1
2#ifndef load_kernel_h
3#define load_kernel_h
4
5
6
7
8
9
10
11
12#include <linux/list.h>
13
14
15#define MTD_DEV_TYPE_NOR 0x0001
16#define MTD_DEV_TYPE_NAND 0x0002
17#define MTD_DEV_TYPE_ONENAND 0x0004
18#define MTD_DEV_TYPE_SPINAND 0x0008
19
20#define MTD_DEV_TYPE(type) (type == MTD_DEV_TYPE_NAND ? "nand" : \
21 (type == MTD_DEV_TYPE_NOR ? "nor" : \
22 (type == MTD_DEV_TYPE_ONENAND ? "onenand" : \
23 "spi-nand"))) \
24
25struct mtd_device {
26 struct list_head link;
27 struct mtdids *id;
28 u16 num_parts;
29 struct list_head parts;
30};
31
32struct part_info {
33 struct list_head link;
34 char *name;
35 u8 auto_name;
36 u64 size;
37 u64 offset;
38 void *jffs2_priv;
39 u32 mask_flags;
40 u32 sector_size;
41 struct mtd_device *dev;
42};
43
44struct mtdids {
45 struct list_head link;
46 u8 type;
47 u8 num;
48 u64 size;
49 char *mtd_id;
50};
51
52#define ldr_strlen strlen
53#define ldr_strncmp strncmp
54#define ldr_memcpy memcpy
55#define putstr(x) printf("%s", x)
56#define mmalloc malloc
57#define UDEBUG printf
58
59#define putnstr(str, size) printf("%*.*s", size, size, str)
60#define ldr_output_string(x) puts(x)
61#define putLabeledWord(x, y) printf("%s %08x\n", x, (unsigned int)y)
62#define led_blink(x, y, z, a)
63
64
65extern int mtdparts_init(void);
66extern int find_dev_and_part(const char *id, struct mtd_device **dev,
67 u8 *part_num, struct part_info **part);
68extern struct mtd_device *device_find(u8 type, u8 num);
69
70#endif
71