]>
Commit | Line | Data |
---|---|---|
7e6ee7ad KP |
1 | /* |
2 | * Header file for UBI support for U-Boot | |
3 | * | |
4 | * Adaptation from kernel to U-Boot | |
5 | * | |
6 | * Copyright (C) 2005-2007 Samsung Electronics | |
7 | * Kyungmin Park <[email protected]> | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License version 2 as | |
11 | * published by the Free Software Foundation. | |
12 | */ | |
13 | ||
14 | #ifndef __UBOOT_UBI_H | |
15 | #define __UBOOT_UBI_H | |
16 | ||
17 | #include <common.h> | |
d8bc55a6 | 18 | #include <compiler.h> |
0c06db59 | 19 | #include <linux/compat.h> |
7e6ee7ad KP |
20 | #include <malloc.h> |
21 | #include <div64.h> | |
0c06db59 | 22 | #include <linux/math64.h> |
7e6ee7ad | 23 | #include <linux/crc32.h> |
9eefe2a2 SR |
24 | #include <linux/types.h> |
25 | #include <linux/list.h> | |
26 | #include <linux/rbtree.h> | |
27 | #include <linux/string.h> | |
7e6ee7ad | 28 | #include <linux/mtd/mtd.h> |
9eefe2a2 | 29 | #include <linux/mtd/ubi.h> |
7e6ee7ad KP |
30 | |
31 | #ifdef CONFIG_CMD_ONENAND | |
32 | #include <onenand_uboot.h> | |
33 | #endif | |
34 | ||
1221ce45 | 35 | #include <linux/errno.h> |
7e6ee7ad | 36 | |
7e6ee7ad | 37 | /* configurable */ |
7e6ee7ad | 38 | #define CONFIG_MTD_UBI_BEB_RESERVE 1 |
7e6ee7ad KP |
39 | |
40 | /* debug options (Linux: drivers/mtd/ubi/Kconfig.debug) */ | |
41 | #undef CONFIG_MTD_UBI_DEBUG | |
42 | #undef CONFIG_MTD_UBI_DEBUG_PARANOID | |
43 | #undef CONFIG_MTD_UBI_DEBUG_MSG | |
44 | #undef CONFIG_MTD_UBI_DEBUG_MSG_EBA | |
45 | #undef CONFIG_MTD_UBI_DEBUG_MSG_WL | |
46 | #undef CONFIG_MTD_UBI_DEBUG_MSG_IO | |
47 | #undef CONFIG_MTD_UBI_DEBUG_MSG_BLD | |
0c06db59 HS |
48 | |
49 | #undef CONFIG_MTD_UBI_BLOCK | |
50 | ||
d1cfeee9 AR |
51 | /* ubi_init() disables returning error codes when built into the Linux |
52 | * kernel so that it doesn't hang the Linux kernel boot process. Since | |
53 | * the U-Boot driver code depends on getting valid error codes from this | |
54 | * function we just tell the UBI layer that we are building as a module | |
55 | * (which only enables the additional error reporting). | |
56 | */ | |
57 | #define CONFIG_MTD_UBI_MODULE | |
58 | ||
7e6ee7ad KP |
59 | /* build.c */ |
60 | #define get_device(...) | |
61 | #define put_device(...) | |
62 | #define ubi_sysfs_init(...) 0 | |
63 | #define ubi_sysfs_close(...) do { } while (0) | |
7e6ee7ad | 64 | |
9eefe2a2 | 65 | #ifndef __UBIFS_H__ |
7e6ee7ad | 66 | #include "../drivers/mtd/ubi/ubi.h" |
9eefe2a2 | 67 | #endif |
7e6ee7ad KP |
68 | |
69 | /* functions */ | |
70 | extern int ubi_mtd_param_parse(const char *val, struct kernel_param *kp); | |
71 | extern int ubi_init(void); | |
2ee951ba | 72 | extern void ubi_exit(void); |
71829067 JH |
73 | extern int ubi_part(char *part_name, const char *vid_header_offset); |
74 | extern int ubi_volume_write(char *volume, void *buf, size_t size); | |
75 | extern int ubi_volume_read(char *volume, char *buf, size_t size); | |
7e6ee7ad KP |
76 | |
77 | extern struct ubi_device *ubi_devices[]; | |
14dfc648 | 78 | int cmd_ubifs_mount(char *vol_name); |
10c20440 | 79 | int cmd_ubifs_umount(void); |
7e6ee7ad KP |
80 | |
81 | #endif |