diff options
author | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
---|---|---|
committer | takeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp> | 2020-11-02 11:07:33 +0900 |
commit | 1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch) | |
tree | cd70a267a5ef105ba32f200aa088e281fbd85747 /external/meta-updater-raspberrypi/recipes-bsp | |
parent | 4204309872da5cb401cbb2729d9e2d4869a87f42 (diff) |
basesystem-jjsandbox/ToshikazuOhiwa/master-jj
recipes
Diffstat (limited to 'external/meta-updater-raspberrypi/recipes-bsp')
13 files changed, 73 insertions, 87 deletions
diff --git a/external/meta-updater-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend b/external/meta-updater-raspberrypi/recipes-bsp/bootfiles/bootfiles.bbappend index adb19c09..adb19c09 100644 --- a/external/meta-updater-raspberrypi/recipes-bsp/bootfiles/bcm2835-bootfiles.bbappend +++ b/external/meta-updater-raspberrypi/recipes-bsp/bootfiles/bootfiles.bbappend diff --git a/external/meta-updater-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend b/external/meta-updater-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend index 5073560f..6ade9f3d 100644 --- a/external/meta-updater-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend +++ b/external/meta-updater-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend @@ -2,16 +2,17 @@ DISABLE_OVERSCAN = "1" do_deploy_append() { if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_LWM}" ]; then - sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt fi if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_HWM}" ]; then - sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt fi - echo "avoid_warnings=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt - echo "dtparam=audio=on" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "avoid_warnings=2" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt + echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt + echo "dtparam=audio=on" >> ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/config.txt } -ENABLE_UART_raspberrypi3 = "1" +ENABLE_UART_raspberrypi3 ?= "1" +ENABLE_UART_raspberrypi4 ?= "1" diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb b/external/meta-updater-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb index 4dceb27c..0ecd792b 100644 --- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb +++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb @@ -16,13 +16,13 @@ S = "${WORKDIR}" inherit deploy do_deploy() { - install -d ${DEPLOYDIR}/bcm2835-bootfiles + install -d ${DEPLOYDIR}/${BOOTFILES_DIR_NAME} - mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Ostree boot script" -d ${S}/boot.scr ${DEPLOYDIR}/bcm2835-bootfiles/boot.scr - install -m 0755 ${S}/uEnv.txt ${DEPLOYDIR}/bcm2835-bootfiles/uEnv.txt + mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Ostree boot script" -d ${S}/boot.scr ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/boot.scr + install -m 0755 ${S}/uEnv.txt ${DEPLOYDIR}/${BOOTFILES_DIR_NAME}/uEnv.txt } addtask deploy before do_package after do_install -do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles" +do_deploy[dirs] += "${DEPLOYDIR}/${BOOTFILES_DIR_NAME}" PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT-and-bootcount-on-RPi3.patch b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT-and-bootcount-on-RPi3.patch deleted file mode 100644 index 394f0ee6..00000000 --- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Enable-FIT-and-bootcount-on-RPi3.patch +++ /dev/null @@ -1,42 +0,0 @@ -From c849889cce23b41df45cfa4efd9fde8eb682195f Mon Sep 17 00:00:00 2001 -From: Laurent Bonnans <laurent.bonnans@here.com> -Date: Wed, 5 Jun 2019 18:12:21 +0200 -Subject: [PATCH] Enable FIT and bootcount on RPi3 - ---- - configs/rpi_3_32b_defconfig | 6 ++++++ - configs/rpi_3_defconfig | 6 ++++++ - 2 files changed, 12 insertions(+) - -diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig -index 9e142cae63..d5d32a202d 100644 ---- a/configs/rpi_3_32b_defconfig -+++ b/configs/rpi_3_32b_defconfig -@@ -39,3 +39,9 @@ CONFIG_SYS_WHITE_ON_BLACK=y - CONFIG_CONSOLE_SCROLL_LINES=10 - CONFIG_PHYS_TO_BUS=y - CONFIG_OF_LIBFDT_OVERLAY=y -+ -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+ -+CONFIG_BOOTCOUNT_LIMIT=y -+CONFIG_BOOTCOUNT_ENV=y -diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig -index f46e504497..80fb70119e 100644 ---- a/configs/rpi_3_defconfig -+++ b/configs/rpi_3_defconfig -@@ -39,3 +39,9 @@ CONFIG_SYS_WHITE_ON_BLACK=y - CONFIG_CONSOLE_SCROLL_LINES=10 - CONFIG_PHYS_TO_BUS=y - CONFIG_OF_LIBFDT_OVERLAY=y -+ -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+ -+CONFIG_BOOTCOUNT_LIMIT=y -+CONFIG_BOOTCOUNT_ENV=y --- -2.20.1 - - diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Increase-rpi-BOOTM_LEN.patch b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Increase-rpi-BOOTM_LEN.patch index 1a6940e0..90ecefd2 100644 --- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Increase-rpi-BOOTM_LEN.patch +++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-Increase-rpi-BOOTM_LEN.patch @@ -1,4 +1,4 @@ -From a4a9b71ac4900fee8081c85c630d55e20b233a81 Mon Sep 17 00:00:00 2001 +From c7d936ae239e9609d95537746600e42892f3dcfb Mon Sep 17 00:00:00 2001 From: Laurent Bonnans <laurent.bonnans@here.com> Date: Wed, 5 Jun 2019 19:22:01 +0200 Subject: [PATCH] Increase rpi BOOTM_LEN @@ -8,17 +8,14 @@ Subject: [PATCH] Increase rpi BOOTM_LEN 1 file changed, 1 insertion(+) diff --git a/include/configs/rpi.h b/include/configs/rpi.h -index a97550b732..4ce9b2f99e 100644 +index 77d2d5458a..dd60042200 100644 --- a/include/configs/rpi.h +++ b/include/configs/rpi.h -@@ -56,6 +56,7 @@ +@@ -54,6 +54,7 @@ #define CONFIG_SYS_MEMTEST_START 0x00100000 #define CONFIG_SYS_MEMTEST_END 0x00200000 #define CONFIG_LOADADDR 0x00200000 +#define CONFIG_SYS_BOOTM_LEN SZ_64M - /* Devices */ - /* GPIO */ --- -2.20.1 - + #ifdef CONFIG_ARM64 + #define CONFIG_SYS_BOOTM_LEN SZ_64M diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch index 44774c0e..73f6e2d9 100644 --- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch +++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch @@ -1,8 +1,7 @@ -From 86cc911aaa958fedf2ea9cb04b4af17f5357815d Mon Sep 17 00:00:00 2001 +From fb48900977dbbfc6f921822abc6728b6075efc4f Mon Sep 17 00:00:00 2001 From: Anton Gerasimov <anton.gerasimov@here.com> Date: Fri, 1 Feb 2019 14:39:48 +0100 -Subject: [PATCH] board: raspberrypi: add serial and revision to the device - tree +Subject: [PATCH] board: raspberrypi: add serial and revision to device tree Raspberry Pi bootloader adds this node to fdt, but if u-boot script doesn't reuse the tree provided by it, this information is lost. @@ -10,31 +9,33 @@ doesn't reuse the tree provided by it, this information is lost. Revision and serial are displayed in /proc/cpuinfo after boot. Signed-off-by: Anton Gerasimov <anton.gerasimov@here.com> +Signed-off-by: Patrick Vacek <patrick.vacek@here.com> + --- board/raspberrypi/rpi/rpi.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c -index 35f5939552..114178397e 100644 +index e367ba3092..d70e07f0a6 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c -@@ -241,6 +241,8 @@ static uint32_t rev_scheme; +@@ -252,6 +252,8 @@ static uint32_t rev_scheme; static uint32_t rev_type; static const struct rpi_model *model; +uint64_t serial; + - #ifdef CONFIG_ARM64 - static struct mm_region bcm2837_mem_map[] = { - { + int dram_init(void) + { + ALLOC_CACHE_ALIGN_BUFFER(struct msg_get_arm_mem, msg, 1); @@ -384,8 +386,8 @@ static void set_serial_number(void) return; } -- snprintf(serial_string, sizeof(serial_string), "%016" PRIx64, +- snprintf(serial_string, sizeof(serial_string), "%016llx", - msg->get_board_serial.body.resp.serial); + serial = msg->get_board_serial.body.resp.serial; -+ snprintf(serial_string, sizeof(serial_string), "%016" PRIx64, serial); ++ snprintf(serial_string, sizeof(serial_string), "%016llx", serial); env_set("serial#", serial_string); } @@ -77,6 +78,3 @@ index 35f5939552..114178397e 100644 #ifdef CONFIG_EFI_LOADER /* Reserve the spin table */ efi_add_memory_map(0, 1, EFI_RESERVED_MEMORY_TYPE, 0); --- -2.17.1 - diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/bootcount.cfg b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/bootcount.cfg new file mode 100644 index 00000000..9fc35894 --- /dev/null +++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/bootcount.cfg @@ -0,0 +1,2 @@ +CONFIG_BOOTCOUNT_LIMIT=y +CONFIG_BOOTCOUNT_ENV=y diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fit.cfg b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fit.cfg new file mode 100644 index 00000000..79639520 --- /dev/null +++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fit.cfg @@ -0,0 +1,2 @@ +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fw_env.config b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fw_env.config new file mode 100644 index 00000000..79204290 --- /dev/null +++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/fw_env.config @@ -0,0 +1 @@ +/mnt/bootpart/uboot.env 0x0000 0x4000 diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/rpi4-fixup-mem.cfg b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/rpi4-fixup-mem.cfg new file mode 100644 index 00000000..230ef286 --- /dev/null +++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/files/rpi4-fixup-mem.cfg @@ -0,0 +1 @@ +CONFIG_ARCH_FIXUP_FDT_MEMORY=y diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/libubootenv_%.bbappend b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/libubootenv_%.bbappend new file mode 100644 index 00000000..af8a7445 --- /dev/null +++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/libubootenv_%.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI_append_rpi = " \ + file://fw_env.config \ + " + +do_install_append_rpi () { + install -d ${D}${sysconfdir} + install -m 0644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config +} diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend deleted file mode 100644 index 77649653..00000000 --- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot-fw-utils_%.bbappend +++ /dev/null @@ -1,9 +0,0 @@ - -do_install_append () { - - cat >${D}${sysconfdir}/fw_env.config <<EOF - -/mnt/bootpart/uboot.env 0x0000 0x4000 - -EOF -} diff --git a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend index 32812600..5032e217 100644 --- a/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend +++ b/external/meta-updater-raspberrypi/recipes-bsp/u-boot/u-boot_%.bbappend @@ -1,7 +1,32 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" -SRC_URI_append = " \ - file://0001-Enable-FIT-and-bootcount-on-RPi3.patch \ - file://0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch \ - file://0001-Increase-rpi-BOOTM_LEN.patch \ - " +SRC_URI_append_rpi = " \ + file://0001-Increase-rpi-BOOTM_LEN.patch \ + file://0001-board-raspberrypi-add-serial-and-revision-to-the-dev.patch \ + file://fit.cfg \ + file://bootcount.cfg \ + " + +SRC_URI_append_raspberrypi4 = " \ + file://rpi4-fixup-mem.cfg \ + " + +# build u-boot image suitable for use with qemu +# we need to masquerade a kernel uImage, due to qemu limitations +# (see https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg05094.html) +# thus, we cannot use u-boot default rule for u-boot.img which sets a correct +# "u-boot" as image type + +DEPENDS_append_rpi = " u-boot-mkimage-native" + +UBOOT_LOAD_ADDR = "0x8000" +UBOOT_LOAD_ADDR_raspberrypi3-64 = "0x80000" +UBOOT_LOAD_ADDR_raspberrypi4-64 = "0x80000" + +do_compile_append_rpi() { + uboot-mkimage -A arm -T kernel -C none -O linux -a ${UBOOT_LOAD_ADDR} -e ${UBOOT_LOAD_ADDR} -d ${B}/u-boot.bin ${B}/u-boot-qemu.img +} + +do_deploy_append_rpi() { + install -m 644 ${B}/u-boot-qemu.img ${DEPLOYDIR}/u-boot-qemu.img +} |