2018-01-12 02:30:01

by David Lechner

[permalink] [raw]
Subject: [PATCH v2 0/2] Add reboot modes for LEGO MINDSTORMS EV3

This series adds a new device tree node to declare a special memory
address that is used by the I2C bootloader on LEGO MINDSTORMS EV3
to boot into a special firmware update mode and enables the required
module to use it.

v2 changes:
* rebase on linux-davinci/master

David Lechner (2):
ARM: dts: da850-lego-ev3: Add node for reboot modes
ARM: davinci_all_defconfig: enable SYSCON_REBOOT_MODE

arch/arm/boot/dts/da850-lego-ev3.dts | 17 +++++++++++++++++
arch/arm/configs/davinci_all_defconfig | 1 +
2 files changed, 18 insertions(+)

--
2.7.4


2018-01-12 02:30:05

by David Lechner

[permalink] [raw]
Subject: [PATCH v2 2/2] ARM: davinci_all_defconfig: enable SYSCON_REBOOT_MODE

This enables SYSCON_REBOOT_MODE as a module. This is used by LEGO
MINDSTORMS EV3 to reboot into a special firmware update mode.

Signed-off-by: David Lechner <[email protected]>
---
arch/arm/configs/davinci_all_defconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/davinci_all_defconfig b/arch/arm/configs/davinci_all_defconfig
index 026154c..bcb70c2 100644
--- a/arch/arm/configs/davinci_all_defconfig
+++ b/arch/arm/configs/davinci_all_defconfig
@@ -126,6 +126,7 @@ CONFIG_GPIO_PCA953X=y
CONFIG_GPIO_PCA953X_IRQ=y
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_GPIO=y
+CONFIG_SYSCON_REBOOT_MODE=m
CONFIG_BATTERY_LEGO_EV3=m
CONFIG_WATCHDOG=y
CONFIG_DAVINCI_WATCHDOG=m
--
2.7.4

2018-01-12 02:30:23

by David Lechner

[permalink] [raw]
Subject: [PATCH v2 1/2] ARM: dts: da850-lego-ev3: Add node for reboot modes

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 <[email protected]>
---
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@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

2018-02-19 18:04:36

by David Lechner

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] Add reboot modes for LEGO MINDSTORMS EV3

On 01/11/2018 08:29 PM, David Lechner wrote:
> This series adds a new device tree node to declare a special memory
> address that is used by the I2C bootloader on LEGO MINDSTORMS EV3
> to boot into a special firmware update mode and enables the required
> module to use it.
>
> v2 changes:
> * rebase on linux-davinci/master
>
> David Lechner (2):
> ARM: dts: da850-lego-ev3: Add node for reboot modes
> ARM: davinci_all_defconfig: enable SYSCON_REBOOT_MODE
>
> arch/arm/boot/dts/da850-lego-ev3.dts | 17 +++++++++++++++++
> arch/arm/configs/davinci_all_defconfig | 1 +
> 2 files changed, 18 insertions(+)
>

Hi Sekhar,

Any objection to pickup up this series? It is independent of all
of the other changes I have been working on.

2018-02-23 11:53:33

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] ARM: dts: da850-lego-ev3: Add node for reboot modes

On Friday 12 January 2018 07:59 AM, David Lechner wrote:
> 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 <[email protected]>

Added to v4.17/dt

Thanks,
Sekhar

2018-02-23 11:56:18

by Sekhar Nori

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] ARM: davinci_all_defconfig: enable SYSCON_REBOOT_MODE

On Friday 12 January 2018 07:59 AM, David Lechner wrote:
> This enables SYSCON_REBOOT_MODE as a module. This is used by LEGO
> MINDSTORMS EV3 to reboot into a special firmware update mode.
>
> Signed-off-by: David Lechner <[email protected]>

Applied to v4.17/defconfig

Thanks,
Sekhar