xref: /rk3399_rockchip-uboot/include/configs/at91sam9260ek.h (revision dcd2f1a0d2875a1386535e2e0db9bfbd57a8fadb)
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  *
81a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
90176d43eSStelian Pop  */
100176d43eSStelian Pop 
110176d43eSStelian Pop #ifndef __CONFIG_H
120176d43eSStelian Pop #define __CONFIG_H
130176d43eSStelian Pop 
148c6407fcSReinhard Meyer /*
158c6407fcSReinhard Meyer  * SoC must be defined first, before hardware.h is included.
168c6407fcSReinhard Meyer  * In this case SoC is defined in boards.cfg.
178c6407fcSReinhard Meyer  */
188c6407fcSReinhard Meyer #include <asm/hardware.h>
190176d43eSStelian Pop 
200176d43eSStelian Pop /*
218c6407fcSReinhard Meyer  * Warning: changing CONFIG_SYS_TEXT_BASE requires
228c6407fcSReinhard Meyer  * adapting the initial boot program.
238c6407fcSReinhard Meyer  * Since the linker has to swallow that define, we must use a pure
248c6407fcSReinhard Meyer  * hex number here!
250176d43eSStelian Pop  */
268c6407fcSReinhard Meyer #define CONFIG_SYS_TEXT_BASE		0x21f00000
278c6407fcSReinhard Meyer 
288c6407fcSReinhard Meyer /* ARM asynchronous clock */
298c6407fcSReinhard Meyer #define CONFIG_SYS_AT91_SLOW_CLOCK	32768		/* slow clock xtal */
308c6407fcSReinhard Meyer #define CONFIG_SYS_AT91_MAIN_CLOCK	18432000	/* main clock xtal */
318c6407fcSReinhard Meyer #define CONFIG_SYS_HZ			1000
328c6407fcSReinhard Meyer 
338c6407fcSReinhard Meyer /* Define actual evaluation board type from used processor type */
348c6407fcSReinhard Meyer #ifdef CONFIG_AT91SAM9G20
358c6407fcSReinhard Meyer # define CONFIG_AT91SAM9G20EK	/* It's an Atmel AT91SAM9G20 EK */
368c6407fcSReinhard Meyer #else
378c6407fcSReinhard Meyer # define CONFIG_AT91SAM9260EK	/* It's an Atmel AT91SAM9260 EK */
388c6407fcSReinhard Meyer #endif
398c6407fcSReinhard Meyer 
408c6407fcSReinhard Meyer /* Misc CPU related */
418c6407fcSReinhard Meyer #define CONFIG_ARCH_CPU_INIT
428c6407fcSReinhard Meyer #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
438c6407fcSReinhard Meyer #define CONFIG_SETUP_MEMORY_TAGS
448c6407fcSReinhard Meyer #define CONFIG_INITRD_TAG
458c6407fcSReinhard Meyer #define CONFIG_SKIP_LOWLEVEL_INIT
468c6407fcSReinhard Meyer #define CONFIG_BOARD_EARLY_INIT_F
478c6407fcSReinhard Meyer #define CONFIG_DISPLAY_CPUINFO
488c6407fcSReinhard Meyer 
49f9129fe3SNicolas Ferre #define CONFIG_CMD_BOOTZ
5036873e7dSNicolas Ferre #define CONFIG_OF_LIBFDT
5136873e7dSNicolas Ferre 
528c6407fcSReinhard Meyer /* general purpose I/O */
538c6407fcSReinhard Meyer #define CONFIG_ATMEL_LEGACY		/* required until (g)pio is fixed */
548c6407fcSReinhard Meyer #define CONFIG_AT91_GPIO
558c6407fcSReinhard Meyer #define CONFIG_AT91_GPIO_PULLUP	1	/* keep pullups on peripheral pins */
568c6407fcSReinhard Meyer 
578c6407fcSReinhard Meyer /* serial console */
588c6407fcSReinhard Meyer #define CONFIG_ATMEL_USART
598c6407fcSReinhard Meyer #define CONFIG_USART_BASE		ATMEL_BASE_DBGU
608c6407fcSReinhard Meyer #define	CONFIG_USART_ID			ATMEL_ID_SYS
618c6407fcSReinhard Meyer #define CONFIG_BAUDRATE			115200
620176d43eSStelian Pop 
63a484b00bSJean-Christophe PLAGNIOL-VILLARD /* LED */
64a484b00bSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_AT91_LED
65a484b00bSJean-Christophe PLAGNIOL-VILLARD #define	CONFIG_RED_LED		AT91_PIN_PA9	/* this is the power led */
66a484b00bSJean-Christophe PLAGNIOL-VILLARD #define	CONFIG_GREEN_LED	AT91_PIN_PA6	/* this is the user led */
67a484b00bSJean-Christophe PLAGNIOL-VILLARD 
680176d43eSStelian Pop #define CONFIG_BOOTDELAY	3
690176d43eSStelian Pop 
700176d43eSStelian Pop /*
710176d43eSStelian Pop  * BOOTP options
720176d43eSStelian Pop  */
730176d43eSStelian Pop #define CONFIG_BOOTP_BOOTFILESIZE	1
740176d43eSStelian Pop #define CONFIG_BOOTP_BOOTPATH		1
750176d43eSStelian Pop #define CONFIG_BOOTP_GATEWAY		1
760176d43eSStelian Pop #define CONFIG_BOOTP_HOSTNAME		1
770176d43eSStelian Pop 
780176d43eSStelian Pop /*
790176d43eSStelian Pop  * Command line configuration.
800176d43eSStelian Pop  */
810176d43eSStelian Pop #include <config_cmd_default.h>
820176d43eSStelian Pop #undef CONFIG_CMD_BDI
830176d43eSStelian Pop #undef CONFIG_CMD_FPGA
8474de7aefSWolfgang Denk #undef CONFIG_CMD_IMI
850176d43eSStelian Pop #undef CONFIG_CMD_IMLS
8674de7aefSWolfgang Denk #undef CONFIG_CMD_LOADS
8774de7aefSWolfgang Denk #undef CONFIG_CMD_SOURCE
880176d43eSStelian Pop 
890176d43eSStelian Pop #define CONFIG_CMD_PING		1
900176d43eSStelian Pop #define CONFIG_CMD_DHCP		1
910176d43eSStelian Pop #define CONFIG_CMD_NAND		1
92a73267a7SWu, Josh #define CONFIG_CMD_MMC
93a73267a7SWu, Josh #define CONFIG_CMD_FAT
940176d43eSStelian Pop #define CONFIG_CMD_USB		1
950176d43eSStelian Pop 
968c6407fcSReinhard Meyer /*
978c6407fcSReinhard Meyer  * SDRAM: 1 bank, min 32, max 128 MB
988c6407fcSReinhard Meyer  * Initialized before u-boot gets started.
998c6407fcSReinhard Meyer  */
1000176d43eSStelian Pop #define CONFIG_NR_DRAM_BANKS		1
1018c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_BASE		ATMEL_BASE_CS1
1028c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_SIZE		0x04000000
1038c6407fcSReinhard Meyer 
1048c6407fcSReinhard Meyer /*
1058c6407fcSReinhard Meyer  * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,
1068c6407fcSReinhard Meyer  * leaving the correct space for initial global data structure above
1078c6407fcSReinhard Meyer  * that address while providing maximum stack area below.
1088c6407fcSReinhard Meyer  */
1098c6407fcSReinhard Meyer #ifdef CONFIG_AT91SAM9XE
1108c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \
1118c6407fcSReinhard Meyer 	(ATMEL_BASE_SRAM + 0x1000 - GENERATED_GBL_DATA_SIZE)
1128c6407fcSReinhard Meyer #else
1138c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \
1148c6407fcSReinhard Meyer 	(ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE)
1158c6407fcSReinhard Meyer #endif
1160176d43eSStelian Pop 
117d0a51373SAndreas Bießmann /*
118d0a51373SAndreas Bießmann  * The (arm)linux board id set by generic code depending on configured board
119d0a51373SAndreas Bießmann  * (see boards.cfg for different boards)
120d0a51373SAndreas Bießmann  */
121d0a51373SAndreas Bießmann #ifdef CONFIG_AT91SAM9G20
122d0a51373SAndreas Bießmann 	/* the sam9g20 variants have two different board ids */
123d0a51373SAndreas Bießmann # ifdef CONFIG_AT91SAM9G20EK_2MMC
124d0a51373SAndreas Bießmann 	/* we may be setup for the 2MMC variant of at91sam9g20ek */
125d0a51373SAndreas Bießmann #  define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC
126d0a51373SAndreas Bießmann # else
127d0a51373SAndreas Bießmann 	/* or the normal at91sam9g20ek */
128d0a51373SAndreas Bießmann #  define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK
129d0a51373SAndreas Bießmann # endif
130d0a51373SAndreas Bießmann #else
131d0a51373SAndreas Bießmann 	/* otherwise default to good old at91sam9260ek */
132d0a51373SAndreas Bießmann # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9260EK
133d0a51373SAndreas Bießmann #endif
134d0a51373SAndreas Bießmann 
1350176d43eSStelian Pop /* DataFlash */
1368495faf5SBo Shen #ifndef CONFIG_AT91SAM9G20EK_2MMC
1374758ebddSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ATMEL_DATAFLASH_SPI
1380176d43eSStelian Pop #define CONFIG_HAS_DATAFLASH		1
1396d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
1406d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_DATAFLASH_BANKS		2
1416d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* CS0 */
1426d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1	0xD0000000	/* CS1 */
14379f0cb6eSStelian Pop #define AT91_SPI_CLK			15000000
1448495faf5SBo Shen #endif
145df486b1fSNicolas Ferre 
146df486b1fSNicolas Ferre #ifdef CONFIG_AT91SAM9G20EK
147df486b1fSNicolas Ferre #define DATAFLASH_TCSS			(0x22 << 16)
148df486b1fSNicolas Ferre #else
1490176d43eSStelian Pop #define DATAFLASH_TCSS			(0x1a << 16)
150df486b1fSNicolas Ferre #endif
1510176d43eSStelian Pop #define DATAFLASH_TCHS			(0x1 << 24)
1520176d43eSStelian Pop 
1530176d43eSStelian Pop /* NAND flash */
15474c076d6SJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_CMD_NAND
15574c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_NAND_ATMEL
1566d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_NAND_DEVICE	1
1578c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_BASE		ATMEL_BASE_CS3
1588c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_DBW_8
15974c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_ALE	(1 << 21)
16074c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_CLE	(1 << 22)
16174c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_ENABLE_PIN	AT91_PIN_PC14
16274c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_READY_PIN	AT91_PIN_PC13
16374c076d6SJean-Christophe PLAGNIOL-VILLARD #endif
1640176d43eSStelian Pop 
165a73267a7SWu, Josh /* MMC */
166a73267a7SWu, Josh #ifdef CONFIG_CMD_MMC
167a73267a7SWu, Josh #define CONFIG_MMC
168a73267a7SWu, Josh #define CONFIG_GENERIC_MMC
169a73267a7SWu, Josh #define CONFIG_GENERIC_ATMEL_MCI
170a73267a7SWu, Josh #endif
171a73267a7SWu, Josh 
172a73267a7SWu, Josh /* FAT */
173a73267a7SWu, Josh #ifdef CONFIG_CMD_FAT
174a73267a7SWu, Josh #define CONFIG_DOS_PARTITION
175a73267a7SWu, Josh #endif
176a73267a7SWu, Josh 
1770176d43eSStelian Pop /* NOR flash - no real flash on this board */
1786d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NO_FLASH			1
1790176d43eSStelian Pop 
1800176d43eSStelian Pop /* Ethernet */
1810176d43eSStelian Pop #define CONFIG_MACB			1
1820176d43eSStelian Pop #define CONFIG_RMII			1
1830176d43eSStelian Pop #define CONFIG_NET_RETRY_COUNT		20
1840176d43eSStelian Pop #define CONFIG_RESET_PHY_R		1
1850176d43eSStelian Pop 
1860176d43eSStelian Pop /* USB */
1872b7178afSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_USB_ATMEL
188*dcd2f1a0SBo Shen #define CONFIG_USB_ATMEL_CLK_SEL_PLLB
1890176d43eSStelian Pop #define CONFIG_USB_OHCI_NEW		1
1906d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
1916d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_REGS_BASE		0x00500000	/* AT91SAM9260_UHP_BASE */
1926d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91sam9260"
1936d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
1940176d43eSStelian Pop #define CONFIG_USB_STORAGE		1
1950176d43eSStelian Pop 
1966d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LOAD_ADDR			0x22000000	/* load address */
1970176d43eSStelian Pop 
1988c6407fcSReinhard Meyer #define CONFIG_SYS_MEMTEST_START		CONFIG_SYS_SDRAM_BASE
1996d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MEMTEST_END			0x23e00000
2000176d43eSStelian Pop 
2016d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_SYS_USE_DATAFLASH_CS0
2020176d43eSStelian Pop 
2030176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS0 */
204057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH	1
2056d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
2060e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET		0x4200
2076d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
2080e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE		0x4200
209e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND	"cp.b 0xC0084000 0x22000000 0x210000; bootm"
21096996ac2SStelian Pop #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
21196996ac2SStelian Pop 				"root=/dev/mtdblock0 "			\
212918319c7SAlbin Tonnerre 				"mtdparts=atmel_nand:-(root) "		\
21396996ac2SStelian Pop 				"rw rootfstype=jffs2"
2140176d43eSStelian Pop 
2156d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #elif CONFIG_SYS_USE_DATAFLASH_CS1
2160176d43eSStelian Pop 
2170176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS1 */
218057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH	1
2196d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
2200e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET		0x4200
2216d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + CONFIG_ENV_OFFSET)
2220e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE		0x4200
223e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND	"cp.b 0xD0084000 0x22000000 0x210000; bootm"
22496996ac2SStelian Pop #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
22596996ac2SStelian Pop 				"root=/dev/mtdblock0 "			\
226918319c7SAlbin Tonnerre 				"mtdparts=atmel_nand:-(root) "		\
22796996ac2SStelian Pop 				"rw rootfstype=jffs2"
2280176d43eSStelian Pop 
22924802073SWu, Josh #elif defined(CONFIG_SYS_USE_NANDFLASH)
2300176d43eSStelian Pop 
2310176d43eSStelian Pop /* bootstrap + u-boot + env + linux in nandflash */
23251bfee19SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_NAND	1
2330c58cfa9SBo Shen #define CONFIG_ENV_OFFSET		0xc0000
2340c58cfa9SBo Shen #define CONFIG_ENV_OFFSET_REDUND	0x100000
2350e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE		0x20000		/* 1 sector = 128 kB */
2360c58cfa9SBo Shen #define CONFIG_BOOTCOMMAND	"nand read 0x22000000 0x200000 0x300000; bootm"
2370c58cfa9SBo Shen #define CONFIG_BOOTARGS							\
2380c58cfa9SBo Shen 	"console=ttyS0,115200 earlyprintk "				\
2390c58cfa9SBo Shen 	"mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,"		\
2400c58cfa9SBo Shen 	"256k(env),256k(env_redundant),256k(spare),"			\
2410c58cfa9SBo Shen 	"512k(dtb),6M(kernel)ro,-(rootfs) "				\
2420c58cfa9SBo Shen 	"root=/dev/mtdblock7 rw rootfstype=jffs2"
2430176d43eSStelian Pop 
24424802073SWu, Josh #else	/* CONFIG_SYS_USE_MMC */
24524802073SWu, Josh /* bootstrap + u-boot + env + linux in mmc */
24624802073SWu, Josh #define CONFIG_ENV_IS_IN_MMC
24724802073SWu, Josh /* For FAT system, most cases it should be in the reserved sector */
24824802073SWu, Josh #define CONFIG_ENV_OFFSET		0x2000
24924802073SWu, Josh #define CONFIG_ENV_SIZE			0x1000
25024802073SWu, Josh #define CONFIG_SYS_MMC_ENV_DEV		0
25124802073SWu, Josh 
25224802073SWu, Josh #define CONFIG_BOOTCOMMAND						\
25324802073SWu, Josh 	"fatload mmc 0:1 0x22000000 uImage; bootm"
25424802073SWu, Josh #define CONFIG_BOOTARGS							\
25524802073SWu, Josh 	"console=ttyS0,115200 earlyprintk "				\
25624802073SWu, Josh 	"mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,"		\
25724802073SWu, Josh 	"256k(env),256k(env_redundant),256k(spare),"			\
25824802073SWu, Josh 	"512k(dtb),6M(kernel)ro,-(rootfs) "				\
25924802073SWu, Josh 	"root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait"
2600176d43eSStelian Pop #endif
2610176d43eSStelian Pop 
2626d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_PROMPT		"U-Boot> "
2636d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_CBSIZE		256
2646d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAXARGS		16
2656d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
2666d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LONGHELP		1
2670176d43eSStelian Pop #define CONFIG_CMDLINE_EDITING	1
268e139cb31SAlexandre Belloni #define CONFIG_AUTO_COMPLETE
2690176d43eSStelian Pop 
2700176d43eSStelian Pop /*
2710176d43eSStelian Pop  * Size of malloc() pool
2720176d43eSStelian Pop  */
2736d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
2740176d43eSStelian Pop 
2750176d43eSStelian Pop #endif
276