summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Keller <rainer.keller@digia.com>2014-09-03 15:17:03 +0200
committerRainer Keller <rainer.keller@digia.com>2014-09-09 11:13:03 +0300
commitff3975413e518b9435ae2239d29fee0c6295c17c (patch)
tree78aacd5f440444baa132fee536200bcb91b16fe1
parentded8f630fd877095aafa679c3c0120fe913483cd (diff)
downloadmeta-boot2qt-ff3975413e518b9435ae2239d29fee0c6295c17c.tar.gz
Add update support to u-boot script
Change-Id: I519a91c57db891c16ccd1d8f61e622d8b16a3a2c Reviewed-by: Samuli Piippo <samuli.piippo@digia.com>
-rw-r--r--recipes/u-boot/u-boot-script-boundary/0002-nitrogen6x-update.patch81
-rw-r--r--recipes/u-boot/u-boot-script-boundary_git.bbappend1
2 files changed, 82 insertions, 0 deletions
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 @@
1From 3d7276b2b27317c5067d2095ea5c3952d11f4390 Mon Sep 17 00:00:00 2001
2From: Rainer Keller <rainer.keller@digia.com>
3Date: Fri, 5 Sep 2014 14:39:50 +0200
4Subject: [PATCH] Add support for update recovery linux
5
6---
7 board/boundary/nitrogen6x/6x_bootscript-yocto.txt | 61 +++++++++++++++++++++++
8 1 file changed, 61 insertions(+)
9
10diff --git a/board/boundary/nitrogen6x/6x_bootscript-yocto.txt b/board/boundary/nitrogen6x/6x_bootscript-yocto.txt
11index 5bc6170..4116ed4 100644
12--- a/board/boundary/nitrogen6x/6x_bootscript-yocto.txt
13+++ b/board/boundary/nitrogen6x/6x_bootscript-yocto.txt
14@@ -1,3 +1,64 @@
15+# Boot2Qt update part begin
16+echo "Boot to Qt"
17+if test "x$boot2qt_update_state" = "x" ; then
18+ setenv boot2qt_update_state valid
19+ saveenv
20+fi
21+
22+# This is a workaround because environment partition is read-only.
23+if fatload mmc 1:1 0x12000000 update/state ; then
24+ mw.b 0x13000000 0x76 1 # v
25+ mw.b 0x13000001 0x75 1 # u
26+ mw.b 0x13000002 0x74 1 # t
27+
28+ if cmp.b 0x12000000 0x13000000 1 ; then
29+ echo "State: Valid"
30+ setenv boot2qt_fat_state valid
31+ setenv boot2qt_update_state valid
32+ saveenv
33+ fi
34+ if cmp.b 0x12000000 0x13000001 1 ; then
35+ echo "State: Update"
36+ setenv boot2qt_fat_state update
37+ fi
38+ if cmp.b 0x12000000 0x13000002 1 ; then
39+ echo "State: Testing"
40+ setenv boot2qt_fat_state testing
41+ fi
42+fi
43+
44+if test "x$boot2qt_fat_state" = "xupdate" || test "x$boot2qt_update_state" = "xinvalid" ; then
45+ setenv boot2qt_update_state testing
46+ saveenv
47+ echo "Recovery linux starting..."
48+ setenv bootargs "console=ttymxc1,115200 vmalloc=400M consoleblank=0 vt.global_cursor_default=0 root=/dev/ram0"
49+
50+ # Guess dtb name
51+ dtbname="imx6";
52+ if itest.s x6S != "x\$cpu" ; then
53+ dtbname=\${dtbname}q-;
54+ else
55+ dtbname=\${dtbname}s-;
56+ fi
57+
58+ if itest.s x == "x\$board" ; then
59+ board=sabrelite
60+ fi
61+ dtbname=\${dtbname}\${board}.dtb;
62+
63+ fatload mmc 1:1 0x10800000 update/uImage
64+ fatload mmc 1:1 0x12000000 update/${dtbname}
65+ fatload mmc 1:1 0x13000000 update/uRamdisk
66+ bootm 0x10800000 0x13000000 0x12000000
67+fi
68+
69+if test "x$boot2qt_fat_state" = "xtesting" || test "x$boot2qt_update_state" = "xtesting"; then
70+ setenv boot2qt_update_state invalid
71+ saveenv
72+fi
73+
74+# Boot2Qt update part end
75+
76 # Yocto-specifics
77 setenv bootpart 2
78 setenv bootdir /
79--
801.8.5.5
81
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 @@
23FILESEXTRAPATHS_append := "${THISDIR}/${PN}:" 23FILESEXTRAPATHS_append := "${THISDIR}/${PN}:"
24SRC_URI += " \ 24SRC_URI += " \
25 file://0001-nitrogen6x-disable-console-cursor-blinking.patch \ 25 file://0001-nitrogen6x-disable-console-cursor-blinking.patch \
26 file://0002-nitrogen6x-update.patch \
26 " 27 "