5 * (C) Copyright 2000-2004
6 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8 * See file CREDITS for list of people who contributed to this
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of
14 * the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 #undef _LINUX_CONFIG_H
31 #define _LINUX_CONFIG_H 1 /* avoid reading Linux autoconf.h file */
33 typedef unsigned char uchar;
34 typedef volatile unsigned long vu_long;
35 typedef volatile unsigned short vu_short;
36 typedef volatile unsigned char vu_char;
39 #include <linux/types.h>
43 #define asmlinkage /* nothing */
48 # include <asm/setup.h>
49 # include <asm/x-load-arm.h> /* ARM version to be fixed! */
50 #endif /* CONFIG_ARM */
53 #define printf(fmt,args...) serial_printf (fmt ,##args)
54 #define getc() serial_getc()
56 #define printf(fmt,args...)
58 #endif /* CFG_PRINTF */
60 /* board/$(BOARD)/$(BOARD).c */
61 int board_init (void);
63 int mmc_boot (unsigned char *buf);
64 void board_hang (void);
66 /* cpu/$(CPU)/cpu.c */
69 void udelay (unsigned long usec);
73 #define NAND_CMD_READ0 0
74 #define NAND_CMD_READ1 1
75 #define NAND_CMD_READOOB 0x50
76 #define NAND_CMD_STATUS 0x70
77 #define NAND_CMD_READID 0x90
78 #define NAND_CMD_RESET 0xff
80 /* Extended Commands for Large page devices */
81 #define NAND_CMD_READSTART 0x30
84 int nand_read_block(uchar *buf, ulong block_addr);
86 int onenand_chip(void);
87 int onenand_read_block(unsigned char *buf, ulong block);
93 int serial_init (void);
94 void serial_setbrg (void);
95 void serial_putc (const char);
96 void serial_puts (const char *);
97 int serial_getc (void);
98 int serial_tstc (void);
101 int serial_printf (const char *fmt, ...);
105 void nand_calculate_ecc (const u_char *dat, u_char *ecc_code);
106 int nand_correct_data (u_char *dat, u_char *read_ecc, u_char *calc_ecc);
109 void hang (void) __attribute__ ((noreturn));
111 extern int do_load_serial_bin (ulong offset, int baudrate);
112 extern u32 get_mem_type(void);
113 extern int mmc_init(int verbose);
114 extern int misc_init_r(void);
116 extern int sprintf (char *__s, const char *__format, ...);
118 #endif /* __COMMON_H_ */