sead3-setup.c 1012 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
  7. */
  8. #include <linux/init.h>
  9. #include <linux/of_platform.h>
  10. #include <linux/of_fdt.h>
  11. #include <linux/bootmem.h>
  12. #include <asm/prom.h>
  13. #include <asm/mips-boards/generic.h>
  14. const char *get_system_type(void)
  15. {
  16. return "MIPS SEAD3";
  17. }
  18. void __init plat_mem_setup(void)
  19. {
  20. /*
  21. * Load the builtin devicetree. This causes the chosen node to be
  22. * parsed resulting in our memory appearing
  23. */
  24. __dt_setup_arch(&__dtb_start);
  25. }
  26. void __init device_tree_init(void)
  27. {
  28. unsigned long base, size;
  29. if (!initial_boot_params)
  30. return;
  31. base = virt_to_phys((void *)initial_boot_params);
  32. size = be32_to_cpu(initial_boot_params->totalsize);
  33. /* Before we do anything, lets reserve the dt blob */
  34. reserve_bootmem(base, size, BOOTMEM_DEFAULT);
  35. unflatten_device_tree();
  36. }