blob: 13cd54a8dc1a2406d9c52ac34fd5dfbd03863737 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Jagan Tekif4b75322016-10-08 18:00:11 +05302/*
3 * Copyright (C) 2016 Amarula Solutions B.V.
4 * Copyright (C) 2016 Engicam S.r.l.
5 *
Jagan Teki0e689a62017-05-12 17:18:28 +05306 * Configuration settings for the Engicam i.MX6 SOM Starter Kits.
Jagan Tekif4b75322016-10-08 18:00:11 +05307 */
8
Jagan Teki0e689a62017-05-12 17:18:28 +05309#ifndef __IMX6_ENGICAM_CONFIG_H
10#define __IMX6_ENGICAM_CONFIG_H
Jagan Tekif4b75322016-10-08 18:00:11 +053011
12#include <linux/sizes.h>
Simon Glass1af3c7f2020-05-10 11:40:09 -060013#include <linux/stringify.h>
Jagan Tekif4b75322016-10-08 18:00:11 +053014#include "mx6_common.h"
15
16/* Size of malloc() pool */
17#define CONFIG_SYS_MALLOC_LEN (16 * SZ_1M)
18
19/* Total Size of Environment Sector */
Jagan Tekif4b75322016-10-08 18:00:11 +053020
Jagan Tekif4b75322016-10-08 18:00:11 +053021/* Environment */
22#ifndef CONFIG_ENV_IS_NOWHERE
23/* Environment in MMC */
24# if defined(CONFIG_ENV_IS_IN_MMC)
Jagan Teki023ff2f2016-10-25 11:53:23 +053025/* Environment in NAND */
Jagan Tekif4b75322016-10-08 18:00:11 +053026# endif
27#endif
28
29/* Default environment */
30#define CONFIG_EXTRA_ENV_SETTINGS \
31 "script=boot.scr\0" \
Jagan Teki37135712016-12-06 00:00:56 +010032 "splashpos=m,m\0" \
Anatolij Gustschine80aa8b2019-09-18 17:23:45 +020033 "splashimage=" __stringify(CONFIG_LOADADDR) "\0" \
Jagan Tekibfd96402016-12-21 12:00:21 +010034 "image=uImage\0" \
Jagan Teki66d1d682016-12-21 12:00:29 +010035 "fit_image=fit.itb\0" \
Jagan Tekif4b75322016-10-08 18:00:11 +053036 "fdt_high=0xffffffff\0" \
Jagan Teki5ed7d312017-05-12 17:18:27 +053037 "fdt_addr=" FDT_ADDR "\0" \
Jagan Tekif4b75322016-10-08 18:00:11 +053038 "boot_fdt=try\0" \
Jagan Tekif4b75322016-10-08 18:00:11 +053039 "mmcpart=1\0" \
Jagan Tekiddd90662016-12-21 12:00:25 +010040 "nandroot=ubi0:rootfs rootfstype=ubifs\0" \
Jagan Tekif4b75322016-10-08 18:00:11 +053041 "mmcautodetect=yes\0" \
42 "mmcargs=setenv bootargs console=${console},${baudrate} " \
43 "root=${mmcroot}\0" \
Jagan Tekiddd90662016-12-21 12:00:25 +010044 "ubiargs=setenv bootargs console=${console},${baudrate} " \
45 "ubi.mtd=5 root=${nandroot} ${mtdparts}\0" \
Jagan Tekif4b75322016-10-08 18:00:11 +053046 "loadbootscript=" \
47 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
48 "bootscript=echo Running bootscript from mmc ...; " \
49 "source\0" \
50 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
51 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
Jagan Teki66d1d682016-12-21 12:00:29 +010052 "loadfit=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${fit_image}\0" \
Jagan Tekib1f82422019-04-26 14:31:46 +053053 "altbootcmd=run recoveryboot\0"\
Jagan Teki66d1d682016-12-21 12:00:29 +010054 "fitboot=echo Booting FIT image from mmc ...; " \
55 "run mmcargs; " \
56 "bootm ${loadaddr}\0" \
Jagan Teki98f566102017-05-07 02:43:00 +053057 "_mmcboot=run mmcargs; " \
Jagan Tekif4b75322016-10-08 18:00:11 +053058 "run mmcargs; " \
59 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
60 "if run loadfdt; then " \
Jagan Tekibfd96402016-12-21 12:00:21 +010061 "bootm ${loadaddr} - ${fdt_addr}; " \
Jagan Tekif4b75322016-10-08 18:00:11 +053062 "else " \
63 "if test ${boot_fdt} = try; then " \
Jagan Tekibfd96402016-12-21 12:00:21 +010064 "bootm; " \
Jagan Tekif4b75322016-10-08 18:00:11 +053065 "else " \
66 "echo WARN: Cannot load the DT; " \
67 "fi; " \
68 "fi; " \
69 "else " \
Jagan Tekibfd96402016-12-21 12:00:21 +010070 "bootm; " \
Jagan Tekiddd90662016-12-21 12:00:25 +010071 "fi\0" \
Jagan Teki98f566102017-05-07 02:43:00 +053072 "mmcboot=echo Booting from mmc ...; " \
73 "if mmc rescan; then " \
74 "if run loadbootscript; then " \
75 "run bootscript; " \
76 "else " \
77 "if run loadfit; then " \
78 "run fitboot; " \
79 "else " \
80 "if run loadimage; then " \
81 "run _mmcboot; " \
82 "fi; " \
83 "fi; " \
84 "fi; " \
85 "fi\0" \
Jagan Tekiddd90662016-12-21 12:00:25 +010086 "nandboot=echo Booting from nand ...; " \
87 "if mtdparts; then " \
88 "echo Starting nand boot ...; " \
89 "else " \
90 "mtdparts default; " \
91 "fi; " \
92 "run ubiargs; " \
93 "nand read ${loadaddr} kernel 0x800000; " \
94 "nand read ${fdt_addr} dtb 0x100000; " \
Jagan Tekib1f82422019-04-26 14:31:46 +053095 "bootm ${loadaddr} - ${fdt_addr}\0" \
96 "recoveryboot=if test ${modeboot} = mmcboot; then " \
97 "run mmcboot; " \
98 "else " \
99 "run nandboot; " \
100 "fi\0"
Jagan Tekif4b75322016-10-08 18:00:11 +0530101
Jagan Teki98f566102017-05-07 02:43:00 +0530102#define CONFIG_BOOTCOMMAND "run $modeboot"
Jagan Tekif4b75322016-10-08 18:00:11 +0530103
104/* Miscellaneous configurable options */
Jagan Tekif4b75322016-10-08 18:00:11 +0530105
106#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
107#define CONFIG_SYS_HZ 1000
108
Jagan Teki0e689a62017-05-12 17:18:28 +0530109#ifdef CONFIG_MX6UL
110# define DRAM_OFFSET(x) 0x87##x
111# define FDT_ADDR __stringify(DRAM_OFFSET(800000))
112#else
113# define DRAM_OFFSET(x) 0x1##x
114# define FDT_ADDR __stringify(DRAM_OFFSET(8000000))
115#endif
Jagan Teki5ed7d312017-05-12 17:18:27 +0530116
Jagan Tekif4b75322016-10-08 18:00:11 +0530117/* Physical Memory Map */
Jagan Tekif4b75322016-10-08 18:00:11 +0530118#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
119
120#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
121#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
122#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
123
124#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
125 GENERATED_GBL_DATA_SIZE)
126#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
127 CONFIG_SYS_INIT_SP_OFFSET)
128
129/* UART */
130#ifdef CONFIG_MXC_UART
Jagan Teki0e689a62017-05-12 17:18:28 +0530131# ifdef CONFIG_MX6UL
132# define CONFIG_MXC_UART_BASE UART1_BASE
133# else
134# define CONFIG_MXC_UART_BASE UART4_BASE
135# endif
Jagan Tekif4b75322016-10-08 18:00:11 +0530136#endif
137
138/* MMC */
Jagan Tekif4b75322016-10-08 18:00:11 +0530139
Jagan Teki023ff2f2016-10-25 11:53:23 +0530140/* NAND */
141#ifdef CONFIG_NAND_MXS
142# define CONFIG_SYS_MAX_NAND_DEVICE 1
143# define CONFIG_SYS_NAND_BASE 0x40000000
144# define CONFIG_SYS_NAND_5_ADDR_CYCLE
145# define CONFIG_SYS_NAND_ONFI_DETECTION
146# define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
147# define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
148
Jagan Teki310db712016-10-08 18:00:27 +0530149/* MTD device */
Jagan Teki023ff2f2016-10-25 11:53:23 +0530150#endif
151
Jagan Teki63af4b02017-08-28 16:45:48 +0530152/* Falcon Mode */
153#ifdef CONFIG_SPL_OS_BOOT
154# define CONFIG_SPL_FS_LOAD_ARGS_NAME "args"
155# define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
Jagan Teki63af4b02017-08-28 16:45:48 +0530156# define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000
Jagan Teki63af4b02017-08-28 16:45:48 +0530157
158/* MMC support: args@1MB kernel@2MB */
159# define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800 /* 1MB */
160# define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
161# define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000 /* 2MB */
162#endif
163
Jagan Tekica7463c2016-12-06 00:00:55 +0100164/* Framebuffer */
165#ifdef CONFIG_VIDEO_IPUV3
Jagan Tekica7463c2016-12-06 00:00:55 +0100166# define CONFIG_IMX_VIDEO_SKIP
167
Jagan Tekica7463c2016-12-06 00:00:55 +0100168# define CONFIG_BMP_16BPP
169# define CONFIG_VIDEO_BMP_RLE8
170# define CONFIG_VIDEO_LOGO
171# define CONFIG_VIDEO_BMP_LOGO
172#endif
173
Jagan Tekif4b75322016-10-08 18:00:11 +0530174/* SPL */
175#ifdef CONFIG_SPL
Jagan Tekic282eae2018-01-10 00:19:52 +0530176# ifdef CONFIG_ENV_IS_IN_NAND
Jagan Teki023ff2f2016-10-25 11:53:23 +0530177# define CONFIG_SPL_NAND_SUPPORT
178# else
179# define CONFIG_SPL_MMC_SUPPORT
180# endif
181
Jagan Tekif4b75322016-10-08 18:00:11 +0530182# include "imx6_spl.h"
Jagan Tekif4b75322016-10-08 18:00:11 +0530183#endif
184
Jagan Teki0e689a62017-05-12 17:18:28 +0530185#endif /* __IMX6_ENGICAM_CONFIG_H */