Globally remove most CONFIG_SPL_BUILD tests from config headers
[platform/kernel/u-boot.git] / include / configs / kp_imx6q_tpc.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * K+P iMX6Q KP_IMX6Q_TPC board configuration
4  *
5  * Copyright (C) 2018 Lukasz Majewski <lukma@denx.de>
6  */
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
20 /* FEC ethernet */
21
22 /* USB Configs */
23 #ifdef CONFIG_CMD_USB
24 #define CONFIG_MXC_USB_PORTSC           (PORT_PTS_UTMI | PORT_PTS_PTW)
25 #define CONFIG_MXC_USB_FLAGS            0
26 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2 /* Enabled USB controller number */
27 #endif
28
29 #define CONFIG_EXTRA_ENV_SETTINGS       \
30         "console=ttymxc0,115200\0"      \
31         "fdt_addr=0x18000000\0"         \
32         "fdt_high=0xffffffff\0"         \
33         "initrd_high=0xffffffff\0"      \
34         "kernel_addr_r=0x10008000\0"    \
35         "fdt_addr_r=0x13000000\0"       \
36         "ramdisk_addr_r=0x18000000\0"   \
37         "scriptaddr=0x14000000\0"       \
38         "kernel_file=fitImage\0"\
39         "rdinit=/sbin/init\0" \
40         "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
41         "fit_config=mx6q_tpc70_conf\0" \
42         "uboot_file=u-boot.img\0" \
43         "SPL_file=SPL\0" \
44         "wic_file=kp-image-kpimx6qtpc.wic\0" \
45         "upd_image=st.4k\0" \
46         "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \
47         "initrd_ram_dev=/dev/ram\0" \
48         "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \
49         "loadusb=usb start; " \
50                "fatload usb 0 ${loadaddr} ${upd_image}\0" \
51         "upd_uboot_sd=" \
52             "if tftp ${loadaddr} ${uboot_file}; then " \
53                "setexpr blkc ${filesize} / 0x200;" \
54                "setexpr blkc ${blkc} + 1;" \
55                "mmc write ${loadaddr} 0x8A ${blkc};" \
56             "fi;\0" \
57         "upd_SPL_sd=" \
58             "if tftp ${loadaddr} ${SPL_file}; then " \
59                "setexpr blkc ${filesize} / 0x200;" \
60                "setexpr blkc ${blkc} + 1;" \
61                "mmc write ${loadaddr} 0x2 ${blkc};" \
62             "fi;\0" \
63         "upd_SPL_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_SPL_sd\0" \
64         "upd_uboot_mmc=mmc dev 1; mmc partconf 1 0 1 1; run upd_uboot_sd\0" \
65         "up_mmc=run upd_SPL_mmc; run upd_uboot_mmc\0" \
66         "up_sd=run upd_SPL_sd; run upd_uboot_sd\0" \
67         "upd_wic=" \
68             "if tftp ${loadaddr} ${wic_file}; then " \
69                "setexpr blkc ${filesize} / 0x200;" \
70                "setexpr blkc ${blkc} + 1;" \
71                "mmc write ${loadaddr} 0x0 ${blkc};" \
72             "fi;\0" \
73         "usbupd=echo Booting update from usb ...; " \
74                "setenv bootargs; " \
75                "run updargs; " \
76                "run addinitrd; " \
77                "run addswupdate; " \
78                "run loadusb; " \
79                "bootm ${loadaddr}#${fit_config}\0" \
80         BOOTENV
81
82 #define BOOT_TARGET_DEVICES(func) \
83         func(MMC, mmc, 0) \
84         func(MMC, mmc, 1) \
85         func(USB, usb, 0) \
86         func(DHCP, dhcp, na)
87
88 #include <config_distro_bootcmd.h>
89
90 /* Physical Memory Map */
91 #define PHYS_SDRAM                      MMDC0_ARB_BASE_ADDR
92
93 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
94 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
95 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
96
97 /* Environment */
98
99 #endif  /* __KP_IMX6Q_TPC_IMX6_CONFIG_H_ */