@@ -111,4 +111,6 @@ source "drivers/xen/Kconfig"
source "drivers/staging/Kconfig"
source "drivers/platform/Kconfig"
+
+source "drivers/fpga/Kconfig"
endmenu
@@ -115,3 +115,4 @@ obj-$(CONFIG_VLYNQ) += vlynq/
obj-$(CONFIG_STAGING) += staging/
obj-y += platform/
obj-y += ieee802154/
+obj-$(CONFIG_FPGA_DRIVERS) += fpga/
new file mode 100644
@@ -0,0 +1 @@
+source "drivers/fpga/carma/Kconfig"
new file mode 100644
@@ -0,0 +1 @@
+obj-y += carma/
new file mode 100644
@@ -0,0 +1,21 @@
+
+menuconfig FPGA_DRIVERS
+ bool "FPGA Drivers"
+ default n
+ help
+ Say Y here to see options for devices used with custom FPGAs.
+ This option alone does not add any kernel code.
+
+ If you say N, all options in this submenu will be skipped and disabled.
+
+if FPGA_DRIVERS
+
+config CARMA
+ tristate "CARMA System Controller FPGA support"
+ depends on FSL_SOC && PPC_83xx
+ default n
+ help
+ Say Y here to include basic support for the CARMA System Controller
+ FPGA. This option allows the other more advanced drivers to be built.
+
+endif # FPGA_DRIVERS
new file mode 100644
@@ -0,0 +1 @@
+obj-$(CONFIG_CARMA) += carma.o
new file mode 100644
@@ -0,0 +1,73 @@
+/*
+ * CARMA Board Utility Driver
+ *
+ * Copyright (c) 2009-2010 Ira W. Snyder <iws@ovro.caltech.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/err.h>
+
+#include "carma.h"
+
+static struct class *carma_class;
+static const char drv_name[] = "carma";
+
+/*
+ * CARMA Device Class Functions
+ */
+
+struct device *carma_device_create(struct device *parent, dev_t devno,
+ const char *fmt, ...)
+{
+ struct device *dev;
+ va_list vargs;
+
+ va_start(vargs, fmt);
+ dev = device_create_vargs(carma_class, parent, devno, NULL, fmt, vargs);
+ va_end(vargs);
+
+ return dev;
+}
+EXPORT_SYMBOL_GPL(carma_device_create);
+
+void carma_device_destroy(dev_t devno)
+{
+ device_destroy(carma_class, devno);
+}
+EXPORT_SYMBOL_GPL(carma_device_destroy);
+
+/*
+ * Module Init / Exit
+ */
+
+static int __init carma_init(void)
+{
+ /* Register the CARMA device class */
+ carma_class = class_create(THIS_MODULE, "carma");
+ if (IS_ERR(carma_class)) {
+ pr_err("%s: unable to create CARMA class\n", drv_name);
+ return PTR_ERR(carma_class);
+ }
+
+ return 0;
+}
+
+static void __exit carma_exit(void)
+{
+ class_destroy(carma_class);
+}
+
+MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>");
+MODULE_DESCRIPTION("CARMA Device Class Driver");
+MODULE_LICENSE("GPL");
+
+module_init(carma_init);
+module_exit(carma_exit);
new file mode 100644
@@ -0,0 +1,22 @@
+/*
+ * CARMA Board Utilities
+ *
+ * Copyright (c) 2009-2010 Ira W. Snyder <iws@ovro.caltech.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#ifndef CARMA_DEVICE_H
+#define CARMA_DEVICE_H
+
+#include <linux/device.h>
+
+struct device *carma_device_create(struct device *parent, dev_t devno,
+ const char *fmt, ...)
+ __attribute__((format(printf, 3, 4)));
+void carma_device_destroy(dev_t devno);
+
+#endif /* CARMA_DEVICE_H */
This adds basic support for the system controller FPGA on the OVRO CARMA board. This patch only adds infrastructure that will be used by later drivers. Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu> --- drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/fpga/Kconfig | 1 + drivers/fpga/Makefile | 1 + drivers/fpga/carma/Kconfig | 21 ++++++++++++ drivers/fpga/carma/Makefile | 1 + drivers/fpga/carma/carma.c | 73 +++++++++++++++++++++++++++++++++++++++++++ drivers/fpga/carma/carma.h | 22 +++++++++++++ 8 files changed, 122 insertions(+), 0 deletions(-) create mode 100644 drivers/fpga/Kconfig create mode 100644 drivers/fpga/Makefile create mode 100644 drivers/fpga/carma/Kconfig create mode 100644 drivers/fpga/carma/Makefile create mode 100644 drivers/fpga/carma/carma.c create mode 100644 drivers/fpga/carma/carma.h