yamon-dt.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2016 Imagination Technologies
  4. * Author: Paul Burton <[email protected]>
  5. */
  6. #ifndef __MIPS_ASM_YAMON_DT_H__
  7. #define __MIPS_ASM_YAMON_DT_H__
  8. #include <linux/types.h>
  9. /**
  10. * struct yamon_mem_region - Represents a contiguous range of physical RAM.
  11. * @start: Start physical address.
  12. * @size: Maximum size of region.
  13. * @discard: Length of additional memory to discard after the region.
  14. */
  15. struct yamon_mem_region {
  16. phys_addr_t start;
  17. phys_addr_t size;
  18. phys_addr_t discard;
  19. };
  20. /**
  21. * yamon_dt_append_cmdline() - Append YAMON-provided command line to /chosen
  22. * @fdt: the FDT blob
  23. *
  24. * Write the YAMON-provided command line to the bootargs property of the
  25. * /chosen node in @fdt.
  26. *
  27. * Return: 0 on success, else -errno
  28. */
  29. extern __init int yamon_dt_append_cmdline(void *fdt);
  30. /**
  31. * yamon_dt_append_memory() - Append YAMON-provided memory info to /memory
  32. * @fdt: the FDT blob
  33. * @regions: zero size terminated array of physical memory regions
  34. *
  35. * Generate a /memory node in @fdt based upon memory size information provided
  36. * by YAMON in its environment and the @regions array.
  37. *
  38. * Return: 0 on success, else -errno
  39. */
  40. extern __init int yamon_dt_append_memory(void *fdt,
  41. const struct yamon_mem_region *regions);
  42. /**
  43. * yamon_dt_serial_config() - Append YAMON-provided serial config to /chosen
  44. * @fdt: the FDT blob
  45. *
  46. * Generate a stdout-path property in the /chosen node of @fdt, based upon
  47. * information provided in the YAMON environment about the UART configuration
  48. * of the system.
  49. *
  50. * Return: 0 on success, else -errno
  51. */
  52. extern __init int yamon_dt_serial_config(void *fdt);
  53. #endif /* __MIPS_ASM_YAMON_DT_H__ */