brcm63xx: move buttons and leds to dts files
[openwrt.git] / target / linux / brcm63xx / patches-3.18 / 511-board_V2500V.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -760,6 +760,27 @@ 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  #endif /* CONFIG_BCM63XX_CPU_6348 */
29  
30  /*
31 @@ -1084,6 +1105,7 @@ static const struct board_info __initcon
32         &board_96348_D4PW,
33         &board_spw500v,
34         &board_96348sv,
35 +       &board_V2500V_BB,
36  #endif
37  
38  #ifdef CONFIG_BCM63XX_CPU_6358
39 @@ -1122,6 +1144,7 @@ static struct of_device_id const bcm963x
40         { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, },
41         { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, },
42         { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, },
43 +       { .compatible = "bt,v2500v-bb", .data = &board_V2500V_BB, },
44         { .compatible = "d-link,dsl-2640b-b", .data = &board_96348_D4PW, },
45         { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, },
46         { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, },
47 @@ -1181,6 +1204,22 @@ void __init board_bcm963xx_init(void)
48                 val &= MPI_CSBASE_BASE_MASK;
49         }
50         boot_addr = (u8 *)KSEG1ADDR(val);
51 +       printk(KERN_INFO PFX "Boot address 0x%08x\n",(unsigned int)boot_addr);
52 +
53 +       /* BT Voyager 2500V (RTA1046VW PCB) has 8 Meg flash used as two */
54 +       /* banks of 4 Meg. The byte at 0xBF800000 identifies the back to use.*/
55 +       /* Loading firmware from the CFE Prompt always loads to Bank 0 */
56 +       /* Do an early check of CFE and then select bank 0 */
57 +
58 +       if (boot_addr == (u8 *)0xbf800000) {
59 +               u8 *tmp_boot_addr = (u8*)0xbfc00000;
60 +
61 +               bcm63xx_nvram_init(tmp_boot_addr + BCM963XX_NVRAM_OFFSET);
62 +               if (!strcmp(bcm63xx_nvram_get_name(), "V2500V_BB")) {
63 +                       printk(KERN_INFO PFX "V2500V: nvram bank 0\n");
64 +                       boot_addr = tmp_boot_addr;
65 +               }
66 +       }
67  
68         /* dump cfe version */
69         cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
70 --- a/arch/mips/bcm63xx/dev-flash.c
71 +++ b/arch/mips/bcm63xx/dev-flash.c
72 @@ -19,6 +19,7 @@
73  #include <linux/spi/spi.h>
74  #include <linux/spi/flash.h>
75  
76 +#include <bcm63xx_board.h>
77  #include <bcm63xx_cpu.h>
78  #include <bcm63xx_dev_flash.h>
79  #include <bcm63xx_dev_hsspi.h>
80 @@ -220,6 +221,13 @@ int __init bcm63xx_flash_register(int nu
81                         val = bcm_mpi_readl(MPI_CSBASE_REG(0));
82                         val &= MPI_CSBASE_BASE_MASK;
83  
84 +                       /* BT Voyager 2500V has 8 Meg flash in two 4 Meg banks */
85 +                       /* Loading from CFE always uses Bank 0 */
86 +                       if (!strcmp(board_get_name(), "V2500V_BB")) {
87 +                               pr_info("V2500V: Start in Bank 0\n");
88 +                               val = val + 0x400000; // Select Bank 0 start address
89 +                       }
90 +
91                         mtd_resources[0].start = val;
92                         mtd_resources[0].end = 0x1FFFFFFF;
93                 }