1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Sysam stmark2 board configuration
5 * (C) Copyright 2017 Angelo Dureghello <angelo@sysam.it>
8 #ifndef __STMARK2_CONFIG_H
9 #define __STMARK2_CONFIG_H
11 #define CONFIG_HOSTNAME "stmark2"
13 #define CONFIG_SYS_UART_PORT 0
15 #define LDS_BOARD_TEXT \
16 board/sysam/stmark2/sbf_dram_init.o (.text*)
18 #define CONFIG_EXTRA_ENV_SETTINGS \
19 "kern_size=0x700000\0" \
20 "loadaddr=0x40001000\0" \
22 "update_uboot=loady ${loadaddr}; " \
23 "sf probe 0:1 50000000; " \
24 "sf erase 0 0x80000; " \
25 "sf write ${loadaddr} 0 ${filesize}\0" \
26 "update_kernel=loady ${loadaddr}; " \
27 "setenv kern_size ${filesize}; saveenv; " \
28 "sf probe 0:1 50000000; " \
29 "sf erase 0x100000 0x700000; " \
30 "sf write ${loadaddr} 0x100000 ${filesize}\0" \
31 "update_rootfs=loady ${loadaddr}; " \
32 "sf probe 0:1 50000000; " \
33 "sf erase 0x00800000 0x100000; " \
34 "sf write ${loadaddr} 0x00800000 ${filesize}\0" \
39 #define CONFIG_RTC_MCFRRTC
40 #define CONFIG_SYS_MCFRRTC_BASE 0xFC0A8000
42 #define CONFIG_SYS_SBFHDR_SIZE 0x7
44 /* Input, PCI, Flexbus, and VCO */
45 #define CONFIG_EXTRA_CLOCK
47 #define CONFIG_PRAM 2048 /* 2048 KB */
48 #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
50 /* Print Buffer Size */
51 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
52 sizeof(CONFIG_SYS_PROMPT) + 16)
53 #define CONFIG_SYS_MAXARGS 16
54 /* Boot Argument Buffer Size */
55 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
57 #define CONFIG_SYS_MBAR 0xFC000000
60 * Definitions for initial stack pointer and data area (in internal SRAM)
62 #define CONFIG_SYS_INIT_RAM_ADDR 0x80000000
63 /* End of used area in internal SRAM */
64 #define CONFIG_SYS_INIT_RAM_SIZE 0x10000
65 #define CONFIG_SYS_INIT_RAM_CTRL 0x221
66 #define CONFIG_SYS_GBL_DATA_OFFSET ((CONFIG_SYS_INIT_RAM_SIZE - \
67 GENERATED_GBL_DATA_SIZE) - 32)
68 #define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET
69 #define CONFIG_SYS_SBFHDR_DATA_OFFSET (CONFIG_SYS_INIT_RAM_SIZE - 32)
72 * Start addresses for the final memory configuration
73 * (Set up by the startup code)
74 * Please note that CONFIG_SYS_SDRAM_BASE _must_ start at 0
76 #define CONFIG_SYS_SDRAM_BASE 0x40000000
77 #define CONFIG_SYS_SDRAM_SIZE 128 /* SDRAM size in MB */
79 #define CONFIG_SYS_DRAM_TEST
81 #if defined(CONFIG_CF_SBF)
82 #define CONFIG_SERIAL_BOOT
85 #if defined(CONFIG_SERIAL_BOOT)
86 #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_TEXT_BASE + 0x400)
88 #define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_FLASH_BASE + 0x400)
91 #define CONFIG_SYS_BOOTPARAMS_LEN (64 * 1024)
92 /* Reserve 256 kB for Monitor */
93 #define CONFIG_SYS_MONITOR_LEN (256 << 10)
96 * For booting Linux, the board info and command line data
97 * have to be in the first 8 MB of memory, since this is
98 * the maximum mapped by the Linux kernel during initialization ??
100 /* Initial Memory map for Linux */
101 #define CONFIG_SYS_BOOTMAPSZ (CONFIG_SYS_SDRAM_BASE + \
102 (CONFIG_SYS_SDRAM_SIZE << 20))
104 /* Configuration for environment
105 * Environment is embedded in u-boot in the second sector of the flash
108 /* Cache Configuration */
109 #define ICACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
110 CONFIG_SYS_INIT_RAM_SIZE - 8)
111 #define DCACHE_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
112 CONFIG_SYS_INIT_RAM_SIZE - 4)
113 #define CONFIG_SYS_ICACHE_INV (CF_CACR_BCINVA + CF_CACR_ICINVA)
114 #define CONFIG_SYS_DCACHE_INV (CF_CACR_DCINVA)
115 #define CONFIG_SYS_CACHE_ACR2 (CONFIG_SYS_SDRAM_BASE | \
116 CF_ADDRMASK(CONFIG_SYS_SDRAM_SIZE) | \
117 CF_ACR_EN | CF_ACR_SM_ALL)
118 #define CONFIG_SYS_CACHE_ICACR (CF_CACR_BEC | CF_CACR_IEC | \
119 CF_CACR_ICINVA | CF_CACR_EUSP)
120 #define CONFIG_SYS_CACHE_DCACR ((CONFIG_SYS_CACHE_ICACR | \
121 CF_CACR_DEC | CF_CACR_DDCM_P | \
122 CF_CACR_DCINVA) & ~CF_CACR_ICINVA)
124 #define CACR_STATUS (CONFIG_SYS_INIT_RAM_ADDR + \
125 CONFIG_SYS_INIT_RAM_SIZE - 12)
128 #define CONFIG_SYS_DISCOVER_PHY
129 /* If CONFIG_SYS_DISCOVER_PHY is not defined - hardcoded */
130 #ifndef CONFIG_SYS_DISCOVER_PHY
131 #define FECDUPLEX FULL
132 #define FECSPEED _100BASET
133 #endif /* CONFIG_SYS_DISCOVER_PHY */
135 #endif /* __STMARK2_CONFIG_H */