/Linux-v5.15/drivers/net/ethernet/cavium/liquidio/ |
D | octeon_mailbox.c | 7 * Copyright (c) 2003-2016 Cavium, Inc. 14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty 31 * @mbox: Pointer mailbox 33 * Reads the 8-bytes of data from the mbox register 36 int octeon_mbox_read(struct octeon_mbox *mbox) in octeon_mbox_read() argument 41 spin_lock(&mbox->lock); in octeon_mbox_read() 43 msg.u64 = readq(mbox->mbox_read_reg); in octeon_mbox_read() 46 spin_unlock(&mbox->lock); in octeon_mbox_read() 50 if (mbox->state & OCTEON_MBOX_STATE_REQUEST_RECEIVING) { in octeon_mbox_read() 51 mbox->mbox_req.data[mbox->mbox_req.recv_len - 1] = msg.u64; in octeon_mbox_read() [all …]
|
/Linux-v5.15/drivers/mailbox/ |
D | mailbox-altera.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright Altera Corporation (C) 2013-2014. All rights reserved 15 #define DRIVER_NAME "altera-mailbox" 40 bool is_sender; /* 1-sender, 0-receiver */ 54 if (!chan || !chan->con_priv) in mbox_chan_to_altera_mbox() 57 return (struct altera_mbox *)chan->con_priv; in mbox_chan_to_altera_mbox() 60 static inline int altera_mbox_full(struct altera_mbox *mbox) in altera_mbox_full() argument 64 status = readl_relaxed(mbox->mbox_base + MAILBOX_STS_REG); in altera_mbox_full() 68 static inline int altera_mbox_pending(struct altera_mbox *mbox) in altera_mbox_pending() argument 72 status = readl_relaxed(mbox->mbox_base + MAILBOX_STS_REG); in altera_mbox_pending() [all …]
|
D | hi6220-mailbox.c | 1 // SPDX-License-Identifier: GPL-2.0-only 56 * - direction: tx or rx 57 * - dst irq: peer core's irq number 58 * - ack irq: local irq number 59 * - slot number 89 static void mbox_set_state(struct hi6220_mbox *mbox, in mbox_set_state() argument 94 status = readl(mbox->base + MBOX_MODE_REG(slot)); in mbox_set_state() 96 writel(status, mbox->base + MBOX_MODE_REG(slot)); in mbox_set_state() 99 static void mbox_set_mode(struct hi6220_mbox *mbox, in mbox_set_mode() argument 104 mode = readl(mbox->base + MBOX_MODE_REG(slot)); in mbox_set_mode() [all …]
|
D | omap-mailbox.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (C) 2006-2009 Nokia Corporation. All rights reserved. 6 * Copyright (C) 2013-2021 Texas Instruments Incorporated - https://www.ti.com 9 * Suman Anna <s-anna@ti.com> 22 #include <linux/omap-mailbox.h> 68 struct omap_mbox *mbox; member 125 if (!chan || !chan->con_priv) in mbox_chan_to_omap_mbox() 128 return (struct omap_mbox *)chan->con_priv; in mbox_chan_to_omap_mbox() 134 return __raw_readl(mdev->mbox_base + ofs); in mbox_read_reg() 140 __raw_writel(val, mdev->mbox_base + ofs); in mbox_write_reg() [all …]
|
D | sun6i-msgbox.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // Copyright (c) 2017-2019 Samuel Holland <samuel@sholland.org> 44 #define mbox_dbg(mbox, ...) dev_dbg((mbox)->controller.dev, __VA_ARGS__) argument 58 return chan - chan->mbox->chans; in channel_number() 63 return chan->con_priv; in to_sun6i_msgbox() 68 struct sun6i_msgbox *mbox = dev_id; in sun6i_msgbox_irq() local 73 status = readl(mbox->regs + LOCAL_IRQ_EN_REG) & in sun6i_msgbox_irq() 74 readl(mbox->regs + LOCAL_IRQ_STAT_REG); in sun6i_msgbox_irq() 80 struct mbox_chan *chan = &mbox->controller.chans[n]; in sun6i_msgbox_irq() 86 uint32_t msg = readl(mbox->regs + MSG_DATA_REG(n)); in sun6i_msgbox_irq() [all …]
|
D | armada-37xx-rwtm-mailbox.c | 1 // SPDX-License-Identifier: GPL-2.0+ 16 #include <linux/armada-37xx-rwtm-mailbox.h> 18 #define DRIVER_NAME "armada-37xx-rwtm-mailbox" 45 struct a37xx_mbox *mbox = chan->con_priv; in a37xx_mbox_receive() local 49 rx_msg.retval = readl(mbox->base + RWTM_MBOX_RETURN_STATUS); in a37xx_mbox_receive() 51 rx_msg.status[i] = readl(mbox->base + RWTM_MBOX_STATUS(i)); in a37xx_mbox_receive() 59 struct a37xx_mbox *mbox = chan->con_priv; in a37xx_mbox_irq_handler() local 62 reg = readl(mbox->base + RWTM_HOST_INT_RESET); in a37xx_mbox_irq_handler() 68 dev_err(mbox->dev, "Secure processor command queue full\n"); in a37xx_mbox_irq_handler() 70 writel(reg, mbox->base + RWTM_HOST_INT_RESET); in a37xx_mbox_irq_handler() [all …]
|
D | mailbox-mpfs.c | 1 // SPDX-License-Identifier: GPL-2.0 72 static bool mpfs_mbox_busy(struct mpfs_mbox *mbox) in mpfs_mbox_busy() argument 76 status = readl_relaxed(mbox->mbox_base + SERVICES_SR_OFFSET); in mpfs_mbox_busy() 83 struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv; in mpfs_mbox_send_data() local 89 mbox->response = msg->response; in mpfs_mbox_send_data() 90 mbox->resp_offset = msg->resp_offset; in mpfs_mbox_send_data() 92 if (mpfs_mbox_busy(mbox)) in mpfs_mbox_send_data() 93 return -EBUSY; in mpfs_mbox_send_data() 95 if (msg->cmd_data_size) { in mpfs_mbox_send_data() 97 u8 extra_bits = msg->cmd_data_size & 3; in mpfs_mbox_send_data() [all …]
|
D | bcm2835-mailbox.c | 1 // SPDX-License-Identifier: GPL-2.0 4 * Copyright (C) 2013-2014 Lubomir Rintel 8 * - arch/arm/mach-bcm2708/vcio.c file written by Gray Girling that was 9 * obtained from branch "rpi-3.6.y" of git://github.com/raspberrypi/ 11 * - drivers/mailbox/bcm2835-ipc.c by Lubomir Rintel at 12 * https://github.com/hackerspace/rpi-linux/blob/lr-raspberry-pi/drivers/ 13 * mailbox/bcm2835-ipc.c 14 * - documentation available on the following web site: 15 * https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface 19 #include <linux/dma-mapping.h> [all …]
|
D | hi3660-mailbox.c | 1 // SPDX-License-Identifier: GPL-2.0 2 // Copyright (c) 2017-2018 HiSilicon Limited. 3 // Copyright (c) 2017-2018 Linaro Limited. 24 #define MBOX_BASE(mbox, ch) ((mbox)->base + ((ch) * 0x40)) argument 81 static struct hi3660_mbox *to_hi3660_mbox(struct mbox_controller *mbox) in to_hi3660_mbox() argument 83 return container_of(mbox, struct hi3660_mbox, controller); in to_hi3660_mbox() 88 unsigned long ch = (unsigned long)chan->con_priv; in hi3660_mbox_check_state() 89 struct hi3660_mbox *mbox = to_hi3660_mbox(chan->mbox); in hi3660_mbox_check_state() local 90 struct hi3660_chan_info *mchan = &mbox->mchan[ch]; in hi3660_mbox_check_state() 91 void __iomem *base = MBOX_BASE(mbox, ch); in hi3660_mbox_check_state() [all …]
|
D | mailbox.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (C) 2013-2014 Linaro Ltd. 31 spin_lock_irqsave(&chan->lock, flags); in add_to_rbuf() 34 if (chan->msg_count == MBOX_TX_QUEUE_LEN) { in add_to_rbuf() 35 spin_unlock_irqrestore(&chan->lock, flags); in add_to_rbuf() 36 return -ENOBUFS; in add_to_rbuf() 39 idx = chan->msg_free; in add_to_rbuf() 40 chan->msg_data[idx] = mssg; in add_to_rbuf() 41 chan->msg_count++; in add_to_rbuf() 43 if (idx == MBOX_TX_QUEUE_LEN - 1) in add_to_rbuf() [all …]
|
D | arm_mhu_db.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2013-2015 Fujitsu Semiconductor Ltd. 29 #define MHU_CHANS 3 /* Secure, Non-Secure High and Low Priority */ 42 struct mbox_controller mbox; member 60 mhu_db_mbox_to_channel(struct mbox_controller *mbox, unsigned int pchan, in mhu_db_mbox_to_channel() argument 66 for (i = 0; i < mbox->num_chans; i++) { in mhu_db_mbox_to_channel() 67 chan_info = mbox->chans[i].con_priv; in mhu_db_mbox_to_channel() 68 if (chan_info && chan_info->pchan == pchan && in mhu_db_mbox_to_channel() 69 chan_info->doorbell == doorbell) in mhu_db_mbox_to_channel() 70 return &mbox->chans[i]; in mhu_db_mbox_to_channel() [all …]
|
D | mailbox-sti.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 36 #define MBOX_BASE(mdev, inst) ((mdev)->base + ((inst) * 4)) 39 * struct sti_mbox_device - STi Mailbox device data 42 * @mbox: Representation of a communication channel controller 55 struct mbox_controller *mbox; member 63 * struct sti_mbox_pdata - STi Mailbox platform specific configuration 74 * struct sti_channel - STi Mailbox allocated channel information 88 struct sti_channel *chan_info = chan->con_priv; in sti_mbox_channel_is_enabled() 89 struct sti_mbox_device *mdev = chan_info->mdev; in sti_mbox_channel_is_enabled() 90 unsigned int instance = chan_info->instance; in sti_mbox_channel_is_enabled() [all …]
|
/Linux-v5.15/drivers/net/ethernet/marvell/octeontx2/af/ |
D | mbox.c | 1 // SPDX-License-Identifier: GPL-2.0 13 #include "mbox.h" 18 void __otx2_mbox_reset(struct otx2_mbox *mbox, int devid) in __otx2_mbox_reset() argument 20 struct otx2_mbox_dev *mdev = &mbox->dev[devid]; in __otx2_mbox_reset() 22 void *hw_mbase = mdev->hwbase; in __otx2_mbox_reset() 24 tx_hdr = hw_mbase + mbox->tx_start; in __otx2_mbox_reset() 25 rx_hdr = hw_mbase + mbox->rx_start; in __otx2_mbox_reset() 27 mdev->msg_size = 0; in __otx2_mbox_reset() 28 mdev->rsp_size = 0; in __otx2_mbox_reset() 29 tx_hdr->num_msgs = 0; in __otx2_mbox_reset() [all …]
|
/Linux-v5.15/drivers/crypto/marvell/octeontx2/ |
D | otx2_cpt_mbox_common.c | 1 // SPDX-License-Identifier: GPL-2.0-only 7 int otx2_cpt_send_mbox_msg(struct otx2_mbox *mbox, struct pci_dev *pdev) in otx2_cpt_send_mbox_msg() argument 11 otx2_mbox_msg_send(mbox, 0); in otx2_cpt_send_mbox_msg() 12 ret = otx2_mbox_wait_for_rsp(mbox, 0); in otx2_cpt_send_mbox_msg() 13 if (ret == -EIO) { in otx2_cpt_send_mbox_msg() 14 dev_err(&pdev->dev, "RVU MBOX timeout.\n"); in otx2_cpt_send_mbox_msg() 17 dev_err(&pdev->dev, "RVU MBOX error: %d.\n", ret); in otx2_cpt_send_mbox_msg() 18 return -EFAULT; in otx2_cpt_send_mbox_msg() 23 int otx2_cpt_send_ready_msg(struct otx2_mbox *mbox, struct pci_dev *pdev) in otx2_cpt_send_ready_msg() argument 27 req = otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*req), in otx2_cpt_send_ready_msg() [all …]
|
D | otx2_cptvf_mbox.c | 1 // SPDX-License-Identifier: GPL-2.0-only 13 cptvf->bbuf_base = devm_kmalloc(&pdev->dev, MBOX_SIZE, GFP_KERNEL); in otx2_cpt_mbox_bbuf_init() 14 if (!cptvf->bbuf_base) in otx2_cpt_mbox_bbuf_init() 15 return -ENOMEM; in otx2_cpt_mbox_bbuf_init() 17 * Overwrite mbox mbase to point to bounce buffer, so that PF/VF in otx2_cpt_mbox_bbuf_init() 18 * prepare all mbox messages in bounce buffer instead of directly in otx2_cpt_mbox_bbuf_init() 19 * in hw mbox memory. in otx2_cpt_mbox_bbuf_init() 21 otx2_mbox = &cptvf->pfvf_mbox; in otx2_cpt_mbox_bbuf_init() 22 mdev = &otx2_mbox->dev[0]; in otx2_cpt_mbox_bbuf_init() 23 mdev->mbase = cptvf->bbuf_base; in otx2_cpt_mbox_bbuf_init() [all …]
|
/Linux-v5.15/drivers/net/ethernet/marvell/octeontx2/nic/ |
D | otx2_dmac_flt.c | 1 // SPDX-License-Identifier: GPL-2.0 17 mutex_lock(&pf->mbox.lock); in otx2_dmacflt_do_add() 19 req = otx2_mbox_alloc_msg_cgx_mac_addr_add(&pf->mbox); in otx2_dmacflt_do_add() 21 mutex_unlock(&pf->mbox.lock); in otx2_dmacflt_do_add() 22 return -ENOMEM; in otx2_dmacflt_do_add() 25 ether_addr_copy(req->mac_addr, mac); in otx2_dmacflt_do_add() 26 err = otx2_sync_mbox_msg(&pf->mbox); in otx2_dmacflt_do_add() 30 otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &req->hdr); in otx2_dmacflt_do_add() 31 *dmac_index = rsp->index; in otx2_dmacflt_do_add() 34 mutex_unlock(&pf->mbox.lock); in otx2_dmacflt_do_add() [all …]
|
D | otx2_vf.c | 1 // SPDX-License-Identifier: GPL-2.0 38 if (msg->id >= MBOX_MSG_MAX) { in otx2vf_process_vfaf_mbox_msg() 39 dev_err(vf->dev, in otx2vf_process_vfaf_mbox_msg() 40 "Mbox msg with unknown ID %d\n", msg->id); in otx2vf_process_vfaf_mbox_msg() 44 if (msg->sig != OTX2_MBOX_RSP_SIG) { in otx2vf_process_vfaf_mbox_msg() 45 dev_err(vf->dev, in otx2vf_process_vfaf_mbox_msg() 46 "Mbox msg with wrong signature %x, ID %d\n", in otx2vf_process_vfaf_mbox_msg() 47 msg->sig, msg->id); in otx2vf_process_vfaf_mbox_msg() 51 if (msg->rc == MBOX_MSG_INVALID) { in otx2vf_process_vfaf_mbox_msg() 52 dev_err(vf->dev, in otx2vf_process_vfaf_mbox_msg() [all …]
|
D | otx2_pf.c | 1 // SPDX-License-Identifier: GPL-2.0 58 netdev->mtu, new_mtu); in otx2_change_mtu() 59 netdev->mtu = new_mtu; in otx2_change_mtu() 69 int irq, vfs = pf->total_vfs; in otx2_disable_flr_me_intr() 73 irq = pci_irq_vector(pf->pdev, RVU_PF_INT_VEC_VFME0); in otx2_disable_flr_me_intr() 78 irq = pci_irq_vector(pf->pdev, RVU_PF_INT_VEC_VFFLR0); in otx2_disable_flr_me_intr() 84 otx2_write64(pf, RVU_PF_VFME_INT_ENA_W1CX(1), INTR_MASK(vfs - 64)); in otx2_disable_flr_me_intr() 85 irq = pci_irq_vector(pf->pdev, RVU_PF_INT_VEC_VFME1); in otx2_disable_flr_me_intr() 88 otx2_write64(pf, RVU_PF_VFFLR_INT_ENA_W1CX(1), INTR_MASK(vfs - 64)); in otx2_disable_flr_me_intr() 89 irq = pci_irq_vector(pf->pdev, RVU_PF_INT_VEC_VFFLR1); in otx2_disable_flr_me_intr() [all …]
|
D | otx2_common.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 21 #include <mbox.h> 157 struct mbox { struct 158 struct otx2_mbox mbox; argument 163 void *bbuf_base; /* Bounce buffer for mbox memory */ argument 165 int num_msgs; /* mbox number of messages */ argument 206 /* MSI-X */ 345 /* Mbox */ 346 struct mbox mbox; member 347 struct mbox *mbox_pfvf; [all …]
|
/Linux-v5.15/Documentation/devicetree/bindings/mailbox/ |
D | ti,omap-mailbox.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/mailbox/ti,omap-mailbox.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Suman Anna <s-anna@ti.com> 35 lines can also be routed to different processor sub-systems on DRA7xx as they 49 within a SoC. The sub-mailboxes (actual communication channels) are 56 "mbox-names" (please see Documentation/devicetree/bindings/mailbox/mailbox.txt 59 phandle to the intended sub-mailbox child node to be used for communication. 60 The equivalent "mbox-names" property value can be used to give a name to the [all …]
|
/Linux-v5.15/drivers/net/wireless/ti/wl18xx/ |
D | event.c | 1 // SPDX-License-Identifier: GPL-2.0-only 67 skb = cfg80211_vendor_event_alloc(wl->hw->wiphy, NULL, 20, in wlcore_smart_config_sync_event() 73 return -EMSGSIZE; in wlcore_smart_config_sync_event() 88 skb = cfg80211_vendor_event_alloc(wl->hw->wiphy, NULL, in wlcore_smart_config_decode_event() 96 return -EMSGSIZE; in wlcore_smart_config_decode_event() 118 struct wl18xx_event_mailbox *mbox = wl->mbox; in wl18xx_process_mailbox_events() local 121 vector = le32_to_cpu(mbox->events_vector); in wl18xx_process_mailbox_events() 122 wl1271_debug(DEBUG_EVENT, "MBOX vector: 0x%x", vector); in wl18xx_process_mailbox_events() 126 mbox->number_of_scan_results); in wl18xx_process_mailbox_events() 128 if (wl->scan_wlvif) in wl18xx_process_mailbox_events() [all …]
|
/Linux-v5.15/drivers/net/ethernet/mellanox/mlxsw/ |
D | pci.c | 1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 2 /* Copyright (c) 2015-2018 Mellanox Technologies. All rights reserved */ 26 iowrite32be(val, (mlxsw_pci)->hw_addr + (MLXSW_PCI_ ## reg)) 28 ioread32be((mlxsw_pci)->hw_addr + (MLXSW_PCI_ ## reg)) 133 tasklet_schedule(&q->tasklet); in mlxsw_pci_queue_tasklet_schedule() 139 return q->mem_item.buf + (elem_size * elem_index); in __mlxsw_pci_queue_elem_get() 145 return &q->elem_info[elem_index]; in mlxsw_pci_queue_elem_info_get() 151 int index = q->producer_counter & (q->count - 1); in mlxsw_pci_queue_elem_info_producer_get() 153 if ((u16) (q->producer_counter - q->consumer_counter) == q->count) in mlxsw_pci_queue_elem_info_producer_get() 161 int index = q->consumer_counter & (q->count - 1); in mlxsw_pci_queue_elem_info_consumer_get() [all …]
|
/Linux-v5.15/drivers/rapidio/devices/ |
D | tsi721.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * RapidIO mport driver for Tsi721 PCIExpress-to-SRIO bridge 19 #include <linux/dma-mapping.h> 32 static int pcie_mrrs = -1; 39 "RIO Messaging MBOX Selection Mask (default: 0x0f = all)"); 47 * tsi721_lcread - read from local SREP config space 55 * success or %-EINVAL on failure. 60 struct tsi721_device *priv = mport->priv; in tsi721_lcread() 63 return -EINVAL; /* only 32-bit access is supported */ in tsi721_lcread() 65 *data = ioread32(priv->regs + offset); in tsi721_lcread() [all …]
|
/Linux-v5.15/drivers/net/wireless/ti/wl1251/ |
D | event.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (c) 1998-2007 Texas Instruments Incorporated 16 struct event_mailbox *mbox) in wl1251_event_scan_complete() argument 21 mbox->scheduled_scan_status, in wl1251_event_scan_complete() 22 mbox->scheduled_scan_channels); in wl1251_event_scan_complete() 24 if (wl->scanning) { in wl1251_event_scan_complete() 29 ieee80211_scan_completed(wl->hw, &info); in wl1251_event_scan_complete() 31 wl->scanning = false; in wl1251_event_scan_complete() 32 if (wl->hw->conf.flags & IEEE80211_CONF_IDLE) in wl1251_event_scan_complete() 41 struct event_mailbox *mbox) in wl1251_event_ps_report() argument [all …]
|
/Linux-v5.15/drivers/net/wireless/ti/wl12xx/ |
D | event.c | 1 // SPDX-License-Identifier: GPL-2.0-only 36 struct wl12xx_event_mailbox *mbox = wl->mbox; in wl12xx_process_mailbox_events() local 40 vector = le32_to_cpu(mbox->events_vector); in wl12xx_process_mailbox_events() 41 vector &= ~(le32_to_cpu(mbox->events_mask)); in wl12xx_process_mailbox_events() 43 wl1271_debug(DEBUG_EVENT, "MBOX vector: 0x%x", vector); in wl12xx_process_mailbox_events() 47 mbox->scheduled_scan_status); in wl12xx_process_mailbox_events() 49 if (wl->scan_wlvif) in wl12xx_process_mailbox_events() 50 wl12xx_scan_completed(wl, wl->scan_wlvif); in wl12xx_process_mailbox_events() 56 mbox->scheduled_scan_status); in wl12xx_process_mailbox_events() 63 mbox->scheduled_scan_status); in wl12xx_process_mailbox_events() [all …]
|