gio: add support for PCAL6408 chip to the pca953x driver
Subsystems (6)
PATCH 1/3 gio: add support for PCAL6408 chip to the pca953x driver
The PCAL6408 chip similar enough to the PCA95xx chip series such that it can be handled by the pca953x driver as well.
This solution is copied from the linux kernel's pca953x driver.
--- drivers/gpio/gpio-pca953x.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpio/gpio-pca953x.c +6 -0
@@ -37,6 +37,8 @@#define PCA_GPIO_MASK 0x00FF#define PCA_INT 0x0100 +#define PCA_PCAL 0x0200 +#define PCA_LATCH_INT (PCA_PCAL | PCA_INT)#define PCA953X_TYPE 0x1000#define PCA957X_TYPE 0x2000
@@ -56,6 +58,8 @@ static struct platform_device_id pca953x_id[] = { { "pca9575", 16 | PCA957X_TYPE | PCA_INT, }, { "pca9698", 40 | PCA953X_TYPE, }, + { "pcal6408", 8 | PCA953X_TYPE | PCA_LATCH_INT, }, + { "max7310", 8 | PCA953X_TYPE, }, { "max7312", 16 | PCA953X_TYPE | PCA_INT, }, { "max7313", 16 | PCA953X_TYPE | PCA_INT, },
@@ -483,6 +487,8 @@ static const struct of_device_id pca953x_dt_ids[] = { { .compatible = "nxp,pca9575", .data = OF_957X(16, PCA_INT), }, { .compatible = "nxp,pca9698", .data = OF_953X(40, 0), }, + { .compatible = "nxp,pcal6408", .data = OF_953X(8, PCA_LATCH_INT), }, + { .compatible = "maxim,max7310", .data = OF_953X( 8, 0), }, { .compatible = "maxim,max7312", .data = OF_953X(16, PCA_INT), }, { .compatible = "maxim,max7313", .data = OF_953X(16, PCA_INT), },
Signature · 1 line
2.30.2
PATCH 2/3 ARM: IMX8MP: add initial support for Variscite DT8MCustomBoard with iMX8MP
The Variscite DT8MCustomBoard is an eval board for the several Variscite SOMs of their "DART" product line. This commit adds support for that baseboard in combination with a DART-MX8M-PLUS SOM. The commit contains an adapted version of the vendors device tree [1] and the vendors DDR timings, taken from Variscite's public U-Boot sources [2].
Both files have been slightly changed to integrate well with barebox.
The boardsupport added with this commit does not yet support every feature of the DT8MCustomBoard. Yet it already supports all basic necessities to make use of barebox.
[1] https://github.com/varigit/linux-imx/tree/3f94f35bda827e8aa06beadb10c77358cfb6dad9
[2] https://github.com/varigit/uboot-imx/tree/7cad2ff68a508c71c572151a85bc786711bab969
--- arch/arm/boards/Makefile | 1 + .../variscite-dt8mcustomboard-imx8mp/Makefile | 5 + .../variscite-dt8mcustomboard-imx8mp/board.c | 91 ++ .../init/automount | 19 + .../flash-header-imx8mp-dart.imxcfg | 7 + .../lowlevel.c | 138 ++ .../lpddr4-timing.c | 1128 +++++++++++++++++ arch/arm/configs/imx_v8_defconfig | 2 + ...variscite_dt8mcustomboard_imx8mp_defconfig | 143 +++ arch/arm/dts/Makefile | 1 + .../dts/imx8mp-var-dart-dt8mcustomboard.dts | 680 ++++++++++ arch/arm/dts/imx8mp-var-dart.dtsi | 395 ++++++ arch/arm/mach-imx/Kconfig | 10 + images/Makefile.imx | 5 + 14 files changed, 2625 insertions(+) create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/Makefile create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/board.c create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/defaultenv-variscite-imx8mp-dart/init/automount create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/lowlevel.c create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/lpddr4-timing.c create mode 100644 arch/arm/configs/variscite_dt8mcustomboard_imx8mp_defconfig create mode 100644 arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts create mode 100644 arch/arm/dts/imx8mp-var-dart.dtsi
arch/arm/boards/Makefile +1 -0
@@ -200,3 +200,4 @@ obj-$(CONFIG_MACH_RK3568_EVB) += rockchip-rk3568-evb/ obj-$(CONFIG_MACH_RK3568_BPI_R2PRO) += rockchip-rk3568-bpi-r2pro/ obj-$(CONFIG_MACH_PINE64_QUARTZ64) += pine64-quartz64/ obj-$(CONFIG_MACH_RADXA_ROCK3) += radxa-rock3/ +obj-$(CONFIG_MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP) += variscite-dt8mcustomboard-imx8mp/
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + +obj-y += board.o +lwl-y += lowlevel.o lpddr4-timing.o +bbenv-y += defaultenv-variscite-imx8mp-dart
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/board.c new file +91 -0
91 lines not on this page · raw message
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/defaultenv-variscite-imx8mp-dart/init/automount new file +19 -0
@@ -0,0 +1,19 @@ +#!/bin/sh + +# automount tftp server + +mkdir -p /mnt/tftp +automount /mnt/tftp 'ifup -a1 && mount -t tftp $global.net.server /mnt/tftp' + +# automount nfs server's nfsroot + +mkdir -p /mnt/nfs +automount /mnt/nfs 'ifup -a1 && mount -t nfs ${global.net.server}:/home/${global.user}/nfsroot/${global.hostname} /mnt/nfs' + +# detect and (automatically) prepare automounts for the internal eMMC +detect mmc2 + +# FAT on usb disk example + +#mkdir -p /mnt/fat +#automount -d /mnt/fat 'usb && [ -e /dev/disk0.0 ] && mount /dev/disk0.0 /mnt/fat'
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0-only + +soc imx8mp + +loadaddr 0x918000 +max_load_size 0x3f000 +ivtofs 0x0
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/lowlevel.c new file +138 -0
138 lines not on this page · raw message
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/lpddr4-timing.c new file +1128 -0
1,128 lines not on this page · raw message
arch/arm/configs/imx_v8_defconfig +2 -0
@@ -10,6 +10,7 @@ CONFIG_MACH_NXP_IMX8MQ_EVK=y CONFIG_MACH_PHYTEC_SOM_IMX8MQ=y CONFIG_MACH_TQ_MBA8MPXL=y CONFIG_MACH_POLYHEX_DEBIX=y +CONFIG_MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP=y CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y CONFIG_MMU=y CONFIG_MALLOC_SIZE=0x0
@@ -129,6 +130,7 @@ CONFIG_EEPROM_AT24=y CONFIG_WATCHDOG=y CONFIG_WATCHDOG_IMX=y CONFIG_RAVE_SP_WATCHDOG=y +CONFIG_GPIO_PCA953X=y CONFIG_IMX_OCOTP=y CONFIG_RAVE_SP_EEPROM=y CONFIG_REGULATOR=y
arch/arm/configs/variscite_dt8mcustomboard_imx8mp_defconfig new file +143 -0
143 lines not on this page · raw message
arch/arm/dts/Makefile +1 -0
@@ -204,5 +204,6 @@ lwl-$(CONFIG_MACH_LS1046ARDB) += fsl-ls1046a-rdb.dtb.o lwl-$(CONFIG_MACH_TQMLS1046A) += fsl-tqmls1046a-mbls10xxa.dtb.o lwl-$(CONFIG_MACH_ZEDBOARD) += zynq-zed.dtb.o lwl-$(CONFIG_MACH_MNT_REFORM) += imx8mq-mnt-reform2.dtb.o +lwl-$(CONFIG_MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP) += imx8mp-var-dart-dt8mcustomboard.dtb.o clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts *.dtb.z
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +680 -0
680 lines not on this page · raw message
arch/arm/dts/imx8mp-var-dart.dtsi new file +395 -0
395 lines not on this page · raw message
arch/arm/mach-imx/Kconfig +10 -0
@@ -650,6 +650,16 @@ config MACH_POLYHEX_DEBIX select IMX8M_DRAM select I2C_IMX_EARLY +config MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP + bool "Variscite DT8MCustomBoard with DART-MX8M-PLUS" + select ARCH_IMX8MP + select FIRMWARE_IMX_LPDDR4_PMU_TRAIN + select FIRMWARE_IMX8MP_ATF + select ARM_SMCCC + select MCI_IMX_ESDHC_PBL + select IMX8M_DRAM + select I2C_IMX_EARLY + config MACH_GRINN_LITEBOARD bool "Grinn liteboard" select ARCH_IMX6UL
images/Makefile.imx +5 -0
@@ -468,6 +468,11 @@ CFG_start_polyhex_debix.pblb.imximg = $(board)/polyhex-debix/flash-header-polyhe FILE_barebox-polyhex-debix.img = start_polyhex_debix.pblb.pimximg image-$(CONFIG_MACH_POLYHEX_DEBIX) += barebox-polyhex-debix.img +pblb-$(CONFIG_MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP) += start_variscite_imx8mp_dart +CFG_start_variscite_imx8mp_dart.pblb.imximg = $(board)/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg +FILE_barebox-variscite-imx8mp-dart-cb.img = start_variscite_imx8mp_dart.pblb.pimximg +image-$(CONFIG_MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP) += barebox-variscite-imx8mp-dart-cb.img + # ----------------------- i.MX8mq based boards -------------------------- pblb-$(CONFIG_MACH_NXP_IMX8MQ_EVK) += start_nxp_imx8mq_evk CFG_start_nxp_imx8mq_evk.pblb.imximg = $(board)/nxp-imx8mq-evk/flash-header-imx8mq-evk.imxcfg
Signature · 1 line
2.30.2
Re: [PATCH 2/3] ARM: IMX8MP: add initial support for Variscite DT8MCustomBoard with iMX8MP
Hi Michael,
Thanks for the patch. Looks mostly good, some small remarks inside.
Quoted 128 lines · Michael Kopfensteiner
The Variscite DT8MCustomBoard is an eval board for the several Variscite SOMs of their "DART" product line. This commit adds support for that baseboard in combination with a DART-MX8M-PLUS SOM. The commit contains an adapted version of the vendors device tree [1] and the vendors DDR timings, taken from Variscite's public U-Boot sources [2].
Both files have been slightly changed to integrate well with barebox.
The boardsupport added with this commit does not yet support every feature of the DT8MCustomBoard. Yet it already supports all basic necessities to make use of barebox.
[1] https://github.com/varigit/linux-imx/tree/3f94f35bda827e8aa06beadb10c77358cfb6dad9
[2] https://github.com/varigit/uboot-imx/tree/7cad2ff68a508c71c572151a85bc786711bab969Signed-off-by Michael Kopfensteiner <[email protected]>--- arch/arm/boards/Makefile | 1 + .../variscite-dt8mcustomboard-imx8mp/Makefile | 5 + .../variscite-dt8mcustomboard-imx8mp/board.c | 91 ++ .../init/automount | 19 + .../flash-header-imx8mp-dart.imxcfg | 7 + .../lowlevel.c | 138 ++ .../lpddr4-timing.c | 1128 +++++++++++++++++ arch/arm/configs/imx_v8_defconfig | 2 + ...variscite_dt8mcustomboard_imx8mp_defconfig | 143 +++ arch/arm/dts/Makefile | 1 + .../dts/imx8mp-var-dart-dt8mcustomboard.dts | 680 ++++++++++ arch/arm/dts/imx8mp-var-dart.dtsi | 395 ++++++ arch/arm/mach-imx/Kconfig | 10 + images/Makefile.imx | 5 + 14 files changed, 2625 insertions(+) create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/Makefile create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/board.c create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/defaultenv-variscite-imx8mp-dart/init/automount create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/lowlevel.c create mode 100644 arch/arm/boards/variscite-dt8mcustomboard-imx8mp/lpddr4-timing.c create mode 100644 arch/arm/configs/variscite_dt8mcustomboard_imx8mp_defconfig create mode 100644 arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts create mode 100644 arch/arm/dts/imx8mp-var-dart.dtsiarch/arm/boards/Makefile +1
-0@@ -200,3 +200,4 @@ obj-$(CONFIG_MACH_RK3568_EVB) += rockchip-rk3568-evb/ obj-$(CONFIG_MACH_RK3568_BPI_R2PRO) += rockchip-rk3568-bpi-r2pro/ obj-$(CONFIG_MACH_PINE64_QUARTZ64) += pine64-quartz64/ obj-$(CONFIG_MACH_RADXA_ROCK3) += radxa-rock3/ +obj-$(CONFIG_MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP) += variscite-dt8mcustomboard-imx8mp/arch/arm/boards/variscite-dt8mcustomboard-imx8mp/Makefile new file +5
-0@@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + +obj-y += board.o +lwl-y += lowlevel.o lpddr4-timing.o +bbenv-y += defaultenv-variscite-imx8mp-dartarch/arm/boards/variscite-dt8mcustomboard-imx8mp/board.c new file +60
-0@@ -0,0 +1,91 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) 2023 Michael Kopfensteiner, VAHLE Automation GmbH +*/ + +#include <asm/memory.h> +#include <bootsource.h> +#include <common.h> +#include <deep-probe.h> +#include <init.h> +#include <linux/phy.h> +#include <linux/sizes.h> +#include <mach/bbu.h> +#include <mach/iomux-mx8mp.h> +#include <gpio.h> +#include <envfs.h> + +#define PHY_ID_ADIN1300 0x0283bc30 +#define PHY_ID_MODEL_MASK 0xfffffff0 + +/* +* This fixup is necessary to properly configure the ADIN1300 +* PHY on the SOM to properly communicate using RGMII. +* This fixup disables the PHY's internal 2ns RGMII receive clock +* delay. Without this configuration change, the system will +* be able to send Ethernet packages, but the MAC won't receive +* any response packages. +* +* This fixup is specific to the ADIN1300 PHY. This implementation +* was ported from Variscite's U-Boot sources. +*/ +static int phy_fixup_adin1300 (struct phy_device *dev) { +int ret; + +pr_debug ("BOARD: applying PHY fixup for ADIN1300\n" ); + + ret =mdiobus_write (dev->bus, dev->addr,0x0010 ,0xFF23 ); +if (ret) { +pr_warn ("ADIN1300 PHY fixup: failed to write EXT_REG_PTR\n" ); +return ret; + } + + ret =mdiobus_write (dev->bus, dev->addr,0x0011 ,0x0E01 ); +if (ret) { +pr_warn ("ADIN1300 PHY fixup: failed to write EXT_REG_DATA\n" ); +return ret; + } + +return 0 ; +} + +static int var_imx8mp_dart_cb_probe (struct device_d *dev) +{ +int emmc_bbu_flag =0 ; +int sd_bbu_flag =0 ; + +phy_register_fixup (PHY_ANY_ID ,PHY_ID_ADIN1300 ,PHY_ID_MODEL_MASK , phy_fixup_adin1300); + +if (bootsource_get () ==BOOTSOURCE_MMC ) { +if (bootsource_get_instance () ==2 ) {
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/board.c line 70
Quoted 10 lines
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/board.c new file +10
-0+of_device_enable_path ("/chosen/environment-emmc" ); + emmc_bbu_flag =BBU_HANDLER_FLAG_DEFAULT ; + }else { +of_device_enable_path ("/chosen/environment-sd" ); + sd_bbu_flag =BBU_HANDLER_FLAG_DEFAULT ; + } + }else { +of_device_enable_path ("/chosen/environment-emmc" ); + emmc_bbu_flag =BBU_HANDLER_FLAG_DEFAULT ; + }
This is equivalent to:
if (bootsource_get() == BOOTSOURCE_MMC && bootsource_get_instance() != 2) {
of_device_enable_path("/chosen/environment-sd");
sd_bbu_flag = BBU_HANDLER_FLAG_DEFAULT;
} else {
of_device_enable_path("/chosen/environment-emmc");
emmc_bbu_flag = BBU_HANDLER_FLAG_DEFAULT;
}This has a bit less duplication. Rather than excluding the non-eMMC devices I think you should include the right one, i.e. write "bootsource_get_instance() == x"
Quoted 36 lines
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/board.c new file +21
-0+ +imx8m_bbu_internal_mmc_register_handler ("SD" ,"/dev/mmc1.barebox" , sd_bbu_flag); +imx8m_bbu_internal_mmcboot_register_handler ("eMMC" ,"/dev/mmc2" , emmc_bbu_flag); + +defaultenv_append_directory (defaultenv_variscite_imx8mp_dart); + +return 0 ; +} + +static const struct of_device_id var_imx8mp_dart_cb_of_match[] = { + { .compatible ="variscite,imx8mp-var-dart" }, + {/* Sentinel */ } +}; +BAREBOX_DEEP_PROBE_ENABLE (var_imx8mp_dart_cb_of_match); + +static struct driver_d var_imx8mp_dart_cb_board_driver = { + .name ="board-var-imx8mp-dart-cb" , + .probe = var_imx8mp_dart_cb_probe, + .of_compatible = var_imx8mp_dart_cb_of_match, +}; +coredevice_platform_driver (var_imx8mp_dart_cb_board_driver);arch/arm/boards/variscite-dt8mcustomboard-imx8mp/defaultenv-variscite-imx8mp-dart/init/automount new file +9
-0@@ -0,0 +1,19 @@ +#!/bin/sh + +# automount tftp server + +mkdir -p /mnt/tftp +automount /mnt/tftp 'ifup -a1 && mount -t tftp $global.net.server /mnt/tftp' + +# automount nfs server's nfsroot +
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/defaultenv-variscite-imx8mp-dart/init/automount line 19
Quoted 10 lines
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/defaultenv-variscite-imx8mp-dart/init/automount new file +10
-0+mkdir -p /mnt/nfs +automount /mnt/nfs 'ifup -a1 && mount -t nfs ${global.net.server}:/home/${global.user}/nfsroot/${global.hostname} /mnt/nfs' + +# detect and (automatically) prepare automounts for the internal eMMC +detect mmc2 + +# FAT on usb disk example + +#mkdir -p /mnt/fat +#automount -d /mnt/fat 'usb && [ -e /dev/disk0.0 ] && mount /dev/disk0.0 /mnt/fat'
Is this file needed? What's the difference to the file provided in defaultenv/defaultenv-2-base/init/automount?
Quoted 6 lines
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg new file +1
-0+ imx8mp_setup_pad(MX8MP_PAD_I2C1_SDA__I2C1_SDA | I2C_PAD_CTRL);
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg
Quoted 10 lines
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg new file +10
-0+ + imx8mm_early_clock_init(); + imx8m_ccgr_clock_enable(IMX8M_CCM_CCGR_I2C1); + + i2c = imx8m_i2c_early_init(IOMEM(MX8MP_I2C1_BASE_ADDR)); + + pmic_configure(i2c, 0x25, pca9450_cfg, ARRAY_SIZE(pca9450_cfg)); +} + +extern struct dram_timing_info dram_timing;
Please add some board specific prefix to the name. Otherwise we'll get linker errors when more than one board is compiled in.
Quoted 12 lines
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg new file +12
-0+ +static void start_atf(void) +{ + /* + * If we are in EL3 we are running for the first time and need to + * initialize the DRAM and run TF-A (BL31). The TF-A will then jump + * to DRAM in EL2. + */ + if (current_el() != 3) + return; + + power_init_board();
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg
Quoted 10 lines
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg new file +10
-0+ + imx8mp_ddr_init(&dram_timing, DRAM_TYPE_LPDDR4); + + imx8mp_load_and_start_image_via_tfa(); +} + +static __noreturn noinline void variscite_imx8mp_dart_cb_start(void) +{ + if (IS_ENABLED(CONFIG_DEBUG_LL)) + setup_uart();
setup_uart() calls pbl_set_putc() which makes it useful for regular use, not only CONFIG_DEBUG_LL. I would just call this unconditionally.
arch/arm/configs/variscite_dt8mcustomboard_imx8mp_defconfig
Quoted 36 lines
arch/arm/boards/variscite-dt8mcustomboard-imx8mp/flash-header-imx8mp-dart.imxcfg new file +35
-0+ + start_atf(); + + /* + * Standard entry we hit once we initialized both DDR and ATF + */ + imx8mp_barebox_entry(__dtb_z_imx8mp_var_dart_dt8mcustomboard_start); +} + +/* + * Power-on execution flow of nxp_imx8mp_vardart_start() might not be + * obvious for a very first read, so here's, hopefully helpful, + * summary: + * + * 1. MaskROM uploads PBL into OCRAM and that's where this function is + * executed for the first time. At entry the exception level is EL3. + * + * 2. DDR is initialized and the image is loaded from storage into DRAM. The PBL + * part is copied from OCRAM to the TF-A return address in DRAM. + * + * 3. TF-A is executed and exits into the PBL code in DRAM. TF-A has taken us + * from EL3 to EL2. + * + * 4. Standard barebox boot flow continues + */ +ENTRY_FUNCTION(start_variscite_imx8mp_dart, r0, r1, r2) +{ + imx8mp_cpu_lowlevel_init(); + relocate_to_current_adr(); + setup_c(); + + IMD_USED_OF(imx8mp_var_dart_dt8mcustomboard); + + variscite_imx8mp_dart_cb_start(); +}arch/arm/configs/variscite_dt8mcustomboard_imx8mp_defconfig +0
-0
No board specific defconfigs please.
Quoted 10 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +4
-0@@ -0,0 +1,680 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright 2019 NXP + * Copyright 2020-2021 Variscite Ltd.
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts line 14
Quoted 10 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +10
-0+ * Copyright 2023 VAHLE Automation GmbH + */ + +#include "imx8mp-var-dart.dtsi" + +/ { + model = "Variscite DART-MX8M-PLUS on DT8MCustomBoard 2.x"; + + // use the memory controller instead + /delete-node/ memory@40000000;
Better don't add this node to the dtsi file. Is the memory size detected correctly? The dtsi file describes 6 GiB of memory which is rather unusual. Is that what your board has?
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts line 134
Quoted 3 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +3
-0+&edacmc { + status = "okay"; +};
You can drop this. It's already enabled in imx8mp.dtsi.
Quoted 8 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +8
-0+&i2c2 { + clock-frequency = <400000>; + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&pinctrl_i2c2>; + pinctrl-1 = <&pinctrl_i2c2_gpio>; + scl-gpios = <&gpio5 16 GPIO_ACTIVE_HIGH>; + sda-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>; + status = "okay";
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts line 193
Quoted 10 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +10
-0+ + typec@3d { + compatible = "nxp,ptn5150"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_extcon>; + reg = <0x3d>; + interrupt-parent = <&gpio1>; + interrupts = <10 IRQ_TYPE_LEVEL_HIGH>; + irq-is-id-quirk; + status ="okay";
status = "okay" is unnecessary for newly added nodes as it's the default.
Quoted 8 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +8
-0+ + port { + typec_dr_sw: endpoint { + remote-endpoint = <&usb3_drd_sw>; + }; + }; + }; +
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts line 211
Quoted 10 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +10
-0+ /* DS1337 RTC module */ + rtc@68 { + compatible = "dallas,ds1337"; + reg = <0x68>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rtc>; + interrupt-parent = <&gpio1>; + interrupts = <15 IRQ_TYPE_EDGE_FALLING>; + wakeup-source; + status = "okay";
dito
Quoted 7 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +7
-0+ }; + + /* Capacitive touch controller */ + ft5x06_ts: ft5x06_ts@38 { + compatible = "edt,edt-ft5206"; + reg = <0x38>; + pinctrl-names = "default";
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts line 228
Quoted 10 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +10
-0+ pinctrl-0 = <&pinctrl_captouch>; + reset-gpios = <&pca6408_2 4 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio1>; + interrupts = <14 IRQ_TYPE_EDGE_FALLING>; + touchscreen-size-x = <800>; + touchscreen-size-y = <480>; + touchscreen-inverted-x; + touchscreen-inverted-y; + wakeup-source; + status = "okay";
dito, found in other places as well.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Re: [PATCH 2/3] ARM: IMX8MP: add initial support for Variscite DT8MCustomBoard with iMX8MP
Hi Sasha,
thanks for your remarks on my patches. I agree with your comments. I will rework the patches and submit a second version soon.
I added a small reply to the memory node remark to point out, that I have no possibility to test my solution with other hardware configurations and I am unsure whether I choose the best solution.
On Tue, Feb 21, 2023 at 10:20AM +0100, Sascha Hauer wrote:
[snip]
Quoted 16 lines
Quoted 16 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +10
-0@@ -0,0 +1,680 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright 2019 NXP + * Copyright 2020-2021 Variscite Ltd. + * Copyright 2023 VAHLE Automation GmbH + */ + +#include "imx8mp-var-dart.dtsi" + +/ {
Quoted 9 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts line 14
Quoted 4 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +4
-0+ model = "Variscite DART-MX8M-PLUS on DT8MCustomBoard 2.x"; + + // use the memory controller instead + /delete-node/ memory@40000000;Better don't add this node to the dtsi file. Is the memory size detected correctly? The dtsi file describes 6 GiB of memory which is rather unusual. Is that what your board has?
I will delete the memory node.
As for the memory size:
Those modules are sold with RAM ranging from 1 to 8 GiB, my module actually has 4GiB of RAM. The dtsi used was taken from Variscites provided linux sources. Hence I thought it might be nice to rely on the memory controller to figure the actual configuration out. I ran "memtest" successfully and used "devinfo mem0" to validate, that it does see 4GiB of RAM for this node.
But I haven't checked whether some other RAM size option gets detected correctly as well, as I only have this one SOM at hand.
Quoted 6 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts line 134
Quoted 3 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +3
-0+&edacmc { + status = "okay"; +};You can drop this. It's already enabled in
imx8mp.dtsi.
[snip]
By the way, I have base those patches on the "next" branch, but I realized that I have no clue what is preferred by the project's maintainers. Shall I base those patches on "master" instead?
Michael
Re: [PATCH 2/3] ARM: IMX8MP: add initial support for Variscite DT8MCustomBoard with iMX8MP
Quoted 41 lines · Kopfensteiner_Michael
Hi Sasha,
thanks for your remarks on my patches. I agree with your comments. I will rework the patches and submit a second version soon.
I added a small reply to the memory node remark to point out, that I have no possibility to test my solution with other hardware configurations and I am unsure whether I choose the best solution.
On Tue, Feb 21, 2023 at 10:20AM +0100, Sascha Hauer wrote:
[snip]
Quoted 16 lines
Quoted 16 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +10
-0@@ -0,0 +1,680 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright 2019 NXP + * Copyright 2020-2021 Variscite Ltd. + * Copyright 2023 VAHLE Automation GmbH + */ + +#include "imx8mp-var-dart.dtsi" + +/ {Quoted 9 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts line 14
Quoted 4 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +4
-0+ model = "Variscite DART-MX8M-PLUS on DT8MCustomBoard 2.x"; + + // use the memory controller instead + /delete-node/ memory@40000000;Better don't add this node to the dtsi file. Is the memory size detected correctly? The dtsi file describes 6 GiB of memory which is rather unusual. Is that what your board has?
I will delete the memory node.
Quoted 8 lines
As for the memory size:
Those modules are sold with RAM ranging from 1 to 8 GiB, my module actually has 4GiB of RAM. The dtsi used was taken from Variscites provided linux sources. Hence I thought it might be nice to rely on the memory controller to figure the actual configuration out. I ran "memtest" successfully and used "devinfo mem0" to validate, that it does see 4GiB of RAM for this node.
But I haven't checked whether some other RAM size option gets detected correctly as well, as I only have this one SOM at hand.
I just stumbled over the 6 GiB in the dtsi file. If your 4 GiB are detected ok then everything is fine.
Quoted 5 lines
[snip]
By the way, I have base those patches on the "next" branch, but I realized that I have no clue what is preferred by the project's maintainers. Shall I base those patches on "master" instead?
It usually doesn't matter. Normally there are no conflicts and I'll handle trivial conflicts in either direction here at my side. For non trivial conflicts we'll have to look at the individual case.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Re: [PATCH 2/3] ARM: IMX8MP: add initial support for Variscite DT8MCustomBoard with iMX8MP
In reply to Michael KopfensteinerQuoted 29 lines · Michael Kopfensteiner
The Variscite DT8MCustomBoard is an eval board for the several Variscite SOMs of their "DART" product line. This commit adds support for that baseboard in combination with a DART-MX8M-PLUS SOM. The commit contains an adapted version of the vendors device tree [1] and the vendors DDR timings, taken from Variscite's public U-Boot sources [2].
Both files have been slightly changed to integrate well with barebox.
The boardsupport added with this commit does not yet support every feature of the DT8MCustomBoard. Yet it already supports all basic necessities to make use of barebox.
[1] https://github.com/varigit/linux-imx/tree/3f94f35bda827e8aa06beadb10c77358cfb6dad9
[2] https://github.com/varigit/uboot-imx/tree/7cad2ff68a508c71c572151a85bc786711bab969arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +14
-0+ +#include "imx8mp-var-dart.dtsi" + +/ { + model = "Variscite DART-MX8M-PLUS on DT8MCustomBoard 2.x"; + + // use the memory controller instead + /delete-node/ memory@40000000; + + chosen { + stdout-path = &uart1; + + environment-sd { + compatible = "barebox,environment";
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts line 30
Quoted 10 lines
arch/arm/dts/imx8mp-var-dart-dt8mcustomboard.dts new file +10
-0+ device-path = &usdhc2, "partname:0"; + status = "disabled"; + }; + + environment-emmc { + compatible = "barebox,environment"; + device-path = &usdhc2, "partname:0"; + status = "disabled"; + }; + };
usdhc2 can't be both SD and eMMC. "partname:0" is the first MBR partition. Is that what you mean here? Normally we put the environment in an unpartitioned area before the first partition.
Sascha
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH 3/3 Documentation: IMX: add doc for the Variscite DT8MCustomBoard
In reply to Michael KopfensteinerThis commit adds a page for the newly added Variscite board.
The information about downloading the NXP firmware blobs was obtained from NXP's public U-Boot sources for the i.MX processors [1].
[1] https://github.com/nxp-imx/uboot-imx
--- .../imx/variscite-dt8mcustomboard-imx8mp.rst | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 Documentation/boards/imx/variscite-dt8mcustomboard-imx8mp.rst
Documentation/boards/imx/variscite-dt8mcustomboard-imx8mp.rst new file +138 -0
@@ -0,0 +1,138 @@ +Variscite DT8MCustomBoard with DART-MX8M-PLUS SOM +================================================= + +This board is an eval-kit for the Variscite DART-MX8M-PLUS SOM. The latter is a +SOM based on the i.MX8M Plus processor. As seen in official Variscite documents there exist +several hardware revisions for this board. Currently only revision 3.0 could was tested +with Barebox. + +The Variscite DART-MX8M-PLUS SOM is available in different configurations. For a rough overview, +these are some of the possible options: + +* Processor: NXP i.MX8M Plus, either @1.6GHz or @1.8GHz +* 1 to 8 GB LPDDR4 RAM +* 8 to 128 GB eMMC +* (optional) GigE PHY on module +* (optional) Wifi + Bluetooth Chip on module + +Besides that the SOM offers a lot of interfaces. Among some of the interfaces that are +made available by the eval-board are: + +* USB3 +* GigE Ethernet +* PCIe +* SD-card slot +* HDMI + +More Information about the eval-board can be found at +https://www.variscite.com/product/single-board-computers/var-dt8mcustomboard/ + +More Information about the targeted SOM can be found at +https://www.variscite.com/product/system-on-module-som/cortex-a53-krait/dart-mx8m-plus-nxp-i-mx-8m-plus + +Providing necessary binary files +-------------------------------- + +Barebox requires some blobs to successfully bringup the system. These blobs +serve different use cases. Barebox's build system will look for these files +in the configured firmware directory (``firmware`` by default). The build +systems expects these files to have certain names. + +Hence the very first thing before building Barebox is to obtain these files and +placing them in the firmware folder. + +The DDR4 training files are part of a set of files that is provided by NXP. +They are provided under the terms of a proprietary EULA one has to agree to, +before getting access to the blobs. They are provided as self-extracting +archive. To get a hand on them, perform the following:: + + $ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.10.bin + $ chmod u+x firmware-imx-8.10.bin + $ ./firmware-imx-8.10.bin + +Assuming that the downloaded executable was run from inside the toplevel directory of the Barebox repo, +the necessary DDR4 training files can simply be hardlinked (or copied):: + + $ ln firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_dmem_202006.bin firmware/lpddr4_pmu_train_1d_dmem.bin + $ ln firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_1d_imem_202006.bin firmware/lpddr4_pmu_train_1d_imem.bin + $ ln firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_dmem_202006.bin firmware/lpddr4_pmu_train_2d_dmem.bin + $ ln firmware-imx-8.10/firmware/ddr/synopsys/lpddr4_pmu_train_2d_imem_202006.bin firmware/lpddr4_pmu_train_2d_imem.bin + +Another required binary is the Secure Monitor Firmware (BL31). This is build by some ARM Trusted Firmware project (ATF). +One fork is provided by NXP and can be downloaded from https://github.com/nxp-imx/imx-atf. Variscite does maintain it's +own fork of NXP's ATF project. This can be found at https://github.com/varigit/imx-atf/. + +Once the ATF has been built successfully, the resulting BL31 binary needs to be placed in the ``firmware`` directory +under the filename ``imx8mp-bl31.bin``. + +After those files are in place, one can proceed with the usual Barebox build routine. + +Compiling Barebox +----------------- + +A quick way to configure and compile Barebox is by using the provided defconfig +for the DT8MCustomBoard:: + + export ARCH=arm + export CROSS_COMPILE=/path/to/your/toolchain/bin/aarch64-v8a-linux-gnu- + make variscite_imx8mp_dart_cb_defconfig + make + +When the build succeeds, the Barebox image `barebox-variscite-imx8mp-dart-cb.img` +can be found in the `images` subdirectory. + +Boot Configuration +------------------ + +The DT8MCustomBoard allows the user to choose whether to proceed with the *internal* +or *external boot mode*. *Internal boot mode* refers to booting from the eMMC memory, +while *external boot mode* refers to booting from an SD-card. + +The mode is selected with switch SW7, located below the buttons on the board. + +Set the switch to **ON** for the BootROM to perform an *internal boot*. Otherwise +set the switch to **OFF** to follow the *external boot* procedure. + +If in doubt, refer to the silk screen on the board, to select the correct switch +position. + +If the BootROM cannot find a valid bootloader image in any of the checked sources, +it'll try several fallbacks until it finally ends in USB download mode or finds +a valid bootloader image to load. + +Starting Barebox +---------------- + +An easy solution to start Barebox bare metal is to use the *external boot* mode and +copy Barebox onto a SD-card. + +To copy the Barebox binary onto a SD-card, use the `dd` tool on linux:: + + dd if=images/barebox-variscite-imx8mp-dart-cb.img of=/dev/mmcblk0 bs=512 seek=1 skip=1 + +For more details and an explanation on how to start Barebox from an existing +U-Boot look here: + +Currently Supported Features +---------------------------- + +The Barebox binary configured by the `variscite_imx8mp_dart_cb_defconfig` does currently +not support all possible features of the DT8MCustomBoard. Yet the binary does contain +everything necessary to boot an operating system on the i.MX8MP. + +Some of the currently supported features: +* general i.MX8MP bringup, including DRAM initialisation +* working eMMC and SD-card support +* serial console on UART 1 - available through the micro-USB connector on the board +* working gigabit ethernet on the first port (labeled ETH, named `eth0` in Barebox and linux) +* working LED and GPIO support + +Some functionality that is currently missing or untested: +* secondary ethernet interface (labeled ETH2) will currently not work +* secure boot (not tested) +* loading of the HDMI firmware +* OP-TEE integration (not tested - early loading currently not supported by the startup code) +* running on other hardware revisions of the DT8MCustomBoard than v3.0 (not tested) + +A lot of the missing features are already solved within other i.MX8M boards, hence it might be +fairly simple to adapt those solutions to this board as well.
Signature · 1 line
2.30.2