diff --git a/board/raspberrypi3_swupdate/config.txt b/board/raspberrypi3_swupdate/config.txt index c06e22a..173aef2 100644 --- a/board/raspberrypi3_swupdate/config.txt +++ b/board/raspberrypi3_swupdate/config.txt @@ -20,5 +20,5 @@ gpu_mem=32 kernel=u-boot.bin # dt overlays -#dtoverlay=disable-bt +dtoverlay=disable-bt #dtoverlay=disable-wifi \ No newline at end of file diff --git a/board/raspberrypi3_swupdate/genimage-raspberrypi3_swupdate.cfg b/board/raspberrypi3_swupdate/genimage-raspberrypi3_swupdate.cfg index 5e59d2f..4703b74 100644 --- a/board/raspberrypi3_swupdate/genimage-raspberrypi3_swupdate.cfg +++ b/board/raspberrypi3_swupdate/genimage-raspberrypi3_swupdate.cfg @@ -8,8 +8,11 @@ image boot.vfat { "config.txt", "boot.scr", "Image", - "u-boot.bin" - "uboot-env.img", + "u-boot.bin", + + } + file uboot.env { + image = "uboot-env.img" } file overlays/README { image = "rpi-firmware/overlays/README" diff --git a/board/raspberrypi3_swupdate/post-image.sh b/board/raspberrypi3_swupdate/post-image.sh index effe95d..1864856 100755 --- a/board/raspberrypi3_swupdate/post-image.sh +++ b/board/raspberrypi3_swupdate/post-image.sh @@ -28,7 +28,7 @@ touch ${TARGET_DIR}/etc/rootfs-A cp ${BINARIES_DIR}/rootfs.ext4 ${BINARIES_DIR}/rootfs-B.ext4 # Create uboot environment -${HOST_DIR}/bin/mkenvimage -s 131072 -o "${BINARIES_DIR}/uboot-env.img" "${BOARD_DIR}/uboot-env.txt" +${HOST_DIR}/bin/mkenvimage -s 0x4000 -o "${BINARIES_DIR}/uboot-env.img" "${BOARD_DIR}/uboot-env.txt" # Copy U-Boot environment image as uboot.env to rpi-firmware directory cp "${BINARIES_DIR}/uboot-env.img" "${BINARIES_DIR}/rpi-firmware/uboot.env" diff --git a/board/raspberrypi3_swupdate/uboot-env.txt b/board/raspberrypi3_swupdate/uboot-env.txt index 279912e..39f2972 100644 --- a/board/raspberrypi3_swupdate/uboot-env.txt +++ b/board/raspberrypi3_swupdate/uboot-env.txt @@ -2,6 +2,8 @@ # Default variables for first boot - these will be modified during operation # Active partition (A or B) +kernel_addr_r=0x01000000 +fdt_addr_r=0x03000000 active_part=A active_root=/dev/mmcblk0p2 inactive_part=B @@ -15,11 +17,11 @@ bootlimit=3 bootcmd=run bootcmd_${active_part} # Kernel boot arguments -bootargs=console=ttyAMA0,115200 console=tty1 root=${active_root} rootwait +bootargs=console=ttyS0,115200 root=${active_root} rootwait # Commands for booting from A or B partitions -bootcmd_A=setenv bootargs console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootwait; load mmc 0:1 ${kernel_addr_r} zImage; load mmc 0:1 ${fdt_addr_r} bcm2710-rpi-3-b.dtb; bootz ${kernel_addr_r} - ${fdt_addr_r} -bootcmd_B=setenv bootargs console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootwait; load mmc 0:1 ${kernel_addr_r} zImage; load mmc 0:1 ${fdt_addr_r} bcm2710-rpi-3-b.dtb; bootz ${kernel_addr_r} - ${fdt_addr_r} +bootcmd_A=setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait; load mmc 0:1 ${kernel_addr_r} Image; load mmc 0:1 0x03000000 bcm2710-rpi-3-b.dtb; booti ${kernel_addr_r} - 0x03000000 +bootcmd_B=setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p3 rootwait; load mmc 0:1 ${kernel_addr_r} Image; load mmc 0:1 0x03000000 bcm2710-rpi-3-b.dtb; booti ${kernel_addr_r} - 0x03000000 # Fallback logic for failed boots altbootcmd=if test ${active_part} = A; then setenv active_part B; setenv active_root /dev/mmcblk0p3; setenv inactive_part A; setenv inactive_root /dev/mmcblk0p2; else setenv active_part A; setenv active_root /dev/mmcblk0p2; setenv inactive_part B; setenv inactive_root /dev/mmcblk0p3; fi; setenv bootcount 0; saveenv; run bootcmd diff --git a/board/raspberrypi3_swupdate/uboot.config b/board/raspberrypi3_swupdate/uboot.config index bcc38cd..07c48d6 100644 --- a/board/raspberrypi3_swupdate/uboot.config +++ b/board/raspberrypi3_swupdate/uboot.config @@ -7,10 +7,14 @@ CONFIG_EFI_CAPSULE_AUTHENTICATE=n # Ensure the basic features we need are enabled CONFIG_ENV_IS_IN_FAT=y +CONFIG_ENV_FAT_INTERFACE="mmc" +CONFIG_ENV_FAT_DEVICE_AND_PART="0:auto" +CONFIG_ENV_FAT_FILE="uboot.env" CONFIG_CMD_GPT=y CONFIG_CMD_MMC=y CONFIG_CMD_USB=y CONFIG_CMD_FS_GENERIC=y +CONFIG_CMD_BOOTI=y # Explicitly enable UART CONFIG_BAUDRATE=115200