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 65*36873e7dSNicolas Ferre #define CONFIG_OF_LIBFDT 66*36873e7dSNicolas Ferre 678c6407fcSReinhard Meyer /* general purpose I/O */ 688c6407fcSReinhard Meyer #define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */ 698c6407fcSReinhard Meyer #define CONFIG_AT91_GPIO 708c6407fcSReinhard Meyer #define CONFIG_AT91_GPIO_PULLUP 1 /* keep pullups on peripheral pins */ 718c6407fcSReinhard Meyer 728c6407fcSReinhard Meyer /* serial console */ 738c6407fcSReinhard Meyer #define CONFIG_ATMEL_USART 748c6407fcSReinhard Meyer #define CONFIG_USART_BASE ATMEL_BASE_DBGU 758c6407fcSReinhard Meyer #define CONFIG_USART_ID ATMEL_ID_SYS 768c6407fcSReinhard Meyer #define CONFIG_BAUDRATE 115200 770176d43eSStelian Pop 78a484b00bSJean-Christophe PLAGNIOL-VILLARD /* LED */ 79a484b00bSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_AT91_LED 80a484b00bSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_RED_LED AT91_PIN_PA9 /* this is the power led */ 81a484b00bSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_GREEN_LED AT91_PIN_PA6 /* this is the user led */ 82a484b00bSJean-Christophe PLAGNIOL-VILLARD 830176d43eSStelian Pop #define CONFIG_BOOTDELAY 3 840176d43eSStelian Pop 850176d43eSStelian Pop /* 860176d43eSStelian Pop * BOOTP options 870176d43eSStelian Pop */ 880176d43eSStelian Pop #define CONFIG_BOOTP_BOOTFILESIZE 1 890176d43eSStelian Pop #define CONFIG_BOOTP_BOOTPATH 1 900176d43eSStelian Pop #define CONFIG_BOOTP_GATEWAY 1 910176d43eSStelian Pop #define CONFIG_BOOTP_HOSTNAME 1 920176d43eSStelian Pop 930176d43eSStelian Pop /* 940176d43eSStelian Pop * Command line configuration. 950176d43eSStelian Pop */ 960176d43eSStelian Pop #include <config_cmd_default.h> 970176d43eSStelian Pop #undef CONFIG_CMD_BDI 980176d43eSStelian Pop #undef CONFIG_CMD_FPGA 9974de7aefSWolfgang Denk #undef CONFIG_CMD_IMI 1000176d43eSStelian Pop #undef CONFIG_CMD_IMLS 10174de7aefSWolfgang Denk #undef CONFIG_CMD_LOADS 10274de7aefSWolfgang Denk #undef CONFIG_CMD_SOURCE 1030176d43eSStelian Pop 1040176d43eSStelian Pop #define CONFIG_CMD_PING 1 1050176d43eSStelian Pop #define CONFIG_CMD_DHCP 1 1060176d43eSStelian Pop #define CONFIG_CMD_NAND 1 1070176d43eSStelian Pop #define CONFIG_CMD_USB 1 1080176d43eSStelian Pop 1098c6407fcSReinhard Meyer /* 1108c6407fcSReinhard Meyer * SDRAM: 1 bank, min 32, max 128 MB 1118c6407fcSReinhard Meyer * Initialized before u-boot gets started. 1128c6407fcSReinhard Meyer */ 1130176d43eSStelian Pop #define CONFIG_NR_DRAM_BANKS 1 1148c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_CS1 1158c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_SIZE 0x04000000 1168c6407fcSReinhard Meyer 1178c6407fcSReinhard Meyer /* 1188c6407fcSReinhard Meyer * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM, 1198c6407fcSReinhard Meyer * leaving the correct space for initial global data structure above 1208c6407fcSReinhard Meyer * that address while providing maximum stack area below. 1218c6407fcSReinhard Meyer */ 1228c6407fcSReinhard Meyer #ifdef CONFIG_AT91SAM9XE 1238c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \ 1248c6407fcSReinhard Meyer (ATMEL_BASE_SRAM + 0x1000 - GENERATED_GBL_DATA_SIZE) 1258c6407fcSReinhard Meyer #else 1268c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \ 1278c6407fcSReinhard Meyer (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE) 1288c6407fcSReinhard Meyer #endif 1290176d43eSStelian Pop 1300176d43eSStelian Pop /* DataFlash */ 1318495faf5SBo Shen #ifndef CONFIG_AT91SAM9G20EK_2MMC 1324758ebddSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ATMEL_DATAFLASH_SPI 1330176d43eSStelian Pop #define CONFIG_HAS_DATAFLASH 1 1346d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_SPI_WRITE_TOUT (5*CONFIG_SYS_HZ) 1356d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_DATAFLASH_BANKS 2 1366d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 0xC0000000 /* CS0 */ 1376d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 0xD0000000 /* CS1 */ 13879f0cb6eSStelian Pop #define AT91_SPI_CLK 15000000 1398495faf5SBo Shen #endif 140df486b1fSNicolas Ferre 141df486b1fSNicolas Ferre #ifdef CONFIG_AT91SAM9G20EK 142df486b1fSNicolas Ferre #define DATAFLASH_TCSS (0x22 << 16) 143df486b1fSNicolas Ferre #else 1440176d43eSStelian Pop #define DATAFLASH_TCSS (0x1a << 16) 145df486b1fSNicolas Ferre #endif 1460176d43eSStelian Pop #define DATAFLASH_TCHS (0x1 << 24) 1470176d43eSStelian Pop 1480176d43eSStelian Pop /* NAND flash */ 14974c076d6SJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_CMD_NAND 15074c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_NAND_ATMEL 1516d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_NAND_DEVICE 1 1528c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3 1538c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_DBW_8 15474c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_ALE (1 << 21) 15574c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_CLE (1 << 22) 15674c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PC14 15774c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PC13 15874c076d6SJean-Christophe PLAGNIOL-VILLARD #endif 1590176d43eSStelian Pop 1600176d43eSStelian Pop /* NOR flash - no real flash on this board */ 1616d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NO_FLASH 1 1620176d43eSStelian Pop 1630176d43eSStelian Pop /* Ethernet */ 1640176d43eSStelian Pop #define CONFIG_MACB 1 1650176d43eSStelian Pop #define CONFIG_RMII 1 1660176d43eSStelian Pop #define CONFIG_NET_RETRY_COUNT 20 1670176d43eSStelian Pop #define CONFIG_RESET_PHY_R 1 1680176d43eSStelian Pop 1690176d43eSStelian Pop /* USB */ 1702b7178afSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_USB_ATMEL 1710176d43eSStelian Pop #define CONFIG_USB_OHCI_NEW 1 1720176d43eSStelian Pop #define CONFIG_DOS_PARTITION 1 1736d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_CPU_INIT 1 1746d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000 /* AT91SAM9260_UHP_BASE */ 1756d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260" 1766d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 1770176d43eSStelian Pop #define CONFIG_USB_STORAGE 1 1783e0cda07SStelian Pop #define CONFIG_CMD_FAT 1 1790176d43eSStelian Pop 1806d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */ 1810176d43eSStelian Pop 1828c6407fcSReinhard Meyer #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE 1836d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MEMTEST_END 0x23e00000 1840176d43eSStelian Pop 1856d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_SYS_USE_DATAFLASH_CS0 1860176d43eSStelian Pop 1870176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS0 */ 188057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH 1 1896d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400) 1900e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET 0x4200 1916d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET) 1920e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE 0x4200 193e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND "cp.b 0xC0084000 0x22000000 0x210000; bootm" 19496996ac2SStelian Pop #define CONFIG_BOOTARGS "console=ttyS0,115200 " \ 19596996ac2SStelian Pop "root=/dev/mtdblock0 " \ 196918319c7SAlbin Tonnerre "mtdparts=atmel_nand:-(root) " \ 19796996ac2SStelian Pop "rw rootfstype=jffs2" 1980176d43eSStelian Pop 1996d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #elif CONFIG_SYS_USE_DATAFLASH_CS1 2000176d43eSStelian Pop 2010176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS1 */ 202057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH 1 2036d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400) 2040e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET 0x4200 2056d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + CONFIG_ENV_OFFSET) 2060e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE 0x4200 207e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND "cp.b 0xD0084000 0x22000000 0x210000; bootm" 20896996ac2SStelian Pop #define CONFIG_BOOTARGS "console=ttyS0,115200 " \ 20996996ac2SStelian Pop "root=/dev/mtdblock0 " \ 210918319c7SAlbin Tonnerre "mtdparts=atmel_nand:-(root) " \ 21196996ac2SStelian Pop "rw rootfstype=jffs2" 2120176d43eSStelian Pop 2136d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #else /* CONFIG_SYS_USE_NANDFLASH */ 2140176d43eSStelian Pop 2150176d43eSStelian Pop /* bootstrap + u-boot + env + linux in nandflash */ 21651bfee19SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_NAND 1 2170e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET 0x60000 2180e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET_REDUND 0x80000 2190e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */ 2200176d43eSStelian Pop #define CONFIG_BOOTCOMMAND "nand read 0x22000000 0xA0000 0x200000; bootm" 22196996ac2SStelian Pop #define CONFIG_BOOTARGS "console=ttyS0,115200 " \ 22296996ac2SStelian Pop "root=/dev/mtdblock5 " \ 223918319c7SAlbin Tonnerre "mtdparts=atmel_nand:128k(bootstrap)ro," \ 22496996ac2SStelian Pop "256k(uboot)ro,128k(env1)ro," \ 22596996ac2SStelian Pop "128k(env2)ro,2M(linux),-(root) " \ 22696996ac2SStelian Pop "rw rootfstype=jffs2" 2270176d43eSStelian Pop 2280176d43eSStelian Pop #endif 2290176d43eSStelian Pop 2306d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_PROMPT "U-Boot> " 2316d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_CBSIZE 256 2326d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAXARGS 16 2336d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) 2346d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LONGHELP 1 2350176d43eSStelian Pop #define CONFIG_CMDLINE_EDITING 1 236e139cb31SAlexandre Belloni #define CONFIG_AUTO_COMPLETE 2370176d43eSStelian Pop 2380176d43eSStelian Pop /* 2390176d43eSStelian Pop * Size of malloc() pool 2400176d43eSStelian Pop */ 2416d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000) 2420176d43eSStelian Pop 2430176d43eSStelian Pop #endif 244