fs_loader.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (C) 2018 Intel Corporation <www.intel.com>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0
  5. */
  6. #ifndef _FS_LOADER_H_
  7. #define _FS_LOADER_H_
  8. #include <dm.h>
  9. /**
  10. * struct phandle_part - A place for storing phandle of node and its partition
  11. *
  12. * This holds information about a phandle of the block device, and its
  13. * partition where the firmware would be loaded from.
  14. *
  15. * @phandle: Phandle of storage device node
  16. * @partition: Partition of block device
  17. */
  18. struct phandle_part {
  19. u32 phandle;
  20. u32 partition;
  21. };
  22. /**
  23. * struct phandle_part - A place for storing all supported storage devices
  24. *
  25. * This holds information about all supported storage devices for driver use.
  26. *
  27. * @phandlepart: Attribute data for block device.
  28. * @mtdpart: MTD partition for ubi partition.
  29. * @ubivol: UBI volume-name for ubifsmount.
  30. */
  31. struct device_platdata {
  32. struct phandle_part phandlepart;
  33. char *mtdpart;
  34. char *ubivol;
  35. };
  36. /**
  37. * request_firmware_into_buf - Load firmware into a previously allocated buffer.
  38. * @dev: An instance of a driver.
  39. * @name: Name of firmware file.
  40. * @buf: Address of buffer to load firmware into.
  41. * @size: Size of buffer.
  42. * @offset: Offset of a file for start reading into buffer.
  43. *
  44. * The firmware is loaded directly into the buffer pointed to by @buf.
  45. *
  46. * Return: Size of total read, negative value when error.
  47. */
  48. int request_firmware_into_buf(struct udevice *dev,
  49. const char *name,
  50. void *buf, size_t size, u32 offset);
  51. #endif