[PATCH v4 6/7] beagleplay: Add DFU support

Sjoerd Simons sjoerd at collabora.com
Fri Jan 12 11:47:16 CET 2024


On Fri, 2024-01-12 at 12:41 +0200, Roger Quadros wrote:
> 
> 
> On 12/01/2024 10:52, Sjoerd Simons wrote:
> > DFU mode on a beagleplay can be used via the Type-C connector by
> > holding
> > the USR switch while powering on.
> > 
> > Configuration is only added for the A53 u-boot parts, for R5 the
> > am62x_r5_usbdfu.config fragment should be used.
> > 
> > Signed-off-by: Sjoerd Simons <sjoerd at collabora.com>
> > 
> > ---
> > 
> > Changes in v4:
> > - New patch
> > 
> >  arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi |  8 ++++++
> >  board/beagle/beagleplay/beagleplay.env       |  1 +
> >  configs/am62x_beagleplay_a53_defconfig       | 30
> > ++++++++++++++++++++
> >  3 files changed, 39 insertions(+)
> > 
> > diff --git a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> > b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> > index a723caa5805..0b1e5e70fe2 100644
> > --- a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> > +++ b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
> > @@ -61,6 +61,14 @@
> >  	>;
> >  };
> >  
> > +&usbss0 {
> > +	bootph-all;
> > +};
> > +
> > +&usb0 {
> > +	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 4f0a94a8113..85c94856017 100644
> > --- a/board/beagle/beagleplay/beagleplay.env
> > +++ b/board/beagle/beagleplay/beagleplay.env
> > @@ -1,6 +1,7 @@
> >  #include <env/ti/ti_common.env>
> >  #include <env/ti/default_findfdt.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 0be20045a97..dfe04b71810 100644
> > --- a/configs/am62x_beagleplay_a53_defconfig
> > +++ b/configs/am62x_beagleplay_a53_defconfig
> > @@ -1,5 +1,6 @@
> >  CONFIG_ARM=y
> >  CONFIG_ARCH_K3=y
> > +CONFIG_SYS_MALLOC_LEN=0x2000000
> >  CONFIG_SYS_MALLOC_F_LEN=0x8000
> >  CONFIG_SPL_GPIO=y
> >  CONFIG_SPL_LIBCOMMON_SUPPORT=y
> > @@ -43,15 +44,20 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
> >  CONFIG_SPL_STACK_R=y
> >  CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
> >  CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1400
> > +CONFIG_SPL_ENV_SUPPORT=y
> >  CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img"
> >  CONFIG_SPL_I2C=y
> >  CONFIG_SPL_DM_MAILBOX=y
> >  CONFIG_SPL_POWER_DOMAIN=y
> > +CONFIG_SPL_RAM_SUPPORT=y
> > +CONFIG_SPL_RAM_DEVICE=y
> >  CONFIG_SPL_YMODEM_SUPPORT=y
> > +CONFIG_CMD_DFU=y
> >  CONFIG_CMD_GPIO=y
> >  CONFIG_CMD_GPIO_READ=y
> >  CONFIG_CMD_I2C=y
> >  CONFIG_CMD_MMC=y
> > +CONFIG_CMD_USB=y
> >  CONFIG_CMD_PMIC=y
> >  CONFIG_CMD_REGULATOR=y
> >  CONFIG_OF_CONTROL=y
> > @@ -68,6 +74,10 @@ CONFIG_SPL_OF_TRANSLATE=y
> >  CONFIG_CLK=y
> >  CONFIG_SPL_CLK=y
> >  CONFIG_CLK_TI_SCI=y
> > +CONFIG_DFU_MMC=y
> > +CONFIG_DFU_RAM=y
> > +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x5000
> > +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
> >  CONFIG_DMA_CHANNELS=y
> >  CONFIG_TI_K3_NAVSS_UDMA=y
> >  CONFIG_TI_SCI_PROTOCOL=y
> > @@ -113,6 +123,26 @@ CONFIG_SOC_TI=y
> >  CONFIG_SYSRESET=y
> >  CONFIG_SPL_SYSRESET=y
> >  CONFIG_SYSRESET_TI_SCI=y
> > +CONFIG_USB=y
> > +CONFIG_DM_USB_GADGET=y
> > +CONFIG_SPL_DM_USB_GADGET=y
> > +CONFIG_USB_XHCI_HCD=y
> > +CONFIG_USB_XHCI_DWC3=y
> 
> XHCI features are really not required for DFU
> but now I see that we depend on XHCI driver to get
> probed even for device mode. lol.

Right yeah i should have made it more clear in the commit message; This
also adds USB host support in the full u-boot in principle (i admit i
didn't actually test that on beagleplay). Which we can do now as the
usb glue is there.

Fwiw in the R5 SPL i've disable XHCI support now based on your comments
last time as USB host support there is not needed ofcourse



-- 
Sjoerd Simons
Collabora Ltd.


More information about the U-Boot mailing list