init.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Xilfpga platform setup
  3. *
  4. * Copyright (C) 2015 Imagination Technologies
  5. * Author: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms and conditions of the GNU General Public License,
  9. * version 2, as published by the Free Software Foundation.
  10. */
  11. #include <linux/of_fdt.h>
  12. #include <linux/of_platform.h>
  13. #include <asm/prom.h>
  14. #define XILFPGA_UART_BASE 0xb0401000
  15. const char *get_system_type(void)
  16. {
  17. return "MIPSfpga";
  18. }
  19. void __init plat_mem_setup(void)
  20. {
  21. __dt_setup_arch(__dtb_start);
  22. strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
  23. }
  24. void __init prom_init(void)
  25. {
  26. setup_8250_early_printk_port(XILFPGA_UART_BASE, 2, 50000);
  27. }
  28. void __init prom_free_prom_memory(void)
  29. {
  30. }
  31. void __init device_tree_init(void)
  32. {
  33. if (!initial_boot_params)
  34. return;
  35. unflatten_and_copy_device_tree();
  36. }
  37. static int __init plat_of_setup(void)
  38. {
  39. if (!of_have_populated_dt())
  40. panic("Device tree not present");
  41. if (of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL))
  42. panic("Failed to populate DT");
  43. return 0;
  44. }
  45. arch_initcall(plat_of_setup);