aspeed-lpc-ctrl.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * Copyright 2017 IBM Corp.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version
  8. * 2 of the License, or (at your option) any later version.
  9. */
  10. #ifndef _UAPI_LINUX_ASPEED_LPC_CTRL_H
  11. #define _UAPI_LINUX_ASPEED_LPC_CTRL_H
  12. #include <linux/ioctl.h>
  13. #include <linux/types.h>
  14. /* Window types */
  15. #define ASPEED_LPC_CTRL_WINDOW_FLASH 1
  16. #define ASPEED_LPC_CTRL_WINDOW_MEMORY 2
  17. /*
  18. * This driver provides a window for the host to access a BMC resource
  19. * across the BMC <-> Host LPC bus.
  20. *
  21. * window_type: The BMC resource that the host will access through the
  22. * window. BMC flash and BMC RAM.
  23. *
  24. * window_id: For each window type there may be multiple windows,
  25. * these are referenced by ID.
  26. *
  27. * flags: Reserved for future use, this field is expected to be
  28. * zeroed.
  29. *
  30. * addr: Address on the host LPC bus that the specified window should
  31. * be mapped. This address must be power of two aligned.
  32. *
  33. * offset: Offset into the BMC window that should be mapped to the
  34. * host (at addr). This must be a multiple of size.
  35. *
  36. * size: The size of the mapping. The smallest possible size is 64K.
  37. * This must be power of two aligned.
  38. *
  39. */
  40. struct aspeed_lpc_ctrl_mapping {
  41. __u8 window_type;
  42. __u8 window_id;
  43. __u16 flags;
  44. __u32 addr;
  45. __u32 offset;
  46. __u32 size;
  47. };
  48. #define __ASPEED_LPC_CTRL_IOCTL_MAGIC 0xb2
  49. #define ASPEED_LPC_CTRL_IOCTL_GET_SIZE _IOWR(__ASPEED_LPC_CTRL_IOCTL_MAGIC, \
  50. 0x00, struct aspeed_lpc_ctrl_mapping)
  51. #define ASPEED_LPC_CTRL_IOCTL_MAP _IOW(__ASPEED_LPC_CTRL_IOCTL_MAGIC, \
  52. 0x01, struct aspeed_lpc_ctrl_mapping)
  53. #endif /* _UAPI_LINUX_ASPEED_LPC_CTRL_H */