blob: 6c3b2c4bf554723012a346fa42a303976c4872cc [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Stefano Babicd67cdcd2011-10-23 23:58:20 +00002/*
3 * (C) Copyright 2011, Stefano Babic <sbabic@denx.de>
4 *
5 * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
6 *
7 * Copyright (C) 2007, Guennadi Liakhovetski <lg@denx.de>
8 *
9 * Configuration for the flea3 board.
Stefano Babicd67cdcd2011-10-23 23:58:20 +000010 */
11
12#ifndef __CONFIG_H
13#define __CONFIG_H
14
15#include <asm/arch/imx-regs.h>
16
17 /* High Level Configuration Options */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000018#define CONFIG_MX35
Stefano Babicd67cdcd2011-10-23 23:58:20 +000019
Stefano Babicd67cdcd2011-10-23 23:58:20 +000020/* Set TEXT at the beginning of the NOR flash */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000021
Stefano Babicd67cdcd2011-10-23 23:58:20 +000022/* This is required to setup the ESDC controller */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000023
Stefano Babicd67cdcd2011-10-23 23:58:20 +000024/*
Stefano Babicd67cdcd2011-10-23 23:58:20 +000025 * Hardware drivers
26 */
trem03997412013-09-21 18:13:36 +020027#define CONFIG_SYS_SPD_BUS_NUM 2 /* I2C3 */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000028
29/*
30 * UART (console)
31 */
Stefano Babic1ca47d92011-11-22 15:22:39 +010032#define CONFIG_MXC_UART_BASE UART3_BASE
Stefano Babicd67cdcd2011-10-23 23:58:20 +000033
Stefano Babicd67cdcd2011-10-23 23:58:20 +000034/*
35 * Command definition
36 */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000037
Stefano Babicd67cdcd2011-10-23 23:58:20 +000038#define CONFIG_NET_RETRY_COUNT 100
39
Stefano Babicd67cdcd2011-10-23 23:58:20 +000040/*
41 * Ethernet on SOC (FEC)
42 */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000043#define CONFIG_FEC_MXC
44#define IMX_FEC_BASE FEC_BASE_ADDR
Stefano Babicd67cdcd2011-10-23 23:58:20 +000045#define CONFIG_FEC_MXC_PHYADDR 0x1
46
Stefano Babicd67cdcd2011-10-23 23:58:20 +000047#define CONFIG_ARP_TIMEOUT 200UL
48
49/*
50 * Miscellaneous configurable options
51 */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000052
Heiko Schocher997ce892016-10-17 15:51:35 +020053#define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000054/* Print Buffer Size */
Heiko Schocher997ce892016-10-17 15:51:35 +020055#define CONFIG_SYS_MAXARGS 32 /* max number of command args */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000056
Stefano Babicd67cdcd2011-10-23 23:58:20 +000057/*
58 * Physical Memory Map
59 */
Stefano Babic774e64e2011-11-25 09:08:36 +010060#define PHYS_SDRAM_1 CSD0_BASE_ADDR
Stefano Babicd67cdcd2011-10-23 23:58:20 +000061#define PHYS_SDRAM_1_SIZE (128 * 1024 * 1024)
62
Stefano Babic774e64e2011-11-25 09:08:36 +010063#define CONFIG_SYS_SDRAM_BASE CSD0_BASE_ADDR
Stefano Babicd67cdcd2011-10-23 23:58:20 +000064#define CONFIG_SYS_INIT_RAM_ADDR (IRAM_BASE_ADDR + 0x10000)
65#define CONFIG_SYS_INIT_RAM_SIZE (IRAM_SIZE / 2)
66#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - \
67 GENERATED_GBL_DATA_SIZE)
68#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
69 CONFIG_SYS_GBL_DATA_OFFSET)
70
71/*
72 * MTD Command for mtdparts
73 */
Stefano Babic774e64e2011-11-25 09:08:36 +010074
Stefano Babicd67cdcd2011-10-23 23:58:20 +000075/*
76 * FLASH and environment organization
77 */
78#define CONFIG_SYS_FLASH_BASE CS0_BASE_ADDR
79#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* max number of memory banks */
80#define CONFIG_SYS_MAX_FLASH_SECT 512 /* max number of sectors on one chip */
81/* Monitor at beginning of flash */
82#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
83#define CONFIG_SYS_MONITOR_LEN (512 * 1024)
84
Stefano Babicd67cdcd2011-10-23 23:58:20 +000085/* Address and size of Redundant Environment Sector */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000086
Stefano Babicd67cdcd2011-10-23 23:58:20 +000087/*
88 * CFI FLASH driver setup
89 */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000090
91/* A non-standard buffered write algorithm */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000092
93/*
94 * NAND FLASH driver setup
95 */
Stefano Babicd67cdcd2011-10-23 23:58:20 +000096#define CONFIG_MXC_NAND_REGS_BASE (NFC_BASE_ADDR)
97#define CONFIG_SYS_MAX_NAND_DEVICE 1
98#define CONFIG_SYS_NAND_BASE (NFC_BASE_ADDR)
99#define CONFIG_MXC_NAND_HWECC
100#define CONFIG_SYS_NAND_LARGEPAGE
101
102/*
103 * Default environment and default scripts
104 * to update uboot and load kernel
105 */
Stefano Babicd67cdcd2011-10-23 23:58:20 +0000106
Mario Six790d8442018-03-28 14:38:20 +0200107#define CONFIG_HOSTNAME "flea3"
Stefano Babicd67cdcd2011-10-23 23:58:20 +0000108#define CONFIG_EXTRA_ENV_SETTINGS \
109 "netdev=eth0\0" \
110 "nfsargs=setenv bootargs root=/dev/nfs rw " \
111 "nfsroot=${serverip}:${rootpath}\0" \
112 "ramargs=setenv bootargs root=/dev/ram rw\0" \
113 "addip_sta=setenv bootargs ${bootargs} " \
114 "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}" \
115 ":${hostname}:${netdev}:off panic=1\0" \
116 "addip_dyn=setenv bootargs ${bootargs} ip=dhcp\0" \
117 "addip=if test -n ${ipdyn};then run addip_dyn;" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200118 "else run addip_sta;fi\0" \
Stefano Babicd67cdcd2011-10-23 23:58:20 +0000119 "addmtd=setenv bootargs ${bootargs} ${mtdparts}\0" \
120 "addtty=setenv bootargs ${bootargs}" \
Stefano Babic774e64e2011-11-25 09:08:36 +0100121 " console=ttymxc2,${baudrate}\0" \
Stefano Babicd67cdcd2011-10-23 23:58:20 +0000122 "addmisc=setenv bootargs ${bootargs} ${misc}\0" \
Stefano Babic774e64e2011-11-25 09:08:36 +0100123 "loadaddr=80800000\0" \
124 "kernel_addr_r=80800000\0" \
Mario Six790d8442018-03-28 14:38:20 +0200125 "hostname=" CONFIG_HOSTNAME "\0" \
126 "bootfile=" CONFIG_HOSTNAME "/uImage\0" \
127 "ramdisk_file=" CONFIG_HOSTNAME "/uRamdisk\0" \
Stefano Babicd67cdcd2011-10-23 23:58:20 +0000128 "flash_self=run ramargs addip addtty addmtd addmisc;" \
129 "bootm ${kernel_addr} ${ramdisk_addr}\0" \
130 "flash_nfs=run nfsargs addip addtty addmtd addmisc;" \
131 "bootm ${kernel_addr}\0" \
132 "net_nfs=tftp ${kernel_addr_r} ${bootfile}; " \
133 "run nfsargs addip addtty addmtd addmisc;" \
134 "bootm ${kernel_addr_r}\0" \
135 "net_self_load=tftp ${kernel_addr_r} ${bootfile};" \
136 "tftp ${ramdisk_addr_r} ${ramdisk_file};\0" \
137 "net_self=if run net_self_load;then " \
138 "run ramargs addip addtty addmtd addmisc;" \
139 "bootm ${kernel_addr_r} ${ramdisk_addr_r};" \
140 "else echo Images not loades;fi\0" \
Mario Six790d8442018-03-28 14:38:20 +0200141 "u-boot=" CONFIG_HOSTNAME "/u-boot.bin\0" \
Stefano Babicd67cdcd2011-10-23 23:58:20 +0000142 "load=tftp ${loadaddr} ${u-boot}\0" \
Marek Vasutfd5ba892012-09-23 17:41:23 +0200143 "uboot_addr=" __stringify(CONFIG_SYS_MONITOR_BASE) "\0" \
Heiko Schocher997ce892016-10-17 15:51:35 +0200144 "update=protect off ${uboot_addr} +80000;" \
145 "erase ${uboot_addr} +80000;" \
Stefano Babicd67cdcd2011-10-23 23:58:20 +0000146 "cp.b ${loadaddr} ${uboot_addr} ${filesize}\0" \
147 "upd=if run load;then echo Updating u-boot;if run update;" \
148 "then echo U-Boot updated;" \
149 "else echo Error updating u-boot !;" \
150 "echo Board without bootloader !!;" \
151 "fi;" \
152 "else echo U-Boot not downloaded..exiting;fi\0" \
153 "bootcmd=run net_nfs\0"
154
Stefano Babicd67cdcd2011-10-23 23:58:20 +0000155#endif /* __CONFIG_H */