Tom Rini | af48948 | 2018-05-18 17:54:39 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2018 |
| 4 | * Lukasz Majewski, DENX Software Engineering, lukma@denx.de |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __CONFIG_H_ |
| 8 | #define __CONFIG_H_ |
| 9 | |
| 10 | #include <asm/arch/imx-regs.h> |
| 11 | #include <linux/sizes.h> |
| 12 | |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 13 | /* USB Configs */ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 14 | #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW) |
| 15 | #define CONFIG_MXC_USB_FLAGS 0 |
| 16 | |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 17 | /* Command definition */ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 18 | |
| 19 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 20 | "console=ttymxc1,115200\0" \ |
| 21 | "fdt_addr=0x75000000\0" \ |
| 22 | "fdt_high=0xffffffff\0" \ |
| 23 | "scriptaddr=0x74000000\0" \ |
| 24 | "kernel_file=fitImage\0"\ |
Lukasz Majewski | c6b7f20 | 2018-05-20 08:33:17 +0200 | [diff] [blame] | 25 | "silent=1\0"\ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 26 | "rdinit=/sbin/init\0" \ |
| 27 | "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \ |
| 28 | "upd_image=st.4k\0" \ |
| 29 | "uboot_file=u-boot.imx\0" \ |
Lukasz Majewski | 530a456 | 2019-05-08 16:26:22 +0200 | [diff] [blame] | 30 | "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \ |
| 31 | "initrd_ram_dev=/dev/ram\0" \ |
| 32 | "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \ |
Lukasz Majewski | 5805a8d | 2019-05-08 16:26:23 +0200 | [diff] [blame] | 33 | "addkeys=setenv bootargs ${bootargs} di=${dig_in} key1=${key1}\0" \ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 34 | "loadusb=usb start; " \ |
| 35 | "fatload usb 0 ${loadaddr} ${upd_image}\0" \ |
| 36 | "up=if tftp ${loadaddr} ${uboot_file}; then " \ |
| 37 | "setexpr blkc ${filesize} / 0x200; " \ |
| 38 | "setexpr blkc ${blkc} + 1; " \ |
| 39 | "mmc write ${loadaddr} 0x2 ${blkc}" \ |
| 40 | "; fi\0" \ |
Lukasz Majewski | 09ed165 | 2019-04-04 12:26:48 +0200 | [diff] [blame] | 41 | "upwic=setenv wic_file kp-image-kp${boardsoc}.wic; "\ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 42 | "if tftp ${loadaddr} ${wic_file}; then " \ |
| 43 | "setexpr blkc ${filesize} / 0x200; " \ |
| 44 | "setexpr blkc ${blkc} + 1; " \ |
| 45 | "mmc write ${loadaddr} 0x0 ${blkc}" \ |
| 46 | "; fi\0" \ |
| 47 | "usbupd=echo Booting update from usb ...; " \ |
| 48 | "setenv bootargs; " \ |
| 49 | "run updargs; " \ |
Lukasz Majewski | 530a456 | 2019-05-08 16:26:22 +0200 | [diff] [blame] | 50 | "run addinitrd; " \ |
| 51 | "run addswupdate; " \ |
Lukasz Majewski | 5805a8d | 2019-05-08 16:26:23 +0200 | [diff] [blame] | 52 | "run addkeys; " \ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 53 | "run loadusb; " \ |
| 54 | "bootm ${loadaddr}#${fit_config}\0" \ |
| 55 | BOOTENV |
| 56 | |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 57 | #define BOOT_TARGET_DEVICES(func) \ |
| 58 | func(MMC, mmc, 0) \ |
| 59 | func(DHCP, dhcp, na) |
| 60 | |
| 61 | #include <config_distro_bootcmd.h> |
| 62 | |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 63 | /* Miscellaneous configurable options */ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 64 | |
| 65 | /* Physical Memory Map */ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 66 | #define PHYS_SDRAM_1 CSD0_BASE_ADDR |
| 67 | #define PHYS_SDRAM_1_SIZE (512 * SZ_1M) |
| 68 | #define PHYS_SDRAM_SIZE (PHYS_SDRAM_1_SIZE) |
| 69 | |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 70 | #define CFG_SYS_SDRAM_BASE (PHYS_SDRAM_1) |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 71 | #define CFG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR) |
| 72 | #define CFG_SYS_INIT_RAM_SIZE (IRAM_SIZE) |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 73 | |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 74 | /* environment organization */ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 75 | |
| 76 | #endif /* __CONFIG_H_ */ |