add support for BT Voyager 2500 (#9070)
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-2.6.37 / 454-board_V2500V.patch
1 Index: b/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 ===================================================================
3 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c 2011-03-21 08:29:36.500387994 +0000
4 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c 2011-03-31 12:35:08.209787004 +0100
5 @@ -845,6 +845,63 @@
6 },
7 };
8
9 + static struct board_info __initdata board_V2500V_BB = {
10 + .name = "V2500V_BB",
11 + .expected_cpu_id = 0x6348,
12 +
13 + .has_uart0 = 1,
14 + .has_enet0 = 1,
15 + .has_enet1 = 1,
16 + .has_pci = 1,
17 +
18 + .enet0 = {
19 + .has_phy = 1,
20 + .use_internal_phy = 1,
21 + },
22 + .enet1 = {
23 + .force_speed_100 = 1,
24 + .force_duplex_full = 1,
25 + },
26 +
27 + .leds = {
28 + {
29 + .name = "power:green",
30 + .gpio = 0,
31 + .active_low = 1,
32 + .default_trigger = "default-on",
33 + },
34 + {
35 + .name = "power:red",
36 + .gpio = 1,
37 + .active_low = 1,
38 + },
39 + {
40 + .name = "adsl",
41 + .gpio = 2,
42 + .active_low = 1,
43 + },
44 + { .name = "ppp",
45 + .gpio = 3,
46 + .active_low = 1,
47 + },
48 + {
49 + .name = "wireless",
50 + .gpio = 6,
51 + .active_low = 1,
52 + },
53 + },
54 + .buttons = {
55 + {
56 + .desc = "reset",
57 + .gpio = 31,
58 + .active_low = 1,
59 + .type = EV_KEY,
60 + .code = KEY_RESTART,
61 + .threshold = 3,
62 + },
63 + },
64 +};
65 +
66 #endif
67
68 /*
69 @@ -1830,6 +1887,7 @@
70 &board_spw500v,
71 &board_ct536_ct5621,
72 &board_96348sv,
73 + &board_V2500V_BB,
74 #endif
75
76 #ifdef CONFIG_BCM63XX_CPU_6358
77 @@ -1977,6 +2035,22 @@
78 val &= MPI_CSBASE_BASE_MASK;
79 }
80 boot_addr = (u8 *)KSEG1ADDR(val);
81 + printk(KERN_INFO PFX "Boot address 0x%08x\n",(unsigned int)boot_addr);
82 +
83 + /* BT Voyager 2500V (RTA1046VW PCB) has 8 Meg flash used as two */
84 + /* banks of 4 Meg. The byte at 0xBF800000 identifies the back to use.*/
85 + /* Loading firmware from the CFE Prompt always loads to Bank 0 */
86 + /* Do an early check of CFE and then select bank 0 */
87 +
88 + if (boot_addr == (u8 *)0xbf800000) {
89 + u8 *tmp_boot_addr;
90 + tmp_boot_addr = (u8 *)0xbfc00000; // Address of Bank 0
91 + memcpy(&nvram, tmp_boot_addr + BCM963XX_NVRAM_OFFSET, sizeof(nvram));
92 + if (!strcmp(nvram.name, "V2500V_BB")) {
93 + printk(KERN_INFO PFX "V2500V: nvram bank 0\n");
94 + boot_addr = (u8 *)0xbfc00000; // Bank 0
95 + }
96 + }
97
98 /* dump cfe version */
99 cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
100 @@ -2184,6 +2258,14 @@
101 val = bcm_mpi_readl(MPI_CSBASE_REG(0));
102 val &= MPI_CSBASE_BASE_MASK;
103 }
104 +
105 + /* BT Voyager 2500V has 8 Meg flash in two 4 Meg banks */
106 + /* Loading from CFE always uses Bank 0 */
107 + if (!strcmp(board.name, "V2500V_BB")) {
108 + printk(KERN_INFO PFX "V2500V: Start in Bank 0\n");
109 + val = val + 0x400000; // Select Bank 0 start address
110 + }
111 +
112 mtd_resources[0].start = val;
113 mtd_resources[0].end = 0x1FFFFFFF;
114