public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 2/3] mx23evk: Convert to driver model
Date: Thu, 18 Feb 2021 20:32:29 -0300	[thread overview]
Message-ID: <20210218233230.506201-2-festevam@gmail.com> (raw)
In-Reply-To: <20210218233230.506201-1-festevam@gmail.com>

Make the conversion to driver model as it is mandatory.

Successfully tested booting Linux from the SD card.

Dropped splash screen support as this needs to be properly
converted to DM and tested.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v1:
- Fix subject mx28->mx23

 arch/arm/dts/Makefile              |  3 +++
 arch/arm/dts/imx23-evk-u-boot.dtsi |  4 ++++
 arch/arm/dts/imx23-u-boot.dtsi     | 14 ++++++++++++++
 arch/arm/dts/imx23.dtsi            |  2 +-
 board/freescale/mx23evk/mx23evk.c  | 23 -----------------------
 configs/mx23evk_defconfig          | 14 +++++++++++---
 6 files changed, 33 insertions(+), 27 deletions(-)
 create mode 100644 arch/arm/dts/imx23-evk-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx23-u-boot.dtsi

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index fefac899fb90..7d742b482098 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -650,6 +650,9 @@ dtb-$(CONFIG_VF610) += vf500-colibri.dtb \
 	vf610-pcm052.dtb \
 	vf610-bk4r1.dtb
 
+dtb-$(CONFIG_MX23) += \
+	imx23-evk.dtb
+
 dtb-$(CONFIG_MX28) += \
 	imx28-evk.dtb \
 	imx28-xea.dtb
diff --git a/arch/arm/dts/imx23-evk-u-boot.dtsi b/arch/arm/dts/imx23-evk-u-boot.dtsi
new file mode 100644
index 000000000000..165e220e314f
--- /dev/null
+++ b/arch/arm/dts/imx23-evk-u-boot.dtsi
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include "imx23-u-boot.dtsi"
+
diff --git a/arch/arm/dts/imx23-u-boot.dtsi b/arch/arm/dts/imx23-u-boot.dtsi
new file mode 100644
index 000000000000..5e87aca61b79
--- /dev/null
+++ b/arch/arm/dts/imx23-u-boot.dtsi
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+&gpio0 {
+	gpio-ranges = <&pinctrl 0 0 32>;
+};
+
+&gpio1 {
+	gpio-ranges = <&pinctrl 0 32 31>;
+};
+
+&gpio2 {
+	gpio-ranges = <&pinctrl 0 63 32>;
+};
+
diff --git a/arch/arm/dts/imx23.dtsi b/arch/arm/dts/imx23.dtsi
index 7f4c602454a5..4cfec7784925 100644
--- a/arch/arm/dts/imx23.dtsi
+++ b/arch/arm/dts/imx23.dtsi
@@ -105,7 +105,7 @@
 				status = "disabled";
 			};
 
-			pinctrl at 80018000 {
+			pinctrl: pinctrl at 80018000 {
 				#address-cells = <1>;
 				#size-cells = <0>;
 				compatible = "fsl,imx23-pinctrl", "simple-bus";
diff --git a/board/freescale/mx23evk/mx23evk.c b/board/freescale/mx23evk/mx23evk.c
index 3fbac6b5cc31..fc0f9acd38e8 100644
--- a/board/freescale/mx23evk/mx23evk.c
+++ b/board/freescale/mx23evk/mx23evk.c
@@ -53,26 +53,3 @@ int board_init(void)
 
 	return 0;
 }
-
-#ifdef	CONFIG_CMD_MMC
-static int mx23evk_mmc_wp(int id)
-{
-	if (id != 0) {
-		printf("MXS MMC: Invalid card selected (card id = %d)\n", id);
-		return 1;
-	}
-
-	return gpio_get_value(MX23_PAD_PWM4__GPIO_1_30);
-}
-
-int board_mmc_init(struct bd_info *bis)
-{
-	/* Configure WP as input */
-	gpio_direction_input(MX23_PAD_PWM4__GPIO_1_30);
-
-	/* Configure MMC0 Power Enable */
-	gpio_direction_output(MX23_PAD_PWM3__GPIO_1_29, 0);
-
-	return mxsmmc_initialize(bis, 0, mx23evk_mmc_wp, NULL);
-}
-#endif
diff --git a/configs/mx23evk_defconfig b/configs/mx23evk_defconfig
index 0e3d9774c591..99881f358c16 100644
--- a/configs/mx23evk_defconfig
+++ b/configs/mx23evk_defconfig
@@ -7,16 +7,19 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x4000
 CONFIG_ENV_OFFSET=0x40000
+CONFIG_DM_GPIO=y
 CONFIG_SPL_TEXT_BASE=0x00001000
 CONFIG_TARGET_MX23EVK=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
+CONFIG_DEFAULT_DEVICE_TREE="imx23-evk"
 CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_ARCH_MISC_INIT=y
 # CONFIG_SPL_FRAMEWORK is not set
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -24,17 +27,22 @@ CONFIG_CMD_USB=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT2=y
 CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_NET is not set
+CONFIG_DM=y
 CONFIG_MXS_GPIO=y
+CONFIG_DM_MMC=y
 CONFIG_MMC_MXS=y
+CONFIG_PINCTRL=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_CONS_INDEX=0
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
-CONFIG_SPLASH_SCREEN=y
-CONFIG_VIDEO_BMP_GZIP=y
-CONFIG_OF_LIBFDT=y
-- 
2.25.1

  reply	other threads:[~2021-02-18 23:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-18 23:32 [PATCH v2 1/3] mx23-evk: Import devicetree file from Linux Fabio Estevam
2021-02-18 23:32 ` Fabio Estevam [this message]
2021-03-01 11:56   ` [PATCH v2 2/3] mx23evk: Convert to driver model sbabic at denx.de
2021-02-18 23:32 ` [PATCH v2 3/3] mx23evk: Add myself as maintainer Fabio Estevam
2021-03-01 11:55   ` sbabic at denx.de
2021-03-01 11:55 ` [PATCH v2 1/3] mx23-evk: Import devicetree file from Linux sbabic at denx.de

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=20210218233230.506201-2-festevam@gmail.com \
    --to=festevam@gmail.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