cuboot-8xx.c 1000 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Old U-boot compatibility for 8xx
  4. *
  5. * Author: Scott Wood <[email protected]>
  6. *
  7. * Copyright (c) 2007 Freescale Semiconductor, Inc.
  8. */
  9. #include "ops.h"
  10. #include "stdio.h"
  11. #include "cuboot.h"
  12. #define TARGET_8xx
  13. #define TARGET_HAS_ETH1
  14. #include "ppcboot.h"
  15. static bd_t bd;
  16. static void platform_fixups(void)
  17. {
  18. void *node;
  19. dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
  20. dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
  21. dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq);
  22. node = finddevice("/soc/cpm");
  23. if (node)
  24. setprop(node, "clock-frequency", &bd.bi_busfreq, 4);
  25. node = finddevice("/soc/cpm/brg");
  26. if (node)
  27. setprop(node, "clock-frequency", &bd.bi_busfreq, 4);
  28. }
  29. void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
  30. unsigned long r6, unsigned long r7)
  31. {
  32. CUBOOT_INIT();
  33. fdt_init(_dtb_start);
  34. serial_console_init();
  35. platform_ops.fixups = platform_fixups;
  36. }