Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
0002 /*
0003  * Copyright 2017 IBM Corp.
0004  *
0005  * This program is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU General Public License
0007  * as published by the Free Software Foundation; either version
0008  * 2 of the License, or (at your option) any later version.
0009  */
0010 
0011 #ifndef _UAPI_LINUX_ASPEED_LPC_CTRL_H
0012 #define _UAPI_LINUX_ASPEED_LPC_CTRL_H
0013 
0014 #include <linux/ioctl.h>
0015 #include <linux/types.h>
0016 
0017 /* Window types */
0018 #define ASPEED_LPC_CTRL_WINDOW_FLASH    1
0019 #define ASPEED_LPC_CTRL_WINDOW_MEMORY   2
0020 
0021 /*
0022  * This driver provides a window for the host to access a BMC resource
0023  * across the BMC <-> Host LPC bus.
0024  *
0025  * window_type: The BMC resource that the host will access through the
0026  * window. BMC flash and BMC RAM.
0027  *
0028  * window_id: For each window type there may be multiple windows,
0029  * these are referenced by ID.
0030  *
0031  * flags: Reserved for future use, this field is expected to be
0032  * zeroed.
0033  *
0034  * addr: Address on the host LPC bus that the specified window should
0035  * be mapped. This address must be power of two aligned.
0036  *
0037  * offset: Offset into the BMC window that should be mapped to the
0038  * host (at addr). This must be a multiple of size.
0039  *
0040  * size: The size of the mapping. The smallest possible size is 64K.
0041  * This must be power of two aligned.
0042  *
0043  */
0044 
0045 struct aspeed_lpc_ctrl_mapping {
0046     __u8    window_type;
0047     __u8    window_id;
0048     __u16   flags;
0049     __u32   addr;
0050     __u32   offset;
0051     __u32   size;
0052 };
0053 
0054 #define __ASPEED_LPC_CTRL_IOCTL_MAGIC   0xb2
0055 
0056 #define ASPEED_LPC_CTRL_IOCTL_GET_SIZE  _IOWR(__ASPEED_LPC_CTRL_IOCTL_MAGIC, \
0057         0x00, struct aspeed_lpc_ctrl_mapping)
0058 
0059 #define ASPEED_LPC_CTRL_IOCTL_MAP   _IOW(__ASPEED_LPC_CTRL_IOCTL_MAGIC, \
0060         0x01, struct aspeed_lpc_ctrl_mapping)
0061 
0062 #endif /* _UAPI_LINUX_ASPEED_LPC_CTRL_H */