ep88xc.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Embedded Planet EP88xC with PlanetCore firmware
  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 "planetcore.h"
  12. #include "mpc8xx.h"
  13. static char *table;
  14. static u64 mem_size;
  15. static void platform_fixups(void)
  16. {
  17. u64 val;
  18. dt_fixup_memory(0, mem_size);
  19. planetcore_set_mac_addrs(table);
  20. if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
  21. printf("No PlanetCore crystal frequency key.\r\n");
  22. return;
  23. }
  24. mpc885_fixup_clocks(val);
  25. }
  26. void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
  27. unsigned long r6, unsigned long r7)
  28. {
  29. table = (char *)r3;
  30. planetcore_prepare_table(table);
  31. if (!planetcore_get_decimal(table, PLANETCORE_KEY_MB_RAM, &mem_size))
  32. return;
  33. mem_size *= 1024 * 1024;
  34. simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
  35. fdt_init(_dtb_start);
  36. planetcore_set_stdout_path(table);
  37. serial_console_init();
  38. platform_ops.fixups = platform_fixups;
  39. }