fdt.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright 2008 Freescale Semiconductor, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * Version 2 as published by the Free Software Foundation.
  7. */
  8. #include <common.h>
  9. #include <libfdt.h>
  10. #include <fdt_support.h>
  11. void ft_cpu_setup(void *blob, bd_t *bd)
  12. {
  13. do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
  14. "timebase-frequency", bd->bi_busfreq / 4, 1);
  15. do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
  16. "bus-frequency", bd->bi_busfreq, 1);
  17. do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
  18. "clock-frequency", bd->bi_intfreq, 1);
  19. do_fixup_by_prop_u32(blob, "device_type", "soc", 4,
  20. "bus-frequency", bd->bi_busfreq, 1);
  21. fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
  22. #if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \
  23. || defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
  24. fdt_fixup_ethernet(blob, bd);
  25. #endif
  26. #ifdef CFG_NS16550
  27. do_fixup_by_compat_u32(blob, "ns16550",
  28. "clock-frequency", bd->bi_busfreq, 1);
  29. #endif
  30. }