blob: 7d879477d705d4ef4211c00dbd5e8ec2a6dac531 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +02002/*
3 * K+P iMX6Q KP_IMX6Q_TPC board configuration
4 *
5 * Copyright (C) 2018 Lukasz Majewski <lukma@denx.de>
Lukasz Majewskie7f7c082018-04-05 09:04:38 +02006 */
7
8#ifndef __KP_IMX6Q_TPC_IMX6_CONFIG_H_
9#define __KP_IMX6Q_TPC_IMX6_CONFIG_H_
10
11#include <asm/arch/imx-regs.h>
12
13#include "mx6_common.h"
14
15/* SPL */
16#include "imx6_spl.h" /* common IMX6 SPL configuration */
17
18/* Miscellaneous configurable options */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020019
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020020/* FEC ethernet */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020021
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020022/* USB Configs */
23#ifdef CONFIG_CMD_USB
24#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020025#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
26#define CONFIG_MXC_USB_FLAGS 0
27#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */
28#endif
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020029
30#ifndef CONFIG_SPL_BUILD
31#define CONFIG_EXTRA_ENV_SETTINGS \
32 "console=ttymxc0,115200\0" \
33 "fdt_addr=0x18000000\0" \
34 "fdt_high=0xffffffff\0" \
35 "initrd_high=0xffffffff\0" \
36 "kernel_addr_r=0x10008000\0" \
37 "fdt_addr_r=0x13000000\0" \
38 "ramdisk_addr_r=0x18000000\0" \
39 "scriptaddr=0x14000000\0" \
40 "kernel_file=fitImage\0"\
41 "rdinit=/sbin/init\0" \
42 "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
43 "fit_config=mx6q_tpc70_conf\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020044 "uboot_file=u-boot.img\0" \
45 "SPL_file=SPL\0" \
46 "wic_file=kp-image-kpimx6qtpc.wic\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020047 "upd_image=st.4k\0" \
Lukasz Majewski3272eaa2019-10-10 16:11:30 +020048 "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \
49 "initrd_ram_dev=/dev/ram\0" \
50 "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020051 "loadusb=usb start; " \
52 "fatload usb 0 ${loadaddr} ${upd_image}\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020053 "upd_uboot_sd=" \
54 "if tftp ${loadaddr} ${uboot_file}; then " \
55 "setexpr blkc ${filesize} / 0x200;" \
56 "setexpr blkc ${blkc} + 1;" \
57 "mmc write ${loadaddr} 0x8A ${blkc};" \
58 "fi;\0" \
59 "upd_SPL_sd=" \
60 "if tftp ${loadaddr} ${SPL_file}; then " \
61 "setexpr blkc ${filesize} / 0x200;" \
62 "setexpr blkc ${blkc} + 1;" \
63 "mmc write ${loadaddr} 0x2 ${blkc};" \
64 "fi;\0" \
Lukasz Majewski1181e4a2019-10-10 16:11:23 +020065 "upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_SPL_sd\0" \
66 "upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_uboot_sd\0" \
67 "up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \
68 "up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020069 "upd_wic=" \
70 "if tftp ${loadaddr} ${wic_file}; then " \
71 "setexpr blkc ${filesize} / 0x200;" \
72 "setexpr blkc ${blkc} + 1;" \
73 "mmc write ${loadaddr} 0x0 ${blkc};" \
74 "fi;\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020075 "usbupd=echo Booting update from usb ...; " \
76 "setenv bootargs; " \
77 "run updargs; " \
Lukasz Majewski3272eaa2019-10-10 16:11:30 +020078 "run addinitrd; " \
79 "run addswupdate; " \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020080 "run loadusb; " \
81 "bootm ${loadaddr}#${fit_config}\0" \
82 BOOTENV
83
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020084#define BOOT_TARGET_DEVICES(func) \
85 func(MMC, mmc, 0) \
86 func(MMC, mmc, 1) \
87 func(USB, usb, 0) \
88 func(DHCP, dhcp, na)
89
90#include <config_distro_bootcmd.h>
91#endif
92
93/* Physical Memory Map */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020094#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
95
96#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
97#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
98#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
99
100#define CONFIG_SYS_INIT_SP_OFFSET \
101 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
102
103#define CONFIG_SYS_INIT_SP_ADDR \
104 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
105
106/* Environment */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +0200107
108#endif /* __KP_IMX6Q_TPC_IMX6_CONFIG_H_ */