diff options
author | Gerald Van Baren <vanbaren@cideas.com> | 2008-06-03 20:24:58 -0400 |
---|---|---|
committer | Gerald Van Baren <vanbaren@cideas.com> | 2008-06-09 21:13:24 -0400 |
commit | 589c04271d129729a8b01391453851ab9cc4069c (patch) | |
tree | 106f54e754f84a6c08abc984ab49e4bedcdef546 /cpu/74xx_7xx | |
parent | 8155efbd7ae9c65564ca98affe94631d612ae088 (diff) | |
download | u-boot-imx-589c04271d129729a8b01391453851ab9cc4069c.zip u-boot-imx-589c04271d129729a8b01391453851ab9cc4069c.tar.gz u-boot-imx-589c04271d129729a8b01391453851ab9cc4069c.tar.bz2 |
Convert mpc7448hpc2 to CONFIG_OF_LIBFDT
This was configured to use the deprecated CONFIG_OF_FLAT_TREE, change
to CONFIG_OF_LIBFDT.
WARNING: This conversion is untested because I do not have a board to
test it on.
NOTE: The FDT blob (DTS) must have an /aliases/ethernet0 and (optionally)
/aliases/ethernet1 property for the ethernet to work.
Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
Diffstat (limited to 'cpu/74xx_7xx')
-rw-r--r-- | cpu/74xx_7xx/cpu.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/cpu/74xx_7xx/cpu.c b/cpu/74xx_7xx/cpu.c index 9c8998b..a6e3426 100644 --- a/cpu/74xx_7xx/cpu.c +++ b/cpu/74xx_7xx/cpu.c @@ -44,6 +44,11 @@ #include <74xx_7xx.h> #include <asm/cache.h> +#if defined(CONFIG_OF_LIBFDT) +#include <libfdt.h> +#include <fdt_support.h> +#endif + #if defined(CONFIG_OF_FLAT_TREE) #include <ft_build.h> #endif @@ -301,29 +306,19 @@ watchdog_reset(void) /* ------------------------------------------------------------------------- */ -#ifdef CONFIG_OF_FLAT_TREE -void -ft_cpu_setup (void *blob, bd_t *bd) +#ifdef CONFIG_OF_LIBFDT +void ft_cpu_setup(void *blob, bd_t *bd) { - u32 *p; - ulong clock; - int len; - - clock = bd->bi_busfreq; + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "timebase-frequency", bd->bi_busfreq / 4, 1); + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "bus-frequency", bd->bi_busfreq, 1); + do_fixup_by_prop_u32(blob, "device_type", "cpu", 4, + "clock-frequency", bd->bi_intfreq, 1); - p = ft_get_prop (blob, "/cpus/" OF_CPU "/bus-frequency", &len); - if (p != NULL) - *p = cpu_to_be32 (clock); + fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize); -#if defined(CONFIG_TSI108_ETH) - p = ft_get_prop (blob, "/" OF_TSI "/ethernet@6200/address", &len); - memcpy (p, bd->bi_enetaddr, 6); -#endif - -#if defined(CONFIG_HAS_ETH1) - p = ft_get_prop (blob, "/" OF_TSI "/ethernet@6600/address", &len); - memcpy (p, bd->bi_enet1addr, 6); -#endif + fdt_fixup_ethernet(blob, bd); } #endif /* ------------------------------------------------------------------------- */ |