xref: /rk3399_rockchip-uboot/include/configs/at91sam9260ek.h (revision 0c58cfa9dd84176a26a64be258a554a38ce654e2)
10176d43eSStelian Pop /*
20176d43eSStelian Pop  * (C) Copyright 2007-2008
3c9e798d3SStelian Pop  * Stelian Pop <stelian@popies.net>
40176d43eSStelian Pop  * Lead Tech Design <www.leadtechdesign.com>
50176d43eSStelian Pop  *
6df486b1fSNicolas Ferre  * Configuation settings for the AT91SAM9260EK & AT91SAM9G20EK boards.
70176d43eSStelian Pop  *
80176d43eSStelian Pop  * See file CREDITS for list of people who contributed to this
90176d43eSStelian Pop  * project.
100176d43eSStelian Pop  *
110176d43eSStelian Pop  * This program is free software; you can redistribute it and/or
120176d43eSStelian Pop  * modify it under the terms of the GNU General Public License as
130176d43eSStelian Pop  * published by the Free Software Foundation; either version 2 of
140176d43eSStelian Pop  * the License, or (at your option) any later version.
150176d43eSStelian Pop  *
160176d43eSStelian Pop  * This program is distributed in the hope that it will be useful,
170176d43eSStelian Pop  * but WITHOUT ANY WARRANTY; without even the implied warranty of
180176d43eSStelian Pop  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
190176d43eSStelian Pop  * GNU General Public License for more details.
200176d43eSStelian Pop  *
210176d43eSStelian Pop  * You should have received a copy of the GNU General Public License
220176d43eSStelian Pop  * along with this program; if not, write to the Free Software
230176d43eSStelian Pop  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
240176d43eSStelian Pop  * MA 02111-1307 USA
250176d43eSStelian Pop  */
260176d43eSStelian Pop 
270176d43eSStelian Pop #ifndef __CONFIG_H
280176d43eSStelian Pop #define __CONFIG_H
290176d43eSStelian Pop 
308c6407fcSReinhard Meyer /*
318c6407fcSReinhard Meyer  * SoC must be defined first, before hardware.h is included.
328c6407fcSReinhard Meyer  * In this case SoC is defined in boards.cfg.
338c6407fcSReinhard Meyer  */
348c6407fcSReinhard Meyer #include <asm/hardware.h>
350176d43eSStelian Pop 
360176d43eSStelian Pop /*
378c6407fcSReinhard Meyer  * Warning: changing CONFIG_SYS_TEXT_BASE requires
388c6407fcSReinhard Meyer  * adapting the initial boot program.
398c6407fcSReinhard Meyer  * Since the linker has to swallow that define, we must use a pure
408c6407fcSReinhard Meyer  * hex number here!
410176d43eSStelian Pop  */
428c6407fcSReinhard Meyer #define CONFIG_SYS_TEXT_BASE		0x21f00000
438c6407fcSReinhard Meyer 
448c6407fcSReinhard Meyer /* ARM asynchronous clock */
458c6407fcSReinhard Meyer #define CONFIG_SYS_AT91_SLOW_CLOCK	32768		/* slow clock xtal */
468c6407fcSReinhard Meyer #define CONFIG_SYS_AT91_MAIN_CLOCK	18432000	/* main clock xtal */
478c6407fcSReinhard Meyer #define CONFIG_SYS_HZ			1000
488c6407fcSReinhard Meyer 
498c6407fcSReinhard Meyer /* Define actual evaluation board type from used processor type */
508c6407fcSReinhard Meyer #ifdef CONFIG_AT91SAM9G20
518c6407fcSReinhard Meyer # define CONFIG_AT91SAM9G20EK	/* It's an Atmel AT91SAM9G20 EK */
528c6407fcSReinhard Meyer #else
538c6407fcSReinhard Meyer # define CONFIG_AT91SAM9260EK	/* It's an Atmel AT91SAM9260 EK */
548c6407fcSReinhard Meyer #endif
558c6407fcSReinhard Meyer 
568c6407fcSReinhard Meyer /* Misc CPU related */
578c6407fcSReinhard Meyer #define CONFIG_ARCH_CPU_INIT
588c6407fcSReinhard Meyer #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
598c6407fcSReinhard Meyer #define CONFIG_SETUP_MEMORY_TAGS
608c6407fcSReinhard Meyer #define CONFIG_INITRD_TAG
618c6407fcSReinhard Meyer #define CONFIG_SKIP_LOWLEVEL_INIT
628c6407fcSReinhard Meyer #define CONFIG_BOARD_EARLY_INIT_F
638c6407fcSReinhard Meyer #define CONFIG_DISPLAY_CPUINFO
648c6407fcSReinhard Meyer 
65f9129fe3SNicolas Ferre #define CONFIG_CMD_BOOTZ
6636873e7dSNicolas Ferre #define CONFIG_OF_LIBFDT
6736873e7dSNicolas Ferre 
688c6407fcSReinhard Meyer /* general purpose I/O */
698c6407fcSReinhard Meyer #define CONFIG_ATMEL_LEGACY		/* required until (g)pio is fixed */
708c6407fcSReinhard Meyer #define CONFIG_AT91_GPIO
718c6407fcSReinhard Meyer #define CONFIG_AT91_GPIO_PULLUP	1	/* keep pullups on peripheral pins */
728c6407fcSReinhard Meyer 
738c6407fcSReinhard Meyer /* serial console */
748c6407fcSReinhard Meyer #define CONFIG_ATMEL_USART
758c6407fcSReinhard Meyer #define CONFIG_USART_BASE		ATMEL_BASE_DBGU
768c6407fcSReinhard Meyer #define	CONFIG_USART_ID			ATMEL_ID_SYS
778c6407fcSReinhard Meyer #define CONFIG_BAUDRATE			115200
780176d43eSStelian Pop 
79a484b00bSJean-Christophe PLAGNIOL-VILLARD /* LED */
80a484b00bSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_AT91_LED
81a484b00bSJean-Christophe PLAGNIOL-VILLARD #define	CONFIG_RED_LED		AT91_PIN_PA9	/* this is the power led */
82a484b00bSJean-Christophe PLAGNIOL-VILLARD #define	CONFIG_GREEN_LED	AT91_PIN_PA6	/* this is the user led */
83a484b00bSJean-Christophe PLAGNIOL-VILLARD 
840176d43eSStelian Pop #define CONFIG_BOOTDELAY	3
850176d43eSStelian Pop 
860176d43eSStelian Pop /*
870176d43eSStelian Pop  * BOOTP options
880176d43eSStelian Pop  */
890176d43eSStelian Pop #define CONFIG_BOOTP_BOOTFILESIZE	1
900176d43eSStelian Pop #define CONFIG_BOOTP_BOOTPATH		1
910176d43eSStelian Pop #define CONFIG_BOOTP_GATEWAY		1
920176d43eSStelian Pop #define CONFIG_BOOTP_HOSTNAME		1
930176d43eSStelian Pop 
940176d43eSStelian Pop /*
950176d43eSStelian Pop  * Command line configuration.
960176d43eSStelian Pop  */
970176d43eSStelian Pop #include <config_cmd_default.h>
980176d43eSStelian Pop #undef CONFIG_CMD_BDI
990176d43eSStelian Pop #undef CONFIG_CMD_FPGA
10074de7aefSWolfgang Denk #undef CONFIG_CMD_IMI
1010176d43eSStelian Pop #undef CONFIG_CMD_IMLS
10274de7aefSWolfgang Denk #undef CONFIG_CMD_LOADS
10374de7aefSWolfgang Denk #undef CONFIG_CMD_SOURCE
1040176d43eSStelian Pop 
1050176d43eSStelian Pop #define CONFIG_CMD_PING		1
1060176d43eSStelian Pop #define CONFIG_CMD_DHCP		1
1070176d43eSStelian Pop #define CONFIG_CMD_NAND		1
1080176d43eSStelian Pop #define CONFIG_CMD_USB		1
1090176d43eSStelian Pop 
1108c6407fcSReinhard Meyer /*
1118c6407fcSReinhard Meyer  * SDRAM: 1 bank, min 32, max 128 MB
1128c6407fcSReinhard Meyer  * Initialized before u-boot gets started.
1138c6407fcSReinhard Meyer  */
1140176d43eSStelian Pop #define CONFIG_NR_DRAM_BANKS		1
1158c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_BASE		ATMEL_BASE_CS1
1168c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_SIZE		0x04000000
1178c6407fcSReinhard Meyer 
1188c6407fcSReinhard Meyer /*
1198c6407fcSReinhard Meyer  * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,
1208c6407fcSReinhard Meyer  * leaving the correct space for initial global data structure above
1218c6407fcSReinhard Meyer  * that address while providing maximum stack area below.
1228c6407fcSReinhard Meyer  */
1238c6407fcSReinhard Meyer #ifdef CONFIG_AT91SAM9XE
1248c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \
1258c6407fcSReinhard Meyer 	(ATMEL_BASE_SRAM + 0x1000 - GENERATED_GBL_DATA_SIZE)
1268c6407fcSReinhard Meyer #else
1278c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \
1288c6407fcSReinhard Meyer 	(ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
1298c6407fcSReinhard Meyer #endif
1300176d43eSStelian Pop 
1310176d43eSStelian Pop /* DataFlash */
1328495faf5SBo Shen #ifndef CONFIG_AT91SAM9G20EK_2MMC
1334758ebddSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ATMEL_DATAFLASH_SPI
1340176d43eSStelian Pop #define CONFIG_HAS_DATAFLASH		1
1356d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
1366d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_DATAFLASH_BANKS		2
1376d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* CS0 */
1386d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1	0xD0000000	/* CS1 */
13979f0cb6eSStelian Pop #define AT91_SPI_CLK			15000000
1408495faf5SBo Shen #endif
141df486b1fSNicolas Ferre 
142df486b1fSNicolas Ferre #ifdef CONFIG_AT91SAM9G20EK
143df486b1fSNicolas Ferre #define DATAFLASH_TCSS			(0x22 << 16)
144df486b1fSNicolas Ferre #else
1450176d43eSStelian Pop #define DATAFLASH_TCSS			(0x1a << 16)
146df486b1fSNicolas Ferre #endif
1470176d43eSStelian Pop #define DATAFLASH_TCHS			(0x1 << 24)
1480176d43eSStelian Pop 
1490176d43eSStelian Pop /* NAND flash */
15074c076d6SJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_CMD_NAND
15174c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_NAND_ATMEL
1526d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_NAND_DEVICE	1
1538c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_BASE		ATMEL_BASE_CS3
1548c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_DBW_8
15574c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_ALE	(1 << 21)
15674c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_CLE	(1 << 22)
15774c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_ENABLE_PIN	AT91_PIN_PC14
15874c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_READY_PIN	AT91_PIN_PC13
15974c076d6SJean-Christophe PLAGNIOL-VILLARD #endif
1600176d43eSStelian Pop 
1610176d43eSStelian Pop /* NOR flash - no real flash on this board */
1626d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NO_FLASH			1
1630176d43eSStelian Pop 
1640176d43eSStelian Pop /* Ethernet */
1650176d43eSStelian Pop #define CONFIG_MACB			1
1660176d43eSStelian Pop #define CONFIG_RMII			1
1670176d43eSStelian Pop #define CONFIG_NET_RETRY_COUNT		20
1680176d43eSStelian Pop #define CONFIG_RESET_PHY_R		1
1690176d43eSStelian Pop 
1700176d43eSStelian Pop /* USB */
1712b7178afSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_USB_ATMEL
1720176d43eSStelian Pop #define CONFIG_USB_OHCI_NEW		1
1730176d43eSStelian Pop #define CONFIG_DOS_PARTITION		1
1746d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
1756d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_REGS_BASE		0x00500000	/* AT91SAM9260_UHP_BASE */
1766d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91sam9260"
1776d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
1780176d43eSStelian Pop #define CONFIG_USB_STORAGE		1
1793e0cda07SStelian Pop #define CONFIG_CMD_FAT			1
1800176d43eSStelian Pop 
1816d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LOAD_ADDR			0x22000000	/* load address */
1820176d43eSStelian Pop 
1838c6407fcSReinhard Meyer #define CONFIG_SYS_MEMTEST_START		CONFIG_SYS_SDRAM_BASE
1846d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MEMTEST_END			0x23e00000
1850176d43eSStelian Pop 
1866d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
1870176d43eSStelian Pop 
1880176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS0 */
189057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH	1
1906d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
1910e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET		0x4200
1926d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
1930e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE		0x4200
194e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND	"cp.b 0xC0084000 0x22000000 0x210000; bootm"
19596996ac2SStelian Pop #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
19696996ac2SStelian Pop 				"root=/dev/mtdblock0 "			\
197918319c7SAlbin Tonnerre 				"mtdparts=atmel_nand:-(root) "		\
19896996ac2SStelian Pop 				"rw rootfstype=jffs2"
1990176d43eSStelian Pop 
2006d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #elif CONFIG_SYS_USE_DATAFLASH_CS1
2010176d43eSStelian Pop 
2020176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS1 */
203057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH	1
2046d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
2050e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET		0x4200
2066d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + CONFIG_ENV_OFFSET)
2070e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE		0x4200
208e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND	"cp.b 0xD0084000 0x22000000 0x210000; bootm"
20996996ac2SStelian Pop #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
21096996ac2SStelian Pop 				"root=/dev/mtdblock0 "			\
211918319c7SAlbin Tonnerre 				"mtdparts=atmel_nand:-(root) "		\
21296996ac2SStelian Pop 				"rw rootfstype=jffs2"
2130176d43eSStelian Pop 
2146d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #else /* CONFIG_SYS_USE_NANDFLASH */
2150176d43eSStelian Pop 
2160176d43eSStelian Pop /* bootstrap + u-boot + env + linux in nandflash */
21751bfee19SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_NAND	1
218*0c58cfa9SBo Shen #define CONFIG_ENV_OFFSET		0xc0000
219*0c58cfa9SBo Shen #define CONFIG_ENV_OFFSET_REDUND	0x100000
2200e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE		0x20000		/* 1 sector = 128 kB */
221*0c58cfa9SBo Shen #define CONFIG_BOOTCOMMAND	"nand read 0x22000000 0x200000 0x300000; bootm"
222*0c58cfa9SBo Shen #define CONFIG_BOOTARGS							\
223*0c58cfa9SBo Shen 	"console=ttyS0,115200 earlyprintk "				\
224*0c58cfa9SBo Shen 	"mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,"		\
225*0c58cfa9SBo Shen 	"256k(env),256k(env_redundant),256k(spare),"			\
226*0c58cfa9SBo Shen 	"512k(dtb),6M(kernel)ro,-(rootfs) "				\
227*0c58cfa9SBo Shen 	"root=/dev/mtdblock7 rw rootfstype=jffs2"
2280176d43eSStelian Pop 
2290176d43eSStelian Pop #endif
2300176d43eSStelian Pop 
2316d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_PROMPT		"U-Boot> "
2326d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_CBSIZE		256
2336d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAXARGS		16
2346d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
2356d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LONGHELP		1
2360176d43eSStelian Pop #define CONFIG_CMDLINE_EDITING	1
237e139cb31SAlexandre Belloni #define CONFIG_AUTO_COMPLETE
2380176d43eSStelian Pop 
2390176d43eSStelian Pop /*
2400176d43eSStelian Pop  * Size of malloc() pool
2410176d43eSStelian Pop  */
2426d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
2430176d43eSStelian Pop 
2440176d43eSStelian Pop #endif
245