From ff3975413e518b9435ae2239d29fee0c6295c17c Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Wed, 3 Sep 2014 15:17:03 +0200 Subject: Add update support to u-boot script Change-Id: I519a91c57db891c16ccd1d8f61e622d8b16a3a2c Reviewed-by: Samuli Piippo --- .../0002-nitrogen6x-update.patch | 81 ++++++++++++++++++++++ recipes/u-boot/u-boot-script-boundary_git.bbappend | 1 + 2 files changed, 82 insertions(+) create mode 100644 recipes/u-boot/u-boot-script-boundary/0002-nitrogen6x-update.patch diff --git a/recipes/u-boot/u-boot-script-boundary/0002-nitrogen6x-update.patch b/recipes/u-boot/u-boot-script-boundary/0002-nitrogen6x-update.patch new file mode 100644 index 0000000..995e418 --- /dev/null +++ b/recipes/u-boot/u-boot-script-boundary/0002-nitrogen6x-update.patch @@ -0,0 +1,81 @@ +From 3d7276b2b27317c5067d2095ea5c3952d11f4390 Mon Sep 17 00:00:00 2001 +From: Rainer Keller +Date: Fri, 5 Sep 2014 14:39:50 +0200 +Subject: [PATCH] Add support for update recovery linux + +--- + board/boundary/nitrogen6x/6x_bootscript-yocto.txt | 61 +++++++++++++++++++++++ + 1 file changed, 61 insertions(+) + +diff --git a/board/boundary/nitrogen6x/6x_bootscript-yocto.txt b/board/boundary/nitrogen6x/6x_bootscript-yocto.txt +index 5bc6170..4116ed4 100644 +--- a/board/boundary/nitrogen6x/6x_bootscript-yocto.txt ++++ b/board/boundary/nitrogen6x/6x_bootscript-yocto.txt +@@ -1,3 +1,64 @@ ++# Boot2Qt update part begin ++echo "Boot to Qt" ++if test "x$boot2qt_update_state" = "x" ; then ++ setenv boot2qt_update_state valid ++ saveenv ++fi ++ ++# This is a workaround because environment partition is read-only. ++if fatload mmc 1:1 0x12000000 update/state ; then ++ mw.b 0x13000000 0x76 1 # v ++ mw.b 0x13000001 0x75 1 # u ++ mw.b 0x13000002 0x74 1 # t ++ ++ if cmp.b 0x12000000 0x13000000 1 ; then ++ echo "State: Valid" ++ setenv boot2qt_fat_state valid ++ setenv boot2qt_update_state valid ++ saveenv ++ fi ++ if cmp.b 0x12000000 0x13000001 1 ; then ++ echo "State: Update" ++ setenv boot2qt_fat_state update ++ fi ++ if cmp.b 0x12000000 0x13000002 1 ; then ++ echo "State: Testing" ++ setenv boot2qt_fat_state testing ++ fi ++fi ++ ++if test "x$boot2qt_fat_state" = "xupdate" || test "x$boot2qt_update_state" = "xinvalid" ; then ++ setenv boot2qt_update_state testing ++ saveenv ++ echo "Recovery linux starting..." ++ setenv bootargs "console=ttymxc1,115200 vmalloc=400M consoleblank=0 vt.global_cursor_default=0 root=/dev/ram0" ++ ++ # Guess dtb name ++ dtbname="imx6"; ++ if itest.s x6S != "x\$cpu" ; then ++ dtbname=\${dtbname}q-; ++ else ++ dtbname=\${dtbname}s-; ++ fi ++ ++ if itest.s x == "x\$board" ; then ++ board=sabrelite ++ fi ++ dtbname=\${dtbname}\${board}.dtb; ++ ++ fatload mmc 1:1 0x10800000 update/uImage ++ fatload mmc 1:1 0x12000000 update/${dtbname} ++ fatload mmc 1:1 0x13000000 update/uRamdisk ++ bootm 0x10800000 0x13000000 0x12000000 ++fi ++ ++if test "x$boot2qt_fat_state" = "xtesting" || test "x$boot2qt_update_state" = "xtesting"; then ++ setenv boot2qt_update_state invalid ++ saveenv ++fi ++ ++# Boot2Qt update part end ++ + # Yocto-specifics + setenv bootpart 2 + setenv bootdir / +-- +1.8.5.5 + diff --git a/recipes/u-boot/u-boot-script-boundary_git.bbappend b/recipes/u-boot/u-boot-script-boundary_git.bbappend index 083b2fd..a479c2b 100644 --- a/recipes/u-boot/u-boot-script-boundary_git.bbappend +++ b/recipes/u-boot/u-boot-script-boundary_git.bbappend @@ -23,4 +23,5 @@ FILESEXTRAPATHS_append := "${THISDIR}/${PN}:" SRC_URI += " \ file://0001-nitrogen6x-disable-console-cursor-blinking.patch \ + file://0002-nitrogen6x-update.patch \ " -- cgit v1.2.3-54-g00ecf