Anatolij Gustschin | 49234a3 | 2020-01-07 16:37:42 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright 2017-2018 NXP |
| 4 | * Copyright 2019 Siemens AG |
| 5 | */ |
| 6 | |
| 7 | #ifndef __IMX8X_CAPRICORN_H |
| 8 | #define __IMX8X_CAPRICORN_H |
| 9 | |
| 10 | #include <linux/sizes.h> |
| 11 | #include <asm/arch/imx-regs.h> |
| 12 | |
| 13 | #include "siemens-env-common.h" |
| 14 | #include "siemens-ccp-common.h" |
| 15 | |
| 16 | /* SPL config */ |
| 17 | #ifdef CONFIG_SPL_BUILD |
| 18 | |
| 19 | #define CONFIG_SPL_MAX_SIZE (124 * 1024) |
| 20 | #define CONFIG_SYS_MONITOR_LEN (1024 * 1024) |
| 21 | #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR |
| 22 | #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x800 |
| 23 | #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 0 |
| 24 | |
| 25 | #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds" |
| 26 | #define CONFIG_SPL_STACK 0x013E000 |
| 27 | #define CONFIG_SPL_BSS_START_ADDR 0x00128000 |
| 28 | #define CONFIG_SPL_BSS_MAX_SIZE 0x1000 /* 4 KB */ |
| 29 | #define CONFIG_SYS_SPL_MALLOC_START 0x00120000 |
| 30 | #define CONFIG_SYS_SPL_MALLOC_SIZE 0x3000 /* 12 KB */ |
| 31 | #define CONFIG_MALLOC_F_ADDR 0x00120000 |
| 32 | |
| 33 | #define CONFIG_SPL_RAW_IMAGE_ARM_TRUSTED_FIRMWARE |
| 34 | #define CONFIG_SPL_ABORT_ON_RAW_IMAGE |
| 35 | |
| 36 | #endif /* CONFIG_SPL_BUILD */ |
| 37 | |
| 38 | #define CONFIG_FACTORYSET |
| 39 | |
| 40 | #undef CONFIG_IDENT_STRING |
| 41 | #define CONFIG_IDENT_STRING GENERATE_CCP_VERSION("01", "07") |
| 42 | |
| 43 | #define CONFIG_REMAKE_ELF |
| 44 | |
| 45 | #define CONFIG_BOARD_EARLY_INIT_F |
| 46 | |
| 47 | /* Commands */ |
Anatolij Gustschin | 49234a3 | 2020-01-07 16:37:42 +0100 | [diff] [blame] | 48 | |
Anatolij Gustschin | 49234a3 | 2020-01-07 16:37:42 +0100 | [diff] [blame] | 49 | #undef CONFIG_BOOTM_NETBSD |
| 50 | |
| 51 | /* ENET Config */ |
| 52 | #define CONFIG_FEC_XCV_TYPE RMII |
| 53 | #define FEC_QUIRK_ENET_MAC |
| 54 | |
| 55 | /* ENET1 connects to base board and MUX with ESAI */ |
| 56 | #define CONFIG_FEC_ENET_DEV 1 |
| 57 | #define CONFIG_FEC_MXC_PHYADDR 0x0 |
| 58 | #define CONFIG_ETHPRIME "eth1" |
| 59 | |
| 60 | /* I2C Configuration */ |
| 61 | #ifndef CONFIG_SPL_BUILD |
| 62 | #define CONFIG_SYS_I2C_SPEED 400000 |
| 63 | /* EEPROM */ |
| 64 | #define EEPROM_I2C_BUS 0 /* I2C0 */ |
| 65 | #define EEPROM_I2C_ADDR 0x50 |
| 66 | /* PCA9552 */ |
| 67 | #define PCA9552_1_I2C_BUS 1 /* I2C1 */ |
| 68 | #define PCA9552_1_I2C_ADDR 0x60 |
| 69 | #endif /* !CONFIG_SPL_BUILD */ |
| 70 | |
| 71 | /* AHAB */ |
| 72 | #ifdef CONFIG_AHAB_BOOT |
| 73 | #define AHAB_ENV "sec_boot=yes\0" |
| 74 | #else |
| 75 | #define AHAB_ENV "sec_boot=no\0" |
| 76 | #endif |
| 77 | |
| 78 | #define MFG_ENV_SETTINGS_DEFAULT \ |
| 79 | "mfgtool_args=setenv bootargs console=${console},${baudrate} " \ |
| 80 | "rdinit=/linuxrc " \ |
| 81 | "clk_ignore_unused "\ |
| 82 | "\0" \ |
| 83 | "kboot=booti\0"\ |
| 84 | "bootcmd_mfg=run mfgtool_args;" \ |
| 85 | "if iminfo ${initrd_addr}; then " \ |
| 86 | "if test ${tee} = yes; then " \ |
| 87 | "bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; " \ |
| 88 | "else " \ |
| 89 | "booti ${loadaddr} ${initrd_addr} ${fdt_addr}; " \ |
| 90 | "fi; " \ |
| 91 | "else " \ |
| 92 | "echo \"Run fastboot ...\"; fastboot 0; " \ |
| 93 | "fi;\0" |
| 94 | |
| 95 | /* Boot M4 */ |
| 96 | #define M4_BOOT_ENV \ |
| 97 | "m4_0_image=m4_0.bin\0" \ |
| 98 | "loadm4image_0=fatload mmc ${mmcdev}:${mmcpart} " \ |
| 99 | "${loadaddr} ${m4_0_image}\0" \ |
| 100 | "m4boot_0=run loadm4image_0; dcache flush; bootaux ${loadaddr} 0\0" \ |
| 101 | |
| 102 | #define CONFIG_MFG_ENV_SETTINGS \ |
| 103 | MFG_ENV_SETTINGS_DEFAULT \ |
| 104 | "initrd_addr=0x83100000\0" \ |
| 105 | "initrd_high=0xffffffffffffffff\0" \ |
| 106 | "emmc_dev=0\0" |
| 107 | |
| 108 | /* Initial environment variables */ |
| 109 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 110 | CONFIG_MFG_ENV_SETTINGS \ |
| 111 | M4_BOOT_ENV \ |
| 112 | AHAB_ENV \ |
| 113 | ENV_COMMON \ |
| 114 | "script=boot.scr\0" \ |
| 115 | "image=Image\0" \ |
| 116 | "panel=NULL\0" \ |
| 117 | "console=ttyLP2\0" \ |
| 118 | "fdt_addr=0x83000000\0" \ |
| 119 | "fdt_high=0xffffffffffffffff\0" \ |
| 120 | "cntr_addr=0x88000000\0" \ |
| 121 | "cntr_file=os_cntr_signed.bin\0" \ |
| 122 | "initrd_addr=0x83800000\0" \ |
| 123 | "initrd_high=0xffffffffffffffff\0" \ |
| 124 | "netdev=eth0\0" \ |
| 125 | "nfsopts=vers=3,udp,rsize=4096,wsize=4096,nolock rw\0" \ |
| 126 | "hostname=capricorn\0" \ |
| 127 | ENV_EMMC \ |
| 128 | ENV_NET |
| 129 | |
| 130 | #define CONFIG_BOOTCOMMAND \ |
| 131 | "if usrbutton; then " \ |
| 132 | "run flash_self_test; " \ |
| 133 | "reset; " \ |
| 134 | "fi;" \ |
| 135 | "run flash_self;" \ |
| 136 | "reset;" |
| 137 | |
| 138 | /* Default location for tftp and bootm */ |
| 139 | #define CONFIG_LOADADDR 0x80280000 |
| 140 | #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR |
| 141 | #define CONFIG_SYS_INIT_SP_ADDR 0x80200000 |
| 142 | |
| 143 | #define CONFIG_BOOTCOUNT_LIMIT |
| 144 | #define CONFIG_BOOTCOUNT_ENV |
| 145 | |
| 146 | /* Environment organisation */ |
| 147 | #define CONFIG_ENV_OVERWRITE |
| 148 | #define CONFIG_SYS_MMC_ENV_DEV 0 /* USDHC1, eMMC */ |
| 149 | #define CONFIG_SYS_MMC_ENV_PART 2 /* 2nd boot partition */ |
| 150 | |
| 151 | /* On CCP board, USDHC1 is for eMMC */ |
| 152 | #define CONFIG_MMCROOT "/dev/mmcblk0p2" /* eMMC */ |
| 153 | #define CONFIG_SYS_MMC_IMG_LOAD_PART 1 |
| 154 | |
| 155 | /* Size of malloc() pool */ |
| 156 | #define CONFIG_SYS_MALLOC_LEN ((CONFIG_ENV_SIZE + (32 * 1024)) * 1024) |
| 157 | |
| 158 | #define CONFIG_SYS_SDRAM_BASE 0x80000000 |
| 159 | #define PHYS_SDRAM_1 0x80000000 |
| 160 | #define PHYS_SDRAM_2 0x880000000 |
| 161 | /* DDR3 board total DDR is 1 GB */ |
| 162 | #define PHYS_SDRAM_1_SIZE 0x40000000 /* 1 GB */ |
| 163 | #define PHYS_SDRAM_2_SIZE 0x00000000 /* 0 GB */ |
| 164 | |
Anatolij Gustschin | 49234a3 | 2020-01-07 16:37:42 +0100 | [diff] [blame] | 165 | /* Console buffer and boot args */ |
| 166 | #define CONFIG_SYS_CBSIZE 2048 |
| 167 | #define CONFIG_SYS_MAXARGS 64 |
| 168 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 169 | |
| 170 | /* Generic Timer Definitions */ |
| 171 | #define COUNTER_FREQUENCY 8000000 /* 8MHz */ |
| 172 | |
| 173 | #define BOOTAUX_RESERVED_MEM_BASE 0x88000000 |
| 174 | #define BOOTAUX_RESERVED_MEM_SIZE SZ_128M /* Reserve from second 128MB */ |
| 175 | |
| 176 | #endif /* __IMX8X_CAPRICORN_H */ |