]>
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 | ||
d8bc55a6 | 17 | #include <compiler.h> |
0c06db59 | 18 | #include <linux/compat.h> |
7e6ee7ad KP |
19 | #include <malloc.h> |
20 | #include <div64.h> | |
0c06db59 | 21 | #include <linux/math64.h> |
7e6ee7ad | 22 | #include <linux/crc32.h> |
9eefe2a2 SR |
23 | #include <linux/types.h> |
24 | #include <linux/list.h> | |
25 | #include <linux/rbtree.h> | |
26 | #include <linux/string.h> | |
7e6ee7ad | 27 | #include <linux/mtd/mtd.h> |
9eefe2a2 | 28 | #include <linux/mtd/ubi.h> |
7e6ee7ad KP |
29 | |
30 | #ifdef CONFIG_CMD_ONENAND | |
31 | #include <onenand_uboot.h> | |
32 | #endif | |
33 | ||
1221ce45 | 34 | #include <linux/errno.h> |
7e6ee7ad | 35 | |
7e6ee7ad KP |
36 | /* build.c */ |
37 | #define get_device(...) | |
38 | #define put_device(...) | |
39 | #define ubi_sysfs_init(...) 0 | |
40 | #define ubi_sysfs_close(...) do { } while (0) | |
7e6ee7ad | 41 | |
9eefe2a2 | 42 | #ifndef __UBIFS_H__ |
7e6ee7ad | 43 | #include "../drivers/mtd/ubi/ubi.h" |
9eefe2a2 | 44 | #endif |
7e6ee7ad KP |
45 | |
46 | /* functions */ | |
47 | extern int ubi_mtd_param_parse(const char *val, struct kernel_param *kp); | |
48 | extern int ubi_init(void); | |
2ee951ba | 49 | extern void ubi_exit(void); |
71829067 | 50 | extern int ubi_part(char *part_name, const char *vid_header_offset); |
25ee9c20 | 51 | extern int ubi_volume_write(char *volume, void *buf, loff_t offset, size_t size); |
cead69c5 | 52 | extern int ubi_volume_read(char *volume, char *buf, loff_t offset, size_t size); |
7e6ee7ad KP |
53 | |
54 | extern struct ubi_device *ubi_devices[]; | |
14dfc648 | 55 | int cmd_ubifs_mount(char *vol_name); |
10c20440 | 56 | int cmd_ubifs_umount(void); |
7e6ee7ad | 57 | |
9daad11a AR |
58 | #if IS_ENABLED(CONFIG_UBI_BLOCK) |
59 | int ubi_bind(struct udevice *dev); | |
60 | #else | |
61 | static inline int ubi_bind(struct udevice *dev) | |
62 | { | |
63 | return -EOPNOTSUPP; | |
64 | } | |
65 | #endif | |
66 | ||
7e6ee7ad | 67 | #endif |