blob: 28b4b55e6a85861845f8914e7a83c28cbcdf0213 [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 */
19#define CONFIG_CMDLINE_TAG
20#define CONFIG_SETUP_MEMORY_TAGS
21#define CONFIG_INITRD_TAG
22#define CONFIG_REVISION_TAG
23
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020024/* Size of malloc() pool */
25#define CONFIG_SYS_MALLOC_LEN (4 * SZ_1M)
26
27/* FEC ethernet */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020028#define IMX_FEC_BASE ENET_BASE_ADDR
29#define CONFIG_FEC_XCV_TYPE RGMII
30#define CONFIG_ETHPRIME "FEC"
31#define CONFIG_FEC_MXC_PHYADDR 0
32#define CONFIG_ARP_TIMEOUT 200UL
33
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020034/* I2C Configs */
35#define CONFIG_SYS_I2C
36#define CONFIG_SYS_I2C_MXC
37#define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
38#define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
39#define CONFIG_SYS_I2C_SPEED 100000
40
41/* MMC Configs */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020042#define CONFIG_SYS_FSL_ESDHC_ADDR 0
43#define CONFIG_SYS_FSL_USDHC_NUM 2
44#define CONFIG_SYS_MMC_ENV_DEV 1 /* 0 = SDHC2, 1 = SDHC4 (eMMC) */
Lukasz Majewski1181e4a2019-10-10 16:11:23 +020045#define CONFIG_SUPPORT_EMMC_BOOT
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020046
47/* UART */
48#define CONFIG_MXC_UART
49#define CONFIG_MXC_UART_BASE UART1_BASE
50#define CONFIG_CONS_INDEX 1
51#define CONFIG_BAUDRATE 115200
52
53/* USB Configs */
54#ifdef CONFIG_CMD_USB
55#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
56#define CONFIG_USB_HOST_ETHER
57#define CONFIG_USB_ETHER_ASIX
58#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
59#define CONFIG_MXC_USB_FLAGS 0
60#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */
61#endif
62
63/* Watchdog */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020064
65/* allow to overwrite serial and ethaddr */
66#define CONFIG_ENV_OVERWRITE
67
68#define CONFIG_LOADADDR 0x12000000
69#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
70
71#ifndef CONFIG_SPL_BUILD
72#define CONFIG_EXTRA_ENV_SETTINGS \
73 "console=ttymxc0,115200\0" \
74 "fdt_addr=0x18000000\0" \
75 "fdt_high=0xffffffff\0" \
76 "initrd_high=0xffffffff\0" \
77 "kernel_addr_r=0x10008000\0" \
78 "fdt_addr_r=0x13000000\0" \
79 "ramdisk_addr_r=0x18000000\0" \
80 "scriptaddr=0x14000000\0" \
81 "kernel_file=fitImage\0"\
82 "rdinit=/sbin/init\0" \
83 "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
84 "fit_config=mx6q_tpc70_conf\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020085 "uboot_file=u-boot.img\0" \
86 "SPL_file=SPL\0" \
87 "wic_file=kp-image-kpimx6qtpc.wic\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020088 "upd_image=st.4k\0" \
89 "updargs=setenv bootargs console=${console} ${smp}"\
90 "rdinit=${rdinit} ${debug} ${displayargs}\0" \
91 "loadusb=usb start; " \
92 "fatload usb 0 ${loadaddr} ${upd_image}\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020093 "upd_uboot_sd=" \
94 "if tftp ${loadaddr} ${uboot_file}; then " \
95 "setexpr blkc ${filesize} / 0x200;" \
96 "setexpr blkc ${blkc} + 1;" \
97 "mmc write ${loadaddr} 0x8A ${blkc};" \
98 "fi;\0" \
99 "upd_SPL_sd=" \
100 "if tftp ${loadaddr} ${SPL_file}; then " \
101 "setexpr blkc ${filesize} / 0x200;" \
102 "setexpr blkc ${blkc} + 1;" \
103 "mmc write ${loadaddr} 0x2 ${blkc};" \
104 "fi;\0" \
Lukasz Majewski1181e4a2019-10-10 16:11:23 +0200105 "upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_SPL_sd\0" \
106 "upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_uboot_sd\0" \
107 "up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \
108 "up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +0200109 "upd_wic=" \
110 "if tftp ${loadaddr} ${wic_file}; then " \
111 "setexpr blkc ${filesize} / 0x200;" \
112 "setexpr blkc ${blkc} + 1;" \
113 "mmc write ${loadaddr} 0x0 ${blkc};" \
114 "fi;\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +0200115 "usbupd=echo Booting update from usb ...; " \
116 "setenv bootargs; " \
117 "run updargs; " \
118 "run loadusb; " \
119 "bootm ${loadaddr}#${fit_config}\0" \
120 BOOTENV
121
122#define CONFIG_BOOTCOMMAND "run usbupd; run distro_bootcmd"
123
124#define BOOT_TARGET_DEVICES(func) \
125 func(MMC, mmc, 0) \
126 func(MMC, mmc, 1) \
127 func(USB, usb, 0) \
128 func(DHCP, dhcp, na)
129
130#include <config_distro_bootcmd.h>
131#endif
132
133/* Physical Memory Map */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +0200134#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
135
136#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
137#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
138#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
139
140#define CONFIG_SYS_INIT_SP_OFFSET \
141 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
142
143#define CONFIG_SYS_INIT_SP_ADDR \
144 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
145
146/* Environment */
147#define CONFIG_ENV_SIZE (SZ_8K)
148#define CONFIG_ENV_OFFSET 0x100000
149#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
150#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
151
152#endif /* __KP_IMX6Q_TPC_IMX6_CONFIG_H_ */