blob: 40eb84cbbd470a5262b522973228602eb8167837 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Adam Forda2965c92017-04-07 10:25:34 -05002/*
3 * Copyright (C) 2017 Logic PD, Inc.
4 *
5 * Configuration settings for the LogicPD i.MX6 SOM.
Adam Forda2965c92017-04-07 10:25:34 -05006 */
7
8#ifndef __IMX6LOGIC_CONFIG_H
9#define __IMX6LOGIC_CONFIG_H
10
11#define CONFIG_MXC_UART_BASE UART1_BASE
12#define CONSOLE_DEV "ttymxc0"
13
Adam Ford1b546992018-07-05 20:58:24 -050014#ifdef CONFIG_SPL
15#include "imx6_spl.h"
16#endif
17
Adam Forda2965c92017-04-07 10:25:34 -050018#include "mx6_common.h"
19
20/* Size of malloc() pool */
21#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
22
Adam Forda2965c92017-04-07 10:25:34 -050023/* MMC Configs */
24#define CONFIG_SYS_FSL_ESDHC_ADDR 0
25#define CONFIG_SYS_FSL_USDHC_NUM 2
26#define CONFIG_MMCROOT "/dev/mmcblk1p2" /* Dev kit SD card */
27
28/* Ethernet Configs */
29#define CONFIG_MII
30#define CONFIG_FEC_XCV_TYPE RMII
31#define CONFIG_ETHPRIME "FEC"
32#define CONFIG_FEC_MXC_PHYADDR 0
Adam Forda2965c92017-04-07 10:25:34 -050033
Adam Forda2965c92017-04-07 10:25:34 -050034#define CONFIG_EXTRA_ENV_SETTINGS \
35 "script=boot.scr\0" \
36 "image=zImage\0" \
37 "bootm_size=0x10000000\0" \
38 "fdt_addr_r=0x18000000\0" \
39 "fdt_addr=0x18000000\0" \
40 "ramdisk_addr_r=0x13000000\0" \
41 "ramdiskaddr=0x13000000\0" \
42 "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
43 "ramdisk_file=rootfs.cpio.uboot\0" \
44 "boot_fdt=try\0" \
45 "ip_dyn=yes\0" \
46 "console=" CONSOLE_DEV "\0" \
47 "mmcdev=1\0" \
48 "mmcpart=1\0" \
49 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
50 "nandroot=ubi0:rootfs rootfstype=ubifs\0" \
51 "mmcargs=setenv bootargs console=${console},${baudrate}" \
52 " root=${mmcroot} ${mtdparts}\0" \
53 "nandargs=setenv bootargs console=${console},${baudrate}" \
54 " ubi.mtd=fs root=${nandroot} ${mtdparts}\0" \
55 "ramargs=setenv bootargs console=${console},${baudrate}" \
56 " root=/dev/ram rw ${mtdparts}\0" \
57 "loadbootscript=" \
58 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
59 "bootscript=echo Running bootscript from mmc ...;" \
60 " source\0" \
61 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};" \
62 " setenv kernelsize ${filesize}\0" \
63 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
64 "loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdiskaddr}" \
65 " ${ramdisk_file}; setenv ramdisksize ${filesize}\0" \
66 "mmcboot=echo Booting from mmc...; run mmcargs; run loadimage;" \
67 " run loadfdt; bootz ${loadaddr} - ${fdt_addr}\0" \
68 "mmcramboot=run ramargs; run loadimage;" \
69 " run loadfdt; run loadramdisk;" \
70 " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
71 "nandboot=echo Booting from nand ...; " \
72 " run nandargs;" \
73 " nand read ${loadaddr} kernel ${kernelsize};" \
74 " nand read ${fdt_addr} dtb;" \
75 " bootz ${loadaddr} - ${fdt_addr}\0" \
76 "nandramboot=echo Booting RAMdisk from nand ...; " \
77 " nand read ${ramdiskaddr} fs ${ramdisksize};" \
78 " nand read ${loadaddr} kernel ${kernelsize};" \
79 " nand read ${fdt_addr} dtb;" \
80 " run ramargs;" \
81 " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
82 "netargs=setenv bootargs console=${console},${baudrate} " \
83 "root=/dev/nfs" \
84 " ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
85 "netboot=echo Booting from net ...; " \
86 "run netargs; " \
87 "if test ${ip_dyn} = yes; then " \
88 "setenv get_cmd dhcp; " \
89 "else " \
90 "setenv get_cmd tftp; " \
91 "fi; " \
92 "${get_cmd} ${image}; " \
93 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
94 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
95 "bootz ${loadaddr} - ${fdt_addr}; " \
96 "else " \
97 "if test ${boot_fdt} = try; then " \
98 "bootz; " \
99 "else " \
100 "echo WARN: Cannot load the DT; " \
101 "fi; " \
102 "fi; " \
103 "else " \
104 "bootz; " \
105 "fi;\0" \
106 "autoboot=mmc dev ${mmcdev};" \
107 "if mmc rescan; then " \
108 "if run loadbootscript; then " \
109 "run bootscript; " \
110 "else " \
111 "if run loadimage; then " \
112 "run mmcboot; " \
113 "else run netboot; " \
114 "fi; " \
115 "fi; " \
116 "else run netboot; fi"
117#define CONFIG_BOOTCOMMAND \
118 "run autoboot"
119
120#define CONFIG_ARP_TIMEOUT 200UL
121
122#define CONFIG_SYS_MEMTEST_START 0x10000000
123#define CONFIG_SYS_MEMTEST_END 0x10010000
124#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
125
Adam Forda2965c92017-04-07 10:25:34 -0500126/* Physical Memory Map */
127#define CONFIG_NR_DRAM_BANKS 1
128#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
129#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
130#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
131#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
132
133#define CONFIG_SYS_INIT_SP_OFFSET \
134 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
135#define CONFIG_SYS_INIT_SP_ADDR \
136 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
137
138/* Environment organization */
Adam Ford1b546992018-07-05 20:58:24 -0500139#define CONFIG_ENV_SIZE (1024 * 1024)
Adam Forda2965c92017-04-07 10:25:34 -0500140#define CONFIG_ENV_OFFSET 0x400000
141#define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE
142
143/* NAND stuff */
Adam Forda2965c92017-04-07 10:25:34 -0500144#define CONFIG_SYS_MAX_NAND_DEVICE 1
145#define CONFIG_SYS_NAND_BASE 0x40000000
146#define CONFIG_SYS_NAND_5_ADDR_CYCLE
147#define CONFIG_SYS_NAND_ONFI_DETECTION
148#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
149#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
Adam Ford1b546992018-07-05 20:58:24 -0500150#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00500000
Adam Forda2965c92017-04-07 10:25:34 -0500151/* MTD device */
152# define CONFIG_MTD_DEVICE
Adam Forda2965c92017-04-07 10:25:34 -0500153# define CONFIG_MTD_PARTITIONS
Adam Forda2965c92017-04-07 10:25:34 -0500154
155/* DMA stuff, needed for GPMI/MXS NAND support */
Adam Forda2965c92017-04-07 10:25:34 -0500156
157/* EEPROM contains serial no, MAC addr and other Logic PD info */
158#define CONFIG_I2C_EEPROM
159
Adam Ford1b546992018-07-05 20:58:24 -0500160/* USB Configs */
161#ifdef CONFIG_CMD_USB
162#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
163#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
164#define CONFIG_MXC_USB_FLAGS 0
165#define CONFIG_USB_MAX_CONTROLLER_COUNT 1 /* Enabled USB controller number */
166#endif
167
168/* Falcon Mode */
169#define CONFIG_SPL_FS_LOAD_ARGS_NAME "args"
170#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"
171#define CONFIG_SYS_SPL_ARGS_ADDR 0x15000000
172
173/* Falcon Mode - MMC support: args@1MB kernel@2MB */
174#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800 /* 1MB */
175#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
176#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000 /* 2MB */
177
Adam Forda2965c92017-04-07 10:25:34 -0500178#endif /* __IMX6LOGIC_CONFIG_H */