blob: c94882846efa4c581e01c6c1b07e4dd460a24c82 [file] [log] [blame]
Tom Rini855ff8e2018-05-18 17:54:39 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Lukasz Majewskiee943652018-04-26 15:07:18 +02002/*
3 * Copyright (C) 2018
4 * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
Lukasz Majewskiee943652018-04-26 15:07:18 +02005 */
6
7#ifndef __CONFIG_H_
8#define __CONFIG_H_
9
10#include <asm/arch/imx-regs.h>
11#include <linux/sizes.h>
12
13#define CONFIG_SYS_FSL_CLK
14
15/* Size of malloc() pool */
16#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
17
Lukasz Majewskiee943652018-04-26 15:07:18 +020018/* USB Configs */
Lukasz Majewskiee943652018-04-26 15:07:18 +020019#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
20#define CONFIG_MXC_USB_FLAGS 0
21
22#define CONFIG_SYS_I2C_MXC
23#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
24#define CONFIG_SYS_EEPROM_BUS_NUM 1
25#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
26
Lukasz Majewskiee943652018-04-26 15:07:18 +020027/* Command definition */
28#define CONFIG_LOADADDR 0x72000000 /* loadaddr env var */
29
30#define CONFIG_EXTRA_ENV_SETTINGS \
31 "console=ttymxc1,115200\0" \
32 "fdt_addr=0x75000000\0" \
33 "fdt_high=0xffffffff\0" \
34 "scriptaddr=0x74000000\0" \
35 "kernel_file=fitImage\0"\
Lukasz Majewskie8d2f282018-05-20 08:33:17 +020036 "silent=1\0"\
Lukasz Majewskiee943652018-04-26 15:07:18 +020037 "rdinit=/sbin/init\0" \
38 "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
39 "upd_image=st.4k\0" \
40 "uboot_file=u-boot.imx\0" \
Lukasz Majewskia73b4b62019-05-08 16:26:22 +020041 "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \
42 "initrd_ram_dev=/dev/ram\0" \
43 "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \
Lukasz Majewski5f6d63a2019-05-08 16:26:23 +020044 "addkeys=setenv bootargs ${bootargs} di=${dig_in} key1=${key1}\0" \
Lukasz Majewskiee943652018-04-26 15:07:18 +020045 "loadusb=usb start; " \
46 "fatload usb 0 ${loadaddr} ${upd_image}\0" \
47 "up=if tftp ${loadaddr} ${uboot_file}; then " \
48 "setexpr blkc ${filesize} / 0x200; " \
49 "setexpr blkc ${blkc} + 1; " \
50 "mmc write ${loadaddr} 0x2 ${blkc}" \
51 "; fi\0" \
Lukasz Majewskiddba5e52019-04-04 12:26:48 +020052 "upwic=setenv wic_file kp-image-kp${boardsoc}.wic; "\
Lukasz Majewskiee943652018-04-26 15:07:18 +020053 "if tftp ${loadaddr} ${wic_file}; then " \
54 "setexpr blkc ${filesize} / 0x200; " \
55 "setexpr blkc ${blkc} + 1; " \
56 "mmc write ${loadaddr} 0x0 ${blkc}" \
57 "; fi\0" \
58 "usbupd=echo Booting update from usb ...; " \
59 "setenv bootargs; " \
60 "run updargs; " \
Lukasz Majewskia73b4b62019-05-08 16:26:22 +020061 "run addinitrd; " \
62 "run addswupdate; " \
Lukasz Majewski5f6d63a2019-05-08 16:26:23 +020063 "run addkeys; " \
Lukasz Majewskiee943652018-04-26 15:07:18 +020064 "run loadusb; " \
65 "bootm ${loadaddr}#${fit_config}\0" \
66 BOOTENV
67
68#define CONFIG_BOOTCOMMAND "run usbupd; run distro_bootcmd"
69
70#define BOOT_TARGET_DEVICES(func) \
71 func(MMC, mmc, 0) \
72 func(DHCP, dhcp, na)
73
74#include <config_distro_bootcmd.h>
75
76#define CONFIG_ARP_TIMEOUT 200UL
77
78/* Miscellaneous configurable options */
79#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
80#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
81
82/* Physical Memory Map */
Lukasz Majewskiee943652018-04-26 15:07:18 +020083#define PHYS_SDRAM_1 CSD0_BASE_ADDR
84#define PHYS_SDRAM_1_SIZE (512 * SZ_1M)
85#define PHYS_SDRAM_SIZE (PHYS_SDRAM_1_SIZE)
86
87#define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1)
88#define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR)
89#define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE)
90
91#define CONFIG_SYS_INIT_SP_OFFSET \
92 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
93#define CONFIG_SYS_INIT_SP_ADDR \
94 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
95
96/* environment organization */
Lukasz Majewskiee943652018-04-26 15:07:18 +020097
98#endif /* __CONFIG_H_ */