1bd713a8201de12bcd63d25d7d3b6f07c26c7caa
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.6 / 511-board_V2500V.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -873,6 +873,63 @@ static struct board_info __initdata boar
4 },
5 },
6 };
7 +
8 +static struct board_info __initdata board_V2500V_BB = {
9 + .name = "V2500V_BB",
10 + .expected_cpu_id = 0x6348,
11 +
12 + .has_uart0 = 1,
13 + .has_enet0 = 1,
14 + .has_enet1 = 1,
15 + .has_pci = 1,
16 +
17 + .enet0 = {
18 + .has_phy = 1,
19 + .use_internal_phy = 1,
20 + },
21 + .enet1 = {
22 + .force_speed_100 = 1,
23 + .force_duplex_full = 1,
24 + },
25 +
26 + .leds = {
27 + {
28 + .name = "V2500V_BB:green:power",
29 + .gpio = 0,
30 + .active_low = 1,
31 + .default_trigger = "default-on",
32 + },
33 + {
34 + .name = "V2500V_BB:red:power",
35 + .gpio = 1,
36 + .active_low = 1,
37 + },
38 + {
39 + .name = "V2500V_BB:green:adsl",
40 + .gpio = 2,
41 + .active_low = 1,
42 + },
43 + { .name = "V2500V_BB:green:ppp",
44 + .gpio = 3,
45 + .active_low = 1,
46 + },
47 + {
48 + .name = "V2500V_BB:green:wireless",
49 + .gpio = 6,
50 + .active_low = 1,
51 + },
52 + },
53 + .buttons = {
54 + {
55 + .desc = "reset",
56 + .gpio = 31,
57 + .active_low = 1,
58 + .type = EV_KEY,
59 + .code = KEY_RESTART,
60 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
61 + },
62 + },
63 +};
64 #endif
65
66 /*
67 @@ -1917,6 +1974,7 @@ static const struct board_info __initdat
68 &board_96348_D4PW,
69 &board_spw500v,
70 &board_96348sv,
71 + &board_V2500V_BB,
72 #endif
73
74 #ifdef CONFIG_BCM63XX_CPU_6358
75 @@ -2037,6 +2095,23 @@ void __init board_prom_init(void)
76 val &= MPI_CSBASE_BASE_MASK;
77 }
78 boot_addr = (u8 *)KSEG1ADDR(val);
79 + printk(KERN_INFO PFX "Boot address 0x%08x\n",(unsigned int)boot_addr);
80 +
81 + /* BT Voyager 2500V (RTA1046VW PCB) has 8 Meg flash used as two */
82 + /* banks of 4 Meg. The byte at 0xBF800000 identifies the back to use.*/
83 + /* Loading firmware from the CFE Prompt always loads to Bank 0 */
84 + /* Do an early check of CFE and then select bank 0 */
85 +
86 + if (boot_addr == (u8 *)0xbf800000) {
87 + unsigned char board_name[16];
88 + u8 *tmp_boot_addr;
89 + tmp_boot_addr = (u8 *)0xbfc00000; // Address of Bank 0
90 + memcpy(board_name, tmp_boot_addr + BCM963XX_NVRAM_OFFSET + offsetof(struct bcm963xx_nvram, name), sizeof(board_name));
91 + if (!strcmp(board_name, "V2500V_BB")) {
92 + printk(KERN_INFO PFX "V2500V: nvram bank 0\n");
93 + boot_addr = (u8 *)0xbfc00000; // Bank 0
94 + }
95 + }
96
97 /* dump cfe version */
98 cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
99 --- a/arch/mips/bcm63xx/dev-flash.c
100 +++ b/arch/mips/bcm63xx/dev-flash.c
101 @@ -19,6 +19,7 @@
102 #include <linux/spi/spi.h>
103 #include <linux/spi/flash.h>
104
105 +#include <bcm63xx_board.h>
106 #include <bcm63xx_cpu.h>
107 #include <bcm63xx_dev_flash.h>
108 #include <bcm63xx_dev_hsspi.h>
109 @@ -162,6 +163,13 @@ int __init bcm63xx_flash_register(int nu
110 val = bcm_mpi_readl(MPI_CSBASE_REG(0));
111 val &= MPI_CSBASE_BASE_MASK;
112
113 + /* BT Voyager 2500V has 8 Meg flash in two 4 Meg banks */
114 + /* Loading from CFE always uses Bank 0 */
115 + if (!strcmp(board_get_name(), "V2500V_BB")) {
116 + pr_info("V2500V: Start in Bank 0\n");
117 + val = val + 0x400000; // Select Bank 0 start address
118 + }
119 +
120 mtd_resources[0].start = val;
121 mtd_resources[0].end = 0x1FFFFFFF;
122