Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a24532f8 authored by Rob Rice's avatar Rob Rice Committed by Jassi Brar
Browse files

mailbox: Add Broadcom PDC mailbox driver



The Broadcom PDC mailbox driver is a mailbox controller that
manages data transfers to and from one or more offload engines.

Signed-off-by: default avatarRob Rice <rob.rice@broadcom.com>
Reviewed-by: default avatarScott Branden <scott.branden@broadcom.com>
Reviewed-by: default avatarRay Jui <ray.jui@broadcom.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent b04f1272
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -123,4 +123,13 @@ config XGENE_SLIMPRO_MBOX
	  It is used to send short messages between ARM64-bit cores and
	  the SLIMpro Management Engine, primarily for PM. Say Y here if you
	  want to use the APM X-Gene SLIMpro IPCM support.

config BCM_PDC_MBOX
	tristate "Broadcom PDC Mailbox"
	depends on ARM64 || COMPILE_TEST
	default ARCH_BCM_IPROC
	help
	  Mailbox implementation for the Broadcom PDC ring manager,
	  which provides access to various offload engines on Broadcom
	  SoCs. Say Y here if you want to use the Broadcom PDC.
endif
+2 −0
Original line number Diff line number Diff line
@@ -25,3 +25,5 @@ obj-$(CONFIG_TI_MESSAGE_MANAGER) += ti-msgmgr.o
obj-$(CONFIG_XGENE_SLIMPRO_MBOX) += mailbox-xgene-slimpro.o

obj-$(CONFIG_HI6220_MBOX)	+= hi6220-mailbox.o

obj-$(CONFIG_BCM_PDC_MBOX)	+= bcm-pdc-mailbox.o
+1531 −0

File added.

Preview size limit exceeded, changes collapsed.

+56 −0
Original line number Diff line number Diff line
/*
 *  Copyright (C) 2016 Broadcom
 *
 * 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.
 *
 * Common header for Broadcom mailbox messages which is shared across
 * Broadcom SoCs and Broadcom mailbox client drivers.
 */

#ifndef _LINUX_BRCM_MESSAGE_H_
#define _LINUX_BRCM_MESSAGE_H_

#include <linux/scatterlist.h>

enum brcm_message_type {
	BRCM_MESSAGE_UNKNOWN = 0,
	BRCM_MESSAGE_SPU,
	BRCM_MESSAGE_SBA,
	BRCM_MESSAGE_MAX,
};

struct brcm_sba_command {
	u64 cmd;
#define BRCM_SBA_CMD_TYPE_A		BIT(0)
#define BRCM_SBA_CMD_TYPE_B		BIT(1)
#define BRCM_SBA_CMD_TYPE_C		BIT(2)
#define BRCM_SBA_CMD_HAS_RESP		BIT(3)
#define BRCM_SBA_CMD_HAS_OUTPUT		BIT(4)
	u64 flags;
	dma_addr_t input;
	size_t input_len;
	dma_addr_t resp;
	size_t resp_len;
	dma_addr_t output;
	size_t output_len;
};

struct brcm_message {
	enum brcm_message_type type;
	union {
		struct {
			struct scatterlist *src;
			struct scatterlist *dst;
		} spu;
		struct {
			struct brcm_sba_command *cmds;
			unsigned int cmds_count;
		} sba;
	};
	void *ctx;
	int error;
};

#endif /* _LINUX_BRCM_MESSAGE_H_ */