]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: t208x: Extend cs4340_get_fw_addr() functionality
authorKuldeep Singh <kuldeep.singh@nxp.com>
Tue, 10 Aug 2021 05:50:10 +0000 (11:20 +0530)
committerPriyanka Jain <priyanka.jain@nxp.com>
Wed, 18 Aug 2021 10:25:15 +0000 (15:55 +0530)
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>
board/freescale/t208xrdb/t208xrdb.c
board/freescale/t208xrdb/t208xrdb.h

index 947dd6aa9f3aa5cefeb2e49ec7d43ffd78a7352b..73ebb4a55bfe87b2198df62f7d515cf5678a8737 100644 (file)
@@ -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;
+}
index edbc860c9d02e13a036f17e7b1cf10d3538d187e..26998898e826da7b9c7a2cb8bd3f858bad5e3bde 100644 (file)
@@ -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);