2021-06-18 13:43:41 +10:00
|
|
|
/*
|
|
|
|
* Microwatt FPGA-based SoC platform setup code.
|
|
|
|
*
|
|
|
|
* Copyright 2020 Paul Mackerras (paulus@ozlabs.org), IBM Corp.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/stddef.h>
|
|
|
|
#include <linux/init.h>
|
2021-06-18 13:45:11 +10:00
|
|
|
#include <linux/of.h>
|
|
|
|
#include <linux/of_platform.h>
|
2021-06-18 13:45:53 +10:00
|
|
|
|
2021-06-18 13:43:41 +10:00
|
|
|
#include <asm/machdep.h>
|
|
|
|
#include <asm/time.h>
|
2021-06-18 13:45:53 +10:00
|
|
|
#include <asm/xics.h>
|
2021-06-18 13:46:32 +10:00
|
|
|
#include <asm/udbg.h>
|
2021-06-18 13:45:53 +10:00
|
|
|
|
2022-06-11 17:10:13 +02:00
|
|
|
#include "microwatt.h"
|
|
|
|
|
2021-06-18 13:45:53 +10:00
|
|
|
static void __init microwatt_init_IRQ(void)
|
|
|
|
{
|
|
|
|
xics_init();
|
|
|
|
}
|
2021-06-18 13:43:41 +10:00
|
|
|
|
2021-06-18 13:45:11 +10:00
|
|
|
static int __init microwatt_populate(void)
|
|
|
|
{
|
|
|
|
return of_platform_default_populate(NULL, NULL, NULL);
|
|
|
|
}
|
|
|
|
machine_arch_initcall(microwatt, microwatt_populate);
|
|
|
|
|
2025-01-31 17:30:09 +11:00
|
|
|
static int __init microwatt_probe(void)
|
|
|
|
{
|
|
|
|
/* Main reason for having this is to start the other CPU(s) */
|
|
|
|
if (IS_ENABLED(CONFIG_SMP))
|
|
|
|
microwatt_init_smp();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2022-06-11 17:10:13 +02:00
|
|
|
static void __init microwatt_setup_arch(void)
|
|
|
|
{
|
|
|
|
microwatt_rng_init();
|
|
|
|
}
|
|
|
|
|
2025-01-31 17:28:39 +11:00
|
|
|
static void microwatt_idle(void)
|
|
|
|
{
|
|
|
|
if (!prep_irq_for_idle_irqsoff())
|
|
|
|
return;
|
|
|
|
|
|
|
|
__asm__ __volatile__ ("wait");
|
|
|
|
}
|
|
|
|
|
2021-06-18 13:43:41 +10:00
|
|
|
define_machine(microwatt) {
|
|
|
|
.name = "microwatt",
|
2023-02-18 10:15:46 +01:00
|
|
|
.compatible = "microwatt-soc",
|
2025-01-31 17:30:09 +11:00
|
|
|
.probe = microwatt_probe,
|
2021-06-18 13:45:53 +10:00
|
|
|
.init_IRQ = microwatt_init_IRQ,
|
2022-06-11 17:10:13 +02:00
|
|
|
.setup_arch = microwatt_setup_arch,
|
2021-06-18 13:46:32 +10:00
|
|
|
.progress = udbg_progress,
|
2025-01-31 17:28:39 +11:00
|
|
|
.power_save = microwatt_idle,
|
2021-06-18 13:43:41 +10:00
|
|
|
};
|