blob: 6da348eb6285f36b63b3391b6b62fa683a582e43 [file] [log] [blame]
Kyungmin Parkad7ae362008-11-19 16:32:36 +01001/*
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 <kyungmin.park@samsung.com>
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>
Anton Vorontsov18d59c02009-09-01 20:58:03 +040018#include <compiler.h>
Heiko Schocher4f7a9a32014-06-24 10:10:03 +020019#include <linux/compat.h>
Kyungmin Parkad7ae362008-11-19 16:32:36 +010020#include <malloc.h>
21#include <div64.h>
Heiko Schocher4f7a9a32014-06-24 10:10:03 +020022#include <linux/math64.h>
Kyungmin Parkad7ae362008-11-19 16:32:36 +010023#include <linux/crc32.h>
Stefan Roese2fc10f62009-03-19 15:35:05 +010024#include <linux/types.h>
25#include <linux/list.h>
26#include <linux/rbtree.h>
27#include <linux/string.h>
Kyungmin Parkad7ae362008-11-19 16:32:36 +010028#include <linux/mtd/mtd.h>
Stefan Roese2fc10f62009-03-19 15:35:05 +010029#include <linux/mtd/ubi.h>
Kyungmin Parkad7ae362008-11-19 16:32:36 +010030
31#ifdef CONFIG_CMD_ONENAND
32#include <onenand_uboot.h>
33#endif
34
Masahiro Yamada56a931c2016-09-21 11:28:55 +090035#include <linux/errno.h>
Kyungmin Parkad7ae362008-11-19 16:32:36 +010036
Kyungmin Parkad7ae362008-11-19 16:32:36 +010037/* build.c */
38#define get_device(...)
39#define put_device(...)
40#define ubi_sysfs_init(...) 0
41#define ubi_sysfs_close(...) do { } while (0)
Kyungmin Parkad7ae362008-11-19 16:32:36 +010042
Stefan Roese2fc10f62009-03-19 15:35:05 +010043#ifndef __UBIFS_H__
Kyungmin Parkad7ae362008-11-19 16:32:36 +010044#include "../drivers/mtd/ubi/ubi.h"
Stefan Roese2fc10f62009-03-19 15:35:05 +010045#endif
Kyungmin Parkad7ae362008-11-19 16:32:36 +010046
47/* functions */
48extern int ubi_mtd_param_parse(const char *val, struct kernel_param *kp);
49extern int ubi_init(void);
Stefan Roese1b20eb82008-11-27 14:07:09 +010050extern void ubi_exit(void);
Joe Hershberger92198452013-04-08 10:32:47 +000051extern int ubi_part(char *part_name, const char *vid_header_offset);
52extern int ubi_volume_write(char *volume, void *buf, size_t size);
53extern int ubi_volume_read(char *volume, char *buf, size_t size);
Kyungmin Parkad7ae362008-11-19 16:32:36 +010054
55extern struct ubi_device *ubi_devices[];
Tien Fong Cheebb7387f2018-07-06 16:26:01 +080056int cmd_ubifs_mount(char *vol_name);
Tien Fong Cheedbc9d852018-07-06 16:25:12 +080057int cmd_ubifs_umount(void);
Kyungmin Parkad7ae362008-11-19 16:32:36 +010058
59#endif