Rick Chen | b46a18b | 2017-12-26 13:55:54 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 Andes Technology Corporation |
| 3 | * Rick Chen, Andes Technology Corporation <rick@andestech.com> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #ifndef __CONFIG_H |
| 9 | #define __CONFIG_H |
| 10 | |
| 11 | /* |
| 12 | * CPU and Board Configuration Options |
| 13 | */ |
| 14 | #define CONFIG_SKIP_LOWLEVEL_INIT |
| 15 | |
| 16 | #define CONFIG_CMDLINE_EDITING |
| 17 | #define CONFIG_BOOTP_SEND_HOSTNAME |
| 18 | #define CONFIG_BOOTP_SERVERIP |
| 19 | |
| 20 | #ifdef CONFIG_SKIP_LOWLEVEL_INIT |
| 21 | #define CONFIG_SYS_TEXT_BASE 0x00000000 |
| 22 | #ifdef CONFIG_OF_CONTROL |
| 23 | #undef CONFIG_OF_SEPARATE |
| 24 | #define CONFIG_OF_EMBED |
| 25 | #endif |
| 26 | #else |
| 27 | #define CONFIG_SYS_TEXT_BASE 0x80000000 |
| 28 | #endif |
| 29 | |
| 30 | /* |
| 31 | * Miscellaneous configurable options |
| 32 | */ |
| 33 | #define CONFIG_SYS_LONGHELP /* undef to save memory */ |
| 34 | #define CONFIG_SYS_CBSIZE 1024 /* Console I/O Buffer Size */ |
| 35 | |
| 36 | /* |
| 37 | * Print Buffer Size |
| 38 | */ |
| 39 | #define CONFIG_SYS_PBSIZE \ |
| 40 | (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16) |
| 41 | |
| 42 | /* |
| 43 | * max number of command args |
| 44 | */ |
| 45 | #define CONFIG_SYS_MAXARGS 16 |
| 46 | |
| 47 | /* |
| 48 | * Boot Argument Buffer Size |
| 49 | */ |
| 50 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 51 | |
| 52 | /* |
| 53 | * Size of malloc() pool |
| 54 | * 512kB is suggested, (CONFIG_ENV_SIZE + 128 * 1024) was not enough |
| 55 | */ |
| 56 | #define CONFIG_SYS_MALLOC_LEN (512 << 10) |
| 57 | |
| 58 | /* |
| 59 | * Physical Memory Map |
| 60 | */ |
| 61 | #define CONFIG_NR_DRAM_BANKS 2 |
| 62 | #define PHYS_SDRAM_0 0x00000000 /* SDRAM Bank #1 */ |
| 63 | #define PHYS_SDRAM_1 \ |
| 64 | (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE) /* SDRAM Bank #2 */ |
| 65 | #define PHYS_SDRAM_0_SIZE 0x20000000 /* 512 MB */ |
| 66 | #define PHYS_SDRAM_1_SIZE 0x20000000 /* 512 MB */ |
| 67 | #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_0 |
| 68 | |
| 69 | /* |
| 70 | * Serial console configuration |
| 71 | */ |
| 72 | #define CONFIG_CONS_INDEX 1 |
| 73 | #define CONFIG_SYS_NS16550_SERIAL |
| 74 | #ifndef CONFIG_DM_SERIAL |
| 75 | #define CONFIG_SYS_NS16550_REG_SIZE -4 |
| 76 | #endif |
| 77 | #define CONFIG_SYS_NS16550_CLK 19660800 |
| 78 | |
| 79 | /* |
| 80 | * SD (MMC) controller |
| 81 | */ |
| 82 | #define CONFIG_FTSDC010_NUMBER 1 |
| 83 | #define CONFIG_FTSDC010_SDIO |
| 84 | |
| 85 | /* Init Stack Pointer */ |
| 86 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE + 0x1000000 - \ |
| 87 | GENERATED_GBL_DATA_SIZE) |
| 88 | |
| 89 | /* |
| 90 | * Load address and memory test area should agree with |
| 91 | * arch/riscv/config.mk. Be careful not to overwrite U-Boot itself. |
| 92 | */ |
| 93 | #define CONFIG_SYS_LOAD_ADDR 0x100000 /* SDRAM */ |
| 94 | |
| 95 | /* |
| 96 | * memtest works on 512 MB in DRAM |
| 97 | */ |
| 98 | #define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_0 |
| 99 | #define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_0 + PHYS_SDRAM_0_SIZE) |
| 100 | |
| 101 | /* environments */ |
| 102 | #define CONFIG_ENV_SPI_BUS 0 |
| 103 | #define CONFIG_ENV_SPI_CS 0 |
| 104 | #define CONFIG_ENV_SPI_MAX_HZ 50000000 |
| 105 | #define CONFIG_ENV_SPI_MODE 0 |
| 106 | #define CONFIG_ENV_SECT_SIZE 0x1000 |
| 107 | #define CONFIG_ENV_OVERWRITE |
| 108 | |
| 109 | /* SPI FLASH */ |
| 110 | #define CONFIG_SF_DEFAULT_BUS 0 |
| 111 | #define CONFIG_SF_DEFAULT_CS 0 |
| 112 | #define CONFIG_SF_DEFAULT_SPEED 1000000 |
| 113 | #define CONFIG_SF_DEFAULT_MODE 0 |
| 114 | |
| 115 | /* |
| 116 | * For booting Linux, the board info and command line data |
| 117 | * have to be in the first 16 MB of memory, since this is |
| 118 | * the maximum mapped by the Linux kernel during initialization. |
| 119 | */ |
| 120 | |
| 121 | /* Initial Memory map for Linux*/ |
| 122 | #define CONFIG_SYS_BOOTMAPSZ (64 << 20) |
| 123 | /* Increase max gunzip size */ |
| 124 | #define CONFIG_SYS_BOOTM_LEN (64 << 20) |
| 125 | |
| 126 | #endif /* __CONFIG_H */ |