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 328c6407fcSReinhard Meyer /* Define actual evaluation board type from used processor type */ 338c6407fcSReinhard Meyer #ifdef CONFIG_AT91SAM9G20 348c6407fcSReinhard Meyer # define CONFIG_AT91SAM9G20EK /* It's an Atmel AT91SAM9G20 EK */ 358c6407fcSReinhard Meyer #else 368c6407fcSReinhard Meyer # define CONFIG_AT91SAM9260EK /* It's an Atmel AT91SAM9260 EK */ 378c6407fcSReinhard Meyer #endif 388c6407fcSReinhard Meyer 398c6407fcSReinhard Meyer /* Misc CPU related */ 408c6407fcSReinhard Meyer #define CONFIG_ARCH_CPU_INIT 418c6407fcSReinhard Meyer #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ 428c6407fcSReinhard Meyer #define CONFIG_SETUP_MEMORY_TAGS 438c6407fcSReinhard Meyer #define CONFIG_INITRD_TAG 448c6407fcSReinhard Meyer #define CONFIG_SKIP_LOWLEVEL_INIT 458c6407fcSReinhard Meyer 468c6407fcSReinhard Meyer /* general purpose I/O */ 478c6407fcSReinhard Meyer #define CONFIG_ATMEL_LEGACY /* required until (g)pio is fixed */ 480176d43eSStelian Pop 490176d43eSStelian Pop /* 500176d43eSStelian Pop * BOOTP options 510176d43eSStelian Pop */ 520176d43eSStelian Pop #define CONFIG_BOOTP_BOOTFILESIZE 1 530176d43eSStelian Pop #define CONFIG_BOOTP_BOOTPATH 1 540176d43eSStelian Pop #define CONFIG_BOOTP_GATEWAY 1 550176d43eSStelian Pop #define CONFIG_BOOTP_HOSTNAME 1 560176d43eSStelian Pop 570176d43eSStelian Pop /* 580176d43eSStelian Pop * Command line configuration. 590176d43eSStelian Pop */ 600176d43eSStelian Pop #define CONFIG_CMD_NAND 1 610176d43eSStelian Pop 628c6407fcSReinhard Meyer /* 638c6407fcSReinhard Meyer * SDRAM: 1 bank, min 32, max 128 MB 648c6407fcSReinhard Meyer * Initialized before u-boot gets started. 658c6407fcSReinhard Meyer */ 660176d43eSStelian Pop #define CONFIG_NR_DRAM_BANKS 1 678c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_CS1 688c6407fcSReinhard Meyer #define CONFIG_SYS_SDRAM_SIZE 0x04000000 698c6407fcSReinhard Meyer 708c6407fcSReinhard Meyer /* 718c6407fcSReinhard Meyer * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM, 728c6407fcSReinhard Meyer * leaving the correct space for initial global data structure above 738c6407fcSReinhard Meyer * that address while providing maximum stack area below. 748c6407fcSReinhard Meyer */ 758c6407fcSReinhard Meyer #ifdef CONFIG_AT91SAM9XE 768c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \ 77*83f1c2efSWenyou Yang (ATMEL_BASE_SRAM + 16 * 1024 - GENERATED_GBL_DATA_SIZE) 788c6407fcSReinhard Meyer #else 798c6407fcSReinhard Meyer # define CONFIG_SYS_INIT_SP_ADDR \ 80*83f1c2efSWenyou Yang (ATMEL_BASE_SRAM1 + 16 * 1024 - GENERATED_GBL_DATA_SIZE) 818c6407fcSReinhard Meyer #endif 820176d43eSStelian Pop 83d0a51373SAndreas Bießmann /* 84d0a51373SAndreas Bießmann * The (arm)linux board id set by generic code depending on configured board 85d0a51373SAndreas Bießmann * (see boards.cfg for different boards) 86d0a51373SAndreas Bießmann */ 87d0a51373SAndreas Bießmann #ifdef CONFIG_AT91SAM9G20 88d0a51373SAndreas Bießmann /* the sam9g20 variants have two different board ids */ 89d0a51373SAndreas Bießmann # ifdef CONFIG_AT91SAM9G20EK_2MMC 90d0a51373SAndreas Bießmann /* we may be setup for the 2MMC variant of at91sam9g20ek */ 91d0a51373SAndreas Bießmann # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK_2MMC 92d0a51373SAndreas Bießmann # else 93d0a51373SAndreas Bießmann /* or the normal at91sam9g20ek */ 94d0a51373SAndreas Bießmann # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9G20EK 95d0a51373SAndreas Bießmann # endif 96d0a51373SAndreas Bießmann #else 97d0a51373SAndreas Bießmann /* otherwise default to good old at91sam9260ek */ 98d0a51373SAndreas Bießmann # define CONFIG_MACH_TYPE MACH_TYPE_AT91SAM9260EK 99d0a51373SAndreas Bießmann #endif 100d0a51373SAndreas Bießmann 1018495faf5SBo Shen #ifndef CONFIG_AT91SAM9G20EK_2MMC 102f5702d7dSWu, Josh /* DataFlash */ 1034758ebddSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ATMEL_DATAFLASH_SPI 1040176d43eSStelian Pop #define CONFIG_HAS_DATAFLASH 1 1056d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_DATAFLASH_BANKS 2 1066d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 0xC0000000 /* CS0 */ 1076d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 0xD0000000 /* CS1 */ 10879f0cb6eSStelian Pop #define AT91_SPI_CLK 15000000 109f5702d7dSWu, Josh #else 110f5702d7dSWu, Josh /* Enable MMC. The MCCK is conflicted with DataFlash */ 1118495faf5SBo Shen #endif 112df486b1fSNicolas Ferre 113df486b1fSNicolas Ferre #ifdef CONFIG_AT91SAM9G20EK 114df486b1fSNicolas Ferre #define DATAFLASH_TCSS (0x22 << 16) 115df486b1fSNicolas Ferre #else 1160176d43eSStelian Pop #define DATAFLASH_TCSS (0x1a << 16) 117df486b1fSNicolas Ferre #endif 1180176d43eSStelian Pop #define DATAFLASH_TCHS (0x1 << 24) 1190176d43eSStelian Pop 1200176d43eSStelian Pop /* NAND flash */ 12174c076d6SJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_CMD_NAND 12274c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_NAND_ATMEL 1236d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAX_NAND_DEVICE 1 1248c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3 1258c6407fcSReinhard Meyer #define CONFIG_SYS_NAND_DBW_8 12674c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_ALE (1 << 21) 12774c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_MASK_CLE (1 << 22) 12874c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_ENABLE_PIN AT91_PIN_PC14 12974c076d6SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_NAND_READY_PIN AT91_PIN_PC13 13074c076d6SJean-Christophe PLAGNIOL-VILLARD #endif 1310176d43eSStelian Pop 1320176d43eSStelian Pop /* USB */ 1332b7178afSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_USB_ATMEL 134dcd2f1a0SBo Shen #define CONFIG_USB_ATMEL_CLK_SEL_PLLB 1350176d43eSStelian Pop #define CONFIG_USB_OHCI_NEW 1 1366d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_CPU_INIT 1 1376d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00500000 /* AT91SAM9260_UHP_BASE */ 1386d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9260" 1396d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 1400176d43eSStelian Pop 1416d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */ 1420176d43eSStelian Pop 1438c6407fcSReinhard Meyer #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE 1446d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MEMTEST_END 0x23e00000 1450176d43eSStelian Pop 1466d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #ifdef CONFIG_SYS_USE_DATAFLASH_CS0 1470176d43eSStelian Pop 1480176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS0 */ 149057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH 1 1506d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400) 1510e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET 0x4200 1526d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET) 1530e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE 0x4200 154e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND "cp.b 0xC0084000 0x22000000 0x210000; bootm" 15596996ac2SStelian Pop #define CONFIG_BOOTARGS "console=ttyS0,115200 " \ 15696996ac2SStelian Pop "root=/dev/mtdblock0 " \ 157918319c7SAlbin Tonnerre "mtdparts=atmel_nand:-(root) " \ 15896996ac2SStelian Pop "rw rootfstype=jffs2" 1590176d43eSStelian Pop 1606d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #elif CONFIG_SYS_USE_DATAFLASH_CS1 1610176d43eSStelian Pop 1620176d43eSStelian Pop /* bootstrap + u-boot + env + linux in dataflash on CS1 */ 163057c849cSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_DATAFLASH 1 1646d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400) 1650e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_OFFSET 0x4200 1666d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_ADDR (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + CONFIG_ENV_OFFSET) 1670e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE 0x4200 168e139cb31SAlexandre Belloni #define CONFIG_BOOTCOMMAND "cp.b 0xD0084000 0x22000000 0x210000; bootm" 16996996ac2SStelian Pop #define CONFIG_BOOTARGS "console=ttyS0,115200 " \ 17096996ac2SStelian Pop "root=/dev/mtdblock0 " \ 171918319c7SAlbin Tonnerre "mtdparts=atmel_nand:-(root) " \ 17296996ac2SStelian Pop "rw rootfstype=jffs2" 1730176d43eSStelian Pop 17424802073SWu, Josh #elif defined(CONFIG_SYS_USE_NANDFLASH) 1750176d43eSStelian Pop 1760176d43eSStelian Pop /* bootstrap + u-boot + env + linux in nandflash */ 17751bfee19SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_IS_IN_NAND 1 178*83f1c2efSWenyou Yang #define CONFIG_ENV_OFFSET 0x120000 1790c58cfa9SBo Shen #define CONFIG_ENV_OFFSET_REDUND 0x100000 1800e8d1586SJean-Christophe PLAGNIOL-VILLARD #define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */ 1810c58cfa9SBo Shen #define CONFIG_BOOTCOMMAND "nand read 0x22000000 0x200000 0x300000; bootm" 1820c58cfa9SBo Shen #define CONFIG_BOOTARGS \ 1830c58cfa9SBo Shen "console=ttyS0,115200 earlyprintk " \ 1840c58cfa9SBo Shen "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \ 1850c58cfa9SBo Shen "256k(env),256k(env_redundant),256k(spare)," \ 1860c58cfa9SBo Shen "512k(dtb),6M(kernel)ro,-(rootfs) " \ 1870c58cfa9SBo Shen "root=/dev/mtdblock7 rw rootfstype=jffs2" 1880176d43eSStelian Pop 18924802073SWu, Josh #else /* CONFIG_SYS_USE_MMC */ 19024802073SWu, Josh /* bootstrap + u-boot + env + linux in mmc */ 19124802073SWu, Josh #define CONFIG_ENV_IS_IN_MMC 19224802073SWu, Josh /* For FAT system, most cases it should be in the reserved sector */ 19324802073SWu, Josh #define CONFIG_ENV_OFFSET 0x2000 19424802073SWu, Josh #define CONFIG_ENV_SIZE 0x1000 19524802073SWu, Josh #define CONFIG_SYS_MMC_ENV_DEV 0 19624802073SWu, Josh 19724802073SWu, Josh #define CONFIG_BOOTCOMMAND \ 19824802073SWu, Josh "fatload mmc 0:1 0x22000000 uImage; bootm" 19924802073SWu, Josh #define CONFIG_BOOTARGS \ 20024802073SWu, Josh "console=ttyS0,115200 earlyprintk " \ 20124802073SWu, Josh "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \ 20224802073SWu, Josh "256k(env),256k(env_redundant),256k(spare)," \ 20324802073SWu, Josh "512k(dtb),6M(kernel)ro,-(rootfs) " \ 20424802073SWu, Josh "root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait" 2050176d43eSStelian Pop #endif 2060176d43eSStelian Pop 2076d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_CBSIZE 256 2086d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MAXARGS 16 2096d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_LONGHELP 1 2100176d43eSStelian Pop #define CONFIG_CMDLINE_EDITING 1 211e139cb31SAlexandre Belloni #define CONFIG_AUTO_COMPLETE 2120176d43eSStelian Pop 2130176d43eSStelian Pop /* 2140176d43eSStelian Pop * Size of malloc() pool 2150176d43eSStelian Pop */ 2166d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000) 2170176d43eSStelian Pop 2180176d43eSStelian Pop #endif 219