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