All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 06/11] arm: vf610: Add iomux support for DSPI
Date: Mon, 18 May 2015 18:36:24 +0530	[thread overview]
Message-ID: <1431954389-6433-7-git-send-email-bhuvanchandra.dv@toradex.com> (raw)
In-Reply-To: <1431954389-6433-1-git-send-email-bhuvanchandra.dv@toradex.com>

Add iomux definitions for DSPI second instance.

Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com>
---
 arch/arm/include/asm/arch-vf610/iomux-vf610.h |  9 +++++++++
 board/toradex/colibri_vf/colibri_vf.c         | 21 +++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/arch/arm/include/asm/arch-vf610/iomux-vf610.h b/arch/arm/include/asm/arch-vf610/iomux-vf610.h
index e22e3f9..b8b22b1 100644
--- a/arch/arm/include/asm/arch-vf610/iomux-vf610.h
+++ b/arch/arm/include/asm/arch-vf610/iomux-vf610.h
@@ -35,6 +35,11 @@
 #define VF610_GPIO_PAD_CTRL	(PAD_CTL_SPEED_MED | PAD_CTL_DSE_50ohm | \
 				PAD_CTL_PUS_47K_UP | PAD_CTL_IBE_ENABLE)
 
+#define VF610_DSPI_PAD_CTRL	(PAD_CTL_OBE_ENABLE | PAD_CTL_DSE_20ohm | \
+				PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_HIGH)
+#define VF610_DSPI_SIN_PAD_CTRL	(PAD_CTL_IBE_ENABLE | PAD_CTL_DSE_20ohm | \
+				PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_HIGH)
+
 enum {
 	VF610_PAD_PTA6__RMII0_CLKIN		= IOMUX_PAD(0x0000, 0x0000, 2, __NA_, 0, VF610_ENET_PAD_CTRL),
 	VF610_PAD_PTA6__RMII0_CLKOUT		= IOMUX_PAD(0x0000, 0x0000, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
@@ -91,6 +96,10 @@ enum {
 	VF610_PAD_PTC15__RMII1_TD1		= IOMUX_PAD(0x00f0, 0x00f0, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
 	VF610_PAD_PTC16__RMII1_TD0		= IOMUX_PAD(0x00f4, 0x00f4, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
 	VF610_PAD_PTC17__RMII1_TXEN		= IOMUX_PAD(0x00f8, 0x00f8, 1, __NA_, 0, VF610_ENET_PAD_CTRL),
+	VF610_PAD_PTD5__DSPI1_CS0		= IOMUX_PAD(0x0150, 0x0150, 3, 0x300, 1, VF610_DSPI_PAD_CTRL),
+	VF610_PAD_PTD6__DSPI1_SIN		= IOMUX_PAD(0x0154, 0x0154, 3, 0x2fc, 1, VF610_DSPI_SIN_PAD_CTRL),
+	VF610_PAD_PTD7__DSPI1_SOUT		= IOMUX_PAD(0x0158, 0x0158, 3, __NA_, 0, VF610_DSPI_PAD_CTRL),
+	VF610_PAD_PTD8__DSPI1_SCK		= IOMUX_PAD(0x015c, 0x015c, 3, 0x2f8, 1, VF610_DSPI_PAD_CTRL),
 	VF610_PAD_PTC29__GPIO_102		= IOMUX_PAD(0x0198, 0x0198, 0, __NA_, 0, VF610_GPIO_PAD_CTRL),
 	VF610_PAD_PTC30__GPIO_103		= IOMUX_PAD(0x019c, 0x019c, 0, __NA_, 0, VF610_GPIO_PAD_CTRL),
 	VF610_PAD_PTA24__ESDHC1_CLK		= IOMUX_PAD(0x0038, 0x0038, 5, __NA_, 0, VF610_SDHC_PAD_CTRL),
diff --git a/board/toradex/colibri_vf/colibri_vf.c b/board/toradex/colibri_vf/colibri_vf.c
index e354c6d..7173022 100644
--- a/board/toradex/colibri_vf/colibri_vf.c
+++ b/board/toradex/colibri_vf/colibri_vf.c
@@ -146,6 +146,20 @@ static void setup_iomux_nfc(void)
 }
 #endif
 
+#ifdef CONFIG_FSL_DSPI
+static void setup_iomux_dspi(void)
+{
+	static const iomux_v3_cfg_t dspi1_pads[] = {
+		VF610_PAD_PTD5__DSPI1_CS0,
+		VF610_PAD_PTD6__DSPI1_SIN,
+		VF610_PAD_PTD7__DSPI1_SOUT,
+		VF610_PAD_PTD8__DSPI1_SCK,
+	};
+
+	imx_iomux_v3_setup_multiple_pads(dspi1_pads, ARRAY_SIZE(dspi1_pads));
+}
+#endif
+
 #ifdef CONFIG_VYBRID_GPIO
 static void setup_iomux_gpio(void)
 {
@@ -252,6 +266,9 @@ static void clock_init(void)
 
 	clrsetbits_le32(&ccm->ccgr0, CCM_REG_CTRL_MASK,
 			CCM_CCGR0_UART0_CTRL_MASK);
+#ifdef CONFIG_FSL_DSPI
+	setbits_le32(&ccm->ccgr0, CCM_CCGR0_DSPI1_CTRL_MASK);
+#endif
 	clrsetbits_le32(&ccm->ccgr1, CCM_REG_CTRL_MASK,
 			CCM_CCGR1_PIT_CTRL_MASK | CCM_CCGR1_WDOGA5_CTRL_MASK);
 	clrsetbits_le32(&ccm->ccgr2, CCM_REG_CTRL_MASK,
@@ -364,6 +381,10 @@ int board_early_init_f(void)
 	setup_iomux_gpio();
 #endif
 
+#ifdef CONFIG_FSL_DSPI
+	setup_iomux_dspi();
+#endif
+
 	return 0;
 }
 
-- 
2.1.0

  parent reply	other threads:[~2015-05-18 13:06 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 13:06 [U-Boot] [PATCH 00/11] Add GPIO driver for Freescale Vybrid platform Bhuvanchandra DV
2015-05-18 13:06 ` [U-Boot] [PATCH 01/11] dm: gpio: uclass: Add flag to control sequence numbering Bhuvanchandra DV
2015-05-18 13:06 ` [U-Boot] [PATCH 02/11] dm: gpio: vf610: Add GPIO driver support Bhuvanchandra DV
2015-05-18 13:06 ` [U-Boot] [PATCH 03/11] colibri_vf: Add pinmux entries for GPIOs Bhuvanchandra DV
2015-05-18 13:06 ` [U-Boot] [PATCH 04/11] colibri_vf: Enable GPIO support Bhuvanchandra DV
2015-05-18 13:06 ` [U-Boot] [PATCH 05/11] arm: vf610: Add clock support for DSPI Bhuvanchandra DV
2015-05-18 13:06 ` Bhuvanchandra DV [this message]
2015-05-18 13:06 ` [U-Boot] [PATCH 07/11] vf610: dts: Add device tree support Bhuvanchandra DV
2015-05-18 13:06 ` [U-Boot] [PATCH 08/11] colibri-vf: Enable SPI support Bhuvanchandra DV
2015-05-18 13:06 ` [U-Boot] [PATCH 09/11] colibri_vf: Add separate defconfig for device tree support Bhuvanchandra DV
2015-06-01  7:45   ` Stefano Babic
2015-06-01  8:07     ` Bhuvanchandra DV
2015-05-18 13:06 ` [U-Boot] [PATCH 10/11] usb: ehci-vf: Add weak function for board specific initialisation Bhuvanchandra DV
2015-05-18 17:09   ` Marek Vasut
2015-05-18 18:52     ` maitysanchayan at gmail.com
2015-05-18 19:04       ` Marek Vasut
2015-05-18 13:06 ` [U-Boot] [PATCH 11/11] colibri_vf: Enable board specific USB initialisation for USB pen gpio Bhuvanchandra DV
2015-05-24 19:34 ` [U-Boot] [PATCH 00/11] Add GPIO driver for Freescale Vybrid platform Bhuvanchandra DV
2015-05-26 11:27   ` Stefano Babic
2015-06-01  5:34     ` Bhuvanchandra DV
2015-06-01  7:17       ` Stefano Babic
2015-06-01  8:51 ` [U-Boot] [PATCH V2 " Bhuvanchandra DV
2015-06-01  8:51   ` [U-Boot] [PATCH V2 01/11] dm: gpio: uclass: Add flag to control sequence numbering Bhuvanchandra DV
2015-06-01  8:51   ` [U-Boot] [PATCH V2 02/11] dm: gpio: vf610: Add GPIO driver support Bhuvanchandra DV
2015-06-01  8:51   ` [U-Boot] [PATCH V2 03/11] colibri_vf: Add pinmux entries for GPIOs Bhuvanchandra DV
2015-06-01 10:26     ` Stefan Agner
2015-06-01  8:51   ` [U-Boot] [PATCH V2 04/11] colibri_vf: Enable GPIO support Bhuvanchandra DV
2015-06-01  8:51   ` [U-Boot] [PATCH V2 05/11] arm: vf610: Add clock support for DSPI Bhuvanchandra DV
2015-06-01  8:51   ` [U-Boot] [PATCH V2 06/11] arm: vf610: Add iomux " Bhuvanchandra DV
2015-06-01  8:51   ` [U-Boot] [PATCH V2 07/11] vf610: dts: Add device tree support Bhuvanchandra DV
2015-06-01  8:51   ` [U-Boot] [PATCH V2 08/11] colibri-vf: Enable SPI support Bhuvanchandra DV
2015-06-01 10:32     ` Stefan Agner
2015-06-01 12:27       ` Bhuvanchandra DV
2015-06-01  8:51   ` [U-Boot] [PATCH V2 09/11] colibri_vf: Add separate defconfig for device tree support Bhuvanchandra DV
2015-06-01 10:35     ` Stefan Agner
2015-06-01 12:28       ` Bhuvanchandra DV
2015-06-01  8:51   ` [U-Boot] [PATCH V2 10/11] usb: ehci-vf: Add weak function for board specific initialisation Bhuvanchandra DV
2015-06-01  8:51   ` [U-Boot] [PATCH V2 11/11] colibri_vf: Enable board specific USB initialisation for USB pen gpio Bhuvanchandra DV
2015-06-01 10:25     ` Stefan Agner

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=1431954389-6433-7-git-send-email-bhuvanchandra.dv@toradex.com \
    --to=bhuvanchandra.dv@toradex.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.