diff options
author | Khang Nguyen <khang.nguyen.xw@renesas.com> | 2019-07-04 15:15:25 +0700 |
---|---|---|
committer | Khang Nguyen <khang.nguyen.xw@renesas.com> | 2019-07-11 07:53:47 +0700 |
commit | 5c4f15912b8b346df386bd14d8a1f3eb12aa8677 (patch) | |
tree | 2a947146c22fd140448b38223a21569836b1feeb | |
parent | 57925b1201701288fd3d501dcb050ceb95638c57 (diff) |
rcar-gen3: rauc: Add support U-boot
This commit adds patches and configuration to support for U-boot bundle.
Change-Id: I66e61d7d0fde8dcba17dec5ed95629063369125d
Signed-off-by: Khang Nguyen <khang.nguyen.xw@renesas.com>
4 files changed, 64 insertions, 0 deletions
diff --git a/meta-rcar-gen3/recipes-core/rauc/rauc/Add-bin-image-for-boot-emmc.patch b/meta-rcar-gen3/recipes-core/rauc/rauc/Add-bin-image-for-boot-emmc.patch new file mode 100644 index 0000000..b4ae6f8 --- /dev/null +++ b/meta-rcar-gen3/recipes-core/rauc/rauc/Add-bin-image-for-boot-emmc.patch @@ -0,0 +1,12 @@ +Index: rauc-1.1/src/update_handler.c +=================================================================== +--- rauc-1.1.orig/src/update_handler.c ++++ rauc-1.1/src/update_handler.c +@@ -1389,6 +1389,7 @@ RaucUpdatePair updatepairs[] = { + {"*.squashfs", "ubivol", img_to_ubivol_handler}, + #if ENABLE_EMMC_BOOT_SUPPORT == 1 + {"*.img", "boot-emmc", img_to_boot_emmc_handler}, ++ {"*.bin", "boot-emmc", img_to_boot_emmc_handler}, + #endif + {"*.img", "*", img_to_raw_handler}, /* fallback */ + {0} diff --git a/meta-rcar-gen3/recipes-core/rauc/rauc/Disable-toggle-active-eMMC-boot-partition.patch b/meta-rcar-gen3/recipes-core/rauc/rauc/Disable-toggle-active-eMMC-boot-partition.patch new file mode 100644 index 0000000..277ab35 --- /dev/null +++ b/meta-rcar-gen3/recipes-core/rauc/rauc/Disable-toggle-active-eMMC-boot-partition.patch @@ -0,0 +1,45 @@ +Index: rauc-1.1/src/update_handler.c +=================================================================== +--- rauc-1.1.orig/src/update_handler.c ++++ rauc-1.1/src/update_handler.c +@@ -1241,40 +1241,6 @@ static gboolean img_to_boot_emmc_handler + goto out; + } + +- /* toggle active boot partition in ext_csd register; do this explicitly on +- * determined boot partition to force the kernel to switch to the partition; +- * for simplicity reasons: in case the user partition is active use +- * mmcblkXboot1, in case no partition is active use mmcblkXboot0 +- */ +- g_debug("Toggling active eMMC boot partition %s -> %s", part_active_str, +- part_slot->device); +- res = r_emmc_write_bootpart( +- part_slot->device, +- INACTIVE_BOOT_PARTITION(part_active), +- &ierror); +- if (!res) { +- g_propagate_error(error, ierror); +- goto out; +- } +- +- /* sanity check: read active boot partition from ext_csd +- * +- * Read explicitly from root device (this forces another kernel +- * partition switch and should trigger the ext_csd bug more reliably). +- */ +- res = r_emmc_read_bootpart(dest_slot->device, &part_active_after, &ierror); +- if (!res) { +- g_propagate_error(error, ierror); +- goto out; +- } +- +- if (part_active == part_active_after) { +- g_set_error(error, R_UPDATE_ERROR, R_UPDATE_ERROR_FAILED, +- "Toggling the boot partition failed! Your kernel is most-likely affected by the ioctl ext_csd bug: see http://rauc.readthedocs.io/en/latest/advanced.html#update-emmc-boot-partitions"); +- res = FALSE; +- goto out; +- } +- + g_message("Boot partition %s is now active", part_slot->device); + + /* run slot post install hook if enabled */ diff --git a/meta-rcar-gen3/recipes-core/rauc/rauc/system.conf b/meta-rcar-gen3/recipes-core/rauc/rauc/system.conf index 847e207..4719f03 100644 --- a/meta-rcar-gen3/recipes-core/rauc/rauc/system.conf +++ b/meta-rcar-gen3/recipes-core/rauc/rauc/system.conf @@ -1,6 +1,7 @@ [system] compatible=@MACHINENAME@ bootloader=uboot +mountprefix=/mnt/rauc [keyring] path=/etc/rauc/rauc-sample-ca.cert.pem @@ -14,3 +15,7 @@ bootname=A device=/dev/mmcblk0p2 type=ext4 bootname=B + +[slot.bootloader.0] +device=/dev/mmcblk0 +type=boot-emmc diff --git a/meta-rcar-gen3/recipes-core/rauc/rauc_%.bbappend b/meta-rcar-gen3/recipes-core/rauc/rauc_%.bbappend index c32227c..9807dcd 100644 --- a/meta-rcar-gen3/recipes-core/rauc/rauc_%.bbappend +++ b/meta-rcar-gen3/recipes-core/rauc/rauc_%.bbappend @@ -3,6 +3,8 @@ FILESEXTRAPATHS_prepend_rcar-gen3 := "${THISDIR}/${PN}:" SRC_URI_append_rcar-gen3 = " \ file://system.conf \ file://rauc_enable_fw_set \ + file://Add-bin-image-for-boot-emmc.patch \ + file://Disable-toggle-active-eMMC-boot-partition.patch \ " RAUC_KEYRING_FILE_rcar-gen3 := "${THISDIR}/${PN}/rauc-sample-ca.cert.pem" |