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 /* ARM asynchronous clock */ 229e336903SWu, Josh #define CONFIG_SYS_AT91_SLOW_CLOCK 32768 /* slow clock xtal */ 239e336903SWu, Josh #define CONFIG_SYS_AT91_MAIN_CLOCK 16000000 /* main clock xtal */ 249e336903SWu, Josh 259e336903SWu, Josh /* Misc CPU related */ 269e336903SWu, Josh #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ 279e336903SWu, Josh #define CONFIG_SETUP_MEMORY_TAGS 289e336903SWu, Josh #define CONFIG_INITRD_TAG 299e336903SWu, Josh #define CONFIG_SKIP_LOWLEVEL_INIT 309e336903SWu, Josh #define CONFIG_BOARD_EARLY_INIT_F 319e336903SWu, Josh #define CONFIG_DISPLAY_CPUINFO 329e336903SWu, Josh 339e336903SWu, Josh #define CONFIG_OF_LIBFDT 3409e03e05SWu, Josh #define CONFIG_SYS_GENERIC_BOARD 359e336903SWu, Josh 369e336903SWu, Josh /* general purpose I/O */ 379e336903SWu, Josh #define CONFIG_AT91_GPIO 389e336903SWu, Josh 399e336903SWu, Josh /* serial console */ 409e336903SWu, Josh #define CONFIG_ATMEL_USART 419e336903SWu, Josh #define CONFIG_USART_BASE ATMEL_BASE_DBGU 429e336903SWu, Josh #define CONFIG_USART_ID ATMEL_ID_SYS 439e336903SWu, Josh #define CONFIG_BAUDRATE 115200 449e336903SWu, Josh 459e336903SWu, Josh /* LCD */ 469e336903SWu, Josh #define CONFIG_LCD 479e336903SWu, Josh #define LCD_BPP LCD_COLOR16 489e336903SWu, Josh #define LCD_OUTPUT_BPP 24 499e336903SWu, Josh #define CONFIG_LCD_LOGO 509e336903SWu, Josh #define CONFIG_LCD_INFO 519e336903SWu, Josh #define CONFIG_LCD_INFO_BELOW_LOGO 529e336903SWu, Josh #define CONFIG_SYS_WHITE_ON_BLACK 539e336903SWu, Josh #define CONFIG_ATMEL_HLCD 549e336903SWu, Josh #define CONFIG_ATMEL_LCD_RGB565 559e336903SWu, Josh #define CONFIG_SYS_CONSOLE_IS_IN_ENV 569e336903SWu, Josh 579e336903SWu, Josh #define CONFIG_BOOTDELAY 3 589e336903SWu, Josh 599e336903SWu, Josh /* 609e336903SWu, Josh * BOOTP options 619e336903SWu, Josh */ 629e336903SWu, Josh #define CONFIG_BOOTP_BOOTFILESIZE 639e336903SWu, Josh #define CONFIG_BOOTP_BOOTPATH 649e336903SWu, Josh #define CONFIG_BOOTP_GATEWAY 659e336903SWu, Josh #define CONFIG_BOOTP_HOSTNAME 669e336903SWu, Josh 679e336903SWu, Josh /* NOR flash - no real flash on this board */ 689e336903SWu, Josh #define CONFIG_SYS_NO_FLASH 699e336903SWu, Josh 709e336903SWu, Josh /* 719e336903SWu, Josh * Command line configuration. 729e336903SWu, Josh */ 739e336903SWu, Josh #include <config_cmd_default.h> 749e336903SWu, Josh #undef CONFIG_CMD_FPGA 759e336903SWu, Josh 769e336903SWu, Josh #define CONFIG_CMD_BOOTZ 779e336903SWu, Josh #define CONFIG_CMD_PING 789e336903SWu, Josh #define CONFIG_CMD_DHCP 799e336903SWu, Josh #define CONFIG_CMD_NAND 809e336903SWu, Josh #define CONFIG_CMD_SF 819e336903SWu, Josh #define CONFIG_CMD_MMC 829e336903SWu, Josh #define CONFIG_CMD_FAT 83d9bef0adSBo Shen #define CONFIG_CMD_USB 849e336903SWu, Josh 859e336903SWu, Josh #define CONFIG_NR_DRAM_BANKS 1 869e336903SWu, Josh #define CONFIG_SYS_SDRAM_BASE 0x20000000 879e336903SWu, Josh #define CONFIG_SYS_SDRAM_SIZE 0x08000000 889e336903SWu, Josh 899e336903SWu, Josh /* 909e336903SWu, Josh * Initial stack pointer: 4k - GENERATED_GBL_DATA_SIZE in internal SRAM, 919e336903SWu, Josh * leaving the correct space for initial global data structure above 929e336903SWu, Josh * that address while providing maximum stack area below. 939e336903SWu, Josh */ 949e336903SWu, Josh # define CONFIG_SYS_INIT_SP_ADDR \ 959e336903SWu, Josh (ATMEL_BASE_SRAM + 0x1000 - GENERATED_GBL_DATA_SIZE) 969e336903SWu, Josh 979e336903SWu, Josh /* DataFlash */ 989e336903SWu, Josh #ifdef CONFIG_CMD_SF 999e336903SWu, Josh #define CONFIG_ATMEL_SPI 1009e336903SWu, Josh #define CONFIG_SPI_FLASH 1019e336903SWu, Josh #define CONFIG_SPI_FLASH_ATMEL 1029e336903SWu, Josh #define CONFIG_SF_DEFAULT_SPEED 30000000 1039e336903SWu, Josh #define CONFIG_ENV_SPI_MODE SPI_MODE_3 1049e336903SWu, Josh #define CONFIG_SF_DEFAULT_MODE SPI_MODE_3 1059e336903SWu, Josh #endif 1069e336903SWu, Josh 1079e336903SWu, Josh /* NAND flash */ 1089e336903SWu, Josh #ifdef CONFIG_CMD_NAND 1099e336903SWu, Josh #define CONFIG_NAND_ATMEL 1109e336903SWu, Josh #define CONFIG_SYS_MAX_NAND_DEVICE 1 1119e336903SWu, Josh #define CONFIG_SYS_NAND_BASE 0x40000000 1129e336903SWu, Josh #define CONFIG_SYS_NAND_MASK_ALE (1 << 21) 1139e336903SWu, Josh #define CONFIG_SYS_NAND_MASK_CLE (1 << 22) 114ac45bb16SAndreas Bießmann #define CONFIG_SYS_NAND_ENABLE_PIN GPIO_PIN_PD(4) 115ac45bb16SAndreas Bießmann #define CONFIG_SYS_NAND_READY_PIN GPIO_PIN_PD(5) 1169e336903SWu, Josh 1179e336903SWu, Josh /* PMECC & PMERRLOC */ 1189e336903SWu, Josh #define CONFIG_ATMEL_NAND_HWECC 1199e336903SWu, Josh #define CONFIG_ATMEL_NAND_HW_PMECC 1209e336903SWu, Josh #define CONFIG_PMECC_CAP 2 1219e336903SWu, Josh #define CONFIG_PMECC_SECTOR_SIZE 512 1229e336903SWu, Josh #define CONFIG_PMECC_INDEX_TABLE_OFFSET 0x8000 123ce76f0aaSBo Shen 124ce76f0aaSBo Shen #define CONFIG_CMD_NAND_TRIMFFS 125ce76f0aaSBo Shen 1269e336903SWu, Josh #endif 1279e336903SWu, Josh 1289e336903SWu, Josh #define CONFIG_MTD_PARTITIONS 1299e336903SWu, Josh #define CONFIG_MTD_DEVICE 1309e336903SWu, Josh #define CONFIG_CMD_MTDPARTS 1319e336903SWu, Josh #define MTDIDS_DEFAULT "nand0=atmel_nand" 1329e336903SWu, Josh #define MTDPARTS_DEFAULT \ 1339e336903SWu, Josh "mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro," \ 1349e336903SWu, Josh "256k(env),256k(env_redundant),256k(spare)," \ 1359e336903SWu, Josh "512k(dtb),6M(kernel)ro,-(rootfs)" 1369e336903SWu, Josh 1379e336903SWu, Josh #define CONFIG_EXTRA_ENV_SETTINGS \ 1389e336903SWu, Josh "console=console=ttyS0,115200\0" \ 1399e336903SWu, Josh "mtdparts="MTDPARTS_DEFAULT"\0" \ 1409e336903SWu, Josh "bootargs_nand=rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs rw\0"\ 1419e336903SWu, Josh "bootargs_mmc=root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait\0" 1429e336903SWu, Josh 1439e336903SWu, Josh /* MMC */ 1449e336903SWu, Josh #ifdef CONFIG_CMD_MMC 1459e336903SWu, Josh #define CONFIG_MMC 1469e336903SWu, Josh #define CONFIG_GENERIC_MMC 1479e336903SWu, Josh #define CONFIG_GENERIC_ATMEL_MCI 1489e336903SWu, Josh #endif 1499e336903SWu, Josh 1509e336903SWu, Josh /* FAT */ 1519e336903SWu, Josh #ifdef CONFIG_CMD_FAT 1529e336903SWu, Josh #define CONFIG_DOS_PARTITION 1539e336903SWu, Josh #endif 1549e336903SWu, Josh 15516276220SBo Shen /* Ethernet */ 15616276220SBo Shen #define CONFIG_KS8851_MLL 15716276220SBo Shen #define CONFIG_KS8851_MLL_BASEADDR 0x30000000 /* use NCS2 */ 15816276220SBo Shen 1599e336903SWu, Josh #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */ 1609e336903SWu, Josh 1619e336903SWu, Josh #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE 1629e336903SWu, Josh #define CONFIG_SYS_MEMTEST_END 0x26e00000 1639e336903SWu, Josh 164d9bef0adSBo Shen /* USB host */ 165d9bef0adSBo Shen #ifdef CONFIG_CMD_USB 166d9bef0adSBo Shen #define CONFIG_USB_ATMEL 167dcd2f1a0SBo Shen #define CONFIG_USB_ATMEL_CLK_SEL_PLLB 168d9bef0adSBo Shen #define CONFIG_USB_OHCI_NEW 169d9bef0adSBo Shen #define CONFIG_SYS_USB_OHCI_CPU_INIT 170d9bef0adSBo Shen #define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_BASE_OHCI 171d9bef0adSBo Shen #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9n12" 172d9bef0adSBo Shen #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1 173d9bef0adSBo Shen #define CONFIG_USB_STORAGE 174d9bef0adSBo Shen #endif 175d9bef0adSBo Shen 1769e336903SWu, Josh #ifdef CONFIG_SYS_USE_SPIFLASH 1779e336903SWu, Josh 1789e336903SWu, Josh /* bootstrap + u-boot + env + linux in dataflash on CS0 */ 1799e336903SWu, Josh #define CONFIG_ENV_IS_IN_SPI_FLASH 1809e336903SWu, Josh #define CONFIG_ENV_OFFSET 0x5000 1819e336903SWu, Josh #define CONFIG_ENV_SIZE 0x3000 1829e336903SWu, Josh #define CONFIG_ENV_SECT_SIZE 0x1000 1839e336903SWu, Josh #define CONFIG_BOOTCOMMAND \ 1849e336903SWu, Josh "setenv bootargs ${console} ${mtdparts} ${bootargs_nand};" \ 1859e336903SWu, Josh "sf probe 0; sf read 0x22000000 0x100000 0x300000; " \ 1869e336903SWu, Josh "bootm 0x22000000" 1879e336903SWu, Josh 1889e336903SWu, Josh #elif defined(CONFIG_SYS_USE_NANDFLASH) 1899e336903SWu, Josh 1909e336903SWu, Josh /* bootstrap + u-boot + env + linux in nandflash */ 1919e336903SWu, Josh #define CONFIG_ENV_IS_IN_NAND 1929e336903SWu, Josh #define CONFIG_ENV_OFFSET 0xc0000 1939e336903SWu, Josh #define CONFIG_ENV_OFFSET_REDUND 0x100000 1949e336903SWu, Josh #define CONFIG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */ 1959e336903SWu, Josh #define CONFIG_BOOTCOMMAND \ 1969e336903SWu, Josh "setenv bootargs ${console} ${mtdparts} ${bootargs_nand};" \ 1979e336903SWu, Josh "nand read 0x21000000 0x180000 0x080000;" \ 1989e336903SWu, Josh "nand read 0x22000000 0x200000 0x400000;" \ 1999e336903SWu, Josh "bootm 0x22000000 - 0x21000000" 2009e336903SWu, Josh 2019e336903SWu, Josh #else /* CONFIG_SYS_USE_MMC */ 2029e336903SWu, Josh 2039e336903SWu, Josh /* bootstrap + u-boot + env + linux in mmc */ 20423ac62d4SWu, Josh 20523ac62d4SWu, Josh #ifdef CONFIG_ENV_IS_IN_MMC 20623ac62d4SWu, Josh /* Use raw reserved sectors to save environment */ 2079e336903SWu, Josh #define CONFIG_ENV_OFFSET 0x2000 2089e336903SWu, Josh #define CONFIG_ENV_SIZE 0x1000 2099e336903SWu, Josh #define CONFIG_SYS_MMC_ENV_DEV 0 21023ac62d4SWu, Josh #else 21123ac62d4SWu, Josh /* Use file in FAT file to save environment */ 21223ac62d4SWu, Josh #define CONFIG_ENV_IS_IN_FAT 21323ac62d4SWu, Josh #define CONFIG_FAT_WRITE 21423ac62d4SWu, Josh #define FAT_ENV_INTERFACE "mmc" 21523ac62d4SWu, Josh #define FAT_ENV_FILE "uboot.env" 21623ac62d4SWu, Josh #define FAT_ENV_DEVICE_AND_PART "0" 21723ac62d4SWu, Josh #define CONFIG_ENV_SIZE 0x4000 21823ac62d4SWu, Josh #endif 21923ac62d4SWu, Josh 2209e336903SWu, Josh #define CONFIG_BOOTCOMMAND \ 2219e336903SWu, Josh "setenv bootargs ${console} ${mtdparts} ${bootargs_mmc};" \ 2229e336903SWu, Josh "fatload mmc 0:1 0x21000000 dtb;" \ 2239e336903SWu, Josh "fatload mmc 0:1 0x22000000 uImage;" \ 2249e336903SWu, Josh "bootm 0x22000000 - 0x21000000" 2259e336903SWu, Josh 2269e336903SWu, Josh #endif 2279e336903SWu, Josh 2289e336903SWu, Josh #define CONFIG_SYS_PROMPT "U-Boot> " 2299e336903SWu, Josh #define CONFIG_SYS_CBSIZE 256 2309e336903SWu, Josh #define CONFIG_SYS_MAXARGS 16 2319e336903SWu, Josh #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) \ 2329e336903SWu, Josh + 16) 2339e336903SWu, Josh #define CONFIG_SYS_LONGHELP 2349e336903SWu, Josh #define CONFIG_CMDLINE_EDITING 2359e336903SWu, Josh #define CONFIG_AUTO_COMPLETE 2369e336903SWu, Josh #define CONFIG_SYS_HUSH_PARSER 2379e336903SWu, Josh 2389e336903SWu, Josh /* 2399e336903SWu, Josh * Size of malloc() pool 2409e336903SWu, Josh */ 2419e336903SWu, Josh #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024) 242*ff255e83SBo Shen 243*ff255e83SBo Shen /* SPL */ 244*ff255e83SBo Shen #define CONFIG_SPL_FRAMEWORK 245*ff255e83SBo Shen #define CONFIG_SPL_TEXT_BASE 0x300000 246*ff255e83SBo Shen #define CONFIG_SPL_MAX_SIZE 0x6000 247*ff255e83SBo Shen #define CONFIG_SPL_STACK 0x308000 248*ff255e83SBo Shen 249*ff255e83SBo Shen #define CONFIG_SPL_BSS_START_ADDR 0x20000000 250*ff255e83SBo Shen #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 251*ff255e83SBo Shen #define CONFIG_SYS_SPL_MALLOC_START 0x20080000 252*ff255e83SBo Shen #define CONFIG_SYS_SPL_MALLOC_SIZE 0x80000 253*ff255e83SBo Shen 254*ff255e83SBo Shen #define CONFIG_SPL_LIBCOMMON_SUPPORT 255*ff255e83SBo Shen #define CONFIG_SPL_LIBGENERIC_SUPPORT 256*ff255e83SBo Shen #define CONFIG_SPL_GPIO_SUPPORT 257*ff255e83SBo Shen #define CONFIG_SPL_SERIAL_SUPPORT 258*ff255e83SBo Shen 259*ff255e83SBo Shen #define CONFIG_SPL_BOARD_INIT 260*ff255e83SBo Shen #define CONFIG_SYS_MONITOR_LEN (512 << 10) 261*ff255e83SBo Shen 262*ff255e83SBo Shen #define CONFIG_SYS_MASTER_CLOCK 132096000 263*ff255e83SBo Shen #define CONFIG_SYS_AT91_PLLA 0x20953f03 264*ff255e83SBo Shen #define CONFIG_SYS_MCKR 0x1301 265*ff255e83SBo Shen #define CONFIG_SYS_MCKR_CSS 0x1302 266*ff255e83SBo Shen 267*ff255e83SBo Shen #define ATMEL_BASE_MPDDRC ATMEL_BASE_DDRSDRC 268*ff255e83SBo Shen 269*ff255e83SBo Shen #ifdef CONFIG_SYS_USE_MMC 270*ff255e83SBo Shen #define CONFIG_SPL_LDSCRIPT arch/arm/mach-at91/arm926ejs/u-boot-spl.lds 271*ff255e83SBo Shen #define CONFIG_SPL_MMC_SUPPORT 272*ff255e83SBo Shen #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x400 273*ff255e83SBo Shen #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200 274*ff255e83SBo Shen #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 275*ff255e83SBo Shen #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" 276*ff255e83SBo Shen #define CONFIG_SPL_FAT_SUPPORT 277*ff255e83SBo Shen #define CONFIG_SPL_LIBDISK_SUPPORT 278*ff255e83SBo Shen 279*ff255e83SBo Shen #elif CONFIG_SYS_USE_NANDFLASH 280*ff255e83SBo Shen #define CONFIG_SPL_NAND_SUPPORT 281*ff255e83SBo Shen #define CONFIG_SPL_NAND_DRIVERS 282*ff255e83SBo Shen #define CONFIG_SPL_NAND_BASE 283*ff255e83SBo Shen #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x40000 284*ff255e83SBo Shen #define CONFIG_SYS_NAND_5_ADDR_CYCLE 285*ff255e83SBo Shen #define CONFIG_SYS_NAND_PAGE_SIZE 0x800 286*ff255e83SBo Shen #define CONFIG_SYS_NAND_PAGE_COUNT 64 287*ff255e83SBo Shen #define CONFIG_SYS_NAND_OOBSIZE 64 288*ff255e83SBo Shen #define CONFIG_SYS_NAND_BLOCK_SIZE 0x20000 289*ff255e83SBo Shen #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0x0 290*ff255e83SBo Shen #define CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER 291*ff255e83SBo Shen 292*ff255e83SBo Shen #elif CONFIG_SYS_USE_SPIFLASH 293*ff255e83SBo Shen #define CONFIG_SPL_SPI_SUPPORT 294*ff255e83SBo Shen #define CONFIG_SPL_SPI_FLASH_SUPPORT 295*ff255e83SBo Shen #define CONFIG_SPL_SPI_LOAD 296*ff255e83SBo Shen #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8400 297*ff255e83SBo Shen 298*ff255e83SBo Shen #endif 2999e336903SWu, Josh 3009e336903SWu, Josh #endif 301