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 | |
| 13 | #define CONFIG_SYS_FSL_CLK |
| 14 | |
| 15 | /* Size of malloc() pool */ |
| 16 | #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M) |
| 17 | |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 18 | /* USB Configs */ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 19 | #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 |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 23 | |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 24 | /* Command definition */ |
| 25 | #define CONFIG_LOADADDR 0x72000000 /* loadaddr env var */ |
| 26 | |
| 27 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 28 | "console=ttymxc1,115200\0" \ |
| 29 | "fdt_addr=0x75000000\0" \ |
| 30 | "fdt_high=0xffffffff\0" \ |
| 31 | "scriptaddr=0x74000000\0" \ |
| 32 | "kernel_file=fitImage\0"\ |
Lukasz Majewski | c6b7f20 | 2018-05-20 08:33:17 +0200 | [diff] [blame] | 33 | "silent=1\0"\ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 34 | "rdinit=/sbin/init\0" \ |
| 35 | "addinitrd=setenv bootargs ${bootargs} rdinit=${rdinit} ${debug} \0" \ |
| 36 | "upd_image=st.4k\0" \ |
| 37 | "uboot_file=u-boot.imx\0" \ |
Lukasz Majewski | 530a456 | 2019-05-08 16:26:22 +0200 | [diff] [blame] | 38 | "updargs=setenv bootargs console=${console} ${smp} ${displayargs}\0" \ |
| 39 | "initrd_ram_dev=/dev/ram\0" \ |
| 40 | "addswupdate=setenv bootargs ${bootargs} root=${initrd_ram_dev} rw\0" \ |
Lukasz Majewski | 5805a8d | 2019-05-08 16:26:23 +0200 | [diff] [blame] | 41 | "addkeys=setenv bootargs ${bootargs} di=${dig_in} key1=${key1}\0" \ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 42 | "loadusb=usb start; " \ |
| 43 | "fatload usb 0 ${loadaddr} ${upd_image}\0" \ |
| 44 | "up=if tftp ${loadaddr} ${uboot_file}; then " \ |
| 45 | "setexpr blkc ${filesize} / 0x200; " \ |
| 46 | "setexpr blkc ${blkc} + 1; " \ |
| 47 | "mmc write ${loadaddr} 0x2 ${blkc}" \ |
| 48 | "; fi\0" \ |
Lukasz Majewski | 09ed165 | 2019-04-04 12:26:48 +0200 | [diff] [blame] | 49 | "upwic=setenv wic_file kp-image-kp${boardsoc}.wic; "\ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 50 | "if tftp ${loadaddr} ${wic_file}; then " \ |
| 51 | "setexpr blkc ${filesize} / 0x200; " \ |
| 52 | "setexpr blkc ${blkc} + 1; " \ |
| 53 | "mmc write ${loadaddr} 0x0 ${blkc}" \ |
| 54 | "; fi\0" \ |
| 55 | "usbupd=echo Booting update from usb ...; " \ |
| 56 | "setenv bootargs; " \ |
| 57 | "run updargs; " \ |
Lukasz Majewski | 530a456 | 2019-05-08 16:26:22 +0200 | [diff] [blame] | 58 | "run addinitrd; " \ |
| 59 | "run addswupdate; " \ |
Lukasz Majewski | 5805a8d | 2019-05-08 16:26:23 +0200 | [diff] [blame] | 60 | "run addkeys; " \ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 61 | "run loadusb; " \ |
| 62 | "bootm ${loadaddr}#${fit_config}\0" \ |
| 63 | BOOTENV |
| 64 | |
| 65 | #define CONFIG_BOOTCOMMAND "run usbupd; run distro_bootcmd" |
| 66 | |
| 67 | #define BOOT_TARGET_DEVICES(func) \ |
| 68 | func(MMC, mmc, 0) \ |
| 69 | func(DHCP, dhcp, na) |
| 70 | |
| 71 | #include <config_distro_bootcmd.h> |
| 72 | |
| 73 | #define CONFIG_ARP_TIMEOUT 200UL |
| 74 | |
| 75 | /* Miscellaneous configurable options */ |
| 76 | #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */ |
| 77 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 78 | |
| 79 | /* Physical Memory Map */ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 80 | #define PHYS_SDRAM_1 CSD0_BASE_ADDR |
| 81 | #define PHYS_SDRAM_1_SIZE (512 * SZ_1M) |
| 82 | #define PHYS_SDRAM_SIZE (PHYS_SDRAM_1_SIZE) |
| 83 | |
| 84 | #define CONFIG_SYS_SDRAM_BASE (PHYS_SDRAM_1) |
| 85 | #define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR) |
| 86 | #define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE) |
| 87 | |
| 88 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 89 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 90 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 91 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 92 | |
| 93 | /* environment organization */ |
Lukasz Majewski | 7515a6f | 2018-04-26 15:07:18 +0200 | [diff] [blame] | 94 | |
| 95 | #endif /* __CONFIG_H_ */ |