diff options
author | Tom Rini <trini@konsulko.com> | 2019-02-27 13:32:09 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-02-27 13:32:09 -0500 |
commit | 783e66816d101f970b185083377846059d4d577d (patch) | |
tree | 31ca1a69df593a7b4ae14dad2def1a48fcc9d91b /arch/riscv/cpu/generic/cpu.c | |
parent | b3820ba997f004a376efc5446683101ff42b05af (diff) | |
parent | 98a66ffa3aafd20d38f357d624e470e20fbb1839 (diff) |
Merge git://git.denx.de/u-boot-riscv
- SiFive FU540 Support
Diffstat (limited to 'arch/riscv/cpu/generic/cpu.c')
-rw-r--r-- | arch/riscv/cpu/generic/cpu.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/riscv/cpu/generic/cpu.c b/arch/riscv/cpu/generic/cpu.c new file mode 100644 index 0000000000..ad2950ce40 --- /dev/null +++ b/arch/riscv/cpu/generic/cpu.c @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com> + */ + +#include <common.h> +#include <dm.h> + +/* + * cleanup_before_linux() is called just before we call linux + * it prepares the processor for linux + * + * we disable interrupt and caches. + */ +int cleanup_before_linux(void) +{ + disable_interrupts(); + + cache_flush(); + + return 0; +} + +/* To enumerate devices on the /soc/ node, create a "simple-bus" driver */ +static const struct udevice_id riscv_virtio_soc_ids[] = { + { .compatible = "riscv-virtio-soc" }, + { } +}; + +U_BOOT_DRIVER(riscv_virtio_soc) = { + .name = "riscv_virtio_soc", + .id = UCLASS_SIMPLE_BUS, + .of_match = riscv_virtio_soc_ids, + .flags = DM_FLAG_PRE_RELOC, +}; |