setup.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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) 2013 Cavium, Inc.
  7. */
  8. #include <linux/kernel.h>
  9. #include <linux/kvm_para.h>
  10. #include <asm/reboot.h>
  11. #include <asm/bootinfo.h>
  12. #include <asm/smp-ops.h>
  13. #include <asm/time.h>
  14. extern struct plat_smp_ops paravirt_smp_ops;
  15. const char *get_system_type(void)
  16. {
  17. return "MIPS Para-Virtualized Guest";
  18. }
  19. void __init plat_time_init(void)
  20. {
  21. mips_hpt_frequency = kvm_hypercall0(KVM_HC_MIPS_GET_CLOCK_FREQ);
  22. preset_lpj = mips_hpt_frequency / (2 * HZ);
  23. }
  24. static void pv_machine_halt(void)
  25. {
  26. kvm_hypercall0(KVM_HC_MIPS_EXIT_VM);
  27. }
  28. /*
  29. * Early entry point for arch setup
  30. */
  31. void __init prom_init(void)
  32. {
  33. int i;
  34. int argc = fw_arg0;
  35. char **argv = (char **)fw_arg1;
  36. #ifdef CONFIG_32BIT
  37. set_io_port_base(KSEG1ADDR(0x1e000000));
  38. #else /* CONFIG_64BIT */
  39. set_io_port_base(PHYS_TO_XKSEG_UNCACHED(0x1e000000));
  40. #endif
  41. for (i = 0; i < argc; i++) {
  42. strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
  43. if (i < argc - 1)
  44. strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
  45. }
  46. _machine_halt = pv_machine_halt;
  47. register_smp_ops(&paravirt_smp_ops);
  48. }
  49. void __init plat_mem_setup(void)
  50. {
  51. /* Do nothing, the "mem=???" parser handles our memory. */
  52. }
  53. void __init prom_free_prom_memory(void)
  54. {
  55. }