brcm63xx: add Broadcom cable modem firmware format header
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.9 / 425-bcm933xx_hcs.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -37,6 +37,7 @@
4 #include <pci_rt2x00_fixup.h>
5
6 #include <uapi/linux/bcm963xx_tag.h>
7 +#include <uapi/linux/bcm933xx_hcs.h>
8
9 #define PFX "board_bcm963xx: "
10
11 @@ -45,6 +46,7 @@
12
13 #define CFE_OFFSET_64K 0x10000
14 #define CFE_OFFSET_128K 0x20000
15 +#define HCS_OFFSET_128K 0x20000
16
17 static struct board_info board;
18
19 @@ -782,8 +784,9 @@ void __init board_prom_init(void)
20 unsigned int i;
21 u8 *boot_addr, *cfe;
22 char cfe_version[32];
23 - char *board_name;
24 + char *board_name = NULL;
25 u32 val;
26 + struct bcm_hcs *hcs;
27
28 /* read base address of boot chip select (0)
29 * 6328/6362 do not have MPI but boot from a fixed address
30 @@ -812,9 +815,13 @@ void __init board_prom_init(void)
31 if (strcmp(cfe_version, "unknown") != 0) {
32 /* cfe present */
33 boardid_fixup(boot_addr);
34 +
35 + board_name = bcm63xx_nvram_get_name();
36 + } else if (BCMCPU_IS_3368()) {
37 + hcs = (struct bcm_hcs *)KSEG1ADDR(0x1fc00000 + HCS_OFFSET_128K);
38 + board_name = hcs->filename;
39 }
40
41 - board_name = bcm63xx_nvram_get_name();
42 /* find board by name */
43 for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) {
44 if (strncmp(board_name, bcm963xx_boards[i]->name, 16))
45 --- /dev/null
46 +++ b/include/uapi/linux/bcm933xx_hcs.h
47 @@ -0,0 +1,18 @@
48 +#ifndef __BCM_HCS_H
49 +#define __BCM_HCS_H
50 +
51 +struct bcm_hcs {
52 + uint16_t magic;
53 + uint16_t control;
54 + uint16_t rev_maj;
55 + uint16_t rev_min;
56 + uint32_t build_date;
57 + uint32_t filelen;
58 + uint32_t ldaddress;
59 + char filename[64];
60 + uint16_t hcs;
61 + uint16_t her_znaet_chto;
62 + uint32_t crc;
63 +};
64 +
65 +#endif /* __BCM_HCS */