diff mbox series

[2/6] soc: add polarfire soc header file

Message ID 20201119170425.18365-1-conor.dooley@microchip.com
State New
Headers show
Series None | expand

Commit Message

Conor Dooley Nov. 19, 2020, 5:04 p.m. UTC
From: Conor Dooley <conor.dooley@microchip.com>

Add header to support the Microchip PolarFire SoC MSS system
controller mailbox.

Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
 include/soc/microchip/mpfs.h | 50 ++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 include/soc/microchip/mpfs.h

Comments

Damien Le Moal Nov. 20, 2020, 12:12 a.m. UTC | #1
On 2020/11/20 2:05, conor.dooley@microchip.com wrote:
> From: Conor Dooley <conor.dooley@microchip.com>
> 
> Add header to support the Microchip PolarFire SoC MSS system
> controller mailbox.

This should be squashed into patch 1.

> 
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> ---
>  include/soc/microchip/mpfs.h | 50 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 include/soc/microchip/mpfs.h
> 
> diff --git a/include/soc/microchip/mpfs.h b/include/soc/microchip/mpfs.h
> new file mode 100644
> index 000000000000..60311ab72b76
> --- /dev/null
> +++ b/include/soc/microchip/mpfs.h
> @@ -0,0 +1,50 @@
> +/* SPDX-License-Identifier: GPL-2.0

This line should be a comment on its  own:

/* SPDX-License-Identifier: GPL-2.0 */

> + *
> + * Microchip MPFS mailbox
> + *
> + * Copyright (c) 2020 Microchip Corporation. All rights reserved.
> + *
> + * Author: Conor Dooley <conor.dooley@microchip.com>
> + *
> + */
> +
> +#ifndef __SOC_MPFS_H__
> +#define __SOC_MPFS_H__
> +
> +#include <linux/types.h>
> +#include <linux/of_device.h>
> +
> +struct mpfs_sys_controller;
> +
> +struct mpfs_mss_msg {
> +	u8 cmd_opcode;
> +	u16 cmd_data_size;
> +	u16 response_size;
> +	u8 *cmd_data;
> +	u16 mailbox_offset;
> +	u16 response_offset;
> +};
> +
> +#if IS_ENABLED(CONFIG_MPFS_SYS_CONTROLLER)
> +
> +int mpfs_blocking_transaction(struct mpfs_sys_controller *mpfs_client, void *msg,
> +			      void *response, u16 response_size_bytes);
> +
> +struct mpfs_sys_controller *mpfs_sys_controller_get(struct device_node *mailbox_node);
> +
> +#else
> +
> +static int mpfs_blocking_transaction(struct mpfs_sys_controller *mpfs_client, void *msg,
> +				     void *response, u16 response_size_bytes)
> +{
> +	return -ENOSYS;
> +};
> +
> +struct mpfs_sys_controller *mpfs_sys_controller_get(struct device_node *mailbox_node)
> +{
> +	return NULL;
> +}
> +
> +#endif /* IS_ENABLED(CONFIG_MPFS_SYS_CONTROLLER) */
> +
> +#endif /* __SOC_MPFS_H__ */
>
diff mbox series

Patch

diff --git a/include/soc/microchip/mpfs.h b/include/soc/microchip/mpfs.h
new file mode 100644
index 000000000000..60311ab72b76
--- /dev/null
+++ b/include/soc/microchip/mpfs.h
@@ -0,0 +1,50 @@ 
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Microchip MPFS mailbox
+ *
+ * Copyright (c) 2020 Microchip Corporation. All rights reserved.
+ *
+ * Author: Conor Dooley <conor.dooley@microchip.com>
+ *
+ */
+
+#ifndef __SOC_MPFS_H__
+#define __SOC_MPFS_H__
+
+#include <linux/types.h>
+#include <linux/of_device.h>
+
+struct mpfs_sys_controller;
+
+struct mpfs_mss_msg {
+	u8 cmd_opcode;
+	u16 cmd_data_size;
+	u16 response_size;
+	u8 *cmd_data;
+	u16 mailbox_offset;
+	u16 response_offset;
+};
+
+#if IS_ENABLED(CONFIG_MPFS_SYS_CONTROLLER)
+
+int mpfs_blocking_transaction(struct mpfs_sys_controller *mpfs_client, void *msg,
+			      void *response, u16 response_size_bytes);
+
+struct mpfs_sys_controller *mpfs_sys_controller_get(struct device_node *mailbox_node);
+
+#else
+
+static int mpfs_blocking_transaction(struct mpfs_sys_controller *mpfs_client, void *msg,
+				     void *response, u16 response_size_bytes)
+{
+	return -ENOSYS;
+};
+
+struct mpfs_sys_controller *mpfs_sys_controller_get(struct device_node *mailbox_node)
+{
+	return NULL;
+}
+
+#endif /* IS_ENABLED(CONFIG_MPFS_SYS_CONTROLLER) */
+
+#endif /* __SOC_MPFS_H__ */