Blame view
include/common.h
26.6 KB
e22117437 Initial revision |
1 |
/* |
3b74e7ec5 MPC512x: remove i... |
2 |
* (C) Copyright 2000-2009 |
e22117437 Initial revision |
3 4 |
* Wolfgang Denk, DENX Software Engineering, wd@denx.de. * |
3765b3e7b Coding Style clea... |
5 |
* SPDX-License-Identifier: GPL-2.0+ |
e22117437 Initial revision |
6 7 8 |
*/ #ifndef __COMMON_H_ |
d0b8feef8 Revert "common.h:... |
9 |
#define __COMMON_H_ 1 |
e22117437 Initial revision |
10 |
|
fcd3c87e4 Make include/comm... |
11 |
#ifndef __ASSEMBLY__ /* put C only stuff in this section */ |
e22117437 Initial revision |
12 13 |
typedef unsigned char uchar; typedef volatile unsigned long vu_long; |
180d3f74e * Fix problems ca... |
14 |
typedef volatile unsigned short vu_short; |
e22117437 Initial revision |
15 |
typedef volatile unsigned char vu_char; |
2a6713b09 move UL() macro f... |
16 17 |
/* Allow sharing constants with type modifiers between C and assembly. */ #define _AC(X, Y) (X##Y) |
e22117437 Initial revision |
18 |
#include <config.h> |
2307ea405 common: Always in... |
19 |
#include <errno.h> |
a7b817699 time: move timer ... |
20 |
#include <time.h> |
25ddd1fb0 Replace CONFIG_SY... |
21 |
#include <asm-offsets.h> |
e22117437 Initial revision |
22 |
#include <linux/bitops.h> |
5bc516ed6 delay: collect {m... |
23 |
#include <linux/delay.h> |
e22117437 Initial revision |
24 25 |
#include <linux/types.h> #include <linux/string.h> |
9aed50808 COMMON: Add __str... |
26 |
#include <linux/stringify.h> |
e22117437 Initial revision |
27 28 |
#include <asm/ptrace.h> #include <stdarg.h> |
cba1da495 include: move var... |
29 |
#include <linux/kernel.h> |
a821d08dc ppc4xx: Remove AP... |
30 |
#if defined(CONFIG_PCI) && defined(CONFIG_4xx) |
e22117437 Initial revision |
31 32 |
#include <pci.h> #endif |
180d3f74e * Fix problems ca... |
33 |
#if defined(CONFIG_8xx) |
e22117437 Initial revision |
34 |
#include <asm/8xx_immap.h> |
03f9d7d17 mpc8xx: remove fa... |
35 36 |
#if defined(CONFIG_MPC859) || defined(CONFIG_MPC859T) || \ defined(CONFIG_MPC866) || \ |
d4ca31c40 * Cleanup lowboot... |
37 |
defined(CONFIG_MPC866P) |
d0b8feef8 Revert "common.h:... |
38 |
# define CONFIG_MPC866_FAMILY 1 |
0ace4d9d8 powerpc: mpc8xx: ... |
39 |
#elif defined(CONFIG_MPC885) |
d0b8feef8 Revert "common.h:... |
40 |
# define CONFIG_MPC885_FAMILY 1 |
180d3f74e * Fix problems ca... |
41 42 43 |
#endif #if defined(CONFIG_MPC860) \ || defined(CONFIG_MPC860T) \ |
1114257c9 Patch by Yuli Bar... |
44 45 |
|| defined(CONFIG_MPC866_FAMILY) \ || defined(CONFIG_MPC885_FAMILY) |
d0b8feef8 Revert "common.h:... |
46 |
# define CONFIG_MPC86x 1 |
2535d6027 * Patch by Martin... |
47 |
#endif |
0db5bca80 * Patch by Martin... |
48 49 |
#elif defined(CONFIG_5xx) #include <asm/5xx_immap.h> |
7e6bf358d Patch by Martin K... |
50 51 |
#elif defined(CONFIG_MPC5xxx) #include <mpc5xxx.h> |
8993e54b6 [ADS5121] Support... |
52 |
#elif defined(CONFIG_MPC512X) |
8993e54b6 [ADS5121] Support... |
53 |
#include <asm/immap_512x.h> |
58dac3276 powerpc: mpc8260:... |
54 |
#elif defined(CONFIG_MPC8260) |
04a85b3b3 * Patches by Pant... |
55 |
#if defined(CONFIG_MPC8247) \ |
04a85b3b3 * Patches by Pant... |
56 |
|| defined(CONFIG_MPC8272) |
d0b8feef8 Revert "common.h:... |
57 |
#define CONFIG_MPC8272_FAMILY 1 |
04a85b3b3 * Patches by Pant... |
58 |
#endif |
e22117437 Initial revision |
59 60 |
#include <asm/immap_8260.h> #endif |
debb7354d Initial support f... |
61 62 63 64 |
#ifdef CONFIG_MPC86xx #include <mpc86xx.h> #include <asm/immap_86xx.h> #endif |
42d1f0394 * Patches by Xian... |
65 66 67 68 |
#ifdef CONFIG_MPC85xx #include <mpc85xx.h> #include <asm/immap_85xx.h> #endif |
0f8986049 83xx: Replace CON... |
69 |
#ifdef CONFIG_MPC83xx |
f046ccd15 * Patch by Eran L... |
70 71 72 |
#include <mpc83xx.h> #include <asm/immap_83xx.h> #endif |
e22117437 Initial revision |
73 |
#ifdef CONFIG_4xx |
b36df5611 ppc4xx: Move ppc4... |
74 |
#include <asm/ppc4xx.h> |
e22117437 Initial revision |
75 |
#endif |
6cfcce676 always pull in as... |
76 77 78 |
#ifdef CONFIG_BLACKFIN #include <asm/blackfin.h> #endif |
2819e1365 TI DA8xx: Integra... |
79 80 81 |
#ifdef CONFIG_SOC_DA8XX #include <asm/arch/hardware.h> #endif |
9f3183d2d armv8/fsl_lsch3: ... |
82 83 84 |
#ifdef CONFIG_FSL_LSCH3 #include <asm/arch/immap_lsch3.h> #endif |
8281c58fd armv8/fsl_lsch2: ... |
85 86 87 |
#ifdef CONFIG_FSL_LSCH2 #include <asm/arch/immap_lsch2.h> #endif |
e22117437 Initial revision |
88 89 90 91 |
#include <part.h> #include <flash.h> #include <image.h> |
4166ecb24 Add some standard... |
92 93 |
/* Bring in printf format macros if inttypes.h is included */ #define __STDC_FORMAT_MACROS |
4d1fd7f1a Add 64-bit data s... |
94 95 96 |
#ifdef __LP64__ #define CONFIG_SYS_SUPPORT_64BIT_DATA #endif |
21726a7af Add assert() for ... |
97 |
#ifdef DEBUG |
88a85fb9f DEBUG: Fix debug ... |
98 |
#define _DEBUG 1 |
21726a7af Add assert() for ... |
99 |
#else |
88a85fb9f DEBUG: Fix debug ... |
100 |
#define _DEBUG 0 |
21726a7af Add assert() for ... |
101 |
#endif |
982868264 Add warn_non_spl(... |
102 103 104 105 106 |
#ifdef CONFIG_SPL_BUILD #define _SPL_BUILD 1 #else #define _SPL_BUILD 0 #endif |
5e7f74332 Add comments for ... |
107 |
/* Define this at the top of a file to add a prefix to debug messages */ |
be25d875b Add pr_fmt() macro |
108 109 110 |
#ifndef pr_fmt #define pr_fmt(fmt) fmt #endif |
21726a7af Add assert() for ... |
111 |
/* |
88a85fb9f DEBUG: Fix debug ... |
112 113 114 115 |
* Output a debug text when condition "cond" is met. The "cond" should be * computed by a preprocessor in the best case, allowing for the best * optimization. */ |
be25d875b Add pr_fmt() macro |
116 117 118 119 |
#define debug_cond(cond, fmt, args...) \ do { \ if (cond) \ printf(pr_fmt(fmt), ##args); \ |
88a85fb9f DEBUG: Fix debug ... |
120 |
} while (0) |
5e7f74332 Add comments for ... |
121 |
/* Show a message if DEBUG is defined in a file */ |
88a85fb9f DEBUG: Fix debug ... |
122 123 |
#define debug(fmt, args...) \ debug_cond(_DEBUG, fmt, ##args) |
982868264 Add warn_non_spl(... |
124 125 126 |
/* Show a message if not in SPL */ #define warn_non_spl(fmt, args...) \ debug_cond(!_SPL_BUILD, fmt, ##args) |
88a85fb9f DEBUG: Fix debug ... |
127 |
/* |
21726a7af Add assert() for ... |
128 129 130 131 132 133 134 135 136 137 138 139 140 |
* An assertion is run-time check done in debug mode only. If DEBUG is not * defined then it is skipped. If DEBUG is defined and the assertion fails, * then it calls panic*( which may or may not reset/halt U-Boot (see * CONFIG_PANIC_HANG), It is hoped that all failing assertions are found * before release, and after release it is hoped that they don't matter. But * in any case these failing assertions cannot be fixed with a reset (which * may just do the same assertion again). */ void __assert_fail(const char *assertion, const char *file, unsigned line, const char *function); #define assert(x) \ ({ if (!(x) && _DEBUG) \ __assert_fail(#x, __FILE__, __LINE__, __func__); }) |
594d57d0c Add EP93xx ethern... |
141 |
#define error(fmt, args...) do { \ |
be25d875b Add pr_fmt() macro |
142 143 144 |
printf("ERROR: " pr_fmt(fmt) " at %s:%d/%s() ", \ |
594d57d0c Add EP93xx ethern... |
145 146 |
##args, __FILE__, __LINE__, __func__); \ } while (0) |
cfa460adf Update MTD to tha... |
147 |
#ifndef BUG |
43835aac4 Added interrupt h... |
148 |
#define BUG() do { \ |
511d0c72b Coding style cleanup |
149 150 |
printf("BUG: failure at %s:%d/%s()! ", __FILE__, __LINE__, __FUNCTION__); \ |
43835aac4 Added interrupt h... |
151 152 153 |
panic("BUG!"); \ } while (0) #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) |
cfa460adf Update MTD to tha... |
154 |
#endif /* BUG */ |
43835aac4 Added interrupt h... |
155 |
|
c83bf6a2d Add a common get_... |
156 |
typedef void (interrupt_handler_t)(void *); |
e22117437 Initial revision |
157 |
|
c83bf6a2d Add a common get_... |
158 |
#include <asm/u-boot.h> /* boot information for Linux kernel */ |
e22117437 Initial revision |
159 |
#include <asm/global_data.h> /* global data used for startup functions */ |
71f951180 * Fix CONFIG_NET_... |
160 161 |
/* * enable common handling for all TQM8xxL/M boards: |
11d9eec47 TQM885D: adjust f... |
162 |
* - CONFIG_TQM8xxM will be defined for all TQM8xxM boards |
71f951180 * Fix CONFIG_NET_... |
163 |
* - CONFIG_TQM8xxL will be defined for all TQM8xxL _and_ TQM8xxM boards |
11d9eec47 TQM885D: adjust f... |
164 |
* and for the TQM885D board |
71f951180 * Fix CONFIG_NET_... |
165 166 167 |
*/ #if defined(CONFIG_TQM823M) || defined(CONFIG_TQM850M) || \ defined(CONFIG_TQM855M) || defined(CONFIG_TQM860M) || \ |
11d9eec47 TQM885D: adjust f... |
168 |
defined(CONFIG_TQM862M) || defined(CONFIG_TQM866M) |
71f951180 * Fix CONFIG_NET_... |
169 170 171 172 |
# ifndef CONFIG_TQM8xxM # define CONFIG_TQM8xxM # endif #endif |
e22117437 Initial revision |
173 |
#if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L) || \ |
d126bfbdb Add support for T... |
174 |
defined(CONFIG_TQM855L) || defined(CONFIG_TQM860L) || \ |
11d9eec47 TQM885D: adjust f... |
175 176 |
defined(CONFIG_TQM862L) || defined(CONFIG_TQM8xxM) || \ defined(CONFIG_TQM885D) |
e22117437 Initial revision |
177 178 179 180 |
# ifndef CONFIG_TQM8xxL # define CONFIG_TQM8xxL # endif #endif |
3fbeeea63 common: move TOTA... |
181 182 183 184 185 186 187 188 189 |
#if defined(CONFIG_ENV_IS_EMBEDDED) #define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN #elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \ (CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)) ) || \ defined(CONFIG_ENV_IS_IN_NVRAM) #define TOTAL_MALLOC_LEN (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE) #else #define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN #endif |
c7de829c7 * Patch by Thomas... |
190 191 |
/* |
e22117437 Initial revision |
192 193 |
* Function Prototypes */ |
0267ba5d8 common: Move dram... |
194 |
int dram_init(void); |
e22117437 Initial revision |
195 |
|
c83bf6a2d Add a common get_... |
196 |
void hang (void) __attribute__ ((noreturn)); |
e22117437 Initial revision |
197 |
|
f6c019c45 Unify timer_init(... |
198 199 |
int timer_init(void); int cpu_init(void); |
e22117437 Initial revision |
200 |
/* */ |
9973e3c61 Change initdram()... |
201 |
phys_size_t initdram (int); |
c6da9ae8a Tidy up data size... |
202 |
|
2ea09c836 Move display_opti... |
203 |
#include <display_options.h> |
e22117437 Initial revision |
204 205 206 |
/* common/main.c */ void main_loop (void); |
009dde195 Rename run_comman... |
207 |
int run_command(const char *cmd, int flag); |
1d43bfd2d Add run_command_r... |
208 |
int run_command_repeatable(const char *cmd, int flag); |
d51004a83 Add run_command_l... |
209 210 211 212 213 214 215 216 217 218 219 220 221 |
/** * Run a list of commands separated by ; or even \0 * * Note that if 'len' is not -1, then the command does not need to be nul * terminated, Memory will be allocated for the command in that case. * * @param cmd List of commands to run, each separated bu semicolon * @param len Length of commands excluding terminator if known (-1 if not) * @param flag Execution flags (CMD_FLAG_...) * @return 0 on success, or != 0 on error. */ int run_command_list(const char *cmd, int len, int flag); |
e22117437 Initial revision |
222 |
|
ea0364f1b Move lib_$ARCH di... |
223 |
/* arch/$(ARCH)/lib/board.c */ |
0365ffcc0 generic-board: sh... |
224 225 |
void board_init_f(ulong); void board_init_r(gd_t *, ulong) __attribute__ ((noreturn)); |
1fed87db6 Allow arch-specif... |
226 227 |
/** |
ecc306639 Fix board init co... |
228 |
* ulong board_init_f_alloc_reserve - allocate reserved area |
1fed87db6 Allow arch-specif... |
229 230 |
* * This function is called by each architecture very early in the start-up |
ecc306639 Fix board init co... |
231 232 |
* code to allow the C runtime to reserve space on the stack for writable * 'globals' such as GD and the malloc arena. |
1fed87db6 Allow arch-specif... |
233 |
* |
ecc306639 Fix board init co... |
234 235 236 237 238 239 240 |
* @top: top of the reserve area, growing down. * @return: bottom of reserved area */ ulong board_init_f_alloc_reserve(ulong top); /** * board_init_f_init_reserve - initialize the reserved area(s) |
1fed87db6 Allow arch-specif... |
241 |
* |
ecc306639 Fix board init co... |
242 243 |
* This function is called once the C runtime has allocated the reserved * area on the stack. It must initialize the GD at the base of that area. |
1fed87db6 Allow arch-specif... |
244 |
* |
ecc306639 Fix board init co... |
245 |
* @base: top from which reservation was done |
1fed87db6 Allow arch-specif... |
246 |
*/ |
ecc306639 Fix board init co... |
247 |
void board_init_f_init_reserve(ulong base); |
1fed87db6 Allow arch-specif... |
248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
/** * arch_setup_gd() - Set up the global_data pointer * * This pointer is special in some architectures and cannot easily be assigned * to. For example on x86 it is implemented by adding a specific record to its * Global Descriptor Table! So we we provide a function to carry out this task. * For most architectures this can simply be: * * gd = gd_ptr; * * @gd_ptr: Pointer to global data */ void arch_setup_gd(gd_t *gd_ptr); |
0365ffcc0 generic-board: sh... |
262 263 264 265 266 |
int checkboard(void); int show_board_info(void); int checkflash(void); int checkdram(void); int last_stage_init(void); |
3b57fe0a7 * Get (mostly) ri... |
267 |
extern ulong monitor_flash_len; |
bea3f28d2 Add support for r... |
268 |
int mac_read_from_eeprom(void); |
6ab6b2afa dts: re-write dts... |
269 |
extern u8 __dtb_dt_begin[]; /* embedded device tree blob */ |
8f5d46872 davinci: add supp... |
270 |
int set_cpu_clk_info(void); |
9272a9b4f m68k: powerpc: Cl... |
271 |
int mdm_init(void); |
1938f4a5b Introduce generic... |
272 |
int print_cpuinfo(void); |
c2240d4db Adjust board_r.c ... |
273 |
int update_flash_size(int flash_size); |
2c072c958 sandbox: config: ... |
274 |
int arch_early_init_r(void); |
e22117437 Initial revision |
275 |
|
15a33e49d Add option to dis... |
276 |
/** |
d4c671cc2 dm: Add a new CPU... |
277 278 279 280 281 282 283 284 285 286 287 |
* arch_cpu_init_dm() - init CPU after driver model is available * * This is called immediately after driver model is available before * relocation. This is similar to arch_cpu_init() but is able to reference * devices * * @return 0 if OK, -ve on error */ int arch_cpu_init_dm(void); /** |
68145d4c7 common/board_f: f... |
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
* Reserve all necessary stacks * * This is used in generic board init sequence in common/board_f.c. Each * architecture could provide this function to tailor the required stacks. * * On entry gd->start_addr_sp is pointing to the suggested top of the stack. * The callee ensures gd->start_add_sp is 16-byte aligned, so architectures * require only this can leave it untouched. * * On exit gd->start_addr_sp and gd->irq_sp should be set to the respective * positions of the stack. The stack pointer(s) will be set to this later. * gd->irq_sp is only required, if the architecture needs it. * * @return 0 if no error */ __weak int arch_reserve_stacks(void); /** |
15a33e49d Add option to dis... |
306 307 308 309 310 311 |
* Show the DRAM size in a board-specific way * * This is used by boards to display DRAM information in their own way. * * @param size Size of DRAM (which should be displayed along with other info) */ |
ea11b401b meminfo cmd: Enab... |
312 |
void board_show_dram(phys_size_t size); |
15a33e49d Add option to dis... |
313 |
|
13d06981a image: Add device... |
314 |
/** |
e29607ed9 ARM: convert arch... |
315 |
* arch_fixup_fdt() - Write arch-specific information to fdt |
13d06981a image: Add device... |
316 |
* |
e29607ed9 ARM: convert arch... |
317 |
* Defined in arch/$(ARCH)/lib/bootm-fdt.c |
13d06981a image: Add device... |
318 319 320 321 |
* * @blob: FDT blob to write to * @return 0 if ok, or -ve FDT_ERR_... on failure */ |
e29607ed9 ARM: convert arch... |
322 |
int arch_fixup_fdt(void *blob); |
13d06981a image: Add device... |
323 |
|
e22117437 Initial revision |
324 325 |
/* common/flash.c */ void flash_perror (int); |
74de7aefd Add "source" comm... |
326 327 |
/* common/cmd_source.c */ int source (ulong addr, const char *fit_uname); |
e22117437 Initial revision |
328 |
|
c83bf6a2d Add a common get_... |
329 |
extern ulong load_addr; /* Default Load Address */ |
1aec244ac tftpput: add save... |
330 331 |
extern ulong save_addr; /* Default Save Address */ extern ulong save_size; /* Default Save Size */ |
e22117437 Initial revision |
332 |
|
06283a640 Add pxe command |
333 334 |
/* common/cmd_net.c */ int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); |
669df7e42 pxe: add support ... |
335 |
/* common/cmd_fat.c */ |
79a86adf2 MLK-12425-2: vide... |
336 337 338 |
int do_fat_size(cmd_tbl_t *, int, int, char * const []); /* common/cmd_fat.c */ |
669df7e42 pxe: add support ... |
339 340 341 342 |
int do_fat_fsload(cmd_tbl_t *, int, int, char * const []); /* common/cmd_ext2.c */ int do_ext2load(cmd_tbl_t *, int, int, char * const []); |
e22117437 Initial revision |
343 344 345 |
/* common/cmd_nvedit.c */ int env_init (void); void env_relocate (void); |
26a41790f Globalize envmatch() |
346 |
int envmatch (uchar *, int); |
20f86a0ae sandbox: Deal wit... |
347 348 349 350 351 |
/* Avoid unfortunate conflict with libc's getenv() */ #ifdef CONFIG_SANDBOX #define getenv uboot_getenv #endif |
84b5e8022 Constify getenv()... |
352 353 |
char *getenv (const char *); int getenv_f (const char *name, char *buf, unsigned len); |
4a9b41310 Add getenv_ulong(... |
354 |
ulong getenv_ulong(const char *name, int base, ulong default_val); |
76b8f79c2 Add getenv_hex() ... |
355 356 357 358 359 360 361 362 363 364 365 366 |
/** * getenv_hex() - Return an environment variable as a hex value * * Decode an environment as a hex number (it may or may not have a 0x * prefix). If the environment variable cannot be found, or does not start * with hex digits, the default value is returned. * * @varname: Variable to decode * @default_val: Value to return on error */ ulong getenv_hex(const char *varname, ulong default_val); |
ec8a252cd env: Use getenv_y... |
367 368 369 370 371 |
/* * Read an environment variable as a boolean * Return -1 if variable does not exist (default to true) */ int getenv_yesno(const char *var); |
c83bf6a2d Add a common get_... |
372 |
int saveenv (void); |
84b5e8022 Constify getenv()... |
373 |
int setenv (const char *, const char *); |
d67f10ce0 Add setenv_ulong(... |
374 |
int setenv_ulong(const char *varname, ulong value); |
bfc599664 Update set_workin... |
375 376 377 378 |
int setenv_hex(const char *varname, ulong value); /** * setenv_addr - Set an environment variable to an address in hex * |
1bce2aeb6 Cosmetic: Fix a n... |
379 |
* @varname: Environment variable to set |
bfc599664 Update set_workin... |
380 381 382 383 384 385 386 |
* @addr: Value to set it to * @return 0 if ok, 1 on error */ static inline int setenv_addr(const char *varname, const void *addr) { return setenv_hex(varname, (ulong)addr); } |
e22117437 Initial revision |
387 |
#ifdef CONFIG_ARM |
96085e347 Fix problem intro... |
388 |
# include <asm/mach-types.h> |
b6e4c4033 * Patch by Denis ... |
389 |
# include <asm/setup.h> |
e22117437 Initial revision |
390 391 |
# include <asm/u-boot-arm.h> /* ARM version to be fixed! */ #endif /* CONFIG_ARM */ |
fea257200 x86: Rename i386 ... |
392 393 394 |
#ifdef CONFIG_X86 /* x86 version to be fixed! */ # include <asm/u-boot-x86.h> #endif /* CONFIG_X86 */ |
744d9859a sandbox: Add arch... |
395 396 397 |
#ifdef CONFIG_SANDBOX # include <asm/u-boot-sandbox.h> /* TODO(sjg) what needs to be fixed? */ #endif |
e70838444 nds32: add NDS32 ... |
398 399 |
#ifdef CONFIG_NDS32 # include <asm/mach-types.h> |
e3c58b029 nds32: Enable the... |
400 |
# include <asm/setup.h> |
e70838444 nds32: add NDS32 ... |
401 402 |
# include <asm/u-boot-nds32.h> #endif /* CONFIG_NDS32 */ |
e034ea3b7 MIPS: board.c: mo... |
403 404 405 |
#ifdef CONFIG_MIPS # include <asm/u-boot-mips.h> #endif /* CONFIG_MIPS */ |
bc5d54288 arc: bdinfo, imag... |
406 407 408 |
#ifdef CONFIG_ARC # include <asm/u-boot-arc.h> #endif /* CONFIG_ARC */ |
e22117437 Initial revision |
409 |
|
04a85b3b3 * Patches by Pant... |
410 411 412 |
#ifdef CONFIG_AUTO_COMPLETE int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf); #endif |
2f70c49e5 netloop: speed up... |
413 |
int get_env_id (void); |
04a85b3b3 * Patches by Pant... |
414 |
|
c83bf6a2d Add a common get_... |
415 416 |
void pci_init (void); void pci_init_board(void); |
e22117437 Initial revision |
417 |
|
a821d08dc ppc4xx: Remove AP... |
418 |
#if defined(CONFIG_PCI) && defined(CONFIG_4xx) |
c71103f9d ppc4xx: Make is_p... |
419 420 |
int pci_pre_init (struct pci_controller *); int is_pci_host (struct pci_controller *); |
466fff1a7 ppc4xx: Add pci_p... |
421 |
#endif |
dbbd12572 ppc4xx: Add PPC40... |
422 |
#if defined(CONFIG_PCI) && (defined(CONFIG_440) || defined(CONFIG_405EX)) |
6d0f6bcf3 rename CFG_ macro... |
423 |
# if defined(CONFIG_SYS_PCI_TARGET_INIT) |
c83bf6a2d Add a common get_... |
424 |
void pci_target_init (struct pci_controller *); |
e22117437 Initial revision |
425 |
# endif |
6d0f6bcf3 rename CFG_ macro... |
426 |
# if defined(CONFIG_SYS_PCI_MASTER_INIT) |
c83bf6a2d Add a common get_... |
427 |
void pci_master_init (struct pci_controller *); |
e22117437 Initial revision |
428 |
# endif |
6f2eb3f3d ppc4xx: Add basic... |
429 430 431 |
#if defined(CONFIG_440SPE) || \ defined(CONFIG_460EX) || defined(CONFIG_460GT) || \ defined(CONFIG_405EX) |
7f1913938 [PPC440SPe] Impro... |
432 |
void pcie_setup_hoses(int busno); |
692519b1e Add support for P... |
433 |
#endif |
e22117437 Initial revision |
434 435 436 437 |
#endif int misc_init_f (void); int misc_init_r (void); |
27b207fd0 * Implement new m... |
438 439 |
/* common/exports.c */ void jumptable_init(void); |
ecb1dc892 Add support for L... |
440 441 |
/* common/kallsysm.c */ const char *symbol_lookup(unsigned long addr, unsigned long *caddr); |
500856eb1 API for external ... |
442 443 |
/* api/api.c */ void api_init (void); |
c83bf6a2d Add a common get_... |
444 |
/* common/memsize.c */ |
a55d23ccf Remove volatile q... |
445 |
long get_ram_size (long *, long); |
e38661634 common: Add get_e... |
446 |
phys_size_t get_effective_memsize(void); |
c83bf6a2d Add a common get_... |
447 |
|
e22117437 Initial revision |
448 449 |
/* $(BOARD)/$(BOARD).c */ void reset_phy (void); |
c83bf6a2d Add a common get_... |
450 |
void fdc_hw_init (void); |
e22117437 Initial revision |
451 452 |
/* $(BOARD)/eeprom.c */ |
354e3ed75 eeprom: Add bus a... |
453 |
void eeprom_init (int bus); |
e22117437 Initial revision |
454 455 |
int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt); int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt); |
e22117437 Initial revision |
456 457 458 459 460 |
/* * Set this up regardless of board * type, to prevent errors. */ |
6d0f6bcf3 rename CFG_ macro... |
461 462 |
#if defined(CONFIG_SPI) || !defined(CONFIG_SYS_I2C_EEPROM_ADDR) # define CONFIG_SYS_DEF_EEPROM_ADDR 0 |
e22117437 Initial revision |
463 |
#else |
548738b4d cmd_eeprom: I2C u... |
464 |
#if !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) |
6d0f6bcf3 rename CFG_ macro... |
465 |
# define CONFIG_SYS_DEF_EEPROM_ADDR CONFIG_SYS_I2C_EEPROM_ADDR |
548738b4d cmd_eeprom: I2C u... |
466 |
#endif |
6d0f6bcf3 rename CFG_ macro... |
467 |
#endif /* CONFIG_SPI || !defined(CONFIG_SYS_I2C_EEPROM_ADDR) */ |
e22117437 Initial revision |
468 |
|
bdccc4fed * Map ISP1362 USB... |
469 |
#if defined(CONFIG_SPI) |
e22117437 Initial revision |
470 471 |
extern void spi_init_f (void); extern void spi_init_r (void); |
c83bf6a2d Add a common get_... |
472 |
extern ssize_t spi_read (uchar *, int, uchar *, int); |
e22117437 Initial revision |
473 474 |
extern ssize_t spi_write (uchar *, int, uchar *, int); #endif |
e22117437 Initial revision |
475 |
/* $(BOARD)/$(BOARD).c */ |
c837dcb1a * The PS/2 mux on... |
476 477 |
int board_early_init_f (void); int board_late_init (void); |
e22117437 Initial revision |
478 |
int board_postclk_init (void); /* after clocks/timebase, before env/serial */ |
c837dcb1a * The PS/2 mux on... |
479 |
int board_early_init_r (void); |
e22117437 Initial revision |
480 |
void board_poweroff (void); |
6d0f6bcf3 rename CFG_ macro... |
481 |
#if defined(CONFIG_SYS_DRAM_TEST) |
e22117437 Initial revision |
482 |
int testdram(void); |
6d0f6bcf3 rename CFG_ macro... |
483 |
#endif /* CONFIG_SYS_DRAM_TEST */ |
e22117437 Initial revision |
484 485 |
/* $(CPU)/start.S */ |
c83bf6a2d Add a common get_... |
486 |
#if defined(CONFIG_5xx) || \ |
0db5bca80 * Patch by Martin... |
487 |
defined(CONFIG_8xx) |
e22117437 Initial revision |
488 489 |
uint get_immr (uint); #endif |
36c728774 * Patch by Mark J... |
490 491 492 |
#if defined(CONFIG_MPC5xxx) uint get_svr (void); #endif |
e22117437 Initial revision |
493 |
uint get_pvr (void); |
547b4cb25 Patches by Jon Lo... |
494 |
uint get_svr (void); |
e22117437 Initial revision |
495 496 497 498 499 500 501 502 503 504 505 506 |
uint rd_ic_cst (void); void wr_ic_cst (uint); void wr_ic_adr (uint); uint rd_dc_cst (void); void wr_dc_cst (uint); void wr_dc_adr (uint); int icache_status (void); void icache_enable (void); void icache_disable(void); int dcache_status (void); void dcache_enable (void); void dcache_disable(void); |
2c451f783 armv7: cache main... |
507 |
void mmu_disable(void); |
5c6db120f arm: Remove unuse... |
508 509 510 511 |
#if defined(CONFIG_ARM) void relocate_code(ulong); #else void relocate_code(ulong, gd_t *, ulong) __attribute__ ((noreturn)); |
959eaa74b arm: relocate_cod... |
512 |
#endif |
e22117437 Initial revision |
513 514 515 |
ulong get_endaddr (void); void trap_init (ulong); #if defined (CONFIG_4xx) || \ |
eeb1b77b7 * Patch by Pierre... |
516 |
defined (CONFIG_MPC5xxx) || \ |
cd94ba397 Add Dcbz(), Dcbi(... |
517 |
defined (CONFIG_MPC85xx) || \ |
debb7354d Initial support f... |
518 |
defined (CONFIG_MPC86xx) || \ |
0f8986049 83xx: Replace CON... |
519 |
defined (CONFIG_MPC83xx) |
c83bf6a2d Add a common get_... |
520 521 522 523 524 525 526 527 528 529 530 531 532 |
unsigned char in8(unsigned int); void out8(unsigned int, unsigned char); unsigned short in16(unsigned int); unsigned short in16r(unsigned int); void out16(unsigned int, unsigned short value); void out16r(unsigned int, unsigned short value); unsigned long in32(unsigned int); unsigned long in32r(unsigned int); void out32(unsigned int, unsigned long value); void out32r(unsigned int, unsigned long value); void ppcDcbf(unsigned long value); void ppcDcbi(unsigned long value); void ppcSync(void); |
0ac6f8b74 Patch by Jon Loel... |
533 |
void ppcDcbz(unsigned long value); |
e22117437 Initial revision |
534 |
#endif |
0643631aa 16bit read/write ... |
535 536 537 538 |
#if defined (CONFIG_MICROBLAZE) unsigned short in16(unsigned int); void out16(unsigned int, unsigned short value); #endif |
e22117437 Initial revision |
539 |
|
0f8986049 83xx: Replace CON... |
540 |
#if defined (CONFIG_MPC83xx) |
90f30a710 mpc83xx: Fix the ... |
541 542 |
void ppcDWload(unsigned int *addr, unsigned int *ret); void ppcDWstore(unsigned int *addr, unsigned int *value); |
7c6db9104 powerpc, mpc83xx:... |
543 544 545 546 547 |
void disable_addr_trans(void); void enable_addr_trans(void); #if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER) void ddr_enable_ecc(unsigned int dram_size); #endif |
90f30a710 mpc83xx: Fix the ... |
548 |
#endif |
e22117437 Initial revision |
549 |
/* $(CPU)/cpu.c */ |
fbb9ecf74 powerpc/mp: add s... |
550 551 552 553 554 555 556 557 558 559 560 561 |
static inline int cpumask_next(int cpu, unsigned int mask) { for (cpu++; !((1 << cpu) & mask); cpu++) ; return cpu; } #define for_each_cpu(iter, cpu, num_cpus, mask) \ for (iter = 0, cpu = cpumask_next(-1, mask); \ iter < num_cpus; \ iter++, cpu = cpumask_next(cpu, mask)) \ |
0e870980a 8xxx: Removed CON... |
562 |
int cpu_numcores (void); |
b8bf0adc1 powerpc/mpc85xx: ... |
563 |
int cpu_num_dspcores(void); |
fbb9ecf74 powerpc/mp: add s... |
564 |
u32 cpu_mask (void); |
b8bf0adc1 powerpc/mpc85xx: ... |
565 |
u32 cpu_dsp_mask(void); |
fbb9ecf74 powerpc/mp: add s... |
566 |
int is_core_valid (unsigned int); |
cbcbf71bf powerpc: Drop pro... |
567 568 569 570 571 572 573 574 575 576 |
/** * arch_cpu_init() - basic cpu-dependent setup for an architecture * * This is called after early malloc is available. It should handle any * CPU- or SoC- specific init needed to continue the init sequence. See * board_f.c for where it is called. If this is not provided, a default * version (which does nothing) will be used. */ int arch_cpu_init(void); |
e22117437 Initial revision |
577 578 579 580 581 |
int checkcpu (void); int checkicache (void); int checkdcache (void); void upmconfig (unsigned int, unsigned int *, unsigned int); ulong get_tbclk (void); |
1fb4dab2a arm:reset: call t... |
582 |
void reset_misc (void); |
3ec924a3c Patch by Steven S... |
583 |
void reset_cpu (ulong addr); |
6a16e0dfc mpc83xx: move com... |
584 |
void ft_cpu_setup(void *blob, bd_t *bd); |
6a16e0dfc mpc83xx: move com... |
585 |
void ft_pci_setup(void *blob, bd_t *bd); |
6a16e0dfc mpc83xx: move com... |
586 |
|
ba6a16981 ARM: add SMP supp... |
587 588 |
void smp_set_core_boot_addr(unsigned long addr, int corenr); void smp_kick_all_cpus(void); |
e22117437 Initial revision |
589 590 591 592 593 |
/* $(CPU)/serial.c */ int serial_init (void); void serial_setbrg (void); void serial_putc (const char); |
756f586a7 * Patch by Yusdi ... |
594 |
void serial_putc_raw(const char); |
e22117437 Initial revision |
595 |
void serial_puts (const char *); |
e22117437 Initial revision |
596 597 |
int serial_getc (void); int serial_tstc (void); |
709ea543b stdio: Pass devic... |
598 599 600 601 |
/* These versions take a stdio_dev pointer */ struct stdio_dev; int serial_stub_getc(struct stdio_dev *sdev); int serial_stub_tstc(struct stdio_dev *sdev); |
e22117437 Initial revision |
602 603 |
/* $(CPU)/speed.c */ int get_clocks (void); |
c178d3da6 * Add variable CP... |
604 605 |
int get_clocks_866 (void); int sdram_adjust_866 (void); |
e9132ea94 Clean up the TQM8... |
606 |
int adjust_sdram_tbs_8xx (void); |
58dac3276 powerpc: mpc8260:... |
607 |
#if defined(CONFIG_MPC8260) |
e22117437 Initial revision |
608 |
int prt_8260_clks (void); |
f046ccd15 * Patch by Eran L... |
609 |
#elif defined(CONFIG_MPC5xxx) |
945af8d72 * Add support for... |
610 611 |
int prt_mpc5xxx_clks (void); #endif |
e22117437 Initial revision |
612 613 614 615 |
#ifdef CONFIG_4xx ulong get_OPB_freq (void); ulong get_PCI_freq (void); #endif |
ac67804fb Add a unified s3c... |
616 617 |
#if defined(CONFIG_S3C24X0) || \ defined(CONFIG_LH7A40X) || \ |
fcfb632bd ARM: Add support ... |
618 |
defined(CONFIG_EP93XX) |
e22117437 Initial revision |
619 620 621 622 623 |
ulong get_FCLK (void); ulong get_HCLK (void); ulong get_PCLK (void); ulong get_UCLK (void); #endif |
f39748ae8 * Patch by Paul R... |
624 625 626 |
#if defined(CONFIG_LH7A40X) ulong get_PLLCLK (void); #endif |
281e00a3b * Code cleanup |
627 628 629 630 631 632 633 634 635 |
#if defined(CONFIG_IMX) ulong get_systemPLLCLK(void); ulong get_FCLK(void); ulong get_HCLK(void); ulong get_BCLK(void); ulong get_PERCLK1(void); ulong get_PERCLK2(void); ulong get_PERCLK3(void); #endif |
e22117437 Initial revision |
636 |
ulong get_bus_freq (ulong); |
550650ddd ppc4xx: Use commo... |
637 |
int get_serial_clock(void); |
e22117437 Initial revision |
638 |
|
42d1f0394 * Patches by Xian... |
639 640 |
#if defined(CONFIG_MPC85xx) typedef MPC85xx_SYS_INFO sys_info_t; |
c83bf6a2d Add a common get_... |
641 |
void get_sys_info ( sys_info_t * ); |
aa34fbc08 fdt: Allow libfdt... |
642 643 |
void ft_fixup_cpu(void *, u64); void ft_fixup_num_cores(void *); |
42d1f0394 * Patches by Xian... |
644 |
#endif |
debb7354d Initial support f... |
645 646 647 |
#if defined(CONFIG_MPC86xx) typedef MPC86xx_SYS_INFO sys_info_t; void get_sys_info ( sys_info_t * ); |
5df4b0ad0 powerpc/8xxx: Rep... |
648 649 650 651 |
static inline ulong get_ddr_freq(ulong dummy) { return get_bus_freq(dummy); } |
2f78eae50 ARMv8/FSL_LSCH3: ... |
652 653 |
#else ulong get_ddr_freq(ulong); |
debb7354d Initial support f... |
654 |
#endif |
42d1f0394 * Patches by Xian... |
655 |
|
99bcad180 ppc4xx: Remove IO... |
656 |
#if defined(CONFIG_4xx) |
e22117437 Initial revision |
657 |
# if defined(CONFIG_440) |
6c5879f38 Add support for A... |
658 659 660 661 |
# if defined(CONFIG_440SPE) unsigned long determine_sysper(void); unsigned long determine_pci_clock_per(void); # endif |
e22117437 Initial revision |
662 |
# endif |
087dfdb79 ppc4xx: Consolida... |
663 |
typedef PPC4xx_SYS_INFO sys_info_t; |
f31d38b9e ppc4xx: Enable 40... |
664 |
int ppc440spe_revB(void); |
c83bf6a2d Add a common get_... |
665 |
void get_sys_info ( sys_info_t * ); |
e22117437 Initial revision |
666 667 668 |
#endif /* $(CPU)/cpu_init.c */ |
58dac3276 powerpc: mpc8260:... |
669 |
#if defined(CONFIG_8xx) || defined(CONFIG_MPC8260) |
e22117437 Initial revision |
670 671 |
void cpu_init_f (volatile immap_t *immr); #endif |
701e64014 powerpc/mpc85xx: ... |
672 |
#if defined(CONFIG_4xx) || defined(CONFIG_MCF52x2) || defined(CONFIG_MPC86xx) |
e22117437 Initial revision |
673 674 |
void cpu_init_f (void); #endif |
701e64014 powerpc/mpc85xx: ... |
675 676 677 |
#ifdef CONFIG_MPC85xx ulong cpu_init_f(void); #endif |
bf9e3b38f * Some code cleanup |
678 |
|
e22117437 Initial revision |
679 |
int cpu_init_r (void); |
58dac3276 powerpc: mpc8260:... |
680 |
#if defined(CONFIG_MPC8260) |
e22117437 Initial revision |
681 |
int prt_8260_rsr (void); |
0f8986049 83xx: Replace CON... |
682 |
#elif defined(CONFIG_MPC83xx) |
9be39a67c mpc83xx: Add supp... |
683 |
int prt_83xx_rsr (void); |
e22117437 Initial revision |
684 685 686 |
#endif /* $(CPU)/interrupts.c */ |
c83bf6a2d Add a common get_... |
687 688 |
int interrupt_init (void); void timer_interrupt (struct pt_regs *); |
e22117437 Initial revision |
689 690 691 692 |
void external_interrupt (struct pt_regs *); void irq_install_handler(int, interrupt_handler_t *, void *); void irq_free_handler (int); void reset_timer (void); |
b2e16a85a Add trace library |
693 694 695 |
/* Return value of monotonic microsecond timer */ unsigned long timer_get_us(void); |
e22117437 Initial revision |
696 697 698 699 700 701 702 703 704 |
void enable_interrupts (void); int disable_interrupts (void); /* $(CPU)/.../commproc.c */ int dpram_init (void); uint dpram_base(void); uint dpram_base_align(uint align); uint dpram_alloc(uint size); uint dpram_alloc_align(uint size,uint align); |
bdccc4fed * Map ISP1362 USB... |
705 706 707 |
void bootcount_store (ulong); ulong bootcount_load (void); #define BOOTCOUNT_MAGIC 0xB001C041 |
e22117437 Initial revision |
708 709 |
/* $(CPU)/.../<eth> */ |
c5bded3c8 Add mii_init() pr... |
710 |
void mii_init (void); |
e22117437 Initial revision |
711 712 713 |
/* $(CPU)/.../lcd.c */ ulong lcd_setmem (ulong); |
e22117437 Initial revision |
714 715 |
/* $(CPU)/.../video.c */ ulong video_setmem (ulong); |
ea0364f1b Move lib_$ARCH di... |
716 |
/* arch/$(ARCH)/lib/cache.c */ |
cba4b1809 arm: do not force... |
717 |
void enable_caches(void); |
e22117437 Initial revision |
718 |
void flush_cache (unsigned long, unsigned long); |
2c451f783 armv7: cache main... |
719 |
void flush_dcache_all(void); |
03d3bfb00 MIPS: Add flush_d... |
720 721 |
void flush_dcache_range(unsigned long start, unsigned long stop); void invalidate_dcache_range(unsigned long start, unsigned long stop); |
2c451f783 armv7: cache main... |
722 723 |
void invalidate_dcache_all(void); void invalidate_icache_all(void); |
0db5bca80 * Patch by Martin... |
724 |
|
4d24a11ee arm: Allow cleanu... |
725 726 727 728 729 730 731 732 733 734 735 736 737 738 |
enum { /* Disable caches (else flush caches but leave them active) */ CBL_DISABLE_CACHES = 1 << 0, CBL_SHOW_BOOTSTAGE_REPORT = 1 << 1, CBL_ALL = 3, }; /** * Clean up ready for linux * * @param flags Flags to control what is done */ int cleanup_before_linux_select(int flags); |
ea0364f1b Move lib_$ARCH di... |
739 |
/* arch/$(ARCH)/lib/ticks.S */ |
19ea4678c Use uint64_t for ... |
740 |
uint64_t get_ticks(void); |
e22117437 Initial revision |
741 |
void wait_ticks (unsigned long); |
ea0364f1b Move lib_$ARCH di... |
742 |
/* arch/$(ARCH)/lib/time.c */ |
e22117437 Initial revision |
743 744 745 |
ulong usec2ticks (unsigned long usec); ulong ticks2usec (unsigned long ticks); int init_timebase (void); |
78acc472d Rename lib_generi... |
746 |
/* lib/gunzip.c */ |
87d93a1ba move prototypes f... |
747 748 749 |
int gunzip(void *, int, unsigned char *, unsigned long *); int zunzip(void *dst, int dstlen, unsigned char *src, unsigned long *lenp, int stoponerr, int offset); |
918e9ebb4 gunzip: add gzwri... |
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 |
/** * gzwrite progress indicators: defined weak to allow board-specific * overrides: * * gzwrite_progress_init called on startup * gzwrite_progress called during decompress/write loop * gzwrite_progress_finish called at end of loop to * indicate success (retcode=0) or failure */ void gzwrite_progress_init(u64 expected_size); void gzwrite_progress(int iteration, u64 bytes_written, u64 total_bytes); void gzwrite_progress_finish(int retcode, u64 totalwritten, u64 totalsize, u32 expected_crc, u32 calculated_crc); /** * decompress and write gzipped image from memory to block device * * @param src compressed image address * @param len compressed image length in bytes * @param dev block device descriptor * @param szwritebuf bytes per write (pad to erase size) * @param startoffs offset in bytes of first write * @param szexpected expected uncompressed length * may be zero to use gzip trailer * for files under 4GiB */ int gzwrite(unsigned char *src, int len, |
4101f6879 dm: Drop the bloc... |
784 |
struct blk_desc *dev, |
918e9ebb4 gunzip: add gzwri... |
785 786 787 |
unsigned long szwritebuf, u64 startoffs, u64 szexpected); |
027b728d4 Add support for L... |
788 789 |
/* lib/lz4_wrapper.c */ int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn); |
54c6977e9 Add qsort - add s... |
790 791 792 |
/* lib/qsort.c */ void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); |
560d424b6 env: re-add suppo... |
793 |
int strcmp_compar(const void *, const void *); |
54c6977e9 Add qsort - add s... |
794 |
|
e11938eab lib: add uuid_str... |
795 |
/* lib/uuid.c */ |
d718ded05 lib: uuid: code r... |
796 |
#include <uuid.h> |
e11938eab lib: add uuid_str... |
797 |
|
78acc472d Rename lib_generi... |
798 |
/* lib/vsprintf.c */ |
9785c905c Move vsprintf fun... |
799 |
#include <vsprintf.h> |
e22117437 Initial revision |
800 |
|
78acc472d Rename lib_generi... |
801 |
/* lib/strmhz.c */ |
55f7934d2 strmhz: Make hz u... |
802 |
char * strmhz(char *buf, unsigned long hz); |
0768b7a87 Consolidate strmh... |
803 |
|
78acc472d Rename lib_generi... |
804 |
/* lib/crc32.c */ |
449609f5b tools: mkimage: F... |
805 |
#include <u-boot/crc.h> |
e22117437 Initial revision |
806 |
|
9acf1ca50 lib: add rand() f... |
807 |
/* lib/rand.c */ |
9acf1ca50 lib: add rand() f... |
808 809 810 811 |
#define RAND_MAX -1U void srand(unsigned int seed); unsigned int rand(void); unsigned int rand_r(unsigned int *seedp); |
9acf1ca50 lib: add rand() f... |
812 |
|
e22117437 Initial revision |
813 814 815 |
/* * STDIO based functions (can always be used) */ |
e22117437 Initial revision |
816 |
/* serial stuff */ |
d9c27253c Make *printf() re... |
817 |
int serial_printf (const char *fmt, ...) |
dc4b0b38d Fix printf errors. |
818 |
__attribute__ ((format (__printf__, 1, 2))); |
e22117437 Initial revision |
819 820 821 822 823 |
/* stdin */ int getc(void); int tstc(void); /* stdout */ |
76f1f3881 Use separate opti... |
824 825 826 827 |
#if !defined(CONFIG_SPL_BUILD) || \ (defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_SERIAL_SUPPORT)) || \ (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) && \ defined(CONFIG_SPL_SERIAL_SUPPORT)) |
e22117437 Initial revision |
828 829 |
void putc(const char c); void puts(const char *s); |
d9c27253c Make *printf() re... |
830 |
int printf(const char *fmt, ...) |
dc4b0b38d Fix printf errors. |
831 |
__attribute__ ((format (__printf__, 1, 2))); |
d9c27253c Make *printf() re... |
832 |
int vprintf(const char *fmt, va_list args); |
76f1f3881 Use separate opti... |
833 834 835 836 837 |
#else #define putc(...) do { } while (0) #define puts(...) do { } while (0) #define printf(...) do { } while (0) #define vprintf(...) do { } while (0) |
80402f34f spl, common, seri... |
838 |
#endif |
e22117437 Initial revision |
839 840 841 842 843 844 845 846 847 |
/* stderr */ #define eputc(c) fputc(stderr, c) #define eputs(s) fputs(stderr, s) #define eprintf(fmt,args...) fprintf(stderr,fmt ,##args) /* * FILE based functions (can only be used AFTER relocation!) */ |
e22117437 Initial revision |
848 849 850 851 |
#define stdin 0 #define stdout 1 #define stderr 2 #define MAX_FILES 3 |
d9c27253c Make *printf() re... |
852 |
int fprintf(int file, const char *fmt, ...) |
dc4b0b38d Fix printf errors. |
853 |
__attribute__ ((format (__printf__, 2, 3))); |
e22117437 Initial revision |
854 855 856 857 |
void fputs(int file, const char *s); void fputc(int file, const char c); int ftstc(int file); int fgetc(int file); |
88d52c6af lib: add gzip lib... |
858 859 860 861 862 863 |
/* lib/gzip.c */ int gzip(void *dst, unsigned long *lenp, unsigned char *src, unsigned long srclen); int zzip(void *dst, unsigned long *lenp, unsigned char *src, unsigned long srclen, int stoponerr, int (*func)(unsigned long, unsigned long)); |
4ef8d53ca net: Allow filter... |
864 865 |
/* lib/net_utils.c */ #include <net.h> |
049a95a77 net: cosmetic: Ch... |
866 |
static inline struct in_addr getenv_ip(char *var) |
4ef8d53ca net: Allow filter... |
867 868 869 |
{ return string_to_ip(getenv(var)); } |
e22117437 Initial revision |
870 |
int pcmcia_init (void); |
2d8d190c8 status_led: Kconf... |
871 |
#ifdef CONFIG_LED_STATUS |
fb364bec5 Fix include/commo... |
872 873 |
# include <status_led.h> #endif |
097e17836 bootstage: Create... |
874 875 |
#include <bootstage.h> |
e22117437 Initial revision |
876 |
|
48522bb50 net: cosmetic: ne... |
877 878 879 |
#ifdef CONFIG_SHOW_ACTIVITY void show_activity(int arg); #endif |
fcd3c87e4 Make include/comm... |
880 881 882 883 |
/* Multicore arch functions */ #ifdef CONFIG_MP int cpu_status(int nr); int cpu_reset(int nr); |
4194b3668 Add support to di... |
884 |
int cpu_disable(int nr); |
54841ab50 Make sure that ar... |
885 |
int cpu_release(int nr, int argc, char * const argv[]); |
fcd3c87e4 Make include/comm... |
886 |
#endif |
81c9431f5 MA-9375 [Android ... |
887 888 889 |
#ifdef CONFIG_CMD_READ int do_raw_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); #endif |
2a6713b09 move UL() macro f... |
890 891 892 893 894 895 |
#else /* __ASSEMBLY__ */ /* Drop a C type modifier (like in 3UL) for constants used in assembly. */ #define _AC(X, Y) X #endif /* __ASSEMBLY__ */ |
fcd3c87e4 Make include/comm... |
896 |
|
13e95e423 ppc: Include <asm... |
897 898 899 900 901 902 903 |
#ifdef CONFIG_PPC /* * Has to be included outside of the #ifndef __ASSEMBLY__ section. * Otherwise might lead to compilation errors in assembler files. */ #include <asm/cache.h> #endif |
fcd3c87e4 Make include/comm... |
904 |
/* Put only stuff here that the assembler can digest */ |
2a6713b09 move UL() macro f... |
905 906 |
/* Declare an unsigned long constant digestable both by C and an assembler. */ #define UL(x) _AC(x, UL) |
fcd3c87e4 Make include/comm... |
907 908 |
#ifdef CONFIG_POST #define CONFIG_HAS_POST |
800eb0964 POST cleanup. |
909 910 911 |
#ifndef CONFIG_POST_ALT_LIST #define CONFIG_POST_STD_LIST #endif |
fcd3c87e4 Make include/comm... |
912 |
#endif |
8aa1a2d11 Patch by Steven S... |
913 |
#ifdef CONFIG_INIT_CRITICAL |
2f6fa46d4 Fixed common.h sp... |
914 |
#error CONFIG_INIT_CRITICAL is deprecated! |
8aa1a2d11 Patch by Steven S... |
915 916 |
#error Read section CONFIG_SKIP_LOWLEVEL_INIT in README. #endif |
155cfb5ef common: fix behav... |
917 |
#define ROUND(a,b) (((a) + (b) - 1) & ~((b) - 1)) |
4b03ac8b5 Add ALIGN() macro |
918 |
|
1e41f5ad4 cache: include as... |
919 |
/* |
c9689ca31 Add a way of chec... |
920 921 922 923 924 925 926 927 928 |
* check_member() - Check the offset of a structure member * * @structure: Name of structure (e.g. global_data) * @member: Name of member (e.g. baudrate) * @offset: Expected offset in bytes */ #define check_member(structure, member, offset) _Static_assert( \ offsetof(struct structure, member) == offset, \ "`struct " #structure "` offset for `" #member "` is not " #offset) |
476476e73 efi: Add support ... |
929 930 931 932 933 934 |
/* Avoid using CONFIG_EFI_STUB directly as we may boot from other loaders */ #ifdef CONFIG_EFI_STUB #define ll_boot_init() false #else #define ll_boot_init() true #endif |
c3eb3fe49 env: allow people... |
935 936 937 938 |
/* Pull in stuff for the build system */ #ifdef DO_DEPS_ONLY # include <environment.h> #endif |
e22117437 Initial revision |
939 |
#endif /* __COMMON_H_ */ |