yamon-dt.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2016 Imagination Technologies
  3. * Author: Paul Burton <paul.burton@mips.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version.
  9. */
  10. #ifndef __MIPS_ASM_YAMON_DT_H__
  11. #define __MIPS_ASM_YAMON_DT_H__
  12. #include <linux/types.h>
  13. /**
  14. * struct yamon_mem_region - Represents a contiguous range of physical RAM.
  15. * @start: Start physical address.
  16. * @size: Maximum size of region.
  17. * @discard: Length of additional memory to discard after the region.
  18. */
  19. struct yamon_mem_region {
  20. phys_addr_t start;
  21. phys_addr_t size;
  22. phys_addr_t discard;
  23. };
  24. /**
  25. * yamon_dt_append_cmdline() - Append YAMON-provided command line to /chosen
  26. * @fdt: the FDT blob
  27. *
  28. * Write the YAMON-provided command line to the bootargs property of the
  29. * /chosen node in @fdt.
  30. *
  31. * Return: 0 on success, else -errno
  32. */
  33. extern __init int yamon_dt_append_cmdline(void *fdt);
  34. /**
  35. * yamon_dt_append_memory() - Append YAMON-provided memory info to /memory
  36. * @fdt: the FDT blob
  37. * @regions: zero size terminated array of physical memory regions
  38. *
  39. * Generate a /memory node in @fdt based upon memory size information provided
  40. * by YAMON in its environment and the @regions array.
  41. *
  42. * Return: 0 on success, else -errno
  43. */
  44. extern __init int yamon_dt_append_memory(void *fdt,
  45. const struct yamon_mem_region *regions);
  46. /**
  47. * yamon_dt_serial_config() - Append YAMON-provided serial config to /chosen
  48. * @fdt: the FDT blob
  49. *
  50. * Generate a stdout-path property in the /chosen node of @fdt, based upon
  51. * information provided in the YAMON environment about the UART configuration
  52. * of the system.
  53. *
  54. * Return: 0 on success, else -errno
  55. */
  56. extern __init int yamon_dt_serial_config(void *fdt);
  57. #endif /* __MIPS_ASM_YAMON_DT_H__ */