qcom_dt_parser.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef _QCOM_DT_PARSER_H
  7. #define _QCOM_DT_PARSER_H
  8. #include <linux/device.h>
  9. #include <linux/platform_device.h>
  10. /**
  11. * struct platform_heap - defines a heap in the given platform
  12. * @type: type of the heap
  13. * @name: used for debug purposes
  14. * @base: base address of heap in physical memory if applicable
  15. * @size: size of the heap in bytes if applicable
  16. * @dev: the device associated with the heap's DT node
  17. * @is_dynamic: indicates if memory can be added or removed from carveout heaps
  18. * is_nomap: indicates if this heap is assosicated with a memory region which is
  19. * which has no-map property.
  20. * is_uncached: indicates if this heap provides uncached memory or not
  21. * @token: the end points to which memory for secure carveout memory is
  22. * assigned to
  23. * @max_align: page order of the maximum alignment. Used by cma heap.
  24. *
  25. * Provided by the board file.
  26. */
  27. struct platform_heap {
  28. u32 type;
  29. const char *name;
  30. phys_addr_t base;
  31. size_t size;
  32. struct device *dev;
  33. bool is_uncached;
  34. bool is_nomap;
  35. u32 token;
  36. u32 max_align;
  37. };
  38. /**
  39. * struct platform_data - array of platform heaps passed from board file
  40. * @nr: number of structures in the array
  41. * @heaps: array of platform_heap structions
  42. *
  43. * Provided by the board file in the form of platform data to a platform device.
  44. */
  45. struct platform_data {
  46. int nr;
  47. struct platform_heap *heaps;
  48. };
  49. struct platform_data *parse_heap_dt(struct platform_device *pdev);
  50. void free_pdata(const struct platform_data *pdata);
  51. #endif /* _QCOM_DT_PARSER_H */