blob: 749e880f36ff8aafac9ab43362c2e11b5a5d5a62 [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 CONFIG_ARP_TIMEOUT 200UL
29
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020030/* USB Configs */
31#ifdef CONFIG_CMD_USB
32#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
33#define CONFIG_USB_HOST_ETHER
34#define CONFIG_USB_ETHER_ASIX
35#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
36#define CONFIG_MXC_USB_FLAGS 0
37#define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */
38#endif
39
40/* Watchdog */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020041
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020042#define CONFIG_LOADADDR 0x12000000
43#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
44
45#ifndef CONFIG_SPL_BUILD
46#define CONFIG_EXTRA_ENV_SETTINGS \
47 "console=ttymxc0,115200\0" \
48 "fdt_addr=0x18000000\0" \
49 "fdt_high=0xffffffff\0" \
50 "initrd_high=0xffffffff\0" \
51 "kernel_addr_r=0x10008000\0" \
52 "fdt_addr_r=0x13000000\0" \
53 "ramdisk_addr_r=0x18000000\0" \
54 "scriptaddr=0x14000000\0" \
55 "kernel_file=fitImage\0"\
56 "rdinit=/sbin/init\0" \
57 "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
58 "fit_config=mx6q_tpc70_conf\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020059 "uboot_file=u-boot.img\0" \
60 "SPL_file=SPL\0" \
61 "wic_file=kp-image-kpimx6qtpc.wic\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020062 "upd_image=st.4k\0" \
Lukasz Majewski3272eaa2019-10-10 16:11:30 +020063 "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \
64 "initrd_ram_dev=/dev/ram\0" \
65 "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020066 "loadusb=usb start; " \
67 "fatload usb 0 ${loadaddr} ${upd_image}\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020068 "upd_uboot_sd=" \
69 "if tftp ${loadaddr} ${uboot_file}; then " \
70 "setexpr blkc ${filesize} / 0x200;" \
71 "setexpr blkc ${blkc} + 1;" \
72 "mmc write ${loadaddr} 0x8A ${blkc};" \
73 "fi;\0" \
74 "upd_SPL_sd=" \
75 "if tftp ${loadaddr} ${SPL_file}; then " \
76 "setexpr blkc ${filesize} / 0x200;" \
77 "setexpr blkc ${blkc} + 1;" \
78 "mmc write ${loadaddr} 0x2 ${blkc};" \
79 "fi;\0" \
Lukasz Majewski1181e4a2019-10-10 16:11:23 +020080 "upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_SPL_sd\0" \
81 "upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_uboot_sd\0" \
82 "up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \
83 "up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020084 "upd_wic=" \
85 "if tftp ${loadaddr} ${wic_file}; then " \
86 "setexpr blkc ${filesize} / 0x200;" \
87 "setexpr blkc ${blkc} + 1;" \
88 "mmc write ${loadaddr} 0x0 ${blkc};" \
89 "fi;\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020090 "usbupd=echo Booting update from usb ...; " \
91 "setenv bootargs; " \
92 "run updargs; " \
Lukasz Majewski3272eaa2019-10-10 16:11:30 +020093 "run addinitrd; " \
94 "run addswupdate; " \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020095 "run loadusb; " \
96 "bootm ${loadaddr}#${fit_config}\0" \
97 BOOTENV
98
99#define CONFIG_BOOTCOMMAND "run usbupd; run distro_bootcmd"
100
101#define BOOT_TARGET_DEVICES(func) \
102 func(MMC, mmc, 0) \
103 func(MMC, mmc, 1) \
104 func(USB, usb, 0) \
105 func(DHCP, dhcp, na)
106
107#include <config_distro_bootcmd.h>
108#endif
109
110/* Physical Memory Map */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +0200111#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
112
113#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
114#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
115#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
116
117#define CONFIG_SYS_INIT_SP_OFFSET \
118 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
119
120#define CONFIG_SYS_INIT_SP_ADDR \
121 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
122
123/* Environment */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +0200124
125#endif /* __KP_IMX6Q_TPC_IMX6_CONFIG_H_ */