diff mbox series

[v5,5/6] beagleplay: Add DFU support

Message ID 20240506143846.1252377-6-martyn.welch@collabora.com
State Accepted
Delegated to: Tom Rini
Headers show
Series Add DFU and usb boot for TI am62x SK and beagleplay | expand

Commit Message

Martyn Welch May 6, 2024, 2:38 p.m. UTC
From: Sjoerd Simons <sjoerd@collabora.com>

DFU mode on a beagleplay can be used via the Type-C connector by holding
the USR switch while powering on.

Configuration is already provided as fragments for both the A53 and R5
u-boot parts. Include the am62x_a53_usbdfu.config config. The
am62x_r5_usbdfu.config fragment needs to be added should DFU boot be
required as this will disable booting from persistent storage due to
binary size constraints.

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
---
Changes in v5:
- Use existing config fragment for a53 DFU configuration
- Force usb0 into peripheral mode

Changes in v4:
- New patch

 arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 9 +++++++++
 board/beagle/beagleplay/beagleplay.env       | 1 +
 configs/am62x_beagleplay_a53_defconfig       | 2 ++
 3 files changed, 12 insertions(+)

Comments

Mattijs Korpershoek May 7, 2024, 9:15 a.m. UTC | #1
Hi Martyn,

Thank you for the patch, and for taking over this series.

On lun., mai 06, 2024 at 15:38, Martyn Welch <martyn.welch@collabora.com> wrote:

> From: Sjoerd Simons <sjoerd@collabora.com>
>
> DFU mode on a beagleplay can be used via the Type-C connector by holding
> the USR switch while powering on.
>
> Configuration is already provided as fragments for both the A53 and R5
> u-boot parts. Include the am62x_a53_usbdfu.config config. The
> am62x_r5_usbdfu.config fragment needs to be added should DFU boot be
> required as this will disable booting from persistent storage due to
> binary size constraints.
>
> Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
> Signed-off-by: Martyn Welch <martyn.welch@collabora.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

I've tested usb gadget on Beagle Play board using fastboot.
Also tested DFU mode via snagboot.

Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
> Changes in v5:
> - Use existing config fragment for a53 DFU configuration
> - Force usb0 into peripheral mode
>
> Changes in v4:
> - New patch
>
>  arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 9 +++++++++
>  board/beagle/beagleplay/beagleplay.env       | 1 +
>  configs/am62x_beagleplay_a53_defconfig       | 2 ++
>  3 files changed, 12 insertions(+)
>
> diff --git a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> index fb2032068d..967a2bdcd1 100644
> --- a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> +++ b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> @@ -54,6 +54,15 @@
>  	>;
>  };
>  
> +&usbss0 {
> +	bootph-all;
> +};
> +
> +&usb0 {
> +	dr_mode = "peripheral";
> +	bootph-all;
> +};
> +
>  #ifdef CONFIG_TARGET_AM625_A53_BEAGLEPLAY
>  
>  #define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
> diff --git a/board/beagle/beagleplay/beagleplay.env b/board/beagle/beagleplay/beagleplay.env
> index bbf6b925d0..8dbfc2f7d2 100644
> --- a/board/beagle/beagleplay/beagleplay.env
> +++ b/board/beagle/beagleplay/beagleplay.env
> @@ -1,5 +1,6 @@
>  #include <env/ti/ti_common.env>
>  #include <env/ti/mmc.env>
> +#include <env/ti/k3_dfu.env>
>  
>  name_kern=Image
>  console=ttyS2,115200n8
> diff --git a/configs/am62x_beagleplay_a53_defconfig b/configs/am62x_beagleplay_a53_defconfig
> index 4f1be1df59..ec62670d55 100644
> --- a/configs/am62x_beagleplay_a53_defconfig
> +++ b/configs/am62x_beagleplay_a53_defconfig
> @@ -121,3 +121,5 @@ CONFIG_EXT4_WRITE=y
>  CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
>  CONFIG_LZO=y
>  CONFIG_EFI_SET_TIME=y
> +
> +#include <configs/am62x_a53_usbdfu.config>
> -- 
> 2.43.0
diff mbox series

Patch

diff --git a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
index fb2032068d..967a2bdcd1 100644
--- a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
+++ b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
@@ -54,6 +54,15 @@ 
 	>;
 };
 
+&usbss0 {
+	bootph-all;
+};
+
+&usb0 {
+	dr_mode = "peripheral";
+	bootph-all;
+};
+
 #ifdef CONFIG_TARGET_AM625_A53_BEAGLEPLAY
 
 #define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
diff --git a/board/beagle/beagleplay/beagleplay.env b/board/beagle/beagleplay/beagleplay.env
index bbf6b925d0..8dbfc2f7d2 100644
--- a/board/beagle/beagleplay/beagleplay.env
+++ b/board/beagle/beagleplay/beagleplay.env
@@ -1,5 +1,6 @@ 
 #include <env/ti/ti_common.env>
 #include <env/ti/mmc.env>
+#include <env/ti/k3_dfu.env>
 
 name_kern=Image
 console=ttyS2,115200n8
diff --git a/configs/am62x_beagleplay_a53_defconfig b/configs/am62x_beagleplay_a53_defconfig
index 4f1be1df59..ec62670d55 100644
--- a/configs/am62x_beagleplay_a53_defconfig
+++ b/configs/am62x_beagleplay_a53_defconfig
@@ -121,3 +121,5 @@  CONFIG_EXT4_WRITE=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_LZO=y
 CONFIG_EFI_SET_TIME=y
+
+#include <configs/am62x_a53_usbdfu.config>