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