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> 13*aa9c5adfSBenjamin Herrenschmidt 1453d143feSPaul Mackerras #include <asm/machdep.h> 1553d143feSPaul Mackerras #include <asm/time.h> 16*aa9c5adfSBenjamin Herrenschmidt #include <asm/xics.h> 17*aa9c5adfSBenjamin Herrenschmidt 18*aa9c5adfSBenjamin Herrenschmidt static void __init microwatt_init_IRQ(void) 19*aa9c5adfSBenjamin Herrenschmidt { 20*aa9c5adfSBenjamin Herrenschmidt xics_init(); 21*aa9c5adfSBenjamin Herrenschmidt } 2253d143feSPaul Mackerras 2353d143feSPaul Mackerras static int __init microwatt_probe(void) 2453d143feSPaul Mackerras { 2553d143feSPaul Mackerras return of_machine_is_compatible("microwatt-soc"); 2653d143feSPaul Mackerras } 2753d143feSPaul Mackerras 280d0f9e5fSBenjamin Herrenschmidt static int __init microwatt_populate(void) 290d0f9e5fSBenjamin Herrenschmidt { 300d0f9e5fSBenjamin Herrenschmidt return of_platform_default_populate(NULL, NULL, NULL); 310d0f9e5fSBenjamin Herrenschmidt } 320d0f9e5fSBenjamin Herrenschmidt machine_arch_initcall(microwatt, microwatt_populate); 330d0f9e5fSBenjamin Herrenschmidt 3453d143feSPaul Mackerras define_machine(microwatt) { 3553d143feSPaul Mackerras .name = "microwatt", 3653d143feSPaul Mackerras .probe = microwatt_probe, 37*aa9c5adfSBenjamin Herrenschmidt .init_IRQ = microwatt_init_IRQ, 3853d143feSPaul Mackerras .calibrate_decr = generic_calibrate_decr, 3953d143feSPaul Mackerras }; 40