blob: ad2950ce40ae7dbad48e2a4821c58b049752c13f [file] [log] [blame]
Bin Meng8a8694d2018-09-26 06:55:21 -07001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
4 */
5
6#include <common.h>
Bin Meng66c69352018-12-12 06:12:25 -08007#include <dm.h>
Bin Meng8a8694d2018-09-26 06:55:21 -07008
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 */
15int cleanup_before_linux(void)
16{
17 disable_interrupts();
18
Rick Chen842d5802018-11-07 09:34:06 +080019 cache_flush();
Bin Meng8a8694d2018-09-26 06:55:21 -070020
21 return 0;
22}
Bin Meng66c69352018-12-12 06:12:25 -080023
24/* To enumerate devices on the /soc/ node, create a "simple-bus" driver */
25static const struct udevice_id riscv_virtio_soc_ids[] = {
26 { .compatible = "riscv-virtio-soc" },
27 { }
28};
29
30U_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};