blob: 55bfa0fe591f8bd0e6cf8ef34b59d94db9f73fed [file] [log] [blame]
Tom Riniaf489482018-05-18 17:54:39 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +02002/*
3 * Copyright (C) 2018
4 * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
Lukasz Majewski7515a6f2018-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 Majewski7515a6f2018-04-26 15:07:18 +020018/* USB Configs */
Lukasz Majewski7515a6f2018-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
27/* allow to overwrite serial and ethaddr */
28#define CONFIG_ENV_OVERWRITE
29
30/* Command definition */
31#define CONFIG_LOADADDR 0x72000000 /* loadaddr env var */
32
33#define CONFIG_EXTRA_ENV_SETTINGS \
34 "console=ttymxc1,115200\0" \
35 "fdt_addr=0x75000000\0" \
36 "fdt_high=0xffffffff\0" \
37 "scriptaddr=0x74000000\0" \
38 "kernel_file=fitImage\0"\
Lukasz Majewskic6b7f202018-05-20 08:33:17 +020039 "silent=1\0"\
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020040 "rdinit=/sbin/init\0" \
41 "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
42 "upd_image=st.4k\0" \
43 "uboot_file=u-boot.imx\0" \
Lukasz Majewski530a4562019-05-08 16:26:22 +020044 "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \
45 "initrd_ram_dev=/dev/ram\0" \
46 "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \
Lukasz Majewski5805a8d2019-05-08 16:26:23 +020047 "addkeys=setenv bootargs ${bootargs} di=${dig_in} key1=${key1}\0" \
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020048 "loadusb=usb start; " \
49 "fatload usb 0 ${loadaddr} ${upd_image}\0" \
50 "up=if tftp ${loadaddr} ${uboot_file}; then " \
51 "setexpr blkc ${filesize} / 0x200; " \
52 "setexpr blkc ${blkc} + 1; " \
53 "mmc write ${loadaddr} 0x2 ${blkc}" \
54 "; fi\0" \
Lukasz Majewski09ed1652019-04-04 12:26:48 +020055 "upwic=setenv wic_file kp-image-kp${boardsoc}.wic; "\
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020056 "if tftp ${loadaddr} ${wic_file}; then " \
57 "setexpr blkc ${filesize} / 0x200; " \
58 "setexpr blkc ${blkc} + 1; " \
59 "mmc write ${loadaddr} 0x0 ${blkc}" \
60 "; fi\0" \
61 "usbupd=echo Booting update from usb ...; " \
62 "setenv bootargs; " \
63 "run updargs; " \
Lukasz Majewski530a4562019-05-08 16:26:22 +020064 "run addinitrd; " \
65 "run addswupdate; " \
Lukasz Majewski5805a8d2019-05-08 16:26:23 +020066 "run addkeys; " \
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020067 "run loadusb; " \
68 "bootm ${loadaddr}#${fit_config}\0" \
69 BOOTENV
70
71#define CONFIG_BOOTCOMMAND "run usbupd; run distro_bootcmd"
72
73#define BOOT_TARGET_DEVICES(func) \
74 func(MMC, mmc, 0) \
75 func(DHCP, dhcp, na)
76
77#include <config_distro_bootcmd.h>
78
79#define CONFIG_ARP_TIMEOUT 200UL
80
81/* Miscellaneous configurable options */
82#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
83#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
84
85/* Physical Memory Map */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020086#define PHYS_SDRAM_1 CSD0_BASE_ADDR
87#define PHYS_SDRAM_1_SIZE (512 * SZ_1M)
88#define PHYS_SDRAM_SIZE (PHYS_SDRAM_1_SIZE)
89
90#define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1)
91#define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR)
92#define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE)
93
94#define CONFIG_SYS_INIT_SP_OFFSET \
95 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
96#define CONFIG_SYS_INIT_SP_ADDR \
97 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
98
99/* environment organization */
100#define CONFIG_ENV_OFFSET (SZ_1M)
101#define CONFIG_ENV_SIZE (SZ_8K)
102#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
103#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
104#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
105#define CONFIG_SYS_MMC_ENV_DEV 0
106
107#endif /* __CONFIG_H_ */