Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
Oleksandr Suvorov | f106e63 | 2021-10-09 22:41:11 +0200 | [diff] [blame] | 3 | * Copyright 2019-2021 Toradex |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __APALIS_IMX8_H |
| 7 | #define __APALIS_IMX8_H |
| 8 | |
| 9 | #include <asm/arch/imx-regs.h> |
| 10 | #include <linux/sizes.h> |
| 11 | |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 12 | /* Networking */ |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 13 | |
| 14 | #define MEM_LAYOUT_ENV_SETTINGS \ |
Marcel Ziswiler | cd14c79 | 2023-01-16 20:05:09 +0100 | [diff] [blame] | 15 | "fdt_addr_r=0x9d400000\0" \ |
| 16 | "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
| 17 | "kernel_comp_addr_r=0xf0000000\0" \ |
| 18 | "kernel_comp_size=0x08000000\0" \ |
| 19 | "ramdisk_addr_r=0x9d500000\0" \ |
| 20 | "scriptaddr=0x9d480000\0" |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 21 | |
Andrejs Cainikovs | 378e284 | 2023-01-16 20:05:14 +0100 | [diff] [blame] | 22 | /* Boot M4 */ |
| 23 | #define M4_BOOT_ENV \ |
| 24 | "m4_0_image=m4_0.bin\0" \ |
| 25 | "m4_1_image=m4_1.bin\0" \ |
| 26 | "loadm4image_0=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4_0_image}\0" \ |
| 27 | "loadm4image_1=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4_1_image}\0" \ |
| 28 | "m4boot_0=run loadm4image_0; dcache flush; bootaux ${loadaddr} 0\0" \ |
| 29 | "m4boot_1=run loadm4image_1; dcache flush; bootaux ${loadaddr} 1\0" \ |
| 30 | |
Marcel Ziswiler | df055ed | 2023-01-16 20:05:05 +0100 | [diff] [blame] | 31 | /* Enable Distro Boot */ |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 32 | #define BOOT_TARGET_DEVICES(func) \ |
| 33 | func(MMC, mmc, 1) \ |
| 34 | func(MMC, mmc, 2) \ |
| 35 | func(MMC, mmc, 0) \ |
| 36 | func(DHCP, dhcp, na) |
| 37 | #include <config_distro_bootcmd.h> |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 38 | |
| 39 | /* Initial environment variables */ |
Tom Rini | c9edebe | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 40 | #define CFG_EXTRA_ENV_SETTINGS \ |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 41 | BOOTENV \ |
Andrejs Cainikovs | 378e284 | 2023-01-16 20:05:14 +0100 | [diff] [blame] | 42 | M4_BOOT_ENV \ |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 43 | MEM_LAYOUT_ENV_SETTINGS \ |
Igor Opaniuk | 84c1a2d | 2022-04-13 11:33:27 +0200 | [diff] [blame] | 44 | "boot_script_dhcp=boot.scr\0" \ |
Marcel Ziswiler | cdd9a30 | 2023-01-16 20:05:06 +0100 | [diff] [blame] | 45 | "console=ttyLP1\0" \ |
Marcel Ziswiler | 79d300c | 2023-01-16 20:04:56 +0100 | [diff] [blame] | 46 | "fdt_board=eval\0" \ |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 47 | "initrd_addr=0x83800000\0" \ |
| 48 | "initrd_high=0xffffffffffffffff\0" \ |
Marcel Ziswiler | f203f22 | 2023-01-16 20:05:08 +0100 | [diff] [blame] | 49 | "update_uboot=askenv confirm Did you load flash.bin resp. u-boot-dtb.imx (y/N)?; " \ |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 50 | "if test \"$confirm\" = \"y\"; then " \ |
| 51 | "setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \ |
| 52 | "${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x0 " \ |
| 53 | "${blkcnt}; fi\0" |
| 54 | |
Tom Rini | bb4dd96 | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 55 | #define CFG_SYS_SDRAM_BASE 0x80000000 |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 56 | #define PHYS_SDRAM_1 0x80000000 |
| 57 | #define PHYS_SDRAM_2 0x880000000 |
| 58 | #define PHYS_SDRAM_1_SIZE SZ_2G /* 2 GB */ |
| 59 | #define PHYS_SDRAM_2_SIZE SZ_2G /* 2 GB */ |
| 60 | |
Marcel Ziswiler | 475ceff | 2019-05-31 19:00:20 +0300 | [diff] [blame] | 61 | #endif /* __APALIS_IMX8_H */ |