xref: /rk3399_rockchip-uboot/include/configs/at91sam9n12ek.h (revision dcd2f1a0d2875a1386535e2e0db9bfbd57a8fadb)
19e336903SWu, Josh /*
29e336903SWu, Josh  * (C) Copyright 2013 Atmel Corporation.
39e336903SWu, Josh  * Josh Wu <josh.wu@atmel.com>
49e336903SWu, Josh  *
59e336903SWu, Josh  * Configuation settings for the AT91SAM9N12-EK boards.
69e336903SWu, Josh  *
71a459660SWolfgang Denk  * SPDX-License-Identifier:	GPL-2.0+
89e336903SWu, Josh  */
99e336903SWu, Josh 
109e336903SWu, Josh #ifndef __AT91SAM9N12_CONFIG_H_
119e336903SWu, Josh #define __AT91SAM9N12_CONFIG_H_
129e336903SWu, Josh 
139e336903SWu, Josh /*
149e336903SWu, Josh  * SoC must be defined first, before hardware.h is included.
159e336903SWu, Josh  * In this case SoC is defined in boards.cfg.
169e336903SWu, Josh  */
179e336903SWu, Josh #include <asm/hardware.h>
189e336903SWu, Josh 
199e336903SWu, Josh #define CONFIG_SYS_TEXT_BASE		0x26f00000
209e336903SWu, Josh 
219e336903SWu, Josh #define CONFIG_ARM926EJS
229e336903SWu, Josh #define CONFIG_AT91FAMILY
239e336903SWu, Josh 
249e336903SWu, Josh /* ARM asynchronous clock */
259e336903SWu, Josh #define CONFIG_SYS_AT91_SLOW_CLOCK	32768		/* slow clock xtal */
269e336903SWu, Josh #define CONFIG_SYS_AT91_MAIN_CLOCK	16000000	/* main clock xtal */
279e336903SWu, Josh #define CONFIG_SYS_HZ			1000
289e336903SWu, Josh 
299e336903SWu, Josh /* Misc CPU related */
309e336903SWu, Josh #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
319e336903SWu, Josh #define CONFIG_SETUP_MEMORY_TAGS
329e336903SWu, Josh #define CONFIG_INITRD_TAG
339e336903SWu, Josh #define CONFIG_SKIP_LOWLEVEL_INIT
349e336903SWu, Josh #define CONFIG_BOARD_EARLY_INIT_F
359e336903SWu, Josh #define CONFIG_DISPLAY_CPUINFO
369e336903SWu, Josh 
379e336903SWu, Josh #define CONFIG_OF_LIBFDT
389e336903SWu, Josh 
399e336903SWu, Josh /* general purpose I/O */
409e336903SWu, Josh #define CONFIG_AT91_GPIO
419e336903SWu, Josh 
429e336903SWu, Josh /* serial console */
439e336903SWu, Josh #define CONFIG_ATMEL_USART
449e336903SWu, Josh #define CONFIG_USART_BASE		ATMEL_BASE_DBGU
459e336903SWu, Josh #define CONFIG_USART_ID			ATMEL_ID_SYS
469e336903SWu, Josh #define CONFIG_BAUDRATE			115200
479e336903SWu, Josh 
489e336903SWu, Josh /* LCD */
499e336903SWu, Josh #define CONFIG_LCD
509e336903SWu, Josh #define LCD_BPP				LCD_COLOR16
519e336903SWu, Josh #define LCD_OUTPUT_BPP			24
529e336903SWu, Josh #define CONFIG_LCD_LOGO
539e336903SWu, Josh #define CONFIG_LCD_INFO
549e336903SWu, Josh #define CONFIG_LCD_INFO_BELOW_LOGO
559e336903SWu, Josh #define CONFIG_SYS_WHITE_ON_BLACK
569e336903SWu, Josh #define CONFIG_ATMEL_HLCD
579e336903SWu, Josh #define CONFIG_ATMEL_LCD_RGB565
589e336903SWu, Josh #define CONFIG_SYS_CONSOLE_IS_IN_ENV
599e336903SWu, Josh 
609e336903SWu, Josh #define CONFIG_BOOTDELAY		3
619e336903SWu, Josh 
629e336903SWu, Josh /*
639e336903SWu, Josh  * BOOTP options
649e336903SWu, Josh  */
659e336903SWu, Josh #define CONFIG_BOOTP_BOOTFILESIZE
669e336903SWu, Josh #define CONFIG_BOOTP_BOOTPATH
679e336903SWu, Josh #define CONFIG_BOOTP_GATEWAY
689e336903SWu, Josh #define CONFIG_BOOTP_HOSTNAME
699e336903SWu, Josh 
709e336903SWu, Josh /* NOR flash - no real flash on this board */
719e336903SWu, Josh #define CONFIG_SYS_NO_FLASH
729e336903SWu, Josh 
739e336903SWu, Josh /*
749e336903SWu, Josh  * Command line configuration.
759e336903SWu, Josh  */
769e336903SWu, Josh #include <config_cmd_default.h>
779e336903SWu, Josh #undef CONFIG_CMD_FPGA
789e336903SWu, Josh 
799e336903SWu, Josh #define CONFIG_CMD_BOOTZ
809e336903SWu, Josh #define CONFIG_CMD_PING
819e336903SWu, Josh #define CONFIG_CMD_DHCP
829e336903SWu, Josh #define CONFIG_CMD_NAND
839e336903SWu, Josh #define CONFIG_CMD_SF
849e336903SWu, Josh #define CONFIG_CMD_MMC
859e336903SWu, Josh #define CONFIG_CMD_FAT
86d9bef0adSBo Shen #define CONFIG_CMD_USB
879e336903SWu, Josh 
889e336903SWu, Josh #define CONFIG_NR_DRAM_BANKS		1
899e336903SWu, Josh #define CONFIG_SYS_SDRAM_BASE		0x20000000
909e336903SWu, Josh #define CONFIG_SYS_SDRAM_SIZE		0x08000000
919e336903SWu, Josh 
929e336903SWu, Josh /*
939e336903SWu, Josh  * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM,
949e336903SWu, Josh  * leaving the correct space for initial global data structure above
959e336903SWu, Josh  * that address while providing maximum stack area below.
969e336903SWu, Josh  */
979e336903SWu, Josh # define CONFIG_SYS_INIT_SP_ADDR \
989e336903SWu, Josh 	(ATMEL_BASE_SRAM + 0x1000 - GENERATED_GBL_DATA_SIZE)
999e336903SWu, Josh 
1009e336903SWu, Josh /* DataFlash */
1019e336903SWu, Josh #ifdef CONFIG_CMD_SF
1029e336903SWu, Josh #define CONFIG_ATMEL_SPI
1039e336903SWu, Josh #define CONFIG_SPI_FLASH
1049e336903SWu, Josh #define CONFIG_SPI_FLASH_ATMEL
1059e336903SWu, Josh #define CONFIG_SF_DEFAULT_SPEED		30000000
1069e336903SWu, Josh #define CONFIG_ENV_SPI_MODE		SPI_MODE_3
1079e336903SWu, Josh #define CONFIG_SF_DEFAULT_MODE		SPI_MODE_3
1089e336903SWu, Josh #endif
1099e336903SWu, Josh 
1109e336903SWu, Josh /* NAND flash */
1119e336903SWu, Josh #ifdef CONFIG_CMD_NAND
1129e336903SWu, Josh #define CONFIG_NAND_ATMEL
1139e336903SWu, Josh #define CONFIG_SYS_MAX_NAND_DEVICE	1
1149e336903SWu, Josh #define CONFIG_SYS_NAND_BASE		0x40000000
1159e336903SWu, Josh #define CONFIG_SYS_NAND_MASK_ALE	(1 << 21)
1169e336903SWu, Josh #define CONFIG_SYS_NAND_MASK_CLE	(1 << 22)
1179e336903SWu, Josh #define CONFIG_SYS_NAND_ENABLE_PIN	AT91_PIO_PORTD, 4
1189e336903SWu, Josh #define CONFIG_SYS_NAND_READY_PIN	AT91_PIO_PORTD, 5
1199e336903SWu, Josh 
1209e336903SWu, Josh /* PMECC & PMERRLOC */
1219e336903SWu, Josh #define CONFIG_ATMEL_NAND_HWECC
1229e336903SWu, Josh #define CONFIG_ATMEL_NAND_HW_PMECC
1239e336903SWu, Josh #define CONFIG_PMECC_CAP		2
1249e336903SWu, Josh #define CONFIG_PMECC_SECTOR_SIZE	512
1259e336903SWu, Josh #define CONFIG_PMECC_INDEX_TABLE_OFFSET	0x8000
126ce76f0aaSBo Shen 
127ce76f0aaSBo Shen #define CONFIG_CMD_NAND_TRIMFFS
128ce76f0aaSBo Shen 
1299e336903SWu, Josh #endif
1309e336903SWu, Josh 
1319e336903SWu, Josh #define CONFIG_MTD_PARTITIONS
1329e336903SWu, Josh #define CONFIG_MTD_DEVICE
1339e336903SWu, Josh #define CONFIG_CMD_MTDPARTS
1349e336903SWu, Josh #define MTDIDS_DEFAULT			"nand0=atmel_nand"
1359e336903SWu, Josh #define MTDPARTS_DEFAULT						\
1369e336903SWu, Josh 	"mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,"		\
1379e336903SWu, Josh 	"256k(env),256k(env_redundant),256k(spare),"			\
1389e336903SWu, Josh 	"512k(dtb),6M(kernel)ro,-(rootfs)"
1399e336903SWu, Josh 
1409e336903SWu, Josh #define CONFIG_EXTRA_ENV_SETTINGS                                       \
1419e336903SWu, Josh 	"console=console=ttyS0,115200\0"                                \
1429e336903SWu, Josh 	"mtdparts="MTDPARTS_DEFAULT"\0"					\
1439e336903SWu, Josh 	"bootargs_nand=rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs rw\0"\
1449e336903SWu, Josh 	"bootargs_mmc=root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait\0"
1459e336903SWu, Josh 
1469e336903SWu, Josh /* MMC */
1479e336903SWu, Josh #ifdef CONFIG_CMD_MMC
1489e336903SWu, Josh #define CONFIG_MMC
1499e336903SWu, Josh #define CONFIG_GENERIC_MMC
1509e336903SWu, Josh #define CONFIG_GENERIC_ATMEL_MCI
1519e336903SWu, Josh #endif
1529e336903SWu, Josh 
1539e336903SWu, Josh /* FAT */
1549e336903SWu, Josh #ifdef CONFIG_CMD_FAT
1559e336903SWu, Josh #define CONFIG_DOS_PARTITION
1569e336903SWu, Josh #endif
1579e336903SWu, Josh 
15816276220SBo Shen /* Ethernet */
15916276220SBo Shen #define CONFIG_KS8851_MLL
16016276220SBo Shen #define CONFIG_KS8851_MLL_BASEADDR	0x30000000 /* use NCS2 */
16116276220SBo Shen 
1629e336903SWu, Josh #define CONFIG_SYS_LOAD_ADDR		0x22000000 /* load address */
1639e336903SWu, Josh 
1649e336903SWu, Josh #define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
1659e336903SWu, Josh #define CONFIG_SYS_MEMTEST_END		0x26e00000
1669e336903SWu, Josh 
167d9bef0adSBo Shen /* USB host */
168d9bef0adSBo Shen #ifdef CONFIG_CMD_USB
169d9bef0adSBo Shen #define CONFIG_USB_ATMEL
170*dcd2f1a0SBo Shen #define CONFIG_USB_ATMEL_CLK_SEL_PLLB
171d9bef0adSBo Shen #define CONFIG_USB_OHCI_NEW
172d9bef0adSBo Shen #define CONFIG_SYS_USB_OHCI_CPU_INIT
173d9bef0adSBo Shen #define CONFIG_SYS_USB_OHCI_REGS_BASE	ATMEL_BASE_OHCI
174d9bef0adSBo Shen #define CONFIG_SYS_USB_OHCI_SLOT_NAME	"at91sam9n12"
175d9bef0adSBo Shen #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	1
176d9bef0adSBo Shen #define CONFIG_USB_STORAGE
177d9bef0adSBo Shen #endif
178d9bef0adSBo Shen 
1799e336903SWu, Josh #ifdef CONFIG_SYS_USE_SPIFLASH
1809e336903SWu, Josh 
1819e336903SWu, Josh /* bootstrap + u-boot + env + linux in dataflash on CS0 */
1829e336903SWu, Josh #define CONFIG_ENV_IS_IN_SPI_FLASH
1839e336903SWu, Josh #define CONFIG_ENV_OFFSET		0x5000
1849e336903SWu, Josh #define CONFIG_ENV_SIZE			0x3000
1859e336903SWu, Josh #define CONFIG_ENV_SECT_SIZE		0x1000
1869e336903SWu, Josh #define CONFIG_BOOTCOMMAND						\
1879e336903SWu, Josh 	"setenv bootargs ${console} ${mtdparts} ${bootargs_nand};"	\
1889e336903SWu, Josh 	"sf probe 0; sf read 0x22000000 0x100000 0x300000; "		\
1899e336903SWu, Josh 	"bootm 0x22000000"
1909e336903SWu, Josh 
1919e336903SWu, Josh #elif defined(CONFIG_SYS_USE_NANDFLASH)
1929e336903SWu, Josh 
1939e336903SWu, Josh /* bootstrap + u-boot + env + linux in nandflash */
1949e336903SWu, Josh #define CONFIG_ENV_IS_IN_NAND
1959e336903SWu, Josh #define CONFIG_ENV_OFFSET		0xc0000
1969e336903SWu, Josh #define CONFIG_ENV_OFFSET_REDUND	0x100000
1979e336903SWu, Josh #define CONFIG_ENV_SIZE			0x20000		/* 1 sector = 128 kB */
1989e336903SWu, Josh #define CONFIG_BOOTCOMMAND						\
1999e336903SWu, Josh 	"setenv bootargs ${console} ${mtdparts} ${bootargs_nand};"	\
2009e336903SWu, Josh 	"nand read 0x21000000 0x180000 0x080000;"			\
2019e336903SWu, Josh 	"nand read 0x22000000 0x200000 0x400000;"			\
2029e336903SWu, Josh 	"bootm 0x22000000 - 0x21000000"
2039e336903SWu, Josh 
2049e336903SWu, Josh #else /* CONFIG_SYS_USE_MMC */
2059e336903SWu, Josh 
2069e336903SWu, Josh /* bootstrap + u-boot + env + linux in mmc */
2079e336903SWu, Josh #define CONFIG_ENV_IS_IN_MMC
2089e336903SWu, Josh /* For FAT system, most cases it should be in the reserved sector */
2099e336903SWu, Josh #define CONFIG_ENV_OFFSET		0x2000
2109e336903SWu, Josh #define CONFIG_ENV_SIZE			0x1000
2119e336903SWu, Josh #define CONFIG_SYS_MMC_ENV_DEV		0
2129e336903SWu, Josh #define CONFIG_BOOTCOMMAND						\
2139e336903SWu, Josh 	"setenv bootargs ${console} ${mtdparts} ${bootargs_mmc};"	\
2149e336903SWu, Josh 	"fatload mmc 0:1 0x21000000 dtb;"				\
2159e336903SWu, Josh 	"fatload mmc 0:1 0x22000000 uImage;"				\
2169e336903SWu, Josh 	"bootm 0x22000000 - 0x21000000"
2179e336903SWu, Josh 
2189e336903SWu, Josh #endif
2199e336903SWu, Josh 
2209e336903SWu, Josh #define CONFIG_SYS_PROMPT	"U-Boot> "
2219e336903SWu, Josh #define CONFIG_SYS_CBSIZE	256
2229e336903SWu, Josh #define CONFIG_SYS_MAXARGS	16
2239e336903SWu, Josh #define CONFIG_SYS_PBSIZE	(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) \
2249e336903SWu, Josh 					+ 16)
2259e336903SWu, Josh #define CONFIG_SYS_LONGHELP
2269e336903SWu, Josh #define CONFIG_CMDLINE_EDITING
2279e336903SWu, Josh #define CONFIG_AUTO_COMPLETE
2289e336903SWu, Josh #define CONFIG_SYS_HUSH_PARSER
2299e336903SWu, Josh 
2309e336903SWu, Josh /*
2319e336903SWu, Josh  * Size of malloc() pool
2329e336903SWu, Josh  */
2339e336903SWu, Josh #define CONFIG_SYS_MALLOC_LEN	(4 * 1024 * 1024)
2349e336903SWu, Josh #define CONFIG_STACKSIZE	(32 * 1024)	/* regular stack */
2359e336903SWu, Josh 
2369e336903SWu, Josh #endif
237