46909b073771c9f07965fed2550ce9359e510f8d
[openwrt/openwrt.git] / target / linux / brcm63xx / patches-4.9 / 511-board_V2500V.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -483,6 +483,26 @@ static struct board_info __initdata boar
4 .ext_irq = 2,
5 },
6 };
7 +
8 +static struct board_info __initdata board_V2500V_BB = {
9 + .name = "V2500V_BB",
10 + .expected_cpu_id = 0x6348,
11 +
12 + .has_enet0 = 1,
13 + .has_enet1 = 1,
14 + .has_pci = 1,
15 +
16 + .enet0 = {
17 + .has_phy = 1,
18 + .use_internal_phy = 1,
19 + },
20 + .enet1 = {
21 + .has_phy = 1,
22 + .phy_id = 0,
23 + .force_speed_100 = 1,
24 + .force_duplex_full = 1,
25 + },
26 +};
27 #endif /* CONFIG_BCM63XX_CPU_6348 */
28
29 /*
30 @@ -755,6 +775,7 @@ static const struct board_info __initcon
31 &board_96348_D4PW,
32 &board_spw500v,
33 &board_96348sv,
34 + &board_V2500V_BB,
35 #endif
36
37 #ifdef CONFIG_BCM63XX_CPU_6358
38 @@ -794,6 +815,7 @@ static struct of_device_id const bcm963x
39 { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, },
40 { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, },
41 { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, },
42 + { .compatible = "bt,v2500v-bb", .data = &board_V2500V_BB, },
43 { .compatible = "d-link,dsl-2640b-b", .data = &board_96348_D4PW, },
44 { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, },
45 { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, },
46 @@ -853,6 +875,22 @@ void __init board_bcm963xx_init(void)
47 val &= MPI_CSBASE_BASE_MASK;
48 }
49 boot_addr = (u8 *)KSEG1ADDR(val);
50 + pr_info("Boot address 0x%08x\n",(unsigned int)boot_addr);
51 +
52 + /* BT Voyager 2500V (RTA1046VW PCB) has 8 Meg flash used as two */
53 + /* banks of 4 Meg. The byte at 0xBF800000 identifies the back to use.*/
54 + /* Loading firmware from the CFE Prompt always loads to Bank 0 */
55 + /* Do an early check of CFE and then select bank 0 */
56 +
57 + if (boot_addr == (u8 *)0xbf800000) {
58 + u8 *tmp_boot_addr = (u8*)0xbfc00000;
59 +
60 + bcm63xx_nvram_init(tmp_boot_addr + BCM963XX_NVRAM_OFFSET);
61 + if (!strcmp(bcm63xx_nvram_get_name(), "V2500V_BB")) {
62 + pr_info("V2500V: nvram bank 0\n");
63 + boot_addr = tmp_boot_addr;
64 + }
65 + }
66
67 /* dump cfe version */
68 cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
69 --- a/arch/mips/bcm63xx/dev-flash.c
70 +++ b/arch/mips/bcm63xx/dev-flash.c
71 @@ -21,6 +21,7 @@
72 #include <linux/spi/spi.h>
73 #include <linux/spi/flash.h>
74
75 +#include <bcm63xx_board.h>
76 #include <bcm63xx_cpu.h>
77 #include <bcm63xx_dev_flash.h>
78 #include <bcm63xx_regs.h>
79 @@ -247,6 +248,13 @@ int __init bcm63xx_flash_register(void)
80 val = bcm_mpi_readl(MPI_CSBASE_REG(0));
81 val &= MPI_CSBASE_BASE_MASK;
82
83 + /* BT Voyager 2500V has 8 Meg flash in two 4 Meg banks */
84 + /* Loading from CFE always uses Bank 0 */
85 + if (!strcmp(board_get_name(), "V2500V_BB")) {
86 + pr_info("V2500V: Start in Bank 0\n");
87 + val = val + 0x400000; // Select Bank 0 start address
88 + }
89 +
90 mtd_resources[0].start = val;
91 mtd_resources[0].end = 0x1FFFFFFF;
92 }