]>
Commit | Line | Data |
---|---|---|
e2211743 | 1 | /* |
d4ca31c4 | 2 | * (C) Copyright 2000-2004 |
e2211743 WD |
3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
4 | * | |
5 | * See file CREDITS for list of people who contributed to this | |
6 | * project. | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU General Public License as | |
10 | * published by the Free Software Foundation; either version 2 of | |
11 | * the License, or (at your option) any later version. | |
12 | * | |
13 | * This program is distributed in the hope that it will be useful, | |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
180d3f74 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
e2211743 WD |
16 | * GNU General Public License for more details. |
17 | * | |
18 | * You should have received a copy of the GNU General Public License | |
19 | * along with this program; if not, write to the Free Software | |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
21 | * MA 02111-1307 USA | |
22 | */ | |
23 | ||
24 | #ifndef __COMMON_H_ | |
25 | #define __COMMON_H_ 1 | |
26 | ||
27 | #undef _LINUX_CONFIG_H | |
28 | #define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */ | |
29 | ||
30 | typedef unsigned char uchar; | |
31 | typedef volatile unsigned long vu_long; | |
180d3f74 | 32 | typedef volatile unsigned short vu_short; |
e2211743 WD |
33 | typedef volatile unsigned char vu_char; |
34 | ||
35 | #include <config.h> | |
36 | #include <linux/bitops.h> | |
37 | #include <linux/types.h> | |
38 | #include <linux/string.h> | |
39 | #include <asm/ptrace.h> | |
40 | #include <stdarg.h> | |
41 | #if defined(CONFIG_PCI) && defined(CONFIG_440) | |
42 | #include <pci.h> | |
43 | #endif | |
180d3f74 | 44 | #if defined(CONFIG_8xx) |
e2211743 | 45 | #include <asm/8xx_immap.h> |
d4ca31c4 WD |
46 | #if defined(CONFIG_MPC852) || defined(CONFIG_MPC852T) || \ |
47 | defined(CONFIG_MPC859) || defined(CONFIG_MPC859T) || \ | |
48 | defined(CONFIG_MPC859DSL) || \ | |
49 | defined(CONFIG_MPC866) || defined(CONFIG_MPC866T) || \ | |
50 | defined(CONFIG_MPC866P) | |
180d3f74 WD |
51 | # define CONFIG_MPC866_et_al 1 |
52 | #elif defined(CONFIG_MPC870) \ | |
53 | || defined(CONFIG_MPC875) \ | |
54 | || defined(CONFIG_MPC880) \ | |
55 | || defined(CONFIG_MPC885) | |
56 | # define CONFIG_DUET 1 | |
57 | #endif | |
58 | #if defined(CONFIG_MPC860) \ | |
59 | || defined(CONFIG_MPC860T) \ | |
60 | || defined(CONFIG_MPC866_et_al) \ | |
61 | || defined(CONFIG_DUET) | |
62 | # define CONFIG_MPC86x 1 | |
2535d602 | 63 | #endif |
0db5bca8 WD |
64 | #elif defined(CONFIG_5xx) |
65 | #include <asm/5xx_immap.h> | |
e2211743 WD |
66 | #elif defined(CONFIG_8260) |
67 | #include <asm/immap_8260.h> | |
68 | #endif | |
42d1f039 WD |
69 | #ifdef CONFIG_MPC85xx |
70 | #include <mpc85xx.h> | |
71 | #include <asm/immap_85xx.h> | |
72 | #endif | |
e2211743 WD |
73 | #ifdef CONFIG_4xx |
74 | #include <ppc4xx.h> | |
75 | #endif | |
76 | #ifdef CONFIG_HYMOD | |
6dd652fa | 77 | #include <board/hymod/hymod.h> |
e2211743 WD |
78 | #endif |
79 | #ifdef CONFIG_ARM | |
80 | #define asmlinkage /* nothing */ | |
81 | #endif | |
82 | ||
83 | #include <part.h> | |
84 | #include <flash.h> | |
85 | #include <image.h> | |
86 | ||
87 | #ifdef DEBUG | |
88 | #define debug(fmt,args...) printf (fmt ,##args) | |
52f52c14 | 89 | #define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args); |
e2211743 WD |
90 | #else |
91 | #define debug(fmt,args...) | |
52f52c14 | 92 | #define debugX(level,fmt,args...) |
e2211743 WD |
93 | #endif /* DEBUG */ |
94 | ||
c83bf6a2 | 95 | typedef void (interrupt_handler_t)(void *); |
e2211743 | 96 | |
c83bf6a2 | 97 | #include <asm/u-boot.h> /* boot information for Linux kernel */ |
e2211743 WD |
98 | #include <asm/global_data.h> /* global data used for startup functions */ |
99 | ||
71f95118 WD |
100 | /* |
101 | * enable common handling for all TQM8xxL/M boards: | |
102 | * - CONFIG_TQM8xxM will be defined for all TQM8xxM boards | |
103 | * - CONFIG_TQM8xxL will be defined for all TQM8xxL _and_ TQM8xxM boards | |
104 | */ | |
105 | #if defined(CONFIG_TQM823M) || defined(CONFIG_TQM850M) || \ | |
106 | defined(CONFIG_TQM855M) || defined(CONFIG_TQM860M) || \ | |
d4ca31c4 | 107 | defined(CONFIG_TQM862M) || defined(CONFIG_TQM866M) |
71f95118 WD |
108 | # ifndef CONFIG_TQM8xxM |
109 | # define CONFIG_TQM8xxM | |
110 | # endif | |
111 | #endif | |
e2211743 | 112 | #if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L) || \ |
d126bfbd | 113 | defined(CONFIG_TQM855L) || defined(CONFIG_TQM860L) || \ |
71f95118 | 114 | defined(CONFIG_TQM862L) || defined(CONFIG_TQM8xxM) |
e2211743 WD |
115 | # ifndef CONFIG_TQM8xxL |
116 | # define CONFIG_TQM8xxL | |
117 | # endif | |
118 | #endif | |
119 | ||
120 | ||
c7de829c WD |
121 | /* |
122 | * General Purpose Utilities | |
123 | */ | |
124 | #define min(X, Y) \ | |
125 | ({ typeof (X) __x = (X), __y = (Y); \ | |
126 | (__x < __y) ? __x : __y; }) | |
127 | ||
128 | #define max(X, Y) \ | |
129 | ({ typeof (X) __x = (X), __y = (Y); \ | |
130 | (__x > __y) ? __x : __y; }) | |
131 | ||
132 | ||
e2211743 WD |
133 | /* |
134 | * Function Prototypes | |
135 | */ | |
136 | ||
137 | #if CONFIG_SERIAL_SOFTWARE_FIFO | |
138 | void serial_buffered_init (void); | |
139 | void serial_buffered_putc (const char); | |
140 | void serial_buffered_puts (const char *); | |
141 | int serial_buffered_getc (void); | |
142 | int serial_buffered_tstc (void); | |
143 | #endif /* CONFIG_SERIAL_SOFTWARE_FIFO */ | |
144 | ||
c83bf6a2 | 145 | void hang (void) __attribute__ ((noreturn)); |
e2211743 WD |
146 | |
147 | /* */ | |
148 | long int initdram (int); | |
c83bf6a2 | 149 | int display_options (void); |
e2211743 WD |
150 | void print_size (ulong, const char *); |
151 | ||
152 | /* common/main.c */ | |
153 | void main_loop (void); | |
154 | int run_command (const char *cmd, int flag); | |
155 | int readline (const char *const prompt); | |
6dd652fa | 156 | void init_cmd_timeout(void); |
e2211743 WD |
157 | void reset_cmd_timeout(void); |
158 | ||
15647dc7 | 159 | /* lib_$(ARCH)/board.c */ |
e2211743 WD |
160 | void board_init_f (ulong); |
161 | void board_init_r (gd_t *, ulong); | |
162 | int checkboard (void); | |
163 | int checkflash (void); | |
164 | int checkdram (void); | |
165 | char * strmhz(char *buf, long hz); | |
166 | int last_stage_init(void); | |
3b57fe0a | 167 | extern ulong monitor_flash_len; |
e2211743 WD |
168 | |
169 | /* common/flash.c */ | |
170 | void flash_perror (int); | |
171 | ||
b0fce99b WD |
172 | /* common/cmd_autoscript.c */ |
173 | int autoscript (ulong addr); | |
174 | ||
e2211743 | 175 | /* common/cmd_bootm.c */ |
b0fce99b | 176 | void print_image_hdr (image_header_t *hdr); |
e2211743 | 177 | |
c83bf6a2 | 178 | extern ulong load_addr; /* Default Load Address */ |
e2211743 WD |
179 | |
180 | /* common/cmd_nvedit.c */ | |
181 | int env_init (void); | |
182 | void env_relocate (void); | |
c83bf6a2 | 183 | char *getenv (uchar *); |
e2211743 | 184 | int getenv_r (uchar *name, uchar *buf, unsigned len); |
c83bf6a2 | 185 | int saveenv (void); |
e2211743 WD |
186 | #ifdef CONFIG_PPC /* ARM version to be fixed! */ |
187 | void inline setenv (char *, char *); | |
2262cfee | 188 | #else |
c83bf6a2 | 189 | void setenv (char *, char *); |
e2211743 WD |
190 | #endif /* CONFIG_PPC */ |
191 | #ifdef CONFIG_ARM | |
b6e4c403 | 192 | # include <asm/setup.h> |
e2211743 WD |
193 | # include <asm/u-boot-arm.h> /* ARM version to be fixed! */ |
194 | #endif /* CONFIG_ARM */ | |
2262cfee | 195 | #ifdef CONFIG_I386 /* x86 version to be fixed! */ |
8bde7f77 | 196 | # include <asm/u-boot-i386.h> |
2262cfee | 197 | #endif /* CONFIG_I386 */ |
e2211743 | 198 | |
c83bf6a2 WD |
199 | void pci_init (void); |
200 | void pci_init_board(void); | |
201 | void pciinfo (int, int); | |
e2211743 WD |
202 | |
203 | #if defined(CONFIG_PCI) && defined(CONFIG_440) | |
204 | # if defined(CFG_PCI_PRE_INIT) | |
c83bf6a2 | 205 | int pci_pre_init (struct pci_controller * ); |
e2211743 WD |
206 | # endif |
207 | # if defined(CFG_PCI_TARGET_INIT) | |
c83bf6a2 | 208 | void pci_target_init (struct pci_controller *); |
e2211743 WD |
209 | # endif |
210 | # if defined(CFG_PCI_MASTER_INIT) | |
c83bf6a2 | 211 | void pci_master_init (struct pci_controller *); |
e2211743 | 212 | # endif |
c83bf6a2 | 213 | int is_pci_host (struct pci_controller *); |
e2211743 WD |
214 | #endif |
215 | ||
216 | int misc_init_f (void); | |
217 | int misc_init_r (void); | |
218 | ||
27b207fd WD |
219 | /* common/exports.c */ |
220 | void jumptable_init(void); | |
221 | ||
c83bf6a2 WD |
222 | /* common/memsize.c */ |
223 | int get_ram_size (volatile long *, long); | |
224 | ||
e2211743 WD |
225 | /* $(BOARD)/$(BOARD).c */ |
226 | void reset_phy (void); | |
c83bf6a2 | 227 | void fdc_hw_init (void); |
e2211743 WD |
228 | |
229 | /* $(BOARD)/eeprom.c */ | |
230 | void eeprom_init (void); | |
6dd652fa WD |
231 | #ifndef CONFIG_SPI |
232 | int eeprom_probe (unsigned dev_addr, unsigned offset); | |
233 | #endif | |
e2211743 WD |
234 | int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt); |
235 | int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt); | |
236 | #ifdef CONFIG_LWMON | |
237 | extern uchar pic_read (uchar reg); | |
238 | extern void pic_write (uchar reg, uchar val); | |
239 | #endif | |
240 | ||
241 | /* | |
242 | * Set this up regardless of board | |
243 | * type, to prevent errors. | |
244 | */ | |
245 | #if defined(CONFIG_SPI) || !defined(CFG_I2C_EEPROM_ADDR) | |
246 | # define CFG_DEF_EEPROM_ADDR 0 | |
247 | #else | |
248 | # define CFG_DEF_EEPROM_ADDR CFG_I2C_EEPROM_ADDR | |
249 | #endif /* CONFIG_SPI || !defined(CFG_I2C_EEPROM_ADDR) */ | |
250 | ||
bdccc4fe | 251 | #if defined(CONFIG_SPI) |
e2211743 WD |
252 | extern void spi_init_f (void); |
253 | extern void spi_init_r (void); | |
c83bf6a2 | 254 | extern ssize_t spi_read (uchar *, int, uchar *, int); |
e2211743 WD |
255 | extern ssize_t spi_write (uchar *, int, uchar *, int); |
256 | #endif | |
257 | ||
258 | #ifdef CONFIG_RPXCLASSIC | |
259 | void rpxclassic_init (void); | |
260 | #endif | |
261 | ||
262 | #ifdef CONFIG_MBX | |
263 | /* $(BOARD)/mbx8xx.c */ | |
264 | void mbx_init (void); | |
265 | void board_serial_init (void); | |
266 | void board_ether_init (void); | |
267 | #endif | |
268 | ||
ba56f625 WD |
269 | #if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_MBX) || \ |
270 | defined(CONFIG_IAD210) || defined(CONFIG_XPEDITE1K) | |
e2211743 WD |
271 | void board_get_enetaddr (uchar *addr); |
272 | #endif | |
273 | ||
274 | #ifdef CONFIG_HERMES | |
275 | /* $(BOARD)/hermes.c */ | |
276 | void hermes_start_lxt980 (int speed); | |
277 | #endif | |
278 | ||
279 | #ifdef CONFIG_EVB64260 | |
280 | void evb64260_init(void); | |
281 | void debug_led(int, int); | |
282 | void display_mem_map(void); | |
283 | void perform_soft_reset(void); | |
284 | #endif | |
285 | ||
286 | void load_sernum_ethaddr (void); | |
287 | ||
288 | /* $(BOARD)/$(BOARD).c */ | |
c837dcb1 WD |
289 | int board_early_init_f (void); |
290 | int board_late_init (void); | |
e2211743 | 291 | int board_postclk_init (void); /* after clocks/timebase, before env/serial */ |
c837dcb1 | 292 | int board_early_init_r (void); |
e2211743 WD |
293 | void board_poweroff (void); |
294 | ||
295 | #if defined(CFG_DRAM_TEST) | |
296 | int testdram(void); | |
297 | #endif /* CFG_DRAM_TEST */ | |
298 | ||
299 | /* $(CPU)/start.S */ | |
c83bf6a2 | 300 | #if defined(CONFIG_5xx) || \ |
0db5bca8 | 301 | defined(CONFIG_8xx) |
e2211743 WD |
302 | uint get_immr (uint); |
303 | #endif | |
c83bf6a2 | 304 | uint get_pir (void); |
e2211743 WD |
305 | uint get_pvr (void); |
306 | uint rd_ic_cst (void); | |
307 | void wr_ic_cst (uint); | |
308 | void wr_ic_adr (uint); | |
309 | uint rd_dc_cst (void); | |
310 | void wr_dc_cst (uint); | |
311 | void wr_dc_adr (uint); | |
312 | int icache_status (void); | |
313 | void icache_enable (void); | |
314 | void icache_disable(void); | |
315 | int dcache_status (void); | |
316 | void dcache_enable (void); | |
317 | void dcache_disable(void); | |
318 | void relocate_code (ulong, gd_t *, ulong); | |
319 | ulong get_endaddr (void); | |
320 | void trap_init (ulong); | |
321 | #if defined (CONFIG_4xx) || \ | |
cbd8a35c | 322 | defined (CONFIG_5xxx) || \ |
e2211743 WD |
323 | defined (CONFIG_74xx_7xx) || \ |
324 | defined (CONFIG_74x) || \ | |
325 | defined (CONFIG_75x) || \ | |
326 | defined (CONFIG_74xx) | |
c83bf6a2 WD |
327 | unsigned char in8(unsigned int); |
328 | void out8(unsigned int, unsigned char); | |
329 | unsigned short in16(unsigned int); | |
330 | unsigned short in16r(unsigned int); | |
331 | void out16(unsigned int, unsigned short value); | |
332 | void out16r(unsigned int, unsigned short value); | |
333 | unsigned long in32(unsigned int); | |
334 | unsigned long in32r(unsigned int); | |
335 | void out32(unsigned int, unsigned long value); | |
336 | void out32r(unsigned int, unsigned long value); | |
337 | void ppcDcbf(unsigned long value); | |
338 | void ppcDcbi(unsigned long value); | |
339 | void ppcSync(void); | |
e2211743 WD |
340 | #endif |
341 | ||
342 | /* $(CPU)/cpu.c */ | |
343 | int checkcpu (void); | |
344 | int checkicache (void); | |
345 | int checkdcache (void); | |
346 | void upmconfig (unsigned int, unsigned int *, unsigned int); | |
347 | ulong get_tbclk (void); | |
348 | ||
349 | /* $(CPU)/serial.c */ | |
350 | int serial_init (void); | |
351 | void serial_setbrg (void); | |
352 | void serial_putc (const char); | |
353 | void serial_puts (const char *); | |
354 | void serial_addr (unsigned int); | |
355 | int serial_getc (void); | |
356 | int serial_tstc (void); | |
357 | ||
358 | /* $(CPU)/speed.c */ | |
359 | int get_clocks (void); | |
c178d3da WD |
360 | int get_clocks_866 (void); |
361 | int sdram_adjust_866 (void); | |
e2211743 WD |
362 | #if defined(CONFIG_8260) |
363 | int prt_8260_clks (void); | |
364 | #endif | |
cbd8a35c | 365 | #if defined(CONFIG_MPC5xxx) |
945af8d7 WD |
366 | int prt_mpc5xxx_clks (void); |
367 | #endif | |
e2211743 WD |
368 | #ifdef CONFIG_4xx |
369 | ulong get_OPB_freq (void); | |
370 | ulong get_PCI_freq (void); | |
371 | #endif | |
372 | #if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) | |
373 | ulong get_FCLK (void); | |
374 | ulong get_HCLK (void); | |
375 | ulong get_PCLK (void); | |
376 | ulong get_UCLK (void); | |
377 | #endif | |
7cb22f97 | 378 | #if defined CONFIG_INCA_IP |
c83bf6a2 | 379 | uint incaip_get_cpuclk (void); |
7cb22f97 | 380 | #endif |
e2211743 WD |
381 | ulong get_bus_freq (ulong); |
382 | ||
42d1f039 WD |
383 | #if defined(CONFIG_MPC85xx) |
384 | typedef MPC85xx_SYS_INFO sys_info_t; | |
c83bf6a2 | 385 | void get_sys_info ( sys_info_t * ); |
42d1f039 WD |
386 | #endif |
387 | ||
e2211743 WD |
388 | #if defined(CONFIG_4xx) || defined(CONFIG_IOP480) |
389 | # if defined(CONFIG_440) | |
390 | typedef PPC440_SYS_INFO sys_info_t; | |
391 | # else | |
392 | typedef PPC405_SYS_INFO sys_info_t; | |
393 | # endif | |
c83bf6a2 | 394 | void get_sys_info ( sys_info_t * ); |
e2211743 WD |
395 | #endif |
396 | ||
397 | /* $(CPU)/cpu_init.c */ | |
398 | #if defined(CONFIG_8xx) || defined(CONFIG_8260) | |
399 | void cpu_init_f (volatile immap_t *immr); | |
400 | #endif | |
bf9e3b38 | 401 | #if defined(CONFIG_4xx) || defined(CONFIG_MPC85xx) || defined(CONFIG_MCF52x2) |
e2211743 WD |
402 | void cpu_init_f (void); |
403 | #endif | |
bf9e3b38 | 404 | |
e2211743 WD |
405 | int cpu_init_r (void); |
406 | #if defined(CONFIG_8260) | |
407 | int prt_8260_rsr (void); | |
408 | #endif | |
409 | ||
410 | /* $(CPU)/interrupts.c */ | |
c83bf6a2 WD |
411 | int interrupt_init (void); |
412 | void timer_interrupt (struct pt_regs *); | |
e2211743 WD |
413 | void external_interrupt (struct pt_regs *); |
414 | void irq_install_handler(int, interrupt_handler_t *, void *); | |
415 | void irq_free_handler (int); | |
416 | void reset_timer (void); | |
417 | ulong get_timer (ulong base); | |
418 | void set_timer (ulong t); | |
419 | void enable_interrupts (void); | |
420 | int disable_interrupts (void); | |
421 | ||
422 | /* $(CPU)/.../commproc.c */ | |
423 | int dpram_init (void); | |
424 | uint dpram_base(void); | |
425 | uint dpram_base_align(uint align); | |
426 | uint dpram_alloc(uint size); | |
427 | uint dpram_alloc_align(uint size,uint align); | |
428 | void post_word_store (ulong); | |
429 | ulong post_word_load (void); | |
bdccc4fe WD |
430 | void bootcount_store (ulong); |
431 | ulong bootcount_load (void); | |
432 | #define BOOTCOUNT_MAGIC 0xB001C041 | |
e2211743 WD |
433 | |
434 | /* $(CPU)/.../<eth> */ | |
435 | void mii_init (void); | |
436 | ||
437 | /* $(CPU)/.../lcd.c */ | |
438 | ulong lcd_setmem (ulong); | |
439 | ||
440 | /* $(CPU)/.../vfd.c */ | |
441 | ulong vfd_setmem (ulong); | |
442 | ||
443 | /* $(CPU)/.../video.c */ | |
444 | ulong video_setmem (ulong); | |
445 | ||
446 | /* ppc/cache.c */ | |
447 | void flush_cache (unsigned long, unsigned long); | |
448 | ||
0db5bca8 | 449 | |
15647dc7 | 450 | /* lib_$(ARCH)/ticks.S */ |
e2211743 WD |
451 | unsigned long long get_ticks(void); |
452 | void wait_ticks (unsigned long); | |
453 | ||
15647dc7 | 454 | /* lib_$(ARCH)/time.c */ |
e2211743 WD |
455 | void udelay (unsigned long); |
456 | ulong usec2ticks (unsigned long usec); | |
457 | ulong ticks2usec (unsigned long ticks); | |
458 | int init_timebase (void); | |
459 | ||
15647dc7 | 460 | /* lib_generic/vsprintf.c */ |
e2211743 | 461 | ulong simple_strtoul(const char *cp,char **endp,unsigned int base); |
c40b2956 WD |
462 | #if CFG_64BIT_VSPRINTF |
463 | unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base); | |
464 | #endif | |
e2211743 WD |
465 | long simple_strtol(const char *cp,char **endp,unsigned int base); |
466 | void panic(const char *fmt, ...); | |
467 | int sprintf(char * buf, const char *fmt, ...); | |
c83bf6a2 | 468 | int vsprintf(char *buf, const char *fmt, va_list args); |
e2211743 | 469 | |
15647dc7 | 470 | /* lib_generic/crc32.c */ |
e2211743 WD |
471 | ulong crc32 (ulong, const unsigned char *, uint); |
472 | ulong crc32_no_comp (ulong, const unsigned char *, uint); | |
473 | ||
474 | /* common/console.c */ | |
e2211743 WD |
475 | int console_init_f(void); /* Before relocation; uses the serial stuff */ |
476 | int console_init_r(void); /* After relocation; uses the console stuff */ | |
477 | int console_assign (int file, char *devname); /* Assign the console */ | |
478 | int ctrlc (void); | |
479 | int had_ctrlc (void); /* have we had a Control-C since last clear? */ | |
480 | void clear_ctrlc (void); /* clear the Control-C condition */ | |
481 | int disable_ctrlc (int); /* 1 to disable, 0 to enable Control-C detect */ | |
482 | ||
483 | /* | |
484 | * STDIO based functions (can always be used) | |
485 | */ | |
486 | ||
487 | /* serial stuff */ | |
488 | void serial_printf (const char *fmt, ...); | |
489 | ||
490 | /* stdin */ | |
491 | int getc(void); | |
492 | int tstc(void); | |
493 | ||
494 | /* stdout */ | |
495 | void putc(const char c); | |
496 | void puts(const char *s); | |
497 | void printf(const char *fmt, ...); | |
6dd652fa | 498 | void vprintf(const char *fmt, va_list args); |
e2211743 WD |
499 | |
500 | /* stderr */ | |
501 | #define eputc(c) fputc(stderr, c) | |
502 | #define eputs(s) fputs(stderr, s) | |
503 | #define eprintf(fmt,args...) fprintf(stderr,fmt ,##args) | |
504 | ||
505 | /* | |
506 | * FILE based functions (can only be used AFTER relocation!) | |
507 | */ | |
508 | ||
509 | #define stdin 0 | |
510 | #define stdout 1 | |
511 | #define stderr 2 | |
512 | #define MAX_FILES 3 | |
513 | ||
514 | void fprintf(int file, const char *fmt, ...); | |
515 | void fputs(int file, const char *s); | |
516 | void fputc(int file, const char c); | |
517 | int ftstc(int file); | |
518 | int fgetc(int file); | |
519 | ||
520 | int pcmcia_init (void); | |
521 | ||
522 | #ifdef CONFIG_SHOW_BOOT_PROGRESS | |
523 | void show_boot_progress (int status); | |
524 | #endif | |
525 | ||
526 | #endif /* __COMMON_H_ */ |