From patchwork Mon Mar 21 07:35:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Purna Chandra Mandal X-Patchwork-Id: 599982 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3qT73S07KSz9s5l for ; Mon, 21 Mar 2016 18:38:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D26DEA7498; Mon, 21 Mar 2016 08:38:04 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n2ESwef92uz3; Mon, 21 Mar 2016 08:38:04 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4443FA74E0; Mon, 21 Mar 2016 08:38:04 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C8AC1A75DE for ; Mon, 21 Mar 2016 08:37:51 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7vj4p_6tEisJ for ; Mon, 21 Mar 2016 08:37:51 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from email.microchip.com (exsmtp03.microchip.com [198.175.253.49]) by theia.denx.de (Postfix) with ESMTPS id 189E5A7686 for ; Mon, 21 Mar 2016 08:37:38 +0100 (CET) Received: from mx.microchip.com (10.10.76.4) by chn-sv-exch03.mchp-main.com (10.10.76.49) with Microsoft SMTP Server id 14.3.181.6; Mon, 21 Mar 2016 00:37:34 -0700 Received: by mx.microchip.com (sSMTP sendmail emulation); Mon, 21 Mar 2016 13:06:01 +0530 From: Purna Chandra Mandal To: Date: Mon, 21 Mar 2016 13:05:43 +0530 Message-ID: <1458545743-3938-5-git-send-email-purna.mandal@microchip.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1458545743-3938-1-git-send-email-purna.mandal@microchip.com> References: <1458545743-3938-1-git-send-email-purna.mandal@microchip.com> MIME-Version: 1.0 Cc: Marek Vasut , Purna Chandra Mandal Subject: [U-Boot] [PATCH v5 4/4] board: pic32mzda: enable USB-host, USB-storage support. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Enable MUSB host and USB storage support for Microchip PIC32MZ[DA] Starter Kit. Signed-off-by: Purna Chandra Mandal --- Changes in v5: None Changes in v4: - dts: add USB clock to musb node - add missing CONFIG_PIC32_USB in defconfig Changes in v3: - add arch specific reads{bwlq}, writes{bwlq} in respective arch io.h - remove reads{bwlq}, writes{bwlq} in musb-new driver Changes in v2: - compilation fix in drivers/usb/musb-new/linux-compat.h seperated - compilation fix in drivers/gadget/f_mass_storage.c seperated arch/mips/dts/pic32mzda.dtsi | 12 ++++++++++++ arch/mips/dts/pic32mzda_sk.dts | 4 ++++ configs/pic32mzdask_defconfig | 6 ++++++ include/configs/pic32mzdask.h | 7 +++++++ 4 files changed, 29 insertions(+) diff --git a/arch/mips/dts/pic32mzda.dtsi b/arch/mips/dts/pic32mzda.dtsi index 7d180d9..8a554f9 100644 --- a/arch/mips/dts/pic32mzda.dtsi +++ b/arch/mips/dts/pic32mzda.dtsi @@ -171,4 +171,16 @@ #address-cells = <1>; #size-cells = <0>; }; + + usb: musb@1f8e3000 { + compatible = "microchip,pic32mzda-usb"; + reg = <0x1f8e3000 0x1000>, + <0x1f884000 0x1000>; + reg-names = "mc", "control"; + interrupts = <132 IRQ_TYPE_EDGE_RISING>, + <133 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clock PB5CLK>; + clock-names = "usb_clk"; + status = "disabled"; + }; }; diff --git a/arch/mips/dts/pic32mzda_sk.dts b/arch/mips/dts/pic32mzda_sk.dts index e5ce0bd..0a7847e 100644 --- a/arch/mips/dts/pic32mzda_sk.dts +++ b/arch/mips/dts/pic32mzda_sk.dts @@ -52,4 +52,8 @@ ethernet_phy: lan8740_phy@0 { reg = <0>; }; +}; + +&usb { + status = "okay"; }; \ No newline at end of file diff --git a/configs/pic32mzdask_defconfig b/configs/pic32mzdask_defconfig index 4017983..eba6cd5 100644 --- a/configs/pic32mzdask_defconfig +++ b/configs/pic32mzdask_defconfig @@ -14,6 +14,7 @@ CONFIG_LOOPW=y CONFIG_CMD_MEMTEST=y CONFIG_CMD_MEMINFO=y # CONFIG_CMD_FLASH is not set +CONFIG_CMD_USB=y # CONFIG_CMD_FPGA is not set CONFIG_CMD_GPIO=y CONFIG_CMD_RARP=y @@ -30,5 +31,10 @@ CONFIG_PIC32_ETH=y CONFIG_PINCTRL=y # CONFIG_PINCTRL_FULL is not set CONFIG_USE_PRIVATE_LIBGCC=y +CONFIG_USB=y +CONFIG_DM_USB=y +CONFIG_USB_MUSB_HOST=y +CONFIG_USB_MUSB_PIC32=y +CONFIG_USB_STORAGE=y CONFIG_USE_TINY_PRINTF=y CONFIG_CMD_DHRYSTONE=y diff --git a/include/configs/pic32mzdask.h b/include/configs/pic32mzdask.h index 3ea1194..78faaec 100644 --- a/include/configs/pic32mzdask.h +++ b/include/configs/pic32mzdask.h @@ -105,6 +105,12 @@ #define CONFIG_GENERIC_MMC #define CONFIG_CMD_MMC +/*-------------------------------------------------- + * USB Configuration + */ +#define CONFIG_USB_MUSB_PIO_ONLY +#define CONFIG_SYS_CACHELINE_SIZE 16 + /*----------------------------------------------------------------------- * File System Configuration */ @@ -153,6 +159,7 @@ #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 0) \ + func(USB, usb, 0) \ func(DHCP, dhcp, na) #include