1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * Copyright 2018 NXP 4 */ 5 6 #ifndef __IMX8QXP_MEK_H 7 #define __IMX8QXP_MEK_H 8 9 #include <linux/sizes.h> 10 #include <linux/stringify.h> 11 #include <asm/arch/imx-regs.h> 12 13 #ifdef CONFIG_SPL_BUILD 14 #define CONFIG_SPL_MAX_SIZE (124 * 1024) 15 #define CONFIG_SYS_MONITOR_LEN (1024 * 1024) 16 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR 17 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x800 18 19 #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds" 20 #define CONFIG_SPL_STACK 0x013E000 21 #define CONFIG_SPL_BSS_START_ADDR 0x00128000 22 #define CONFIG_SPL_BSS_MAX_SIZE 0x1000 /* 4 KB */ 23 #define CONFIG_SYS_SPL_MALLOC_START 0x00120000 24 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x3000 /* 12 KB */ 25 #define CONFIG_SERIAL_LPUART_BASE 0x5a060000 26 #define CONFIG_MALLOC_F_ADDR 0x00120000 27 28 #define CONFIG_SPL_RAW_IMAGE_ARM_TRUSTED_FIRMWARE 29 30 #define CONFIG_SPL_ABORT_ON_RAW_IMAGE 31 32 #define CONFIG_OF_EMBED 33 #endif 34 35 #define CONFIG_REMAKE_ELF 36 37 /* Flat Device Tree Definitions */ 38 #define CONFIG_OF_BOARD_SETUP 39 40 #define CONFIG_SYS_FSL_ESDHC_ADDR 0 41 #define USDHC1_BASE_ADDR 0x5B010000 42 #define USDHC2_BASE_ADDR 0x5B020000 43 44 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG 45 46 #ifdef CONFIG_AHAB_BOOT 47 #define AHAB_ENV "sec_boot=yes\0" 48 #else 49 #define AHAB_ENV "sec_boot=no\0" 50 #endif 51 52 /* Initial environment variables */ 53 #define CONFIG_EXTRA_ENV_SETTINGS \ 54 AHAB_ENV \ 55 "script=boot.scr\0" \ 56 "image=Image\0" \ 57 "panel=NULL\0" \ 58 "console=ttyLP0\0" \ 59 "fdt_addr=0x83000000\0" \ 60 "fdt_high=0xffffffffffffffff\0" \ 61 "boot_fdt=try\0" \ 62 "fdt_file=undefined\0" \ 63 "initrd_addr=0x83800000\0" \ 64 "initrd_high=0xffffffffffffffff\0" \ 65 "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ 66 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \ 67 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \ 68 "mmcautodetect=yes\0" \ 69 "mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot}\0 " \ 70 "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ 71 "bootscript=echo Running bootscript from mmc ...; " \ 72 "source\0" \ 73 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ 74 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ 75 "loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}\0" \ 76 "auth_os=auth_cntr ${cntr_addr}\0" \ 77 "boot_os=booti ${loadaddr} - ${fdt_addr};\0" \ 78 "mmcboot=echo Booting from mmc ...; " \ 79 "run mmcargs; " \ 80 "if test ${sec_boot} = yes; then " \ 81 "if run auth_os; then " \ 82 "run boot_os; " \ 83 "else " \ 84 "echo ERR: failed to authenticate; " \ 85 "fi; " \ 86 "else " \ 87 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ 88 "if run loadfdt; then " \ 89 "run boot_os; " \ 90 "else " \ 91 "echo WARN: Cannot load the DT; " \ 92 "fi; " \ 93 "else " \ 94 "echo wait for boot; " \ 95 "fi;" \ 96 "fi;\0" \ 97 "netargs=setenv bootargs console=${console},${baudrate} " \ 98 "root=/dev/nfs " \ 99 "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ 100 "netboot=echo Booting from net ...; " \ 101 "run netargs; " \ 102 "if test ${ip_dyn} = yes; then " \ 103 "setenv get_cmd dhcp; " \ 104 "else " \ 105 "setenv get_cmd tftp; " \ 106 "fi; " \ 107 "if test ${sec_boot} = yes; then " \ 108 "${get_cmd} ${cntr_addr} ${cntr_file}; " \ 109 "if run auth_os; then " \ 110 "run boot_os; " \ 111 "else " \ 112 "echo ERR: failed to authenticate; " \ 113 "fi; " \ 114 "else " \ 115 "${get_cmd} ${loadaddr} ${image}; " \ 116 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \ 117 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ 118 "run boot_os; " \ 119 "else " \ 120 "echo WARN: Cannot load the DT; " \ 121 "fi; " \ 122 "else " \ 123 "booti; " \ 124 "fi;" \ 125 "fi;\0" 126 127 #define CONFIG_BOOTCOMMAND \ 128 "mmc dev ${mmcdev}; if mmc rescan; then " \ 129 "if run loadbootscript; then " \ 130 "run bootscript; " \ 131 "else " \ 132 "if test ${sec_boot} = yes; then " \ 133 "if run loadcntr; then " \ 134 "run mmcboot; " \ 135 "else run netboot; " \ 136 "fi; " \ 137 "else " \ 138 "if run loadimage; then " \ 139 "run mmcboot; " \ 140 "else run netboot; " \ 141 "fi; " \ 142 "fi; " \ 143 "fi; " \ 144 "else booti ${loadaddr} - ${fdt_addr}; fi" 145 146 /* Link Definitions */ 147 #define CONFIG_LOADADDR 0x80280000 148 149 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR 150 151 #define CONFIG_SYS_INIT_SP_ADDR 0x80200000 152 153 /* Default environment is in SD */ 154 155 #define CONFIG_SYS_MMC_IMG_LOAD_PART 1 156 157 /* On LPDDR4 board, USDHC1 is for eMMC, USDHC2 is for SD on CPU board */ 158 #define CONFIG_MMCROOT "/dev/mmcblk1p2" /* USDHC2 */ 159 #define CONFIG_SYS_FSL_USDHC_NUM 2 160 161 /* Size of malloc() pool */ 162 #define CONFIG_SYS_MALLOC_LEN ((CONFIG_ENV_SIZE + (32 * 1024)) * 1024) 163 164 #define CONFIG_SYS_SDRAM_BASE 0x80000000 165 #define PHYS_SDRAM_1 0x80000000 166 #define PHYS_SDRAM_2 0x880000000 167 #define PHYS_SDRAM_1_SIZE 0x80000000 /* 2 GB */ 168 /* LPDDR4 board total DDR is 3GB */ 169 #define PHYS_SDRAM_2_SIZE 0x40000000 /* 1 GB */ 170 171 /* Generic Timer Definitions */ 172 #define COUNTER_FREQUENCY 8000000 /* 8MHz */ 173 174 #ifndef CONFIG_DM_PCA953X 175 #define CONFIG_PCA953X 176 #endif 177 178 /* Networking */ 179 #define CONFIG_FEC_XCV_TYPE RGMII 180 181 /* Misc configuration */ 182 #define CONFIG_SYS_CBSIZE 2048 183 #define CONFIG_SYS_MAXARGS 64 184 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 185 186 #endif /* __IMX8QXP_MEK_H */ 187