linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: david@lechnology.com (David Lechner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] ARM: dts: da850-lego-ev3: Add node for reboot modes
Date: Thu, 11 Jan 2018 20:29:50 -0600	[thread overview]
Message-ID: <1515724191-30499-2-git-send-email-david@lechnology.com> (raw)
In-Reply-To: <1515724191-30499-1-git-send-email-david@lechnology.com>

This adds a new node for reboot modes on LEGO MINDSTORMS EV3. The EV3's
bootloader looks for a magic number in the ARM local RAM and if found,
it will boot into a special firmware update mode where the flash memory
can be written via USB.

This has been testing working using the command:

    # systemctl reboot loader

Signed-off-by: David Lechner <david@lechnology.com>
---
 arch/arm/boot/dts/da850-lego-ev3.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/da850-lego-ev3.dts b/arch/arm/boot/dts/da850-lego-ev3.dts
index 81942ae..2e85080 100644
--- a/arch/arm/boot/dts/da850-lego-ev3.dts
+++ b/arch/arm/boot/dts/da850-lego-ev3.dts
@@ -184,6 +184,23 @@
 		io-channel-names = "voltage", "current";
 		rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>;
 	};
+
+	/* ARM local RAM */
+	memory at ffff0000 {
+		compatible = "syscon", "simple-mfd";
+		reg = <0xffff0000 0x2000>; /* 8k */
+
+		/*
+		 * The I2C bootloader looks for this magic value to either
+		 * boot normally or boot into a firmware update mode.
+		 */
+		reboot-mode {
+			compatible = "syscon-reboot-mode";
+			offset = <0x1ffc>;
+			mode-normal = <0x00000000>;
+			mode-loader = <0x5555aaaa>;
+		};
+	};
 };
 
 &pmx_core {
-- 
2.7.4

  reply	other threads:[~2018-01-12  2:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12  2:29 [PATCH v2 0/2] Add reboot modes for LEGO MINDSTORMS EV3 David Lechner
2018-01-12  2:29 ` David Lechner [this message]
2018-02-23 11:51   ` [PATCH v2 1/2] ARM: dts: da850-lego-ev3: Add node for reboot modes Sekhar Nori
2018-01-12  2:29 ` [PATCH v2 2/2] ARM: davinci_all_defconfig: enable SYSCON_REBOOT_MODE David Lechner
2018-02-23 11:54   ` Sekhar Nori
2018-02-19 18:03 ` [PATCH v2 0/2] Add reboot modes for LEGO MINDSTORMS EV3 David Lechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1515724191-30499-2-git-send-email-david@lechnology.com \
    --to=david@lechnology.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).