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 19*20a9689bSJason A. Donenfeld #include "microwatt.h" 20*20a9689bSJason A. Donenfeld 21aa9c5adfSBenjamin Herrenschmidt static void __init microwatt_init_IRQ(void) 22aa9c5adfSBenjamin Herrenschmidt { 23aa9c5adfSBenjamin Herrenschmidt xics_init(); 24aa9c5adfSBenjamin Herrenschmidt } 2553d143feSPaul Mackerras 2653d143feSPaul Mackerras static int __init microwatt_probe(void) 2753d143feSPaul Mackerras { 2853d143feSPaul Mackerras return of_machine_is_compatible("microwatt-soc"); 2953d143feSPaul Mackerras } 3053d143feSPaul Mackerras 310d0f9e5fSBenjamin Herrenschmidt static int __init microwatt_populate(void) 320d0f9e5fSBenjamin Herrenschmidt { 330d0f9e5fSBenjamin Herrenschmidt return of_platform_default_populate(NULL, NULL, NULL); 340d0f9e5fSBenjamin Herrenschmidt } 350d0f9e5fSBenjamin Herrenschmidt machine_arch_initcall(microwatt, microwatt_populate); 360d0f9e5fSBenjamin Herrenschmidt 37*20a9689bSJason A. Donenfeld static void __init microwatt_setup_arch(void) 38*20a9689bSJason A. Donenfeld { 39*20a9689bSJason A. Donenfeld microwatt_rng_init(); 40*20a9689bSJason A. Donenfeld } 41*20a9689bSJason A. Donenfeld 4253d143feSPaul Mackerras define_machine(microwatt) { 4353d143feSPaul Mackerras .name = "microwatt", 4453d143feSPaul Mackerras .probe = microwatt_probe, 45aa9c5adfSBenjamin Herrenschmidt .init_IRQ = microwatt_init_IRQ, 46*20a9689bSJason A. Donenfeld .setup_arch = microwatt_setup_arch, 4748b545b8SBenjamin Herrenschmidt .progress = udbg_progress, 4853d143feSPaul Mackerras .calibrate_decr = generic_calibrate_decr, 4953d143feSPaul Mackerras }; 50