summaryrefslogtreecommitdiff
path: root/board/freescale/ls1043ardb/cpld.c
diff options
context:
space:
mode:
authorGong Qianyu <Qianyu.Gong@freescale.com>2015-10-26 19:47:56 +0800
committerYork Sun <yorksun@freescale.com>2015-10-29 10:34:02 -0700
commitc7ca8b07fcdd9af739fa3b1bfabe05d0da36c556 (patch)
treec7fb27284b1aee3e208596d4bff2a57d21916aa6 /board/freescale/ls1043ardb/cpld.c
parent8ef0d5c43841bccc9112e160e96d6498aa94871b (diff)
downloadu-boot-imx-c7ca8b07fcdd9af739fa3b1bfabe05d0da36c556.zip
u-boot-imx-c7ca8b07fcdd9af739fa3b1bfabe05d0da36c556.tar.gz
u-boot-imx-c7ca8b07fcdd9af739fa3b1bfabe05d0da36c556.tar.bz2
armv8/ls1043ardb: Add sd boot support
Signed-off-by: Gong Qianyu <Qianyu.Gong@freescale.com> Reviewed-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'board/freescale/ls1043ardb/cpld.c')
-rw-r--r--board/freescale/ls1043ardb/cpld.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/board/freescale/ls1043ardb/cpld.c b/board/freescale/ls1043ardb/cpld.c
index f29383d..78c2824 100644
--- a/board/freescale/ls1043ardb/cpld.c
+++ b/board/freescale/ls1043ardb/cpld.c
@@ -61,6 +61,21 @@ void cpld_set_nand(void)
CPLD_WRITE(system_rst, 1);
}
+void cpld_set_sd(void)
+{
+ u16 reg = CPLD_CFG_RCW_SRC_SD;
+ u8 reg5 = (u8)(reg >> 1);
+ u8 reg6 = (u8)(reg & 1);
+
+ cpld_rev_bit(&reg5);
+
+ CPLD_WRITE(soft_mux_on, 1);
+
+ CPLD_WRITE(cfg_rcw_src1, reg5);
+ CPLD_WRITE(cfg_rcw_src2, reg6);
+
+ CPLD_WRITE(system_rst, 1);
+}
#ifdef DEBUG
static void cpld_dump_regs(void)
{
@@ -109,6 +124,8 @@ int do_cpld(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
cpld_set_altbank();
else if (strcmp(argv[2], "nand") == 0)
cpld_set_nand();
+ else if (strcmp(argv[2], "sd") == 0)
+ cpld_set_sd();
else
cpld_set_defbank();
#ifdef DEBUG
@@ -128,6 +145,7 @@ U_BOOT_CMD(
"reset: reset to default bank\n"
"cpld reset altbank: reset to alternate bank\n"
"cpld reset nand: reset to boot from NAND flash\n"
+ "cpld reset sd: reset to boot from SD card\n"
#ifdef DEBUG
"cpld dump - display the CPLD registers\n"
#endif