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 | 184eadb | 2018-10-15 02:21:13 -0700 | [diff] [blame] | 7 | #include <dm.h> |
Bin Meng | 8a8694d | 2018-09-26 06:55:21 -0700 | [diff] [blame] | 8 | #include <fdtdec.h> |
Bin Meng | 184eadb | 2018-10-15 02:21:13 -0700 | [diff] [blame] | 9 | #include <virtio_types.h> |
| 10 | #include <virtio.h> |
Bin Meng | 8a8694d | 2018-09-26 06:55:21 -0700 | [diff] [blame] | 11 | |
| 12 | #define MROM_FDT_ADDR 0x1020 |
| 13 | |
| 14 | int board_init(void) |
| 15 | { |
Bin Meng | 184eadb | 2018-10-15 02:21:13 -0700 | [diff] [blame] | 16 | /* |
| 17 | * Make sure virtio bus is enumerated so that peripherals |
| 18 | * on the virtio bus can be discovered by their drivers |
| 19 | */ |
| 20 | virtio_init(); |
| 21 | |
Bin Meng | 8a8694d | 2018-09-26 06:55:21 -0700 | [diff] [blame] | 22 | return 0; |
| 23 | } |
| 24 | |
| 25 | void *board_fdt_blob_setup(void) |
| 26 | { |
| 27 | /* |
| 28 | * QEMU loads a generated DTB for us immediately |
| 29 | * after the reset vectors in the MROM |
| 30 | */ |
| 31 | return (void *)MROM_FDT_ADDR; |
| 32 | } |