xref: /rk3399_rockchip-uboot/include/configs/at91sam9260ek.h (revision a73267a7ce8adea9d062a58db896ca4275333c68)
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
108*a73267a7SWu, Josh #define CONFIG_CMD_MMC
109*a73267a7SWu, Josh #define CONFIG_CMD_FAT
1100176d43eSStelian Pop #define CONFIG_CMD_USB		1
1110176d43eSStelian Pop 
1128c6407fcSReinhard Meyer /*
1138c6407fcSReinhard Meyer  * SDRAM: 1 bank, min 32, max 128 MB
1148c6407fcSReinhard Meyer  * Initialized before u-boot gets started.
1158c6407fcSReinhard Meyer  */
1160176d43eSStelian Pop #define CONFIG_NR_DRAM_BANKS		1
1178c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_BASE		ATMEL_BASE_CS1
1188c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_SIZE		0x04000000
1198c6407fcSReinhard Meyer 
1208c6407fcSReinhard Meyer /*
1218c6407fcSReinhard Meyer  * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,
1228c6407fcSReinhard Meyer  * leaving the correct space for initial global data structure above
1238c6407fcSReinhard Meyer  * that address while providing maximum stack area below.
1248c6407fcSReinhard Meyer  */
1258c6407fcSReinhard Meyer #ifdef CONFIG_AT91SAM9XE
1268c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \
1278c6407fcSReinhard Meyer 	(ATMEL_BASE_SRAM + 0x1000 - GENERATED_GBL_DATA_SIZE)
1288c6407fcSReinhard Meyer #else
1298c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \
1308c6407fcSReinhard Meyer 	(ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
1318c6407fcSReinhard Meyer #endif
1320176d43eSStelian Pop 
1330176d43eSStelian Pop /* DataFlash */
1348495faf5SBo Shen #ifndef CONFIG_AT91SAM9G20EK_2MMC
1354758ebddSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ATMEL_DATAFLASH_SPI
1360176d43eSStelian Pop #define CONFIG_HAS_DATAFLASH		1
1376d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
1386d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_DATAFLASH_BANKS		2
1396d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* CS0 */
1406d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1	0xD0000000	/* CS1 */
14179f0cb6eSStelian Pop #define AT91_SPI_CLK			15000000
1428495faf5SBo Shen #endif
143df486b1fSNicolas Ferre 
144df486b1fSNicolas Ferre #ifdef CONFIG_AT91SAM9G20EK
145df486b1fSNicolas Ferre #define DATAFLASH_TCSS			(0x22 << 16)
146df486b1fSNicolas Ferre #else
1470176d43eSStelian Pop #define DATAFLASH_TCSS			(0x1a << 16)
148df486b1fSNicolas Ferre #endif
1490176d43eSStelian Pop #define DATAFLASH_TCHS			(0x1 << 24)
1500176d43eSStelian Pop 
1510176d43eSStelian Pop /* NAND flash */
15274c076d6SJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_CMD_NAND
15374c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_NAND_ATMEL
1546d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_NAND_DEVICE	1
1558c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_BASE		ATMEL_BASE_CS3
1568c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_DBW_8
15774c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_ALE	(1 << 21)
15874c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_CLE	(1 << 22)
15974c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_ENABLE_PIN	AT91_PIN_PC14
16074c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_READY_PIN	AT91_PIN_PC13
16174c076d6SJean-Christophe PLAGNIOL-VILLARD #endif
1620176d43eSStelian Pop 
163*a73267a7SWu, Josh /* MMC */
164*a73267a7SWu, Josh #ifdef CONFIG_CMD_MMC
165*a73267a7SWu, Josh #define CONFIG_MMC
166*a73267a7SWu, Josh #define CONFIG_GENERIC_MMC
167*a73267a7SWu, Josh #define CONFIG_GENERIC_ATMEL_MCI
168*a73267a7SWu, Josh #endif
169*a73267a7SWu, Josh 
170*a73267a7SWu, Josh /* FAT */
171*a73267a7SWu, Josh #ifdef CONFIG_CMD_FAT
172*a73267a7SWu, Josh #define CONFIG_DOS_PARTITION
173*a73267a7SWu, Josh #endif
174*a73267a7SWu, Josh 
1750176d43eSStelian Pop /* NOR flash - no real flash on this board */
1766d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NO_FLASH			1
1770176d43eSStelian Pop 
1780176d43eSStelian Pop /* Ethernet */
1790176d43eSStelian Pop #define CONFIG_MACB			1
1800176d43eSStelian Pop #define CONFIG_RMII			1
1810176d43eSStelian Pop #define CONFIG_NET_RETRY_COUNT		20
1820176d43eSStelian Pop #define CONFIG_RESET_PHY_R		1
1830176d43eSStelian Pop 
1840176d43eSStelian Pop /* USB */
1852b7178afSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_USB_ATMEL
1860176d43eSStelian Pop #define CONFIG_USB_OHCI_NEW		1
1876d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
1886d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_REGS_BASE		0x00500000	/* AT91SAM9260_UHP_BASE */
1896d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91sam9260"
1906d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
1910176d43eSStelian Pop #define CONFIG_USB_STORAGE		1
1920176d43eSStelian Pop 
1936d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LOAD_ADDR			0x22000000	/* load address */
1940176d43eSStelian Pop 
1958c6407fcSReinhard Meyer #define CONFIG_SYS_MEMTEST_START		CONFIG_SYS_SDRAM_BASE
1966d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MEMTEST_END			0x23e00000
1970176d43eSStelian Pop 
1986d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
1990176d43eSStelian Pop 
2000176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS0 */
201057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH	1
2026d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
2030e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET		0x4200
2046d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
2050e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE		0x4200
206e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND	"cp.b 0xC0084000 0x22000000 0x210000; bootm"
20796996ac2SStelian Pop #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
20896996ac2SStelian Pop 				"root=/dev/mtdblock0 "			\
209918319c7SAlbin Tonnerre 				"mtdparts=atmel_nand:-(root) "		\
21096996ac2SStelian Pop 				"rw rootfstype=jffs2"
2110176d43eSStelian Pop 
2126d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #elif CONFIG_SYS_USE_DATAFLASH_CS1
2130176d43eSStelian Pop 
2140176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS1 */
215057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH	1
2166d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
2170e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET		0x4200
2186d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + CONFIG_ENV_OFFSET)
2190e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE		0x4200
220e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND	"cp.b 0xD0084000 0x22000000 0x210000; bootm"
22196996ac2SStelian Pop #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
22296996ac2SStelian Pop 				"root=/dev/mtdblock0 "			\
223918319c7SAlbin Tonnerre 				"mtdparts=atmel_nand:-(root) "		\
22496996ac2SStelian Pop 				"rw rootfstype=jffs2"
2250176d43eSStelian Pop 
2266d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #else /* CONFIG_SYS_USE_NANDFLASH */
2270176d43eSStelian Pop 
2280176d43eSStelian Pop /* bootstrap + u-boot + env + linux in nandflash */
22951bfee19SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_NAND	1
2300c58cfa9SBo Shen #define CONFIG_ENV_OFFSET		0xc0000
2310c58cfa9SBo Shen #define CONFIG_ENV_OFFSET_REDUND	0x100000
2320e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE		0x20000		/* 1 sector = 128 kB */
2330c58cfa9SBo Shen #define CONFIG_BOOTCOMMAND	"nand read 0x22000000 0x200000 0x300000; bootm"
2340c58cfa9SBo Shen #define CONFIG_BOOTARGS							\
2350c58cfa9SBo Shen 	"console=ttyS0,115200 earlyprintk "				\
2360c58cfa9SBo Shen 	"mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,"		\
2370c58cfa9SBo Shen 	"256k(env),256k(env_redundant),256k(spare),"			\
2380c58cfa9SBo Shen 	"512k(dtb),6M(kernel)ro,-(rootfs) "				\
2390c58cfa9SBo Shen 	"root=/dev/mtdblock7 rw rootfstype=jffs2"
2400176d43eSStelian Pop 
2410176d43eSStelian Pop #endif
2420176d43eSStelian Pop 
2436d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_PROMPT		"U-Boot> "
2446d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_CBSIZE		256
2456d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAXARGS		16
2466d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
2476d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LONGHELP		1
2480176d43eSStelian Pop #define CONFIG_CMDLINE_EDITING	1
249e139cb31SAlexandre Belloni #define CONFIG_AUTO_COMPLETE
2500176d43eSStelian Pop 
2510176d43eSStelian Pop /*
2520176d43eSStelian Pop  * Size of malloc() pool
2530176d43eSStelian Pop  */
2546d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
2550176d43eSStelian Pop 
2560176d43eSStelian Pop #endif
257