xref: /linux/arch/powerpc/platforms/powernv/setup.c (revision 0869b6fd209bda402576a9a559120ddd4f61198e)
155190f88SBenjamin Herrenschmidt /*
255190f88SBenjamin Herrenschmidt  * PowerNV setup code.
355190f88SBenjamin Herrenschmidt  *
455190f88SBenjamin Herrenschmidt  * Copyright 2011 IBM Corp.
555190f88SBenjamin Herrenschmidt  *
655190f88SBenjamin Herrenschmidt  * This program is free software; you can redistribute it and/or
755190f88SBenjamin Herrenschmidt  * modify it under the terms of the GNU General Public License
855190f88SBenjamin Herrenschmidt  * as published by the Free Software Foundation; either version
955190f88SBenjamin Herrenschmidt  * 2 of the License, or (at your option) any later version.
1055190f88SBenjamin Herrenschmidt  */
1155190f88SBenjamin Herrenschmidt 
1255190f88SBenjamin Herrenschmidt #undef DEBUG
1355190f88SBenjamin Herrenschmidt 
1455190f88SBenjamin Herrenschmidt #include <linux/cpu.h>
1555190f88SBenjamin Herrenschmidt #include <linux/errno.h>
1655190f88SBenjamin Herrenschmidt #include <linux/sched.h>
1755190f88SBenjamin Herrenschmidt #include <linux/kernel.h>
1855190f88SBenjamin Herrenschmidt #include <linux/tty.h>
1955190f88SBenjamin Herrenschmidt #include <linux/reboot.h>
2055190f88SBenjamin Herrenschmidt #include <linux/init.h>
2155190f88SBenjamin Herrenschmidt #include <linux/console.h>
2255190f88SBenjamin Herrenschmidt #include <linux/delay.h>
2355190f88SBenjamin Herrenschmidt #include <linux/irq.h>
2455190f88SBenjamin Herrenschmidt #include <linux/seq_file.h>
2555190f88SBenjamin Herrenschmidt #include <linux/of.h>
2626a2056eSRob Herring #include <linux/of_fdt.h>
2755190f88SBenjamin Herrenschmidt #include <linux/interrupt.h>
2855190f88SBenjamin Herrenschmidt #include <linux/bug.h>
29cd15b048SBenjamin Herrenschmidt #include <linux/pci.h>
30fb5153d0SGautham R. Shenoy #include <linux/cpufreq.h>
3155190f88SBenjamin Herrenschmidt 
3255190f88SBenjamin Herrenschmidt #include <asm/machdep.h>
3355190f88SBenjamin Herrenschmidt #include <asm/firmware.h>
3455190f88SBenjamin Herrenschmidt #include <asm/xics.h>
35628daa8dSBenjamin Herrenschmidt #include <asm/rtas.h>
36daea1175SBenjamin Herrenschmidt #include <asm/opal.h>
3713906db6SBenjamin Herrenschmidt #include <asm/kexec.h>
38b2a80878SShreyas B. Prabhu #include <asm/smp.h>
3955190f88SBenjamin Herrenschmidt 
4055190f88SBenjamin Herrenschmidt #include "powernv.h"
4155190f88SBenjamin Herrenschmidt 
4255190f88SBenjamin Herrenschmidt static void __init pnv_setup_arch(void)
4355190f88SBenjamin Herrenschmidt {
444817fc32SAnton Blanchard 	set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT);
454817fc32SAnton Blanchard 
4655190f88SBenjamin Herrenschmidt 	/* Initialize SMP */
4755190f88SBenjamin Herrenschmidt 	pnv_smp_init();
4855190f88SBenjamin Herrenschmidt 
4961305a96SBenjamin Herrenschmidt 	/* Setup PCI */
5061305a96SBenjamin Herrenschmidt 	pnv_pci_init();
5155190f88SBenjamin Herrenschmidt 
52628daa8dSBenjamin Herrenschmidt 	/* Setup RTC and NVRAM callbacks */
53628daa8dSBenjamin Herrenschmidt 	if (firmware_has_feature(FW_FEATURE_OPAL))
54628daa8dSBenjamin Herrenschmidt 		opal_nvram_init();
5555190f88SBenjamin Herrenschmidt 
5655190f88SBenjamin Herrenschmidt 	/* Enable NAP mode */
5755190f88SBenjamin Herrenschmidt 	powersave_nap = 1;
5855190f88SBenjamin Herrenschmidt 
5955190f88SBenjamin Herrenschmidt 	/* XXX PMCS */
6055190f88SBenjamin Herrenschmidt }
6155190f88SBenjamin Herrenschmidt 
6255190f88SBenjamin Herrenschmidt static void __init pnv_init_early(void)
6355190f88SBenjamin Herrenschmidt {
643fafe9c2SBenjamin Herrenschmidt 	/*
653fafe9c2SBenjamin Herrenschmidt 	 * Initialize the LPC bus now so that legacy serial
663fafe9c2SBenjamin Herrenschmidt 	 * ports can be found on it
673fafe9c2SBenjamin Herrenschmidt 	 */
683fafe9c2SBenjamin Herrenschmidt 	opal_lpc_init();
693fafe9c2SBenjamin Herrenschmidt 
70daea1175SBenjamin Herrenschmidt #ifdef CONFIG_HVC_OPAL
71daea1175SBenjamin Herrenschmidt 	if (firmware_has_feature(FW_FEATURE_OPAL))
72daea1175SBenjamin Herrenschmidt 		hvc_opal_init_early();
73daea1175SBenjamin Herrenschmidt 	else
74daea1175SBenjamin Herrenschmidt #endif
75daea1175SBenjamin Herrenschmidt 		add_preferred_console("hvc", 0, NULL);
7655190f88SBenjamin Herrenschmidt }
7755190f88SBenjamin Herrenschmidt 
7855190f88SBenjamin Herrenschmidt static void __init pnv_init_IRQ(void)
7955190f88SBenjamin Herrenschmidt {
8055190f88SBenjamin Herrenschmidt 	xics_init();
8155190f88SBenjamin Herrenschmidt 
8255190f88SBenjamin Herrenschmidt 	WARN_ON(!ppc_md.get_irq);
8355190f88SBenjamin Herrenschmidt }
8455190f88SBenjamin Herrenschmidt 
8555190f88SBenjamin Herrenschmidt static void pnv_show_cpuinfo(struct seq_file *m)
8655190f88SBenjamin Herrenschmidt {
8755190f88SBenjamin Herrenschmidt 	struct device_node *root;
8855190f88SBenjamin Herrenschmidt 	const char *model = "";
8955190f88SBenjamin Herrenschmidt 
9055190f88SBenjamin Herrenschmidt 	root = of_find_node_by_path("/");
9155190f88SBenjamin Herrenschmidt 	if (root)
9255190f88SBenjamin Herrenschmidt 		model = of_get_property(root, "model", NULL);
9355190f88SBenjamin Herrenschmidt 	seq_printf(m, "machine\t\t: PowerNV %s\n", model);
9475b93da4SBenjamin Herrenschmidt 	if (firmware_has_feature(FW_FEATURE_OPALv3))
9575b93da4SBenjamin Herrenschmidt 		seq_printf(m, "firmware\t: OPAL v3\n");
9675b93da4SBenjamin Herrenschmidt 	else if (firmware_has_feature(FW_FEATURE_OPALv2))
9714a43e69SBenjamin Herrenschmidt 		seq_printf(m, "firmware\t: OPAL v2\n");
9814a43e69SBenjamin Herrenschmidt 	else if (firmware_has_feature(FW_FEATURE_OPAL))
9914a43e69SBenjamin Herrenschmidt 		seq_printf(m, "firmware\t: OPAL v1\n");
10014a43e69SBenjamin Herrenschmidt 	else
10114a43e69SBenjamin Herrenschmidt 		seq_printf(m, "firmware\t: BML\n");
10255190f88SBenjamin Herrenschmidt 	of_node_put(root);
10355190f88SBenjamin Herrenschmidt }
10455190f88SBenjamin Herrenschmidt 
1052196c6f1SVasant Hegde static void pnv_prepare_going_down(void)
1062196c6f1SVasant Hegde {
1072196c6f1SVasant Hegde 	/*
1082196c6f1SVasant Hegde 	 * Disable all notifiers from OPAL, we can't
1092196c6f1SVasant Hegde 	 * service interrupts anymore anyway
1102196c6f1SVasant Hegde 	 */
1112196c6f1SVasant Hegde 	opal_notifier_disable();
1122196c6f1SVasant Hegde 
1132196c6f1SVasant Hegde 	/* Soft disable interrupts */
1142196c6f1SVasant Hegde 	local_irq_disable();
1152196c6f1SVasant Hegde 
1162196c6f1SVasant Hegde 	/*
1172196c6f1SVasant Hegde 	 * Return secondary CPUs to firwmare if a flash update
1182196c6f1SVasant Hegde 	 * is pending otherwise we will get all sort of error
1192196c6f1SVasant Hegde 	 * messages about CPU being stuck etc.. This will also
1202196c6f1SVasant Hegde 	 * have the side effect of hard disabling interrupts so
1212196c6f1SVasant Hegde 	 * past this point, the kernel is effectively dead.
1222196c6f1SVasant Hegde 	 */
1232196c6f1SVasant Hegde 	opal_flash_term_callback();
1242196c6f1SVasant Hegde }
1252196c6f1SVasant Hegde 
126ec27329fSBenjamin Herrenschmidt static void  __noreturn pnv_restart(char *cmd)
12755190f88SBenjamin Herrenschmidt {
128ec27329fSBenjamin Herrenschmidt 	long rc = OPAL_BUSY;
129ec27329fSBenjamin Herrenschmidt 
1302196c6f1SVasant Hegde 	pnv_prepare_going_down();
131e8e71fa4SGavin Shan 
132ec27329fSBenjamin Herrenschmidt 	while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
133ec27329fSBenjamin Herrenschmidt 		rc = opal_cec_reboot();
134ec27329fSBenjamin Herrenschmidt 		if (rc == OPAL_BUSY_EVENT)
135ec27329fSBenjamin Herrenschmidt 			opal_poll_events(NULL);
136ec27329fSBenjamin Herrenschmidt 		else
137ec27329fSBenjamin Herrenschmidt 			mdelay(10);
138ec27329fSBenjamin Herrenschmidt 	}
139ec27329fSBenjamin Herrenschmidt 	for (;;)
140ec27329fSBenjamin Herrenschmidt 		opal_poll_events(NULL);
14155190f88SBenjamin Herrenschmidt }
14255190f88SBenjamin Herrenschmidt 
143ec27329fSBenjamin Herrenschmidt static void __noreturn pnv_power_off(void)
14455190f88SBenjamin Herrenschmidt {
145ec27329fSBenjamin Herrenschmidt 	long rc = OPAL_BUSY;
146ec27329fSBenjamin Herrenschmidt 
1472196c6f1SVasant Hegde 	pnv_prepare_going_down();
148e8e71fa4SGavin Shan 
149ec27329fSBenjamin Herrenschmidt 	while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
150ec27329fSBenjamin Herrenschmidt 		rc = opal_cec_power_down(0);
151ec27329fSBenjamin Herrenschmidt 		if (rc == OPAL_BUSY_EVENT)
152ec27329fSBenjamin Herrenschmidt 			opal_poll_events(NULL);
153ec27329fSBenjamin Herrenschmidt 		else
154ec27329fSBenjamin Herrenschmidt 			mdelay(10);
155ec27329fSBenjamin Herrenschmidt 	}
156ec27329fSBenjamin Herrenschmidt 	for (;;)
157ec27329fSBenjamin Herrenschmidt 		opal_poll_events(NULL);
15855190f88SBenjamin Herrenschmidt }
15955190f88SBenjamin Herrenschmidt 
160ec27329fSBenjamin Herrenschmidt static void __noreturn pnv_halt(void)
16155190f88SBenjamin Herrenschmidt {
162ec27329fSBenjamin Herrenschmidt 	pnv_power_off();
16355190f88SBenjamin Herrenschmidt }
16455190f88SBenjamin Herrenschmidt 
16555190f88SBenjamin Herrenschmidt static void pnv_progress(char *s, unsigned short hex)
16655190f88SBenjamin Herrenschmidt {
16755190f88SBenjamin Herrenschmidt }
16855190f88SBenjamin Herrenschmidt 
169cd15b048SBenjamin Herrenschmidt static int pnv_dma_set_mask(struct device *dev, u64 dma_mask)
170cd15b048SBenjamin Herrenschmidt {
171cd15b048SBenjamin Herrenschmidt 	if (dev_is_pci(dev))
172cd15b048SBenjamin Herrenschmidt 		return pnv_pci_dma_set_mask(to_pci_dev(dev), dma_mask);
173cd15b048SBenjamin Herrenschmidt 	return __dma_set_mask(dev, dma_mask);
174cd15b048SBenjamin Herrenschmidt }
175cd15b048SBenjamin Herrenschmidt 
17673ed148aSBenjamin Herrenschmidt static void pnv_shutdown(void)
17773ed148aSBenjamin Herrenschmidt {
17873ed148aSBenjamin Herrenschmidt 	/* Let the PCI code clear up IODA tables */
17973ed148aSBenjamin Herrenschmidt 	pnv_pci_shutdown();
18073ed148aSBenjamin Herrenschmidt 
181f7d98d18SVasant Hegde 	/*
182f7d98d18SVasant Hegde 	 * Stop OPAL activity: Unregister all OPAL interrupts so they
183f7d98d18SVasant Hegde 	 * don't fire up while we kexec and make sure all potentially
184f7d98d18SVasant Hegde 	 * DMA'ing ops are complete (such as dump retrieval).
18573ed148aSBenjamin Herrenschmidt 	 */
18673ed148aSBenjamin Herrenschmidt 	opal_shutdown();
18773ed148aSBenjamin Herrenschmidt }
18873ed148aSBenjamin Herrenschmidt 
18955190f88SBenjamin Herrenschmidt #ifdef CONFIG_KEXEC
190298b34d7SBenjamin Herrenschmidt static void pnv_kexec_wait_secondaries_down(void)
191298b34d7SBenjamin Herrenschmidt {
192298b34d7SBenjamin Herrenschmidt 	int my_cpu, i, notified = -1;
193298b34d7SBenjamin Herrenschmidt 
194298b34d7SBenjamin Herrenschmidt 	my_cpu = get_cpu();
195298b34d7SBenjamin Herrenschmidt 
196298b34d7SBenjamin Herrenschmidt 	for_each_online_cpu(i) {
197298b34d7SBenjamin Herrenschmidt 		uint8_t status;
198298b34d7SBenjamin Herrenschmidt 		int64_t rc;
199298b34d7SBenjamin Herrenschmidt 
200298b34d7SBenjamin Herrenschmidt 		if (i == my_cpu)
201298b34d7SBenjamin Herrenschmidt 			continue;
202298b34d7SBenjamin Herrenschmidt 
203298b34d7SBenjamin Herrenschmidt 		for (;;) {
204298b34d7SBenjamin Herrenschmidt 			rc = opal_query_cpu_status(get_hard_smp_processor_id(i),
205298b34d7SBenjamin Herrenschmidt 						   &status);
206298b34d7SBenjamin Herrenschmidt 			if (rc != OPAL_SUCCESS || status != OPAL_THREAD_STARTED)
207298b34d7SBenjamin Herrenschmidt 				break;
208298b34d7SBenjamin Herrenschmidt 			barrier();
209298b34d7SBenjamin Herrenschmidt 			if (i != notified) {
210298b34d7SBenjamin Herrenschmidt 				printk(KERN_INFO "kexec: waiting for cpu %d "
211298b34d7SBenjamin Herrenschmidt 				       "(physical %d) to enter OPAL\n",
212298b34d7SBenjamin Herrenschmidt 				       i, paca[i].hw_cpu_id);
213298b34d7SBenjamin Herrenschmidt 				notified = i;
214298b34d7SBenjamin Herrenschmidt 			}
215298b34d7SBenjamin Herrenschmidt 		}
216298b34d7SBenjamin Herrenschmidt 	}
217298b34d7SBenjamin Herrenschmidt }
218298b34d7SBenjamin Herrenschmidt 
21955190f88SBenjamin Herrenschmidt static void pnv_kexec_cpu_down(int crash_shutdown, int secondary)
22055190f88SBenjamin Herrenschmidt {
22155190f88SBenjamin Herrenschmidt 	xics_kexec_teardown_cpu(secondary);
22213906db6SBenjamin Herrenschmidt 
223298b34d7SBenjamin Herrenschmidt 	/* On OPAL v3, we return all CPUs to firmware */
224298b34d7SBenjamin Herrenschmidt 
225298b34d7SBenjamin Herrenschmidt 	if (!firmware_has_feature(FW_FEATURE_OPALv3))
226298b34d7SBenjamin Herrenschmidt 		return;
227298b34d7SBenjamin Herrenschmidt 
228298b34d7SBenjamin Herrenschmidt 	if (secondary) {
22913906db6SBenjamin Herrenschmidt 		/* Return secondary CPUs to firmware on OPAL v3 */
23013906db6SBenjamin Herrenschmidt 		mb();
23113906db6SBenjamin Herrenschmidt 		get_paca()->kexec_state = KEXEC_STATE_REAL_MODE;
23213906db6SBenjamin Herrenschmidt 		mb();
23313906db6SBenjamin Herrenschmidt 
23413906db6SBenjamin Herrenschmidt 		/* Return the CPU to OPAL */
23513906db6SBenjamin Herrenschmidt 		opal_return_cpu();
236298b34d7SBenjamin Herrenschmidt 	} else if (crash_shutdown) {
237298b34d7SBenjamin Herrenschmidt 		/*
238298b34d7SBenjamin Herrenschmidt 		 * On crash, we don't wait for secondaries to go
239298b34d7SBenjamin Herrenschmidt 		 * down as they might be unreachable or hung, so
240298b34d7SBenjamin Herrenschmidt 		 * instead we just wait a bit and move on.
241298b34d7SBenjamin Herrenschmidt 		 */
242298b34d7SBenjamin Herrenschmidt 		mdelay(1);
243298b34d7SBenjamin Herrenschmidt 	} else {
244298b34d7SBenjamin Herrenschmidt 		/* Primary waits for the secondaries to have reached OPAL */
245298b34d7SBenjamin Herrenschmidt 		pnv_kexec_wait_secondaries_down();
24613906db6SBenjamin Herrenschmidt 	}
24755190f88SBenjamin Herrenschmidt }
24855190f88SBenjamin Herrenschmidt #endif /* CONFIG_KEXEC */
24955190f88SBenjamin Herrenschmidt 
2506d97d7a2SAnton Blanchard #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
2516d97d7a2SAnton Blanchard static unsigned long pnv_memory_block_size(void)
2526d97d7a2SAnton Blanchard {
2536d97d7a2SAnton Blanchard 	return 256UL * 1024 * 1024;
2546d97d7a2SAnton Blanchard }
2556d97d7a2SAnton Blanchard #endif
2566d97d7a2SAnton Blanchard 
257628daa8dSBenjamin Herrenschmidt static void __init pnv_setup_machdep_opal(void)
258628daa8dSBenjamin Herrenschmidt {
259628daa8dSBenjamin Herrenschmidt 	ppc_md.get_boot_time = opal_get_boot_time;
260628daa8dSBenjamin Herrenschmidt 	ppc_md.get_rtc_time = opal_get_rtc_time;
261628daa8dSBenjamin Herrenschmidt 	ppc_md.set_rtc_time = opal_set_rtc_time;
262628daa8dSBenjamin Herrenschmidt 	ppc_md.restart = pnv_restart;
263628daa8dSBenjamin Herrenschmidt 	ppc_md.power_off = pnv_power_off;
264628daa8dSBenjamin Herrenschmidt 	ppc_md.halt = pnv_halt;
265ed79ba9eSBenjamin Herrenschmidt 	ppc_md.machine_check_exception = opal_machine_check;
26655672ecfSMahesh Salgaonkar 	ppc_md.mce_check_early_recovery = opal_mce_check_early_recovery;
267*0869b6fdSMahesh Salgaonkar 	ppc_md.hmi_exception_early = opal_hmi_exception_early;
268*0869b6fdSMahesh Salgaonkar 	ppc_md.handle_hmi_exception = opal_handle_hmi_exception;
269628daa8dSBenjamin Herrenschmidt }
270628daa8dSBenjamin Herrenschmidt 
271628daa8dSBenjamin Herrenschmidt #ifdef CONFIG_PPC_POWERNV_RTAS
272628daa8dSBenjamin Herrenschmidt static void __init pnv_setup_machdep_rtas(void)
273628daa8dSBenjamin Herrenschmidt {
274628daa8dSBenjamin Herrenschmidt 	if (rtas_token("get-time-of-day") != RTAS_UNKNOWN_SERVICE) {
275628daa8dSBenjamin Herrenschmidt 		ppc_md.get_boot_time = rtas_get_boot_time;
276628daa8dSBenjamin Herrenschmidt 		ppc_md.get_rtc_time = rtas_get_rtc_time;
277628daa8dSBenjamin Herrenschmidt 		ppc_md.set_rtc_time = rtas_set_rtc_time;
278628daa8dSBenjamin Herrenschmidt 	}
279628daa8dSBenjamin Herrenschmidt 	ppc_md.restart = rtas_restart;
280628daa8dSBenjamin Herrenschmidt 	ppc_md.power_off = rtas_power_off;
281628daa8dSBenjamin Herrenschmidt 	ppc_md.halt = rtas_halt;
282628daa8dSBenjamin Herrenschmidt }
283628daa8dSBenjamin Herrenschmidt #endif /* CONFIG_PPC_POWERNV_RTAS */
284628daa8dSBenjamin Herrenschmidt 
28555190f88SBenjamin Herrenschmidt static int __init pnv_probe(void)
28655190f88SBenjamin Herrenschmidt {
28755190f88SBenjamin Herrenschmidt 	unsigned long root = of_get_flat_dt_root();
28855190f88SBenjamin Herrenschmidt 
28955190f88SBenjamin Herrenschmidt 	if (!of_flat_dt_is_compatible(root, "ibm,powernv"))
29055190f88SBenjamin Herrenschmidt 		return 0;
29155190f88SBenjamin Herrenschmidt 
29255190f88SBenjamin Herrenschmidt 	hpte_init_native();
29355190f88SBenjamin Herrenschmidt 
294628daa8dSBenjamin Herrenschmidt 	if (firmware_has_feature(FW_FEATURE_OPAL))
295628daa8dSBenjamin Herrenschmidt 		pnv_setup_machdep_opal();
296628daa8dSBenjamin Herrenschmidt #ifdef CONFIG_PPC_POWERNV_RTAS
297628daa8dSBenjamin Herrenschmidt 	else if (rtas.base)
298628daa8dSBenjamin Herrenschmidt 		pnv_setup_machdep_rtas();
299628daa8dSBenjamin Herrenschmidt #endif /* CONFIG_PPC_POWERNV_RTAS */
300628daa8dSBenjamin Herrenschmidt 
30155190f88SBenjamin Herrenschmidt 	pr_debug("PowerNV detected !\n");
30255190f88SBenjamin Herrenschmidt 
30355190f88SBenjamin Herrenschmidt 	return 1;
30455190f88SBenjamin Herrenschmidt }
30555190f88SBenjamin Herrenschmidt 
306fb5153d0SGautham R. Shenoy /*
307fb5153d0SGautham R. Shenoy  * Returns the cpu frequency for 'cpu' in Hz. This is used by
308fb5153d0SGautham R. Shenoy  * /proc/cpuinfo
309fb5153d0SGautham R. Shenoy  */
310fb5153d0SGautham R. Shenoy unsigned long pnv_get_proc_freq(unsigned int cpu)
311fb5153d0SGautham R. Shenoy {
312fb5153d0SGautham R. Shenoy 	unsigned long ret_freq;
313fb5153d0SGautham R. Shenoy 
314fb5153d0SGautham R. Shenoy 	ret_freq = cpufreq_quick_get(cpu) * 1000ul;
315fb5153d0SGautham R. Shenoy 
316fb5153d0SGautham R. Shenoy 	/*
317fb5153d0SGautham R. Shenoy 	 * If the backend cpufreq driver does not exist,
318fb5153d0SGautham R. Shenoy          * then fallback to old way of reporting the clockrate.
319fb5153d0SGautham R. Shenoy 	 */
320fb5153d0SGautham R. Shenoy 	if (!ret_freq)
321fb5153d0SGautham R. Shenoy 		ret_freq = ppc_proc_freq;
322fb5153d0SGautham R. Shenoy 	return ret_freq;
323fb5153d0SGautham R. Shenoy }
324fb5153d0SGautham R. Shenoy 
32555190f88SBenjamin Herrenschmidt define_machine(powernv) {
32655190f88SBenjamin Herrenschmidt 	.name			= "PowerNV",
32755190f88SBenjamin Herrenschmidt 	.probe			= pnv_probe,
32855190f88SBenjamin Herrenschmidt 	.init_early		= pnv_init_early,
329628daa8dSBenjamin Herrenschmidt 	.setup_arch		= pnv_setup_arch,
33055190f88SBenjamin Herrenschmidt 	.init_IRQ		= pnv_init_IRQ,
33155190f88SBenjamin Herrenschmidt 	.show_cpuinfo		= pnv_show_cpuinfo,
332fb5153d0SGautham R. Shenoy 	.get_proc_freq          = pnv_get_proc_freq,
33355190f88SBenjamin Herrenschmidt 	.progress		= pnv_progress,
33473ed148aSBenjamin Herrenschmidt 	.machine_shutdown	= pnv_shutdown,
335591ac0cbSNicolas Pitre 	.power_save             = power7_idle,
33655190f88SBenjamin Herrenschmidt 	.calibrate_decr		= generic_calibrate_decr,
337cd15b048SBenjamin Herrenschmidt 	.dma_set_mask		= pnv_dma_set_mask,
33855190f88SBenjamin Herrenschmidt #ifdef CONFIG_KEXEC
33955190f88SBenjamin Herrenschmidt 	.kexec_cpu_down		= pnv_kexec_cpu_down,
34055190f88SBenjamin Herrenschmidt #endif
3416d97d7a2SAnton Blanchard #ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
3426d97d7a2SAnton Blanchard 	.memory_block_size	= pnv_memory_block_size,
3436d97d7a2SAnton Blanchard #endif
34455190f88SBenjamin Herrenschmidt };
345