diff options
author | Kim Phillips <kim.phillips@freescale.com> | 2008-08-25 17:02:10 -0500 |
---|---|---|
committer | Kim Phillips <kim.phillips@freescale.com> | 2008-08-25 17:02:10 -0500 |
commit | ce0eb70333331da6942167c41e6841c8c7994a33 (patch) | |
tree | 225f0feda257a0c63f6226a421abf8873254a374 /board | |
parent | a49d10cf027d059ee15c262010a05cdaec0961e1 (diff) | |
parent | 021f6df6e96af5b387810cf96d24848da1faa55c (diff) | |
download | u-boot-ce0eb70333331da6942167c41e6841c8c7994a33.zip u-boot-ce0eb70333331da6942167c41e6841c8c7994a33.tar.gz u-boot-ce0eb70333331da6942167c41e6841c8c7994a33.tar.bz2 |
Merge branch 'next'
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/mpc8315erdb/mpc8315erdb.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/board/freescale/mpc8315erdb/mpc8315erdb.c b/board/freescale/mpc8315erdb/mpc8315erdb.c index 7af36dd..3eecee2 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,47 @@ 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) + return; + + 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 |