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 658c6407fcSReinhard Meyer /* general purpose I/O */ 668c6407fcSReinhard Meyer #define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */ 678c6407fcSReinhard Meyer #define CONFIG_AT91_GPIO 688c6407fcSReinhard Meyer #define CONFIG_AT91_GPIO_PULLUP 1 /* keep pullups on peripheral pins */ 698c6407fcSReinhard Meyer 708c6407fcSReinhard Meyer /* serial console */ 718c6407fcSReinhard Meyer #define CONFIG_ATMEL_USART 728c6407fcSReinhard Meyer #define CONFIG_USART_BASE ATMEL_BASE_DBGU 738c6407fcSReinhard Meyer #define CONFIG_USART_ID ATMEL_ID_SYS 748c6407fcSReinhard Meyer #define CONFIG_BAUDRATE 115200 750176d43eSStelian Pop 76a484b00bSJean-Christophe PLAGNIOL-VILLARD /* LED */ 77a484b00bSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_AT91_LED 78a484b00bSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_RED_LED AT91_PIN_PA9 /* this is the power led */ 79a484b00bSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_GREEN_LED AT91_PIN_PA6 /* this is the user led */ 80a484b00bSJean-Christophe PLAGNIOL-VILLARD 810176d43eSStelian Pop #define CONFIG_BOOTDELAY 3 820176d43eSStelian Pop 830176d43eSStelian Pop /* 840176d43eSStelian Pop * BOOTP options 850176d43eSStelian Pop */ 860176d43eSStelian Pop #define CONFIG_BOOTP_BOOTFILESIZE 1 870176d43eSStelian Pop #define CONFIG_BOOTP_BOOTPATH 1 880176d43eSStelian Pop #define CONFIG_BOOTP_GATEWAY 1 890176d43eSStelian Pop #define CONFIG_BOOTP_HOSTNAME 1 900176d43eSStelian Pop 910176d43eSStelian Pop /* 920176d43eSStelian Pop * Command line configuration. 930176d43eSStelian Pop */ 940176d43eSStelian Pop #include <config_cmd_default.h> 950176d43eSStelian Pop #undef CONFIG_CMD_BDI 960176d43eSStelian Pop #undef CONFIG_CMD_FPGA 9774de7aefSWolfgang Denk #undef CONFIG_CMD_IMI 980176d43eSStelian Pop #undef CONFIG_CMD_IMLS 9974de7aefSWolfgang Denk #undef CONFIG_CMD_LOADS 10074de7aefSWolfgang Denk #undef CONFIG_CMD_SOURCE 1010176d43eSStelian Pop 1020176d43eSStelian Pop #define CONFIG_CMD_PING 1 1030176d43eSStelian Pop #define CONFIG_CMD_DHCP 1 1040176d43eSStelian Pop #define CONFIG_CMD_NAND 1 1050176d43eSStelian Pop #define CONFIG_CMD_USB 1 1060176d43eSStelian Pop 1078c6407fcSReinhard Meyer /* 1088c6407fcSReinhard Meyer * SDRAM: 1 bank, min 32, max 128 MB 1098c6407fcSReinhard Meyer * Initialized before u-boot gets started. 1108c6407fcSReinhard Meyer */ 1110176d43eSStelian Pop #define CONFIG_NR_DRAM_BANKS 1 1128c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_CS1 1138c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_SIZE 0x04000000 1148c6407fcSReinhard Meyer 1158c6407fcSReinhard Meyer /* 1168c6407fcSReinhard Meyer * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM, 1178c6407fcSReinhard Meyer * leaving the correct space for initial global data structure above 1188c6407fcSReinhard Meyer * that address while providing maximum stack area below. 1198c6407fcSReinhard Meyer */ 1208c6407fcSReinhard Meyer #ifdef CONFIG_AT91SAM9XE 1218c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \ 1228c6407fcSReinhard Meyer (ATMEL_BASE_SRAM + 0x1000 - GENERATED_GBL_DATA_SIZE) 1238c6407fcSReinhard Meyer #else 1248c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \ 1258c6407fcSReinhard Meyer (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE) 1268c6407fcSReinhard Meyer #endif 1270176d43eSStelian Pop 1280176d43eSStelian Pop /* DataFlash */ 129*8495faf5SBo Shen #ifndef CONFIG_AT91SAM9G20EK_2MMC 1304758ebddSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ATMEL_DATAFLASH_SPI 1310176d43eSStelian Pop #define CONFIG_HAS_DATAFLASH 1 1326d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_SPI_WRITE_TOUT (5*CONFIG_SYS_HZ) 1336d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_DATAFLASH_BANKS 2 1346d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 0xC0000000 /* CS0 */ 1356d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 0xD0000000 /* CS1 */ 13679f0cb6eSStelian Pop #define AT91_SPI_CLK 15000000 137*8495faf5SBo Shen #endif 138df486b1fSNicolas Ferre 139df486b1fSNicolas Ferre #ifdef CONFIG_AT91SAM9G20EK 140df486b1fSNicolas Ferre #define DATAFLASH_TCSS (0x22 << 16) 141df486b1fSNicolas Ferre #else 1420176d43eSStelian Pop #define DATAFLASH_TCSS (0x1a << 16) 143df486b1fSNicolas Ferre #endif 1440176d43eSStelian Pop #define DATAFLASH_TCHS (0x1 << 24) 1450176d43eSStelian Pop 1460176d43eSStelian Pop /* NAND flash */ 14774c076d6SJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_CMD_NAND 14874c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_NAND_ATMEL 1496d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_NAND_DEVICE 1 1508c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3 1518c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_DBW_8 15274c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_ALE (1 << 21) 15374c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_CLE (1 << 22) 15474c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PC14 15574c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PC13 15674c076d6SJean-Christophe PLAGNIOL-VILLARD #endif 1570176d43eSStelian Pop 1580176d43eSStelian Pop /* NOR flash - no real flash on this board */ 1596d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NO_FLASH 1 1600176d43eSStelian Pop 1610176d43eSStelian Pop /* Ethernet */ 1620176d43eSStelian Pop #define CONFIG_MACB 1 1630176d43eSStelian Pop #define CONFIG_RMII 1 1640176d43eSStelian Pop #define CONFIG_NET_RETRY_COUNT 20 1650176d43eSStelian Pop #define CONFIG_RESET_PHY_R 1 1660176d43eSStelian Pop 1670176d43eSStelian Pop /* USB */ 1682b7178afSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_USB_ATMEL 1690176d43eSStelian Pop #define CONFIG_USB_OHCI_NEW 1 1700176d43eSStelian Pop #define CONFIG_DOS_PARTITION 1 1716d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_CPU_INIT 1 1726d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000 /* AT91SAM9260_UHP_BASE */ 1736d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260" 1746d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 1750176d43eSStelian Pop #define CONFIG_USB_STORAGE 1 1763e0cda07SStelian Pop #define CONFIG_CMD_FAT 1 1770176d43eSStelian Pop 1786d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */ 1790176d43eSStelian Pop 1808c6407fcSReinhard Meyer #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE 1816d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MEMTEST_END 0x23e00000 1820176d43eSStelian Pop 1836d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_SYS_USE_DATAFLASH_CS0 1840176d43eSStelian Pop 1850176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS0 */ 186057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH 1 1876d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400) 1880e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET 0x4200 1896d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET) 1900e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE 0x4200 191e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND "cp.b 0xC0084000 0x22000000 0x210000; bootm" 19296996ac2SStelian Pop #define CONFIG_BOOTARGS "console=ttyS0,115200 " \ 19396996ac2SStelian Pop "root=/dev/mtdblock0 " \ 194918319c7SAlbin Tonnerre "mtdparts=atmel_nand:-(root) " \ 19596996ac2SStelian Pop "rw rootfstype=jffs2" 1960176d43eSStelian Pop 1976d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #elif CONFIG_SYS_USE_DATAFLASH_CS1 1980176d43eSStelian Pop 1990176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS1 */ 200057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH 1 2016d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400) 2020e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET 0x4200 2036d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + CONFIG_ENV_OFFSET) 2040e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE 0x4200 205e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND "cp.b 0xD0084000 0x22000000 0x210000; bootm" 20696996ac2SStelian Pop #define CONFIG_BOOTARGS "console=ttyS0,115200 " \ 20796996ac2SStelian Pop "root=/dev/mtdblock0 " \ 208918319c7SAlbin Tonnerre "mtdparts=atmel_nand:-(root) " \ 20996996ac2SStelian Pop "rw rootfstype=jffs2" 2100176d43eSStelian Pop 2116d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #else /* CONFIG_SYS_USE_NANDFLASH */ 2120176d43eSStelian Pop 2130176d43eSStelian Pop /* bootstrap + u-boot + env + linux in nandflash */ 21451bfee19SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_NAND 1 2150e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET 0x60000 2160e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET_REDUND 0x80000 2170e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */ 2180176d43eSStelian Pop #define CONFIG_BOOTCOMMAND "nand read 0x22000000 0xA0000 0x200000; bootm" 21996996ac2SStelian Pop #define CONFIG_BOOTARGS "console=ttyS0,115200 " \ 22096996ac2SStelian Pop "root=/dev/mtdblock5 " \ 221918319c7SAlbin Tonnerre "mtdparts=atmel_nand:128k(bootstrap)ro," \ 22296996ac2SStelian Pop "256k(uboot)ro,128k(env1)ro," \ 22396996ac2SStelian Pop "128k(env2)ro,2M(linux),-(root) " \ 22496996ac2SStelian Pop "rw rootfstype=jffs2" 2250176d43eSStelian Pop 2260176d43eSStelian Pop #endif 2270176d43eSStelian Pop 2286d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_PROMPT "U-Boot> " 2296d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_CBSIZE 256 2306d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAXARGS 16 2316d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) 2326d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LONGHELP 1 2330176d43eSStelian Pop #define CONFIG_CMDLINE_EDITING 1 234e139cb31SAlexandre Belloni #define CONFIG_AUTO_COMPLETE 2350176d43eSStelian Pop 2360176d43eSStelian Pop /* 2370176d43eSStelian Pop * Size of malloc() pool 2380176d43eSStelian Pop */ 2396d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000) 2400176d43eSStelian Pop 2410176d43eSStelian Pop #endif 242