diff options
author | Kuldeep Singh <kuldeep.singh@nxp.com> | 2021-08-10 11:20:10 +0530 |
---|---|---|
committer | Priyanka Jain <priyanka.jain@nxp.com> | 2021-08-18 15:55:15 +0530 |
commit | 8ae83cc5af56abe3334dbe48e03407f7ff641c24 (patch) | |
tree | 54292f991feaf583b4755916b72b2d18925606ab /board/freescale | |
parent | 961928397f75a5099740519d79ef594eeec87238 (diff) | |
download | u-boot-8ae83cc5af56abe3334dbe48e03407f7ff641c24.tar.gz |
board: t208x: Extend cs4340_get_fw_addr() functionality
T2080RDB supports booting from 2 nor banks(default and altbank). The
corresponding defconfig can only have one entry defined and therefore,
extend cs4340_get_fw_addr() function to overwrite firmware address which
will be later used in cortina firmware.
Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'board/freescale')
-rw-r--r-- | board/freescale/t208xrdb/t208xrdb.c | 20 | ||||
-rw-r--r-- | board/freescale/t208xrdb/t208xrdb.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/board/freescale/t208xrdb/t208xrdb.c b/board/freescale/t208xrdb/t208xrdb.c index 947dd6aa9f..73ebb4a55b 100644 --- a/board/freescale/t208xrdb/t208xrdb.c +++ b/board/freescale/t208xrdb/t208xrdb.c @@ -165,3 +165,23 @@ int ft_board_setup(void *blob, struct bd_info *bd) return 0; } + +ulong *cs4340_get_fw_addr(void) +{ + ulong cortina_fw_addr = CONFIG_CORTINA_FW_ADDR; + +#ifdef CONFIG_SYS_CORTINA_FW_IN_NOR + u8 reg; + + reg = CPLD_READ(flash_csr); + if (!(reg & CPLD_BOOT_SEL)) { + reg = ((reg & CPLD_LBMAP_MASK) >> CPLD_LBMAP_SHIFT); + if (reg == 0) + cortina_fw_addr = CORTINA_FW_ADDR_IFCNOR; + else if (reg == 4) + cortina_fw_addr = CORTINA_FW_ADDR_IFCNOR_ALTBANK; + } +#endif + + return (ulong *)cortina_fw_addr; +} diff --git a/board/freescale/t208xrdb/t208xrdb.h b/board/freescale/t208xrdb/t208xrdb.h index edbc860c9d..26998898e8 100644 --- a/board/freescale/t208xrdb/t208xrdb.h +++ b/board/freescale/t208xrdb/t208xrdb.h @@ -7,6 +7,9 @@ #ifndef __CORENET_DS_H__ #define __CORENET_DS_H__ +#define CORTINA_FW_ADDR_IFCNOR 0xefe00000 +#define CORTINA_FW_ADDR_IFCNOR_ALTBANK 0xebe00000 + void fdt_fixup_board_enet(void *blob); void pci_of_setup(void *blob, struct bd_info *bd); void fdt_fixup_board_fman_ethernet(void *blob); |