Merge tag 'mips-pull-2020-06-29' of https://gitlab.denx.de/u-boot/custodians/u-boot...
[platform/kernel/u-boot.git] / include / configs / s32v234evb.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2015-2016 Freescale Semiconductor, Inc.
4  *
5  * Configuration settings for the Freescale S32V234 EVB board.
6  */
7
8 #ifndef __CONFIG_H
9 #define __CONFIG_H
10
11 #include <asm/arch/imx-regs.h>
12
13 #define CONFIG_S32V234
14
15 /* Config GIC */
16 #define CONFIG_GICV2
17 #define GICD_BASE 0x7D001000
18 #define GICC_BASE 0x7D002000
19
20 #define CONFIG_REMAKE_ELF
21 #undef CONFIG_RUN_FROM_IRAM_ONLY
22
23 #define CONFIG_RUN_FROM_DDR1
24 #undef CONFIG_RUN_FROM_DDR0
25
26 /* Run by default from DDR1  */
27 #ifdef CONFIG_RUN_FROM_DDR0
28 #define DDR_BASE_ADDR           0x80000000
29 #else
30 #define DDR_BASE_ADDR           0xC0000000
31 #endif
32
33 #define CONFIG_MACH_TYPE                4146
34
35 #define CONFIG_SKIP_LOWLEVEL_INIT
36
37 /* Config CACHE */
38
39 #define CONFIG_SYS_FULL_VA
40
41 /* Enable passing of ATAGs */
42 #define CONFIG_CMDLINE_TAG
43
44 /* SMP Spin Table Definitions */
45 #define CPU_RELEASE_ADDR                (CONFIG_SYS_SDRAM_BASE + 0x7fff0)
46
47 /* Generic Timer Definitions */
48 #define COUNTER_FREQUENCY               (1000000000)    /* 1000MHz */
49 #define CONFIG_SYS_FSL_ERRATUM_A008585
50
51 /* Size of malloc() pool */
52 #ifdef CONFIG_RUN_FROM_IRAM_ONLY
53 #define CONFIG_SYS_MALLOC_LEN           (CONFIG_ENV_SIZE + 1 * 1024 * 1024)
54 #else
55 #define CONFIG_SYS_MALLOC_LEN           (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
56 #endif
57
58 #define LINFLEXUART_BASE                LINFLEXD0_BASE_ADDR
59
60 #define CONFIG_DEBUG_UART_LINFLEXUART
61 #define CONFIG_DEBUG_UART_BASE          LINFLEXUART_BASE
62
63 /* Allow to overwrite serial and ethaddr */
64 #define CONFIG_ENV_OVERWRITE
65 #define CONFIG_SYS_UART_PORT            (1)
66
67 #define CONFIG_SYS_FSL_ESDHC_ADDR       USDHC_BASE_ADDR
68 #define CONFIG_SYS_FSL_ESDHC_NUM        1
69
70 #if 0
71
72 /* Ethernet config */
73 #define CONFIG_FEC_MXC
74 #define IMX_FEC_BASE            ENET_BASE_ADDR
75 #define CONFIG_FEC_XCV_TYPE     RMII
76 #define CONFIG_FEC_MXC_PHYADDR  0
77 #endif
78
79 #if 0                           /* Disable until the FLASH will be implemented */
80 #define CONFIG_SYS_USE_NAND
81 #endif
82
83 #ifdef CONFIG_SYS_USE_NAND
84 /* Nand Flash Configs */
85 #define CONFIG_JFFS2_NAND
86 #define MTD_NAND_FSL_NFC_SWECC 1
87 #define CONFIG_NAND_FSL_NFC
88 #define CONFIG_SYS_NAND_BASE            0x400E0000
89 #define CONFIG_SYS_MAX_NAND_DEVICE      1
90 #define NAND_MAX_CHIPS                  CONFIG_SYS_MAX_NAND_DEVICE
91 #define CONFIG_SYS_NAND_SELECT_DEVICE
92 #define CONFIG_SYS_64BIT_VSPRINTF       /* needed for nand_util.c */
93 #endif
94
95 #define CONFIG_LOADADDR                 0xC307FFC0
96
97 #define CONFIG_EXTRA_ENV_SETTINGS \
98         "boot_scripts=boot.scr.uimg boot.scr\0" \
99         "scriptaddr=" __stringify(CONFIG_LOADADDR) "\0" \
100         "console=ttyLF0,115200\0" \
101         "fdt_file=s32v234-evb.dtb\0" \
102         "fdt_high=0xffffffff\0" \
103         "initrd_high=0xffffffff\0" \
104         "fdt_addr_r=0xC2000000\0" \
105         "kernel_addr_r=0xC307FFC0\0" \
106         "ramdisk_addr_r=0xC4000000\0" \
107         "ramdisk=rootfs.uimg\0"\
108         "ip_dyn=yes\0" \
109         "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
110         "update_sd_firmware_filename=u-boot.imx\0" \
111         "update_sd_firmware=" \
112                 "if test ${ip_dyn} = yes; then " \
113                         "setenv get_cmd dhcp; " \
114                 "else " \
115                         "setenv get_cmd tftp; " \
116                 "fi; " \
117                 "if mmc dev ${mmcdev}; then "   \
118                         "if ${get_cmd} ${update_sd_firmware_filename}; then " \
119                                 "setexpr fw_sz ${filesize} / 0x200; " \
120                                 "setexpr fw_sz ${fw_sz} + 1; "  \
121                                 "mmc write ${loadaddr} 0x2 ${fw_sz}; " \
122                         "fi; "  \
123                 "fi\0" \
124         "loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdisk_addr} ${ramdisk}\0" \
125         "jtagboot=echo Booting using jtag...; " \
126                 "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
127         "jtagsdboot=echo Booting loading Linux with ramdisk from SD...; " \
128                 "run loaduimage; run loadramdisk; run loadfdt;"\
129                 "bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0" \
130         "boot_net_usb_start=true\0" \
131         BOOTENV
132
133 #define BOOT_TARGET_DEVICES(func) \
134         func(MMC, mmc, 1) \
135         func(MMC, mmc, 0) \
136         func(DHCP, dhcp, na)
137
138 #define CONFIG_BOOTCOMMAND \
139         "run distro_bootcmd"
140
141 #include <config_distro_bootcmd.h>
142 #include <linux/stringify.h>
143
144 /* Miscellaneous configurable options */
145 #define CONFIG_SYS_PROMPT               "=> "
146
147 #define CONFIG_SYS_LOAD_ADDR            CONFIG_LOADADDR
148 #define CONFIG_SYS_HZ                           1000
149
150 #ifdef CONFIG_RUN_FROM_IRAM_ONLY
151 #define CONFIG_SYS_MALLOC_BASE          (DDR_BASE_ADDR)
152 #endif
153
154 /* Physical memory map */
155 /* EVB board has 2x256 MB DDR chips, DDR0 and DDR1, u-boot is using just one */
156 #define PHYS_SDRAM                      (DDR_BASE_ADDR)
157 #define PHYS_SDRAM_SIZE                 (256 * 1024 * 1024)
158
159 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM
160 #define CONFIG_SYS_INIT_RAM_ADDR        IRAM_BASE_ADDR
161 #define CONFIG_SYS_INIT_RAM_SIZE        IRAM_SIZE
162
163 #define CONFIG_SYS_INIT_SP_OFFSET \
164         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
165 #define CONFIG_SYS_INIT_SP_ADDR \
166         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
167
168 /* environment organization */
169
170 #define CONFIG_SYS_MMC_ENV_DEV          0
171
172
173 #define CONFIG_BOOTP_BOOTFILESIZE
174
175 #endif