Merge https://source.denx.de/u-boot/custodians/u-boot-usb
[platform/kernel/u-boot.git] / include / configs / qemu-arm.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 2017 Tuomas Tynkkynen
4  */
5
6 #ifndef __CONFIG_H
7 #define __CONFIG_H
8
9 #include <linux/sizes.h>
10
11 /* Physical memory map */
12
13 #define CONFIG_SYS_SDRAM_BASE           0x40000000
14
15 /* GUIDs for capsule updatable firmware images */
16 #define QEMU_ARM_UBOOT_IMAGE_GUID \
17         EFI_GUID(0xf885b085, 0x99f8, 0x45af, 0x84, 0x7d, \
18                  0xd5, 0x14, 0x10, 0x7a, 0x4a, 0x2c)
19
20 #define QEMU_ARM64_UBOOT_IMAGE_GUID \
21         EFI_GUID(0x058b7d83, 0x50d5, 0x4c47, 0xa1, 0x95, \
22                  0x60, 0xd8, 0x6a, 0xd3, 0x41, 0xc4)
23
24 /* Try files from QEMU's -kernel/-initrd, through the QEMU firmware device. */
25 #define BOOTENV_DEV_QFW(devtypeu, devtypel, instance) \
26         "bootcmd_qfw= " \
27                 "if qfw load $kernel_addr_r $ramdisk_addr_r; then " \
28                 "  booti $kernel_addr_r $ramdisk_addr_r:$filesize $fdtcontroladdr; " \
29                 "  if test $? -eq 1; then " \
30                 "    bootz $kernel_addr_r $ramdisk_addr_r:$filesize $fdtcontroladdr; " \
31                 "  fi ; " \
32                 "fi\0"
33 #define BOOTENV_DEV_NAME_QFW(devtypeu, devtypel, instance) "qfw "
34
35 /* For timer, QEMU emulates an ARMv7/ARMv8 architected timer */
36
37 /* Environment options */
38
39 #if CONFIG_IS_ENABLED(CMD_USB)
40 # define BOOT_TARGET_USB(func) func(USB, usb, 0)
41 #else
42 # define BOOT_TARGET_USB(func)
43 #endif
44
45 #if CONFIG_IS_ENABLED(CMD_SCSI)
46 # define BOOT_TARGET_SCSI(func) func(SCSI, scsi, 0)
47 #else
48 # define BOOT_TARGET_SCSI(func)
49 #endif
50
51 #if CONFIG_IS_ENABLED(CMD_VIRTIO)
52 # define BOOT_TARGET_VIRTIO(func) func(VIRTIO, virtio, 0)
53 #else
54 # define BOOT_TARGET_VIRTIO(func)
55 #endif
56
57 #if CONFIG_IS_ENABLED(CMD_NVME)
58 # define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
59 #else
60 # define BOOT_TARGET_NVME(func)
61 #endif
62
63 #if CONFIG_IS_ENABLED(CMD_DHCP)
64 # define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
65 #else
66 # define BOOT_TARGET_DHCP(func)
67 #endif
68
69 #define BOOT_TARGET_DEVICES(func) \
70         func(QFW, qfw, na) \
71         BOOT_TARGET_USB(func) \
72         BOOT_TARGET_SCSI(func) \
73         BOOT_TARGET_VIRTIO(func) \
74         BOOT_TARGET_NVME(func) \
75         BOOT_TARGET_DHCP(func)
76
77 #include <config_distro_bootcmd.h>
78
79 #define CONFIG_EXTRA_ENV_SETTINGS \
80         "fdt_high=0xffffffff\0" \
81         "initrd_high=0xffffffff\0" \
82         "fdt_addr=0x40000000\0" \
83         "scriptaddr=0x40200000\0" \
84         "pxefile_addr_r=0x40300000\0" \
85         "kernel_addr_r=0x40400000\0" \
86         "ramdisk_addr_r=0x44000000\0" \
87         BOOTENV
88
89 #endif /* __CONFIG_H */