blob: a1460f4c656dc38402cab27770a0b8670cc3ce94 [file] [log] [blame]
wdenke2211742002-11-02 23:30:20 +00001/*
wdenkd4ca31c2004-01-02 14:00:00 +00002 * (C) Copyright 2000-2004
wdenke2211742002-11-02 23:30:20 +00003 * 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
wdenk180d3f72004-01-04 16:28:35 +000015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wdenke2211742002-11-02 23:30:20 +000016 * 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
30typedef unsigned char uchar;
31typedef volatile unsigned long vu_long;
wdenk180d3f72004-01-04 16:28:35 +000032typedef volatile unsigned short vu_short;
wdenke2211742002-11-02 23:30:20 +000033typedef 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
wdenk180d3f72004-01-04 16:28:35 +000044#if defined(CONFIG_8xx)
wdenke2211742002-11-02 23:30:20 +000045#include <asm/8xx_immap.h>
wdenkd4ca31c2004-01-02 14:00:00 +000046#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)
wdenk180d3f72004-01-04 16:28:35 +000051# 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
wdenk2535d602003-07-17 23:16:40 +000063#endif
wdenk0db5bca2003-03-31 17:27:09 +000064#elif defined(CONFIG_5xx)
65#include <asm/5xx_immap.h>
wdenke2211742002-11-02 23:30:20 +000066#elif defined(CONFIG_8260)
67#include <asm/immap_8260.h>
68#endif
wdenk42d1f032003-10-15 23:53:47 +000069#ifdef CONFIG_MPC85xx
70#include <mpc85xx.h>
71#include <asm/immap_85xx.h>
72#endif
wdenke2211742002-11-02 23:30:20 +000073#ifdef CONFIG_4xx
74#include <ppc4xx.h>
75#endif
76#ifdef CONFIG_HYMOD
wdenk6dd652f2003-06-19 23:40:20 +000077#include <board/hymod/hymod.h>
wdenke2211742002-11-02 23:30:20 +000078#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)
wdenk52f52c12003-06-19 23:04:19 +000089#define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args);
wdenke2211742002-11-02 23:30:20 +000090#else
91#define debug(fmt,args...)
wdenk52f52c12003-06-19 23:04:19 +000092#define debugX(level,fmt,args...)
wdenke2211742002-11-02 23:30:20 +000093#endif /* DEBUG */
94
wdenkc83bf6a2004-01-06 22:38:14 +000095typedef void (interrupt_handler_t)(void *);
wdenke2211742002-11-02 23:30:20 +000096
wdenkc83bf6a2004-01-06 22:38:14 +000097#include <asm/u-boot.h> /* boot information for Linux kernel */
wdenke2211742002-11-02 23:30:20 +000098#include <asm/global_data.h> /* global data used for startup functions */
99
wdenk71f95112003-06-15 22:40:42 +0000100/*
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) || \
wdenkd4ca31c2004-01-02 14:00:00 +0000107 defined(CONFIG_TQM862M) || defined(CONFIG_TQM866M)
wdenk71f95112003-06-15 22:40:42 +0000108# ifndef CONFIG_TQM8xxM
109# define CONFIG_TQM8xxM
110# endif
111#endif
wdenke2211742002-11-02 23:30:20 +0000112#if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L) || \
wdenkd126bfb2003-04-10 11:18:18 +0000113 defined(CONFIG_TQM855L) || defined(CONFIG_TQM860L) || \
wdenk71f95112003-06-15 22:40:42 +0000114 defined(CONFIG_TQM862L) || defined(CONFIG_TQM8xxM)
wdenke2211742002-11-02 23:30:20 +0000115# ifndef CONFIG_TQM8xxL
116# define CONFIG_TQM8xxL
117# endif
118#endif
119
120
121/*
wdenkc7de8292002-11-19 11:04:11 +0000122 * 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
133/*
wdenke2211742002-11-02 23:30:20 +0000134 * Function Prototypes
135 */
136
137#if CONFIG_SERIAL_SOFTWARE_FIFO
138void serial_buffered_init (void);
139void serial_buffered_putc (const char);
140void serial_buffered_puts (const char *);
141int serial_buffered_getc (void);
142int serial_buffered_tstc (void);
143#endif /* CONFIG_SERIAL_SOFTWARE_FIFO */
144
wdenkc83bf6a2004-01-06 22:38:14 +0000145void hang (void) __attribute__ ((noreturn));
wdenke2211742002-11-02 23:30:20 +0000146
147/* */
148long int initdram (int);
wdenkc83bf6a2004-01-06 22:38:14 +0000149int display_options (void);
wdenke2211742002-11-02 23:30:20 +0000150void print_size (ulong, const char *);
151
152/* common/main.c */
153void main_loop (void);
154int run_command (const char *cmd, int flag);
155int readline (const char *const prompt);
wdenk6dd652f2003-06-19 23:40:20 +0000156void init_cmd_timeout(void);
wdenke2211742002-11-02 23:30:20 +0000157void reset_cmd_timeout(void);
158
wdenk15647dc2003-10-09 19:00:25 +0000159/* lib_$(ARCH)/board.c */
wdenke2211742002-11-02 23:30:20 +0000160void board_init_f (ulong);
161void board_init_r (gd_t *, ulong);
162int checkboard (void);
163int checkflash (void);
164int checkdram (void);
165char * strmhz(char *buf, long hz);
166int last_stage_init(void);
wdenk3b57fe02003-05-30 12:48:29 +0000167extern ulong monitor_flash_len;
wdenke2211742002-11-02 23:30:20 +0000168
169/* common/flash.c */
170void flash_perror (int);
171
wdenkb0fce992003-06-29 21:03:46 +0000172/* common/cmd_autoscript.c */
173int autoscript (ulong addr);
174
wdenke2211742002-11-02 23:30:20 +0000175/* common/cmd_bootm.c */
wdenkb0fce992003-06-29 21:03:46 +0000176void print_image_hdr (image_header_t *hdr);
wdenke2211742002-11-02 23:30:20 +0000177
wdenkc83bf6a2004-01-06 22:38:14 +0000178extern ulong load_addr; /* Default Load Address */
wdenke2211742002-11-02 23:30:20 +0000179
180/* common/cmd_nvedit.c */
181int env_init (void);
182void env_relocate (void);
wdenkc83bf6a2004-01-06 22:38:14 +0000183char *getenv (uchar *);
wdenke2211742002-11-02 23:30:20 +0000184int getenv_r (uchar *name, uchar *buf, unsigned len);
wdenkc83bf6a2004-01-06 22:38:14 +0000185int saveenv (void);
wdenke2211742002-11-02 23:30:20 +0000186#ifdef CONFIG_PPC /* ARM version to be fixed! */
187void inline setenv (char *, char *);
wdenk2262cfe2002-11-18 00:14:45 +0000188#else
wdenkc83bf6a2004-01-06 22:38:14 +0000189void setenv (char *, char *);
wdenke2211742002-11-02 23:30:20 +0000190#endif /* CONFIG_PPC */
191#ifdef CONFIG_ARM
wdenkb6e4c402004-01-02 16:05:07 +0000192# include <asm/setup.h>
wdenke2211742002-11-02 23:30:20 +0000193# include <asm/u-boot-arm.h> /* ARM version to be fixed! */
194#endif /* CONFIG_ARM */
wdenk2262cfe2002-11-18 00:14:45 +0000195#ifdef CONFIG_I386 /* x86 version to be fixed! */
wdenk8bde7f72003-06-27 21:31:46 +0000196# include <asm/u-boot-i386.h>
wdenk2262cfe2002-11-18 00:14:45 +0000197#endif /* CONFIG_I386 */
wdenke2211742002-11-02 23:30:20 +0000198
wdenkc83bf6a2004-01-06 22:38:14 +0000199void pci_init (void);
200void pci_init_board(void);
201void pciinfo (int, int);
wdenke2211742002-11-02 23:30:20 +0000202
203#if defined(CONFIG_PCI) && defined(CONFIG_440)
204# if defined(CFG_PCI_PRE_INIT)
wdenkc83bf6a2004-01-06 22:38:14 +0000205 int pci_pre_init (struct pci_controller * );
wdenke2211742002-11-02 23:30:20 +0000206# endif
207# if defined(CFG_PCI_TARGET_INIT)
wdenkc83bf6a2004-01-06 22:38:14 +0000208 void pci_target_init (struct pci_controller *);
wdenke2211742002-11-02 23:30:20 +0000209# endif
210# if defined(CFG_PCI_MASTER_INIT)
wdenkc83bf6a2004-01-06 22:38:14 +0000211 void pci_master_init (struct pci_controller *);
wdenke2211742002-11-02 23:30:20 +0000212# endif
wdenkc83bf6a2004-01-06 22:38:14 +0000213 int is_pci_host (struct pci_controller *);
wdenke2211742002-11-02 23:30:20 +0000214#endif
215
216int misc_init_f (void);
217int misc_init_r (void);
218
wdenk27b207f2003-07-24 23:38:38 +0000219/* common/exports.c */
220void jumptable_init(void);
221
wdenkc83bf6a2004-01-06 22:38:14 +0000222/* common/memsize.c */
223int get_ram_size (volatile long *, long);
224
wdenke2211742002-11-02 23:30:20 +0000225/* $(BOARD)/$(BOARD).c */
226void reset_phy (void);
wdenkc83bf6a2004-01-06 22:38:14 +0000227void fdc_hw_init (void);
wdenke2211742002-11-02 23:30:20 +0000228
229/* $(BOARD)/eeprom.c */
230void eeprom_init (void);
wdenk6dd652f2003-06-19 23:40:20 +0000231#ifndef CONFIG_SPI
232int eeprom_probe (unsigned dev_addr, unsigned offset);
233#endif
wdenke2211742002-11-02 23:30:20 +0000234int eeprom_read (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt);
235int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cnt);
236#ifdef CONFIG_LWMON
237extern uchar pic_read (uchar reg);
238extern 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
wdenkbdccc4f2003-08-05 17:43:17 +0000251#if defined(CONFIG_SPI)
wdenke2211742002-11-02 23:30:20 +0000252extern void spi_init_f (void);
253extern void spi_init_r (void);
wdenkc83bf6a2004-01-06 22:38:14 +0000254extern ssize_t spi_read (uchar *, int, uchar *, int);
wdenke2211742002-11-02 23:30:20 +0000255extern ssize_t spi_write (uchar *, int, uchar *, int);
256#endif
257
258#ifdef CONFIG_RPXCLASSIC
259void rpxclassic_init (void);
260#endif
261
262#ifdef CONFIG_MBX
263/* $(BOARD)/mbx8xx.c */
264void mbx_init (void);
265void board_serial_init (void);
266void board_ether_init (void);
267#endif
268
wdenkba56f622004-02-06 23:19:44 +0000269#if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_MBX) || \
270 defined(CONFIG_IAD210) || defined(CONFIG_XPEDITE1K)
wdenke2211742002-11-02 23:30:20 +0000271void board_get_enetaddr (uchar *addr);
272#endif
273
274#ifdef CONFIG_HERMES
275/* $(BOARD)/hermes.c */
276void hermes_start_lxt980 (int speed);
277#endif
278
279#ifdef CONFIG_EVB64260
280void evb64260_init(void);
281void debug_led(int, int);
282void display_mem_map(void);
283void perform_soft_reset(void);
284#endif
285
286void load_sernum_ethaddr (void);
287
288/* $(BOARD)/$(BOARD).c */
wdenkc837dcb2004-01-20 23:12:12 +0000289int board_early_init_f (void);
290int board_late_init (void);
wdenke2211742002-11-02 23:30:20 +0000291int board_postclk_init (void); /* after clocks/timebase, before env/serial */
wdenkc837dcb2004-01-20 23:12:12 +0000292int board_early_init_r (void);
wdenke2211742002-11-02 23:30:20 +0000293void board_poweroff (void);
294
295#if defined(CFG_DRAM_TEST)
296int testdram(void);
297#endif /* CFG_DRAM_TEST */
298
299/* $(CPU)/start.S */
wdenkc83bf6a2004-01-06 22:38:14 +0000300#if defined(CONFIG_5xx) || \
wdenk0db5bca2003-03-31 17:27:09 +0000301 defined(CONFIG_8xx)
wdenke2211742002-11-02 23:30:20 +0000302uint get_immr (uint);
303#endif
wdenkc83bf6a2004-01-06 22:38:14 +0000304uint get_pir (void);
wdenke2211742002-11-02 23:30:20 +0000305uint get_pvr (void);
306uint rd_ic_cst (void);
307void wr_ic_cst (uint);
308void wr_ic_adr (uint);
309uint rd_dc_cst (void);
310void wr_dc_cst (uint);
311void wr_dc_adr (uint);
312int icache_status (void);
313void icache_enable (void);
314void icache_disable(void);
315int dcache_status (void);
316void dcache_enable (void);
317void dcache_disable(void);
318void relocate_code (ulong, gd_t *, ulong);
319ulong get_endaddr (void);
320void trap_init (ulong);
321#if defined (CONFIG_4xx) || \
wdenkcbd8a352004-02-24 02:00:03 +0000322 defined (CONFIG_5xxx) || \
wdenke2211742002-11-02 23:30:20 +0000323 defined (CONFIG_74xx_7xx) || \
324 defined (CONFIG_74x) || \
325 defined (CONFIG_75x) || \
326 defined (CONFIG_74xx)
wdenkc83bf6a2004-01-06 22:38:14 +0000327unsigned char in8(unsigned int);
328void out8(unsigned int, unsigned char);
329unsigned short in16(unsigned int);
330unsigned short in16r(unsigned int);
331void out16(unsigned int, unsigned short value);
332void out16r(unsigned int, unsigned short value);
333unsigned long in32(unsigned int);
334unsigned long in32r(unsigned int);
335void out32(unsigned int, unsigned long value);
336void out32r(unsigned int, unsigned long value);
337void ppcDcbf(unsigned long value);
338void ppcDcbi(unsigned long value);
339void ppcSync(void);
wdenke2211742002-11-02 23:30:20 +0000340#endif
341
342/* $(CPU)/cpu.c */
343int checkcpu (void);
344int checkicache (void);
345int checkdcache (void);
346void upmconfig (unsigned int, unsigned int *, unsigned int);
347ulong get_tbclk (void);
348
349/* $(CPU)/serial.c */
350int serial_init (void);
351void serial_setbrg (void);
352void serial_putc (const char);
353void serial_puts (const char *);
354void serial_addr (unsigned int);
355int serial_getc (void);
356int serial_tstc (void);
357
358/* $(CPU)/speed.c */
359int get_clocks (void);
wdenkc178d3d2004-01-24 20:25:54 +0000360int get_clocks_866 (void);
361int sdram_adjust_866 (void);
wdenke2211742002-11-02 23:30:20 +0000362#if defined(CONFIG_8260)
363int prt_8260_clks (void);
364#endif
wdenkcbd8a352004-02-24 02:00:03 +0000365#if defined(CONFIG_MPC5xxx)
wdenk945af8d2003-07-16 21:53:01 +0000366int prt_mpc5xxx_clks (void);
367#endif
wdenke2211742002-11-02 23:30:20 +0000368#ifdef CONFIG_4xx
369ulong get_OPB_freq (void);
370ulong get_PCI_freq (void);
371#endif
372#if defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410)
373ulong get_FCLK (void);
374ulong get_HCLK (void);
375ulong get_PCLK (void);
376ulong get_UCLK (void);
377#endif
wdenk7cb22f92003-12-27 19:24:54 +0000378#if defined CONFIG_INCA_IP
wdenkc83bf6a2004-01-06 22:38:14 +0000379uint incaip_get_cpuclk (void);
wdenk7cb22f92003-12-27 19:24:54 +0000380#endif
wdenke2211742002-11-02 23:30:20 +0000381ulong get_bus_freq (ulong);
382
wdenk42d1f032003-10-15 23:53:47 +0000383#if defined(CONFIG_MPC85xx)
384typedef MPC85xx_SYS_INFO sys_info_t;
wdenkc83bf6a2004-01-06 22:38:14 +0000385void get_sys_info ( sys_info_t * );
wdenk42d1f032003-10-15 23:53:47 +0000386#endif
387
wdenke2211742002-11-02 23:30:20 +0000388#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
wdenkc83bf6a2004-01-06 22:38:14 +0000394void get_sys_info ( sys_info_t * );
wdenke2211742002-11-02 23:30:20 +0000395#endif
396
397/* $(CPU)/cpu_init.c */
398#if defined(CONFIG_8xx) || defined(CONFIG_8260)
399void cpu_init_f (volatile immap_t *immr);
400#endif
wdenkbf9e3b32004-02-12 00:47:09 +0000401#if defined(CONFIG_4xx) || defined(CONFIG_MPC85xx) || defined(CONFIG_MCF52x2)
wdenke2211742002-11-02 23:30:20 +0000402void cpu_init_f (void);
403#endif
wdenkbf9e3b32004-02-12 00:47:09 +0000404
wdenke2211742002-11-02 23:30:20 +0000405int cpu_init_r (void);
406#if defined(CONFIG_8260)
407int prt_8260_rsr (void);
408#endif
409
410/* $(CPU)/interrupts.c */
wdenkc83bf6a2004-01-06 22:38:14 +0000411int interrupt_init (void);
412void timer_interrupt (struct pt_regs *);
wdenke2211742002-11-02 23:30:20 +0000413void external_interrupt (struct pt_regs *);
414void irq_install_handler(int, interrupt_handler_t *, void *);
415void irq_free_handler (int);
416void reset_timer (void);
417ulong get_timer (ulong base);
418void set_timer (ulong t);
419void enable_interrupts (void);
420int disable_interrupts (void);
421
422/* $(CPU)/.../commproc.c */
423int dpram_init (void);
424uint dpram_base(void);
425uint dpram_base_align(uint align);
426uint dpram_alloc(uint size);
427uint dpram_alloc_align(uint size,uint align);
428void post_word_store (ulong);
429ulong post_word_load (void);
wdenkbdccc4f2003-08-05 17:43:17 +0000430void bootcount_store (ulong);
431ulong bootcount_load (void);
432#define BOOTCOUNT_MAGIC 0xB001C041
wdenke2211742002-11-02 23:30:20 +0000433
434/* $(CPU)/.../<eth> */
435void mii_init (void);
436
437/* $(CPU)/.../lcd.c */
438ulong lcd_setmem (ulong);
439
440/* $(CPU)/.../vfd.c */
441ulong vfd_setmem (ulong);
442
443/* $(CPU)/.../video.c */
444ulong video_setmem (ulong);
445
446/* ppc/cache.c */
447void flush_cache (unsigned long, unsigned long);
448
wdenk0db5bca2003-03-31 17:27:09 +0000449
wdenk15647dc2003-10-09 19:00:25 +0000450/* lib_$(ARCH)/ticks.S */
wdenke2211742002-11-02 23:30:20 +0000451unsigned long long get_ticks(void);
452void wait_ticks (unsigned long);
453
wdenk15647dc2003-10-09 19:00:25 +0000454/* lib_$(ARCH)/time.c */
wdenke2211742002-11-02 23:30:20 +0000455void udelay (unsigned long);
456ulong usec2ticks (unsigned long usec);
457ulong ticks2usec (unsigned long ticks);
458int init_timebase (void);
459
wdenk15647dc2003-10-09 19:00:25 +0000460/* lib_generic/vsprintf.c */
wdenke2211742002-11-02 23:30:20 +0000461ulong simple_strtoul(const char *cp,char **endp,unsigned int base);
462long simple_strtol(const char *cp,char **endp,unsigned int base);
463void panic(const char *fmt, ...);
464int sprintf(char * buf, const char *fmt, ...);
wdenkc83bf6a2004-01-06 22:38:14 +0000465int vsprintf(char *buf, const char *fmt, va_list args);
wdenke2211742002-11-02 23:30:20 +0000466
wdenk15647dc2003-10-09 19:00:25 +0000467/* lib_generic/crc32.c */
wdenke2211742002-11-02 23:30:20 +0000468ulong crc32 (ulong, const unsigned char *, uint);
469ulong crc32_no_comp (ulong, const unsigned char *, uint);
470
471/* common/console.c */
wdenke2211742002-11-02 23:30:20 +0000472int console_init_f(void); /* Before relocation; uses the serial stuff */
473int console_init_r(void); /* After relocation; uses the console stuff */
474int console_assign (int file, char *devname); /* Assign the console */
475int ctrlc (void);
476int had_ctrlc (void); /* have we had a Control-C since last clear? */
477void clear_ctrlc (void); /* clear the Control-C condition */
478int disable_ctrlc (int); /* 1 to disable, 0 to enable Control-C detect */
479
480/*
481 * STDIO based functions (can always be used)
482 */
483
484/* serial stuff */
485void serial_printf (const char *fmt, ...);
486
487/* stdin */
488int getc(void);
489int tstc(void);
490
491/* stdout */
492void putc(const char c);
493void puts(const char *s);
494void printf(const char *fmt, ...);
wdenk6dd652f2003-06-19 23:40:20 +0000495void vprintf(const char *fmt, va_list args);
wdenke2211742002-11-02 23:30:20 +0000496
497/* stderr */
498#define eputc(c) fputc(stderr, c)
499#define eputs(s) fputs(stderr, s)
500#define eprintf(fmt,args...) fprintf(stderr,fmt ,##args)
501
502/*
503 * FILE based functions (can only be used AFTER relocation!)
504 */
505
506#define stdin 0
507#define stdout 1
508#define stderr 2
509#define MAX_FILES 3
510
511void fprintf(int file, const char *fmt, ...);
512void fputs(int file, const char *s);
513void fputc(int file, const char c);
514int ftstc(int file);
515int fgetc(int file);
516
517int pcmcia_init (void);
518
519#ifdef CONFIG_SHOW_BOOT_PROGRESS
520void show_boot_progress (int status);
521#endif
522
523#endif /* __COMMON_H_ */