ubi_uboot.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 <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. #ifndef __UBOOT_UBI_H
  14. #define __UBOOT_UBI_H
  15. #include <common.h>
  16. #include <compiler.h>
  17. #include <linux/compat.h>
  18. #include <malloc.h>
  19. #include <div64.h>
  20. #include <linux/math64.h>
  21. #include <linux/crc32.h>
  22. #include <linux/types.h>
  23. #include <linux/list.h>
  24. #include <linux/rbtree.h>
  25. #include <linux/string.h>
  26. #include <linux/mtd/mtd.h>
  27. #include <linux/mtd/ubi.h>
  28. #ifdef CONFIG_CMD_ONENAND
  29. #include <onenand_uboot.h>
  30. #endif
  31. #include <linux/errno.h>
  32. /* configurable */
  33. #define CONFIG_MTD_UBI_BEB_RESERVE 1
  34. /* debug options (Linux: drivers/mtd/ubi/Kconfig.debug) */
  35. #undef CONFIG_MTD_UBI_DEBUG
  36. #undef CONFIG_MTD_UBI_DEBUG_PARANOID
  37. #undef CONFIG_MTD_UBI_DEBUG_MSG
  38. #undef CONFIG_MTD_UBI_DEBUG_MSG_EBA
  39. #undef CONFIG_MTD_UBI_DEBUG_MSG_WL
  40. #undef CONFIG_MTD_UBI_DEBUG_MSG_IO
  41. #undef CONFIG_MTD_UBI_DEBUG_MSG_BLD
  42. #undef CONFIG_MTD_UBI_BLOCK
  43. /* ubi_init() disables returning error codes when built into the Linux
  44. * kernel so that it doesn't hang the Linux kernel boot process. Since
  45. * the U-Boot driver code depends on getting valid error codes from this
  46. * function we just tell the UBI layer that we are building as a module
  47. * (which only enables the additional error reporting).
  48. */
  49. #define CONFIG_MTD_UBI_MODULE
  50. /* build.c */
  51. #define get_device(...)
  52. #define put_device(...)
  53. #define ubi_sysfs_init(...) 0
  54. #define ubi_sysfs_close(...) do { } while (0)
  55. #ifndef __UBIFS_H__
  56. #include "../drivers/mtd/ubi/ubi.h"
  57. #endif
  58. /* functions */
  59. extern int ubi_mtd_param_parse(const char *val, struct kernel_param *kp);
  60. extern int ubi_init(void);
  61. extern void ubi_exit(void);
  62. extern int ubi_part(char *part_name, const char *vid_header_offset);
  63. extern int ubi_volume_write(char *volume, void *buf, size_t size);
  64. extern int ubi_volume_read(char *volume, char *buf, size_t size);
  65. extern struct ubi_device *ubi_devices[];
  66. int cmd_ubifs_mount(char *vol_name);
  67. int cmd_ubifs_umount(void);
  68. #endif