imx: board: Add support for the K+P's kp_imx6q_tpc board
Subsystems (3)
PATCH 1/2 imx: board: Add support for the K+P's kp_imx6q_tpc board
This commit provides support for Kieback & Peter GmbH IMX6Q based TPC board.
Signed-off-by Lukasz Majewski <[email protected]>
---
arch/arm/mach-imx/mx6/Kconfig | 11 ++ board/k+p/kp_imx6q_tpc/Kconfig | 12 ++ board/k+p/kp_imx6q_tpc/MAINTAINERS | 6 + board/k+p/kp_imx6q_tpc/Makefile | 11 ++ board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c | 302 ++++++++++++++++++++++++++++++ board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c | 283 ++++++++++++++++++++++++++++ configs/kp_imx6q_tpc_defconfig | 48 +++++ include/configs/kp_imx6q_tpc.h | 133 +++++++++++++ 8 files changed, 806 insertions(+) create mode 100644 board/k+p/kp_imx6q_tpc/Kconfig create mode 100644 board/k+p/kp_imx6q_tpc/MAINTAINERS create mode 100644 board/k+p/kp_imx6q_tpc/Makefile create mode 100644 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c create mode 100644 board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c create mode 100644 configs/kp_imx6q_tpc_defconfig create mode 100644 include/configs/kp_imx6q_tpc.h
arch/arm/mach-imx/mx6/Kconfig +11 -0
@@ -388,6 +388,16 @@ config TARGET_TBS2910 config TARGET_TITANIUM bool "titanium" +config TARGET_KP_IMX6Q_TPC + bool "K+P KP_IMX6Q_TPC i.MX6 Quad" + select MX6QDL + select BOARD_LATE_INIT + select BOARD_EARLY_INIT_F + select SUPPORT_SPL + select DM + select DM_THERMAL + imply CMD_SPL + config TARGET_TQMA6 bool "TQ Systems TQMa6 board" select BOARD_LATE_INIT
@@ -494,6 +504,7 @@ source "board/tbs/tbs2910/Kconfig" source "board/tqc/tqma6/Kconfig" source "board/toradex/apalis_imx6/Kconfig" source "board/toradex/colibri_imx6/Kconfig" +source "board/k+p/kp_imx6q_tpc/Kconfig" source "board/udoo/Kconfig" source "board/udoo/neo/Kconfig" source "board/wandboard/Kconfig"
board/k+p/kp_imx6q_tpc/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +if TARGET_KP_IMX6Q_TPC + +config SYS_BOARD + default "kp_imx6q_tpc" + +config SYS_VENDOR + default "k+p" + +config SYS_CONFIG_NAME + default "kp_imx6q_tpc" + +endif
board/k+p/kp_imx6q_tpc/MAINTAINERS new file +6 -0
@@ -0,0 +1,6 @@ +KP_IMX6Q_TPC BOARD +M: Lukasz Majewski <[email protected]> +S: Maintained +F: board/k+p/kp_imx6q_tpc/ +F: include/configs/kp_imx6q_tpc.h +F: configs/kp_imx6q_tpc_defconfig
board/k+p/kp_imx6q_tpc/Makefile new file +11 -0
@@ -0,0 +1,11 @@ +# +# Copyright (C) 2018 Lukasz Majewski <[email protected]> +# +# SPDX-License-Identifier: GPL-2.0+ +# + +ifdef CONFIG_SPL_BUILD +obj-y := kp_imx6q_tpc_spl.o +else +obj-y := kp_imx6q_tpc.o +endif
board/k+p/kp_imx6q_tpc/kp_imx6q_tpc.c new file +302 -0
302 lines not on this page · raw message
board/k+p/kp_imx6q_tpc/kp_imx6q_tpc_spl.c new file +283 -0
283 lines not on this page · raw message
configs/kp_imx6q_tpc_defconfig new file +48 -0
48 lines not on this page · raw message
include/configs/kp_imx6q_tpc.h new file +133 -0
133 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH 2/2 boot: script: The boot.scr file for K+P's boards
By using this file one can avoid cluttering <board>.h file with u-boot HUSH commands necessary for booting target device.
With such approach the commands are stored only in one place and can be reused if needed.
Signed-off-by Lukasz Majewski <[email protected]>
---
board/k+p/bootscripts/tpcboot.cmd | 96 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 board/k+p/bootscripts/tpcboot.cmd
board/k+p/bootscripts/tpcboot.cmd new file +96 -0
@@ -0,0 +1,96 @@ +# +# Copyright (C) 2018 +# Lukasz Majewski, DENX Software Engineering, lukma at denx.de +# +# +# This is an example file to generate boot.scr - a boot script for U-Boot +# Generate boot.scr: +# ./tools/mkimage -c none -A arm -T script -d tpcboot.cmd boot.scr +# +# SPDX-License-Identifier: GPL-2.0+ + + +# Input envs (to be set in environment) +# Mandatory: +# kernel_file = "fitImage" +# boardname = "XXXX" // set automatically in u-boot +# boardsoc = "imx6q" // set automatically in u-boot +# +# Optional: +# bootcmd_force = "nfs" "tftp_kernel" +# If not set - eMMC/SD boot + +# Generic setup +setenv mmcroot "/dev/mmcblk${devnum}p2 rootwait rw" +setenv displayargs "" +setenv mmcargs "setenv bootargs console=${console} ${smp} root=${mmcroot} \ + ${displayargs}" +setenv boot_fitImage " + setenv fdt_conf 'conf@${boardsoc}-${boardname}.dtb'; + setenv itbcfg "\"#\${fdt_conf}\""; + print itbcfg; + bootm '${loadaddr}${itbcfg}';" + +#------------------------------------------------------------ +# +# Provide default 'bootcmd' command +#------------------------------------------------------------ +setenv bootcmd " +if test -e ${devtype} ${devnum}:${distro_bootpart} ${kernel_file}; then + echo Found kernel image: ${kernel_file}; + if load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} \ + ${kernel_file}; then + run mmcargs; + run boot_fitImage; + fi; +fi;" + +#------------------------------------------------------------ +# +# Provide 'boot_tftp_kernel' command +#------------------------------------------------------------ +setenv download_kernel "tftpboot ${loadaddr} ${kernel_file}" + +setenv boot_tftp_kernel " +if run download_kernel; then + run mmcargs; + run boot_fitImage; +fi" + +#------------------------------------------------------------ +# +# Provide 'boot_nfs' command +#------------------------------------------------------------ +setenv rootpath "/srv/tftp/KP/rootfs" +setenv nfsargs "setenv bootargs root=/dev/nfs rw \ + nfsroot=${serverip}:${rootpath},nolock,nfsvers=3" +setenv addip "setenv bootargs ${bootargs} \ + ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:\ + ${hostname}:eth0:on" + +setenv boot_nfs " +if run download_kernel; then + run nfsargs; + run addip; + setenv bootargs ${bootargs} console=${console}; + + run boot_fitImage; +fi" + +#------------------------------------------------------------ +# +# Set correct boot flow +#------------------------------------------------------------ + +setenv bcmd " +if test ! -n ${bootcmd_force}; then + run bootcmd; +fi; +if test ${bootcmd_force} = nfs; then + run boot_nfs; +else if test ${bootcmd_force} = tftp_kernel; then + run boot_tftp_kernel; + fi; +fi" + +run bcmd
Signature · 1 line
2.11.0