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