From patchwork Thu Dec 17 17:34:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Purna Chandra Mandal X-Patchwork-Id: 558483 X-Patchwork-Delegate: daniel.schwierzeck@googlemail.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 04FE1140187 for ; Fri, 18 Dec 2015 04:36:36 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5736A4BD4D; Thu, 17 Dec 2015 18:36:34 +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 s_tpG2ttAOVC; Thu, 17 Dec 2015 18:36:34 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AAA1B4BCA9; Thu, 17 Dec 2015 18:36:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B48D04BCA9 for ; Thu, 17 Dec 2015 18:36:30 +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 yPFUk5pMa65M for ; Thu, 17 Dec 2015 18:36:30 +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 (exsmtp01.microchip.com [198.175.253.37]) by theia.denx.de (Postfix) with ESMTPS id 004F94BC94 for ; Thu, 17 Dec 2015 18:36:27 +0100 (CET) Received: from [10.41.20.11] (10.10.76.4) by CHN-SV-EXCH01.mchp-main.com (10.10.76.37) with Microsoft SMTP Server id 14.3.181.6; Thu, 17 Dec 2015 10:36:26 -0700 To: From: Purna Chandra Mandal Message-ID: <5672F22E.4050302@microchip.com> Date: Thu, 17 Dec 2015 23:04:38 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Cc: Pantelis Antoniou Subject: [U-Boot] [PATCH v1 17/18] board: add SDHCI support for PIC32MZDASK board. 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" Add SDHCI and file system (FAT, EXT2, EXT4) support to enable OS (Linux) boot from micro-SD card. Signed-off-by: Purna Chandra Mandal --- arch/mips/dts/pic32mzda.dtsi | 11 +++++++++++ arch/mips/dts/pic32mzda_sk.dts | 7 +++++++ configs/pic32mzdask_defconfig | 2 ++ include/configs/pic32mzdask.h | 27 +++++++++++++++++++++++++++ 4 files changed, 47 insertions(+) diff --git a/arch/mips/dts/pic32mzda.dtsi b/arch/mips/dts/pic32mzda.dtsi index cf76825..3ae54c3 100644 --- a/arch/mips/dts/pic32mzda.dtsi +++ b/arch/mips/dts/pic32mzda.dtsi @@ -148,4 +148,15 @@ phy-mode = "rmii"; status = "disabled"; }; + + sdhci: sdhci@1f8ec000 { + compatible = "microchip,pic32mzda-sdhci"; + reg = <0xbf8ec000 0x100>; + interrupts = <191 IRQ_TYPE_LEVEL_HIGH>; + bus-width = <4>; + cap-sd-highspeed; + clock-freq-min-max = <25000000>,<25000000>; + clock-irq-pins = <1>,<1>; + status = "disabled"; + }; }; diff --git a/arch/mips/dts/pic32mzda_sk.dts b/arch/mips/dts/pic32mzda_sk.dts index 38ef9c0..db1dde9 100644 --- a/arch/mips/dts/pic32mzda_sk.dts +++ b/arch/mips/dts/pic32mzda_sk.dts @@ -23,6 +23,9 @@ }; &clock { + microchip,refo2-frequency = <50000000>; + microchip,refo4-frequency = <25000000>; + microchip,refo5-frequency = <40000000>; status = "okay"; u-boot,dm-pre-reloc; }; @@ -41,3 +44,7 @@ reset-gpios = <&gpioJ 15 0>; status = "okay"; }; + +&sdhci { + status = "okay"; +}; \ No newline at end of file diff --git a/configs/pic32mzdask_defconfig b/configs/pic32mzdask_defconfig index d74d169..3079387 100644 --- a/configs/pic32mzdask_defconfig +++ b/configs/pic32mzdask_defconfig @@ -29,3 +29,5 @@ CONFIG_DM_ETH=y CONFIG_PHYLIB=y CONFIG_NETDEVICES=y CONFIG_PIC32_ETH=y +CONFIG_DM_MMC=y +CONFIG_PIC32_SDHCI=y diff --git a/include/configs/pic32mzdask.h b/include/configs/pic32mzdask.h index 8e5c31b..94e73e3 100644 --- a/include/configs/pic32mzdask.h +++ b/include/configs/pic32mzdask.h @@ -127,6 +127,33 @@ */ #define CONFIG_OF_LIBFDT 1 +/*----------------------------------------------------------------------- + * SDHC Configuration + */ +#define CONFIG_SDHCI +#define CONFIG_MMC +#define CONFIG_GENERIC_MMC +#define CONFIG_CMD_MMC + +/*----------------------------------------------------------------------- + * File System Configuration + */ +/* FAT FS */ +#define CONFIG_DOS_PARTITION +#define CONFIG_PARTITION_UUIDS +#define CONFIG_SUPPORT_VFAT +#define CONFIG_FS_FAT +#define CONFIG_FAT_WRITE +#define CONFIG_CMD_FS_GENERIC +#define CONFIG_CMD_PART +#define CONFIG_CMD_FAT + +/* EXT4 FS */ +#define CONFIG_FS_EXT4 +#define CONFIG_CMD_EXT2 +#define CONFIG_CMD_EXT4 +#define CONFIG_CMD_EXT4_WRITE + /* ------------------------------------------------- * Environment */