board: imx7d tqma7d support
Subsystems (3)
cover board: imx7d tqma7d support
This work is based on the vendor BSP and an attempt to mainline tqma7 board support. The module is used by many long life products, so it would be nice with upstream supported bootloader. So it's easier to update when secure boot and TPM 2.0 support improves. This patch focus on core bootloader features and not whistles & bells. I have successfully booted a 4.19 mainline kernel with this patch and a device tree patch series currently under review [1]. It compiles without warnings against 2019.01, there are a few checkpatch warnings left that I have not found a valid solution for.
Checkpatch does not like GPL-2.0+ and it results in a few:
WARNING: Missing or malformed SPDX-License-Identifier tag in line 1
Using grep I have found many lines in the current tree with the same SPDX line.
There are about 30 lines that I can refacture between the following two checkpatch warnings:
WARNING: Avoid unnecessary line continuations
WARNING: line over 80 characters
Not sure which warning should be preferred.
Any testing and/or review would be welcome.
[1] https://www.spinics.net/lists/devicetree/msg277129.html
Bruno Thomsen (1):
board: tq mba7 tqma7d 1gb emmc support.
arch/arm/mach-imx/Kconfig | 2 +- arch/arm/mach-imx/cpu.c | 2 +- arch/arm/mach-imx/mx7/Kconfig | 9 + arch/arm/mach-imx/mx7/soc.c | 7 + board/tqc/common/Kconfig | 4 + board/tqc/common/Makefile | 10 + board/tqc/common/tqc_bb.h | 30 ++ board/tqc/common/tqc_emmc.c | 78 ++++ board/tqc/common/tqc_emmc.h | 12 + board/tqc/tqma7/Kconfig | 79 ++++ board/tqc/tqma7/MAINTAINERS | 8 + board/tqc/tqma7/Makefile | 9 + board/tqc/tqma7/README | 38 ++ board/tqc/tqma7/tqma7.c | 328 ++++++++++++++ board/tqc/tqma7/tqma7_mba7.c | 596 ++++++++++++++++++++++++++ board/tqc/tqma7/tqma7d.cfg | 68 +++ board/tqc/tqma7/tqma7d_ddr_1gb.cfg | 58 +++ board/tqc/tqma7/tqma7d_ddr_512mb.cfg | 58 +++ configs/tqma7d_1gb_mba7_mmc_defconfig | 50 +++ include/configs/tqma7.h | 426 ++++++++++++++++++ include/configs/tqma7_mba7.h | 35 ++ 21 files changed, 1905 insertions(+), 2 deletions(-) create mode 100644 board/tqc/common/Kconfig create mode 100644 board/tqc/common/Makefile create mode 100644 board/tqc/common/tqc_bb.h create mode 100644 board/tqc/common/tqc_emmc.c create mode 100644 board/tqc/common/tqc_emmc.h create mode 100644 board/tqc/tqma7/Kconfig create mode 100644 board/tqc/tqma7/MAINTAINERS create mode 100644 board/tqc/tqma7/Makefile create mode 100644 board/tqc/tqma7/README create mode 100644 board/tqc/tqma7/tqma7.c create mode 100644 board/tqc/tqma7/tqma7_mba7.c create mode 100644 board/tqc/tqma7/tqma7d.cfg create mode 100644 board/tqc/tqma7/tqma7d_ddr_1gb.cfg create mode 100644 board/tqc/tqma7/tqma7d_ddr_512mb.cfg create mode 100644 configs/tqma7d_1gb_mba7_mmc_defconfig create mode 100644 include/configs/tqma7.h create mode 100644 include/configs/tqma7_mba7.h
Signature · 1 line
2.20.1
PATCH 1/1 board: tq mba7 tqma7d 1gb emmc support.
Add TQMa7D SoM support when mounted on MBa7 evaluation board.
--- arch/arm/mach-imx/Kconfig | 2 +- arch/arm/mach-imx/cpu.c | 2 +- arch/arm/mach-imx/mx7/Kconfig | 9 + arch/arm/mach-imx/mx7/soc.c | 7 + board/tqc/common/Kconfig | 4 + board/tqc/common/Makefile | 10 + board/tqc/common/tqc_bb.h | 30 ++ board/tqc/common/tqc_emmc.c | 78 ++++ board/tqc/common/tqc_emmc.h | 12 + board/tqc/tqma7/Kconfig | 79 ++++ board/tqc/tqma7/MAINTAINERS | 8 + board/tqc/tqma7/Makefile | 9 + board/tqc/tqma7/README | 38 ++ board/tqc/tqma7/tqma7.c | 328 ++++++++++++++ board/tqc/tqma7/tqma7_mba7.c | 596 ++++++++++++++++++++++++++ board/tqc/tqma7/tqma7d.cfg | 68 +++ board/tqc/tqma7/tqma7d_ddr_1gb.cfg | 58 +++ board/tqc/tqma7/tqma7d_ddr_512mb.cfg | 58 +++ configs/tqma7d_1gb_mba7_mmc_defconfig | 50 +++ include/configs/tqma7.h | 426 ++++++++++++++++++ include/configs/tqma7_mba7.h | 35 ++ 21 files changed, 1905 insertions(+), 2 deletions(-) create mode 100644 board/tqc/common/Kconfig create mode 100644 board/tqc/common/Makefile create mode 100644 board/tqc/common/tqc_bb.h create mode 100644 board/tqc/common/tqc_emmc.c create mode 100644 board/tqc/common/tqc_emmc.h create mode 100644 board/tqc/tqma7/Kconfig create mode 100644 board/tqc/tqma7/MAINTAINERS create mode 100644 board/tqc/tqma7/Makefile create mode 100644 board/tqc/tqma7/README create mode 100644 board/tqc/tqma7/tqma7.c create mode 100644 board/tqc/tqma7/tqma7_mba7.c create mode 100644 board/tqc/tqma7/tqma7d.cfg create mode 100644 board/tqc/tqma7/tqma7d_ddr_1gb.cfg create mode 100644 board/tqc/tqma7/tqma7d_ddr_512mb.cfg create mode 100644 configs/tqma7d_1gb_mba7_mmc_defconfig create mode 100644 include/configs/tqma7.h create mode 100644 include/configs/tqma7_mba7.h
arch/arm/mach-imx/Kconfig +1 -1
@@ -46,7 +46,7 @@ config SECURE_BOOT config CMD_BMODE bool "Support the 'bmode' command" default y - depends on ARCH_MX6 || ARCH_MX5 + depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5 help This enables the 'bmode' (bootmode) command for forcing a boot from specific media.
arch/arm/mach-imx/cpu.c +1 -1
@@ -251,7 +251,7 @@ int cpu_eth_init(bd_t *bis) {int rc = -ENODEV ; -#if defined(CONFIG_FEC_MXC ) +#if defined(CONFIG_FEC_MXC ) && defined(CONFIG_FEC_MXC_PHYADDR ) rc =fecmxc_initialize (bis);#endif
arch/arm/mach-imx/mx7/Kconfig +9 -0
@@ -60,6 +60,14 @@ config TARGET_COLIBRI_IMX7 select DM_THERMAL imply CMD_DM +config TARGET_TQMA7 + bool "tqma7" + select MX7D + select TQMA7 + select DM + select DM_THERMAL + select TQC_EMMC + endchoice config SYS_SOC
@@ -70,5 +78,6 @@ source "board/freescale/mx7dsabresd/Kconfig" source "board/technexion/pico-imx7d/Kconfig" source "board/toradex/colibri_imx7/Kconfig" source "board/warp7/Kconfig" +source "board/tqc/tqma7/Kconfig" endif
arch/arm/mach-imx/mx7/soc.c +7 -0
@@ -8,6 +8,7 @@#include <asm/arch/imx-regs.h> #include <asm/arch/clock.h> #include <asm/arch/sys_proto.h> +#include <asm/mach-imx/boot_mode.h> #include <asm/mach-imx/dma.h> #include <asm/mach-imx/hab.h> #include <asm/mach-imx/rdc-sema.h>
@@ -128,6 +129,12 @@ struct imx_sec_config_fuse_t const imx_sec_config_fuse = { };#endif +#if defined(CONFIG_CMD_BMODE ) +const struct boot_mode soc_boot_modes[] = { + {NULL ,0 }, +}; +#endif +static bool is_mx7d (void ) {struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR ;
board/tqc/common/Kconfig new file +4 -0
@@ -0,0 +1,4 @@ + +config TQC_EMMC + bool + default n
board/tqc/common/Makefile new file +10 -0
@@ -0,0 +1,10 @@ +# +# Copyright (C) 2016, Markus Niebel <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +# necessary to create built-in.o +obj- := __dummy__.o + +obj-$(CONFIG_TQC_EMMC) += tqc_emmc.o
board/tqc/common/tqc_bb.h new file +30 -0
@@ -0,0 +1,30 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2013, 2014, 2016 TQ Systems +* Author: Markus Niebel <[email protected]> +*/ + +#ifndef __TQC_BB__ +#define __TQC_BB__ + +#include <common.h> + +int tqc_bb_board_mmc_getwp (struct mmc *mmc); +int tqc_bb_board_mmc_getcd (struct mmc *mmc); +int tqc_bb_board_mmc_init (bd_t *bis); + +int tqc_bb_board_early_init_f (void ); +int tqc_bb_board_init (void ); +int tqc_bb_board_late_init (void ); +int tqc_bb_checkboard (void ); + +const char *tqc_bb_get_boardname (void ); + +/* +* Device Tree Support +*/ +#if defined(CONFIG_OF_BOARD_SETUP ) && defined(CONFIG_OF_LIBFDT ) +void tqc_bb_ft_board_setup (void *blob,bd_t *bd); +#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */ + +#endif
board/tqc/common/tqc_emmc.c new file +78 -0
78 lines not on this page · raw message
board/tqc/common/tqc_emmc.h new file +12 -0
@@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* (C) Copyright 2017 TQ Systems GmbH +* Markus Niebel <[email protected]> +*/ +#ifndef __TQC_EMMC_H__ +#define __TQC_EMMC_H__ + +int tqc_emmc_need_dsr (struct mmc *mmc); +int tqc_ft_fixup_emmc_dsr (void *blob,const char *path,u32 value); + +#endif /* __TQC_EMMC_H__ */
board/tqc/tqma7/Kconfig new file +79 -0
79 lines not on this page · raw message
board/tqc/tqma7/MAINTAINERS new file +8 -0
@@ -0,0 +1,8 @@ +TQ SYSTEMS TQMA7 BOARD +M: Markus Niebel <[email protected]> +R: Bruno Thomsen <[email protected]> +S: Maintained +F: board/tqc/tqma7/* +F: include/configs/tqma7.h +F: include/configs/tqma7_*.h +F: configs/tqma7*_defconfig
board/tqc/tqma7/Makefile new file +9 -0
@@ -0,0 +1,9 @@ +# +# Copyright (C) 2016, Markus Niebel <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-y := tqma7.o + +obj-$(CONFIG_MBA7) += tqma7_mba7.o
board/tqc/tqma7/README new file +38 -0
@@ -0,0 +1,38 @@ +U-Boot for the TQ Systems TQMa7x modules + +This file contains information for the port of +U-Boot to the TQ Systems TQMa7x modules. + +1. Boot source +-------------- + +The following boot source is supported: + +- SD/eMMC +- QSPI NOR (work in progress) + +2. Building +------------ + +To build U-Boot for the TQ Systems TQMa6 modules: + + make tqma7d_<dram>_<baseboard>_<boot>_defconfig + make + +dram is a placeholder for the DRAM size +512mb +1gb + +baseboard is a placeholder for the mainboard to compile for +mba7 + +boot is a placeholder for the boot device +mmc - means eMMC +qspi - mean QSPI NOR + +This gives the following configurations: + +tqma7d_512mb_mba7_mmc_defconfig (work in progress) +tqma7d_1gb_mba7_mmc_defconfig +tqma7d_512mb_mba7_qspi_defconfig (work in progress) +tqma7d_1gb_mba7_qspi_defconfig (work in progress)
board/tqc/tqma7/tqma7.c new file +328 -0
328 lines not on this page · raw message
board/tqc/tqma7/tqma7_mba7.c new file +596 -0
596 lines not on this page · raw message
board/tqc/tqma7/tqma7d.cfg new file +68 -0
68 lines not on this page · raw message
board/tqc/tqma7/tqma7d_ddr_1gb.cfg new file +58 -0
58 lines not on this page · raw message
board/tqc/tqma7/tqma7d_ddr_512mb.cfg new file +58 -0
58 lines not on this page · raw message
configs/tqma7d_1gb_mba7_mmc_defconfig new file +50 -0
50 lines not on this page · raw message
include/configs/tqma7.h new file +426 -0
426 lines not on this page · raw message
include/configs/tqma7_mba7.h new file +35 -0
@@ -0,0 +1,35 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2016-2018 Markus Niebel <[email protected]> +* Copyright (C) 2019 Bruno Thomsen <[email protected]> +* +* Configuration settings for the TQ Systems MBa7x carrier board +* for TQMa7x module. +*/ + +#ifndef __CONFIG_TQMA7_MBA7_H +#define __CONFIG_TQMA7_MBA7_H + +#define CONFIG_FEC_XCV_TYPE RGMII +#define CONFIG_ETHPRIME "FEC" +#define CONFIG_PHY_TI + +#define TQMA7_ENET1_PHYADDR 0x00 +#define TQMA7_ENET2_PHYADDR 0x00 + +#define CONFIG_MXC_UART_BASE UART6_IPS_BASE_ADDR +#define CONSOLE_DEV "ttymxc5" + +#define MTDIDS_DEFAULT \ + "nor0=nor0\0" + +#define MTDPARTS_DEFAULT \ + "mtdparts=nor0:" \ + "832k at 0k(U-Boot)," \ + "64k at 832k(ENV1)," \ + "64k at 896k(ENV2)," \ + "64k at 960k(DTB)," \ + "7M at 1M(Linux)," \ + "56M at 8M(RootFS)" \ + +#endif /* __CONFIG_TQMA7_MBA7_H */
Signature · 1 line
2.20.1
Fabio Estevam
reviewerPATCH 1/1 board: tq mba7 tqma7d 1gb emmc support.
Hi Bruno,
arch/arm/mach-imx/Kconfig config SECURE_BOOT · line 49
Quoted 10 lines · Bruno Thomsen
arch/arm/mach-imx/Kconfig +1
-1@@ -46,7 +46,7 @@ config SECURE_BOOT config CMD_BMODE bool "Support the 'bmode' command" default y - depends on ARCH_MX6 || ARCH_MX5 + depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5
This should be a separate patch.
arch/arm/mach-imx/cpu.c int cpu_eth_init(bd_t *bis) · line 254
Quoted 13 lines
arch/arm/mach-imx/Kconfig +0
-0help This enables the 'bmode' (bootmode) command for forcing a boot from specific media.arch/arm/mach-imx/cpu.c +1
-1@@ -251,7 +251,7 @@ int cpu_eth_init(bd_t *bis) {int rc = -ENODEV ; -#if defined(CONFIG_FEC_MXC ) +#if defined(CONFIG_FEC_MXC ) && defined(CONFIG_FEC_MXC_PHYADDR )
This one too.
Also, please consider converting this board to DM.