imx: board: Add support for the K+P's kp_imx6q_tpc board
Subsystems (3)
PATCH v2 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.
U-boot console output:
U-Boot SPL 2018.05-rc1-00005-g631e2d01fd (Apr 04 2018 - 21:16:24 +0200) Trying to boot from MMC1
U-Boot 2018.05-rc1-00005-g631e2d01fd (Apr 04 2018 - 21:16:24 +0200)
CPU: Freescale i.MX6Q rev1.5 996 MHz (running at 792 MHz)
CPU: Extended Commercial temperature grade (-20C to 105C) at 37C
Reset cause: POR
Board: K+P KP_IMX6Q_TPC i.MX6Q
Watchdog enabled
I2C: ready
DRAM: 2 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
In: serial
Out: serial
Err: serial
Net: FEC [PRIME]Autoboot in 3 seconds
---
Changes in v2:
- Provide usbupd command to check for USB updates
- Drop DCD table DDR3 setup in favor of u-boot mainline
- Enable DDR3 calibration for iMX6Q
- Add boot log for a reference
Dependency:
- This board requires following patch for proper operation:
[U-Boot] [PATCH] ARM: mx6: ddr: Add write leveling correction code
--- 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 | 338 ++++++++++++++++++++++++++++++ configs/kp_imx6q_tpc_defconfig | 42 ++++ include/configs/kp_imx6q_tpc.h | 141 +++++++++++++ 8 files changed, 863 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
@@ -387,6 +387,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
@@ -493,6 +503,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 +338 -0
338 lines not on this page · raw message
configs/kp_imx6q_tpc_defconfig new file +42 -0
42 lines not on this page · raw message
include/configs/kp_imx6q_tpc.h new file +141 -0
141 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH v2 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.
---
Changes in v2:
- None
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
PATCH v2 2/2 boot: script: The boot.scr file for K+P's boards
Quoted 11 lines · Lukasz Majewski
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]>Reviewed-by Stefano Babic <[email protected]>---
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v2 1/2 imx: board: Add support for the K+P's kp_imx6q_tpc board
In reply to Lukasz MajewskiQuoted 23 lines · Lukasz Majewski
This commit provides support for Kieback & Peter GmbH IMX6Q based TPC board.
U-boot console output:
U-Boot SPL 2018.05-rc1-00005-g631e2d01fd (Apr 04 2018 - 21:16:24 +0200) Trying to boot from MMC1
U-Boot 2018.05-rc1-00005-g631e2d01fd (Apr 04 2018 - 21:16:24 +0200)
CPU: Freescale i.MX6Q rev1.5 996 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 37C Reset cause: POR Board: K+P KP_IMX6Q_TPC i.MX6Q Watchdog enabled I2C: ready DRAM: 2 GiB MMC: FSL_SDHC: 0, FSL_SDHC: 1 Loading Environment from MMC... OK In: serial Out: serial Err: serial Net: FEC [PRIME]
Quoted 4 lines
Autoboot in 3 seconds
---
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================