]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - arch/blackfin/include/asm/config.h
Blackfin: fix building after asm-offsets.h intro
[karo-tx-uboot.git] / arch / blackfin / include / asm / config.h
1 /*
2  * config.h - setup common defines for Blackfin boards based on config.h
3  *
4  * Copyright (c) 2007-2009 Analog Devices Inc.
5  *
6  * Licensed under the GPL-2 or later.
7  */
8
9 #ifndef __ASM_BLACKFIN_CONFIG_POST_H__
10 #define __ASM_BLACKFIN_CONFIG_POST_H__
11
12 /* Some of our defines use this (like CONFIG_SYS_GBL_DATA_ADDR) */
13 #include <asm-offsets.h>
14
15 #ifndef CONFIG_BFIN_SCRATCH_REG
16 # define CONFIG_BFIN_SCRATCH_REG retn
17 #endif
18
19 /* Relocation to SDRAM works on all Blackfin boards */
20 #define CONFIG_RELOC_FIXUP_WORKS
21
22 /* Make sure the structure is properly aligned */
23 #if ((CONFIG_SYS_GBL_DATA_ADDR & -4) != CONFIG_SYS_GBL_DATA_ADDR)
24 # error CONFIG_SYS_GBL_DATA_ADDR: must be 4 byte aligned
25 #endif
26
27 /* Set default CONFIG_VCO_HZ if need be */
28 #if !defined(CONFIG_VCO_HZ)
29 # if (CONFIG_CLKIN_HALF == 0)
30 #  define CONFIG_VCO_HZ (CONFIG_CLKIN_HZ * CONFIG_VCO_MULT)
31 # else
32 #  define CONFIG_VCO_HZ ((CONFIG_CLKIN_HZ * CONFIG_VCO_MULT) / 2)
33 # endif
34 #endif
35
36 /* Set default CONFIG_CCLK_HZ if need be */
37 #if !defined(CONFIG_CCLK_HZ)
38 # if (CONFIG_PLL_BYPASS == 0)
39 #  define CONFIG_CCLK_HZ (CONFIG_VCO_HZ / CONFIG_CCLK_DIV)
40 # else
41 #  define CONFIG_CCLK_HZ CONFIG_CLKIN_HZ
42 # endif
43 #endif
44
45 /* Set default CONFIG_SCLK_HZ if need be */
46 #if !defined(CONFIG_SCLK_HZ)
47 # if (CONFIG_PLL_BYPASS == 0)
48 #  define CONFIG_SCLK_HZ (CONFIG_VCO_HZ / CONFIG_SCLK_DIV)
49 # else
50 #  define CONFIG_SCLK_HZ CONFIG_CLKIN_HZ
51 # endif
52 #endif
53
54 /* Since we use these to program PLL registers directly,
55  * make sure the values are sane and won't screw us up.
56  */
57 #if (CONFIG_VCO_MULT & 0x3F) != CONFIG_VCO_MULT
58 # error CONFIG_VCO_MULT: Invalid value: must fit in 6 bits (0 - 63)
59 #endif
60 #if (CONFIG_CLKIN_HALF & 0x1) != CONFIG_CLKIN_HALF
61 # error CONFIG_CLKIN_HALF: Invalid value: must be 0 or 1
62 #endif
63 #if (CONFIG_PLL_BYPASS & 0x1) != CONFIG_PLL_BYPASS
64 # error CONFIG_PLL_BYPASS: Invalid value: must be 0 or 1
65 #endif
66
67 /* If we are using KGDB, make sure we defer exceptions */
68 #ifdef CONFIG_CMD_KGDB
69 # define CONFIG_EXCEPTION_DEFER 1
70 #endif
71
72 /* Using L1 scratch pad makes sense for everyone by default. */
73 #ifndef CONFIG_LINUX_CMDLINE_ADDR
74 # define CONFIG_LINUX_CMDLINE_ADDR L1_SRAM_SCRATCH
75 #endif
76 #ifndef CONFIG_LINUX_CMDLINE_SIZE
77 # define CONFIG_LINUX_CMDLINE_SIZE L1_SRAM_SCRATCH_SIZE
78 #endif
79
80 /* Set default SPI flash CS to the one we boot from */
81 #if defined(CONFIG_ENV_IS_IN_SPI_FLASH) && !defined(CONFIG_ENV_SPI_CS)
82 # define CONFIG_ENV_SPI_CS BFIN_BOOT_SPI_SSEL
83 #endif
84
85 /* We need envcrc to embed the env into LDRs */
86 #ifdef CONFIG_ENV_IS_EMBEDDED_IN_LDR
87 # define CONFIG_BUILD_ENVCRC
88 #endif
89
90 /* Default/common Blackfin memory layout */
91 #ifndef CONFIG_SYS_SDRAM_BASE
92 # define CONFIG_SYS_SDRAM_BASE 0
93 #endif
94 #ifndef CONFIG_SYS_MAX_RAM_SIZE
95 # define CONFIG_SYS_MAX_RAM_SIZE (CONFIG_MEM_SIZE * 1024 * 1024)
96 #endif
97 #ifndef CONFIG_SYS_MONITOR_BASE
98 # if CONFIG_SYS_MAX_RAM_SIZE
99 #  define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_MAX_RAM_SIZE - CONFIG_SYS_MONITOR_LEN)
100 # else
101 #  define CONFIG_SYS_MONITOR_BASE 0
102 # endif
103 #endif
104 #ifndef CONFIG_SYS_MALLOC_BASE
105 # define CONFIG_SYS_MALLOC_BASE (CONFIG_SYS_MONITOR_BASE - CONFIG_SYS_MALLOC_LEN)
106 #endif
107 #ifndef CONFIG_SYS_GBL_DATA_ADDR
108 # define CONFIG_SYS_GBL_DATA_ADDR (CONFIG_SYS_MALLOC_BASE - GENERATED_GBL_DATA_SIZE)
109 #endif
110 #ifndef CONFIG_STACKBASE
111 # define CONFIG_STACKBASE (CONFIG_SYS_GBL_DATA_ADDR - 4)
112 #endif
113 #ifndef CONFIG_SYS_MEMTEST_START
114 # define CONFIG_SYS_MEMTEST_START 0
115 #endif
116 #ifndef CONFIG_SYS_MEMTEST_END
117 # define CONFIG_SYS_MEMTEST_END (CONFIG_STACKBASE - 8192 + 4)
118 #endif
119
120 /* Check to make sure everything fits in external RAM */
121 #if CONFIG_SYS_MAX_RAM_SIZE && \
122     ((CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN) > CONFIG_SYS_MAX_RAM_SIZE)
123 # error Memory Map does not fit into configuration
124 #endif
125
126 /* Default/common Blackfin environment settings */
127 #ifndef CONFIG_LOADADDR
128 # define CONFIG_LOADADDR 0x1000000
129 #endif
130 #ifndef CONFIG_SYS_LOAD_ADDR
131 # define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR
132 #endif
133 #ifndef CONFIG_SYS_BOOTM_LEN
134 # define CONFIG_SYS_BOOTM_LEN 0x4000000
135 #endif
136 #ifndef CONFIG_SYS_PROMPT
137 # define CONFIG_SYS_PROMPT "bfin> "
138 #endif
139 #ifndef CONFIG_SYS_CBSIZE
140 # define CONFIG_SYS_CBSIZE 1024
141 #elif defined(CONFIG_CMD_KGDB) && CONFIG_SYS_CBSIZE < 1024
142 # error "kgdb needs cbsize to be >= 1024"
143 #endif
144 #ifndef CONFIG_SYS_BARGSIZE
145 # define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
146 #endif
147 #ifndef CONFIG_SYS_PBSIZE
148 # define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
149 #endif
150 #ifndef CONFIG_SYS_MAXARGS
151 # define CONFIG_SYS_MAXARGS 16
152 #endif
153 #if defined(CONFIG_SYS_HZ)
154 # if (CONFIG_SYS_HZ != 1000)
155 #  warning "CONFIG_SYS_HZ must always be 1000"
156 # endif
157 # undef CONFIG_SYS_HZ
158 #endif
159 #define CONFIG_SYS_HZ 1000
160 #ifndef CONFIG_SYS_BAUDRATE_TABLE
161 # define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
162 #endif
163
164 #endif