blob: 845705c86db22083d3811ba5ba6cda2aba4e4351 [file] [log] [blame]
Marcel Ziswiler475ceff2019-05-31 19:00:20 +03001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
Oleksandr Suvorovf106e632021-10-09 22:41:11 +02003 * Copyright 2019-2021 Toradex
Marcel Ziswiler475ceff2019-05-31 19:00:20 +03004 */
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 Ziswiler475ceff2019-05-31 19:00:20 +030012/* Networking */
Marcel Ziswiler475ceff2019-05-31 19:00:20 +030013
14#define MEM_LAYOUT_ENV_SETTINGS \
Marcel Ziswilercd14c792023-01-16 20:05:09 +010015 "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 Ziswiler475ceff2019-05-31 19:00:20 +030021
Andrejs Cainikovs378e2842023-01-16 20:05:14 +010022/* 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 Ziswilerdf055ed2023-01-16 20:05:05 +010031/* Enable Distro Boot */
Marcel Ziswiler475ceff2019-05-31 19:00:20 +030032#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 Ziswiler475ceff2019-05-31 19:00:20 +030038
39/* Initial environment variables */
Tom Rinic9edebe2022-12-04 10:03:50 -050040#define CFG_EXTRA_ENV_SETTINGS \
Marcel Ziswiler475ceff2019-05-31 19:00:20 +030041 BOOTENV \
Andrejs Cainikovs378e2842023-01-16 20:05:14 +010042 M4_BOOT_ENV \
Marcel Ziswiler475ceff2019-05-31 19:00:20 +030043 MEM_LAYOUT_ENV_SETTINGS \
Igor Opaniuk84c1a2d2022-04-13 11:33:27 +020044 "boot_script_dhcp=boot.scr\0" \
Marcel Ziswilercdd9a302023-01-16 20:05:06 +010045 "console=ttyLP1\0" \
Marcel Ziswiler79d300c2023-01-16 20:04:56 +010046 "fdt_board=eval\0" \
Marcel Ziswiler475ceff2019-05-31 19:00:20 +030047 "initrd_addr=0x83800000\0" \
48 "initrd_high=0xffffffffffffffff\0" \
Marcel Ziswilercdd9a302023-01-16 20:05:06 +010049 "setup=setenv setupargs console=tty1 console=${console},${baudrate} " \
50 "consoleblank=0 earlycon\0" \
Marcel Ziswilerf203f222023-01-16 20:05:08 +010051 "update_uboot=askenv confirm Did you load flash.bin resp. u-boot-dtb.imx (y/N)?; " \
Marcel Ziswiler475ceff2019-05-31 19:00:20 +030052 "if test \"$confirm\" = \"y\"; then " \
53 "setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \
54 "${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x0 " \
55 "${blkcnt}; fi\0"
56
Tom Rinibb4dd962022-11-16 13:10:37 -050057#define CFG_SYS_SDRAM_BASE 0x80000000
Marcel Ziswiler475ceff2019-05-31 19:00:20 +030058#define PHYS_SDRAM_1 0x80000000
59#define PHYS_SDRAM_2 0x880000000
60#define PHYS_SDRAM_1_SIZE SZ_2G /* 2 GB */
61#define PHYS_SDRAM_2_SIZE SZ_2G /* 2 GB */
62
Marcel Ziswiler475ceff2019-05-31 19:00:20 +030063#endif /* __APALIS_IMX8_H */