2 * Copyright (C) 2017 Logic PD, Inc.
4 * Configuration settings for the LogicPD i.MX6 SOM.
6 * SPDX-License-Identifier: GPL-2.0+
9 #ifndef __IMX6LOGIC_CONFIG_H
10 #define __IMX6LOGIC_CONFIG_H
12 #define CONFIG_MXC_UART_BASE UART1_BASE
13 #define CONSOLE_DEV "ttymxc0"
15 #include <config_distro_defaults.h>
16 #include "mx6_common.h"
18 /* Size of malloc() pool */
19 #define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
21 #define CONFIG_MXC_UART
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 */
28 /* Ethernet Configs */
30 #define CONFIG_FEC_XCV_TYPE RMII
31 #define CONFIG_ETHPRIME "FEC"
32 #define CONFIG_FEC_MXC_PHYADDR 0
34 #define CONFIG_PHY_SMSC
36 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
38 #define CONFIG_EXTRA_ENV_SETTINGS \
41 "bootm_size=0x10000000\0" \
42 "fdt_addr_r=0x18000000\0" \
43 "fdt_addr=0x18000000\0" \
44 "ramdisk_addr_r=0x13000000\0" \
45 "ramdiskaddr=0x13000000\0" \
46 "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
47 "ramdisk_file=rootfs.cpio.uboot\0" \
50 "console=" CONSOLE_DEV "\0" \
53 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
54 "nandroot=ubi0:rootfs rootfstype=ubifs\0" \
55 "mmcargs=setenv bootargs console=${console},${baudrate}" \
56 " root=${mmcroot} ${mtdparts}\0" \
57 "nandargs=setenv bootargs console=${console},${baudrate}" \
58 " ubi.mtd=fs root=${nandroot} ${mtdparts}\0" \
59 "ramargs=setenv bootargs console=${console},${baudrate}" \
60 " root=/dev/ram rw ${mtdparts}\0" \
62 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
63 "bootscript=echo Running bootscript from mmc ...;" \
65 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};" \
66 " setenv kernelsize ${filesize}\0" \
67 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
68 "loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdiskaddr}" \
69 " ${ramdisk_file}; setenv ramdisksize ${filesize}\0" \
70 "mmcboot=echo Booting from mmc...; run mmcargs; run loadimage;" \
71 " run loadfdt; bootz ${loadaddr} - ${fdt_addr}\0" \
72 "mmcramboot=run ramargs; run loadimage;" \
73 " run loadfdt; run loadramdisk;" \
74 " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
75 "nandboot=echo Booting from nand ...; " \
77 " nand read ${loadaddr} kernel ${kernelsize};" \
78 " nand read ${fdt_addr} dtb;" \
79 " bootz ${loadaddr} - ${fdt_addr}\0" \
80 "nandramboot=echo Booting RAMdisk from nand ...; " \
81 " nand read ${ramdiskaddr} fs ${ramdisksize};" \
82 " nand read ${loadaddr} kernel ${kernelsize};" \
83 " nand read ${fdt_addr} dtb;" \
85 " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
86 "netargs=setenv bootargs console=${console},${baudrate} " \
88 " ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
89 "netboot=echo Booting from net ...; " \
91 "if test ${ip_dyn} = yes; then " \
92 "setenv get_cmd dhcp; " \
94 "setenv get_cmd tftp; " \
96 "${get_cmd} ${image}; " \
97 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
98 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
99 "bootz ${loadaddr} - ${fdt_addr}; " \
101 "if test ${boot_fdt} = try; then " \
104 "echo WARN: Cannot load the DT; " \
110 "autoboot=mmc dev ${mmcdev};" \
111 "if mmc rescan; then " \
112 "if run loadbootscript; then " \
115 "if run loadimage; then " \
117 "else run netboot; " \
120 "else run netboot; fi"
121 #define CONFIG_BOOTCOMMAND \
124 #define CONFIG_ARP_TIMEOUT 200UL
126 #define CONFIG_SYS_MEMTEST_START 0x10000000
127 #define CONFIG_SYS_MEMTEST_END 0x10010000
128 #define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
130 /* Physical Memory Map */
131 #define CONFIG_NR_DRAM_BANKS 1
132 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
133 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
134 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
135 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
137 #define CONFIG_SYS_INIT_SP_OFFSET \
138 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
139 #define CONFIG_SYS_INIT_SP_ADDR \
140 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
142 /* Environment organization */
143 #define CONFIG_ENV_SIZE (8 * 1024)
144 #define CONFIG_ENV_OFFSET 0x400000
145 #define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE
148 #define CONFIG_CMD_NAND_TRIMFFS
149 #define CONFIG_SYS_MAX_NAND_DEVICE 1
150 #define CONFIG_SYS_NAND_BASE 0x40000000
151 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
152 #define CONFIG_SYS_NAND_ONFI_DETECTION
153 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
154 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
157 # define CONFIG_MTD_DEVICE
158 # define CONFIG_MTD_PARTITIONS
159 # define MTDIDS_DEFAULT "nand0=gpmi-nand"
160 # define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:4m(uboot)," \
161 "1m(env),16m(kernel),1m(dtb),-(fs)"
163 /* DMA stuff, needed for GPMI/MXS NAND support */
164 #define CONFIG_APBH_DMA
165 #define CONFIG_APBH_DMA_BURST
166 #define CONFIG_APBH_DMA_BURST8
168 /* EEPROM contains serial no, MAC addr and other Logic PD info */
169 #define CONFIG_I2C_EEPROM
171 #endif /* __IMX6LOGIC_CONFIG_H */