xref: /openbmc/u-boot/arch/riscv/cpu/generic/cpu.c (revision fd0bc623)
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
4  */
5 
6 #include <common.h>
7 #include <dm.h>
8 
9 /*
10  * cleanup_before_linux() is called just before we call linux
11  * it prepares the processor for linux
12  *
13  * we disable interrupt and caches.
14  */
15 int cleanup_before_linux(void)
16 {
17 	disable_interrupts();
18 
19 	cache_flush();
20 
21 	return 0;
22 }
23 
24 /* To enumerate devices on the /soc/ node, create a "simple-bus" driver */
25 static const struct udevice_id riscv_virtio_soc_ids[] = {
26 	{ .compatible = "riscv-virtio-soc" },
27 	{ }
28 };
29 
30 U_BOOT_DRIVER(riscv_virtio_soc) = {
31 	.name = "riscv_virtio_soc",
32 	.id = UCLASS_SIMPLE_BUS,
33 	.of_match = riscv_virtio_soc_ids,
34 	.flags = DM_FLAG_PRE_RELOC,
35 };
36