1 From f3b3faafe7b5a1c07b12d18e96c36bc8a0eecaed Mon Sep 17 00:00:00 2001
2 From: Florian Fainelli <florian@openwrt.org>
3 Date: Tue, 18 Jun 2013 16:55:41 +0000
4 Subject: [PATCH 3/6] MIPS: BCM63XX: recognize Cable Modem firmware format
6 Add the firmware header format which is used by Broadcom Cable Modem
7 SoCs such as the BCM3368 SoC. We export the bcm_hcs firmware format
8 structure because it is used by user-land tools to create firmware
9 images for these SoCs and will later be used by a corresponding MTD
12 Signed-off-by: Florian Fainelli <florian@openwrt.org>
13 Cc: linux-mips@linux-mips.org
14 Cc: cernekee@gmail.com
16 Patchwork: https://patchwork.linux-mips.org/patch/5496/
17 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
19 arch/mips/bcm63xx/boards/board_bcm963xx.c | 14 ++++++++++++--
20 include/uapi/linux/Kbuild | 1 +
21 include/uapi/linux/bcm933xx_hcs.h | 24 ++++++++++++++++++++++++
22 3 files changed, 37 insertions(+), 2 deletions(-)
23 create mode 100644 include/uapi/linux/bcm933xx_hcs.h
25 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
26 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
28 #include <bcm63xx_dev_usb_usbd.h>
29 #include <board_bcm963xx.h>
31 +#include <uapi/linux/bcm933xx_hcs.h>
33 #define PFX "board_bcm963xx: "
35 +#define HCS_OFFSET_128K 0x20000
37 static struct board_info board;
40 @@ -722,8 +726,9 @@ void __init board_prom_init(void)
45 + char *board_name = NULL;
47 + struct bcm_hcs *hcs;
49 /* read base address of boot chip select (0)
50 * 6328/6362 do not have MPI but boot from a fixed address
51 @@ -747,7 +752,12 @@ void __init board_prom_init(void)
53 bcm63xx_nvram_init(boot_addr + BCM963XX_NVRAM_OFFSET);
55 - board_name = bcm63xx_nvram_get_name();
56 + if (BCMCPU_IS_3368()) {
57 + hcs = (struct bcm_hcs *)boot_addr;
58 + board_name = hcs->filename;
60 + board_name = bcm63xx_nvram_get_name();
62 /* find board by name */
63 for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
64 if (strncmp(board_name, bcm963xx_boards[i]->name, 16))
65 --- a/include/uapi/linux/Kbuild
66 +++ b/include/uapi/linux/Kbuild
67 @@ -62,6 +62,7 @@ header-y += auxvec.h
71 +header-y += bcm933xx_hcs.h
76 +++ b/include/uapi/linux/bcm933xx_hcs.h
79 + * Broadcom Cable Modem firmware format
82 +#ifndef __BCM933XX_HCS_H
83 +#define __BCM933XX_HCS_H
85 +#include <linux/types.h>
97 + __u16 her_znaet_chto;
101 +#endif /* __BCM933XX_HCS */