Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Sysam stmark2 board configuration |
| 4 | * |
| 5 | * (C) Copyright 2017 Angelo Dureghello <angelo@sysam.it> |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __STMARK2_CONFIG_H |
| 9 | #define __STMARK2_CONFIG_H |
| 10 | |
Mario Six | 5bc0543 | 2018-03-28 14:38:20 +0200 | [diff] [blame] | 11 | #define CONFIG_HOSTNAME "stmark2" |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 12 | |
| 13 | #define CONFIG_MCFUART |
| 14 | #define CONFIG_SYS_UART_PORT 0 |
| 15 | #define CONFIG_SYS_BAUDRATE_TABLE { 9600 , 19200 , 38400 , 57600, 115200 } |
| 16 | |
| 17 | #define LDS_BOARD_TEXT \ |
| 18 | board/sysam/stmark2/sbf_dram_init.o (.text*) |
| 19 | |
| 20 | #define CONFIG_TIMESTAMP |
| 21 | |
| 22 | #define CONFIG_BOOTARGS \ |
| 23 | "console=ttyS0,115200 root=/dev/ram0 rw " \ |
| 24 | "rootfstype=ramfs " \ |
| 25 | "rdinit=/bin/init " \ |
| 26 | "devtmpfs.mount=1" |
| 27 | |
| 28 | #define CONFIG_BOOTCOMMAND \ |
| 29 | "sf probe 0:1 50000000; " \ |
| 30 | "sf read ${loadaddr} 0x100000 ${kern_size}; " \ |
| 31 | "bootm ${loadaddr}" |
| 32 | |
| 33 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 34 | "kern_size=0x700000\0" \ |
| 35 | "loadaddr=0x40001000\0" \ |
| 36 | "-(rootfs)\0" \ |
| 37 | "update_uboot=loady ${loadaddr}; " \ |
| 38 | "sf probe 0:1 50000000; " \ |
| 39 | "sf erase 0 0x80000; " \ |
| 40 | "sf write ${loadaddr} 0 ${filesize}\0" \ |
| 41 | "update_kernel=loady ${loadaddr}; " \ |
| 42 | "setenv kern_size ${filesize}; saveenv; " \ |
| 43 | "sf probe 0:1 50000000; " \ |
| 44 | "sf erase 0x100000 0x700000; " \ |
| 45 | "sf write ${loadaddr} 0x100000 ${filesize}\0" \ |
| 46 | "update_rootfs=loady ${loadaddr}; " \ |
| 47 | "sf probe 0:1 50000000; " \ |
| 48 | "sf erase 0x00800000 0x100000; " \ |
| 49 | "sf write ${loadaddr} 0x00800000 ${filesize}\0" \ |
| 50 | "" |
| 51 | |
| 52 | /* Realtime clock */ |
| 53 | #undef CONFIG_MCFRTC |
| 54 | #define CONFIG_RTC_MCFRRTC |
| 55 | #define CONFIG_SYS_MCFRRTC_BASE 0xFC0A8000 |
| 56 | |
| 57 | /* spi not partitions */ |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 58 | #define CONFIG_JFFS2_CMDLINE |
| 59 | #define CONFIG_JFFS2_DEV "nor0" |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 60 | |
| 61 | /* Timer */ |
| 62 | #define CONFIG_MCFTMR |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 63 | |
| 64 | /* DSPI and Serial Flash */ |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 65 | #define CONFIG_CF_DSPI |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 66 | #define CONFIG_SERIAL_FLASH |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 67 | |
| 68 | #define CONFIG_SYS_SBFHDR_SIZE 0x7 |
| 69 | |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 70 | /* Input, PCI, Flexbus, and VCO */ |
| 71 | #define CONFIG_EXTRA_CLOCK |
| 72 | |
| 73 | #define CONFIG_PRAM 2048 /* 2048 KB */ |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 74 | #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ |
| 75 | |
| 76 | /* Print Buffer Size */ |
| 77 | #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \ |
| 78 | sizeof(CONFIG_SYS_PROMPT) + 16) |
| 79 | #define CONFIG_SYS_MAXARGS 16 |
| 80 | /* Boot Argument Buffer Size */ |
| 81 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 82 | |
| 83 | #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_SDRAM_BASE + 0x10000) |
| 84 | #define CONFIG_SYS_MBAR 0xFC000000 |
| 85 | |
| 86 | /* |
| 87 | * Definitions for initial stack pointer and data area (in internal SRAM) |
| 88 | */ |
| 89 | #define CONFIG_SYS_INIT_RAM_ADDR 0x80000000 |
| 90 | /* End of used area in internal SRAM */ |
| 91 | #define CONFIG_SYS_INIT_RAM_SIZE 0x10000 |
| 92 | #define CONFIG_SYS_INIT_RAM_CTRL 0x221 |
| 93 | #define CONFIG_SYS_GBL_DATA_OFFSET ((CONFIG_SYS_INIT_RAM_SIZE - \ |
| 94 | GENERATED_GBL_DATA_SIZE) - 32) |
| 95 | #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET |
| 96 | #define CONFIG_SYS_SBFHDR_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - 32) |
| 97 | |
| 98 | /* |
| 99 | * Start addresses for the final memory configuration |
| 100 | * (Set up by the startup code) |
| 101 | * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0 |
| 102 | */ |
| 103 | #define CONFIG_SYS_SDRAM_BASE 0x40000000 |
| 104 | #define CONFIG_SYS_SDRAM_SIZE 128 /* SDRAM size in MB */ |
| 105 | |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 106 | #define CONFIG_SYS_DRAM_TEST |
| 107 | |
| 108 | #if defined(CONFIG_CF_SBF) |
| 109 | #define CONFIG_SERIAL_BOOT |
| 110 | #endif |
| 111 | |
| 112 | #if defined(CONFIG_SERIAL_BOOT) |
| 113 | #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_TEXT_BASE + 0x400) |
| 114 | #else |
| 115 | #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_FLASH_BASE + 0x400) |
| 116 | #endif |
| 117 | |
| 118 | #define CONFIG_SYS_BOOTPARAMS_LEN (64 * 1024) |
| 119 | /* Reserve 256 kB for Monitor */ |
| 120 | #define CONFIG_SYS_MONITOR_LEN (256 << 10) |
| 121 | /* Reserve 256 kB for malloc() */ |
| 122 | #define CONFIG_SYS_MALLOC_LEN (256 << 10) |
| 123 | |
| 124 | /* |
| 125 | * For booting Linux, the board info and command line data |
| 126 | * have to be in the first 8 MB of memory, since this is |
| 127 | * the maximum mapped by the Linux kernel during initialization ?? |
| 128 | */ |
| 129 | /* Initial Memory map for Linux */ |
| 130 | #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + \ |
| 131 | (CONFIG_SYS_SDRAM_SIZE << 20)) |
| 132 | |
| 133 | /* Configuration for environment |
| 134 | * Environment is embedded in u-boot in the second sector of the flash |
| 135 | */ |
| 136 | |
| 137 | #if defined(CONFIG_CF_SBF) |
| 138 | #define CONFIG_ENV_IS_IN_SPI_FLASH 1 |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 139 | #endif |
| 140 | |
| 141 | #undef CONFIG_ENV_OVERWRITE |
| 142 | |
| 143 | /* Cache Configuration */ |
| 144 | #define CONFIG_SYS_CACHELINE_SIZE 16 |
| 145 | #define ICACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \ |
| 146 | CONFIG_SYS_INIT_RAM_SIZE - 8) |
| 147 | #define DCACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \ |
| 148 | CONFIG_SYS_INIT_RAM_SIZE - 4) |
| 149 | #define CONFIG_SYS_ICACHE_INV (CF_CACR_BCINVA + CF_CACR_ICINVA) |
| 150 | #define CONFIG_SYS_DCACHE_INV (CF_CACR_DCINVA) |
| 151 | #define CONFIG_SYS_CACHE_ACR2 (CONFIG_SYS_SDRAM_BASE | \ |
| 152 | CF_ADDRMASK(CONFIG_SYS_SDRAM_SIZE) | \ |
| 153 | CF_ACR_EN | CF_ACR_SM_ALL) |
| 154 | #define CONFIG_SYS_CACHE_ICACR (CF_CACR_BEC | CF_CACR_IEC | \ |
| 155 | CF_CACR_ICINVA | CF_CACR_EUSP) |
| 156 | #define CONFIG_SYS_CACHE_DCACR ((CONFIG_SYS_CACHE_ICACR | \ |
| 157 | CF_CACR_DEC | CF_CACR_DDCM_P | \ |
| 158 | CF_CACR_DCINVA) & ~CF_CACR_ICINVA) |
| 159 | |
| 160 | #define CACR_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \ |
| 161 | CONFIG_SYS_INIT_RAM_SIZE - 12) |
| 162 | |
Angelo Durgehello | ff56f2b | 2019-11-15 23:54:15 +0100 | [diff] [blame] | 163 | #ifdef CONFIG_MCFFEC |
| 164 | #define CONFIG_MII_INIT 1 |
| 165 | #define CONFIG_SYS_DISCOVER_PHY |
| 166 | #define CONFIG_SYS_RX_ETH_BUFFER 8 |
| 167 | #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN |
| 168 | /* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */ |
| 169 | #ifndef CONFIG_SYS_DISCOVER_PHY |
| 170 | #define FECDUPLEX FULL |
| 171 | #define FECSPEED _100BASET |
| 172 | #else |
| 173 | #ifndef CONFIG_SYS_FAULT_ECHO_LINK_DOWN |
| 174 | #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN |
| 175 | #endif |
| 176 | #endif /* CONFIG_SYS_DISCOVER_PHY */ |
| 177 | #endif |
Angelo Dureghello | a373024 | 2017-08-07 01:17:18 +0200 | [diff] [blame] | 178 | #endif /* __STMARK2_CONFIG_H */ |