Mateusz Kulikowski | 6a302ae | 2013-12-02 23:30:58 +0100 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2007-2013 |
| 3 | * Stelian Pop <stelian.pop@leadtechdesign.com> |
| 4 | * Lead Tech Design <www.leadtechdesign.com> |
| 5 | * Thomas Petazzoni, Free Electrons, <thomas.petazzoni@free-electrons.com> |
| 6 | * Mateusz Kulikowski <mateusz.kulikowski@gmail.com> |
| 7 | * |
| 8 | * Settings for Calao USB-A9263 board |
| 9 | * |
| 10 | * U-Boot image has to be less than 200704 bytes, otherwise at91bootstrap |
| 11 | * installed on board will not be able to load it properly. |
| 12 | * |
| 13 | * SPDX-License-Identifier: GPL-2.0+ |
| 14 | */ |
| 15 | |
| 16 | #ifndef __CONFIG_H |
| 17 | #define __CONFIG_H |
| 18 | #include <asm/hardware.h> |
| 19 | |
| 20 | /* ARM asynchronous clock */ |
| 21 | #define CONFIG_SYS_AT91_MAIN_CLOCK 12000000 /* 12 MHz crystal */ |
| 22 | #define CONFIG_SYS_AT91_SLOW_CLOCK 32768 |
Mateusz Kulikowski | 6a302ae | 2013-12-02 23:30:58 +0100 | [diff] [blame] | 23 | |
| 24 | #define CONFIG_MACH_TYPE MACH_TYPE_USB_A9263 |
| 25 | |
| 26 | #define CONFIG_ARCH_CPU_INIT |
| 27 | |
| 28 | #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ |
| 29 | #define CONFIG_SETUP_MEMORY_TAGS |
| 30 | #define CONFIG_INITRD_TAG |
| 31 | |
| 32 | #define CONFIG_SKIP_LOWLEVEL_INIT |
| 33 | |
| 34 | #define CONFIG_DISPLAY_CPUINFO |
| 35 | |
Mateusz Kulikowski | 6a302ae | 2013-12-02 23:30:58 +0100 | [diff] [blame] | 36 | #define CONFIG_SYS_TEXT_BASE 0x23f00000 |
| 37 | |
| 38 | /* |
| 39 | * Hardware drivers |
| 40 | */ |
| 41 | #define CONFIG_AT91_GPIO |
| 42 | |
| 43 | /* serial console */ |
| 44 | #define CONFIG_ATMEL_USART |
| 45 | #define CONFIG_USART_BASE ATMEL_BASE_DBGU |
| 46 | #define CONFIG_USART_ID ATMEL_ID_SYS |
| 47 | #define CONFIG_BAUDRATE 115200 |
| 48 | |
Mateusz Kulikowski | 6a302ae | 2013-12-02 23:30:58 +0100 | [diff] [blame] | 49 | |
| 50 | /* |
| 51 | * BOOTP options |
| 52 | */ |
| 53 | #define CONFIG_BOOTP_BOOTFILESIZE |
| 54 | #define CONFIG_BOOTP_BOOTPATH |
| 55 | #define CONFIG_BOOTP_GATEWAY |
| 56 | #define CONFIG_BOOTP_HOSTNAME |
| 57 | |
| 58 | /* |
| 59 | * Command line configuration. |
| 60 | */ |
Mateusz Kulikowski | 6a302ae | 2013-12-02 23:30:58 +0100 | [diff] [blame] | 61 | #define CONFIG_CMD_NAND |
| 62 | |
| 63 | /* SDRAM */ |
| 64 | #define CONFIG_NR_DRAM_BANKS 1 |
| 65 | #define CONFIG_SYS_SDRAM_BASE ATMEL_BASE_CS1 |
| 66 | #define CONFIG_SYS_SDRAM_SIZE 0x04000000 |
| 67 | |
| 68 | #define CONFIG_SYS_INIT_SP_ADDR \ |
| 69 | (ATMEL_BASE_SRAM1 + 0x1000 - GENERATED_GBL_DATA_SIZE) |
| 70 | |
| 71 | /* DataFlash */ |
| 72 | #define CONFIG_ATMEL_DATAFLASH_SPI |
| 73 | #define CONFIG_HAS_DATAFLASH |
Mateusz Kulikowski | 6a302ae | 2013-12-02 23:30:58 +0100 | [diff] [blame] | 74 | #define CONFIG_SYS_MAX_DATAFLASH_BANKS 1 |
| 75 | #define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 0xC0000000 |
| 76 | #define AT91_SPI_CLK 8000000 |
| 77 | #define DATAFLASH_TCSS (0x1a << 16) |
| 78 | #define DATAFLASH_TCHS (0x1 << 24) |
| 79 | |
| 80 | /* no NOR flash */ |
| 81 | #define CONFIG_SYS_NO_FLASH |
| 82 | |
| 83 | /* NAND flash */ |
| 84 | #ifdef CONFIG_CMD_NAND |
| 85 | #define CONFIG_NAND_ATMEL |
| 86 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 |
| 87 | #define CONFIG_SYS_NAND_BASE ATMEL_BASE_CS3 |
| 88 | /* our ALE is AD21 */ |
| 89 | #define CONFIG_SYS_NAND_MASK_ALE (1 << 21) |
| 90 | /* our CLE is AD22 */ |
| 91 | #define CONFIG_SYS_NAND_MASK_CLE (1 << 22) |
| 92 | #define CONFIG_SYS_NAND_ENABLE_PIN GPIO_PIN_PD(15) |
| 93 | #define CONFIG_SYS_NAND_READY_PIN GPIO_PIN_PA(22) |
| 94 | #endif |
| 95 | |
| 96 | #define MTDPARTS_DEFAULT \ |
| 97 | "mtdparts=atmel_nand:16m(kernel)ro,120m(root1),-(root2)" |
| 98 | |
| 99 | /* Ethernet */ |
| 100 | #define CONFIG_MACB |
| 101 | #define CONFIG_RMII |
| 102 | #define CONFIG_NET_RETRY_COUNT 20 |
| 103 | #define CONFIG_AT91_WANTS_COMMON_PHY |
| 104 | |
| 105 | /* USB */ |
| 106 | #ifdef CONFIG_CMD_USB |
| 107 | #define CONFIG_USB_ATMEL |
| 108 | #define CONFIG_USB_OHCI_NEW |
| 109 | #define CONFIG_DOS_PARTITION |
| 110 | #define CONFIG_SYS_USB_OHCI_CPU_INIT |
| 111 | #define CONFIG_SYS_USB_OHCI_REGS_BASE 0x00a00000 |
| 112 | #define CONFIG_SYS_USB_OHCI_SLOT_NAME "at91sam9263" |
| 113 | #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 |
Mateusz Kulikowski | 6a302ae | 2013-12-02 23:30:58 +0100 | [diff] [blame] | 114 | #endif |
| 115 | |
| 116 | #define CONFIG_SYS_LOAD_ADDR 0x22000000 |
| 117 | |
| 118 | #define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE |
| 119 | #define CONFIG_SYS_MEMTEST_END 0x23e00000 |
| 120 | |
| 121 | /* bootstrap + u-boot + env in dataflash on CS0 */ |
| 122 | #define CONFIG_ENV_IS_IN_DATAFLASH |
| 123 | #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x4000) |
| 124 | #define CONFIG_ENV_OFFSET 0x2000 |
| 125 | #define CONFIG_ENV_ADDR (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + \ |
| 126 | CONFIG_ENV_OFFSET) |
| 127 | #define CONFIG_ENV_SIZE 0x2000 |
| 128 | #define CONFIG_BOOTCOMMAND "nboot 21000000 0" |
| 129 | #define CONFIG_BOOTARGS "console=ttyS0,115200 " \ |
| 130 | "root=/dev/mtdblock1 " \ |
| 131 | "mtdparts=" MTDPARTS_DEFAULT " " \ |
| 132 | "rw rootfstype=jffs2" |
| 133 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 134 | "mtdparts=" MTDPARTS_DEFAULT "\0" \ |
| 135 | |
Mateusz Kulikowski | 6a302ae | 2013-12-02 23:30:58 +0100 | [diff] [blame] | 136 | #define CONFIG_SYS_CBSIZE 256 |
| 137 | #define CONFIG_SYS_MAXARGS 16 |
| 138 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 139 | sizeof(CONFIG_SYS_PROMPT) + 16) |
| 140 | #define CONFIG_CMDLINE_EDITING |
| 141 | #define CONFIG_AUTO_COMPLETE |
Mateusz Kulikowski | 6a302ae | 2013-12-02 23:30:58 +0100 | [diff] [blame] | 142 | #define CONFIG_SYS_LONGHELP |
| 143 | |
| 144 | /* |
| 145 | * Size of malloc() pool |
| 146 | */ |
| 147 | #define CONFIG_SYS_MALLOC_LEN ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000) |
| 148 | |
| 149 | #endif |