sead3-setup.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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/mips-boards/generic.h>
  13. #include <asm/prom.h>
  14. int coherentio; /* 0 => no DMA cache coherency (may be set by user) */
  15. int hw_coherentio; /* 0 => no HW DMA cache coherency (reflects real HW) */
  16. const char *get_system_type(void)
  17. {
  18. return "MIPS SEAD3";
  19. }
  20. void __init plat_mem_setup(void)
  21. {
  22. /*
  23. * Load the builtin devicetree. This causes the chosen node to be
  24. * parsed resulting in our memory appearing
  25. */
  26. __dt_setup_arch(&__dtb_start);
  27. }
  28. void __init device_tree_init(void)
  29. {
  30. unsigned long base, size;
  31. if (!initial_boot_params)
  32. return;
  33. base = virt_to_phys((void *)initial_boot_params);
  34. size = be32_to_cpu(initial_boot_params->totalsize);
  35. /* Before we do anything, lets reserve the dt blob */
  36. reserve_bootmem(base, size, BOOTMEM_DEFAULT);
  37. unflatten_device_tree();
  38. }