blob: 874c94e01f917582f67e4bf94a242f2d8808b97d [file] [log] [blame]
Teresa Remmet30fb74d2021-01-13 16:28:09 +01001/* SPDX-License-Identifier: GPL-2.0-or-later
2 *
3 * Copyright (C) 2020 PHYTEC Messtechnik GmbH
4 * Author: Teresa Remmet <t.remmet@phytec.de>
5 */
6
7#ifndef __PHYCORE_IMX8MP_H
8#define __PHYCORE_IMX8MP_H
9
10#include <linux/sizes.h>
11#include <asm/arch/imx-regs.h>
12
13#define CONFIG_SYS_BOOTM_LEN SZ_64M
14
15#define CONFIG_SPL_MAX_SIZE (152 * SZ_1K)
16#define CONFIG_SYS_MONITOR_LEN SZ_512K
17#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
18#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300
19#define CONFIG_SYS_UBOOT_BASE \
20 (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
21
22#ifdef CONFIG_SPL_BUILD
23#define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds"
24#define CONFIG_SPL_STACK 0x960000
25#define CONFIG_SPL_BSS_START_ADDR 0x98FC00
26#define CONFIG_SPL_BSS_MAX_SIZE SZ_1K
27#define CONFIG_SYS_SPL_MALLOC_START 0x42200000
28#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K
29
30#define CONFIG_SPL_ABORT_ON_RAW_IMAGE
31
Teresa Remmet30fb74d2021-01-13 16:28:09 +010032#define CONFIG_POWER_PCA9450
33
Teresa Remmet30fb74d2021-01-13 16:28:09 +010034#endif
35
36#define CONFIG_EXTRA_ENV_SETTINGS \
37 "image=Image\0" \
Teresa Remmet5fc6abf2021-07-07 12:57:59 +000038 "console=ttymxc0,115200\0" \
Teresa Remmet30fb74d2021-01-13 16:28:09 +010039 "fdt_addr=0x48000000\0" \
40 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
Teresa Remmet7de60a62021-07-07 12:58:00 +000041 "ip_dyn=yes\0" \
Teresa Remmet30fb74d2021-01-13 16:28:09 +010042 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
43 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
44 "mmcroot=2\0" \
45 "mmcautodetect=yes\0" \
46 "mmcargs=setenv bootargs console=${console} " \
47 "root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \
48 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
49 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
50 "mmcboot=echo Booting from mmc ...; " \
51 "run mmcargs; " \
52 "if run loadfdt; then " \
53 "booti ${loadaddr} - ${fdt_addr}; " \
54 "else " \
55 "echo WARN: Cannot load the DT; " \
56 "fi;\0 " \
Teresa Remmet7de60a62021-07-07 12:58:00 +000057 "nfsroot=/nfs\0" \
58 "netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp " \
59 "nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
60 "netboot=echo Booting from net ...; " \
61 "run netargs; " \
62 "if test ${ip_dyn} = yes; then " \
63 "setenv get_cmd dhcp; " \
64 "else " \
65 "setenv get_cmd tftp; " \
66 "fi; " \
67 "${get_cmd} ${loadaddr} ${image}; " \
68 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
69 "booti ${loadaddr} - ${fdt_addr}; " \
70 "else " \
71 "echo WARN: Cannot load the DT; " \
72 "fi;\0" \
Teresa Remmet30fb74d2021-01-13 16:28:09 +010073
74#define CONFIG_BOOTCOMMAND \
75 "mmc dev ${mmcdev}; if mmc rescan; then " \
76 "if run loadimage; then " \
77 "run mmcboot; " \
78 "else run netboot; " \
79 "fi; " \
80 "fi;"
81
82/* Link Definitions */
Teresa Remmet30fb74d2021-01-13 16:28:09 +010083
84#define CONFIG_SYS_INIT_RAM_ADDR 0x40000000
85#define CONFIG_SYS_INIT_RAM_SIZE SZ_512K
86#define CONFIG_SYS_INIT_SP_OFFSET \
87 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
88#define CONFIG_SYS_INIT_SP_ADDR \
89 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
90
91#define CONFIG_MMCROOT "/dev/mmcblk2p2" /* USDHC3 */
92
Teresa Remmet30fb74d2021-01-13 16:28:09 +010093#define CONFIG_SYS_SDRAM_BASE 0x40000000
94
95#define PHYS_SDRAM 0x40000000
96#define PHYS_SDRAM_SIZE 0x80000000
97
98/* UART */
Teresa Remmet5fc6abf2021-07-07 12:57:59 +000099#define CONFIG_MXC_UART_BASE UART1_BASE_ADDR
Teresa Remmet30fb74d2021-01-13 16:28:09 +0100100
101/* Monitor Command Prompt */
102#define CONFIG_SYS_CBSIZE SZ_2K
103#define CONFIG_SYS_MAXARGS 64
104#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
105
106/* USDHC */
107#define CONFIG_FSL_USDHC
108#define CONFIG_SYS_FSL_USDHC_NUM 2
109#define CONFIG_SYS_FSL_ESDHC_ADDR 0
110#define CONFIG_SYS_MMC_IMG_LOAD_PART 1
111
Teresa Remmet30fb74d2021-01-13 16:28:09 +0100112#endif /* __PHYCORE_IMX8MP_H */