All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Ray <ian.ray@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 04/13] board: ge: bx50v3: Enable CONFIG_DM_SPI, CONFIG_DM_SPI_FLASH
Date: Thu, 31 Jan 2019 16:21:14 +0200	[thread overview]
Message-ID: <cb2a514caa57a9e0e03fa3025408dd5eef28b1a4.1548942080.git.ian.ray@ge.com> (raw)
In-Reply-To: <cover.1548942080.git.ian.ray@ge.com>

Use SPI flash device model, and remove SPI pin configuration code since
the pinctrl driver is used.

Signed-off-by: Ian Ray <ian.ray@ge.com>
---
 arch/arm/dts/imx6q-bx50v3.dts | 27 +++++++++++++++++++++++++++
 board/ge/bx50v3/bx50v3.c      | 25 -------------------------
 configs/ge_bx50v3_defconfig   |  2 ++
 3 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/arch/arm/dts/imx6q-bx50v3.dts b/arch/arm/dts/imx6q-bx50v3.dts
index 0fff219..deaec63 100644
--- a/arch/arm/dts/imx6q-bx50v3.dts
+++ b/arch/arm/dts/imx6q-bx50v3.dts
@@ -8,6 +8,7 @@
 /dts-v1/;
 
 #include "imx6q.dtsi"
+#include <dt-bindings/gpio/gpio.h>
 
 / {
 	model = "General Electric Bx50v3";
@@ -17,6 +18,16 @@
 &iomuxc {
 	pinctrl-names = "default";
 
+	pinctrl_ecspi1: ecspi1grp {
+		fsl,pins = <
+			MX6QDL_PAD_EIM_D17__ECSPI1_MISO	0x100b1
+			MX6QDL_PAD_EIM_D18__ECSPI1_MOSI	0x100b1
+			MX6QDL_PAD_EIM_D16__ECSPI1_SCLK	0x100b1
+			/* SPI1 CS */
+			MX6QDL_PAD_EIM_EB2__GPIO2_IO30	0x1b0b0
+		>;
+	};
+
 	pinctrl_usdhc3: usdhc3grp {
 		fsl,pins = <
 			MX6QDL_PAD_SD3_CMD__SD3_CMD	0x17059
@@ -60,3 +71,19 @@
 &usdhc4 {
 	status = "disabled";
 };
+
+/* SPI NOR */
+&ecspi1 {
+	cs-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_ecspi1>;
+	status = "okay";
+
+	flash: n25q032 at 0 {
+		compatible = "jedec,spi-nor";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		spi-max-frequency = <20000000>;
+		reg = <0>;
+	};
+};
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
index dac063d..b69b9e7 100644
--- a/board/ge/bx50v3/bx50v3.c
+++ b/board/ge/bx50v3/bx50v3.c
@@ -53,9 +53,6 @@ static struct vpd_cache vpd;
 #define ENET_RX_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
 	PAD_CTL_SPEED_HIGH   | PAD_CTL_SRE_FAST)
 
-#define SPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_SPEED_MED | \
-		      PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
-
 #define I2C_PAD_CTRL  (PAD_CTL_PUS_100K_UP |			\
 	PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | PAD_CTL_HYS |	\
 	PAD_CTL_ODE | PAD_CTL_SRE_FAST)
@@ -113,13 +110,6 @@ static void setup_iomux_enet(void)
 	mdelay(1);
 }
 
-static iomux_v3_cfg_t const ecspi1_pads[] = {
-	MX6_PAD_EIM_D16__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL),
-	MX6_PAD_EIM_D17__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL),
-	MX6_PAD_EIM_D18__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL),
-	MX6_PAD_EIM_EB2__GPIO2_IO30 | MUX_PAD_CTRL(NO_PAD_CTRL),
-};
-
 static struct i2c_pads_info i2c_pad_info1 = {
 	.scl = {
 		.i2c_mode = MX6_PAD_CSI0_DAT9__I2C1_SCL | I2C_PAD,
@@ -159,18 +149,6 @@ static struct i2c_pads_info i2c_pad_info3 = {
 	}
 };
 
-#ifdef CONFIG_MXC_SPI
-int board_spi_cs_gpio(unsigned bus, unsigned cs)
-{
-	return (bus == 0 && cs == 0) ? (IMX_GPIO_NR(2, 30)) : -1;
-}
-
-static void setup_spi(void)
-{
-	imx_iomux_v3_setup_multiple_pads(ecspi1_pads, ARRAY_SIZE(ecspi1_pads));
-}
-#endif
-
 static iomux_v3_cfg_t const pcie_pads[] = {
 	MX6_PAD_GPIO_5__GPIO1_IO05 | MUX_PAD_CTRL(NO_PAD_CTRL),
 	MX6_PAD_GPIO_17__GPIO7_IO12 | MUX_PAD_CTRL(NO_PAD_CTRL),
@@ -594,9 +572,6 @@ int board_init(void)
 	/* address of boot parameters */
 	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
-#ifdef CONFIG_MXC_SPI
-	setup_spi();
-#endif
 	return 0;
 }
 
diff --git a/configs/ge_bx50v3_defconfig b/configs/ge_bx50v3_defconfig
index 10a8b67..71bf9d6 100644
--- a/configs/ge_bx50v3_defconfig
+++ b/configs/ge_bx50v3_defconfig
@@ -60,3 +60,5 @@ CONFIG_BLK=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
 CONFIG_DM_GPIO=y
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y
-- 
2.10.1

  parent reply	other threads:[~2019-01-31 14:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 14:21 [U-Boot] [PATCH 00/13] board: ge: initial dm support Ian Ray
2019-01-31 14:21 ` [U-Boot] [PATCH 01/13] board: ge: bx50v3: Enable CONFIG_DM Ian Ray
2019-03-13  9:47   ` [U-Boot] [U-Boot,01/13] " sbabic at denx.de
2019-01-31 14:21 ` [U-Boot] [PATCH 02/13] board: ge: bx50v3: Enable CONFIG_DM_MMC Ian Ray
2019-03-13  9:47   ` [U-Boot] [U-Boot,02/13] " sbabic at denx.de
2019-01-31 14:21 ` [U-Boot] [PATCH 03/13] board: ge: bx50v3: Enable CONFIG_DM_GPIO Ian Ray
2019-03-13  9:29   ` [U-Boot] [U-Boot,03/13] " sbabic at denx.de
2019-01-31 14:21 ` Ian Ray [this message]
2019-03-13  9:28   ` [U-Boot] [U-Boot, 04/13] board: ge: bx50v3: Enable CONFIG_DM_SPI, CONFIG_DM_SPI_FLASH sbabic at denx.de
2019-01-31 14:21 ` [U-Boot] [PATCH 05/13] board: ge: ppd: Enable CONFIG_DM Ian Ray
2019-03-13  9:29   ` [U-Boot] [U-Boot,05/13] " sbabic at denx.de
2019-01-31 14:21 ` [U-Boot] [PATCH 06/13] arm: imx: Add esdhc3/4 nodes to imx53.dtsi Ian Ray
2019-03-13  9:28   ` [U-Boot] [U-Boot, " sbabic at denx.de
2019-01-31 14:21 ` [U-Boot] [PATCH 07/13] board: ge: ppd: Enable CONFIG_DM_MMC Ian Ray
2019-03-13  9:28   ` [U-Boot] [U-Boot,07/13] " sbabic at denx.de
2019-01-31 14:21 ` [U-Boot] [PATCH 08/13] board: ge: store version information in fdt Ian Ray
2019-03-13  9:38   ` [U-Boot] [U-Boot, " sbabic at denx.de
2019-01-31 14:21 ` [U-Boot] [PATCH 09/13] board: ge: bx50v3: Specific ARP timeout removed Ian Ray
2019-01-31 14:21 ` [U-Boot] [PATCH 10/13] board: ge: bx50v3: Network booting of fitImage with nfs rootfs Ian Ray
     [not found]   ` <joonas.aijala@ge.com>
2019-03-13  9:28     ` [U-Boot] [U-Boot, " sbabic at denx.de
2019-03-13  9:38     ` [U-Boot] [U-Boot, 09/13] board: ge: bx50v3: Specific ARP timeout removed sbabic at denx.de
2019-01-31 14:21 ` [U-Boot] [PATCH 11/13] mx53ppd: bring dock out of reset at boot Ian Ray
2019-03-13  9:28   ` [U-Boot] [U-Boot,11/13] " sbabic at denx.de
2019-01-31 14:21 ` [U-Boot] [PATCH 12/13] mx53ppd: fix unsupported set command Ian Ray
2019-03-13  9:30   ` [U-Boot] [U-Boot,12/13] " sbabic at denx.de
2019-01-31 14:21 ` [U-Boot] [PATCH 13/13] bootcount: i2c: Delay after writing Ian Ray
2019-03-13 10:04   ` Stefano Babic
2019-03-13 13:01     ` Heiko Schocher
2019-03-13 13:42       ` Stefano Babic
2019-03-14  7:34         ` [U-Boot] EXT: " Ray, Ian

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=cb2a514caa57a9e0e03fa3025408dd5eef28b1a4.1548942080.git.ian.ray@ge.com \
    --to=ian.ray@ge.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.