Dinh Nguyen | 7775440 | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 Altera Corporation <www.altera.com> |
| 3 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | * SPDX-License-Identifier: GPL-2.0+ |
Dinh Nguyen | 7775440 | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 5 | */ |
| 6 | #ifndef __CONFIG_H |
| 7 | #define __CONFIG_H |
| 8 | |
| 9 | #include <asm/arch/socfpga_base_addrs.h> |
| 10 | |
| 11 | /* |
| 12 | * High level configuration |
| 13 | */ |
| 14 | |
| 15 | #define CONFIG_ARMV7 |
| 16 | #define CONFIG_L2_OFF |
| 17 | #define CONFIG_SYS_DCACHE_OFF |
| 18 | #undef CONFIG_USE_IRQ |
| 19 | |
| 20 | #define CONFIG_MISC_INIT_R |
| 21 | #define CONFIG_SINGLE_BOOTLOADER |
| 22 | #define CONFIG_SOCFPGA |
| 23 | |
| 24 | #define CONFIG_SYS_TEXT_BASE 0x08000040 |
| 25 | #define V_NS16550_CLK 1000000 |
| 26 | #define CONFIG_BAUDRATE 57600 |
| 27 | #define CONFIG_SYS_HZ 1000 |
| 28 | #define CONFIG_TIMER_CLOCK_KHZ 2400 |
| 29 | #define CONFIG_SYS_LOAD_ADDR 0x7fc0 |
| 30 | |
| 31 | /* Console I/O Buffer Size */ |
| 32 | #define CONFIG_SYS_CBSIZE 256 |
| 33 | /* Monitor Command Prompt */ |
| 34 | #define CONFIG_SYS_PROMPT "SOCFPGA_CYCLONE5 # " |
| 35 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 36 | sizeof(CONFIG_SYS_PROMPT) + 16) |
| 37 | |
| 38 | /* |
| 39 | * Display CPU and Board Info |
| 40 | */ |
| 41 | #define CONFIG_DISPLAY_CPUINFO |
| 42 | #define CONFIG_DISPLAY_BOARDINFO |
| 43 | |
| 44 | /* |
| 45 | * Enable early stage initialization at C environment |
| 46 | */ |
| 47 | #define CONFIG_BOARD_EARLY_INIT_F |
| 48 | |
| 49 | /* flat device tree */ |
| 50 | #define CONFIG_OF_LIBFDT |
| 51 | /* skip updating the FDT blob */ |
| 52 | #define CONFIG_FDT_BLOB_SKIP_UPDATE |
| 53 | /* Initial Memory map size for Linux, minus 4k alignment for DFT blob */ |
| 54 | #define CONFIG_SYS_BOOTMAPSZ ((256*1024*1024) - (4*1024)) |
| 55 | |
| 56 | #define CONFIG_SPL_RAM_DEVICE |
Albert ARIBAUD | e05e5de | 2013-01-08 10:18:02 +0000 | [diff] [blame] | 57 | #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR |
Dinh Nguyen | 7775440 | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 58 | #define CONFIG_SYS_SPL_MALLOC_START ((unsigned long) (&__malloc_start)) |
| 59 | #define CONFIG_SYS_SPL_MALLOC_SIZE (&__malloc_end - &__malloc_start) |
| 60 | |
| 61 | /* |
| 62 | * Memory allocation (MALLOC) |
| 63 | */ |
| 64 | /* Room required on the stack for the environment data */ |
| 65 | #define CONFIG_ENV_SIZE 1024 |
| 66 | /* Size of DRAM reserved for malloc() use */ |
| 67 | #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024) |
| 68 | |
| 69 | /* SP location before relocation, must use scratch RAM */ |
| 70 | #define CONFIG_SYS_INIT_RAM_ADDR 0xFFFF0000 |
| 71 | /* Reserving 0x100 space at back of scratch RAM for debug info */ |
| 72 | #define CONFIG_SYS_INIT_RAM_SIZE (0x10000 - 0x100) |
| 73 | /* Stack pointer prior relocation, must situated at on-chip RAM */ |
| 74 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \ |
| 75 | CONFIG_SYS_INIT_RAM_SIZE - \ |
| 76 | GENERATED_GBL_DATA_SIZE) |
| 77 | |
| 78 | |
| 79 | /* |
| 80 | * Command line configuration. |
| 81 | */ |
| 82 | #define CONFIG_SYS_NO_FLASH |
| 83 | #include <config_cmd_default.h> |
| 84 | /* FAT file system support */ |
| 85 | #define CONFIG_CMD_FAT |
| 86 | |
| 87 | |
| 88 | /* |
| 89 | * Misc |
| 90 | */ |
| 91 | #define CONFIG_DOS_PARTITION 1 |
| 92 | |
| 93 | #ifdef CONFIG_SPL_BUILD |
| 94 | #undef CONFIG_PARTITIONS |
| 95 | #endif |
| 96 | |
| 97 | /* |
| 98 | * Environment setup |
| 99 | */ |
| 100 | |
| 101 | /* Delay before automatically booting the default image */ |
| 102 | #define CONFIG_BOOTDELAY 3 |
| 103 | /* Enable auto completion of commands using TAB */ |
| 104 | #define CONFIG_AUTO_COMPLETE |
| 105 | /* use "hush" command parser */ |
| 106 | #define CONFIG_SYS_HUSH_PARSER |
| 107 | #define CONFIG_SYS_PROMPT_HUSH_PS2 "> " |
| 108 | #define CONFIG_CMD_RUN |
| 109 | |
| 110 | #define CONFIG_BOOTCOMMAND "run ramboot" |
| 111 | |
| 112 | /* |
| 113 | * arguments passed to the bootm command. The value of |
| 114 | * CONFIG_BOOTARGS goes into the environment value "bootargs". |
| 115 | * Do note the value will overide also the chosen node in FDT blob. |
| 116 | */ |
| 117 | #define CONFIG_BOOTARGS "console=ttyS0,57600,mem=256M@0x0" |
| 118 | |
| 119 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 120 | "verify=n\0" \ |
Marek Vasut | 5368c55 | 2012-09-23 17:41:24 +0200 | [diff] [blame] | 121 | "loadaddr= " __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \ |
Dinh Nguyen | 7775440 | 2012-10-04 06:46:02 +0000 | [diff] [blame] | 122 | "ramboot=setenv bootargs " CONFIG_BOOTARGS ";" \ |
| 123 | "bootm ${loadaddr} - ${fdt_addr}\0" \ |
| 124 | "bootimage=uImage\0" \ |
| 125 | "fdt_addr=100\0" \ |
| 126 | "fsloadcmd=ext2load\0" \ |
| 127 | "bootm ${loadaddr} - ${fdt_addr}\0" \ |
| 128 | "qspiroot=/dev/mtdblock0\0" \ |
| 129 | "qspirootfstype=jffs2\0" \ |
| 130 | "qspiboot=setenv bootargs " CONFIG_BOOTARGS \ |
| 131 | " root=${qspiroot} rw rootfstype=${qspirootfstype};"\ |
| 132 | "bootm ${loadaddr} - ${fdt_addr}\0" |
| 133 | |
| 134 | /* using environment setting for stdin, stdout, stderr */ |
| 135 | #define CONFIG_SYS_CONSOLE_IS_IN_ENV |
| 136 | /* Enable the call to overwrite_console() */ |
| 137 | #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE |
| 138 | /* Enable overwrite of previous console environment settings */ |
| 139 | #define CONFIG_SYS_CONSOLE_ENV_OVERWRITE |
| 140 | |
| 141 | /* max number of command args */ |
| 142 | #define CONFIG_SYS_MAXARGS 16 |
| 143 | |
| 144 | |
| 145 | /* |
| 146 | * Hardware drivers |
| 147 | */ |
| 148 | |
| 149 | /* |
| 150 | * SDRAM Memory Map |
| 151 | */ |
| 152 | /* We have 1 bank of DRAM */ |
| 153 | #define CONFIG_NR_DRAM_BANKS 1 |
| 154 | /* SDRAM Bank #1 */ |
| 155 | #define CONFIG_SYS_SDRAM_BASE 0x00000000 |
| 156 | /* SDRAM memory size */ |
| 157 | #define PHYS_SDRAM_1_SIZE 0x80000000 |
| 158 | |
| 159 | #define PHYS_SDRAM_1 CONFIG_SYS_SDRAM_BASE |
| 160 | #define CONFIG_SYS_MEMTEST_START 0x00000000 |
| 161 | #define CONFIG_SYS_MEMTEST_END PHYS_SDRAM_1_SIZE |
| 162 | |
| 163 | /* |
| 164 | * NS16550 Configuration |
| 165 | */ |
| 166 | #define UART0_BASE SOCFPGA_UART0_ADDRESS |
| 167 | #define CONFIG_SYS_NS16550 |
| 168 | #define CONFIG_SYS_NS16550_SERIAL |
| 169 | #define CONFIG_SYS_NS16550_REG_SIZE -4 |
| 170 | #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK |
| 171 | #define CONFIG_CONS_INDEX 1 |
| 172 | #define CONFIG_SYS_NS16550_COM1 UART0_BASE |
| 173 | |
| 174 | #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200} |
| 175 | |
| 176 | /* |
| 177 | * FLASH |
| 178 | */ |
| 179 | #define CONFIG_SYS_NO_FLASH |
| 180 | |
| 181 | /* |
| 182 | * L4 OSC1 Timer 0 |
| 183 | */ |
| 184 | /* This timer use eosc1 where the clock frequency is fixed |
| 185 | * throughout any condition */ |
| 186 | #define CONFIG_SYS_TIMERBASE SOCFPGA_OSC1TIMER0_ADDRESS |
| 187 | |
| 188 | /* reload value when timer count to zero */ |
| 189 | #define TIMER_LOAD_VAL 0xFFFFFFFF |
| 190 | |
| 191 | #define CONFIG_ENV_IS_NOWHERE |
| 192 | |
| 193 | /* |
| 194 | * SPL "Second Program Loader" aka Initial Software |
| 195 | */ |
| 196 | |
| 197 | /* Enable building of SPL globally */ |
| 198 | #define CONFIG_SPL |
| 199 | #define CONFIG_SPL_FRAMEWORK |
| 200 | |
| 201 | /* TEXT_BASE for linking the SPL binary */ |
| 202 | #define CONFIG_SPL_TEXT_BASE 0xFFFF0000 |
| 203 | |
| 204 | /* Stack size for SPL */ |
| 205 | #define CONFIG_SPL_STACK_SIZE (4 * 1024) |
| 206 | |
| 207 | /* MALLOC size for SPL */ |
| 208 | #define CONFIG_SPL_MALLOC_SIZE (5 * 1024) |
| 209 | |
| 210 | #define CONFIG_SPL_SERIAL_SUPPORT |
| 211 | #define CONFIG_SPL_BOARD_INIT |
| 212 | |
| 213 | #define CHUNKSZ_CRC32 (1 * 1024) |
| 214 | |
| 215 | #define CONFIG_CRC32_VERIFY |
| 216 | |
| 217 | /* Linker script for SPL */ |
| 218 | #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv7/socfpga/u-boot-spl.lds" |
| 219 | |
| 220 | /* Support for common/libcommon.o in SPL binary */ |
| 221 | #define CONFIG_SPL_LIBCOMMON_SUPPORT |
| 222 | /* Support for lib/libgeneric.o in SPL binary */ |
| 223 | #define CONFIG_SPL_LIBGENERIC_SUPPORT |
| 224 | |
| 225 | #endif /* __CONFIG_H */ |