diff options
Diffstat (limited to 'board/freescale/ls1043ardb/cpld.c')
-rw-r--r-- | board/freescale/ls1043ardb/cpld.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/board/freescale/ls1043ardb/cpld.c b/board/freescale/ls1043ardb/cpld.c index f29383dc301..78c28246a82 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(®5); + + 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 |