summaryrefslogtreecommitdiff
path: root/board/freescale/ls1043ardb/ls1043ardb.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-10-24 21:28:47 -0400
committerTom Rini <trini@konsulko.com>2022-10-24 21:28:47 -0400
commit3eebbd866bfa8e889e52d1734b574a585e076a5a (patch)
tree5ba4d5966dd2589cc21728c502f56549de1c7d57 /board/freescale/ls1043ardb/ls1043ardb.c
parent26bfb853cae5c05950f8716e6f405eb0f9588d97 (diff)
parentc4f0de3eecd951cd5480cdbc9d96c63a4432a521 (diff)
downloadu-boot-3eebbd866bfa8e889e52d1734b574a585e076a5a.tar.gz
u-boot-3eebbd866bfa8e889e52d1734b574a585e076a5a.tar.bz2
u-boot-3eebbd866bfa8e889e52d1734b574a585e076a5a.zip
Merge tag 'fsl-qoriq-2022-10-18' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq
Layerscape update - support sysreset, - de-select FSL_IFC when booting from SD - disable unused parts of ICID tables - reduce ns_dev size for csu - enable dma snooping for ls104x - nand driver fixups for ls1043ardb rev 7.0 boards.
Diffstat (limited to 'board/freescale/ls1043ardb/ls1043ardb.c')
-rw-r--r--board/freescale/ls1043ardb/ls1043ardb.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/board/freescale/ls1043ardb/ls1043ardb.c b/board/freescale/ls1043ardb/ls1043ardb.c
index f388eb496f..8c91f0771f 100644
--- a/board/freescale/ls1043ardb/ls1043ardb.c
+++ b/board/freescale/ls1043ardb/ls1043ardb.c
@@ -167,7 +167,7 @@ int checkboard(void)
if (cfg_rcw_src == 0x25)
printf("vBank %d\n", CPLD_READ(vbank));
- else if (cfg_rcw_src == 0x106)
+ else if ((cfg_rcw_src == 0x106) || (cfg_rcw_src == 0x118))
puts("NAND\n");
else
printf("Invalid setting of SW4\n");
@@ -347,10 +347,54 @@ int ft_board_setup(void *blob, struct bd_info *bd)
return 0;
}
+void nand_fixup(void)
+{
+ u32 csor = 0;
+
+ if (CPLD_READ(pcba_ver) < 0x7)
+ return;
+
+ /* Change NAND Flash PGS/SPRZ configuration */
+ csor = CONFIG_SYS_NAND_CSOR;
+ if ((csor & CSOR_NAND_PGS_MASK) == CSOR_NAND_PGS_2K)
+ csor = (csor & ~(CSOR_NAND_PGS_MASK)) | CSOR_NAND_PGS_4K;
+
+ if ((csor & CSOR_NAND_SPRZ_MASK) == CSOR_NAND_SPRZ_64)
+ csor = (csor & ~(CSOR_NAND_SPRZ_MASK)) | CSOR_NAND_SPRZ_224;
+
+ if (IS_ENABLED(CONFIG_TFABOOT)) {
+ u8 cfg_rcw_src1, cfg_rcw_src2;
+ u16 cfg_rcw_src;
+
+ cfg_rcw_src1 = CPLD_READ(cfg_rcw_src1);
+ cfg_rcw_src2 = CPLD_READ(cfg_rcw_src2);
+ cpld_rev_bit(&cfg_rcw_src1);
+ cfg_rcw_src = cfg_rcw_src1;
+ cfg_rcw_src = (cfg_rcw_src << 1) | cfg_rcw_src2;
+
+ if (cfg_rcw_src == 0x25)
+ set_ifc_csor(IFC_CS1, csor);
+ else if (cfg_rcw_src == 0x118)
+ set_ifc_csor(IFC_CS0, csor);
+ else
+ printf("Invalid setting\n");
+ } else {
+ if (IS_ENABLED(CONFIG_NAND_BOOT))
+ set_ifc_csor(IFC_CS0, csor);
+ else
+ set_ifc_csor(IFC_CS1, csor);
+ }
+}
+
#if IS_ENABLED(CONFIG_OF_BOARD_FIXUP)
int board_fix_fdt(void *blob)
{
+ /* nand driver fix up */
+ nand_fixup();
+
+ /* fdt fix up */
fdt_fixup_phy_addr(blob);
+
return 0;
}
#endif