]> code.ossystems Code Review - meta-freescale.git/commitdiff
wic: Fix image generation for i.MX MXS SoC family
authorOtavio Salvador <otavio@ossystems.com.br>
Thu, 26 Apr 2018 16:52:55 +0000 (13:52 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 3 Jul 2018 21:41:08 +0000 (18:41 -0300)
The image needs to use the U-Boot generated, for the uSD card, so a
dependency on that must be added to ensure the file is available prior
'wic' uses it.

Besides that, the fstype needs to be changed so it sets the partition
mark allowing the bootrom to find it.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
classes/image_types_fsl.bbclass
conf/machine/include/imx-base.inc
wic/imx-uboot-mxs-bootpart.wks.in [moved from wic/imx-uboot-mxs-bootpart.wks with 85% similarity]
wic/imx-uboot-mxs.wks.in [moved from wic/imx-uboot-mxs.wks with 81% similarity]

index 4709af9521e4b8f89232034bfc05de253a52c0b3..e7627200b838512f89952e280f2198ac87059fc8 100644 (file)
@@ -312,3 +312,17 @@ IMAGE_TYPEDEP_sdcard_append = " \
     ${@bb.utils.contains('IMAGE_FSTYPES', 'uboot-mxsboot-sdcard', 'uboot-mxsboot-sdcard', '', d)} \
     ${@bb.utils.contains('IMAGE_FSTYPES', 'barebox-mxsboot-sdcard', 'barebox-mxsboot-sdcard', '', d)} \
 "
+
+# In case we are building for i.MX23 or i.MX28 we need to have the
+# image stream built before the wic generation
+do_image_wic[depends] += " \
+    ${@bb.utils.contains('IMAGE_FSTYPES', 'uboot-mxsboot-sdcard', \
+                                          '${IMAGE_BASENAME}:do_image_uboot_mxsboot_sdcard', '', d)} \
+"
+
+# We need to apply a fixup inside of the partition table
+IMAGE_CMD_wic_append_mxs() {
+       # Change partition type for mxs processor family
+       bbnote "Setting partition type to 0x53 as required for mxs' SoC family."
+       echo -n S | dd of=$out${IMAGE_NAME_SUFFIX}.wic bs=1 count=1 seek=450 conv=notrunc
+}
index d14cd53fccd171794d60450fe804368a6aad4d1d..facbe145453d62e82765fe10860829e4eec25e53 100644 (file)
@@ -291,7 +291,7 @@ WKS_FILE_DEPENDS ?= " \
 "
 
 SOC_DEFAULT_WKS_FILE ?= "imx-uboot-bootpart.wks"
-SOC_DEFAULT_WKS_FILE_mxs ?= "imx-uboot-mxs-bootpart.wks"
+SOC_DEFAULT_WKS_FILE_mxs ?= "imx-uboot-mxs-bootpart.wks.in"
 
 WKS_FILE ?= "${SOC_DEFAULT_WKS_FILE}"
 
similarity index 85%
rename from wic/imx-uboot-mxs-bootpart.wks
rename to wic/imx-uboot-mxs-bootpart.wks.in
index 0e96ab3aa45c521a6d2f73bf8e73e365f3bfc0df..8b5bdd4872db925dc8225540e5976ba83be8a0c5 100644 (file)
@@ -12,7 +12,7 @@
 # | |         |              |
 # 0 1kiB    4MiB          16MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
 #
-part u-boot --source rawcopy --sourceparams="file=u-boot.sb" --ondisk mmcblk --no-table --align 1
+part u-boot --source rawcopy --sourceparams="file=${IMAGE_NAME}.rootfs.uboot-mxsboot-sdcard" --ondisk mmcblk --align 1024
 part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 16
 part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
 
similarity index 81%
rename from wic/imx-uboot-mxs.wks
rename to wic/imx-uboot-mxs.wks.in
index 0f5c51d47db450fbcf04c6678484ce71b04c0693..44b6f931913daf13651c8a8f21cae92195020207 100644 (file)
@@ -12,7 +12,7 @@
 # | |         |              |
 # 0 1kiB    4MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
 #
-part u-boot --source rawcopy --sourceparams="file=u-boot.sb" --ondisk mmcblk --no-table --align 1
+part u-boot --source rawcopy --sourceparams="file=${IMAGE_NAME}.rootfs.uboot-mxsboot-sdcard" --ondisk mmcblk --align 1024
 part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096
 
 bootloader --ptable msdos