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.
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>
26 #include <linux/interrupt.h>
27 #include <linux/bug.h>
29 #include <asm/machdep.h>
30 #include <asm/firmware.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
);
56 static void __init
pnv_init_early(void)
61 static void __init
pnv_init_IRQ(void)
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("/");
75 model
= of_get_property(root
, "model", NULL
);
76 seq_printf(m
, "machine\t\t: PowerNV %s\n", model
);
80 static void pnv_restart(char *cmd
)
85 static void pnv_power_off(void)
90 static void pnv_halt(void)
95 static unsigned long __init
pnv_get_boot_time(void)
100 static void pnv_get_rtc_time(struct rtc_time
*rtc_tm
)
104 static int pnv_set_rtc_time(struct rtc_time
*tm
)
109 static void pnv_progress(char *s
, unsigned short hex
)
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"))
129 pr_debug("PowerNV detected !\n");
134 define_machine(powernv
) {
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
,
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
,
151 .kexec_cpu_down
= pnv_kexec_cpu_down
,