ep8248e.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Embedded Planet EP8248E with PlanetCore firmware
  4. *
  5. * Author: Scott Wood <scottwood@freescale.com>
  6. *
  7. * Copyright (c) 2007 Freescale Semiconductor, Inc.
  8. */
  9. #include "ops.h"
  10. #include "stdio.h"
  11. #include "planetcore.h"
  12. #include "pq2.h"
  13. static char *table;
  14. static u64 mem_size;
  15. #include <io.h>
  16. static void platform_fixups(void)
  17. {
  18. u64 val;
  19. dt_fixup_memory(0, mem_size);
  20. planetcore_set_mac_addrs(table);
  21. if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
  22. printf("No PlanetCore crystal frequency key.\r\n");
  23. return;
  24. }
  25. pq2_fixup_clocks(val);
  26. }
  27. void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
  28. unsigned long r6, unsigned long r7)
  29. {
  30. table = (char *)r3;
  31. planetcore_prepare_table(table);
  32. if (!planetcore_get_decimal(table, PLANETCORE_KEY_MB_RAM, &mem_size))
  33. return;
  34. mem_size *= 1024 * 1024;
  35. simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
  36. fdt_init(_dtb_start);
  37. planetcore_set_stdout_path(table);
  38. serial_console_init();
  39. platform_ops.fixups = platform_fixups;
  40. }