[U-Boot] [PATCH] [UBI] Basic Unsorted Block Image (UBI) support v3 (#5)
Magnus Lilja
lilja.magnus at gmail.com
Sun Nov 2 22:01:59 CET 2008
Dear Kyungmin Park,
2008/10/28 Kyungmin Park <kmpark at infradead.org>:
> UBI (Latin: "where?") stands for "Unsorted Block Images". It is a volume management system for flash devices which manages multiple logical volumes on a single physical flash device and spreads the I/O load (i.e, wear-leveling) across the whole flash chip.
>
> In a sense, UBI may be compared to the Logical Volume Manager (LVM). Whereas LVM maps logical sectors to physical sectors, UBI maps logical eraseblocks to physical eraseblocks. But besides the mapping, UBI implements global wear-leveling and I/O errors handling.
>
> For more details, Please visit the following URL.
> http://www.linux-mtd.infradead.org/doc/ubi.html
>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> ---
> diff --git a/include/ubi_uboot.h b/include/ubi_uboot.h
> new file mode 100644
> index 0000000..b4b2fa2
> --- /dev/null
> +++ b/include/ubi_uboot.h
> @@ -0,0 +1,218 @@
> +/*
> + * Header file for UBI support for U-Boot
> + *
> + * Adaptation from kernel to U-Boot
> + *
> + * Copyright (C) 2005-2007 Samsung Electronics
> + * Kyungmin Park <kyungmin.park at samsung.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef __UBOOT_UBI_H
> +#define __UBOOT_UBI_H
> +
> +#include <common.h>
> +#include <malloc.h>
> +#include <div64.h>
> +#include <linux/crc32.h>
> +#include <linux/mtd/mtd.h>
> +
> +#ifdef CONFIG_CMD_ONENAND
> +#include <onenand_uboot.h>
> +#endif
> +
> +#include <asm/errno.h>
> +
> +#define DPRINTK(format, args...) \
> +do { \
> + printf("%s[%d]: " format "\n", __func__, __LINE__, ##args); \
> +} while (0)
> +
> +/* configurable */
> +#define CONFIG_MTD_UBI_WL_THRESHOLD 4096
> +#define CONFIG_MTD_UBI_BEB_RESERVE 1
> +#define UBI_IO_DEBUG 0
> +
> +/* #define CONFIG_MTD_UBI_DEBUG */
> +/* #define CONFIG_MTD_UBI_DEBUG_PARANOID */
> +
> +#define CONFIG_MTD_UBI_DEBUG_DISABLE_BGT
> +/* #define CONFIG_MTD_UBI_DEBUG_MSG */
> +/* #define CONFIG_MTD_UBI_DEBUG_MSG_EBA */
> +/* #define CONFIG_MTD_UBI_DEBUG_MSG_WL */
> +/* #define CONFIG_MTD_UBI_DEBUG_MSG_IO */
> +/* #define CONFIG_MTD_UBI_DEBUG_MSG_BLD */
These configs should be documented somewhere, e.g. in doc/README.ubi .
Regards, Magnus
More information about the U-Boot
mailing list