summaryrefslogtreecommitdiff
path: root/board/freescale/p2041rdb/cpld.c
diff options
context:
space:
mode:
authorShaohui Xie <Shaohui.Xie@freescale.com>2011-09-13 17:51:39 +0800
committerKumar Gala <galak@kernel.crashing.org>2011-10-03 08:29:54 -0500
commitba50fee6ae7e626bb2eda9d28403d7d3950f407a (patch)
tree7a6bd82233c3f92e547ba4a0e87170c57ffaa908 /board/freescale/p2041rdb/cpld.c
parentd4b9106609a67617d8cef3bb6bce124974865388 (diff)
downloadu-boot-imx-ba50fee6ae7e626bb2eda9d28403d7d3950f407a.zip
u-boot-imx-ba50fee6ae7e626bb2eda9d28403d7d3950f407a.tar.gz
u-boot-imx-ba50fee6ae7e626bb2eda9d28403d7d3950f407a.tar.bz2
powerpc/p2041rdb: update cpld reset command according to CPLD 2.0
CPLD 2.0 provides a new register which bit[0] is set to '1' will reset board with initializing the CPLD registers to default values. And add bit[6] of register at offset 0x5 to use to enable flash bank selection. Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'board/freescale/p2041rdb/cpld.c')
-rw-r--r--board/freescale/p2041rdb/cpld.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/board/freescale/p2041rdb/cpld.c b/board/freescale/p2041rdb/cpld.c
index 8e1f46e..37b0ed5 100644
--- a/board/freescale/p2041rdb/cpld.c
+++ b/board/freescale/p2041rdb/cpld.c
@@ -53,7 +53,11 @@ void cpld_reset(void) __attribute__((weak, alias("__cpld_reset")));
*/
void __cpld_set_altbank(void)
{
+ u8 reg5 = CPLD_READ(sw_ctl_on);
+
+ CPLD_WRITE(sw_ctl_on, reg5 | CPLD_SWITCH_BANK_ENABLE);
CPLD_WRITE(fbank_sel, 1);
+ CPLD_WRITE(system_rst, 1);
}
void cpld_set_altbank(void)
__attribute__((weak, alias("__cpld_set_altbank")));
@@ -61,12 +65,12 @@ void cpld_set_altbank(void)
/**
* Set the boot bank to the default bank
*/
-void __cpld_clear_altbank(void)
+void __cpld_set_defbank(void)
{
- CPLD_WRITE(fbank_sel, 0);
+ CPLD_WRITE(system_rst_default, 1);
}
-void cpld_clear_altbank(void)
- __attribute__((weak, alias("__cpld_clear_altbank")));
+void cpld_set_defbank(void)
+ __attribute__((weak, alias("__cpld_set_defbank")));
#ifdef DEBUG
static void cpld_dump_regs(void)
@@ -101,9 +105,7 @@ int cpld_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (strcmp(argv[2], "altbank") == 0)
cpld_set_altbank();
else
- cpld_clear_altbank();
-
- cpld_reset();
+ cpld_set_defbank();
} else if (strcmp(argv[1], "watchdog") == 0) {
static char *period[8] = {"1ms", "10ms", "30ms", "disable",
"100ms", "1s", "10s", "60s"};