dts in u-boot
create a new dts from https://www.cnblogs.com/majingwang/articles/18307686
set the dts here:
arch/arm/dts/qemu-arm.dts
actually qemu-arm have prepared a dtb in the beginning of ram.(0x40000000)
In order to test our u-boot dts, we will use our dtb in u-boot.
点击查看代码
diff --git a/configs/qemu_arm_defconfig b/configs/qemu_arm_defconfig
index c817e45e0f..5963acba1d 100644
--- a/configs/qemu_arm_defconfig
+++ b/configs/qemu_arm_defconfig
@@ -5,15 +5,16 @@ CONFIG_SYS_MALLOC_LEN=0x1000000
CONFIG_NR_DRAM_BANKS=1
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x40200000
-CONFIG_ENV_SIZE=0x40000
-CONFIG_ENV_SECT_SIZE=0x40000
+CONFIG_ENV_SIZE=0x80000
+CONFIG_ENV_SECT_SIZE=0x80000
CONFIG_DEFAULT_DEVICE_TREE="qemu-arm"
CONFIG_TARGET_QEMU_ARM_32BIT=y
CONFIG_DEBUG_UART_BASE=0x9000000
CONFIG_DEBUG_UART_CLOCK=0
CONFIG_ARMV7_LPAE=y
+CONFIG_TEXT_BASE=0x40200000
CONFIG_SYS_LOAD_ADDR=0x40200000
-CONFIG_ENV_ADDR=0x100000
+CONFIG_ENV_ADDR=0x400000
CONFIG_PCI=y
CONFIG_DEBUG_UART=y
CONFIG_AHCI=y
@@ -35,10 +36,15 @@ CONFIG_CMD_MTD=y
CONFIG_CMD_PCI=y
CONFIG_CMD_TPM=y
CONFIG_CMD_MTDPARTS=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_REAL=y
+CONFIG_OF_SEPARATE=y
+CONFIG_OF_LIST="qemu-arm"
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_SCSI_AHCI=y
CONFIG_AHCI_PCI=y
CONFIG_DFU_TFTP=y
+CONFIG_TFTP_PORT=y
CONFIG_DFU_MTD=y
CONFIG_DFU_RAM=y
# CONFIG_MMC is not set
make CROSS_COMPILE=arm-linux-gnueabi- qemu_arm_defconfig
make CROSS_COMPILE=arm-linux-gnueabi- menuconfig
Device Tree Control->Provided by the board=y,Omit the device tree output=n,(qemu-arm) Default Device Tree for DT control,Support embedding several DTBs in a FIT image for u-boot=y
make CROSS_COMPILE=arm-linux-gnueabi- -j10
There u-boot.bin and u-boot.dtb
download u-boot.dtb to u-boot.
=>tftp 0x42000000 192.168.55.1:u-boot.dtb
=>fdt addr 0x42000000
=>fdt print
=>print loadaddr
loadaddr=0x40200000
=>tftp $loadaddr 192.168.55.1:u-boot.bin
=>setenv fdt_addr 0x42000000
=>go $loadaddr
We meet a issue that if download dtb to the beginning of ram, it will fail to init pci card.
浙公网安备 33010602011771号