1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * dcdbas.h: Definitions for Dell Systems Management Base driver
5 * Copyright (C) 1995-2005 Dell Inc.
11 #include <linux/device.h>
12 #include <linux/sysfs.h>
13 #include <linux/types.h>
15 #define MAX_SMI_DATA_BUF_SIZE (256 * 1024)
17 #define HC_ACTION_NONE (0)
18 #define HC_ACTION_HOST_CONTROL_POWEROFF BIT(1)
19 #define HC_ACTION_HOST_CONTROL_POWERCYCLE BIT(2)
21 #define HC_SMITYPE_NONE (0)
22 #define HC_SMITYPE_TYPE1 (1)
23 #define HC_SMITYPE_TYPE2 (2)
24 #define HC_SMITYPE_TYPE3 (3)
26 #define ESM_APM_CMD (0x0A0)
27 #define ESM_APM_POWER_CYCLE (0x10)
28 #define ESM_STATUS_CMD_UNSUCCESSFUL (-1)
30 #define CMOS_BASE_PORT (0x070)
31 #define CMOS_PAGE1_INDEX_PORT (0)
32 #define CMOS_PAGE1_DATA_PORT (1)
33 #define CMOS_PAGE2_INDEX_PORT_PIIX4 (2)
34 #define CMOS_PAGE2_DATA_PORT_PIIX4 (3)
35 #define PE1400_APM_CONTROL_PORT (0x0B0)
36 #define PCAT_APM_CONTROL_PORT (0x0B2)
37 #define PCAT_APM_STATUS_PORT (0x0B3)
38 #define PE1300_CMOS_CMD_STRUCT_PTR (0x38)
39 #define PE1400_CMOS_CMD_STRUCT_PTR (0x70)
41 #define MAX_SYSMGMT_SHORTCMD_PARMBUF_LEN (14)
42 #define MAX_SYSMGMT_LONGCMD_SGENTRY_NUM (16)
44 #define TIMEOUT_USEC_SHORT_SEMA_BLOCKING (10000)
45 #define EXPIRED_TIMER (0)
47 #define SMI_CMD_MAGIC (0x534D4931)
48 #define SMM_EPS_SIG "$SCB"
50 #define DCDBAS_DEV_ATTR_RW(_name) \
51 DEVICE_ATTR(_name,0600,_name##_show,_name##_store);
53 #define DCDBAS_DEV_ATTR_RO(_name) \
54 DEVICE_ATTR(_name,0400,_name##_show,NULL);
56 #define DCDBAS_DEV_ATTR_WO(_name) \
57 DEVICE_ATTR(_name,0200,NULL,_name##_store);
59 #define DCDBAS_BIN_ATTR_RW(_name) \
60 struct bin_attribute bin_attr_##_name = { \
61 .attr = { .name = __stringify(_name), \
63 .read = _name##_read, \
64 .write = _name##_write, \
71 __u16 command_address
;
74 __u8 command_buffer
[1];
75 } __attribute__ ((packed
));
83 __u8 parm
[MAX_SYSMGMT_SHORTCMD_PARMBUF_LEN
];
84 } __attribute__ ((packed
)) shortreq
;
91 } __attribute__ ((packed
))
92 sglist
[MAX_SYSMGMT_LONGCMD_SGENTRY_NUM
];
93 } __attribute__ ((packed
)) longreq
;
94 } __attribute__ ((packed
)) parameters
;
95 } __attribute__ ((packed
));
97 int dcdbas_smi_request(struct smi_cmd
*smi_cmd
);
99 struct smm_eps_table
{
100 char smm_comm_buff_anchor
[4];
104 u64 smm_comm_buff_addr
;
108 #endif /* _DCDBAS_H_ */