blob: 78c6c67ab99f030af5ea9df3b1cab69c637b035f [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
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020013/* USB Configs */
Tom Rinib9796e82022-12-04 10:04:56 -050014#define CFG_MXC_USB_FLAGS 0
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020015
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020016/* Command definition */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020017
Tom Rinic9edebe2022-12-04 10:03:50 -050018#define CFG_EXTRA_ENV_SETTINGS \
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020019 "console=ttymxc1,115200\0" \
20 "fdt_addr=0x75000000\0" \
21 "fdt_high=0xffffffff\0" \
22 "scriptaddr=0x74000000\0" \
23 "kernel_file=fitImage\0"\
Lukasz Majewskic6b7f202018-05-20 08:33:17 +020024 "silent=1\0"\
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020025 "rdinit=/sbin/init\0" \
26 "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \
27 "upd_image=st.4k\0" \
28 "uboot_file=u-boot.imx\0" \
Lukasz Majewski530a4562019-05-08 16:26:22 +020029 "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \
30 "initrd_ram_dev=/dev/ram\0" \
31 "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \
Lukasz Majewski5805a8d2019-05-08 16:26:23 +020032 "addkeys=setenv bootargs ${bootargs} di=${dig_in} key1=${key1}\0" \
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020033 "loadusb=usb start; " \
34 "fatload usb 0 ${loadaddr} ${upd_image}\0" \
35 "up=if tftp ${loadaddr} ${uboot_file}; then " \
36 "setexpr blkc ${filesize} / 0x200; " \
37 "setexpr blkc ${blkc} + 1; " \
38 "mmc write ${loadaddr} 0x2 ${blkc}" \
39 "; fi\0" \
Lukasz Majewski09ed1652019-04-04 12:26:48 +020040 "upwic=setenv wic_file kp-image-kp${boardsoc}.wic; "\
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020041 "if tftp ${loadaddr} ${wic_file}; then " \
42 "setexpr blkc ${filesize} / 0x200; " \
43 "setexpr blkc ${blkc} + 1; " \
44 "mmc write ${loadaddr} 0x0 ${blkc}" \
45 "; fi\0" \
46 "usbupd=echo Booting update from usb ...; " \
47 "setenv bootargs; " \
48 "run updargs; " \
Lukasz Majewski530a4562019-05-08 16:26:22 +020049 "run addinitrd; " \
50 "run addswupdate; " \
Lukasz Majewski5805a8d2019-05-08 16:26:23 +020051 "run addkeys; " \
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020052 "run loadusb; " \
53 "bootm ${loadaddr}#${fit_config}\0" \
54 BOOTENV
55
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020056#define BOOT_TARGET_DEVICES(func) \
57 func(MMC, mmc, 0) \
58 func(DHCP, dhcp, na)
59
60#include <config_distro_bootcmd.h>
61
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020062/* Miscellaneous configurable options */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020063
64/* Physical Memory Map */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020065#define PHYS_SDRAM_1 CSD0_BASE_ADDR
66#define PHYS_SDRAM_1_SIZE (512 * SZ_1M)
67#define PHYS_SDRAM_SIZE (PHYS_SDRAM_1_SIZE)
68
Tom Rinibb4dd962022-11-16 13:10:37 -050069#define CFG_SYS_SDRAM_BASE (PHYS_SDRAM_1)
Tom Rini6a5dccc2022-11-16 13:10:41 -050070#define CFG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR)
71#define CFG_SYS_INIT_RAM_SIZE (IRAM_SIZE)
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020072
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020073/* environment organization */
Lukasz Majewski7515a6f2018-04-26 15:07:18 +020074
75#endif /* __CONFIG_H_ */