[PATCH] ARM: i.MX8MP: add TQ mba8mpxl board

Sascha Hauer sha at pengutronix.de
Mon Oct 24 05:32:39 PDT 2022


On Mon, Oct 24, 2022 at 02:09:52PM +0200, Holger Assmann wrote:
> This commit adds support for the TQ MBa8MPxL with TQMa8MPxL module with
> i.MX8M Plus Quad/Dual SoC. This very combination results in configuration
> symbol "MACH_TQ_MBA8MPXL". A possible variant based on i.MX8M Plus Dual
> would be supported transparently, once barebox deleted the CPU nodes
> when it detects that they were fused away. It already does so for
> i.MX8MM and i.MX8MN.
> 
> We use the respective Linux upstream device trees and their implications
> regarding hardware support.
> 
> Known to be unsupported for now is the second Ethernet interface around
> the eqos dwmac IP. This has to be resolved by porting over the fitting
> wrapper from Linux.
> 
> Signed-off-by: Leonard Göhrs <l.goehrs at pengutronix.de>
> Signed-off-by: Holger Assmann <h.assmann at pengutronix.de>
> ---
>  arch/arm/boards/Makefile                      |    1 +
>  arch/arm/boards/mba8mpxl/Makefile             |    4 +
>  arch/arm/boards/mba8mpxl/board.c              |   54 +
>  .../mba8mpxl/flash-header-tqma8mpxl.imxcfg    |    7 +
>  arch/arm/boards/mba8mpxl/lowlevel.c           |  111 +
>  arch/arm/boards/mba8mpxl/lpddr4-timing.c      | 1856 +++++++++++++++++
>  arch/arm/dts/Makefile                         |    1 +
>  arch/arm/dts/imx8mp-tqma8mpql-mba8mpxl.dts    |   59 +
>  arch/arm/mach-imx/Kconfig                     |   10 +
>  images/Makefile.imx                           |    5 +
>  10 files changed, 2108 insertions(+)
>  create mode 100644 arch/arm/boards/mba8mpxl/Makefile
>  create mode 100644 arch/arm/boards/mba8mpxl/board.c
>  create mode 100644 arch/arm/boards/mba8mpxl/flash-header-tqma8mpxl.imxcfg
>  create mode 100644 arch/arm/boards/mba8mpxl/lowlevel.c
>  create mode 100644 arch/arm/boards/mba8mpxl/lpddr4-timing.c
>  create mode 100644 arch/arm/dts/imx8mp-tqma8mpql-mba8mpxl.dts
> 
> diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
> index a0e84c24d7..9db3669a5e 100644
> --- a/arch/arm/boards/Makefile
> +++ b/arch/arm/boards/Makefile
> @@ -91,6 +91,7 @@ obj-$(CONFIG_MACH_NXP_IMX8MQ_EVK)		+= nxp-imx8mq-evk/
>  obj-$(CONFIG_MACH_NXP_IMX8MM_EVK)		+= nxp-imx8mm-evk/
>  obj-$(CONFIG_MACH_NXP_IMX8MN_EVK)		+= nxp-imx8mn-evk/
>  obj-$(CONFIG_MACH_NXP_IMX8MP_EVK)		+= nxp-imx8mp-evk/
> +obj-$(CONFIG_MACH_TQ_MBA8MPXL)			+= mba8mpxl/
>  obj-$(CONFIG_MACH_OMAP343xSDP)			+= omap343xdsp/
>  obj-$(CONFIG_MACH_OMAP3EVM)			+= omap3evm/
>  obj-$(CONFIG_MACH_PANDA)			+= panda/
> diff --git a/arch/arm/boards/mba8mpxl/Makefile b/arch/arm/boards/mba8mpxl/Makefile
> new file mode 100644
> index 0000000000..35d8640087
> --- /dev/null
> +++ b/arch/arm/boards/mba8mpxl/Makefile
> @@ -0,0 +1,4 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +
> +obj-y += board.o
> +lwl-y += lowlevel.o lpddr4-timing.o
> diff --git a/arch/arm/boards/mba8mpxl/board.c b/arch/arm/boards/mba8mpxl/board.c
> new file mode 100644
> index 0000000000..f654a64995
> --- /dev/null
> +++ b/arch/arm/boards/mba8mpxl/board.c
> @@ -0,0 +1,54 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (C) 2022 Holger Assmann <h.assmann at pengutronix.de>
> + */
> +
> +#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>
> +
> +static int tqma8mpxl_probe(struct device_d *dev)
> +{
> +	int emmc_bbu_flag = 0;
> +	int sd_bbu_flag = 0;
> +
> +	if (bootsource_get() == BOOTSOURCE_MMC) {
> +		if (bootsource_get_instance() == 2) {
> +			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;
> +	}

You can write this as:

	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;
	}

> +static __noreturn noinline void tqma8mpxl_start(void)
> +{
> +	extern char __dtb_z_imx8mp_tqma8mpql_mba8mpxl_start[];
> +
> +	setup_uart();
> +
> +	if (current_el() == 3) {
> +		extern struct dram_timing_info dram_timing_2gb_no_ecc;
> +
> +		power_init_board();
> +
> +		imx8mp_ddr_init(&dram_timing_2gb_no_ecc, DRAM_TYPE_LPDDR4);
> +	

Trailing whitespace here.

> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 99f44e7b04..5ceb97129f 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -146,6 +146,7 @@ lwl-$(CONFIG_MACH_NXP_IMX8MN_EVK) += imx8mn-evk.dtb.o imx8mn-ddr4-evk.dtb.o
>  lwl-$(CONFIG_MACH_NXP_IMX8MP_EVK) += imx8mp-evk.dtb.o
>  lwl-$(CONFIG_MACH_NXP_IMX8MQ_EVK) += imx8mq-evk.dtb.o
>  lwl-$(CONFIG_MACH_INNOCOMM_WB15) += imx8mm-innocomm-wb15-evk.dtb.o
> +lwl-$(CONFIG_MACH_TQ_MBA8MPXL) += imx8mp-tqma8mpql-mba8mpxl.dtb.o
>  lwl-$(CONFIG_MACH_TORADEX_COLIBRI_T20) += tegra20-colibri-iris.dtb.o
>  lwl-$(CONFIG_MACH_TOSHIBA_AC100) += tegra20-paz00.dtb.o
>  lwl-$(CONFIG_MACH_TQMA53) += imx53-mba53.dtb.o
> diff --git a/arch/arm/dts/imx8mp-tqma8mpql-mba8mpxl.dts b/arch/arm/dts/imx8mp-tqma8mpql-mba8mpxl.dts
> new file mode 100644
> index 0000000000..8bd9efbaef
> --- /dev/null
> +++ b/arch/arm/dts/imx8mp-tqma8mpql-mba8mpxl.dts
> @@ -0,0 +1,59 @@
> +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
> +/*
> + * Copyright 2017 NXP
> + * Copyright (C) 2017 Pengutronix, Oleksij Rempel <kernel at pengutronix.de>
> + */
> +
> +/dts-v1/;
> +
> +#include <arm64/freescale/imx8mp-tqma8mpql-mba8mpxl.dts>
> +#include "imx8mp.dtsi"
> +
> +/ {
> +	chosen {
> +		environment-sd {
> +			compatible = "barebox,environment";
> +			device-path = &usdhc2, "partname:barebox-environment";

Please add a label to the environment partition and point to that here.

> +			status = "disabled";
> +		};
> +		environment-emmc {
> +			compatible = "barebox,environment";
> +			device-path = &usdhc3, "partname:barebox-environment";

ditto.

Sascha


-- 
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 |



More information about the barebox mailing list