[U-Boot] [PATCH v1 17/18] board: add SDHCI support for PIC32MZDASK board.

Add SDHCI and file system (FAT, EXT2, EXT4) support to enable OS (Linux) boot from micro-SD card.
Signed-off-by: Purna Chandra Mandal purna.mandal@microchip.com ---
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 */
participants (1)
-
Purna Chandra Mandal