blob: c0cb3db23e7a7013fcb31df29058490ecece89de [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
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020015/* Miscellaneous configurable options */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020016
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020017/* FEC ethernet */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020018
Tom Rinic9edebe2022-12-04 10:03:50 -050019#define CFG_EXTRA_ENV_SETTINGS \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020020 "console=ttymxc0,115200\0" \
21 "fdt_addr=0x18000000\0" \
22 "fdt_high=0xffffffff\0" \
23 "initrd_high=0xffffffff\0" \
24 "kernel_addr_r=0x10008000\0" \
25 "fdt_addr_r=0x13000000\0" \
26 "ramdisk_addr_r=0x18000000\0" \
27 "scriptaddr=0x14000000\0" \
28 "kernel_file=fitImage\0"\
29 "rdinit=/sbin/init\0" \
30 "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
31 "fit_config=mx6q_tpc70_conf\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020032 "uboot_file=u-boot.img\0" \
33 "SPL_file=SPL\0" \
34 "wic_file=kp-image-kpimx6qtpc.wic\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020035 "upd_image=st.4k\0" \
Lukasz Majewski3272eaa2019-10-10 16:11:30 +020036 "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \
37 "initrd_ram_dev=/dev/ram\0" \
38 "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020039 "loadusb=usb start; " \
40 "fatload usb 0 ${loadaddr} ${upd_image}\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020041 "upd_uboot_sd=" \
42 "if tftp ${loadaddr} ${uboot_file}; then " \
43 "setexpr blkc ${filesize} / 0x200;" \
44 "setexpr blkc ${blkc} + 1;" \
45 "mmc write ${loadaddr} 0x8A ${blkc};" \
46 "fi;\0" \
47 "upd_SPL_sd=" \
48 "if tftp ${loadaddr} ${SPL_file}; then " \
49 "setexpr blkc ${filesize} / 0x200;" \
50 "setexpr blkc ${blkc} + 1;" \
51 "mmc write ${loadaddr} 0x2 ${blkc};" \
52 "fi;\0" \
Lukasz Majewski1181e4a2019-10-10 16:11:23 +020053 "upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_SPL_sd\0" \
54 "upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_uboot_sd\0" \
55 "up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \
56 "up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \
Lukasz Majewskiab875e82019-10-10 16:11:22 +020057 "upd_wic=" \
58 "if tftp ${loadaddr} ${wic_file}; then " \
59 "setexpr blkc ${filesize} / 0x200;" \
60 "setexpr blkc ${blkc} + 1;" \
61 "mmc write ${loadaddr} 0x0 ${blkc};" \
62 "fi;\0" \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020063 "usbupd=echo Booting update from usb ...; " \
64 "setenv bootargs; " \
65 "run updargs; " \
Lukasz Majewski3272eaa2019-10-10 16:11:30 +020066 "run addinitrd; " \
67 "run addswupdate; " \
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020068 "run loadusb; " \
69 "bootm ${loadaddr}#${fit_config}\0" \
70 BOOTENV
71
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020072#define BOOT_TARGET_DEVICES(func) \
73 func(MMC, mmc, 0) \
74 func(MMC, mmc, 1) \
75 func(USB, usb, 0) \
76 func(DHCP, dhcp, na)
77
78#include <config_distro_bootcmd.h>
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020079
80/* Physical Memory Map */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020081#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
82
Tom Rinibb4dd962022-11-16 13:10:37 -050083#define CFG_SYS_SDRAM_BASE PHYS_SDRAM
Tom Rini6a5dccc2022-11-16 13:10:41 -050084#define CFG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
85#define CFG_SYS_INIT_RAM_SIZE IRAM_SIZE
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020086
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020087/* Environment */
Lukasz Majewskie7f7c082018-04-05 09:04:38 +020088
89#endif /* __KP_IMX6Q_TPC_IMX6_CONFIG_H_ */