summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@theqtcompany.com>2015-08-21 09:16:14 +0200
committerGatis Paeglis <gatis.paeglis@digia.com>2015-10-12 13:39:51 +0000
commitc76b6f31bcc37557612e745d7715e63368b941ec (patch)
tree548d8cf457c009d5f6f92550450ac3771ab3a230 /examples
parent112e64cb0209340f2965e9660f8fcbb514741896 (diff)
OTA version 0.1
Now depends on https://github.com/GNOME/ostree/pull/149 The pull request is waiting for a review. Change-Id: I523ce588cecebbae7cee13ce3d5dfa875d9fb1b6 Reviewed-by: Rainer Keller <rainer.keller@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/README118
-rw-r--r--examples/beaglebone_black/uEnv.txt10
-rw-r--r--examples/nitrogen6x_max/6x_bootscript.txt169
3 files changed, 297 insertions, 0 deletions
diff --git a/examples/README b/examples/README
new file mode 100644
index 0000000..08bed44
--- /dev/null
+++ b/examples/README
@@ -0,0 +1,118 @@
+Example 1 - nitrogen6x_max board.
+
+ On this board a default bootcmd contains:
+
+ bootcmd =
+ for dtype in ${bootdevs}; do
+ if itest.s "xusb" == "x${dtype}" ; then
+ usb start ;
+ fi;
+ for disk in 0 1 ; do
+ ${dtype} dev ${disk} ;
+ for fs in fat ext2 ; do
+ ${fs}load ${dtype} ${disk}:1 10008000 /6x_bootscript&& source 10008000 ;
+ done ;
+ done ;
+ done;
+ setenv stdout serial,vga ; echo ;
+ echo 6x_bootscript not found ; echo ;
+ echo serial console at 115200, 8N1 ; echo ;
+ echo details at http://boundarydevices.com/6q_bootscript ;
+ setenv stdin serial,usbkbd
+
+ From where we see that it uses a compiled bootscript to import
+ an additional environment. To enable OSTree on this board we
+ can modify the default boot script by adding:
+
+ # Source OSTree environment.
+ if ${fs}load ${dtype} ${disk}:1 10800000 loader/uEnv.txt ; then
+ env import -t 10800000 $filesize
+ fi
+
+ # Use kernel_image and ramdisk_image values that were imported from the loader/uEnv.txt
+ ${fs}load ${dtype} ${disk}:1 10800000 ${kernel_image}
+ setenv ramdisk_addr 0x40000000
+ ${fs}load ${dtype} ${disk}:1 ${ramdisk_addr} ${ramdisk_image}
+
+ bootm 10800000 ${ramdisk_addr} 12000000
+
+Example 2 - beaglebone black
+
+ Tested on a device where: printe ver = U-Boot 2013.04-dirty (Jun 19 2013 - 09:57:14)
+
+ On this board a default bootcmd contains:
+
+ bootcmd=
+ gpio set 53;
+ i2c mw 0x24 1 0x3e;
+ run findfdt;
+ mmc dev 0;
+
+ if mmc rescan ; then
+ echo micro SD card found;
+ setenv mmcdev 0;
+ else
+ echo No micro SD card found, setting mmcdev to 1;
+ setenv mmcdev 1;
+ fi;
+
+ setenv bootpart ${mmcdev}:2;
+ mmc dev ${mmcdev};
+
+ if mmc rescan; then
+ gpio set 54;
+ echo SD/MMC found on device ${mmcdev};
+ if run loadbootenv; then
+ echo Loaded environment from ${bootenv};
+ run importbootenv;
+ fi;
+
+ if test -n $uenvcmd; then
+ echo Running uenvcmd ...;
+ run uenvcmd;
+ fi;
+
+ gpio set 55;
+
+ if run loaduimage; then
+ gpio set 56;
+ run loadfdt;
+ run mmcboot;
+ fi;
+ fi;
+
+ From where we see that it uses loadbootenv to import an additional environment.
+ To see what this command contains execute the following from u-boot console:
+
+ printe loadbootenv
+ loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}
+ printe bootenv
+ bootenv=uEnv.txt
+
+ Now we know that it sources /uEnv.txt. To enable OSTree on this board we will add
+ our custom commands in the /uEnv.txt file.
+
+ Default /uEnv.txt contains:
+
+ optargs=consoleblank=0 vt.global_cursor_default=0 quiet
+ # extra options to support older u-boot (2013)
+ bootfile=zImage
+ loadaddr=0x80200000
+ loaduimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
+ mmcboot=echo Booting from mmc ...; run mmcargs; bootz ${loadaddr} - ${fdtaddr}
+
+ After our changes it contains:
+
+ bootpart=0:1
+ bootdir=/
+ optargs=consoleblank=0 vt.global_cursor_default=0 quiet
+ loadostreeenv=setenv bootenv loader/uEnv.txt; if run loadbootenv; then echo Loaded environment from ${bootenv}; run importbootenv; fi;
+ mmcroot=/dev/mmcblk0p2
+ loaduimage=run loadostreeenv; load mmc ${bootpart} ${loadaddr} ${kernel_image}
+ loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
+ loadramdisk=load mmc ${mmcdev} ${rdaddr} ${ramdisk_image}
+ mmcargs=setenv bootargs $bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
+ mmcboot=run loadramdisk; echo Booting from mmc ....; run mmcargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
+
+ Notice how we insert the 'loadostreeenv' command before loading kernel and initramfs.
+
diff --git a/examples/beaglebone_black/uEnv.txt b/examples/beaglebone_black/uEnv.txt
new file mode 100644
index 0000000..1c1cff4
--- /dev/null
+++ b/examples/beaglebone_black/uEnv.txt
@@ -0,0 +1,10 @@
+bootpart=0:1
+bootdir=/
+optargs=consoleblank=0 vt.global_cursor_default=0 quiet
+loadostreeenv=setenv bootenv loader/uEnv.txt; if run loadbootenv; then echo Loaded environment from ${bootenv}; run importbootenv; fi;
+mmcroot=/dev/mmcblk0p2
+loaduimage=run loadostreeenv; load mmc ${bootpart} ${loadaddr} ${kernel_image}
+loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
+loadramdisk=load mmc ${mmcdev} ${rdaddr} ${ramdisk_image}
+mmcargs=setenv bootargs $bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
+mmcboot=run loadramdisk; echo Booting from mmc ....; run mmcargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
diff --git a/examples/nitrogen6x_max/6x_bootscript.txt b/examples/nitrogen6x_max/6x_bootscript.txt
new file mode 100644
index 0000000..aeb8415
--- /dev/null
+++ b/examples/nitrogen6x_max/6x_bootscript.txt
@@ -0,0 +1,169 @@
+# Yocto-specifics
+
+setenv bootpart 2
+setenv bootdir /
+
+if ${fs}load ${dtype} ${disk}:1 10800000 loader/uEnv.txt ; then
+ env import -t 10800000 $filesize
+fi
+
+if ${fs}load ${dtype} ${disk}:1 10800000 uEnv.txt ; then
+ env import -t 10800000 $filesize
+else
+ setenv bootargs $bootargs enable_wait_mode=off
+fi
+
+setenv nextcon 0;
+
+i2c dev 1 ;
+if i2c probe 0x50 ; then
+ setenv bootargs $bootargs video=mxcfb${nextcon}:dev=hdmi,1280x720M@60,if=RGB24
+ setenv fbmem "fbmem=28M";
+ setexpr nextcon $nextcon + 1
+else
+ echo "------ no HDMI monitor";
+fi
+
+i2c dev 2
+if i2c probe 0x04 ; then
+ setenv bootargs $bootargs video=mxcfb${nextcon}:dev=ldb,LDB-XGA,if=RGB666
+ if test "0" -eq $nextcon; then
+ setenv fbmem "fbmem=10M";
+ else
+ setenv fbmem ${fbmem},10M
+ fi
+ setexpr nextcon $nextcon + 1
+else
+ echo "------ no Freescale display";
+fi
+
+if i2c probe 0x38 ; then
+ if itest.s "xLDB-WXGA" == "x$panel"; then
+ setenv bootargs $bootargs video=mxcfb${nextcon}:dev=ldb,1280x800MR@60,if=RGB666
+ screenres=1280,800
+ else
+ setenv bootargs $bootargs video=mxcfb${nextcon}:dev=ldb,1024x600M@60,if=RGB666
+ screenres=1024,600
+ fi
+ if test "0" -eq $nextcon; then
+ setenv fbmem "fbmem=10M";
+ else
+ setenv fbmem ${fbmem},10M
+ fi
+ setexpr nextcon $nextcon + 1
+ setenv bootargs $bootargs ft5x06_ts.screenres=$screenres
+ if itest.s "x" -ne "x$calibration" ; then
+ setenv bootargs $bootargs ft5x06_ts.calibration=$calibration
+ fi
+else
+ echo "------ no ft5x06 touch controller";
+fi
+
+if i2c probe 0x41 ; then
+ setenv bootargs $bootargs video=mxcfb${nextcon}:dev=ldb,1024x600M@60,if=RGB666
+ if test "0" -eq $nextcon; then
+ setenv fbmem "fbmem=10M";
+ else
+ setenv fbmem ${fbmem},10M
+ fi
+ setexpr nextcon $nextcon + 1
+else
+ echo "------ no ILI210x touch controller";
+fi
+
+if i2c probe 0x48 ; then
+ if itest.s "xqvga" == "x$panel" ; then
+ display="320x240MR@60,if=RGB24";
+ else
+ display="CLAA-WVGA,if=RGB666";
+ fi
+ setenv bootargs $bootargs video=mxcfb${nextcon}:dev=lcd,$display
+ if test "0" -eq $nextcon; then
+ setenv fbmem "fbmem=10M";
+ else
+ setenv fbmem ${fbmem},10M
+ fi
+ setexpr nextcon $nextcon + 1
+else
+ echo "------ no 800x480 display";
+fi
+
+while test "4" -ne $nextcon ; do
+ setenv bootargs $bootargs video=mxcfb${nextcon}:off ;
+ setexpr nextcon $nextcon + 1 ;
+done
+
+setenv bootargs $bootargs $fbmem
+setenv bootargs "$bootargs console=ttymxc1,115200 vmalloc=400M consoleblank=0 rootwait"
+
+if itest.s x$bootpart == x ; then
+ bootpart=1
+fi
+
+if test "sata" = "${dtype}" ; then
+ setenv bootargs "$bootargs root=/dev/sda$bootpart" ;
+else
+ if test "usb" = "${dtype}" ; then
+ setenv bootargs "$bootargs root=/dev/sda$bootpart" ;
+ elif itest.s "x" == "x$sdphys" ; then
+ setenv bootargs "$bootargs root=/dev/mmcblk0p$bootpart" ;
+ elif itest 0 -eq ${disk}; then
+ setenv bootargs "$bootargs root=/dev/mmcblk2p$bootpart" ;
+ else
+ setenv bootargs "$bootargs root=/dev/mmcblk3p$bootpart" ;
+ fi
+fi
+
+if itest.s "x" == "x$dtbname" ; then
+ dtbname="imx6";
+ if itest.s x6SOLO == "x$cpu" ; then
+ dtbname=${dtbname}dl-;
+ elif itest.s x6DL == "x$cpu" ; then
+ dtbname=${dtbname}dl-;
+ else
+ dtbname=${dtbname}q-;
+ fi
+ if itest.s x == "x$board" ; then
+ board=sabrelite
+ fi
+ dtbname=${dtbname}${board}.dtb;
+fi
+
+if itest.s x == x${bootdir} ; then
+ bootdir=/boot/
+fi
+
+if ${fs}load ${dtype} ${disk}:1 12000000 ${bootdir}$dtbname ; then
+ havedtb=1;
+ setenv fdt_addr 0x11000000
+ setenv fdt_high 0xffffffff
+else
+ havedtb=
+fi
+
+if itest.s x == x$allow_noncea ; then
+ setenv bootargs $bootargs mxc_hdmi.only_cea=1;
+ echo "only CEA modes allowed on HDMI port";
+else
+ setenv bootargs $bootargs mxc_hdmi.only_cea=0;
+ echo "non-CEA modes allowed on HDMI, audio may be affected";
+fi
+
+if itest.s "x" != "x$disable_giga" ; then
+ setenv bootargs $bootargs fec.disable_giga=1
+fi
+
+if itest.s "x" != "x$wlmac" ; then
+ setenv bootargs $bootargs wlcore.mac=$wlmac
+fi
+
+${fs}load ${dtype} ${disk}:1 10800000 ${kernel_image}
+setenv ramdisk_addr 0x40000000
+${fs}load ${dtype} ${disk}:1 ${ramdisk_addr} ${ramdisk_image}
+
+bootm 10800000 ${ramdisk_addr} 12000000
+
+echo "Error loading kernel image"
+
+
+