[PATCH linux] FSI: Initial stubs for device driver

Christopher Bostic cbostic at us.ibm.com
Wed Jun 22 01:21:45 AEST 2016




From: Christopher Bostic <cbostic at us.ibm.com>
Date: Thu, 9 Jun 2016 13:42:59 -0500

Initial FSI device driver stubs

---
 drivers/Makefile      |  1 +
 drivers/fsi/Makefile  |  5 +++++
 drivers/fsi/fsiinit.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++
++++
 drivers/fsi/fsiinit.h | 45 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 105 insertions(+)
 create mode 100644 drivers/fsi/Makefile
 create mode 100644 drivers/fsi/fsiinit.c
 create mode 100644 drivers/fsi/fsiinit.h

diff --git a/drivers/Makefile b/drivers/Makefile
index 795d0ca..8ea7c58 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -172,3 +172,4 @@ obj-$(CONFIG_STM)        += hwtracing/stm/
 obj-$(CONFIG_ANDROID)        += android/
 obj-$(CONFIG_NVMEM)        += nvmem/
 obj-$(CONFIG_FPGA)        += fpga/
+obj-$(CONFIG_FSI)        += fsi/
diff --git a/drivers/fsi/Makefile b/drivers/fsi/Makefile
new file mode 100644
index 0000000..f547c08
--- /dev/null
+++ b/drivers/fsi/Makefile
@@ -0,0 +1,5 @@
+#
+# Makefile for the FSI bus specific drivers.
+#
+
+obj-y        += fsiinit.o
diff --git a/drivers/fsi/fsiinit.c b/drivers/fsi/fsiinit.c
new file mode 100644
index 0000000..d7902d8
--- /dev/null
+++ b/drivers/fsi/fsiinit.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) International Business Machines Corp., 2012
+ *
+ * FSI Master device driver
+ *
+ * Thomas Richter, IBM Boeblingen, Germany, 17-Jun-2010
+ * Christopher Bostic, IBM Austin, TX  2016
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include "fsiinit.h"
+
+MODULE_AUTHOR("Christopher Bostic cbostic at us.ibm.com");
+MODULE_DESCRIPTION("FSI master device driver");
+
+#define FSIDD_MAJOR    0        /* FSI device driver major */
+#define    FSIDD_TOSTR(x)    #x
+#define    FSIDD_VERNO    4000
+#define    FSIDD_VER(x)    FSIDD_TOSTR(x)
+
+struct fsidd fsidd = {        /* FSI device driver structure definition */
+    .magic = FSI_DD_MAGIC,
+    .strno = FSI_DD_STRNO,
+};
+
+
+static int fsi_start(void)
+{
+    int rc = 0;
+
+
+    printk("FSI DD %s installation ok\n", fsidd.vstr);
+    return rc;
+}
+
+static void fsi_exit(void)
+{
+
+}
+
+static int __init fsi_init(void)
+{
+    int rc = 0;
+
+    /* Set up the host controller */
+    fsi_start();
+    return rc;
+}
+
+module_init(fsi_init);
+module_exit(fsi_exit);
+
diff --git a/drivers/fsi/fsiinit.h b/drivers/fsi/fsiinit.h
new file mode 100644
index 0000000..2383610
--- /dev/null
+++ b/drivers/fsi/fsiinit.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) International Business Machines Corp., 2010
+ *
+ * FSI Master device driver
+ *
+ * Thomas Richter, IBM Boeblingen, Germany, Jun-2010
+ * Christopher Bostic, IBM Austin, TX 2013
+ *
+ *
+ * Structure definitions and defines.
+ */
+
+#ifndef DRIVERS_FSIINIT_H
+#define DRIVERS_FSIINIT_H
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/kobject.h>
+#include <linux/workqueue.h>
+#include <linux/hrtimer.h>
+
+#define VSTRLEN        32        /* Version string length */
+
+enum {
+    FSI_DD_MAGIC = 0x64644632,    /* ddF2 */
+    FSI_DD_STRNO = 0x1        /* Structure version number */
+};
+
+struct fsidd {                /* FSI Main structure */
+    unsigned long magic;        /* Magic number */
+    unsigned long strno;        /* Structure version number */
+    char vstr[VSTRLEN];        /* Version string */
+    dev_t major;            /* Major number of device */
+    struct workqueue_struct *hotp_wq;    /* Hot plug work queue */
+    wait_queue_head_t error_wq;    /* Wait queue for port errors */
+    wait_queue_head_t lbus_wq;    /* Wait queue for lbus events */
+    wait_queue_head_t irq_wq;    /* Wait queue for IRQ loops */
+    wait_queue_head_t link_wq;    /* Wait queue for link changes */
+    unsigned long state;        /* State driver is in */
+    struct kobject kobj;        /* Anchor point in /sys/kernel */
+};
+
+#define    to_fsidd(a)        container_of(a, struct fsidd, kobj)
+
+#endif /* DRIVERS_FSIINIT_H */
--
1.8.2.2


                                                                                     
                                                                                     
                                                                                     
  Christopher L Bostic                                                           IBM 
                                                                                     
  Phone: 1-512-286-5411 | Tie-Line: 363-5411                                         
                                                                                     
  Enterprise Systems Group - Power Firmware                                          
  Service Processor Microcode Development  Dept 3ALS                                 
  11400 Burnet Road                                                                  
  Austin, TX 78759                                                                   
                                                                                     
                                                                                     



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20160621/aa70b8cd/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 14810419.gif
Type: image/gif
Size: 1851 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20160621/aa70b8cd/attachment-0001.gif>


More information about the openbmc mailing list