blob: 845705c86db22083d3811ba5ba6cda2aba4e4351 [file] [log] [blame]
Marcel Ziswiler3d603662019-05-31 19:00:20 +03001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
Oleksandr Suvorov41d4b002021-10-09 22:41:11 +02003 * Copyright 2019-2021 Toradex
Marcel Ziswiler3d603662019-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 Ziswiler3d603662019-05-31 19:00:20 +030012/* Networking */
Marcel Ziswiler3d603662019-05-31 19:00:20 +030013
14#define MEM_LAYOUT_ENV_SETTINGS \
Marcel Ziswilera9f1e352023-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 Ziswiler3d603662019-05-31 19:00:20 +030021
Andrejs Cainikovsbaa75502023-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 Ziswilerb2f2ee32023-01-16 20:05:05 +010031/* Enable Distro Boot */
Marcel Ziswiler3d603662019-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 Ziswiler3d603662019-05-31 19:00:20 +030038
39/* Initial environment variables */
Tom Rini0613c362022-12-04 10:03:50 -050040#define CFG_EXTRA_ENV_SETTINGS \
Marcel Ziswiler3d603662019-05-31 19:00:20 +030041 BOOTENV \
Andrejs Cainikovsbaa75502023-01-16 20:05:14 +010042 M4_BOOT_ENV \
Marcel Ziswiler3d603662019-05-31 19:00:20 +030043 MEM_LAYOUT_ENV_SETTINGS \
Igor Opaniuk1377a772022-04-13 11:33:27 +020044 "boot_script_dhcp=boot.scr\0" \
Marcel Ziswilerb3d41fb2023-01-16 20:05:06 +010045 "console=ttyLP1\0" \
Marcel Ziswilerfe7b2b32023-01-16 20:04:56 +010046 "fdt_board=eval\0" \
Marcel Ziswiler3d603662019-05-31 19:00:20 +030047 "initrd_addr=0x83800000\0" \
48 "initrd_high=0xffffffffffffffff\0" \
Marcel Ziswilerb3d41fb2023-01-16 20:05:06 +010049 "setup=setenv setupargs console=tty1 console=${console},${baudrate} " \
50 "consoleblank=0 earlycon\0" \
Marcel Ziswiler89301432023-01-16 20:05:08 +010051 "update_uboot=askenv confirm Did you load flash.bin resp. u-boot-dtb.imx (y/N)?; " \
Marcel Ziswiler3d603662019-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 Riniaa6e94d2022-11-16 13:10:37 -050057#define CFG_SYS_SDRAM_BASE 0x80000000
Marcel Ziswiler3d603662019-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 Ziswiler3d603662019-05-31 19:00:20 +030063#endif /* __APALIS_IMX8_H */