xref: /linux/arch/powerpc/platforms/microwatt/setup.c (revision 1c96fcdef8c7492ecf34ed70102a1ae5253ef9d1)
153d143feSPaul Mackerras /*
253d143feSPaul Mackerras  * Microwatt FPGA-based SoC platform setup code.
353d143feSPaul Mackerras  *
453d143feSPaul Mackerras  * Copyright 2020 Paul Mackerras (paulus@ozlabs.org), IBM Corp.
553d143feSPaul Mackerras  */
653d143feSPaul Mackerras 
753d143feSPaul Mackerras #include <linux/types.h>
853d143feSPaul Mackerras #include <linux/kernel.h>
953d143feSPaul Mackerras #include <linux/stddef.h>
1053d143feSPaul Mackerras #include <linux/init.h>
110d0f9e5fSBenjamin Herrenschmidt #include <linux/of.h>
120d0f9e5fSBenjamin Herrenschmidt #include <linux/of_platform.h>
13aa9c5adfSBenjamin Herrenschmidt 
1453d143feSPaul Mackerras #include <asm/machdep.h>
1553d143feSPaul Mackerras #include <asm/time.h>
16aa9c5adfSBenjamin Herrenschmidt #include <asm/xics.h>
1748b545b8SBenjamin Herrenschmidt #include <asm/udbg.h>
18aa9c5adfSBenjamin Herrenschmidt 
1920a9689bSJason A. Donenfeld #include "microwatt.h"
2020a9689bSJason A. Donenfeld 
21aa9c5adfSBenjamin Herrenschmidt static void __init microwatt_init_IRQ(void)
22aa9c5adfSBenjamin Herrenschmidt {
23aa9c5adfSBenjamin Herrenschmidt 	xics_init();
24aa9c5adfSBenjamin Herrenschmidt }
2553d143feSPaul Mackerras 
260d0f9e5fSBenjamin Herrenschmidt static int __init microwatt_populate(void)
270d0f9e5fSBenjamin Herrenschmidt {
280d0f9e5fSBenjamin Herrenschmidt 	return of_platform_default_populate(NULL, NULL, NULL);
290d0f9e5fSBenjamin Herrenschmidt }
300d0f9e5fSBenjamin Herrenschmidt machine_arch_initcall(microwatt, microwatt_populate);
310d0f9e5fSBenjamin Herrenschmidt 
3220a9689bSJason A. Donenfeld static void __init microwatt_setup_arch(void)
3320a9689bSJason A. Donenfeld {
3420a9689bSJason A. Donenfeld 	microwatt_rng_init();
3520a9689bSJason A. Donenfeld }
3620a9689bSJason A. Donenfeld 
3753d143feSPaul Mackerras define_machine(microwatt) {
3853d143feSPaul Mackerras 	.name			= "microwatt",
39*1c96fcdeSChristophe Leroy 	.compatible		= "microwatt-soc",
40aa9c5adfSBenjamin Herrenschmidt 	.init_IRQ		= microwatt_init_IRQ,
4120a9689bSJason A. Donenfeld 	.setup_arch		= microwatt_setup_arch,
4248b545b8SBenjamin Herrenschmidt 	.progress		= udbg_progress,
4353d143feSPaul Mackerras 	.calibrate_decr		= generic_calibrate_decr,
4453d143feSPaul Mackerras };
45