powerpc: Add skeleton PowerNV platform
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / powerpc / platforms / powernv / setup.c
blob569f9cc4eb046f47d9545982d849feae4eaa23c3
1 /*
2 * PowerNV setup code.
4 * Copyright 2011 IBM Corp.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #undef DEBUG
14 #include <linux/cpu.h>
15 #include <linux/errno.h>
16 #include <linux/sched.h>
17 #include <linux/kernel.h>
18 #include <linux/tty.h>
19 #include <linux/reboot.h>
20 #include <linux/init.h>
21 #include <linux/console.h>
22 #include <linux/delay.h>
23 #include <linux/irq.h>
24 #include <linux/seq_file.h>
25 #include <linux/of.h>
26 #include <linux/interrupt.h>
27 #include <linux/bug.h>
29 #include <asm/machdep.h>
30 #include <asm/firmware.h>
31 #include <asm/xics.h>
33 #include "powernv.h"
35 static void __init pnv_setup_arch(void)
37 /* Force console to hvc for now until we have sorted out the
38 * real console situation for the platform. This will make
39 * hvc_udbg work at least.
41 add_preferred_console("hvc", 0, NULL);
43 /* Initialize SMP */
44 pnv_smp_init();
46 /* XXX PCI */
48 /* XXX NVRAM */
50 /* Enable NAP mode */
51 powersave_nap = 1;
53 /* XXX PMCS */
56 static void __init pnv_init_early(void)
58 /* XXX IOMMU */
61 static void __init pnv_init_IRQ(void)
63 xics_init();
65 WARN_ON(!ppc_md.get_irq);
68 static void pnv_show_cpuinfo(struct seq_file *m)
70 struct device_node *root;
71 const char *model = "";
73 root = of_find_node_by_path("/");
74 if (root)
75 model = of_get_property(root, "model", NULL);
76 seq_printf(m, "machine\t\t: PowerNV %s\n", model);
77 of_node_put(root);
80 static void pnv_restart(char *cmd)
82 for (;;);
85 static void pnv_power_off(void)
87 for (;;);
90 static void pnv_halt(void)
92 for (;;);
95 static unsigned long __init pnv_get_boot_time(void)
97 return 0;
100 static void pnv_get_rtc_time(struct rtc_time *rtc_tm)
104 static int pnv_set_rtc_time(struct rtc_time *tm)
106 return 0;
109 static void pnv_progress(char *s, unsigned short hex)
113 #ifdef CONFIG_KEXEC
114 static void pnv_kexec_cpu_down(int crash_shutdown, int secondary)
116 xics_kexec_teardown_cpu(secondary);
118 #endif /* CONFIG_KEXEC */
120 static int __init pnv_probe(void)
122 unsigned long root = of_get_flat_dt_root();
124 if (!of_flat_dt_is_compatible(root, "ibm,powernv"))
125 return 0;
127 hpte_init_native();
129 pr_debug("PowerNV detected !\n");
131 return 1;
134 define_machine(powernv) {
135 .name = "PowerNV",
136 .probe = pnv_probe,
137 .setup_arch = pnv_setup_arch,
138 .init_early = pnv_init_early,
139 .init_IRQ = pnv_init_IRQ,
140 .show_cpuinfo = pnv_show_cpuinfo,
141 .restart = pnv_restart,
142 .power_off = pnv_power_off,
143 .halt = pnv_halt,
144 .get_boot_time = pnv_get_boot_time,
145 .get_rtc_time = pnv_get_rtc_time,
146 .set_rtc_time = pnv_set_rtc_time,
147 .progress = pnv_progress,
148 .power_save = power7_idle,
149 .calibrate_decr = generic_calibrate_decr,
150 #ifdef CONFIG_KEXEC
151 .kexec_cpu_down = pnv_kexec_cpu_down,
152 #endif