public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Purna Chandra Mandal <purna.mandal@microchip.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 17/18] board: add SDHCI support for PIC32MZDASK board.
Date: Thu, 17 Dec 2015 23:04:38 +0530	[thread overview]
Message-ID: <5672F22E.4050302@microchip.com> (raw)

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 at 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
  */
-- 
1.8.3.1

                 reply	other threads:[~2015-12-17 17:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5672F22E.4050302@microchip.com \
    --to=purna.mandal@microchip.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox