summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorLarry Johnson <lrj@acm.org>2009-01-28 15:30:02 -0500
committerStefan Roese <sr@denx.de>2009-01-29 10:55:56 +0100
commitf20405e31680efc36293c59b4963db57c9d93df4 (patch)
tree30db84f0c8c35ecd4cafa15ec830569bdb66f603 /board
parentc1b7c70083fc8d0bb77db20dd47bb6c988f3dc67 (diff)
downloadu-boot-imx-f20405e31680efc36293c59b4963db57c9d93df4.zip
u-boot-imx-f20405e31680efc36293c59b4963db57c9d93df4.tar.gz
u-boot-imx-f20405e31680efc36293c59b4963db57c9d93df4.tar.bz2
ppc4xx: Add variable "korat_usbcf" for Korat board
The new environment variable "korat_usbcf" selects the USB port used by the Korat board's CompactFlash controller. Signed-off-by: Larry Johnson <lrj@acm.org> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'board')
-rw-r--r--board/korat/korat.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/board/korat/korat.c b/board/korat/korat.c
index 5ad75f7..8328ba3 100644
--- a/board/korat/korat.c
+++ b/board/korat/korat.c
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 2007-2008
+ * (C) Copyright 2007-2009
* Larry Johnson, lrj@acm.org
*
* (C) Copyright 2006-2007
@@ -351,6 +351,7 @@ int misc_init_r(void)
unsigned long sdr0_pfc1;
uint32_t const flash1_size = gd->bd->bi_flashsize - CONFIG_SYS_FLASH0_SIZE;
char const *const act = getenv("usbact");
+ char const *const usbcf = getenv("korat_usbcf");
/*
* Re-do FLASH1 sizing and adjust flash start and offset.
@@ -405,6 +406,26 @@ int misc_init_r(void)
/*
* USB suff...
*/
+ /*
+ * Select the USB controller on the 440EPx ("ppc") or on the PCI bus
+ * ("pci") for the CompactFlash.
+ */
+ if (usbcf != NULL && (strcmp(usbcf, "ppc") == 0)) {
+ /*
+ * If environment variable "usbcf" is defined and set to "ppc",
+ * then connect the CompactFlash controller to the PowerPC USB
+ * port.
+ */
+ printf("Attaching CompactFalsh controller to PPC USB\n");
+ out_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x02,
+ in_8((u8 *) CONFIG_SYS_CPLD_BASE + 0x02) | 0x10);
+ } else {
+ if (usbcf != NULL && (strcmp(usbcf, "pci") != 0))
+ printf("Warning: \"korat_usbcf\" is not set to a legal "
+ "value (\"ppc\" or \"pci\")\n");
+
+ printf("Attaching CompactFalsh controller to PCI USB\n");
+ }
if (act == NULL || strcmp(act, "hostdev") == 0) {
/* SDR Setting */
mfsdr(SDR0_PFC1, sdr0_pfc1);