xref: /rk3399_rockchip-uboot/include/jffs2/load_kernel.h (revision 700a0c648df72f2c8e0589c0d0470b5ffd7cab7b)
1fe8c2806Swdenk #ifndef load_kernel_h
2fe8c2806Swdenk #define load_kernel_h
3fe8c2806Swdenk /*-------------------------------------------------------------------------
4fe8c2806Swdenk  * Filename:      load_kernel.h
5fe8c2806Swdenk  * Version:       $Id: load_kernel.h,v 1.3 2002/01/25 01:34:11 nyet Exp $
6fe8c2806Swdenk  * Copyright:     Copyright (C) 2001, Russ Dill
7fe8c2806Swdenk  * Author:        Russ Dill <Russ.Dill@asu.edu>
8fe8c2806Swdenk  * Description:   header for load kernel modules
9fe8c2806Swdenk  *-----------------------------------------------------------------------*/
10fe8c2806Swdenk /*
11fe8c2806Swdenk  *
12fe8c2806Swdenk  * This program is free software; you can redistribute it and/or modify
13fe8c2806Swdenk  * it under the terms of the GNU General Public License as published by
14fe8c2806Swdenk  * the Free Software Foundation; either version 2 of the License, or
15fe8c2806Swdenk  * (at your option) any later version.
16fe8c2806Swdenk  *
17fe8c2806Swdenk  * This program is distributed in the hope that it will be useful,
18fe8c2806Swdenk  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19fe8c2806Swdenk  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20fe8c2806Swdenk  * GNU General Public License for more details.
21fe8c2806Swdenk  *
22fe8c2806Swdenk  * You should have received a copy of the GNU General Public License
23fe8c2806Swdenk  * along with this program; if not, write to the Free Software
24fe8c2806Swdenk  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25fe8c2806Swdenk  *
26fe8c2806Swdenk  */
27fe8c2806Swdenk 
28*700a0c64SWolfgang Denk #include <linux/list.h>
29fe8c2806Swdenk 
30*700a0c64SWolfgang Denk /* mtd device types */
31*700a0c64SWolfgang Denk #define MTD_DEV_TYPE_NOR      0x0001
32*700a0c64SWolfgang Denk #define MTD_DEV_TYPE_NAND     0x0002
33*700a0c64SWolfgang Denk #define MTD_DEV_TYPE(type) ((type == MTD_DEV_TYPE_NAND) ? "nand" : "nor")
34fe8c2806Swdenk 
35*700a0c64SWolfgang Denk struct mtd_device {
36*700a0c64SWolfgang Denk 	struct list_head link;
37*700a0c64SWolfgang Denk 	struct mtdids *id;		/* parent mtd id entry */
38*700a0c64SWolfgang Denk 	u16 num_parts;			/* number of partitions on this device */
39*700a0c64SWolfgang Denk 	struct list_head parts;		/* partitions */
40fe8c2806Swdenk };
41fe8c2806Swdenk 
42*700a0c64SWolfgang Denk struct part_info {
43*700a0c64SWolfgang Denk 	struct list_head link;
44*700a0c64SWolfgang Denk 	char *name;			/* partition name */
45*700a0c64SWolfgang Denk 	u8 auto_name;			/* set to 1 for generated name */
46*700a0c64SWolfgang Denk 	u32 size;			/* total size of the partition */
47*700a0c64SWolfgang Denk 	u32 offset;			/* offset within device */
48*700a0c64SWolfgang Denk 	void *jffs2_priv;		/* used internaly by jffs2 */
49*700a0c64SWolfgang Denk 	u32 mask_flags;			/* kernel MTD mask flags */
50*700a0c64SWolfgang Denk 	struct mtd_device *dev;		/* parent device */
51*700a0c64SWolfgang Denk };
52fe8c2806Swdenk 
53*700a0c64SWolfgang Denk struct mtdids {
54*700a0c64SWolfgang Denk 	struct list_head link;
55*700a0c64SWolfgang Denk 	u8 type;			/* device type */
56*700a0c64SWolfgang Denk 	u8 num;				/* device number */
57*700a0c64SWolfgang Denk 	u32 size;			/* device size */
58*700a0c64SWolfgang Denk 	char *mtd_id;			/* linux kernel device id */
59fe8c2806Swdenk };
60fe8c2806Swdenk 
61fe8c2806Swdenk #define ldr_strlen	strlen
62fe8c2806Swdenk #define ldr_strncmp	strncmp
63fe8c2806Swdenk #define ldr_memcpy	memcpy
64fe8c2806Swdenk #define putstr(x)	printf("%s", x)
65fe8c2806Swdenk #define mmalloc		malloc
66fe8c2806Swdenk #define UDEBUG		printf
67fe8c2806Swdenk 
68fe8c2806Swdenk #define putnstr(str, size)	printf("%*.*s", size, size, str)
69fe8c2806Swdenk #define ldr_output_string(x)	puts(x)
70fe8c2806Swdenk #define putLabeledWord(x, y)	printf("%s %08x\n", x, (unsigned int)y)
71fe8c2806Swdenk #define led_blink(x, y, z, a)
72fe8c2806Swdenk 
73fe8c2806Swdenk #endif /* load_kernel_h */
74