Bin Meng | 8a8694d | 2018-09-26 06:55:21 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com> |
| 4 | */ |
| 5 | |
| 6 | #include <common.h> |
Bin Meng | 66c6935 | 2018-12-12 06:12:25 -0800 | [diff] [blame] | 7 | #include <dm.h> |
Simon Glass | 8f3f761 | 2019-11-14 12:57:42 -0700 | [diff] [blame] | 8 | #include <irq_func.h> |
Bin Meng | 8a8694d | 2018-09-26 06:55:21 -0700 | [diff] [blame] | 9 | |
| 10 | /* |
| 11 | * cleanup_before_linux() is called just before we call linux |
| 12 | * it prepares the processor for linux |
| 13 | * |
| 14 | * we disable interrupt and caches. |
| 15 | */ |
| 16 | int cleanup_before_linux(void) |
| 17 | { |
| 18 | disable_interrupts(); |
| 19 | |
Rick Chen | 842d580 | 2018-11-07 09:34:06 +0800 | [diff] [blame] | 20 | cache_flush(); |
Bin Meng | 8a8694d | 2018-09-26 06:55:21 -0700 | [diff] [blame] | 21 | |
| 22 | return 0; |
| 23 | } |
Bin Meng | 66c6935 | 2018-12-12 06:12:25 -0800 | [diff] [blame] | 24 | |
| 25 | /* To enumerate devices on the /soc/ node, create a "simple-bus" driver */ |
| 26 | static const struct udevice_id riscv_virtio_soc_ids[] = { |
| 27 | { .compatible = "riscv-virtio-soc" }, |
| 28 | { } |
| 29 | }; |
| 30 | |
| 31 | U_BOOT_DRIVER(riscv_virtio_soc) = { |
| 32 | .name = "riscv_virtio_soc", |
| 33 | .id = UCLASS_SIMPLE_BUS, |
| 34 | .of_match = riscv_virtio_soc_ids, |
| 35 | .flags = DM_FLAG_PRE_RELOC, |
| 36 | }; |