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