Skip to contentSkip to conversation

board: apalis-tk1: launch toradex easy installer in usb recovery

PATCH In review Marcel Ziswiler 4 participants 5 messages Aug 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 board: apalis-tk1: launch toradex easy installer in usb recovery

From: Marcel Ziswiler <[email protected]>

The USB recovery mode is used by Toradex to load the Toradex Easy Installer image which supports further system images installation. Prepare for loading and launching the Toradex Easy Installer if the USB Recovery mode is activated.

---

Changes in v3:
- Switch very long lines to multiline to make checkpatch happy as suggested by Stefano.

 board/toradex/apalis-tk1/apalis-tk1.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
board/toradex/apalis-tk1/apalis-tk1.c +18 -2
index b97617cfca3..2769b546010 100644
@@ -38,8 +38,24 @@
 int arch_misc_init(void)
 {
 	if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
-	    NVBOOTTYPE_RECOVERY)
-		printf("USB recovery mode\n");
+	    NVBOOTTYPE_RECOVERY) {
+		printf("USB recovery mode, attempting to boot Toradex Easy "
+		       "Installer\n");
+		env_set("bootdelay", "-2");
+		env_set("defargs", "pcie_aspm=off user_debug=30");
+		env_set("fdt_high", "");
+		env_set("initrd_high", "");
+
+		env_set("setup", "env set setupargs igb_mac=${ethaddr} "
+			"consoleblank=0 no_console_suspend=1 "
+			"console=${console},${baudrate}n8 ${memargs}");
+		env_set("teziargs", "rootfstype=squashfs root=/dev/ram quiet "
+			"autoinstall");
+		env_set("vidargs", "video=HDMI-A-1:640x480-16@60D");
+		env_set("bootcmd", "run setup; env set bootargs ${defargs} "
+			"${setupargs} ${vidargs} ${teziargs}; bootm 0x80208000"
+			"#config@${soc}-${fdt_module}-${fdt_board}.dtb");
+	}
 
 	/* PCB Version Indication: V1.2 and later have GPIO_PV0 wired to GND */
 	gpio_request(TEGRA_GPIO(V, 0), "PCB Version Indication");
Signature · 1 line
2.26.2
#1 lore raw

Hallo Marcel,

Quoted 7 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

The USB recovery mode is used by Toradex to load the Toradex Easy Installer image which supports further system images installation. Prepare for loading and launching the Toradex Easy Installer if the USB Recovery mode is activated.

Quoted 5 lines

---

Added Tom in CC as he's in charge for Tegra (I have just reviewed V2 because it was part of i.MX series).

Best regards,
Stefano

Quoted 39 lines

Changes in v3:
- Switch very long lines to multiline to make checkpatch happy as suggested by Stefano.

  board/toradex/apalis-tk1/apalis-tk1.c | 20 ++++++++++++++++++--
  1 file changed, 18 insertions(+), 2 deletions(-)
board/toradex/apalis-tk1/apalis-tk1.c +18 -2
index b97617cfca3..2769b546010 100644
@@ -38,8 +38,24 @@
  int arch_misc_init(void)
  {
  	if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
-	    NVBOOTTYPE_RECOVERY)
-		printf("USB recovery mode\n");
+	    NVBOOTTYPE_RECOVERY) {
+		printf("USB recovery mode, attempting to boot Toradex Easy "
+		       "Installer\n");
+		env_set("bootdelay", "-2");
+		env_set("defargs", "pcie_aspm=off user_debug=30");
+		env_set("fdt_high", "");
+		env_set("initrd_high", "");
+
+		env_set("setup", "env set setupargs igb_mac=${ethaddr} "
+			"consoleblank=0 no_console_suspend=1 "
+			"console=${console},${baudrate}n8 ${memargs}");
+		env_set("teziargs", "rootfstype=squashfs root=/dev/ram quiet "
+			"autoinstall");
+		env_set("vidargs", "video=HDMI-A-1:640x480-16@60D");
+		env_set("bootcmd", "run setup; env set bootargs ${defargs} "
+			"${setupargs} ${vidargs} ${teziargs}; bootm 0x80208000"
+			"#config@${soc}-${fdt_module}-${fdt_board}.dtb");
+	}
 
  	/* PCB Version Indication: V1.2 and later have GPIO_PV0 wired to GND */
  	gpio_request(TEGRA_GPIO(V, 0), "PCB Version Indication");
Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#2 lore raw

I'm fine with someone else taking this tegra patch in if it's part of a larger series. If not, let me know and I'll take it as a singleton.

Tom

--
nvpublic

-----Original Message-----
From: Stefano Babic <[email protected]>
Sent: Wednesday, August 11, 2021 6:24 AM
To: Marcel Ziswiler <[email protected]>; [email protected]
Cc: Stefano Babic <[email protected]>; Simon Glass <[email protected]>; Marcel Ziswiler <[email protected]>; Oleksandr Suvorov <[email protected]>; Tom Warren <[email protected]>
Subject: Re: [PATCH v3] board: apalis-tk1: launch toradex easy installer in usb recovery

External email: Use caution opening links or attachments

Hallo Marcel,

Quoted 7 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

The USB recovery mode is used by Toradex to load the Toradex Easy Installer image which supports further system images installation. Prepare for loading and launching the Toradex Easy Installer if the USB Recovery mode is activated.

Quoted 5 lines

---

Added Tom in CC as he's in charge for Tegra (I have just reviewed V2 because it was part of i.MX series).

Best regards,
Stefano

Quoted 30 lines

Changes in v3:
- Switch very long lines to multiline to make checkpatch happy as suggested by Stefano.

  board/toradex/apalis-tk1/apalis-tk1.c | 20 ++++++++++++++++++--
  1 file changed, 18 insertions(+), 2 deletions(-)
board/toradex/apalis-tk1/apalis-tk1.c +11 -2
index b97617cfca3..2769b546010 100644
@@ -38,8 +38,24 @@
  int arch_misc_init(void)
  {
      if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
-         NVBOOTTYPE_RECOVERY)
-             printf("USB recovery mode\n");
+         NVBOOTTYPE_RECOVERY) {
+             printf("USB recovery mode, attempting to boot Toradex Easy "
+                    "Installer\n");
+             env_set("bootdelay", "-2");
+             env_set("defargs", "pcie_aspm=off user_debug=30");
+             env_set("fdt_high", "");
+             env_set("initrd_high", "");
+
+             env_set("setup", "env set setupargs igb_mac=${ethaddr} "
+                     "consoleblank=0 no_console_suspend=1 "
+                     "console=${console},${baudrate}n8 ${memargs}");

board/toradex/apalis-tk1/apalis-tk1.c line 61

Quoted 10 lines
board/toradex/apalis-tk1/apalis-tk1.c +7 -0
+             env_set("teziargs", "rootfstype=squashfs root=/dev/ram quiet "
+                     "autoinstall");
+             env_set("vidargs", "video=HDMI-A-1:640x480-16@60D");
+             env_set("bootcmd", "run setup; env set bootargs ${defargs} "
+                     "${setupargs} ${vidargs} ${teziargs}; bootm 0x80208000"
+                     "#config@${soc}-${fdt_module}-${fdt_board}.dtb");
+     }
 
      /* PCB Version Indication: V1.2 and later have GPIO_PV0 wired to GND */
      gpio_request(TEGRA_GPIO(V, 0), "PCB Version Indication");

--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================

#3 lore raw
Quoted 2 lines · Tom Warren

I'm fine with someone else taking this tegra patch in if it's part of a larger series. If not, let me know and I'll take it as a singleton.

The rest of that series which was i.MX specific was already applied by Stefano. So if you could take this one as a singleton that would be great. Thanks!

Quoted 1 line

Tom

Cheers

Marcel

Quoted 75 lines

--
nvpublic

-----Original Message-----
From: Stefano Babic <[email protected]>
Sent: Wednesday, August 11, 2021 6:24 AM
To: Marcel Ziswiler <[email protected]>; [email protected]
Cc: Stefano Babic <[email protected]>; Simon Glass <[email protected]>; Marcel Ziswiler <[email protected]>; Oleksandr Suvorov <[email protected]>; Tom Warren <[email protected]>
Subject: Re: [PATCH v3] board: apalis-tk1: launch toradex easy installer in usb recovery

External email: Use caution opening links or attachments

Hallo Marcel,

Quoted 7 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

The USB recovery mode is used by Toradex to load the Toradex Easy Installer image which supports further system images installation. Prepare for loading and launching the Toradex Easy Installer if the USB Recovery mode is activated.

Quoted 5 lines

---

Added Tom in CC as he's in charge for Tegra (I have just reviewed V2 because it was part of i.MX series).

Best regards,
Stefano

Quoted 39 lines

Changes in v3:
- Switch very long lines to multiline to make checkpatch happy as suggested by Stefano.

  board/toradex/apalis-tk1/apalis-tk1.c | 20 ++++++++++++++++++--

  1 file changed, 18 insertions(+), 2 deletions(-)
board/toradex/apalis-tk1/apalis-tk1.c +0 -0
index b97617cfca3..2769b546010 100644
@@ -38,8 +38,24 @@
   int arch_misc_init(void)
   {

      if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
-         NVBOOTTYPE_RECOVERY)
-             printf("USB recovery mode\n");
+         NVBOOTTYPE_RECOVERY) {
+             printf("USB recovery mode, attempting to boot Toradex Easy " +                    "Installer\n");
+             env_set("bootdelay", "-2");
+             env_set("defargs", "pcie_aspm=off user_debug=30"); +             env_set("fdt_high", "");
+             env_set("initrd_high", "");
+
+             env_set("setup", "env set setupargs igb_mac=${ethaddr} " +                     "consoleblank=0 no_console_suspend=1 "
+                     "console=${console},${baudrate}n8 ${memargs}"); +             env_set("teziargs", "rootfstype=squashfs root=/dev/ram quiet " +                     "autoinstall");
+             env_set("vidargs", "video=HDMI-A-1:640x480-16@60D"); +             env_set("bootcmd", "run setup; env set bootargs ${defargs} " +                     "${setupargs} ${vidargs} ${teziargs}; bootm 0x80208000" +                     "#config@${soc}-${fdt_module}-${fdt_board}.dtb"); +     }

      /* PCB Version Indication: V1.2 and later have GPIO_PV0 wired to GND */ gpio_request(TEGRA_GPIO(V, 0), "PCB Version Indication");

#4 lore raw
Quoted 1 line

The rest of that series which was i.MX specific was already applied by Stefano. So if you could take this one as a singleton that would be great. Thanks!

Will do, but it won't happen until at least next Monday as I'm OOTO til then.

Tom
--
nvpublic

-----Original Message-----
From: Marcel Ziswiler <[email protected]>
Sent: Wednesday, August 11, 2021 12:56 PM
To: [email protected]; Tom Warren <[email protected]>; [email protected]
Cc: [email protected]; Oleksandr Suvorov <[email protected]>
Subject: Re: [PATCH v3] board: apalis-tk1: launch toradex easy installer in usb recovery

External email: Use caution opening links or attachments

Quoted 2 lines · Tom Warren

I'm fine with someone else taking this tegra patch in if it's part of a larger series. If not, let me know and I'll take it as a singleton.

The rest of that series which was i.MX specific was already applied by Stefano. So if you could take this one as a singleton that would be great. Thanks!

Quoted 1 line

Tom

Cheers

Marcel

Quoted 76 lines

--
nvpublic

-----Original Message-----
From: Stefano Babic <[email protected]>
Sent: Wednesday, August 11, 2021 6:24 AM
To: Marcel Ziswiler <[email protected]>; [email protected]
Cc: Stefano Babic <[email protected]>; Simon Glass <[email protected]>; Marcel Ziswiler <[email protected]>; Oleksandr Suvorov <[email protected]>; Tom Warren <[email protected]>
Subject: Re: [PATCH v3] board: apalis-tk1: launch toradex easy installer in usb recovery

External email: Use caution opening links or attachments

Hallo Marcel,

Quoted 7 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

The USB recovery mode is used by Toradex to load the Toradex Easy Installer image which supports further system images installation. Prepare for loading and launching the Toradex Easy Installer if the USB Recovery mode is activated.

Quoted 5 lines

---

Added Tom in CC as he's in charge for Tegra (I have just reviewed V2 because it was part of i.MX series).

Best regards,
Stefano

Quoted 39 lines

Changes in v3:
- Switch very long lines to multiline to make checkpatch happy as suggested by Stefano.

  board/toradex/apalis-tk1/apalis-tk1.c | 20 ++++++++++++++++++--
  1 file changed, 18 insertions(+), 2 deletions(-)
board/toradex/apalis-tk1/apalis-tk1.c +18 -2
index b97617cfca3..2769b546010 100644
@@ -38,8 +38,24 @@
  int arch_misc_init(void)
  {
      if (readl(NV_PA_BASE_SRAM + NVBOOTINFOTABLE_BOOTTYPE) ==
-         NVBOOTTYPE_RECOVERY)
-             printf("USB recovery mode\n");
+         NVBOOTTYPE_RECOVERY) {
+             printf("USB recovery mode, attempting to boot Toradex Easy "
+                    "Installer\n");
+             env_set("bootdelay", "-2");
+             env_set("defargs", "pcie_aspm=off user_debug=30");
+             env_set("fdt_high", "");
+             env_set("initrd_high", "");
+
+             env_set("setup", "env set setupargs igb_mac=${ethaddr} "
+                     "consoleblank=0 no_console_suspend=1 "
+                     "console=${console},${baudrate}n8 ${memargs}");
+             env_set("teziargs", "rootfstype=squashfs root=/dev/ram quiet "
+                     "autoinstall");
+             env_set("vidargs", "video=HDMI-A-1:640x480-16@60D");
+             env_set("bootcmd", "run setup; env set bootargs ${defargs} "
+                     "${setupargs} ${vidargs} ${teziargs}; bootm 0x80208000"
+                     "#config@${soc}-${fdt_module}-${fdt_board}.dtb");
+     }
 
      /* PCB Version Indication: V1.2 and later have GPIO_PV0 wired to GND */
      gpio_request(TEGRA_GPIO(V, 0), "PCB Version Indication");