cuboot-824x.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Old U-boot compatibility for 824x
  3. *
  4. * Copyright (c) 2007 Freescale Semiconductor, Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published
  8. * by the Free Software Foundation.
  9. */
  10. #include "ops.h"
  11. #include "stdio.h"
  12. #include "cuboot.h"
  13. #define TARGET_824x
  14. #include "ppcboot.h"
  15. static bd_t bd;
  16. static void platform_fixups(void)
  17. {
  18. void *soc;
  19. dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
  20. dt_fixup_mac_addresses(bd.bi_enetaddr);
  21. dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
  22. soc = find_node_by_devtype(NULL, "soc");
  23. if (soc) {
  24. void *serial = NULL;
  25. setprop(soc, "bus-frequency", &bd.bi_busfreq,
  26. sizeof(bd.bi_busfreq));
  27. while ((serial = find_node_by_devtype(serial, "serial"))) {
  28. if (get_parent(serial) != soc)
  29. continue;
  30. setprop(serial, "clock-frequency", &bd.bi_busfreq,
  31. sizeof(bd.bi_busfreq));
  32. }
  33. }
  34. }
  35. void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
  36. unsigned long r6, unsigned long r7)
  37. {
  38. CUBOOT_INIT();
  39. fdt_init(_dtb_start);
  40. serial_console_init();
  41. platform_ops.fixups = platform_fixups;
  42. }