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