Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82080C4332F for ; Tue, 8 Nov 2022 16:41:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 83CFD84FFA; Tue, 8 Nov 2022 17:40:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667925653; bh=hWKLtvxRcejNyB+b9DQ0wElmEXSuWWUhxJke4uWbbf4=; h=From:To:Subject:In-reply-to:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From; b=I0aYQD34QK1HULA+pZQkQ7sQIAAC3dVtiLYltS7Njmd0iZWueT8dHTanGXO95a3s3 ISXsqUM4MlsH/WpJ5exsAb/7zI/Dcq2LpcAFgDkxTNMDQmwlvsc3KYsrHyg1qSH5/q U2Z3dcZqSrxBcx4uuIAg54p5m9Q5XNO17sELRspwi2f22L2GJmlSDDWHMqlBYXhOqO pW4+YgSaCcFW5His3RtINOf669bZzTVUWb5boyH7r0yvLw33K3UAHJjdPXvt2hLEvT UlWNMVZu0TzS+49MP25O2RY/kr/OPZqugmm81aBr2uP/Tommp+Z4hLDuGVQRIMScYX b8MWna4UV93Sg== Received: by phobos.denx.de (Postfix, from userid 109) id 9F589850C0; Tue, 8 Nov 2022 17:39:41 +0100 (CET) Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6A26085063 for ; Tue, 8 Nov 2022 17:38:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sbabic@denx.de Received: from frontend03.mail.m-online.net (unknown [192.168.6.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4N6DM21FRWz1s94G; Tue, 8 Nov 2022 17:38:54 +0100 (CET) Received: from localhost (dynscan3.mnet-online.de [192.168.6.84]) by mail.m-online.net (Postfix) with ESMTP id 4N6DM215Rqz1qqlR; Tue, 8 Nov 2022 17:38:54 +0100 (CET) X-Amavis-Alert: BAD HEADER SECTION, Missing required header field: "Date" Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan3.mail.m-online.net [192.168.6.84]) (amavisd-new, port 10024) with ESMTP id rI1dEao4UG-C; Tue, 8 Nov 2022 17:38:53 +0100 (CET) Received: from papero (host-88-217-136-221.customer.m-online.net [88.217.136.221]) by mail.mnet-online.de (Postfix) with ESMTP; Tue, 8 Nov 2022 17:38:53 +0100 (CET) From: sbabic@denx.de X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 1693403 X-Patchwork-Delegate: sbabic@denx.de To: Adam Ford ,u-boot@lists.denx.de Subject: [PATCH 2/3] imx: imx8mm-beacon: Enable USB booting via SDP In-reply-to: <20221022142825.55155-2-aford173@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Message-Id: <20221108163941.9F589850C0@phobos.denx.de> Date: Tue, 8 Nov 2022 17:39:34 +0100 (CET) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean > In order to boot over USB, the device tree needs to enable > a few extra nodes in SPL. Since the USB driver has the > ability to detect host/device, the dr_mode can be removed > from the device tree since it needs to act as a device when > booting and OTG is the default mode. Add USB boot support > to spl_board_boot_device and enable the corresponding config > options. > Signed-off-by: Adam Ford > Reviewed-by: Fabio Estevam > diff --git a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi b/arch/arm/dts/imx8= mm-beacon-kit-u-boot.dtsi > index c94b4ffa4c..00ac413f36 100644 > --- a/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi > +++ b/arch/arm/dts/imx8mm-beacon-kit-u-boot.dtsi > @@ -13,6 +13,10 @@ > }; > }; > =20 > +&aips4 { > + u-boot,dm-spl; > +}; > + > ®_usdhc2_vmmc { > u-boot,off-on-delay-us =3D <20000>; > }; > @@ -77,12 +81,24 @@ > u-boot,dm-spl; > }; > =20 > +®_usbotg1 { > + > +}; > + > &uart2 { > u-boot,dm-spl; > }; > =20 > +&usbmisc1 { > + u-boot,dm-spl; > +}; > + > &usbotg1 { > - dr_mode=3D"host"; > + u-boot,dm-spl; > +}; > + > +&usbphynop1 { > + u-boot,dm-spl; > }; > =20 > &usdhc2 { > diff --git a/board/beacon/imx8mm/spl.c b/board/beacon/imx8mm/spl.c > index b0e9d918da..a5f337aa17 100644 > --- a/board/beacon/imx8mm/spl.c > +++ b/board/beacon/imx8mm/spl.c > @@ -34,6 +34,8 @@ int spl_board_boot_device(enum boot_device boot_dev_spl) > case SD3_BOOT: > case MMC3_BOOT: > return BOOT_DEVICE_MMC2; > + case USB_BOOT: > + return BOOT_DEVICE_BOARD; > default: > return BOOT_DEVICE_NONE; > } > diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defcon= fig > index f6a1012d8a..90a623515e 100644 > --- a/configs/imx8mm_beacon_defconfig > +++ b/configs/imx8mm_beacon_defconfig > @@ -39,6 +39,9 @@ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=3Dy > CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=3D0x300 > CONFIG_SPL_I2C=3Dy > CONFIG_SPL_POWER=3Dy > +CONFIG_SPL_USB_HOST=3Dy > +CONFIG_SPL_USB_GADGET=3Dy > +CONFIG_SPL_USB_SDP_SUPPORT=3Dy > CONFIG_SPL_WATCHDOG=3Dy > CONFIG_HUSH_PARSER=3Dy > CONFIG_SYS_MAXARGS=3D64 > @@ -56,6 +59,7 @@ CONFIG_CMD_MMC=3Dy > CONFIG_CMD_PART=3Dy > CONFIG_CMD_SPI=3Dy > CONFIG_CMD_USB=3Dy > +CONFIG_CMD_USB_SDP=3Dy > CONFIG_CMD_USB_MASS_STORAGE=3Dy > CONFIG_CMD_DHCP=3Dy > CONFIG_CMD_MII=3Dy > @@ -103,6 +107,8 @@ CONFIG_PHY_ATHEROS=3Dy > CONFIG_PHY_GIGE=3Dy > CONFIG_FEC_MXC=3Dy > CONFIG_MII=3Dy > +CONFIG_SPL_PHY=3Dy > +CONFIG_SPL_NOP_PHY=3Dy > CONFIG_PINCTRL=3Dy > CONFIG_SPL_PINCTRL=3Dy > CONFIG_PINCTRL_IMX8M=3Dy > @@ -127,12 +133,13 @@ CONFIG_SYSRESET_PSCI=3Dy > CONFIG_SYSRESET_WATCHDOG=3Dy > CONFIG_DM_THERMAL=3Dy > CONFIG_USB=3Dy > -# CONFIG_SPL_DM_USB is not set > CONFIG_USB_EHCI_HCD=3Dy > +CONFIG_MXC_USB_OTG_HACTIVE=3Dy > CONFIG_USB_STORAGE=3Dy > CONFIG_USB_GADGET=3Dy > CONFIG_USB_GADGET_VENDOR_NUM=3D0x0525 > CONFIG_USB_GADGET_PRODUCT_NUM=3D0xa4a5 > CONFIG_CI_UDC=3Dy > +CONFIG_SDP_LOADADDR=3D0x40400000 > CONFIG_USB_GADGET_DOWNLOAD=3Dy > CONFIG_IMX_WATCHDOG=3Dy Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic --=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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: sbabic@denx.de =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D