aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2013-06-06 22:22:09 +0000
committerFlorian Fainelli <florian@openwrt.org>2013-06-06 22:22:09 +0000
commit25a96c2b766588892a40cb34df0b69b9a4aac459 (patch)
tree4e0e4042ced554194c14b4b285f835dd1eb32be9 /target/linux/brcm63xx
parent370609a4b8281b1af03438a9b10f97c2bdb55bf6 (diff)
downloadmaster-187ad058-25a96c2b766588892a40cb34df0b69b9a4aac459.tar.gz
master-187ad058-25a96c2b766588892a40cb34df0b69b9a4aac459.tar.bz2
master-187ad058-25a96c2b766588892a40cb34df0b69b9a4aac459.zip
brcm63xx: add Broadcom cable modem firmware format header
Signed-off-by: Florian Fainelli <florian@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36875 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx')
-rw-r--r--target/linux/brcm63xx/patches-3.8/425-bcm933xx_hcs.patch65
-rw-r--r--target/linux/brcm63xx/patches-3.9/425-bcm933xx_hcs.patch65
2 files changed, 130 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-3.8/425-bcm933xx_hcs.patch b/target/linux/brcm63xx/patches-3.8/425-bcm933xx_hcs.patch
new file mode 100644
index 0000000000..79533fb64e
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.8/425-bcm933xx_hcs.patch
@@ -0,0 +1,65 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -37,6 +37,7 @@
+ #include <pci_rt2x00_fixup.h>
+
+ #include <uapi/linux/bcm963xx_tag.h>
++#include <uapi/linux/bcm933xx_hcs.h>
+
+ #define PFX "board_bcm963xx: "
+
+@@ -45,6 +46,7 @@
+
+ #define CFE_OFFSET_64K 0x10000
+ #define CFE_OFFSET_128K 0x20000
++#define HCS_OFFSET_128K 0x20000
+
+ static struct board_info board;
+
+@@ -782,8 +784,9 @@ void __init board_prom_init(void)
+ unsigned int i;
+ u8 *boot_addr, *cfe;
+ char cfe_version[32];
+- char *board_name;
++ char *board_name = NULL;
+ u32 val;
++ struct bcm_hcs *hcs;
+
+ /* read base address of boot chip select (0)
+ * 6328/6362 do not have MPI but boot from a fixed address
+@@ -812,9 +815,13 @@ void __init board_prom_init(void)
+ if (strcmp(cfe_version, "unknown") != 0) {
+ /* cfe present */
+ boardid_fixup(boot_addr);
++
++ board_name = bcm63xx_nvram_get_name();
++ } else if (BCMCPU_IS_3368()) {
++ hcs = (struct bcm_hcs *)KSEG1ADDR(0x1fc00000 + HCS_OFFSET_128K);
++ board_name = hcs->filename;
+ }
+
+- board_name = bcm63xx_nvram_get_name();
+ /* find board by name */
+ for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
+ if (strncmp(board_name, bcm963xx_boards[i]->name, 16))
+--- /dev/null
++++ b/include/uapi/linux/bcm933xx_hcs.h
+@@ -0,0 +1,18 @@
++#ifndef __BCM_HCS_H
++#define __BCM_HCS_H
++
++struct bcm_hcs {
++ uint16_t magic;
++ uint16_t control;
++ uint16_t rev_maj;
++ uint16_t rev_min;
++ uint32_t build_date;
++ uint32_t filelen;
++ uint32_t ldaddress;
++ char filename[64];
++ uint16_t hcs;
++ uint16_t her_znaet_chto;
++ uint32_t crc;
++};
++
++#endif /* __BCM_HCS */
diff --git a/target/linux/brcm63xx/patches-3.9/425-bcm933xx_hcs.patch b/target/linux/brcm63xx/patches-3.9/425-bcm933xx_hcs.patch
new file mode 100644
index 0000000000..79533fb64e
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.9/425-bcm933xx_hcs.patch
@@ -0,0 +1,65 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -37,6 +37,7 @@
+ #include <pci_rt2x00_fixup.h>
+
+ #include <uapi/linux/bcm963xx_tag.h>
++#include <uapi/linux/bcm933xx_hcs.h>
+
+ #define PFX "board_bcm963xx: "
+
+@@ -45,6 +46,7 @@
+
+ #define CFE_OFFSET_64K 0x10000
+ #define CFE_OFFSET_128K 0x20000
++#define HCS_OFFSET_128K 0x20000
+
+ static struct board_info board;
+
+@@ -782,8 +784,9 @@ void __init board_prom_init(void)
+ unsigned int i;
+ u8 *boot_addr, *cfe;
+ char cfe_version[32];
+- char *board_name;
++ char *board_name = NULL;
+ u32 val;
++ struct bcm_hcs *hcs;
+
+ /* read base address of boot chip select (0)
+ * 6328/6362 do not have MPI but boot from a fixed address
+@@ -812,9 +815,13 @@ void __init board_prom_init(void)
+ if (strcmp(cfe_version, "unknown") != 0) {
+ /* cfe present */
+ boardid_fixup(boot_addr);
++
++ board_name = bcm63xx_nvram_get_name();
++ } else if (BCMCPU_IS_3368()) {
++ hcs = (struct bcm_hcs *)KSEG1ADDR(0x1fc00000 + HCS_OFFSET_128K);
++ board_name = hcs->filename;
+ }
+
+- board_name = bcm63xx_nvram_get_name();
+ /* find board by name */
+ for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
+ if (strncmp(board_name, bcm963xx_boards[i]->name, 16))
+--- /dev/null
++++ b/include/uapi/linux/bcm933xx_hcs.h
+@@ -0,0 +1,18 @@
++#ifndef __BCM_HCS_H
++#define __BCM_HCS_H
++
++struct bcm_hcs {
++ uint16_t magic;
++ uint16_t control;
++ uint16_t rev_maj;
++ uint16_t rev_min;
++ uint32_t build_date;
++ uint32_t filelen;
++ uint32_t ldaddress;
++ char filename[64];
++ uint16_t hcs;
++ uint16_t her_znaet_chto;
++ uint32_t crc;
++};
++
++#endif /* __BCM_HCS */