Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2016 Freescale Semiconductor, Inc. |
| 4 | * |
| 5 | * Configuration settings for the Freescale i.MX7ULP EVK board. |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __MX7ULP_EVK_CONFIG_H |
| 9 | #define __MX7ULP_EVK_CONFIG_H |
| 10 | |
| 11 | #include <linux/sizes.h> |
| 12 | #include <asm/arch/imx-regs.h> |
| 13 | |
| 14 | /*Uncomment it to use secure boot*/ |
| 15 | /*#define CONFIG_SECURE_BOOT*/ |
| 16 | |
| 17 | #ifdef CONFIG_SECURE_BOOT |
| 18 | #ifndef CONFIG_CSF_SIZE |
| 19 | #define CONFIG_CSF_SIZE 0x4000 |
| 20 | #endif |
| 21 | #endif |
| 22 | |
| 23 | #define CONFIG_BOARD_POSTCLK_INIT |
| 24 | #define CONFIG_SYS_BOOTM_LEN 0x1000000 |
| 25 | |
| 26 | #define SRC_BASE_ADDR CMC1_RBASE |
| 27 | #define IRAM_BASE_ADDR OCRAM_0_BASE |
| 28 | #define IOMUXC_BASE_ADDR IOMUXC1_RBASE |
| 29 | |
Peng Fan | 04cb0d3 | 2017-02-22 16:21:57 +0800 | [diff] [blame] | 30 | #define CONFIG_FSL_USDHC |
Peng Fan | 04cb0d3 | 2017-02-22 16:21:57 +0800 | [diff] [blame] | 31 | |
| 32 | #define CONFIG_SYS_FSL_USDHC_NUM 1 |
| 33 | |
| 34 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
| 35 | #define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC1 */ |
| 36 | #define CONFIG_SYS_MMC_ENV_PART 0 /* user area */ |
| 37 | #define CONFIG_MMCROOT "/dev/mmcblk0p2" /* USDHC1 */ |
| 38 | #define CONFIG_SYS_MMC_IMG_LOAD_PART 1 |
| 39 | |
| 40 | #define CONFIG_ENV_OFFSET (12 * SZ_64K) |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 41 | #define CONFIG_ENV_SIZE SZ_8K |
| 42 | |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 43 | /* Using ULP WDOG for reset */ |
| 44 | #define WDOG_BASE_ADDR WDG1_RBASE |
| 45 | |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 46 | #define CONFIG_SYS_HZ_CLOCK 1000000 /* Fixed at 1Mhz from TSTMR */ |
| 47 | |
| 48 | #define CONFIG_INITRD_TAG |
| 49 | #define CONFIG_CMDLINE_TAG |
| 50 | #define CONFIG_SETUP_MEMORY_TAGS |
| 51 | /*#define CONFIG_REVISION_TAG*/ |
| 52 | |
| 53 | /* Size of malloc() pool */ |
| 54 | #define CONFIG_SYS_MALLOC_LEN (8 * SZ_1M) |
| 55 | |
| 56 | #define CONFIG_BOARD_EARLY_INIT_F |
| 57 | |
| 58 | /* UART */ |
| 59 | #define LPUART_BASE LPUART4_RBASE |
| 60 | |
| 61 | /* allow to overwrite serial and ethaddr */ |
| 62 | #define CONFIG_ENV_OVERWRITE |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 63 | #define CONFIG_BAUDRATE 115200 |
| 64 | |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 65 | #define CONFIG_SYS_CACHELINE_SIZE 64 |
| 66 | |
| 67 | /* Miscellaneous configurable options */ |
| 68 | #define CONFIG_SYS_PROMPT "=> " |
| 69 | #define CONFIG_SYS_CBSIZE 512 |
| 70 | |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 71 | #define CONFIG_SYS_MAXARGS 256 |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 72 | |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 73 | /* Physical Memory Map */ |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 74 | |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 75 | #define PHYS_SDRAM 0x60000000 |
| 76 | #define PHYS_SDRAM_SIZE SZ_1G |
| 77 | #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM |
| 78 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 79 | |
| 80 | #define CONFIG_LOADADDR 0x60800000 |
| 81 | |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 82 | #define CONFIG_SYS_MEMTEST_END 0x9E000000 |
| 83 | |
Peng Fan | 04cb0d3 | 2017-02-22 16:21:57 +0800 | [diff] [blame] | 84 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 85 | "script=boot.scr\0" \ |
| 86 | "image=zImage\0" \ |
| 87 | "console=ttyLP0\0" \ |
| 88 | "fdt_high=0xffffffff\0" \ |
| 89 | "initrd_high=0xffffffff\0" \ |
| 90 | "fdt_file=imx7ulp-evk.dtb\0" \ |
| 91 | "fdt_addr=0x63000000\0" \ |
| 92 | "boot_fdt=try\0" \ |
| 93 | "earlycon=lpuart32,0x402D0010\0" \ |
| 94 | "ip_dyn=yes\0" \ |
| 95 | "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ |
| 96 | "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ |
| 97 | "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ |
| 98 | "mmcautodetect=yes\0" \ |
| 99 | "mmcargs=setenv bootargs console=${console},${baudrate} " \ |
| 100 | "root=${mmcroot}\0" \ |
| 101 | "loadbootscript=" \ |
| 102 | "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ |
| 103 | "bootscript=echo Running bootscript from mmc ...; " \ |
| 104 | "source\0" \ |
| 105 | "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ |
| 106 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ |
| 107 | "mmcboot=echo Booting from mmc ...; " \ |
| 108 | "run mmcargs; " \ |
| 109 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 110 | "if run loadfdt; then " \ |
| 111 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
| 112 | "else " \ |
| 113 | "if test ${boot_fdt} = try; then " \ |
| 114 | "bootz; " \ |
| 115 | "else " \ |
| 116 | "echo WARN: Cannot load the DT; " \ |
| 117 | "fi; " \ |
| 118 | "fi; " \ |
| 119 | "else " \ |
| 120 | "bootz; " \ |
| 121 | "fi;\0" \ |
| 122 | "netargs=setenv bootargs console=${console},${baudrate} " \ |
| 123 | "root=/dev/nfs " \ |
| 124 | "ip=:::::eth0:dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 125 | "netboot=echo Booting from net ...; " \ |
| 126 | "run netargs; " \ |
| 127 | "if test ${ip_dyn} = yes; then " \ |
| 128 | "setenv get_cmd dhcp; " \ |
| 129 | "else " \ |
| 130 | "setenv get_cmd tftp; " \ |
| 131 | "fi; " \ |
| 132 | "usb start; "\ |
| 133 | "${get_cmd} ${image}; " \ |
| 134 | "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ |
| 135 | "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ |
| 136 | "bootz ${loadaddr} - ${fdt_addr}; " \ |
| 137 | "else " \ |
| 138 | "if test ${boot_fdt} = try; then " \ |
| 139 | "bootz; " \ |
| 140 | "else " \ |
| 141 | "echo WARN: Cannot load the DT; " \ |
| 142 | "fi; " \ |
| 143 | "fi; " \ |
| 144 | "else " \ |
| 145 | "bootz; " \ |
| 146 | "fi;\0" \ |
| 147 | |
| 148 | #define CONFIG_BOOTCOMMAND \ |
| 149 | "mmc dev ${mmcdev}; if mmc rescan; then " \ |
| 150 | "if run loadbootscript; then " \ |
| 151 | "run bootscript; " \ |
| 152 | "else " \ |
| 153 | "if run loadimage; then " \ |
| 154 | "run mmcboot; " \ |
| 155 | "fi; " \ |
| 156 | "fi; " \ |
| 157 | "fi" |
| 158 | |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 159 | #define CONFIG_SYS_HZ 1000 |
| 160 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 161 | |
| 162 | #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR |
| 163 | #define CONFIG_SYS_INIT_RAM_SIZE SZ_256K |
| 164 | |
| 165 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 166 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 167 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 168 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 169 | |
Trevor Woerner | 1001502 | 2019-05-03 09:41:00 -0400 | [diff] [blame] | 170 | #if !CONFIG_IS_ENABLED(SYS_DCACHE_OFF) |
Peng Fan | 77fa045 | 2017-02-22 16:21:56 +0800 | [diff] [blame] | 171 | #define CONFIG_CMD_CACHE |
| 172 | #endif |
| 173 | |
| 174 | #endif /* __CONFIG_H */ |