blob: bfc9b33e8c8df3feff81730a084b1a8a2f1c6241 [file] [log] [blame]
Adam Forda2965c92017-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
Adam Forda2965c92017-04-07 10:25:34 -050015#include "mx6_common.h"
16
17/* Size of malloc() pool */
18#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
19
Adam Forda2965c92017-04-07 10:25:34 -050020/* MMC Configs */
21#define CONFIG_SYS_FSL_ESDHC_ADDR 0
22#define CONFIG_SYS_FSL_USDHC_NUM 2
23#define CONFIG_MMCROOT "/dev/mmcblk1p2" /* Dev kit SD card */
24
25/* Ethernet Configs */
26#define CONFIG_MII
27#define CONFIG_FEC_XCV_TYPE RMII
28#define CONFIG_ETHPRIME "FEC"
29#define CONFIG_FEC_MXC_PHYADDR 0
Adam Forda2965c92017-04-07 10:25:34 -050030
Adam Forda2965c92017-04-07 10:25:34 -050031#define CONFIG_EXTRA_ENV_SETTINGS \
32 "script=boot.scr\0" \
33 "image=zImage\0" \
34 "bootm_size=0x10000000\0" \
35 "fdt_addr_r=0x18000000\0" \
36 "fdt_addr=0x18000000\0" \
37 "ramdisk_addr_r=0x13000000\0" \
38 "ramdiskaddr=0x13000000\0" \
39 "kernel_addr_r=" __stringify(CONFIG_LOADADDR) "\0" \
40 "ramdisk_file=rootfs.cpio.uboot\0" \
41 "boot_fdt=try\0" \
42 "ip_dyn=yes\0" \
43 "console=" CONSOLE_DEV "\0" \
44 "mmcdev=1\0" \
45 "mmcpart=1\0" \
46 "mmcroot=" CONFIG_MMCROOT " rootwait rw\0" \
47 "nandroot=ubi0:rootfs rootfstype=ubifs\0" \
48 "mmcargs=setenv bootargs console=${console},${baudrate}" \
49 " root=${mmcroot} ${mtdparts}\0" \
50 "nandargs=setenv bootargs console=${console},${baudrate}" \
51 " ubi.mtd=fs root=${nandroot} ${mtdparts}\0" \
52 "ramargs=setenv bootargs console=${console},${baudrate}" \
53 " root=/dev/ram rw ${mtdparts}\0" \
54 "loadbootscript=" \
55 "fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
56 "bootscript=echo Running bootscript from mmc ...;" \
57 " source\0" \
58 "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image};" \
59 " setenv kernelsize ${filesize}\0" \
60 "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
61 "loadramdisk=fatload mmc ${mmcdev}:${mmcpart} ${ramdiskaddr}" \
62 " ${ramdisk_file}; setenv ramdisksize ${filesize}\0" \
63 "mmcboot=echo Booting from mmc...; run mmcargs; run loadimage;" \
64 " run loadfdt; bootz ${loadaddr} - ${fdt_addr}\0" \
65 "mmcramboot=run ramargs; run loadimage;" \
66 " run loadfdt; run loadramdisk;" \
67 " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
68 "nandboot=echo Booting from nand ...; " \
69 " run nandargs;" \
70 " nand read ${loadaddr} kernel ${kernelsize};" \
71 " nand read ${fdt_addr} dtb;" \
72 " bootz ${loadaddr} - ${fdt_addr}\0" \
73 "nandramboot=echo Booting RAMdisk from nand ...; " \
74 " nand read ${ramdiskaddr} fs ${ramdisksize};" \
75 " nand read ${loadaddr} kernel ${kernelsize};" \
76 " nand read ${fdt_addr} dtb;" \
77 " run ramargs;" \
78 " bootz ${loadaddr} ${ramdiskaddr} ${fdt_addr}\0" \
79 "netargs=setenv bootargs console=${console},${baudrate} " \
80 "root=/dev/nfs" \
81 " ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
82 "netboot=echo Booting from net ...; " \
83 "run netargs; " \
84 "if test ${ip_dyn} = yes; then " \
85 "setenv get_cmd dhcp; " \
86 "else " \
87 "setenv get_cmd tftp; " \
88 "fi; " \
89 "${get_cmd} ${image}; " \
90 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
91 "if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
92 "bootz ${loadaddr} - ${fdt_addr}; " \
93 "else " \
94 "if test ${boot_fdt} = try; then " \
95 "bootz; " \
96 "else " \
97 "echo WARN: Cannot load the DT; " \
98 "fi; " \
99 "fi; " \
100 "else " \
101 "bootz; " \
102 "fi;\0" \
103 "autoboot=mmc dev ${mmcdev};" \
104 "if mmc rescan; then " \
105 "if run loadbootscript; then " \
106 "run bootscript; " \
107 "else " \
108 "if run loadimage; then " \
109 "run mmcboot; " \
110 "else run netboot; " \
111 "fi; " \
112 "fi; " \
113 "else run netboot; fi"
114#define CONFIG_BOOTCOMMAND \
115 "run autoboot"
116
117#define CONFIG_ARP_TIMEOUT 200UL
118
119#define CONFIG_SYS_MEMTEST_START 0x10000000
120#define CONFIG_SYS_MEMTEST_END 0x10010000
121#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
122
Adam Forda2965c92017-04-07 10:25:34 -0500123/* Physical Memory Map */
124#define CONFIG_NR_DRAM_BANKS 1
125#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
126#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
127#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
128#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
129
130#define CONFIG_SYS_INIT_SP_OFFSET \
131 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
132#define CONFIG_SYS_INIT_SP_ADDR \
133 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
134
135/* Environment organization */
136#define CONFIG_ENV_SIZE (8 * 1024)
Adam Forda2965c92017-04-07 10:25:34 -0500137#define CONFIG_ENV_OFFSET 0x400000
138#define CONFIG_ENV_SECT_SIZE CONFIG_ENV_SIZE
139
140/* NAND stuff */
Adam Forda2965c92017-04-07 10:25:34 -0500141#define CONFIG_SYS_MAX_NAND_DEVICE 1
142#define CONFIG_SYS_NAND_BASE 0x40000000
143#define CONFIG_SYS_NAND_5_ADDR_CYCLE
144#define CONFIG_SYS_NAND_ONFI_DETECTION
145#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
146#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x200000
147
148/* MTD device */
149# define CONFIG_MTD_DEVICE
Adam Forda2965c92017-04-07 10:25:34 -0500150# define CONFIG_MTD_PARTITIONS
Adam Forda2965c92017-04-07 10:25:34 -0500151
152/* DMA stuff, needed for GPMI/MXS NAND support */
Adam Forda2965c92017-04-07 10:25:34 -0500153
154/* EEPROM contains serial no, MAC addr and other Logic PD info */
155#define CONFIG_I2C_EEPROM
156
157#endif /* __IMX6LOGIC_CONFIG_H */