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