9f4752a88f36c6f52537aa4b5d29b7dbe3510038
[platform/kernel/u-boot.git] / include / configs / qemu-riscv.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
4  */
5
6 #ifndef __CONFIG_H
7 #define __CONFIG_H
8
9 #include <linux/sizes.h>
10
11 #ifdef CONFIG_SPL
12
13 #define CONFIG_SYS_SPL_MALLOC_START     0x84100000
14 #define CONFIG_SYS_SPL_MALLOC_SIZE      0x00100000
15
16 #endif
17
18 #define CONFIG_SYS_SDRAM_BASE           0x80000000
19
20 #define CONFIG_SYS_BOOTM_LEN            SZ_64M
21
22 #define CONFIG_STANDALONE_LOAD_ADDR     0x80200000
23
24 #define RISCV_MMODE_TIMERBASE           0x2000000
25 #define RISCV_MMODE_TIMER_FREQ          1000000
26
27 #define RISCV_SMODE_TIMER_FREQ          1000000
28
29 /* Environment options */
30
31 #ifndef CONFIG_SPL_BUILD
32 #define BOOT_TARGET_DEVICES(func) \
33         func(QEMU, qemu, na) \
34         func(VIRTIO, virtio, 0) \
35         func(SCSI, scsi, 0) \
36         func(DHCP, dhcp, na)
37
38 #include <config_distro_bootcmd.h>
39
40 #define BOOTENV_DEV_QEMU(devtypeu, devtypel, instance) \
41         "bootcmd_qemu=" \
42                 "if env exists kernel_start; then " \
43                         "bootm ${kernel_start} - ${fdtcontroladdr};" \
44                 "fi;\0"
45
46 #define BOOTENV_DEV_NAME_QEMU(devtypeu, devtypel, instance) \
47         "qemu "
48
49 #define CONFIG_EXTRA_ENV_SETTINGS \
50         "fdt_high=0xffffffffffffffff\0" \
51         "initrd_high=0xffffffffffffffff\0" \
52         "kernel_addr_r=0x84000000\0" \
53         "kernel_comp_addr_r=0x88000000\0" \
54         "kernel_comp_size=0x4000000\0" \
55         "fdt_addr_r=0x8c000000\0" \
56         "scriptaddr=0x8c100000\0" \
57         "pxefile_addr_r=0x8c200000\0" \
58         "ramdisk_addr_r=0x8c300000\0" \
59         BOOTENV
60 #endif
61
62 #endif /* __CONFIG_H */