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