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