summaryrefslogtreecommitdiffstats
path: root/board/freescale
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2008-07-08 21:00:04 +0400
committerKim Phillips <kim.phillips@freescale.com>2008-07-16 14:16:44 -0500
commit25f5f0d49a3ae89bf4396f2557ce98debfef21da (patch)
tree49f47bfea3b6bc4b2bd988c34073edd35182cd7e /board/freescale
parent015b27b9e165fcf220e42f2c4afbaeaa2758fcf6 (diff)
downloadtalos-obmc-uboot-25f5f0d49a3ae89bf4396f2557ce98debfef21da.tar.gz
talos-obmc-uboot-25f5f0d49a3ae89bf4396f2557ce98debfef21da.zip
83xx: mpc8315erdb: add support for switching between ULPI/UTMI USB PHYs
Freescale ships MPC8315E-RDB boards either with TSEC1 and USB UTMI support, or without TSEC1 but with USB ULPI PHY support in addition. With this patch user can specify desired USB PHY. Also, it seems that we can't distinguish the two boards in software, so user have to set `mpc8315erdb' environment variable to either 'tsec1' (TSEC1 enabled) or `ulpi' (board with ULPI PHY, TSEC1 disabled), so that Linux will not probe for TSEC1. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Diffstat (limited to 'board/freescale')
-rw-r--r--board/freescale/mpc8315erdb/mpc8315erdb.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/board/freescale/mpc8315erdb/mpc8315erdb.c b/board/freescale/mpc8315erdb/mpc8315erdb.c
index 7af36ddb9b..7555ffbdd6 100644
--- a/board/freescale/mpc8315erdb/mpc8315erdb.c
+++ b/board/freescale/mpc8315erdb/mpc8315erdb.c
@@ -25,9 +25,8 @@
#include <common.h>
#include <i2c.h>
-#if defined(CONFIG_OF_LIBFDT)
#include <libfdt.h>
-#endif
+#include <fdt_support.h>
#include <pci.h>
#include <mpc83xx.h>
@@ -122,11 +121,46 @@ void pci_init_board(void)
}
#if defined(CONFIG_OF_BOARD_SETUP)
+void fdt_tsec1_fixup(void *fdt, bd_t *bd)
+{
+ char *mpc8315erdb = getenv("mpc8315erdb");
+ const char disabled[] = "disabled";
+ const char *path;
+ int ret;
+
+ if (!mpc8315erdb) {
+ if (!strcmp(mpc8315erdb, "tsec1")) {
+ return;
+ } else if (strcmp(mpc8315erdb, "ulpi")) {
+ printf("WARNING: wrong `mpc8315erdb' environment "
+ "variable specified: `%s'. Should be `ulpi' "
+ "or `tsec1'.\n", mpc8315erdb);
+ return;
+ }
+ }
+
+ ret = fdt_path_offset(fdt, "/aliases");
+ if (ret < 0) {
+ printf("WARNING: can't find /aliases node\n");
+ return;
+ }
+
+ path = fdt_getprop(fdt, ret, "ethernet0", NULL);
+ if (!path) {
+ printf("WARNING: can't find ethernet0 alias\n");
+ return;
+ }
+
+ do_fixup_by_path(fdt, path, "status", disabled, sizeof(disabled), 1);
+}
+
void ft_board_setup(void *blob, bd_t *bd)
{
ft_cpu_setup(blob, bd);
#ifdef CONFIG_PCI
ft_pci_setup(blob, bd);
#endif
+ fdt_fixup_dr_usb(blob, bd);
+ fdt_tsec1_fixup(blob, bd);
}
#endif
OpenPOWER on IntegriCloud