diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2012-08-28 10:46:26 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-09-26 09:44:59 -0400 |
commit | 1d1c8f78bed5f8e769757525bd9c2dec69f11a44 (patch) | |
tree | 75f1ef4eb3836975e46a86fad456e8bafa1a5ffe /arch | |
parent | 184b08afb5eab8a43d75f4aa0a0f912653f797d7 (diff) |
s390: add scm bus driver
Bus driver to manage Storage Class Memory.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/Kconfig | 7 | ||||
-rw-r--r-- | arch/s390/include/asm/eadm.h | 51 |
2 files changed, 58 insertions, 0 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 443fac9f1649..3781db22f427 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -433,6 +433,13 @@ config CHSC_SCH | |||
433 | 433 | ||
434 | If unsure, say N. | 434 | If unsure, say N. |
435 | 435 | ||
436 | config SCM_BUS | ||
437 | def_bool y | ||
438 | depends on 64BIT | ||
439 | prompt "SCM bus driver" | ||
440 | help | ||
441 | Bus driver for Storage Class Memory. | ||
442 | |||
436 | endmenu | 443 | endmenu |
437 | 444 | ||
438 | menu "Dump support" | 445 | menu "Dump support" |
diff --git a/arch/s390/include/asm/eadm.h b/arch/s390/include/asm/eadm.h index 4a65803baa08..3922f5257172 100644 --- a/arch/s390/include/asm/eadm.h +++ b/arch/s390/include/asm/eadm.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define _ASM_S390_EADM_H | 2 | #define _ASM_S390_EADM_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/device.h> | ||
6 | #include <linux/spinlock.h> | ||
5 | 7 | ||
6 | struct arqb { | 8 | struct arqb { |
7 | u64 data; | 9 | u64 data; |
@@ -71,4 +73,53 @@ struct aob { | |||
71 | struct msb msb[AOB_NR_MSB]; | 73 | struct msb msb[AOB_NR_MSB]; |
72 | } __packed __aligned(PAGE_SIZE); | 74 | } __packed __aligned(PAGE_SIZE); |
73 | 75 | ||
76 | struct aob_rq_header { | ||
77 | struct scm_device *scmdev; | ||
78 | char data[0]; | ||
79 | }; | ||
80 | |||
81 | struct scm_device { | ||
82 | u64 address; | ||
83 | u64 size; | ||
84 | unsigned int nr_max_block; | ||
85 | struct device dev; | ||
86 | spinlock_t lock; | ||
87 | struct { | ||
88 | unsigned int persistence:4; | ||
89 | unsigned int oper_state:4; | ||
90 | unsigned int data_state:4; | ||
91 | unsigned int rank:4; | ||
92 | unsigned int release:1; | ||
93 | unsigned int res_id:8; | ||
94 | } __packed attrs; | ||
95 | }; | ||
96 | |||
97 | #define OP_STATE_GOOD 1 | ||
98 | #define OP_STATE_TEMP_ERR 2 | ||
99 | #define OP_STATE_PERM_ERR 3 | ||
100 | |||
101 | struct scm_driver { | ||
102 | struct device_driver drv; | ||
103 | int (*probe) (struct scm_device *scmdev); | ||
104 | int (*remove) (struct scm_device *scmdev); | ||
105 | void (*handler) (struct scm_device *scmdev, void *data, int error); | ||
106 | }; | ||
107 | |||
108 | int scm_driver_register(struct scm_driver *scmdrv); | ||
109 | void scm_driver_unregister(struct scm_driver *scmdrv); | ||
110 | |||
111 | int scm_start_aob(struct aob *aob); | ||
112 | void scm_irq_handler(struct aob *aob, int error); | ||
113 | |||
114 | struct eadm_ops { | ||
115 | int (*eadm_start) (struct aob *aob); | ||
116 | struct module *owner; | ||
117 | }; | ||
118 | |||
119 | int scm_get_ref(void); | ||
120 | void scm_put_ref(void); | ||
121 | |||
122 | void register_eadm_ops(struct eadm_ops *ops); | ||
123 | void unregister_eadm_ops(struct eadm_ops *ops); | ||
124 | |||
74 | #endif /* _ASM_S390_EADM_H */ | 125 | #endif /* _ASM_S390_EADM_H */ |