39728c45e45b99bf2ac047c1c7348b361d5de188
[openwrt/staging/ldir.git] / target / linux / bcm63xx / patches-5.15 / 531-board_bcm6348-bt-voyager-2500v-bb.patch
1 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
2 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
3 @@ -3230,6 +3230,22 @@ void __init board_bcm963xx_init(void)
4 val &= MPI_CSBASE_BASE_MASK;
5 }
6 boot_addr = (u8 *)KSEG1ADDR(val);
7 + pr_info("Boot address 0x%08x\n",(unsigned int)boot_addr);
8 +
9 + /* BT Voyager 2500V (RTA1046VW PCB) has 8 Meg flash used as two */
10 + /* banks of 4 Meg. The byte at 0xBF800000 identifies the back to use.*/
11 + /* Loading firmware from the CFE Prompt always loads to Bank 0 */
12 + /* Do an early check of CFE and then select bank 0 */
13 +
14 + if (boot_addr == (u8 *)0xbf800000) {
15 + u8 *tmp_boot_addr = (u8*)0xbfc00000;
16 +
17 + bcm63xx_nvram_init(tmp_boot_addr + BCM963XX_NVRAM_OFFSET);
18 + if (!strcmp(bcm63xx_nvram_get_name(), "V2500V_BB")) {
19 + pr_info("V2500V: nvram bank 0\n");
20 + boot_addr = tmp_boot_addr;
21 + }
22 + }
23
24 /* dump cfe version */
25 cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET;
26 --- a/arch/mips/bcm63xx/dev-flash.c
27 +++ b/arch/mips/bcm63xx/dev-flash.c
28 @@ -21,6 +21,7 @@
29 #include <linux/spi/spi.h>
30 #include <linux/spi/flash.h>
31
32 +#include <bcm63xx_board.h>
33 #include <bcm63xx_cpu.h>
34 #include <bcm63xx_dev_flash.h>
35 #include <bcm63xx_regs.h>
36 @@ -256,6 +257,13 @@ int __init bcm63xx_flash_register(void)
37 val = bcm_mpi_readl(MPI_CSBASE_REG(0));
38 val &= MPI_CSBASE_BASE_MASK;
39
40 + /* BT Voyager 2500V has 8 Meg flash in two 4 Meg banks */
41 + /* Loading from CFE always uses Bank 0 */
42 + if (!strcmp(board_get_name(), "V2500V_BB")) {
43 + pr_info("V2500V: Start in Bank 0\n");
44 + val = val + 0x400000; // Select Bank 0 start address
45 + }
46 +
47 mtd_resources[0].start = val;
48 mtd_resources[0].end = 0x1FFFFFFF;
49 }