From 6da749d8b364adff089356c75ffa477278fd250f Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 5 Apr 2020 12:20:23 +0200 Subject: [PATCH 01/14] arm: meson: imply DM_RNG All ARCH_MESON boards have a hardware random number generator. So we should enable building the RNG driver. Signed-off-by: Heinrich Schuchardt Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index bbb1e2738bf..eee4538c7e2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -762,6 +762,7 @@ config ARCH_OMAP2PLUS config ARCH_MESON bool "Amlogic Meson" imply DISTRO_DEFAULTS + imply DM_RNG help Support for the Meson SoC family developed by Amlogic Inc., targeted at media players and tablet computers. We currently From d2235ee56c543105ec87274914432eb01abc5556 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 7 Apr 2020 08:32:00 +0200 Subject: [PATCH 02/14] configs: correct SMBIOS information for ODROID-C2 CONFIG_SMBIOS_MANUFACTURER="amlogic" CONFIG_SMBIOS_PRODUCT_NAME="p200" is incorrect for the ODROID-C2. Show correct board name and manufacturer in SMBIOS. Signed-off-by: Heinrich Schuchardt Signed-off-by: Neil Armstrong --- configs/odroid-c2_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig index 64fbfdf0646..39279b40db1 100644 --- a/configs/odroid-c2_defconfig +++ b/configs/odroid-c2_defconfig @@ -7,6 +7,7 @@ CONFIG_NR_DRAM_BANKS=1 CONFIG_DEBUG_UART_BASE=0xc81004c0 CONFIG_DEBUG_UART_CLOCK=24000000 CONFIG_IDENT_STRING=" odroid-c2" +CONFIG_SMBIOS_PRODUCT_NAME="ODROID-C2" CONFIG_DEBUG_UART=y CONFIG_OF_BOARD_SETUP=y CONFIG_CONSOLE_MUX=y @@ -41,3 +42,4 @@ CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_DEBUG_UART_SKIP_INIT=y CONFIG_MESON_SERIAL=y CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_SMBIOS_MANUFACTURER="Hardkernel Co., Ltd." From ae9bf79bedc4ec5b4f8fb55d2f7736fdb7a4258d Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Wed, 15 Apr 2020 17:58:30 +0200 Subject: [PATCH 03/14] ARM: dts: add missing meson-gxl-s805x-libretech-ac-u-boot.dtsi file The libretech-ac u-boot.dtsi file is missing to enabled DT nodes changes to enable Video output on U-Boot. Fixes: 671b1db8f8 ("arm64: dts: meson-gx: vpu should be probed before relocation") Reported-by: Jerome Brunet Signed-off-by: Neil Armstrong Tested-by: Jerome Brunet --- arch/arm/dts/meson-gxl-s805x-libretech-ac-u-boot.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 arch/arm/dts/meson-gxl-s805x-libretech-ac-u-boot.dtsi diff --git a/arch/arm/dts/meson-gxl-s805x-libretech-ac-u-boot.dtsi b/arch/arm/dts/meson-gxl-s805x-libretech-ac-u-boot.dtsi new file mode 100644 index 00000000000..c35158d7e9e --- /dev/null +++ b/arch/arm/dts/meson-gxl-s805x-libretech-ac-u-boot.dtsi @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 BayLibre, SAS. + * Author: Neil Armstrong + */ + +#include "meson-gx-u-boot.dtsi" From c8ccca921adef0fa6bba58d5b4b49a07d0862159 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 16 Apr 2020 10:39:41 +0200 Subject: [PATCH 04/14] arm64: dts: meson-gx: add back dmc register range until canvas driver is available The Linux VPU bindings have changed and dropped the dmc register range. Add it back in the meson-gx-u-boot.dtsi file until a proper canvas driver is available. Fixes: dd5f2351e9 ("arm64: dts: meson: sync dt and bindings from v5.6-rc2") Signed-off-by: Neil Armstrong --- arch/arm/dts/meson-gx-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/dts/meson-gx-u-boot.dtsi b/arch/arm/dts/meson-gx-u-boot.dtsi index b84e5edba4c..17d2cb95c13 100644 --- a/arch/arm/dts/meson-gx-u-boot.dtsi +++ b/arch/arm/dts/meson-gx-u-boot.dtsi @@ -11,6 +11,10 @@ }; &vpu { + reg = <0x0 0xd0100000 0x0 0x100000>, + <0x0 0xc883c000 0x0 0x1000>, + <0x0 0xc8838000 0x0 0x1000>; + reg-names = "vpu", "hhi", "dmc"; u-boot,dm-pre-reloc; }; From c2b9aa98bf44e9537222c5c8d6ea365d5220f2e4 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 30 Mar 2020 11:27:23 +0200 Subject: [PATCH 05/14] generic-phy: add generic_phy_get_by_node() Add generic_phy_get_by_node() to get a PHY phandle from a node instead of a udevice. Signed-off-by: Neil Armstrong Reviewed-by: Tom Rini [narmstrong: fixed by including ofnode.h in generic-phy.h] --- drivers/phy/phy-uclass.c | 16 +++++++++++----- include/generic-phy.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/drivers/phy/phy-uclass.c b/drivers/phy/phy-uclass.c index e201a90c8c8..e463b0b400e 100644 --- a/drivers/phy/phy-uclass.c +++ b/drivers/phy/phy-uclass.c @@ -31,20 +31,20 @@ static int generic_phy_xlate_offs_flags(struct phy *phy, return 0; } -int generic_phy_get_by_index(struct udevice *dev, int index, - struct phy *phy) +int generic_phy_get_by_node(ofnode node, int index, struct phy *phy) { struct ofnode_phandle_args args; struct phy_ops *ops; struct udevice *phydev; int i, ret; - debug("%s(dev=%p, index=%d, phy=%p)\n", __func__, dev, index, phy); + debug("%s(node=%s, index=%d, phy=%p)\n", + __func__, ofnode_get_name(node), index, phy); assert(phy); phy->dev = NULL; - ret = dev_read_phandle_with_args(dev, "phys", "#phy-cells", 0, index, - &args); + ret = ofnode_parse_phandle_with_args(node, "phys", "#phy-cells", 0, + index, &args); if (ret) { debug("%s: dev_read_phandle_with_args failed: err=%d\n", __func__, ret); @@ -90,6 +90,12 @@ err: return ret; } +int generic_phy_get_by_index(struct udevice *dev, int index, + struct phy *phy) +{ + return generic_phy_get_by_node(dev_ofnode(dev), index, phy); +} + int generic_phy_get_by_name(struct udevice *dev, const char *phy_name, struct phy *phy) { diff --git a/include/generic-phy.h b/include/generic-phy.h index 95caf583413..73537025c2c 100644 --- a/include/generic-phy.h +++ b/include/generic-phy.h @@ -7,6 +7,8 @@ #ifndef __GENERIC_PHY_H #define __GENERIC_PHY_H +#include + struct ofnode_phandle_args; /** @@ -193,6 +195,33 @@ int generic_phy_power_off(struct phy *phy); int generic_phy_get_by_index(struct udevice *user, int index, struct phy *phy); +/** + * generic_phy_get_by_node() - Get a PHY device by integer index on ofnode + * + * @node: the device node + * @index: The index in the list of available PHYs + * @phy: A pointer to the PHY port + * + * This looks up a PHY device for a client device based on its ofnode and on + * its position in the list of the possible PHYs. + * + * example: + * usb1: usb_otg_ss@xxx { + * compatible = "xxx"; + * reg = ; + * . + * . + * phys = <&usb2_phy>, <&usb3_phy>; + * . + * . + * }; + * the USB2 phy can be accessed by passing index '0' and the USB3 phy can + * be accessed by passing index '1' + * + * @return 0 if OK, or a negative error code + */ +int generic_phy_get_by_node(ofnode node, int index, struct phy *phy); + /** * generic_phy_get_by_name() - Get a PHY device by its name. * From 838c0af9d25daa6f783acf0091deca0512baf0df Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 30 Mar 2020 11:27:24 +0200 Subject: [PATCH 06/14] phy: meson-gxl-usb: add set_mode call to force switch to peripheral mode Add set_mode function in the Amlogic GXL PHYs that will be called by the arch code to switch PHYs from/to gadget mode. Signed-off-by: Neil Armstrong --- arch/arm/include/asm/arch-meson/usb-gx.h | 16 ++++++++++ drivers/phy/meson-gxl-usb2.c | 30 ++++++++++++++---- drivers/phy/meson-gxl-usb3.c | 40 ++++++++++++++++++------ 3 files changed, 70 insertions(+), 16 deletions(-) create mode 100644 arch/arm/include/asm/arch-meson/usb-gx.h diff --git a/arch/arm/include/asm/arch-meson/usb-gx.h b/arch/arm/include/asm/arch-meson/usb-gx.h new file mode 100644 index 00000000000..aeb8e0c6739 --- /dev/null +++ b/arch/arm/include/asm/arch-meson/usb-gx.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2019 BayLibre SAS + * Author: Neil Armstrong + */ +#ifndef _ARCH_MESON_USB_GX_H_ +#define _ARCH_MESON_USB_GX_H_ + +#include +#include + +/* TOFIX add set_mode to struct phy_ops */ +void phy_meson_gxl_usb2_set_mode(struct phy *phy, enum usb_dr_mode mode); +void phy_meson_gxl_usb3_set_mode(struct phy *phy, enum usb_dr_mode mode); + +#endif diff --git a/drivers/phy/meson-gxl-usb2.c b/drivers/phy/meson-gxl-usb2.c index c98d12b627d..b4f4c3c76b9 100644 --- a/drivers/phy/meson-gxl-usb2.c +++ b/drivers/phy/meson-gxl-usb2.c @@ -17,6 +17,9 @@ #include #include #include +#include + +#include #include #include @@ -121,15 +124,30 @@ static void phy_meson_gxl_usb2_reset(struct phy_meson_gxl_usb2_priv *priv) udelay(RESET_COMPLETE_TIME); } -static void -phy_meson_gxl_usb2_set_host_mode(struct phy_meson_gxl_usb2_priv *priv) +void phy_meson_gxl_usb2_set_mode(struct phy *phy, enum usb_dr_mode mode) { + struct udevice *dev = phy->dev; + struct phy_meson_gxl_usb2_priv *priv = dev_get_priv(dev); uint val; regmap_read(priv->regmap, U2P_R0, &val); - val |= U2P_R0_DM_PULLDOWN; - val |= U2P_R0_DP_PULLDOWN; - val &= ~U2P_R0_ID_PULLUP; + + switch (mode) { + case USB_DR_MODE_UNKNOWN: + case USB_DR_MODE_HOST: + case USB_DR_MODE_OTG: + val |= U2P_R0_DM_PULLDOWN; + val |= U2P_R0_DP_PULLDOWN; + val &= ~U2P_R0_ID_PULLUP; + break; + + case USB_DR_MODE_PERIPHERAL: + val &= ~U2P_R0_DM_PULLDOWN; + val &= ~U2P_R0_DP_PULLDOWN; + val |= U2P_R0_ID_PULLUP; + break; + } + regmap_write(priv->regmap, U2P_R0, val); phy_meson_gxl_usb2_reset(priv); @@ -146,7 +164,7 @@ static int phy_meson_gxl_usb2_power_on(struct phy *phy) val &= ~U2P_R0_POWER_ON_RESET; regmap_write(priv->regmap, U2P_R0, val); - phy_meson_gxl_usb2_set_host_mode(priv); + phy_meson_gxl_usb2_set_mode(phy, USB_DR_MODE_HOST); #if CONFIG_IS_ENABLED(DM_REGULATOR) if (priv->phy_supply) { diff --git a/drivers/phy/meson-gxl-usb3.c b/drivers/phy/meson-gxl-usb3.c index c2a8593b39f..9de55bb5df0 100644 --- a/drivers/phy/meson-gxl-usb3.c +++ b/drivers/phy/meson-gxl-usb3.c @@ -16,6 +16,9 @@ #include #include #include +#include + +#include #include #include @@ -93,20 +96,35 @@ struct phy_meson_gxl_usb3_priv { #endif }; -static int -phy_meson_gxl_usb3_set_host_mode(struct phy_meson_gxl_usb3_priv *priv) +void phy_meson_gxl_usb3_set_mode(struct phy *phy, enum usb_dr_mode mode) { + struct udevice *dev = phy->dev; + struct phy_meson_gxl_usb3_priv *priv = dev_get_priv(dev); uint val; - regmap_read(priv->regmap, USB_R0, &val); - val &= ~USB_R0_U2D_ACT; - regmap_write(priv->regmap, USB_R0, val); + switch (mode) { + case USB_DR_MODE_UNKNOWN: + case USB_DR_MODE_HOST: + case USB_DR_MODE_OTG: + regmap_read(priv->regmap, USB_R0, &val); + val &= ~USB_R0_U2D_ACT; + regmap_write(priv->regmap, USB_R0, val); - regmap_read(priv->regmap, USB_R4, &val); - val &= ~USB_R4_P21_SLEEP_M0; - regmap_write(priv->regmap, USB_R4, val); + regmap_read(priv->regmap, USB_R4, &val); + val &= ~USB_R4_P21_SLEEP_M0; + regmap_write(priv->regmap, USB_R4, val); + break; - return 0; + case USB_DR_MODE_PERIPHERAL: + regmap_read(priv->regmap, USB_R0, &val); + val |= USB_R0_U2D_ACT; + regmap_write(priv->regmap, USB_R0, val); + + regmap_read(priv->regmap, USB_R4, &val); + val |= USB_R4_P21_SLEEP_M0; + regmap_write(priv->regmap, USB_R4, val); + break; + } } static int phy_meson_gxl_usb3_power_on(struct phy *phy) @@ -122,7 +140,9 @@ static int phy_meson_gxl_usb3_power_on(struct phy *phy) val |= FIELD_PREP(USB_R5_ID_DIG_TH_MASK, 0xff); regmap_write(priv->regmap, USB_R5, val); - return phy_meson_gxl_usb3_set_host_mode(priv); + phy_meson_gxl_usb3_set_mode(phy, USB_DR_MODE_HOST); + + return 0; } static int phy_meson_gxl_usb3_power_off(struct phy *phy) From dc999e5759d7ed7082a36c99709fd905f28c6dd5 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 30 Mar 2020 11:27:25 +0200 Subject: [PATCH 07/14] arm: meson-gx: add board_usb_init()/cleanup() for USB gadget Add arch code to initialize USB Gadget mode using the DWC2 controller, and using the previously added set_mode() phy functions. [narmstrong: fixup board_usb_cleanup call to phy_meson_gxl_usb2_set_mode] Signed-off-by: Neil Armstrong --- arch/arm/mach-meson/board-gx.c | 118 +++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/arch/arm/mach-meson/board-gx.c b/arch/arm/mach-meson/board-gx.c index 191fd490058..3da99017a5a 100644 --- a/arch/arm/mach-meson/board-gx.c +++ b/arch/arm/mach-meson/board-gx.c @@ -14,6 +14,11 @@ #include #include #include +#include +#include +#include +#include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -149,3 +154,116 @@ void meson_eth_init(phy_interface_t mode, unsigned int flags) /* Enable power gate */ clrbits_le32(GX_MEM_PD_REG_0, GX_MEM_PD_REG_0_ETH_MASK); } + +#if CONFIG_IS_ENABLED(USB_XHCI_DWC3_OF_SIMPLE) && \ + CONFIG_IS_ENABLED(USB_GADGET_DWC2_OTG) +static struct dwc2_plat_otg_data meson_gx_dwc2_data; +static struct phy usb_phys[2]; + +int board_usb_init(int index, enum usb_init_type init) +{ + struct ofnode_phandle_args args; + struct udevice *clk_dev; + ofnode dwc2_node; + struct clk clk; + int ret, i; + u32 val; + + /* find the dwc2 node */ + dwc2_node = ofnode_by_compatible(ofnode_null(), "snps,dwc2"); + if (!ofnode_valid(dwc2_node)) { + debug("Not found dwc2 node\n"); + return -ENODEV; + } + + if (!ofnode_is_available(dwc2_node)) { + debug("dwc2 is disabled in the device tree\n"); + return -ENODEV; + } + + /* get the PHYs */ + for (i = 0; i < 2; i++) { + ret = generic_phy_get_by_node(dwc2_node, i, &usb_phys[i]); + if (ret && ret != -ENOENT) { + pr_err("Failed to get USB PHY%d for %s\n", + i, ofnode_get_name(dwc2_node)); + return ret; + } + } + + for (i = 0; i < 2; i++) { + ret = generic_phy_init(&usb_phys[i]); + if (ret) { + pr_err("Can't init USB PHY%d for %s\n", + i, ofnode_get_name(dwc2_node)); + return ret; + } + } + + for (i = 0; i < 2; i++) { + ret = generic_phy_power_on(&usb_phys[i]); + if (ret) { + pr_err("Can't power USB PHY%d for %s\n", + i, ofnode_get_name(dwc2_node)); + return ret; + } + } + + phy_meson_gxl_usb3_set_mode(&usb_phys[0], USB_DR_MODE_PERIPHERAL); + phy_meson_gxl_usb2_set_mode(&usb_phys[1], USB_DR_MODE_PERIPHERAL); + + meson_gx_dwc2_data.regs_otg = ofnode_get_addr(dwc2_node); + if (meson_gx_dwc2_data.regs_otg == FDT_ADDR_T_NONE) { + debug("usbotg: can't get base address\n"); + return -ENODATA; + } + + /* Enable clock */ + ret = ofnode_parse_phandle_with_args(dwc2_node, "clocks", + "#clock-cells", 0, 0, &args); + if (ret) { + debug("usbotg has no clocks defined in the device tree\n"); + return ret; + } + + ret = uclass_get_device_by_ofnode(UCLASS_CLK, args.node, &clk_dev); + if (ret) + return ret; + + if (args.args_count != 1) { + debug("Can't find clock ID in the device tree\n"); + return -ENODATA; + } + + clk.dev = clk_dev; + clk.id = args.args[0]; + + ret = clk_enable(&clk); + if (ret) { + debug("Failed to enable usbotg clock\n"); + return ret; + } + + ofnode_read_u32(dwc2_node, "g-rx-fifo-size", &val); + meson_gx_dwc2_data.rx_fifo_sz = val; + ofnode_read_u32(dwc2_node, "g-np-tx-fifo-size", &val); + meson_gx_dwc2_data.np_tx_fifo_sz = val; + ofnode_read_u32(dwc2_node, "g-tx-fifo-size", &val); + meson_gx_dwc2_data.tx_fifo_sz = val; + + return dwc2_udc_probe(&meson_gx_dwc2_data); +} + +int board_usb_cleanup(int index, enum usb_init_type init) +{ + int i; + + phy_meson_gxl_usb3_set_mode(&usb_phys[0], USB_DR_MODE_HOST); + phy_meson_gxl_usb2_set_mode(&usb_phys[1], USB_DR_MODE_HOST); + + for (i = 0; i < 2; i++) + usb_phys[i].dev = NULL; + + return 0; +} +#endif From a19e8a0f036366d76bf5bc6c156bc270420b9663 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 30 Mar 2020 11:27:26 +0200 Subject: [PATCH 08/14] arm: dts: meson-gxl: Add USB Gadget nodes for U-Boot Add the USB DWC2 node to u-boot specific dtsi files since Gadget support is not (yet) available in upstream Linux yet. Signed-off-by: Neil Armstrong --- .../meson-gxl-s905x-khadas-vim-u-boot.dtsi | 2 +- .../meson-gxl-s905x-libretech-cc-u-boot.dtsi | 6 ++++- arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi | 2 +- arch/arm/dts/meson-gxl-u-boot.dtsi | 23 +++++++++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 arch/arm/dts/meson-gxl-u-boot.dtsi diff --git a/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi b/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi index c35158d7e9e..39270ea71c8 100644 --- a/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi +++ b/arch/arm/dts/meson-gxl-s905x-khadas-vim-u-boot.dtsi @@ -4,4 +4,4 @@ * Author: Neil Armstrong */ -#include "meson-gx-u-boot.dtsi" +#include "meson-gxl-u-boot.dtsi" diff --git a/arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi b/arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi index c35158d7e9e..474a3e16044 100644 --- a/arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi +++ b/arch/arm/dts/meson-gxl-s905x-libretech-cc-u-boot.dtsi @@ -4,4 +4,8 @@ * Author: Neil Armstrong */ -#include "meson-gx-u-boot.dtsi" +#include "meson-gxl-u-boot.dtsi" + +&dwc2 { + status = "okay"; +}; diff --git a/arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi b/arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi index c35158d7e9e..39270ea71c8 100644 --- a/arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi +++ b/arch/arm/dts/meson-gxl-s905x-p212-u-boot.dtsi @@ -4,4 +4,4 @@ * Author: Neil Armstrong */ -#include "meson-gx-u-boot.dtsi" +#include "meson-gxl-u-boot.dtsi" diff --git a/arch/arm/dts/meson-gxl-u-boot.dtsi b/arch/arm/dts/meson-gxl-u-boot.dtsi new file mode 100644 index 00000000000..9e88afd30eb --- /dev/null +++ b/arch/arm/dts/meson-gxl-u-boot.dtsi @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2019 BayLibre, SAS. + * Author: Neil Armstrong + */ + +#include "meson-gx-u-boot.dtsi" + +&usb0 { + dwc2: usb@c9100000 { + compatible = "snps,dwc2"; + reg = <0x0 0xc9100000 0x0 0x40000>; + interrupts = ; + clocks = <&clkc CLKID_USB1_DDR_BRIDGE>; + clock-names = "ddr"; + phys = <&usb3_phy>, <&usb2_phy1>; + dr_mode = "peripheral"; + g-rx-fifo-size = <192>; + g-np-tx-fifo-size = <128>; + g-tx-fifo-size = <128 128 16 16 16>; + status = "disabled"; + }; +}; From af71bdc03026cb07b2e7f8fba06d9da5f1e31bc6 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 30 Mar 2020 11:27:27 +0200 Subject: [PATCH 09/14] configs: libretech-cc: Enable USB gadget with Mass Storage function Enable configs to support USB gadget and Mass Storage Signed-off-by: Neil Armstrong --- configs/libretech-cc_defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configs/libretech-cc_defconfig b/configs/libretech-cc_defconfig index 7c257b33b3b..2c512ebc1ec 100644 --- a/configs/libretech-cc_defconfig +++ b/configs/libretech-cc_defconfig @@ -19,6 +19,7 @@ CONFIG_CMD_GPIO=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_REGULATOR=y CONFIG_OF_CONTROL=y @@ -51,6 +52,12 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3=y +# CONFIG_USB_DWC3_GADGET is not set +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e +CONFIG_USB_GADGET_PRODUCT_NUM=0xfada +CONFIG_USB_GADGET_DWC2_OTG=y +CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_DM_VIDEO=y # CONFIG_VIDEO_BPP8 is not set # CONFIG_VIDEO_BPP16 is not set From 7033dbfc726cf32e74884ad0391bd8a62bcbfea1 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 30 Mar 2020 11:27:28 +0200 Subject: [PATCH 10/14] configs: libretech-ac: Enable USB gadget with Mass Storage function Enable configs to support USB gadget and Mass Storage Signed-off-by: Neil Armstrong --- configs/libretech-ac_defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configs/libretech-ac_defconfig b/configs/libretech-ac_defconfig index 09b87c54d5e..7e486757a2f 100644 --- a/configs/libretech-ac_defconfig +++ b/configs/libretech-ac_defconfig @@ -27,6 +27,7 @@ CONFIG_CMD_MMC=y CONFIG_CMD_SF_TEST=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_REGULATOR=y CONFIG_OF_CONTROL=y @@ -69,6 +70,12 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3=y CONFIG_USB_KEYBOARD=y +# CONFIG_USB_DWC3_GADGET is not set +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e +CONFIG_USB_GADGET_PRODUCT_NUM=0xfada +CONFIG_USB_GADGET_DWC2_OTG=y +CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_DM_VIDEO=y # CONFIG_VIDEO_BPP8 is not set # CONFIG_VIDEO_BPP16 is not set From 269ac202ae9a186df87e0c3c0486002d414ee790 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 30 Mar 2020 11:27:29 +0200 Subject: [PATCH 11/14] configs: khadas-vim2: Enable USB gadget with Mass Storage function Enable configs to support USB gadget and Mass Storage Signed-off-by: Neil Armstrong --- configs/khadas-vim2_defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configs/khadas-vim2_defconfig b/configs/khadas-vim2_defconfig index 9cb377e55e0..a5335664108 100644 --- a/configs/khadas-vim2_defconfig +++ b/configs/khadas-vim2_defconfig @@ -20,6 +20,7 @@ CONFIG_CMD_GPIO=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_REGULATOR=y CONFIG_OF_CONTROL=y @@ -49,4 +50,10 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3=y +# CONFIG_USB_DWC3_GADGET is not set +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e +CONFIG_USB_GADGET_PRODUCT_NUM=0xfada +CONFIG_USB_GADGET_DWC2_OTG=y +CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_OF_LIBFDT_OVERLAY=y From 2a367d2745f9aeedb6fb5edade2829a7bb6a0dba Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 30 Mar 2020 11:27:30 +0200 Subject: [PATCH 12/14] configs: khadas-vim: Enable USB gadget with Mass Storage function Enable configs to support USB gadget and Mass Storage Signed-off-by: Neil Armstrong --- configs/khadas-vim_defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configs/khadas-vim_defconfig b/configs/khadas-vim_defconfig index e18a5e62bb6..8a0af5cebb3 100644 --- a/configs/khadas-vim_defconfig +++ b/configs/khadas-vim_defconfig @@ -20,6 +20,7 @@ CONFIG_CMD_GPIO=y # CONFIG_CMD_LOADS is not set CONFIG_CMD_MMC=y CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_REGULATOR=y CONFIG_OF_CONTROL=y @@ -50,4 +51,10 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3=y +# CONFIG_USB_DWC3_GADGET is not set +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e +CONFIG_USB_GADGET_PRODUCT_NUM=0xfada +CONFIG_USB_GADGET_DWC2_OTG=y +CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_OF_LIBFDT_OVERLAY=y From 572a8064af5c9150b642f61932f9968d8eaee7fd Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 30 Mar 2020 11:27:31 +0200 Subject: [PATCH 13/14] configs: libretech-s905d-pc: Enable USB gadget with Mass Storage function Enable configs to support USB gadget and Mass Storage Signed-off-by: Neil Armstrong --- configs/libretech-s905d-pc_defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configs/libretech-s905d-pc_defconfig b/configs/libretech-s905d-pc_defconfig index 7e0c95872a6..531d519a7c1 100644 --- a/configs/libretech-s905d-pc_defconfig +++ b/configs/libretech-s905d-pc_defconfig @@ -26,6 +26,7 @@ CONFIG_CMD_SF=y CONFIG_CMD_SF_TEST=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_REGULATOR=y CONFIG_OF_CONTROL=y @@ -65,6 +66,12 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3=y +# CONFIG_USB_DWC3_GADGET is not set +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e +CONFIG_USB_GADGET_PRODUCT_NUM=0xfada +CONFIG_USB_GADGET_DWC2_OTG=y +CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_KEYBOARD=y CONFIG_DM_VIDEO=y CONFIG_SYS_WHITE_ON_BLACK=y From 699a33b9388607446452ed3457921cfd61fc094e Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Mon, 30 Mar 2020 11:27:32 +0200 Subject: [PATCH 14/14] configs: libretech-s912-pc: Enable USB gadget with Mass Storage function Enable configs to support USB gadget and Mass Storage Signed-off-by: Neil Armstrong --- configs/libretech-s912-pc_defconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configs/libretech-s912-pc_defconfig b/configs/libretech-s912-pc_defconfig index 5f4ee329e27..595ec21da77 100644 --- a/configs/libretech-s912-pc_defconfig +++ b/configs/libretech-s912-pc_defconfig @@ -26,6 +26,7 @@ CONFIG_CMD_SF=y CONFIG_CMD_SF_TEST=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y +CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_REGULATOR=y CONFIG_OF_CONTROL=y @@ -65,6 +66,12 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_USB_XHCI_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3=y +# CONFIG_USB_DWC3_GADGET is not set +CONFIG_USB_GADGET=y +CONFIG_USB_GADGET_VENDOR_NUM=0x1b8e +CONFIG_USB_GADGET_PRODUCT_NUM=0xfada +CONFIG_USB_GADGET_DWC2_OTG=y +CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_KEYBOARD=y CONFIG_DM_VIDEO=y CONFIG_SYS_WHITE_ON_BLACK=y