All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] AM642-EVM: Add USB support
@ 2021-06-01 15:13 Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 01/10] tools: k3_fit_atf: Add support for providing ATF load address using a Kconfig symbol Aswath Govindraju
                   ` (10 more replies)
  0 siblings, 11 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Vignesh Raghavendra, Nishanth Menon, Suman Anna,
	Keerthy, u-boot

The following series of patches add support for the following
- Kconfig symbol for giving the load address for ATF
- USB Mass storrage boot mode in AM642-EVM
- DFU boot mode in AM642-EVM
- Host and peripheral modes for AM642-EVM in U-Boot
- Set the USB PHY core voltage to 0.85V

Aswath Govindraju (10):
  tools: k3_fit_atf: Add support for providing ATF load address using a
    Kconfig symbol
  arm: mach-k3: am642_init: Add support for USB boot mode
  arm: mach-k3: am642_init: Do USB fixups to facilitate host and device
    boot modes
  board: ti: am64x: Set the core voltage of USB PHY to 0.85V
  arm: dts: k3-am64-main: Add USB DT nodes
  arm: dts: k3-am642-*-evm: Add USB support
  arm: dts: k3-am642-evm-u-boot: Add U-Boot tags and fix the dr_mode to
    peripheral for USB subsystem
  configs: am64x_evm_*_defconfig: Move the SPL Load address to
    0x70000000, move the ATF to a latter location and rearrange EEPROM
    and BSS data
  arm: dts: k3-am64-main: Update the location of ATF in SRAM
  configs: am64: Enable configs to support USB host and device modes

 arch/arm/dts/k3-am64-main.dtsi                | 32 ++++++++++++-
 arch/arm/dts/k3-am642-evm-u-boot.dtsi         | 13 ++++++
 arch/arm/dts/k3-am642-evm.dts                 | 18 ++++++++
 arch/arm/dts/k3-am642-r5-evm.dts              | 18 ++++++++
 arch/arm/mach-k3/Kconfig                      |  7 +++
 arch/arm/mach-k3/am642_init.c                 | 46 ++++++++++++++++++-
 arch/arm/mach-k3/config.mk                    |  1 +
 arch/arm/mach-k3/include/mach/am64_hardware.h | 11 +++--
 arch/arm/mach-k3/include/mach/am64_spl.h      |  6 ++-
 board/ti/am64x/evm.c                          | 14 ++++++
 configs/am64x_evm_a53_defconfig               | 40 ++++++++++++++++
 configs/am64x_evm_r5_defconfig                | 38 +++++++++++++--
 include/configs/am64x_evm.h                   | 15 +++++-
 tools/k3_fit_atf.sh                           |  9 ++--
 14 files changed, 251 insertions(+), 17 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 01/10] tools: k3_fit_atf: Add support for providing ATF load address using a Kconfig symbol
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
@ 2021-06-01 15:13 ` Aswath Govindraju
  2021-06-03  5:24   ` Lokesh Vutla
  2021-06-01 15:13 ` [PATCH 02/10] arm: mach-k3: am642_init: Add support for USB boot mode Aswath Govindraju
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Nishanth Menon, Vignesh Raghavendra, Suman Anna,
	Keerthy, u-boot

Add support for providing ATF load address with a Kconfig symbol.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 arch/arm/mach-k3/Kconfig   | 7 +++++++
 arch/arm/mach-k3/config.mk | 1 +
 tools/k3_fit_atf.sh        | 9 ++++++---
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
index bfbce44bfa59..2c46d7a3a798 100644
--- a/arch/arm/mach-k3/Kconfig
+++ b/arch/arm/mach-k3/Kconfig
@@ -147,6 +147,13 @@ config SYS_K3_SPL_ATF
 	  Enabling this will try to start Cortex-A (typically with ATF)
 	  after SPL from R5.
 
+config K3_ATF_LOAD_ADDR
+	hex "Load address of ATF image"
+	default 0x7000000
+	help
+	  The load address for the ATF image. This value defaults to 0x70000000
+	  if not provided in the board defconfig file.
+
 source "board/ti/am65x/Kconfig"
 source "board/ti/am64x/Kconfig"
 source "board/ti/j721e/Kconfig"
diff --git a/arch/arm/mach-k3/config.mk b/arch/arm/mach-k3/config.mk
index 41fee2b5a172..674489068204 100644
--- a/arch/arm/mach-k3/config.mk
+++ b/arch/arm/mach-k3/config.mk
@@ -67,6 +67,7 @@ endif
 quiet_cmd_k3_mkits = MKITS   $@
 cmd_k3_mkits = \
 	$(srctree)/tools/k3_fit_atf.sh \
+	$(CONFIG_K3_ATF_LOAD_ADDR) \
 	$(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(LIST_OF_DTB))) > $@
 
 $(SPL_ITS): FORCE
diff --git a/tools/k3_fit_atf.sh b/tools/k3_fit_atf.sh
index 4e9f69c08789..2c0287a63394 100755
--- a/tools/k3_fit_atf.sh
+++ b/tools/k3_fit_atf.sh
@@ -5,7 +5,7 @@
 # ATF, OPTEE, SPL and multiple device trees (given on the command line).
 # Inspired from board/sunxi/mksunxi_fit_atf.sh
 #
-# usage: $0 <dt_name> [<dt_name> [<dt_name] ...]
+# usage: $0 <atf_load_addr> <dt_name> [<dt_name> [<dt_name] ...]
 
 [ -z "$ATF" ] && ATF="bl31.bin"
 
@@ -40,8 +40,8 @@ cat << __HEADER_EOF
 			arch = "arm64";
 			compression = "none";
 			os = "arm-trusted-firmware";
-			load = <0x70000000>;
-			entry = <0x70000000>;
+			load = <$1>;
+			entry = <$1>;
 		};
 		tee {
 			description = "OPTEE";
@@ -65,6 +65,9 @@ cat << __HEADER_EOF
 		};
 __HEADER_EOF
 
+# shift through ATF load address in the command line arguments
+shift
+
 for dtname in $*
 do
 	cat << __FDT_IMAGE_EOF
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 02/10] arm: mach-k3: am642_init: Add support for USB boot mode
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 01/10] tools: k3_fit_atf: Add support for providing ATF load address using a Kconfig symbol Aswath Govindraju
@ 2021-06-01 15:13 ` Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 03/10] arm: mach-k3: am642_init: Do USB fixups to facilitate host and device boot modes Aswath Govindraju
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Vignesh Raghavendra, Nishanth Menon, Suman Anna,
	Keerthy, u-boot

Add support for identifying USB host and device boot modes

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 arch/arm/mach-k3/am642_init.c                 | 13 +++++++++++--
 arch/arm/mach-k3/include/mach/am64_hardware.h |  5 +++++
 arch/arm/mach-k3/include/mach/am64_spl.h      |  6 ++++--
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c
index a433702b4e30..1a2bc4bb9048 100644
--- a/arch/arm/mach-k3/am642_init.c
+++ b/arch/arm/mach-k3/am642_init.c
@@ -192,8 +192,11 @@ static u32 __get_backup_bootmedia(u32 main_devstat)
 	case BACKUP_BOOT_DEVICE_UART:
 		return BOOT_DEVICE_UART;
 
-	case BACKUP_BOOT_DEVICE_USB:
-		return BOOT_DEVICE_USB;
+	case BACKUP_BOOT_DEVICE_DFU:
+		if (bkup_bootmode_cfg & MAIN_DEVSTAT_BACKUP_USB_MODE_MASK)
+			return BOOT_DEVICE_USB;
+		return BOOT_DEVICE_DFU;
+
 
 	case BACKUP_BOOT_DEVICE_ETHERNET:
 		return BOOT_DEVICE_ETHERNET;
@@ -245,6 +248,12 @@ static u32 __get_primary_bootmedia(u32 main_devstat)
 			return BOOT_DEVICE_MMC2;
 		return BOOT_DEVICE_MMC1;
 
+	case BOOT_DEVICE_DFU:
+		if ((bootmode_cfg & MAIN_DEVSTAT_PRIMARY_USB_MODE_MASK) >>
+		    MAIN_DEVSTAT_PRIMARY_USB_MODE_SHIFT)
+			return BOOT_DEVICE_USB;
+		return BOOT_DEVICE_DFU;
+
 	case BOOT_DEVICE_NOBOOT:
 		return BOOT_DEVICE_RAM;
 	}
diff --git a/arch/arm/mach-k3/include/mach/am64_hardware.h b/arch/arm/mach-k3/include/mach/am64_hardware.h
index c368aa7e6bf1..4ee41ad762ba 100644
--- a/arch/arm/mach-k3/include/mach/am64_hardware.h
+++ b/arch/arm/mach-k3/include/mach/am64_hardware.h
@@ -30,6 +30,11 @@
 #define MAIN_DEVSTAT_PRIMARY_MMC_PORT_SHIFT		2
 #define MAIN_DEVSTAT_PRIMARY_MMC_PORT_MASK		0x04
 
+#define MAIN_DEVSTAT_PRIMARY_USB_MODE_SHIFT		1
+#define MAIN_DEVSTAT_PRIMARY_USB_MODE_MASK		0x02
+
+#define MAIN_DEVSTAT_BACKUP_USB_MODE_MASK		0x01
+
 /*
  * The CTRL_MMR and PADCFG_MMR memory space is divided into several
  * equally-spaced partitions, so defining the partition size allows us to
diff --git a/arch/arm/mach-k3/include/mach/am64_spl.h b/arch/arm/mach-k3/include/mach/am64_spl.h
index 36826cfc4ed0..607b09c2e5dc 100644
--- a/arch/arm/mach-k3/include/mach/am64_spl.h
+++ b/arch/arm/mach-k3/include/mach/am64_spl.h
@@ -19,7 +19,8 @@
 #define BOOT_DEVICE_MMC			0x08
 #define BOOT_DEVICE_EMMC		0x09
 
-#define BOOT_DEVICE_USB			0x0A
+#define BOOT_DEVICE_USB			0x2A
+#define BOOT_DEVICE_DFU			0x0A
 #define BOOT_DEVICE_GPMC_NOR		0x0C
 #define BOOT_DEVICE_PCIE		0x0D
 #define BOOT_DEVICE_XSPI		0x0E
@@ -32,12 +33,13 @@
 #define BOOT_DEVICE_MMC2_2		0x1F
 
 /* Backup BootMode devices */
-#define BACKUP_BOOT_DEVICE_USB		0x01
+#define BACKUP_BOOT_DEVICE_DFU		0x01
 #define BACKUP_BOOT_DEVICE_UART		0x03
 #define BACKUP_BOOT_DEVICE_ETHERNET	0x04
 #define BACKUP_BOOT_DEVICE_MMC		0x05
 #define BACKUP_BOOT_DEVICE_SPI		0x06
 #define BACKUP_BOOT_DEVICE_I2C		0x07
+#define BACKUP_BOOT_DEVICE_USB		0x09
 
 #define K3_PRIMARY_BOOTMODE		0x0
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 03/10] arm: mach-k3: am642_init: Do USB fixups to facilitate host and device boot modes
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 01/10] tools: k3_fit_atf: Add support for providing ATF load address using a Kconfig symbol Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 02/10] arm: mach-k3: am642_init: Add support for USB boot mode Aswath Govindraju
@ 2021-06-01 15:13 ` Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 04/10] board: ti: am64x: Set the core voltage of USB PHY to 0.85V Aswath Govindraju
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Nishanth Menon, Vignesh Raghavendra, Suman Anna,
	Keerthy, u-boot

U-Boot either supports USB host or device mode for a node at a time in the
device tree nodes. To support both host and dfu bootmodes, dr_mode is set
to "peripheral" by default and then fixed based on the mode selected by
the boot mode config dip switches on the board.

This needs to happen before the cdns3 generic layer binds the usb device
to a host or a device driver. Therefore, use fdtdec_setup_board()
implementation to fixup the device tree property.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 arch/arm/mach-k3/am642_init.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c
index 1a2bc4bb9048..579dbacb7e48 100644
--- a/arch/arm/mach-k3/am642_init.c
+++ b/arch/arm/mach-k3/am642_init.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <fdt_support.h>
 #include <spl.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
@@ -106,6 +107,38 @@ void do_dt_magic(void)
 }
 #endif
 
+#if CONFIG_IS_ENABLED(USB_STORAGE)
+static int fixup_usb_boot(const void *fdt_blob)
+{
+	int ret = 0;
+
+	switch (spl_boot_device()) {
+	case BOOT_DEVICE_USB:
+		/*
+		 * If the boot mode is host, fixup the dr_mode to host
+		 * before cdns3 bind takes place
+		 */
+		ret = fdt_find_and_setprop((void *)fdt_blob,
+					   "/bus@f4000/cdns-usb@f900000/usb@f400000",
+					   "dr_mode", "host", 5, 0);
+		if (ret)
+			printf("%s: fdt_find_and_setprop() failed:%d\n",
+			       __func__, ret);
+		fallthrough;
+	default:
+		break;
+	}
+
+	return ret;
+}
+
+int fdtdec_board_setup(const void *fdt_blob)
+{
+	/* Can use the pointer from the function parameters */
+	return fixup_usb_boot(fdt_blob);
+}
+#endif
+
 void board_init_f(ulong dummy)
 {
 #if defined(CONFIG_K3_LOAD_SYSFW)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 04/10] board: ti: am64x: Set the core voltage of USB PHY to 0.85V
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
                   ` (2 preceding siblings ...)
  2021-06-01 15:13 ` [PATCH 03/10] arm: mach-k3: am642_init: Do USB fixups to facilitate host and device boot modes Aswath Govindraju
@ 2021-06-01 15:13 ` Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 05/10] arm: dts: k3-am64-main: Add USB DT nodes Aswath Govindraju
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Vignesh Raghavendra, Nishanth Menon, Suman Anna,
	Keerthy, u-boot

Set the core voltage of USB PHY in AM64x to 0.85V in spl_board_init().

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 board/ti/am64x/evm.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c
index 35cd9e027c04..cdbb9a87bc44 100644
--- a/board/ti/am64x/evm.c
+++ b/board/ti/am64x/evm.c
@@ -152,3 +152,17 @@ int board_late_init(void)
 	return 0;
 }
 #endif
+
+#define CTRLMMR_USB0_PHY_CTRL	0x43004008
+#define CORE_VOLTAGE		0x80000000
+
+#ifdef CONFIG_SPL_BOARD_INIT
+void spl_board_init(void)
+{
+	u32 val;
+	/* Set USB PHY core voltage to 0.85V */
+	val = readl(CTRLMMR_USB0_PHY_CTRL);
+	val &= ~(CORE_VOLTAGE);
+	writel(val, CTRLMMR_USB0_PHY_CTRL);
+}
+#endif
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 05/10] arm: dts: k3-am64-main: Add USB DT nodes
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
                   ` (3 preceding siblings ...)
  2021-06-01 15:13 ` [PATCH 04/10] board: ti: am64x: Set the core voltage of USB PHY to 0.85V Aswath Govindraju
@ 2021-06-01 15:13 ` Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 06/10] arm: dts: k3-am642-*-evm: Add USB support Aswath Govindraju
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Vignesh Raghavendra, Nishanth Menon, Suman Anna,
	Keerthy, u-boot

Add DT node for the single USB subsystem in main dtsi file.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 arch/arm/dts/k3-am64-main.dtsi | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/dts/k3-am64-main.dtsi b/arch/arm/dts/k3-am64-main.dtsi
index a65011b396cc..5a58337c1ca7 100644
--- a/arch/arm/dts/k3-am64-main.dtsi
+++ b/arch/arm/dts/k3-am64-main.dtsi
@@ -499,6 +499,36 @@
 		clock-names = "gpio";
 	};
 
+	usbss0: cdns-usb@f900000{
+		compatible = "ti,am64-usb", "ti,j721e-usb";
+		reg = <0x00 0xf900000 0x00 0x100>;
+		power-domains = <&k3_pds 161 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 161 9>, <&k3_clks 161 1>;
+		clock-names = "ref", "lpm";
+		assigned-clocks = <&k3_clks 161 9>; /* USB2_REFCLK */
+		assigned-clock-parents = <&k3_clks 161 10>; /* HF0SC0 */
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+		usb0: usb@f400000{
+			compatible = "cdns,usb3";
+			reg = <0x00 0xf400000 0x00 0x10000>,
+			      <0x00 0xf410000 0x00 0x10000>,
+			      <0x00 0xf420000 0x00 0x10000>;
+			reg-names = "otg",
+				    "xhci",
+				    "dev";
+			interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>, /* irq.0 */
+				     <GIC_SPI 194 IRQ_TYPE_LEVEL_HIGH>, /* irq.6 */
+				     <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>; /* otgirq */
+			interrupt-names = "host",
+					  "peripheral",
+					  "otg";
+			maximum-speed = "super-speed";
+			dr_mode = "otg";
+		};
+	};
+
 	main_gpio1: gpio@601000 {
 		compatible = "ti,j721e-gpio", "ti,keystone-gpio";
 		reg = <0x00 0x00601000 0x00 0x100>;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 06/10] arm: dts: k3-am642-*-evm: Add USB support
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
                   ` (4 preceding siblings ...)
  2021-06-01 15:13 ` [PATCH 05/10] arm: dts: k3-am64-main: Add USB DT nodes Aswath Govindraju
@ 2021-06-01 15:13 ` Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 07/10] arm: dts: k3-am642-evm-u-boot: Add U-Boot tags and fix the dr_mode to peripheral for USB subsystem Aswath Govindraju
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Vignesh Raghavendra, Nishanth Menon, Suman Anna,
	Keerthy, u-boot

AM64 EVM board has a micro USB 2.0 AB connector and the USB0_VBUS is
connected with a resistor divider in between. USB0_DRVVBUS pin is muxed
between USB0_DRVVBUS and GPIO1_79 signals.

Add the corresponding properties and set the pinmux mode for USB subsystem
in the evm dts file.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 arch/arm/dts/k3-am642-evm.dts    | 18 ++++++++++++++++++
 arch/arm/dts/k3-am642-r5-evm.dts | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/arch/arm/dts/k3-am642-evm.dts b/arch/arm/dts/k3-am642-evm.dts
index dc3482bea433..3a505d22c635 100644
--- a/arch/arm/dts/k3-am642-evm.dts
+++ b/arch/arm/dts/k3-am642-evm.dts
@@ -201,6 +201,12 @@
 			AM64X_IOPAD(0x0144, PIN_OUTPUT, 4) /* (Y11) PRG1_PRU1_GPO15.RGMII2_TX_CTL */
 		>;
 	};
+
+	main_usb0_pins_default: main-usb0-pins-default {
+		pinctrl-single,pins = <
+			AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */
+		>;
+	};
 };
 
 &main_uart0 {
@@ -337,3 +343,15 @@
 	ti,driver-strength-ohm = <50>;
 	disable-wp;
 };
+
+&usbss0 {
+	ti,vbus-divider;
+	ti,usb2-only;
+};
+
+&usb0 {
+	dr_mode = "otg";
+	maximum-speed = "high-speed";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_usb0_pins_default>;
+};
diff --git a/arch/arm/dts/k3-am642-r5-evm.dts b/arch/arm/dts/k3-am642-r5-evm.dts
index 1fbf6d2c23a5..cc48fd4cb607 100644
--- a/arch/arm/dts/k3-am642-r5-evm.dts
+++ b/arch/arm/dts/k3-am642-r5-evm.dts
@@ -141,6 +141,12 @@
 			AM64X_IOPAD(0x0030, PIN_OUTPUT_PULLUP, 7)	/* (L18) OSPI0_CSN1.GPIO0_12 */
 		>;
 	};
+
+	main_usb0_pins_default: main-usb0-pins-default {
+		pinctrl-single,pins = <
+			AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */
+		>;
+	};
 };
 
 &dmsc {
@@ -201,4 +207,16 @@
 	/delete-property/ power-domains;
 };
 
+&usbss0 {
+	ti,vbus-divider;
+	ti,usb2-only;
+};
+
+&usb0 {
+	dr_mode = "otg";
+	maximum-speed = "high-speed";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_usb0_pins_default>;
+};
+
 #include "k3-am642-evm-u-boot.dtsi"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 07/10] arm: dts: k3-am642-evm-u-boot: Add U-Boot tags and fix the dr_mode to peripheral for USB subsystem
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
                   ` (5 preceding siblings ...)
  2021-06-01 15:13 ` [PATCH 06/10] arm: dts: k3-am642-*-evm: Add USB support Aswath Govindraju
@ 2021-06-01 15:13 ` Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 08/10] configs: am64x_evm_*_defconfig: Move the SPL Load address to 0x70000000, move the ATF to a latter location and rearrange EEPROM and BSS data Aswath Govindraju
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Nishanth Menon, Vignesh Raghavendra, Suman Anna,
	Keerthy, u-boot

Add U-Boot tags and fix the dr_mode as peripheral in U-Boot to support DFU
by default.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 arch/arm/dts/k3-am642-evm-u-boot.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/dts/k3-am642-evm-u-boot.dtsi b/arch/arm/dts/k3-am642-evm-u-boot.dtsi
index 10dea7a1cc46..ed38b7269ee5 100644
--- a/arch/arm/dts/k3-am642-evm-u-boot.dtsi
+++ b/arch/arm/dts/k3-am642-evm-u-boot.dtsi
@@ -50,6 +50,19 @@
 	u-boot,dm-spl;
 };
 
+&usb0 {
+	dr_mode="peripheral";
+	u-boot,dm-spl;
+};
+
+&usbss0 {
+	u-boot,dm-spl;
+};
+
+&main_usb0_pins_default {
+	u-boot,dm-spl;
+};
+
 &dmss {
 	u-boot,dm-spl;
 };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 08/10] configs: am64x_evm_*_defconfig: Move the SPL Load address to 0x70000000, move the ATF to a latter location and rearrange EEPROM and BSS data
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
                   ` (6 preceding siblings ...)
  2021-06-01 15:13 ` [PATCH 07/10] arm: dts: k3-am642-evm-u-boot: Add U-Boot tags and fix the dr_mode to peripheral for USB subsystem Aswath Govindraju
@ 2021-06-01 15:13 ` Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 09/10] arm: dts: k3-am64-main: Update the location of ATF in SRAM Aswath Govindraju
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Nishanth Menon, Vignesh Raghavendra, Suman Anna,
	Keerthy, u-boot

For USB DFU boot mode there is a limitation on the load address of boot
images that they have to be less than 0x70001000. Therefore, move the
SPL_TEXT_BASE address to 0x70000000.

Currently ATF is being loaded at 0x70000000, if the SPL is being loaded at
0x70000000 then ATF would overwrite SPL image when loaded. Therefore, move
the location of ATF to a latter location in SRAM, past the SPL image. Also
rearrange the EEPROM and BSS data on top of ATF.

Given below is the placement of various data sections in SRAM

     ┌──────────────────────────────────────┐0x70000000
     │                                      │
     │                                      │
     │                                      │
     │    SPL IMAGE (Max size 1.5 MB)       │
     │                                      │
     │                                      │
     │                                      │
     ├──────────────────────────────────────┤0x7017FFFF
     │                                      │
     │           SPL STACK                  │
     │                                      │
     ├──────────────────────────────────────┤0x70192727
     │          GLOBAL DATA(216 B)          │
     ├──────────────────────────────────────┤0x701927FF
     │                                      │
     │       INITIAL HEAP (32 KB)           │
     │                                      │
     ├──────────────────────────────────────┤0x7019A7FF
     │                                      │
     │          BSS  (20 KB)                │
     ├──────────────────────────────────────┤0x7019F7FF
     │         EEPROM DATA (2 KB)           │
     ├──────────────────────────────────────┤0x7019FFFF
     │                                      │
     │                                      │
     │            ATF (123 KB)              │
     │                                      │
     │                                      │
     ├──────────────────────────────────────┤0x701BEBFB
     │   BOOT PARAMETER INDEX TABLE (5124 B)│
     ├──────────────────────────────────────┤0x701BFFFF
     │                                      │
     │SYSFW FIREWALLED DUE TO A BUG (128 KB)│
     │                                      │
     ├──────────────────────────────────────┤0x701DFFFF
     │                                      │
     │      DMSC CODE AREA (128 KB)         │
     │                                      │
     └──────────────────────────────────────┘0x701FFFFF

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 arch/arm/mach-k3/include/mach/am64_hardware.h | 6 ++----
 configs/am64x_evm_a53_defconfig               | 1 +
 configs/am64x_evm_r5_defconfig                | 2 +-
 include/configs/am64x_evm.h                   | 3 ++-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-k3/include/mach/am64_hardware.h b/arch/arm/mach-k3/include/mach/am64_hardware.h
index 4ee41ad762ba..96383437d5b1 100644
--- a/arch/arm/mach-k3/include/mach/am64_hardware.h
+++ b/arch/arm/mach-k3/include/mach/am64_hardware.h
@@ -7,8 +7,6 @@
 #ifndef __ASM_ARCH_AM64_HARDWARE_H
 #define __ASM_ARCH_AM64_HARDWARE_H
 
-#include <config.h>
-
 #define CTRL_MMR0_BASE					0x43000000
 #define CTRLMMR_MAIN_DEVSTAT				(CTRL_MMR0_BASE + 0x30)
 
@@ -54,7 +52,7 @@
 
 #define ROM_ENTENDED_BOOT_DATA_INFO			0x701beb00
 
-/* Use Last 1K as Scratch pad */
-#define TI_SRAM_SCRATCH_BOARD_EEPROM_START		0x701bfc00
+/* Use Last 2K as Scratch pad */
+#define TI_SRAM_SCRATCH_BOARD_EEPROM_START		0x7019f800
 
 #endif /* __ASM_ARCH_DRA8_HARDWARE_H */
diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 304f5b41a3ae..3b8b7474f845 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -5,6 +5,7 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_NR_DRAM_BANKS=2
 CONFIG_SOC_K3_AM642=y
+CONFIG_K3_ATF_LOAD_ADDR=0x701a0000
 CONFIG_TARGET_AM642_A53_EVM=y
 CONFIG_ENV_SIZE=0x20000
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x280000
diff --git a/configs/am64x_evm_r5_defconfig b/configs/am64x_evm_r5_defconfig
index 2810fa1fc57d..de0c814222c0 100644
--- a/configs/am64x_evm_r5_defconfig
+++ b/configs/am64x_evm_r5_defconfig
@@ -10,7 +10,7 @@ CONFIG_ENV_SIZE=0x20000
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
-CONFIG_SPL_TEXT_BASE=0x70020000
+CONFIG_SPL_TEXT_BASE=0x70000000
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
diff --git a/include/configs/am64x_evm.h b/include/configs/am64x_evm.h
index 7c30e50c5f1e..7c9bdc2d7d3a 100644
--- a/include/configs/am64x_evm.h
+++ b/include/configs/am64x_evm.h
@@ -12,6 +12,7 @@
 #include <linux/sizes.h>
 #include <config_distro_bootcmd.h>
 #include <environment/ti/mmc.h>
+#include <asm/arch/am64_hardware.h>
 
 /* DDR Configuration */
 #define CONFIG_SYS_SDRAM_BASE1		0x880000000
@@ -43,7 +44,7 @@
  * location filled in by the boot ROM that we want to read out without any
  * interference from the C context.
  */
-#define CONFIG_SPL_BSS_START_ADDR	(CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX -\
+#define CONFIG_SPL_BSS_START_ADDR	(TI_SRAM_SCRATCH_BOARD_EEPROM_START -\
 					 CONFIG_SPL_BSS_MAX_SIZE)
 /* Set the stack right below the SPL BSS section */
 #define CONFIG_SYS_INIT_SP_ADDR         CONFIG_SPL_BSS_START_ADDR
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 09/10] arm: dts: k3-am64-main: Update the location of ATF in SRAM
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
                   ` (7 preceding siblings ...)
  2021-06-01 15:13 ` [PATCH 08/10] configs: am64x_evm_*_defconfig: Move the SPL Load address to 0x70000000, move the ATF to a latter location and rearrange EEPROM and BSS data Aswath Govindraju
@ 2021-06-01 15:13 ` Aswath Govindraju
  2021-06-01 15:13 ` [PATCH 10/10] configs: am64: Enable configs to support USB host and device modes Aswath Govindraju
  2021-06-01 16:13 ` [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
  10 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Nishanth Menon, Vignesh Raghavendra, Suman Anna,
	Keerthy, u-boot

For USB DFU boot mode there is a limitation on the load address of boot
images that they have to be less than 0x70001000. So, the load address of
SPL has been moved to 0x70000000 and ATF has been moved to a latter
location, 0x701a0000.

Therefore, update its location accordingly in the device tree file.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 arch/arm/dts/k3-am64-main.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/k3-am64-main.dtsi b/arch/arm/dts/k3-am64-main.dtsi
index 5a58337c1ca7..fccf0d2fcfb0 100644
--- a/arch/arm/dts/k3-am64-main.dtsi
+++ b/arch/arm/dts/k3-am64-main.dtsi
@@ -14,7 +14,7 @@
 		ranges = <0x0 0x00 0x70000000 0x200000>;
 
 		atf-sram@0 {
-			reg = <0x0 0x1a000>;
+			reg = <0x1a0000 0x1a000>;
 		};
 	};
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 10/10] configs: am64: Enable configs to support USB host and device modes
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
                   ` (8 preceding siblings ...)
  2021-06-01 15:13 ` [PATCH 09/10] arm: dts: k3-am64-main: Update the location of ATF in SRAM Aswath Govindraju
@ 2021-06-01 15:13 ` Aswath Govindraju
  2021-06-01 16:13 ` [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
  10 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 15:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Aswath Govindraju, Lokesh Vutla,
	Dave Gerlach, Vignesh Raghavendra, Nishanth Menon, Suman Anna,
	Keerthy, u-boot

Enable config options required to add support for USB Mass storage boot,
USB DFU boot, host and device modes in U-Boot.

Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 configs/am64x_evm_a53_defconfig | 39 +++++++++++++++++++++++++++++++++
 configs/am64x_evm_r5_defconfig  | 36 ++++++++++++++++++++++++++++--
 include/configs/am64x_evm.h     | 12 +++++++++-
 3 files changed, 84 insertions(+), 3 deletions(-)

diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 3b8b7474f845..a3aab807c6e7 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -23,6 +23,7 @@ CONFIG_DEFAULT_DEVICE_TREE="k3-am642-evm"
 CONFIG_DISTRO_DEFAULTS=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run get_kern_${boot}; run get_fdt_${boot}; run run_kern"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
@@ -30,12 +31,17 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DMA=y
 CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_POWER_DOMAIN=y
 CONFIG_SPL_RAM_SUPPORT=y
 CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_SPI_LOAD=y
+CONFIG_SPL_USB_HOST_SUPPORT=y
+CONFIG_SPL_USB_STORAGE=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_SPL_DFU=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_I2C=y
@@ -103,3 +109,36 @@ CONFIG_TIMER=y
 CONFIG_SPL_TIMER=y
 CONFIG_OMAP_TIMER=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_CMD_DFU=y
+CONFIG_CMD_DM=y
+CONFIG_CMD_USB=y
+CONFIG_DFU=y
+CONFIG_DFU_OVER_USB=y
+# CONFIG_DFU_TFTP is not set
+CONFIG_DFU_MMC=y
+CONFIG_DFU_RAM=y
+CONFIG_DFU_SF=y
+# CONFIG_DFU_VIRT is not set
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x40000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_DM_USB_GADGET=y
+CONFIG_SPL_DM_USB_GADGET=y
+CONFIG_USB_HOST=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_CDNS3=y
+CONFIG_USB_CDNS3_GADGET=y
+CONFIG_SPL_USB_CDNS3_GADGET=y
+CONFIG_USB_CDNS3_HOST=y
+CONFIG_SPL_USB_CDNS3_HOST=y
+CONFIG_USB_CDNS3_TI=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0x6165
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_FUNCTION_MASS_STORAGE=y
diff --git a/configs/am64x_evm_r5_defconfig b/configs/am64x_evm_r5_defconfig
index de0c814222c0..3e9b5650c60d 100644
--- a/configs/am64x_evm_r5_defconfig
+++ b/configs/am64x_evm_r5_defconfig
@@ -23,6 +23,7 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEFAULT_DEVICE_TREE="k3-am642-r5-evm"
 CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
 CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y
@@ -31,19 +32,30 @@ CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_EARLY_BSS=y
+CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_DM_RESET=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_POWER_DOMAIN=y
+CONFIG_SPL_RAM_SUPPORT=y
+CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_REMOTEPROC=y
 CONFIG_SPL_SPI_LOAD=y
+CONFIG_SPL_USB_HOST_SUPPORT=y
+CONFIG_SPL_USB_STORAGE=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_SPL_DFU=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_ASKENV=y
+CONFIG_CMD_DFU=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_REMOTEPROC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_TIME=y
 CONFIG_CMD_FAT=y
@@ -52,8 +64,6 @@ CONFIG_SPL_OF_CONTROL=y
 CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_SPL_OF_LIST="k3-am642-r5-evm k3-am642-r5-sk"
 CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
-CONFIG_ENV_IS_IN_FAT=y
-CONFIG_ENV_FAT_DEVICE_AND_PART="1:1"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
@@ -64,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_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x5000
 CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_DA8XX_GPIO=y
 CONFIG_DM_I2C=y
@@ -101,4 +115,22 @@ CONFIG_CADENCE_QSPI=y
 CONFIG_TIMER=y
 CONFIG_SPL_TIMER=y
 CONFIG_OMAP_TIMER=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_SPL_DM_USB=y
+CONFIG_DM_USB_GADGET=y
+CONFIG_SPL_DM_USB_GADGET=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_CDNS3=y
+CONFIG_USB_CDNS3_GADGET=y
+CONFIG_SPL_USB_CDNS3_GADGET=y
+CONFIG_USB_CDNS3_HOST=y
+CONFIG_SPL_USB_CDNS3_HOST=y
+CONFIG_USB_CDNS3_TI=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0x6165
+CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
diff --git a/include/configs/am64x_evm.h b/include/configs/am64x_evm.h
index 7c9bdc2d7d3a..c2c2bf06777c 100644
--- a/include/configs/am64x_evm.h
+++ b/include/configs/am64x_evm.h
@@ -13,6 +13,7 @@
 #include <config_distro_bootcmd.h>
 #include <environment/ti/mmc.h>
 #include <asm/arch/am64_hardware.h>
+#include <environment/ti/k3_dfu.h>
 
 /* DDR Configuration */
 #define CONFIG_SYS_SDRAM_BASE1		0x880000000
@@ -95,16 +96,25 @@
 		"${bootdir}/${name_fit}\0"				\
 	"partitions=" PARTS_DEFAULT
 
+#define EXTRA_ENV_DFUARGS \
+	DFU_ALT_INFO_MMC \
+	DFU_ALT_INFO_EMMC \
+	DFU_ALT_INFO_RAM \
+	DFU_ALT_INFO_OSPI
+
 /* Incorporate settings into the U-Boot environment */
 #define CONFIG_EXTRA_ENV_SETTINGS					\
 	DEFAULT_LINUX_BOOT_ENV						\
 	DEFAULT_MMC_TI_ARGS						\
 	EXTRA_ENV_AM642_BOARD_SETTINGS					\
-	EXTRA_ENV_AM642_BOARD_SETTINGS_MMC
+	EXTRA_ENV_AM642_BOARD_SETTINGS_MMC				\
+	EXTRA_ENV_DFUARGS
 
 /* Now for the remaining common defines */
 #include <configs/ti_armv7_common.h>
 
+#define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
+
 /* MMC ENV related defines */
 #ifdef CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV		0
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 00/10] AM642-EVM: Add USB support
  2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
                   ` (9 preceding siblings ...)
  2021-06-01 15:13 ` [PATCH 10/10] configs: am64: Enable configs to support USB host and device modes Aswath Govindraju
@ 2021-06-01 16:13 ` Aswath Govindraju
  2021-06-03  5:29   ` Lokesh Vutla
  10 siblings, 1 reply; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-01 16:13 UTC (permalink / raw)
  Cc: Kishon Vijay Abraham I, Lokesh Vutla, Dave Gerlach,
	Vignesh Raghavendra, Nishanth Menon, Suman Anna, Keerthy, u-boot

Hi all,

On 01/06/21 8:43 pm, Aswath Govindraju wrote:
> The following series of patches add support for the following
> - Kconfig symbol for giving the load address for ATF
> - USB Mass storrage boot mode in AM642-EVM
> - DFU boot mode in AM642-EVM
> - Host and peripheral modes for AM642-EVM in U-Boot
> - Set the USB PHY core voltage to 0.85V
> 

Patch 9 is dependent on,
https://patchwork.ozlabs.org/project/uboot/patch/20210601112147.10253-1-a-govindraju@ti.com/

Thanks,
Aswath

> Aswath Govindraju (10):
>   tools: k3_fit_atf: Add support for providing ATF load address using a
>     Kconfig symbol
>   arm: mach-k3: am642_init: Add support for USB boot mode
>   arm: mach-k3: am642_init: Do USB fixups to facilitate host and device
>     boot modes
>   board: ti: am64x: Set the core voltage of USB PHY to 0.85V
>   arm: dts: k3-am64-main: Add USB DT nodes
>   arm: dts: k3-am642-*-evm: Add USB support
>   arm: dts: k3-am642-evm-u-boot: Add U-Boot tags and fix the dr_mode to
>     peripheral for USB subsystem
>   configs: am64x_evm_*_defconfig: Move the SPL Load address to
>     0x70000000, move the ATF to a latter location and rearrange EEPROM
>     and BSS data
>   arm: dts: k3-am64-main: Update the location of ATF in SRAM
>   configs: am64: Enable configs to support USB host and device modes
> 
>  arch/arm/dts/k3-am64-main.dtsi                | 32 ++++++++++++-
>  arch/arm/dts/k3-am642-evm-u-boot.dtsi         | 13 ++++++
>  arch/arm/dts/k3-am642-evm.dts                 | 18 ++++++++
>  arch/arm/dts/k3-am642-r5-evm.dts              | 18 ++++++++
>  arch/arm/mach-k3/Kconfig                      |  7 +++
>  arch/arm/mach-k3/am642_init.c                 | 46 ++++++++++++++++++-
>  arch/arm/mach-k3/config.mk                    |  1 +
>  arch/arm/mach-k3/include/mach/am64_hardware.h | 11 +++--
>  arch/arm/mach-k3/include/mach/am64_spl.h      |  6 ++-
>  board/ti/am64x/evm.c                          | 14 ++++++
>  configs/am64x_evm_a53_defconfig               | 40 ++++++++++++++++
>  configs/am64x_evm_r5_defconfig                | 38 +++++++++++++--
>  include/configs/am64x_evm.h                   | 15 +++++-
>  tools/k3_fit_atf.sh                           |  9 ++--
>  14 files changed, 251 insertions(+), 17 deletions(-)
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 01/10] tools: k3_fit_atf: Add support for providing ATF load address using a Kconfig symbol
  2021-06-01 15:13 ` [PATCH 01/10] tools: k3_fit_atf: Add support for providing ATF load address using a Kconfig symbol Aswath Govindraju
@ 2021-06-03  5:24   ` Lokesh Vutla
  2021-06-03  5:58     ` Aswath Govindraju
  0 siblings, 1 reply; 16+ messages in thread
From: Lokesh Vutla @ 2021-06-03  5:24 UTC (permalink / raw)
  To: Aswath Govindraju
  Cc: Kishon Vijay Abraham I, Dave Gerlach, Nishanth Menon,
	Vignesh Raghavendra, Suman Anna, Keerthy, u-boot



On 01/06/21 8:43 pm, Aswath Govindraju wrote:
> Add support for providing ATF load address with a Kconfig symbol.
> 
> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
> ---
>  arch/arm/mach-k3/Kconfig   | 7 +++++++
>  arch/arm/mach-k3/config.mk | 1 +
>  tools/k3_fit_atf.sh        | 9 ++++++---
>  3 files changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
> index bfbce44bfa59..2c46d7a3a798 100644
> --- a/arch/arm/mach-k3/Kconfig
> +++ b/arch/arm/mach-k3/Kconfig
> @@ -147,6 +147,13 @@ config SYS_K3_SPL_ATF
>  	  Enabling this will try to start Cortex-A (typically with ATF)
>  	  after SPL from R5.
>  
> +config K3_ATF_LOAD_ADDR
> +	hex "Load address of ATF image"
> +	default 0x7000000

	shouldn't this be 0x70000000 ?

Thanks and regards,
Lokesh


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 00/10] AM642-EVM: Add USB support
  2021-06-01 16:13 ` [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
@ 2021-06-03  5:29   ` Lokesh Vutla
  2021-06-03  6:14     ` Aswath Govindraju
  0 siblings, 1 reply; 16+ messages in thread
From: Lokesh Vutla @ 2021-06-03  5:29 UTC (permalink / raw)
  To: Aswath Govindraju
  Cc: Kishon Vijay Abraham I, Dave Gerlach, Vignesh Raghavendra,
	Nishanth Menon, Suman Anna, Keerthy, u-boot



On 01/06/21 9:43 pm, Aswath Govindraju wrote:
> Hi all,
> 
> On 01/06/21 8:43 pm, Aswath Govindraju wrote:
>> The following series of patches add support for the following
>> - Kconfig symbol for giving the load address for ATF
>> - USB Mass storrage boot mode in AM642-EVM
>> - DFU boot mode in AM642-EVM
>> - Host and peripheral modes for AM642-EVM in U-Boot
>> - Set the USB PHY core voltage to 0.85V
>>
> 
> Patch 9 is dependent on,
> https://patchwork.ozlabs.org/project/uboot/patch/20210601112147.10253-1-a-govindraju@ti.com/

Please ping me once the above patch is merged.

Thanks and regards,
Lokesh


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 01/10] tools: k3_fit_atf: Add support for providing ATF load address using a Kconfig symbol
  2021-06-03  5:24   ` Lokesh Vutla
@ 2021-06-03  5:58     ` Aswath Govindraju
  0 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-03  5:58 UTC (permalink / raw)
  To: Lokesh Vutla
  Cc: Kishon Vijay Abraham I, Dave Gerlach, Nishanth Menon,
	Vignesh Raghavendra, Suman Anna, Keerthy, u-boot

Hi Lokesh,

On 03/06/21 10:54 am, Lokesh Vutla wrote:
> 
> 
> On 01/06/21 8:43 pm, Aswath Govindraju wrote:
>> Add support for providing ATF load address with a Kconfig symbol.
>>
>> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
>> ---
>>  arch/arm/mach-k3/Kconfig   | 7 +++++++
>>  arch/arm/mach-k3/config.mk | 1 +
>>  tools/k3_fit_atf.sh        | 9 ++++++---
>>  3 files changed, 14 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
>> index bfbce44bfa59..2c46d7a3a798 100644
>> --- a/arch/arm/mach-k3/Kconfig
>> +++ b/arch/arm/mach-k3/Kconfig
>> @@ -147,6 +147,13 @@ config SYS_K3_SPL_ATF
>>  	  Enabling this will try to start Cortex-A (typically with ATF)
>>  	  after SPL from R5.
>>  
>> +config K3_ATF_LOAD_ADDR
>> +	hex "Load address of ATF image"
>> +	default 0x7000000
> 
> 	shouldn't this be 0x70000000 ?
> 

Sorry , it should be 0x70000000. Will correct this in respin.

Thanks,
Aswath

> Thanks and regards,
> Lokesh
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 00/10] AM642-EVM: Add USB support
  2021-06-03  5:29   ` Lokesh Vutla
@ 2021-06-03  6:14     ` Aswath Govindraju
  0 siblings, 0 replies; 16+ messages in thread
From: Aswath Govindraju @ 2021-06-03  6:14 UTC (permalink / raw)
  To: Lokesh Vutla
  Cc: Kishon Vijay Abraham I, Dave Gerlach, Vignesh Raghavendra,
	Nishanth Menon, Suman Anna, Keerthy, u-boot

Hi,

On 03/06/21 10:59 am, Lokesh Vutla wrote:
> 
> 
> On 01/06/21 9:43 pm, Aswath Govindraju wrote:
>> Hi all,
>>
>> On 01/06/21 8:43 pm, Aswath Govindraju wrote:
>>> The following series of patches add support for the following
>>> - Kconfig symbol for giving the load address for ATF
>>> - USB Mass storrage boot mode in AM642-EVM
>>> - DFU boot mode in AM642-EVM
>>> - Host and peripheral modes for AM642-EVM in U-Boot
>>> - Set the USB PHY core voltage to 0.85V
>>>
>>
>> Patch 9 is dependent on,
>> https://patchwork.ozlabs.org/project/uboot/patch/20210601112147.10253-1-a-govindraju@ti.com/
> 
> Please ping me once the above patch is merged.
> 

I have a posted a respin(v2) of this series after making the correction
in the patch 1 for the default ATF load address. I will ping on the v2
series after the above patch gets merged.

Thanks,
Aswath

> Thanks and regards,
> Lokesh
> 



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-06-03  6:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01 15:13 [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
2021-06-01 15:13 ` [PATCH 01/10] tools: k3_fit_atf: Add support for providing ATF load address using a Kconfig symbol Aswath Govindraju
2021-06-03  5:24   ` Lokesh Vutla
2021-06-03  5:58     ` Aswath Govindraju
2021-06-01 15:13 ` [PATCH 02/10] arm: mach-k3: am642_init: Add support for USB boot mode Aswath Govindraju
2021-06-01 15:13 ` [PATCH 03/10] arm: mach-k3: am642_init: Do USB fixups to facilitate host and device boot modes Aswath Govindraju
2021-06-01 15:13 ` [PATCH 04/10] board: ti: am64x: Set the core voltage of USB PHY to 0.85V Aswath Govindraju
2021-06-01 15:13 ` [PATCH 05/10] arm: dts: k3-am64-main: Add USB DT nodes Aswath Govindraju
2021-06-01 15:13 ` [PATCH 06/10] arm: dts: k3-am642-*-evm: Add USB support Aswath Govindraju
2021-06-01 15:13 ` [PATCH 07/10] arm: dts: k3-am642-evm-u-boot: Add U-Boot tags and fix the dr_mode to peripheral for USB subsystem Aswath Govindraju
2021-06-01 15:13 ` [PATCH 08/10] configs: am64x_evm_*_defconfig: Move the SPL Load address to 0x70000000, move the ATF to a latter location and rearrange EEPROM and BSS data Aswath Govindraju
2021-06-01 15:13 ` [PATCH 09/10] arm: dts: k3-am64-main: Update the location of ATF in SRAM Aswath Govindraju
2021-06-01 15:13 ` [PATCH 10/10] configs: am64: Enable configs to support USB host and device modes Aswath Govindraju
2021-06-01 16:13 ` [PATCH 00/10] AM642-EVM: Add USB support Aswath Govindraju
2021-06-03  5:29   ` Lokesh Vutla
2021-06-03  6:14     ` Aswath Govindraju

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.