[PATCH linux dev-4.7 1/5] drivers/fsi: Add MFSI a.k.a. hub master device driver
Eddie James
eajames at linux.vnet.ibm.com
Fri Feb 17 10:04:24 AEDT 2017
Acked-by: Eddie James <eajames at linux.vnet.ibm.com>
On 02/16/2017 04:04 PM, Christopher Bostic wrote:
> Add the basic hub master device driver. Registers with the
> FSI core to be notified of its engine device and its link devices.
>
> Signed-off-by: Christopher Bostic <cbostic at linux.vnet.ibm.com>
> ---
> drivers/fsi/Kconfig | 9 ++++++
> drivers/fsi/Makefile | 1 +
> drivers/fsi/fsi-master-hub.c | 65 ++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 75 insertions(+)
> create mode 100644 drivers/fsi/fsi-master-hub.c
>
> diff --git a/drivers/fsi/Kconfig b/drivers/fsi/Kconfig
> index c78b9b6e..bb7c5d5 100644
> --- a/drivers/fsi/Kconfig
> +++ b/drivers/fsi/Kconfig
> @@ -18,6 +18,15 @@ config FSI_MASTER_GPIO
> ---help---
> This option enables a FSI master driver using GPIO lines.
>
> +config FSI_MASTER_HUB
> + tristate "Hub FSI master"
> + depends on FSI
> + ---help---
> + This option enables a hub FSI master. Hub masters extend the
> + address space of the primary master and allow chaining of
> + multiple devices. Chaining FSI links from one hub to another
> + allows for very high device fan out.
> +
> config FSI_SCOM
> tristate "SCOM FSI client device driver"
> depends on FSI
> diff --git a/drivers/fsi/Makefile b/drivers/fsi/Makefile
> index 3a106ba..37b5f5e 100644
> --- a/drivers/fsi/Makefile
> +++ b/drivers/fsi/Makefile
> @@ -3,3 +3,4 @@ obj-$(CONFIG_FSI) += fsi-core.o
> obj-$(CONFIG_FSI_MASTER_GPIO) += fsi-master-gpio.o
> obj-$(CONFIG_FSI_SCOM) += fsi-scom.o
> obj-$(CONFIG_FSI_I2C) += i2c/
> +obj-$(CONFIG_FSI_MASTER_HUB) += fsi-master-hub.o
> diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c
> new file mode 100644
> index 0000000..19b7c77
> --- /dev/null
> +++ b/drivers/fsi/fsi-master-hub.c
> @@ -0,0 +1,65 @@
> +/*
> + * Hub Master FSI Client device driver
> + *
> + * Copyright (C) IBM Corporation 2017
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERGCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/fsi.h>
> +#include <linux/module.h>
> +#include <linux/cdev.h>
> +#include <linux/fs.h>
> +#include <linux/uaccess.h>
> +
> +#include "fsi-master.h"
> +
> +#define FSI_ENGID_HUB_MASTER 0x1C
> +#define FSI_ENGID_HUB_LINK 0x1D
> +
> +static int hub_master_probe(struct device *dev)
> +{
> + return 0;
> +}
> +
> +static struct fsi_device_id hub_master_ids[] = {
> + {
> + .engine_type = FSI_ENGID_HUB_MASTER,
> + .version = FSI_VERSION_ANY,
> + },
> + {
> + .engine_type = FSI_ENGID_HUB_LINK,
> + .version = FSI_VERSION_ANY,
> + },
> + { 0 }
> +};
> +
> +static struct fsi_driver hub_master_drv = {
> + .id_table = hub_master_ids,
> + .drv = {
> + .name = "hub_master",
> + .bus = &fsi_bus_type,
> + .probe = hub_master_probe,
> + }
> +};
> +
> +static int hub_master_init(void)
> +{
> + return fsi_driver_register(&hub_master_drv);
> +}
> +
> +static void hub_master_exit(void)
> +{
> + fsi_driver_unregister(&hub_master_drv);
> +}
> +
> +module_init(hub_master_init);
> +module_exit(hub_master_exit);
> +MODULE_LICENSE("GPL");
More information about the openbmc
mailing list