brcm63xx: convert BTV2500V to dts
[openwrt/svn-archive/archive.git] / target / linux / brcm63xx / patches-3.14 / 511-board_V2500V.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -935,6 +935,65 @@ 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 + .has_phy = 1,
23 + .phy_id = 0,
24 + .force_speed_100 = 1,
25 + .force_duplex_full = 1,
26 + },
27 +
28 + .leds = {
29 + {
30 + .name = "V2500V_BB:green:power",
31 + .gpio = 0,
32 + .active_low = 1,
33 + .default_trigger = "default-on",
34 + },
35 + {
36 + .name = "V2500V_BB:red:power",
37 + .gpio = 1,
38 + .active_low = 1,
39 + },
40 + {
41 + .name = "V2500V_BB:green:adsl",
42 + .gpio = 2,
43 + .active_low = 1,
44 + },
45 + { .name = "V2500V_BB:green:ppp",
46 + .gpio = 3,
47 + .active_low = 1,
48 + },
49 + {
50 + .name = "V2500V_BB:green:wireless",
51 + .gpio = 6,
52 + .active_low = 1,
53 + },
54 + },
55 + .buttons = {
56 + {
57 + .desc = "reset",
58 + .gpio = 31,
59 + .active_low = 1,
60 + .type = EV_KEY,
61 + .code = KEY_RESTART,
62 + .debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
63 + },
64 + },
65 +};
66 #endif /* CONFIG_BCM63XX_CPU_6348 */
67
68 /*
69 @@ -1675,6 +1734,7 @@ static const struct board_info __initcon
70 &board_96348_D4PW,
71 &board_spw500v,
72 &board_96348sv,
73 + &board_V2500V_BB,
74 #endif
75
76 #ifdef CONFIG_BCM63XX_CPU_6358
77 @@ -1713,6 +1773,7 @@ static struct of_device_id const bcm963x
78 { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, },
79 { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, },
80 { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, },
81 + { .compatible = "bt,v2500v-bb", .data = &board_V2500V_BB, },
82 { .compatible = "d-link,dsl-2640b-b", .data = &board_96348_D4PW, },
83 { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, },
84 { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, },
85 @@ -1772,6 +1833,22 @@ void __init board_bcm963xx_init(void)
86 val &= MPI_CSBASE_BASE_MASK;
87 }
88 boot_addr = (u8 *)KSEG1ADDR(val);
89 + printk(KERN_INFO PFX "Boot address 0x%08x\n",(unsigned int)boot_addr);
90 +
91 + /* BT Voyager 2500V (RTA1046VW PCB) has 8 Meg flash used as two */
92 + /* banks of 4 Meg. The byte at 0xBF800000 identifies the back to use.*/
93 + /* Loading firmware from the CFE Prompt always loads to Bank 0 */
94 + /* Do an early check of CFE and then select bank 0 */
95 +
96 + if (boot_addr == (u8 *)0xbf800000) {
97 + u8 *tmp_boot_addr = (u8*)0xbfc00000;
98 +
99 + bcm63xx_nvram_init(tmp_boot_addr + BCM963XX_NVRAM_OFFSET);
100 + if (!strcmp(bcm63xx_nvram_get_name(), "V2500V_BB")) {
101 + printk(KERN_INFO PFX "V2500V: nvram bank 0\n");
102 + boot_addr = tmp_boot_addr;
103 + }
104 + }
105
106 /* dump cfe version */
107 cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
108 --- a/arch/mips/bcm63xx/dev-flash.c
109 +++ b/arch/mips/bcm63xx/dev-flash.c
110 @@ -19,6 +19,7 @@
111 #include <linux/spi/spi.h>
112 #include <linux/spi/flash.h>
113
114 +#include <bcm63xx_board.h>
115 #include <bcm63xx_cpu.h>
116 #include <bcm63xx_dev_flash.h>
117 #include <bcm63xx_dev_hsspi.h>
118 @@ -220,6 +221,13 @@ int __init bcm63xx_flash_register(int nu
119 val = bcm_mpi_readl(MPI_CSBASE_REG(0));
120 val &= MPI_CSBASE_BASE_MASK;
121
122 + /* BT Voyager 2500V has 8 Meg flash in two 4 Meg banks */
123 + /* Loading from CFE always uses Bank 0 */
124 + if (!strcmp(board_get_name(), "V2500V_BB")) {
125 + pr_info("V2500V: Start in Bank 0\n");
126 + val = val + 0x400000; // Select Bank 0 start address
127 + }
128 +
129 mtd_resources[0].start = val;
130 mtd_resources[0].end = 0x1FFFFFFF;
131 }