From: Fabio Estevam Date: Sun, 6 Nov 2016 22:43:27 +0000 (-0200) Subject: freescale: Create the board/freescale/common/imx/ directory X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e3f6475801067c8d0ef0c90a56a357105c5faa34;p=buildroot.git freescale: Create the board/freescale/common/imx/ directory In order to have a better hierarchy for the genimage scripts used by NXP mx25, mx51, mx53, mx6, mx7 SoCs, let's place them inside the board/freescale/common/imx/ directory. This helps in creating a more natural separation between the mxs scripts that are placed inside the board/freescale/common/mxs/ directory. Suggested-by: Thomas Petazzoni Signed-off-by: Fabio Estevam Signed-off-by: Thomas Petazzoni --- diff --git a/board/freescale/common/genimage.cfg.template b/board/freescale/common/genimage.cfg.template deleted file mode 100644 index acce058b2a..0000000000 --- a/board/freescale/common/genimage.cfg.template +++ /dev/null @@ -1,40 +0,0 @@ -# Minimal SD card image for the Freescale boards Template -# -# We mimic the .sdcard Freescale's image format: -# * the SD card must have 1 kB free space at the beginning, -# * U-Boot is dumped as is, -# * a FAT partition at offset 8 MB is containing zImage/uImage and DTB files -# * a single root filesystem partition is required (ext2, ext3 or ext4) -# - -image boot.vfat { - vfat { - files = { - %FILES% - } - } - size = 16M -} - -image sdcard.img { - hdimage { - } - - partition u-boot { - in-partition-table = "no" - image = "u-boot.imx" - offset = 1024 - } - - partition boot { - partition-type = 0xC - bootable = "true" - image = "boot.vfat" - offset = 8M - } - - partition rootfs { - partition-type = 0x83 - image = "rootfs.ext2" - } -} diff --git a/board/freescale/common/imx/genimage.cfg.template b/board/freescale/common/imx/genimage.cfg.template new file mode 100644 index 0000000000..acce058b2a --- /dev/null +++ b/board/freescale/common/imx/genimage.cfg.template @@ -0,0 +1,40 @@ +# Minimal SD card image for the Freescale boards Template +# +# We mimic the .sdcard Freescale's image format: +# * the SD card must have 1 kB free space at the beginning, +# * U-Boot is dumped as is, +# * a FAT partition at offset 8 MB is containing zImage/uImage and DTB files +# * a single root filesystem partition is required (ext2, ext3 or ext4) +# + +image boot.vfat { + vfat { + files = { + %FILES% + } + } + size = 16M +} + +image sdcard.img { + hdimage { + } + + partition u-boot { + in-partition-table = "no" + image = "u-boot.imx" + offset = 1024 + } + + partition boot { + partition-type = 0xC + bootable = "true" + image = "boot.vfat" + offset = 8M + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext2" + } +} diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh new file mode 100755 index 0000000000..9e4da82dc7 --- /dev/null +++ b/board/freescale/common/imx/post-image.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +# +# dtb_list extracts the list of DTB files from BR2_LINUX_KERNEL_INTREE_DTS_NAME +# in ${BR_CONFIG}, then prints the corresponding list of file names for the +# genimage configuration file +# +dtb_list() +{ + local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})" + + for dt in $DTB_LIST; do + echo -n "\"$dt.dtb\", " + done +} + +# +# linux_image extracts the Linux image format from BR2_LINUX_KERNEL_UIMAGE in +# ${BR_CONFIG}, then prints the corresponding file name for the genimage +# configuration file +# +linux_image() +{ + if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then + echo "\"uImage\"" + else + echo "\"zImage\"" + fi +} + +main() +{ + local FILES="$(dtb_list) $(linux_image)" + local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)" + local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" + + sed -e "s/%FILES%/${FILES}/" \ + board/freescale/common/imx/genimage.cfg.template > ${GENIMAGE_CFG} + + rm -rf "${GENIMAGE_TMP}" + + genimage \ + --rootpath "${TARGET_DIR}" \ + --tmppath "${GENIMAGE_TMP}" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "${GENIMAGE_CFG}" + + rm -f ${GENIMAGE_CFG} + + exit $? +} + +main $@ diff --git a/board/freescale/common/post-image.sh b/board/freescale/common/post-image.sh deleted file mode 100755 index 7d48550a5a..0000000000 --- a/board/freescale/common/post-image.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash - -# -# dtb_list extracts the list of DTB files from BR2_LINUX_KERNEL_INTREE_DTS_NAME -# in ${BR_CONFIG}, then prints the corresponding list of file names for the -# genimage configuration file -# -dtb_list() -{ - local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})" - - for dt in $DTB_LIST; do - echo -n "\"$dt.dtb\", " - done -} - -# -# linux_image extracts the Linux image format from BR2_LINUX_KERNEL_UIMAGE in -# ${BR_CONFIG}, then prints the corresponding file name for the genimage -# configuration file -# -linux_image() -{ - if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then - echo "\"uImage\"" - else - echo "\"zImage\"" - fi -} - -main() -{ - local FILES="$(dtb_list) $(linux_image)" - local GENIMAGE_CFG="$(mktemp --suffix genimage.cfg)" - local GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" - - sed -e "s/%FILES%/${FILES}/" \ - board/freescale/common/genimage.cfg.template > ${GENIMAGE_CFG} - - rm -rf "${GENIMAGE_TMP}" - - genimage \ - --rootpath "${TARGET_DIR}" \ - --tmppath "${GENIMAGE_TMP}" \ - --inputpath "${BINARIES_DIR}" \ - --outputpath "${BINARIES_DIR}" \ - --config "${GENIMAGE_CFG}" - - rm -f ${GENIMAGE_CFG} - - exit $? -} - -main $@ diff --git a/board/freescale/imx25pdk/readme.txt b/board/freescale/imx25pdk/readme.txt index df7c617264..1aece6c9b3 100644 --- a/board/freescale/imx25pdk/readme.txt +++ b/board/freescale/imx25pdk/readme.txt @@ -40,7 +40,7 @@ command as root: *** WARNING! This will destroy all the card content. Use with care! *** For details about the medium image layout, see the definition in -board/freescale/common/genimage.cfg.template. +board/freescale/common/imx/genimage.cfg.template. Boot the i.MX25 PDK board ========================= diff --git a/board/freescale/imx51evk/readme.txt b/board/freescale/imx51evk/readme.txt index bf739fd659..d67a3fd724 100644 --- a/board/freescale/imx51evk/readme.txt +++ b/board/freescale/imx51evk/readme.txt @@ -40,7 +40,7 @@ command as root: *** WARNING! This will destroy all the card content. Use with care! *** For details about the medium image layout, see the definition in -board/freescale/common/genimage.cfg.template. +board/freescale/common/imx/genimage.cfg.template. Boot the i.MX51 EVK board ========================= diff --git a/board/freescale/imx6sabre/readme.txt b/board/freescale/imx6sabre/readme.txt index e409d8f190..a1bd82fdc7 100644 --- a/board/freescale/imx6sabre/readme.txt +++ b/board/freescale/imx6sabre/readme.txt @@ -71,7 +71,7 @@ command as root: *** WARNING! The script will destroy all the card content. Use with care! *** For details about the medium image layout, see the definition in -board/freescale/common/genimage.cfg.template. +board/freescale/common/imx/genimage.cfg.template. Boot the SABRE board ==================== diff --git a/board/freescale/imx6ulevk/readme.txt b/board/freescale/imx6ulevk/readme.txt index 98de2775db..25b95fec52 100644 --- a/board/freescale/imx6ulevk/readme.txt +++ b/board/freescale/imx6ulevk/readme.txt @@ -43,7 +43,7 @@ command as root: *** WARNING! This will destroy all the card content. Use with care! *** For details about the medium image layout, see the definition in -board/freescale/common/genimage.cfg.template. +board/freescale/common/imx/genimage.cfg.template. Boot the i.MX6UL EVK board ========================= diff --git a/board/freescale/imx7dsdb/readme.txt b/board/freescale/imx7dsdb/readme.txt index 9aeeb166d8..c6030f6965 100644 --- a/board/freescale/imx7dsdb/readme.txt +++ b/board/freescale/imx7dsdb/readme.txt @@ -40,7 +40,7 @@ command as root: *** WARNING! This will destroy all the card content. Use with care! *** For details about the medium image layout, see the definition in -board/freescale/common/genimage.cfg.template. +board/freescale/common/imx/genimage.cfg.template. Boot the i.MX7D SDB board ========================= diff --git a/board/technexion/imx6ulpico/readme.txt b/board/technexion/imx6ulpico/readme.txt index a7c3a445d0..7eab3f6b86 100644 --- a/board/technexion/imx6ulpico/readme.txt +++ b/board/technexion/imx6ulpico/readme.txt @@ -46,7 +46,7 @@ command as root: *** WARNING! This will destroy all the card content. Use with care! *** For details about the medium image layout, see the definition in -board/freescale/common/genimage.cfg.template. +board/freescale/common/imx/genimage.cfg.template. Boot the i.MX6UL Pico board ========================= diff --git a/configs/freescale_imx6dlsabreauto_defconfig b/configs/freescale_imx6dlsabreauto_defconfig index ed5f67cab2..1cf5fee0fd 100644 --- a/configs/freescale_imx6dlsabreauto_defconfig +++ b/configs/freescale_imx6dlsabreauto_defconfig @@ -21,7 +21,7 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-sabreauto" # filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y diff --git a/configs/freescale_imx6dlsabresd_defconfig b/configs/freescale_imx6dlsabresd_defconfig index 0cbe974477..904f0a2442 100644 --- a/configs/freescale_imx6dlsabresd_defconfig +++ b/configs/freescale_imx6dlsabresd_defconfig @@ -21,7 +21,7 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6dl-sabresd" # filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y # required tools to create the microSD image diff --git a/configs/freescale_imx6qsabreauto_defconfig b/configs/freescale_imx6qsabreauto_defconfig index 9ae2f813e7..64efd42195 100644 --- a/configs/freescale_imx6qsabreauto_defconfig +++ b/configs/freescale_imx6qsabreauto_defconfig @@ -21,7 +21,7 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabreauto" # filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y diff --git a/configs/freescale_imx6qsabresd_defconfig b/configs/freescale_imx6qsabresd_defconfig index 913a724212..962c274d60 100644 --- a/configs/freescale_imx6qsabresd_defconfig +++ b/configs/freescale_imx6qsabresd_defconfig @@ -21,7 +21,7 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-sabresd" # filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y diff --git a/configs/freescale_imx6sololiteevk_defconfig b/configs/freescale_imx6sololiteevk_defconfig index 79ebcb83c2..bf0b9e5f2d 100644 --- a/configs/freescale_imx6sololiteevk_defconfig +++ b/configs/freescale_imx6sololiteevk_defconfig @@ -18,7 +18,7 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6sl-evk" # filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y # required tools to create the microSD image diff --git a/configs/freescale_imx6sxsabresd_defconfig b/configs/freescale_imx6sxsabresd_defconfig index fed1a3e08a..9b5cdb85e4 100644 --- a/configs/freescale_imx6sxsabresd_defconfig +++ b/configs/freescale_imx6sxsabresd_defconfig @@ -21,7 +21,7 @@ BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6sx-sdb" # filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y # required tools to create the microSD image diff --git a/configs/freescale_imx6ulevk_defconfig b/configs/freescale_imx6ulevk_defconfig index d033b9950c..3c5a9099a0 100644 --- a/configs/freescale_imx6ulevk_defconfig +++ b/configs/freescale_imx6ulevk_defconfig @@ -31,6 +31,6 @@ BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y # filesystem / image -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y diff --git a/configs/freescale_imx7dsabresd_defconfig b/configs/freescale_imx7dsabresd_defconfig index 4bedef10be..97d3cde16e 100644 --- a/configs/freescale_imx7dsabresd_defconfig +++ b/configs/freescale_imx7dsabresd_defconfig @@ -33,4 +33,4 @@ BR2_TARGET_UBOOT_FORMAT_IMX=y BR2_PACKAGE_HOST_DOSFSTOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" diff --git a/configs/imx6ulpico_defconfig b/configs/imx6ulpico_defconfig index 71277d9b82..88604a6627 100644 --- a/configs/imx6ulpico_defconfig +++ b/configs/imx6ulpico_defconfig @@ -45,6 +45,6 @@ BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y # filesystem / image -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y diff --git a/configs/mx25pdk_defconfig b/configs/mx25pdk_defconfig index 645fe8a13a..65a6d12f56 100644 --- a/configs/mx25pdk_defconfig +++ b/configs/mx25pdk_defconfig @@ -14,7 +14,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y # Filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y diff --git a/configs/mx51evk_defconfig b/configs/mx51evk_defconfig index 1fca282536..db82a36eaa 100644 --- a/configs/mx51evk_defconfig +++ b/configs/mx51evk_defconfig @@ -14,7 +14,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y # Filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y diff --git a/configs/mx53loco_defconfig b/configs/mx53loco_defconfig index 94ac818d1b..7597ae9ca7 100644 --- a/configs/mx53loco_defconfig +++ b/configs/mx53loco_defconfig @@ -14,7 +14,7 @@ BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MTOOLS=y # Filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index 31251f4645..a55a5049cf 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -38,7 +38,7 @@ BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y # Filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y diff --git a/configs/warpboard_defconfig b/configs/warpboard_defconfig index 5e9c0514b7..531a8783b1 100644 --- a/configs/warpboard_defconfig +++ b/configs/warpboard_defconfig @@ -42,7 +42,7 @@ BR2_PACKAGE_HOST_DFU_UTIL=y BR2_PACKAGE_HOST_IMX_USB_LOADER=y # Filesystem -BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/post-image.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh" BR2_TARGET_ROOTFS_EXT2=y BR2_TARGET_ROOTFS_EXT2_4=y