Skip to contentSkip to conversation

ARM: imx: pico-imx8mq: Add support for Technexion Pico-iMX8MQ

PATCH Superseded Marek Vasut 2 participants 2 messages Apr 2, 2020 – Apr 16, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: pico-imx8mq: Add support for Technexion Pico-iMX8MQ

Add initial support for Technexion Pico-iMX8MQ SoM on PicoPI carrier board. Currently working is ethernet, serial, eMMC. DT is imported from Linux 5.4.28 ("462afcd6e7ea") .

Cc Stefano Babic <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc "NXP i.MX U-Boot Team" <[email protected]>
Cc Peng Fan <[email protected]>
---
 arch/arm/dts/Makefile                         |    3 +-
 arch/arm/dts/imx8mq-pico-pi.dts               |  416 ++++
 arch/arm/mach-imx/imx8m/Kconfig               |    6 +
 board/technexion/pico-imx8mq/Kconfig          |   12 +
 board/technexion/pico-imx8mq/MAINTAINERS      |    6 +
 board/technexion/pico-imx8mq/Makefile         |   12 +
 board/technexion/pico-imx8mq/README           |   52 +
 board/technexion/pico-imx8mq/lpddr4_timing.h  |   14 +
 .../pico-imx8mq/lpddr4_timing_1gb.c           | 1734 +++++++++++++++++
 .../pico-imx8mq/lpddr4_timing_2gb.c           | 1734 +++++++++++++++++
 .../pico-imx8mq/lpddr4_timing_3gb.c           | 1734 +++++++++++++++++
 .../pico-imx8mq/lpddr4_timing_4gb.c           | 1734 +++++++++++++++++
 board/technexion/pico-imx8mq/pico-imx8mq.c    |  149 ++
 board/technexion/pico-imx8mq/spl.c            |  241 +++
 configs/pico-imx8mq_defconfig                 |   49 +
 include/configs/pico-imx8mq.h                 |  216 ++
 16 files changed, 8111 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx8mq-pico-pi.dts
 create mode 100644 board/technexion/pico-imx8mq/Kconfig
 create mode 100644 board/technexion/pico-imx8mq/MAINTAINERS
 create mode 100644 board/technexion/pico-imx8mq/Makefile
 create mode 100644 board/technexion/pico-imx8mq/README
 create mode 100644 board/technexion/pico-imx8mq/lpddr4_timing.h
 create mode 100644 board/technexion/pico-imx8mq/lpddr4_timing_1gb.c
 create mode 100644 board/technexion/pico-imx8mq/lpddr4_timing_2gb.c
 create mode 100644 board/technexion/pico-imx8mq/lpddr4_timing_3gb.c
 create mode 100644 board/technexion/pico-imx8mq/lpddr4_timing_4gb.c
 create mode 100644 board/technexion/pico-imx8mq/pico-imx8mq.c
 create mode 100644 board/technexion/pico-imx8mq/spl.c
 create mode 100644 configs/pico-imx8mq_defconfig
 create mode 100644 include/configs/pico-imx8mq.h
arch/arm/dts/Makefile +2 -1
index 9c593b2c98..e317fd321d 100644
@@ -721,8 +721,9 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mm-evk.dtb \
 	imx8mm-verdin.dtb \
 	imx8mn-ddr4-evk.dtb \
+	imx8mp-evk.dtb \
 	imx8mq-evk.dtb \
-	imx8mp-evk.dtb
+	imx8mq-pico-pi.dtb
 
 dtb-$(CONFIG_ARCH_IMXRT) += imxrt1050-evk.dtb
 
arch/arm/dts/imx8mq-pico-pi.dts new file +416 -0

416 lines not on this page · raw message

arch/arm/mach-imx/imx8m/Kconfig +6 -0
index 58f1758ab6..8f30c269f9 100644
@@ -50,6 +50,11 @@ config TARGET_IMX8MP_EVK
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
 
+config TARGET_PICO_IMX8MQ
+	bool "Support Technexion Pico iMX8MQ"
+	select IMX8MQ
+	select IMX8M_LPDDR4
+
 config TARGET_VERDIN_IMX8MM
        bool "Support Toradex Verdin iMX8M Mini module"
        select IMX8MM
@@ -62,6 +67,7 @@ source "board/freescale/imx8mq_evk/Kconfig"
 source "board/freescale/imx8mm_evk/Kconfig"
 source "board/freescale/imx8mn_evk/Kconfig"
 source "board/freescale/imx8mp_evk/Kconfig"
+source "board/technexion/pico-imx8mq/Kconfig"
 source "board/toradex/verdin-imx8mm/Kconfig"
 
 endif
board/technexion/pico-imx8mq/Kconfig new file +12 -0
new file mode 100644
index 0000000000..031fc1d563
@@ -0,0 +1,12 @@
+if TARGET_PICO_IMX8MQ
+
+config SYS_BOARD
+	default "pico-imx8mq"
+
+config SYS_VENDOR
+	default "technexion"
+
+config SYS_CONFIG_NAME
+	default "pico-imx8mq"
+
+endif
board/technexion/pico-imx8mq/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000000..92a3bae402
@@ -0,0 +1,6 @@
+i.MX8MQ EVK BOARD
+M:	Marek Vasut <[email protected]>
+S:	Maintained
+F:	board/technexion/pico-imx8mq/
+F:	include/configs/pico-imx8mq.h
+F:	configs/pico-imx8mq_defconfig
board/technexion/pico-imx8mq/Makefile new file +12 -0
new file mode 100644
index 0000000000..7cfe1e02ef
@@ -0,0 +1,12 @@
+#
+# Copyright 2017 NXP
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+obj-y += pico-imx8mq.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_timing_1gb.o lpddr4_timing_2gb.o lpddr4_timing_3gb.o lpddr4_timing_4gb.o
+endif
board/technexion/pico-imx8mq/README new file +52 -0

52 lines not on this page · raw message

board/technexion/pico-imx8mq/lpddr4_timing.h new file +14 -0
new file mode 100644
index 0000000000..89b0b927bc
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2020 Marek Vasut <[email protected]>
+ */
+
+#ifndef __LPDDR4_TIMING_H__
+#define __LPDDR4_TIMING_H__
+
+extern struct dram_timing_info dram_timing_1gb;
+extern struct dram_timing_info dram_timing_2gb;
+extern struct dram_timing_info dram_timing_3gb;
+extern struct dram_timing_info dram_timing_4gb;
+
+#endif /* __LPDDR4_TIMING_H__ */
board/technexion/pico-imx8mq/lpddr4_timing_1gb.c new file +1734 -0

1,734 lines not on this page · raw message

board/technexion/pico-imx8mq/lpddr4_timing_2gb.c new file +1734 -0

726 lines not on this page · raw message

board/technexion/pico-imx8mq/lpddr4_timing_3gb.c new file +1734 -0

1,734 lines not on this page · raw message

board/technexion/pico-imx8mq/lpddr4_timing_4gb.c new file +1734 -0

1,734 lines not on this page · raw message

board/technexion/pico-imx8mq/pico-imx8mq.c new file +149 -0

149 lines not on this page · raw message

board/technexion/pico-imx8mq/spl.c new file +241 -0

241 lines not on this page · raw message

configs/pico-imx8mq_defconfig new file +49 -0

49 lines not on this page · raw message

include/configs/pico-imx8mq.h new file +216 -0

216 lines not on this page · raw message

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

Signature · 1 line
2.25.1

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

reviewer
#1 lore raw

PATCH 1/1 ARM: imx: pico-imx8mq: Add support for Technexion Pico-iMX8MQ

Hi Marek,

arch/arm/dts/imx8mq-pico-pi.dts line 12

Quoted 13 lines · Marek Vasut
arch/arm/dts/imx8mq-pico-pi.dts new file +12 -0
@@ -0,0 +1,416 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 Wandboard, Org.
+ * Copyright 2017 NXP
+ *
+ * Author: Richard Hu <[email protected]>
+ */
+
+/dts-v1/;
+
+/* First 128KB is for PSCI ATF. */
+/memreserve/ 0x40000000 0x00020000;

Please remove this as it is not part of the official device tree.

If you really need it, then add it to the u-boot.dtsi version.

I guess this is not needed and I plan to remove it from imx8mq-evk as well.0x0},

Quoted 10 lines
board/technexion/pico-imx8mq/pico-imx8mq.c new file +10 -0
+#include <common.h>
+#include <env.h>
+#include <init.h>
+#include <malloc.h>
+#include <errno.h>
+#include <asm/io.h>
+#include <miiphy.h>
+#include <netdev.h>
+#include <asm/mach-imx/iomux-v3.h>
+#include <asm-generic/gpio.h>

board/technexion/pico-imx8mq/pico-imx8mq.c line 25

Quoted 10 lines
board/technexion/pico-imx8mq/pico-imx8mq.c new file +10 -0
+#include <fsl_esdhc_imx.h>
+#include <mmc.h>
+#include <asm/arch/imx8mq_pins.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/mach-imx/gpio.h>
+#include <asm/mach-imx/mxc_i2c.h>
+#include <asm/arch/clock.h>
+#include <spl.h>
+#include <power/pmic.h>
+#include <power/pfuze100_pmic.h>

This include file is not needed as this PMIC is not used on this board.

board/technexion/pico-imx8mq/pico-imx8mq.c line 97

Quoted 12 lines
board/technexion/pico-imx8mq/pico-imx8mq.c new file +12 -0
+static void setup_iomux_fec(void)
+{
+       imx_iomux_v3_setup_multiple_pads(fec1_pads, ARRAY_SIZE(fec1_pads));
+
+       gpio_request(IMX_GPIO_NR(1, 0), "fec1_pwr");
+       gpio_direction_output(IMX_GPIO_NR(1, 0), 1);
+       udelay(500);
+
+       gpio_request(IMX_GPIO_NR(1, 9), "fec1_rst");
+       gpio_direction_output(IMX_GPIO_NR(1, 9), 0);
+       udelay(500);
+       gpio_direction_output(IMX_GPIO_NR(1, 9), 1);

This should be done via device tree instead of board code.

board/technexion/pico-imx8mq/pico-imx8mq.c line 144

Quoted 4 lines
board/technexion/pico-imx8mq/pico-imx8mq.c new file +4 -0
+int board_late_init(void)
+{
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+       env_set("board_name", "EVK");

This board is not an EVK ;-)

board/technexion/pico-imx8mq/spl.c line 88

Quoted 3 lines
board/technexion/pico-imx8mq/spl.c new file +3 -0
+       printf("%s: LPDDR4 %i GiB\n", __func__, size);
+       ddr_init(dram_timing);
+       writel(size, M4_BOOTROM_BASE_ADDR);

Why is this needed?

board/technexion/pico-imx8mq/spl.c line 235

Quoted 2 lines
board/technexion/pico-imx8mq/spl.c new file +2 -0
+       /* Adjust pmic voltage to 1.0V for 800M */
+       setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);

The comment does not match the code.

configs/pico-imx8mq_defconfig line 3

Quoted 7 lines

index 0000000000..9193e1f406

configs/pico-imx8mq_defconfig new file +3 -0
@@ -0,0 +1,49 @@
+CONFIG_ARM=y
+CONFIG_SPL_SYS_ICACHE_OFF=y
+CONFIG_SPL_SYS_DCACHE_OFF=y

Can't we have caches enabled now? I don't recall why we disabled it for i.MX8MQ EVK, but I thought this is no longer an issue.

include/configs/pico-imx8mq.h line 7

Quoted 13 lines
include/configs/pico-imx8mq.h new file +7 -0
new file mode 100644
index 0000000000..0f1c7831e6
@@ -0,0 +1,216 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#ifndef __IMX8M_EVK_H
+#define __IMX8M_EVK_H

This should be adjusted for the pico board name instead of evk.

include/configs/pico-imx8mq.h line 55

Quoted 6 lines
include/configs/pico-imx8mq.h new file +6 -0
+#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+
+#define CONFIG_POWER
+#define CONFIG_POWER_I2C
+#define CONFIG_POWER_PFUZE100
+#define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08

This PMIC is not used on this board.

include/configs/pico-imx8mq.h line 78

Quoted 11 lines
include/configs/pico-imx8mq.h new file +11 -0
+
+/* ENET Config */
+/* ENET1 */
+#if defined(CONFIG_CMD_NET)
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_MII
+#define CONFIG_MII
+#define CONFIG_ETHPRIME                        "FEC"
+
+#define CONFIG_FEC_MXC

This could be moved to defconfig.

include/configs/pico-imx8mq.h line 84

Quoted 6 lines
include/configs/pico-imx8mq.h new file +6 -0
+#define CONFIG_FEC_XCV_TYPE            RGMII
+#define CONFIG_FEC_MXC_PHYADDR         1
+#define FEC_QUIRK_ENET_MAC
+
+#define CONFIG_PHY_GIGE
+#define IMX_FEC_BASE                   0x30BE0000

Not needed if you use DM.

include/configs/pico-imx8mq.h line 97

Quoted 13 lines
include/configs/pico-imx8mq.h new file +13 -0
+
+#define CONFIG_PHYLIB
+#define CONFIG_PHY_ATHEROS
+#endif
+
+/* Initial environment variables */
+#define CONFIG_EXTRA_ENV_SETTINGS                                      \
+       "script=boot.scr\0"                                             \
+       "image=Image\0"                                                 \
+       "console=ttymxc0,115200\0"                                      \
+       "fdt_addr=0x43000000\0"                                         \
+       "fdt_high=0xffffffffffffffff\0"                                 \
+       "boot_fdt=try\0"                                                \

Please remove "boot_fdt".

This only made sense when we wanted to supported both dt and non-dt platforms in the beginning of i.MX6 times.