summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2012-08-28 16:46:26 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-09-26 15:44:59 +0200
commit1d1c8f78bed5f8e769757525bd9c2dec69f11a44 (patch)
tree75f1ef4eb3836975e46a86fad456e8bafa1a5ffe /arch/s390
parent184b08afb5eab8a43d75f4aa0a0f912653f797d7 (diff)
downloadop-kernel-dev-1d1c8f78bed5f8e769757525bd9c2dec69f11a44.zip
op-kernel-dev-1d1c8f78bed5f8e769757525bd9c2dec69f11a44.tar.gz
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/s390')
-rw-r--r--arch/s390/Kconfig7
-rw-r--r--arch/s390/include/asm/eadm.h51
2 files changed, 58 insertions, 0 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 443fac9..3781db2 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -433,6 +433,13 @@ config CHSC_SCH
If unsure, say N.
+config SCM_BUS
+ def_bool y
+ depends on 64BIT
+ prompt "SCM bus driver"
+ help
+ Bus driver for Storage Class Memory.
+
endmenu
menu "Dump support"
diff --git a/arch/s390/include/asm/eadm.h b/arch/s390/include/asm/eadm.h
index 4a65803..3922f52 100644
--- a/arch/s390/include/asm/eadm.h
+++ b/arch/s390/include/asm/eadm.h
@@ -2,6 +2,8 @@
#define _ASM_S390_EADM_H
#include <linux/types.h>
+#include <linux/device.h>
+#include <linux/spinlock.h>
struct arqb {
u64 data;
@@ -71,4 +73,53 @@ struct aob {
struct msb msb[AOB_NR_MSB];
} __packed __aligned(PAGE_SIZE);
+struct aob_rq_header {
+ struct scm_device *scmdev;
+ char data[0];
+};
+
+struct scm_device {
+ u64 address;
+ u64 size;
+ unsigned int nr_max_block;
+ struct device dev;
+ spinlock_t lock;
+ struct {
+ unsigned int persistence:4;
+ unsigned int oper_state:4;
+ unsigned int data_state:4;
+ unsigned int rank:4;
+ unsigned int release:1;
+ unsigned int res_id:8;
+ } __packed attrs;
+};
+
+#define OP_STATE_GOOD 1
+#define OP_STATE_TEMP_ERR 2
+#define OP_STATE_PERM_ERR 3
+
+struct scm_driver {
+ struct device_driver drv;
+ int (*probe) (struct scm_device *scmdev);
+ int (*remove) (struct scm_device *scmdev);
+ void (*handler) (struct scm_device *scmdev, void *data, int error);
+};
+
+int scm_driver_register(struct scm_driver *scmdrv);
+void scm_driver_unregister(struct scm_driver *scmdrv);
+
+int scm_start_aob(struct aob *aob);
+void scm_irq_handler(struct aob *aob, int error);
+
+struct eadm_ops {
+ int (*eadm_start) (struct aob *aob);
+ struct module *owner;
+};
+
+int scm_get_ref(void);
+void scm_put_ref(void);
+
+void register_eadm_ops(struct eadm_ops *ops);
+void unregister_eadm_ops(struct eadm_ops *ops);
+
#endif /* _ASM_S390_EADM_H */
OpenPOWER on IntegriCloud