Skip to contentSkip to conversation

imx8m: USDHC3 base address definition for i.MX8MP

PATCH Superseded Martyn Welch 1 participant 5 messages Jul 21, 2022

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 imx8m: USDHC3 base address definition for i.MX8MP

The i.MX8MP also has USDHC3, allow access to the relvant base address definition.

---
 arch/arm/include/asm/arch-imx8m/imx-regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/arch-imx8m/imx-regs.h +1 -1
index 1da75528d4..912c28e624 100644
@@ -45,7 +45,7 @@
 #define UART4_BASE_ADDR		0x30A60000
 #define USDHC1_BASE_ADDR	0x30B40000
 #define USDHC2_BASE_ADDR	0x30B50000
-#ifdef CONFIG_IMX8MM
+#if defined(CONFIG_IMX8MM) || defined(CONFIG_IMX8MP)
 #define USDHC3_BASE_ADDR	0x30B60000
 #endif
 #define UART_BASE_ADDR(n)	(			\
Signature · 1 line
2.35.1
#1 lore raw

PATCH 2/5 ARM: imx: imx8mp: Enable support for i2c5 and i2c6 on i.MX8MP

The i.MX8MP SoC contains 2 more i2c buses. Add support for the configuration of these buses.

---
 arch/arm/include/asm/arch-imx8m/imx-regs.h |  4 ++++
 arch/arm/mach-imx/i2c-mxv7.c               |  6 ++++++
 arch/arm/mach-imx/imx8m/clock_imx8mm.c     | 12 +++++++++---
 3 files changed, 19 insertions(+), 3 deletions(-)
arch/arm/include/asm/arch-imx8m/imx-regs.h +4 -0
index 912c28e624..6bdf7a7d4f 100644
@@ -43,6 +43,10 @@
 #define I2C3_BASE_ADDR		0x30A40000
 #define I2C4_BASE_ADDR		0x30A50000
 #define UART4_BASE_ADDR		0x30A60000
+#ifdef CONFIG_IMX8MP
+#define I2C5_BASE_ADDR          0x30AD0000
+#define I2C6_BASE_ADDR          0x30AE0000
+#endif
 #define USDHC1_BASE_ADDR	0x30B40000
 #define USDHC2_BASE_ADDR	0x30B50000
 #if defined(CONFIG_IMX8MM) || defined(CONFIG_IMX8MP)
arch/arm/mach-imx/i2c-mxv7.c +6 -0
index d36347d8e8..d3b4f6c9a8 100644
@@ -70,6 +70,12 @@ static void * const i2c_bases[] = {
 #ifdef I2C4_BASE_ADDR
 	(void *)I2C4_BASE_ADDR,
 #endif
+#ifdef I2C5_BASE_ADDR
+	(void *)I2C5_BASE_ADDR,
+#endif
+#ifdef I2C6_BASE_ADDR
+	(void *)I2C6_BASE_ADDR,
+#endif
 };
 
 /* i2c_index can be from 0 - 3 */
arch/arm/mach-imx/imx8m/clock_imx8mm.c +9 -3
index 4db55f8608..64ad57e9b3 100644
@@ -36,11 +36,17 @@ void enable_ocotp_clk(unsigned char enable)
 
 int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
 {
-	/* 0 - 3 is valid i2c num */
-	if (i2c_num > 3)
+	u8 i2c_ccgr[6] = {
+			CCGR_I2C1, CCGR_I2C2, CCGR_I2C3, CCGR_I2C4,
+#if (IS_ENABLED(CONFIG_IMX8MP))
+			CCGR_I2C5_8MP, CCGR_I2C6_8MP
+#endif
+	};
+
+	if (i2c_num > ARRAY_SIZE(i2c_ccgr))
 		return -EINVAL;
 
-	clock_enable(CCGR_I2C1 + i2c_num, !!enable);
+	clock_enable(i2c_ccgr[i2c_num], !!enable);
 
 	return 0;
 }
Signature · 1 line
2.35.1
#2 lore raw

PATCH 3/5 drivers: power: pmic: Add support for rn5t568 PMIC

In reply to Martyn Welch

Add support for the rn5t568 PMIC to the rn5t567 driver.

---
 drivers/power/pmic/rn5t567.c | 1 +
 1 file changed, 1 insertion(+)
drivers/power/pmic/rn5t567.c +1 -0
index d9a8298ebb..9d103dd840 100644
@@ -53,6 +53,7 @@ static struct dm_pmic_ops rn5t567_ops = {
 
 static const struct udevice_id rn5t567_ids[] = {
 	{ .compatible = "ricoh,rn5t567" },
+	{ .compatible = "ricoh,rn5t568" },
 	{ }
 };
 
Signature · 1 line
2.35.1
#3 lore raw

PATCH 4/5 drivers: power: pmic: Add legacy support for rn5t567 PMIC

In reply to Martyn Welch

The support added later in this series tweaks the PMIC voltages in the SPL, which doesn't support DM. Add legacy support to the rn5t567 PMIC driver to allow that to happen.

---
 drivers/power/pmic/Makefile       |  1 +
 drivers/power/pmic/pmic_rn5t567.c | 31 +++++++++++++++++++++++++++++++
 include/power/rn5t567_pmic.h      |  2 ++
 3 files changed, 34 insertions(+)
 create mode 100644 drivers/power/pmic/pmic_rn5t567.c
drivers/power/pmic/Makefile +1 -0
index f73b326255..37c7584126 100644
@@ -42,5 +42,6 @@ obj-$(CONFIG_POWER_TPS65218) += pmic_tps65218.o
 obj-$(CONFIG_POWER_TPS65910) += pmic_tps65910.o
 obj-$(CONFIG_POWER_HI6553) += pmic_hi6553.o
 obj-$(CONFIG_POWER_MC34VR500) += pmic_mc34vr500.o
+obj-$(CONFIG_POWER_RN5T567) += pmic_rn5t567.o
 obj-$(CONFIG_PMIC_TPS65941) += tps65941.o
 obj-$(CONFIG_PMIC_TPS65219) += tps65219.o
drivers/power/pmic/pmic_rn5t567.c new file +31 -0
new file mode 100644
index 0000000000..37156ef00c
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2019 NXP
+ */
+
+#include <common.h>
+#include <errno.h>
+#include <i2c.h>
+#include <power/pmic.h>
+#include <power/rn5t567_pmic.h>
+
+static const char rn5t567_name[] = "RN5T567";
+
+int power_rn5t567_init(unsigned char bus, unsigned char addr)
+{
+	struct pmic *p = pmic_alloc();
+
+	if (!p) {
+		printf("%s: POWER allocation error!\n", __func__);
+		return -ENOMEM;
+	}
+
+	p->name = rn5t567_name;
+	p->interface = PMIC_I2C;
+	p->number_of_regs = RN5T567_NUM_OF_REGS;
+	p->hw.i2c.addr = addr;
+	p->hw.i2c.tx_num = 1;
+	p->bus = bus;
+
+	return 0;
+}
include/power/rn5t567_pmic.h +2 -0
index 93bc7cba5a..241847ea77 100644
@@ -109,4 +109,6 @@ enum {
 	RN5T567_NUM_OF_REGS	= 0xBF,
 };
 
+int power_rn5t567_init(unsigned char bus, unsigned char addr);
+
 #endif
Signature · 1 line
2.35.1
#4 lore raw

PATCH 5/5 arm: imx8mp: Initial MSC SM2S iMX8MP support

In reply to Martyn Welch

Add support for the MSC SM2S-IMX8PLUS SMARC Module. This is currently being used in conjunction with the MSC SM2-MB-EP1 Mini-ITX Carrier Board.

---
 arch/arm/dts/Makefile                         |    1 +
 arch/arm/dts/msc-sm2s-imx8mp-u-boot.dtsi      |  168 ++
 arch/arm/dts/msc-sm2s-imx8mp.dts              |  820 ++++++++
 arch/arm/mach-imx/imx8m/Kconfig               |    8 +
 board/msc/sm2s_imx8mp/Kconfig                 |   15 +
 board/msc/sm2s_imx8mp/Makefile                |   12 +
 board/msc/sm2s_imx8mp/imximage-8mp-lpddr4.cfg |    8 +
 board/msc/sm2s_imx8mp/lpddr4_timing.c         | 1842 +++++++++++++++++
 board/msc/sm2s_imx8mp/sm2s_imx8mp.c           |   60 +
 board/msc/sm2s_imx8mp/spl.c                   |  275 +++
 configs/msc_sm2s_imx8mp_defconfig             |   94 +
 include/configs/msc_sm2s_imx8mp.h             |  113 +
 12 files changed, 3416 insertions(+)
 create mode 100644 arch/arm/dts/msc-sm2s-imx8mp-u-boot.dtsi
 create mode 100644 arch/arm/dts/msc-sm2s-imx8mp.dts
 create mode 100644 board/msc/sm2s_imx8mp/Kconfig
 create mode 100644 board/msc/sm2s_imx8mp/Makefile
 create mode 100644 board/msc/sm2s_imx8mp/imximage-8mp-lpddr4.cfg
 create mode 100644 board/msc/sm2s_imx8mp/lpddr4_timing.c
 create mode 100644 board/msc/sm2s_imx8mp/sm2s_imx8mp.c
 create mode 100644 board/msc/sm2s_imx8mp/spl.c
 create mode 100644 configs/msc_sm2s_imx8mp_defconfig
 create mode 100644 include/configs/msc_sm2s_imx8mp.h
arch/arm/dts/Makefile +1 -0
index 5caedf7bd3..37072604ca 100644
@@ -964,6 +964,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mp-venice.dtb \
 	imx8mp-venice-gw74xx.dtb \
 	imx8mp-verdin.dtb \
+	msc-sm2s-imx8mp.dtb \
 	imx8mq-pico-pi.dtb \
 	imx8mq-kontron-pitx-imx8m.dtb
 
arch/arm/dts/msc-sm2s-imx8mp-u-boot.dtsi new file +168 -0

168 lines not on this page · raw message

arch/arm/dts/msc-sm2s-imx8mp.dts new file +820 -0

820 lines not on this page · raw message

arch/arm/mach-imx/imx8m/Kconfig +8 -0
index 09b9d5603d..8120001358 100644
@@ -268,6 +268,13 @@ config TARGET_IMX8MP_RSB3720A1_6G
 	select IMX8MP
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
+
+config TARGET_MSC_SM2S_IMX8MP
+	bool "MSC SMARC2 i.MX8MPLUS"
+	select BINMAN
+	select IMX8MP
+	select SUPPORT_SPL
+	select IMX8M_LPDDR4
 endchoice
 
 source "board/advantech/imx8mp_rsb3720a1/Kconfig"
@@ -287,6 +294,7 @@ source "board/google/imx8mq_phanbell/Kconfig"
 source "board/kontron/pitx_imx8m/Kconfig"
 source "board/kontron/sl-mx8mm/Kconfig"
 source "board/menlo/mx8menlo/Kconfig"
+source "board/msc/sm2s_imx8mp/Kconfig"
 source "board/phytec/phycore_imx8mm/Kconfig"
 source "board/phytec/phycore_imx8mp/Kconfig"
 source "board/ronetix/imx8mq-cm/Kconfig"
board/msc/sm2s_imx8mp/Kconfig new file +15 -0
new file mode 100644
index 0000000000..f71a5b2bcd
@@ -0,0 +1,15 @@
+if TARGET_MSC_SM2S_IMX8MP
+
+config SYS_BOARD
+	default "sm2s_imx8mp"
+
+config SYS_VENDOR
+	default "msc"
+
+config SYS_CONFIG_NAME
+	default "msc_sm2s_imx8mp"
+
+config IMX_CONFIG
+	default "board/msc/sm2s_imx8mp/imximage-8mp-lpddr4.cfg"
+
+endif
board/msc/sm2s_imx8mp/Makefile new file +12 -0
new file mode 100644
index 0000000000..f60dd7260c
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2021 AVNET Embedded, MSC Technologies GmbH
+#
+# SPDX-License-Identifier:      GPL-2.0
+#
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o lpddr4_timing.o
+else
+obj-y += sm2s_imx8mp.o
+endif
+
board/msc/sm2s_imx8mp/imximage-8mp-lpddr4.cfg new file +8 -0
new file mode 100644
index 0000000000..8aadedb102
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021 NXP
+ */
+
+ROM_VERSION	v2
+BOOT_FROM	sd
+LOADER		u-boot-spl-ddr.bin	0x920000
board/msc/sm2s_imx8mp/lpddr4_timing.c new file +1842 -0

1,842 lines not on this page · raw message

board/msc/sm2s_imx8mp/sm2s_imx8mp.c new file +60 -0

60 lines not on this page · raw message

board/msc/sm2s_imx8mp/spl.c new file +275 -0

48 lines not on this page · raw message

configs/msc_sm2s_imx8mp_defconfig new file +94 -0

94 lines not on this page · raw message

include/configs/msc_sm2s_imx8mp.h new file +113 -0

113 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.35.1

Part of the diff is not shown here. View the raw message.