blob: c1db6eace1aa583c800b04822b9be5f2f82fc81a [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
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020015/* USB Configs */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020016#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
17#define CONFIG_MXC_USB_FLAGS 0
18
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020019/* Command definition */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020020
21#define CONFIG_EXTRA_ENV_SETTINGS \
22 "console=ttymxc1,115200\0" \
23 "fdt_addr=0x75000000\0" \
24 "fdt_high=0xffffffff\0" \
25 "scriptaddr=0x74000000\0" \
26 "kernel_file=fitImage\0"\
Lukasz Majewskic6b7f202018-05-20 08:33:17 +020027 "silent=1\0"\
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020028 "rdinit=/sbin/init\0" \
29 "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
30 "upd_image=st.4k\0" \
31 "uboot_file=u-boot.imx\0" \
Lukasz Majewski530a4562019-05-08 16:26:22 +020032 "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \
33 "initrd_ram_dev=/dev/ram\0" \
34 "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \
Lukasz Majewski5805a8d2019-05-08 16:26:23 +020035 "addkeys=setenv bootargs ${bootargs} di=${dig_in} key1=${key1}\0" \
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020036 "loadusb=usb start; " \
37 "fatload usb 0 ${loadaddr} ${upd_image}\0" \
38 "up=if tftp ${loadaddr} ${uboot_file}; then " \
39 "setexpr blkc ${filesize} / 0x200; " \
40 "setexpr blkc ${blkc} + 1; " \
41 "mmc write ${loadaddr} 0x2 ${blkc}" \
42 "; fi\0" \
Lukasz Majewski09ed1652019-04-04 12:26:48 +020043 "upwic=setenv wic_file kp-image-kp${boardsoc}.wic; "\
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020044 "if tftp ${loadaddr} ${wic_file}; then " \
45 "setexpr blkc ${filesize} / 0x200; " \
46 "setexpr blkc ${blkc} + 1; " \
47 "mmc write ${loadaddr} 0x0 ${blkc}" \
48 "; fi\0" \
49 "usbupd=echo Booting update from usb ...; " \
50 "setenv bootargs; " \
51 "run updargs; " \
Lukasz Majewski530a4562019-05-08 16:26:22 +020052 "run addinitrd; " \
53 "run addswupdate; " \
Lukasz Majewski5805a8d2019-05-08 16:26:23 +020054 "run addkeys; " \
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020055 "run loadusb; " \
56 "bootm ${loadaddr}#${fit_config}\0" \
57 BOOTENV
58
59#define CONFIG_BOOTCOMMAND "run usbupd; run distro_bootcmd"
60
61#define BOOT_TARGET_DEVICES(func) \
62 func(MMC, mmc, 0) \
63 func(DHCP, dhcp, na)
64
65#include <config_distro_bootcmd.h>
66
67#define CONFIG_ARP_TIMEOUT 200UL
68
69/* Miscellaneous configurable options */
70#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020071
72/* Physical Memory Map */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020073#define PHYS_SDRAM_1 CSD0_BASE_ADDR
74#define PHYS_SDRAM_1_SIZE (512 * SZ_1M)
75#define PHYS_SDRAM_SIZE (PHYS_SDRAM_1_SIZE)
76
77#define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1)
78#define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR)
79#define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE)
80
81#define CONFIG_SYS_INIT_SP_OFFSET \
82 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
83#define CONFIG_SYS_INIT_SP_ADDR \
84 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
85
86/* environment organization */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020087
88#endif /* __CONFIG_H_ */