aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/image/gen_sdcard_head_img.sh
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2018-07-18 14:14:40 +0800
committerHauke Mehrtens <hauke@hauke-m.de>2018-09-22 21:20:57 +0200
commiteb684205e5e6958ad71cf4a179fa776f6507f7e3 (patch)
treefe6803b86bdfd42e65cbf894854e47c307d992fa /target/linux/layerscape/image/gen_sdcard_head_img.sh
parentf0ec7bd27d206ea0eb9587e178ce0d7ddc006bce (diff)
downloadupstream-eb684205e5e6958ad71cf4a179fa776f6507f7e3.tar.gz
upstream-eb684205e5e6958ad71cf4a179fa776f6507f7e3.tar.bz2
upstream-eb684205e5e6958ad71cf4a179fa776f6507f7e3.zip
layerscape: add SD card boot support
NOR/QSPI Flash on Layerscape board only has limited 64MB memory size. Since some boards (ls1043ardb/ls1046ardb/ls1088ardb/ls1021atwr) could support SD card boot, we added SD boot support for them to put all things on SD card to meet large memory requirement. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Diffstat (limited to 'target/linux/layerscape/image/gen_sdcard_head_img.sh')
-rwxr-xr-xtarget/linux/layerscape/image/gen_sdcard_head_img.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/target/linux/layerscape/image/gen_sdcard_head_img.sh b/target/linux/layerscape/image/gen_sdcard_head_img.sh
new file mode 100755
index 0000000000..dc1efbb3e0
--- /dev/null
+++ b/target/linux/layerscape/image/gen_sdcard_head_img.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+#
+# Copyright 2018 NXP
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+set -x
+[ $# -eq 3 ] || {
+ echo "SYNTAX: $0 <file> <rootfs part offset> <rootfs size>"
+ exit 1
+}
+
+OUTPUT="$1"
+ROOTFSOFFSET="$(($2 * 1024))"
+ROOTFSSIZE="$3"
+
+head=4
+sect=16
+
+set `ptgen -o $OUTPUT -h $head -s $sect -l $ROOTFSOFFSET -t 83 -p ${ROOTFSSIZE}M`