blob: fcd5896a97bdabe7343be91583e31a17547c28cf [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
Teresa Remmet30fb74d2021-01-13 16:28:09 +010023#define CONFIG_SPL_STACK 0x960000
24#define CONFIG_SPL_BSS_START_ADDR 0x98FC00
25#define CONFIG_SPL_BSS_MAX_SIZE SZ_1K
26#define CONFIG_SYS_SPL_MALLOC_START 0x42200000
27#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K
28
29#define CONFIG_SPL_ABORT_ON_RAW_IMAGE
30
Teresa Remmet30fb74d2021-01-13 16:28:09 +010031#define CONFIG_POWER_PCA9450
32
Teresa Remmet30fb74d2021-01-13 16:28:09 +010033#endif
34
35#define CONFIG_EXTRA_ENV_SETTINGS \
36 "image=Image\0" \
Teresa Remmet5fc6abf2021-07-07 12:57:59 +000037 "console=ttymxc0,115200\0" \
Teresa Remmet30fb74d2021-01-13 16:28:09 +010038 "fdt_addr=0x48000000\0" \
39 "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
Teresa Remmet7de60a62021-07-07 12:58:00 +000040 "ip_dyn=yes\0" \
Teresa Remmet30fb74d2021-01-13 16:28:09 +010041 "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
42 "mmcpart=" __stringify(CONFIG_SYS_MMC_IMG_LOAD_PART) "\0" \
43 "mmcroot=2\0" \
44 "mmcautodetect=yes\0" \
45 "mmcargs=setenv bootargs console=${console} " \
46 "root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \
47 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
48 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
49 "mmcboot=echo Booting from mmc ...; " \
50 "run mmcargs; " \
51 "if run loadfdt; then " \
52 "booti ${loadaddr} - ${fdt_addr}; " \
53 "else " \
54 "echo WARN: Cannot load the DT; " \
55 "fi;\0 " \
Teresa Remmet7de60a62021-07-07 12:58:00 +000056 "nfsroot=/nfs\0" \
57 "netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp " \
58 "nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
59 "netboot=echo Booting from net ...; " \
60 "run netargs; " \
61 "if test ${ip_dyn} = yes; then " \
62 "setenv get_cmd dhcp; " \
63 "else " \
64 "setenv get_cmd tftp; " \
65 "fi; " \
66 "${get_cmd} ${loadaddr} ${image}; " \
67 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
68 "booti ${loadaddr} - ${fdt_addr}; " \
69 "else " \
70 "echo WARN: Cannot load the DT; " \
71 "fi;\0" \
Teresa Remmet30fb74d2021-01-13 16:28:09 +010072
73#define CONFIG_BOOTCOMMAND \
74 "mmc dev ${mmcdev}; if mmc rescan; then " \
75 "if run loadimage; then " \
76 "run mmcboot; " \
77 "else run netboot; " \
78 "fi; " \
79 "fi;"
80
81/* Link Definitions */
Teresa Remmet30fb74d2021-01-13 16:28:09 +010082
83#define CONFIG_SYS_INIT_RAM_ADDR 0x40000000
84#define CONFIG_SYS_INIT_RAM_SIZE SZ_512K
85#define CONFIG_SYS_INIT_SP_OFFSET \
86 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
87#define CONFIG_SYS_INIT_SP_ADDR \
88 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
89
90#define CONFIG_MMCROOT "/dev/mmcblk2p2" /* USDHC3 */
91
Teresa Remmet30fb74d2021-01-13 16:28:09 +010092#define CONFIG_SYS_SDRAM_BASE 0x40000000
93
94#define PHYS_SDRAM 0x40000000
95#define PHYS_SDRAM_SIZE 0x80000000
96
97/* UART */
Teresa Remmet5fc6abf2021-07-07 12:57:59 +000098#define CONFIG_MXC_UART_BASE UART1_BASE_ADDR
Teresa Remmet30fb74d2021-01-13 16:28:09 +010099
100/* Monitor Command Prompt */
101#define CONFIG_SYS_CBSIZE SZ_2K
102#define CONFIG_SYS_MAXARGS 64
103#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
104
105/* USDHC */
Teresa Remmet30fb74d2021-01-13 16:28:09 +0100106#define CONFIG_SYS_FSL_USDHC_NUM 2
107#define CONFIG_SYS_FSL_ESDHC_ADDR 0
108#define CONFIG_SYS_MMC_IMG_LOAD_PART 1
109
Teresa Remmet30fb74d2021-01-13 16:28:09 +0100110#endif /* __PHYCORE_IMX8MP_H */