blob: 821f1ffacdb85d66811a91424dd90c7f43065473 [file] [log] [blame]
Adam Fordf479cec2017-04-07 10:25:34 -05001/*
2 * Copyright (C) 2017 Logic PD, Inc.
3 *
4 * Configuration settings for the LogicPD i.MX6 SOM.
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9#ifndef __IMX6LOGIC_CONFIG_H
10#define __IMX6LOGIC_CONFIG_H
11
12#define CONFIG_MXC_UART_BASE UART1_BASE
13#define CONSOLE_DEV "ttymxc0"
14
15#include <config_distro_defaults.h>
16#include "mx6_common.h"
17
18/* Size of malloc() pool */
19#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
20
21#define CONFIG_MXC_UART
22
23/* 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
33#define CONFIG_PHYLIB
34#define CONFIG_PHY_SMSC
35
Adam Fordf479cec2017-04-07 10:25:34 -050036#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
37
38#define CONFIG_EXTRA_ENV_SETTINGS \
39 "script=boot.scr\0" \
40 "image=zImage\0" \
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" \
48 "boot_fdt=try\0" \
49 "ip_dyn=yes\0" \
50 "console=" CONSOLE_DEV "\0" \
51 "mmcdev=1\0" \
52 "mmcpart=1\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" \
61 "loadbootscript=" \
62 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
63 "bootscript=echo Running bootscript from mmc ...;" \
64 " source\0" \
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 ...; " \
76 " run nandargs;" \
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;" \
84 " run ramargs;" \
85 " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
86 "netargs=setenv bootargs console=${console},${baudrate} " \
87 "root=/dev/nfs" \
88 " ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
89 "netboot=echo Booting from net ...; " \
90 "run netargs; " \
91 "if test ${ip_dyn} = yes; then " \
92 "setenv get_cmd dhcp; " \
93 "else " \
94 "setenv get_cmd tftp; " \
95 "fi; " \
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}; " \
100 "else " \
101 "if test ${boot_fdt} = try; then " \
102 "bootz; " \
103 "else " \
104 "echo WARN: Cannot load the DT; " \
105 "fi; " \
106 "fi; " \
107 "else " \
108 "bootz; " \
109 "fi;\0" \
110 "autoboot=mmc dev ${mmcdev};" \
111 "if mmc rescan; then " \
112 "if run loadbootscript; then " \
113 "run bootscript; " \
114 "else " \
115 "if run loadimage; then " \
116 "run mmcboot; " \
117 "else run netboot; " \
118 "fi; " \
119 "fi; " \
120 "else run netboot; fi"
121#define CONFIG_BOOTCOMMAND \
122 "run autoboot"
123
124#define CONFIG_ARP_TIMEOUT 200UL
125
126#define CONFIG_SYS_MEMTEST_START 0x10000000
127#define CONFIG_SYS_MEMTEST_END 0x10010000
128#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
129
Adam Fordf479cec2017-04-07 10:25:34 -0500130/* 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
136
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)
141
142/* Environment organization */
143#define CONFIG_ENV_SIZE (8 * 1024)
144#define CONFIG_ENV_IS_IN_NAND
145#define CONFIG_ENV_OFFSET 0x400000
146#define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE
147
148/* NAND stuff */
149#define CONFIG_CMD_NAND_TRIMFFS
150#define CONFIG_SYS_MAX_NAND_DEVICE 1
151#define CONFIG_SYS_NAND_BASE 0x40000000
152#define CONFIG_SYS_NAND_5_ADDR_CYCLE
153#define CONFIG_SYS_NAND_ONFI_DETECTION
154#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
155#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
156
157/* MTD device */
158# define CONFIG_MTD_DEVICE
159# define CONFIG_CMD_MTDPARTS
160# define CONFIG_MTD_PARTITIONS
161# define MTDIDS_DEFAULT "nand0=gpmi-nand"
162# define MTDPARTS_DEFAULT "mtdparts=gpmi-nand:4m(uboot)," \
163 "1m(env),16m(kernel),1m(dtb),-(fs)"
164
165/* DMA stuff, needed for GPMI/MXS NAND support */
166#define CONFIG_APBH_DMA
167#define CONFIG_APBH_DMA_BURST
168#define CONFIG_APBH_DMA_BURST8
169
170/* EEPROM contains serial no, MAC addr and other Logic PD info */
171#define CONFIG_I2C_EEPROM
172
173#endif /* __IMX6LOGIC_CONFIG_H */