Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 1 | /* 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 |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 17 | #define CONFIG_SYS_UBOOT_BASE \ |
| 18 | (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) |
| 19 | |
| 20 | #ifdef CONFIG_SPL_BUILD |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 21 | #define CONFIG_SPL_STACK 0x960000 |
| 22 | #define CONFIG_SPL_BSS_START_ADDR 0x98FC00 |
| 23 | #define CONFIG_SPL_BSS_MAX_SIZE SZ_1K |
| 24 | #define CONFIG_SYS_SPL_MALLOC_START 0x42200000 |
| 25 | #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_512K |
| 26 | |
| 27 | #define CONFIG_SPL_ABORT_ON_RAW_IMAGE |
| 28 | |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 29 | #define CONFIG_POWER_PCA9450 |
| 30 | |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 31 | #endif |
| 32 | |
| 33 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 34 | "image=Image\0" \ |
Teresa Remmet | 5fc6abf | 2021-07-07 12:57:59 +0000 | [diff] [blame] | 35 | "console=ttymxc0,115200\0" \ |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 36 | "fdt_addr=0x48000000\0" \ |
| 37 | "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \ |
Teresa Remmet | 7de60a6 | 2021-07-07 12:58:00 +0000 | [diff] [blame] | 38 | "ip_dyn=yes\0" \ |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 39 | "mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \ |
Tom Rini | b113bca | 2021-12-11 14:55:52 -0500 | [diff] [blame] | 40 | "mmcpart=1\0" \ |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 41 | "mmcroot=2\0" \ |
| 42 | "mmcautodetect=yes\0" \ |
| 43 | "mmcargs=setenv bootargs console=${console} " \ |
| 44 | "root=/dev/mmcblk${mmcdev}p${mmcroot} rootwait rw\0" \ |
| 45 | "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \ |
| 46 | "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \ |
| 47 | "mmcboot=echo Booting from mmc ...; " \ |
| 48 | "run mmcargs; " \ |
| 49 | "if run loadfdt; then " \ |
| 50 | "booti ${loadaddr} - ${fdt_addr}; " \ |
| 51 | "else " \ |
| 52 | "echo WARN: Cannot load the DT; " \ |
| 53 | "fi;\0 " \ |
Teresa Remmet | 7de60a6 | 2021-07-07 12:58:00 +0000 | [diff] [blame] | 54 | "nfsroot=/nfs\0" \ |
| 55 | "netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp " \ |
| 56 | "nfsroot=${serverip}:${nfsroot},v3,tcp\0" \ |
| 57 | "netboot=echo Booting from net ...; " \ |
| 58 | "run netargs; " \ |
| 59 | "if test ${ip_dyn} = yes; then " \ |
| 60 | "setenv get_cmd dhcp; " \ |
| 61 | "else " \ |
| 62 | "setenv get_cmd tftp; " \ |
| 63 | "fi; " \ |
| 64 | "${get_cmd} ${loadaddr} ${image}; " \ |
| 65 | "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \ |
| 66 | "booti ${loadaddr} - ${fdt_addr}; " \ |
| 67 | "else " \ |
| 68 | "echo WARN: Cannot load the DT; " \ |
| 69 | "fi;\0" \ |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 70 | |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 71 | /* Link Definitions */ |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 72 | |
| 73 | #define CONFIG_SYS_INIT_RAM_ADDR 0x40000000 |
| 74 | #define CONFIG_SYS_INIT_RAM_SIZE SZ_512K |
| 75 | #define CONFIG_SYS_INIT_SP_OFFSET \ |
| 76 | (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE) |
| 77 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 78 | (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET) |
| 79 | |
| 80 | #define CONFIG_MMCROOT "/dev/mmcblk2p2" /* USDHC3 */ |
| 81 | |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 82 | #define CONFIG_SYS_SDRAM_BASE 0x40000000 |
| 83 | |
| 84 | #define PHYS_SDRAM 0x40000000 |
| 85 | #define PHYS_SDRAM_SIZE 0x80000000 |
| 86 | |
| 87 | /* UART */ |
Teresa Remmet | 5fc6abf | 2021-07-07 12:57:59 +0000 | [diff] [blame] | 88 | #define CONFIG_MXC_UART_BASE UART1_BASE_ADDR |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 89 | |
| 90 | /* Monitor Command Prompt */ |
| 91 | #define CONFIG_SYS_CBSIZE SZ_2K |
| 92 | #define CONFIG_SYS_MAXARGS 64 |
| 93 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 94 | |
| 95 | /* USDHC */ |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 96 | #define CONFIG_SYS_FSL_USDHC_NUM 2 |
| 97 | #define CONFIG_SYS_FSL_ESDHC_ADDR 0 |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 98 | |
Teresa Remmet | 30fb74d | 2021-01-13 16:28:09 +0100 | [diff] [blame] | 99 | #endif /* __PHYCORE_IMX8MP_H */ |