/linux/drivers/net/ethernet/cavium/liquidio/ |
H A 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/drivers/net/ethernet/marvell/octeontx2/af/ |
H A 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/drivers/soc/apple/ |
H A D | mailbox.c | 1 // SPDX-License-Identifier: GPL-2.0-only OR MIT 9 * exchange 64+32 bit messages between the main CPU and a co-processor. 13 * Both the main CPU and the co-processor see the same set of registers but 99 int apple_mbox_send(struct apple_mbox *mbox, const struct apple_mbox_msg msg, in apple_mbox_send() argument 107 spin_lock_irqsave(&mbox->tx_lock, flags); in apple_mbox_send() 108 mbox_ctrl = readl_relaxed(mbox->regs + mbox->hw->a2i_control); in apple_mbox_send() 110 while (mbox_ctrl & mbox->hw->control_full) { in apple_mbox_send() 113 mbox->regs + mbox->hw->a2i_control, mbox_ctrl, in apple_mbox_send() 114 !(mbox_ctrl & mbox->hw->control_full), 100, in apple_mbox_send() 118 spin_unlock_irqrestore(&mbox->tx_lock, flags); in apple_mbox_send() [all …]
|
/linux/drivers/mailbox/ |
H A 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 …]
|
H A D | hi6220-mailbox.c | 1 // SPDX-License-Identifier: GPL-2.0-only 57 * - direction: tx or rx 58 * - dst irq: peer core's irq number 59 * - ack irq: local irq number 60 * - slot number 90 static void mbox_set_state(struct hi6220_mbox *mbox, in mbox_set_state() argument 95 status = readl(mbox->base + MBOX_MODE_REG(slot)); in mbox_set_state() 97 writel(status, mbox->base + MBOX_MODE_REG(slot)); in mbox_set_state() 100 static void mbox_set_mode(struct hi6220_mbox *mbox, in mbox_set_mode() argument 105 mode = readl(mbox->base + MBOX_MODE_REG(slot)); in mbox_set_mode() [all …]
|
H A D | mailbox-mpfs.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (c) 2020-2022 Microchip Corporation. All rights reserved. 46 #define SCB_CTRL_MASK GENMASK(SCB_CTRL_POS + SCB_MASK_WIDTH - 1, SCB_CTRL_POS) 63 #define SCB_STATUS_MASK GENMASK(SCB_STATUS_POS + SCB_MASK_WIDTH - 1, SCB_STATUS_POS) 78 static bool mpfs_mbox_busy(struct mpfs_mbox *mbox) in mpfs_mbox_busy() argument 82 if (mbox->control_scb) in mpfs_mbox_busy() 83 regmap_read(mbox->control_scb, SERVICES_SR_OFFSET, &status); in mpfs_mbox_busy() 85 status = readl_relaxed(mbox->ctrl_base + SERVICES_SR_OFFSET); in mpfs_mbox_busy() 92 struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv; in mpfs_mbox_last_tx_done() local 93 struct mpfs_mss_response *response = mbox->response; in mpfs_mbox_last_tx_done() [all …]
|
H A 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> 97 return __raw_readl(mdev->mbox_base + ofs); in mbox_read_reg() 103 __raw_writel(val, mdev->mbox_base + ofs); in mbox_write_reg() 107 static u32 mbox_fifo_read(struct omap_mbox *mbox) in mbox_fifo_read() argument 109 struct omap_mbox_fifo *fifo = &mbox->rx_fifo; in mbox_fifo_read() 111 return mbox_read_reg(mbox->parent, fifo->msg); in mbox_fifo_read() 114 static void mbox_fifo_write(struct omap_mbox *mbox, u32 msg) in mbox_fifo_write() argument [all …]
|
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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. 25 #define MBOX_BASE(mbox, ch) ((mbox)->base + ((ch) * 0x40)) argument 48 * struct hi3660_chan_info - Hi3660 mailbox channel information 62 * struct hi3660_mbox - Hi3660 mailbox controller data 80 static struct hi3660_mbox *to_hi3660_mbox(struct mbox_controller *mbox) in to_hi3660_mbox() argument 82 return container_of(mbox, struct hi3660_mbox, controller); in to_hi3660_mbox() 87 unsigned long ch = (unsigned long)chan->con_priv; in hi3660_mbox_check_state() 88 struct hi3660_mbox *mbox = to_hi3660_mbox(chan->mbox); in hi3660_mbox_check_state() local [all …]
|
H A D | mailbox.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (C) 2013-2014 Linaro Ltd. 32 spin_lock_irqsave(&chan->lock, flags); in add_to_rbuf() 35 if (chan->msg_count == MBOX_TX_QUEUE_LEN) { in add_to_rbuf() 36 spin_unlock_irqrestore(&chan->lock, flags); in add_to_rbuf() 37 return -ENOBUFS; in add_to_rbuf() 40 idx = chan->msg_free; in add_to_rbuf() 41 chan->msg_data[idx] = mssg; in add_to_rbuf() 42 chan->msg_count++; in add_to_rbuf() 44 if (idx == MBOX_TX_QUEUE_LEN - 1) in add_to_rbuf() [all …]
|
H A D | mtk-adsp-mailbox.c | 1 // SPDX-License-Identifier: GPL-2.0 4 * Author: Allen-KH Cheng <allen-kh.cheng@mediatek.com> 19 struct mbox_controller mbox; member 31 static inline struct mtk_adsp_mbox_priv *get_mtk_adsp_mbox_priv(struct mbox_controller *mbox) in get_mtk_adsp_mbox_priv() argument 33 return container_of(mbox, struct mtk_adsp_mbox_priv, mbox); in get_mtk_adsp_mbox_priv() 39 struct mtk_adsp_mbox_priv *priv = get_mtk_adsp_mbox_priv(chan->mbox); in mtk_adsp_mbox_irq() 40 u32 op = readl(priv->va_mboxreg + priv->cfg->set_out); in mtk_adsp_mbox_irq() 42 writel(op, priv->va_mboxreg + priv->cfg->clr_out); in mtk_adsp_mbox_irq() 56 static struct mbox_chan *mtk_adsp_mbox_xlate(struct mbox_controller *mbox, in mtk_adsp_mbox_xlate() argument 59 return mbox->chans; in mtk_adsp_mbox_xlate() [all …]
|
H A D | arm_mhu_db.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2013-2015 Fujitsu Semiconductor Ltd. 28 #define MHU_CHANS 3 /* Secure, Non-Secure High and Low Priority */ 41 struct mbox_controller mbox; member 46 * struct mhu_db_channel - ARM MHU Mailbox allocated channel information 59 mhu_db_mbox_to_channel(struct mbox_controller *mbox, unsigned int pchan, in mhu_db_mbox_to_channel() argument 65 for (i = 0; i < mbox->num_chans; i++) { in mhu_db_mbox_to_channel() 66 chan_info = mbox->chans[i].con_priv; in mhu_db_mbox_to_channel() 67 if (chan_info && chan_info->pchan == pchan && in mhu_db_mbox_to_channel() 68 chan_info->doorbell == doorbell) in mhu_db_mbox_to_channel() [all …]
|
H A 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/drivers/net/ethernet/marvell/octeon_ep/ |
H A D | octep_ctrl_mbox.c | 1 // SPDX-License-Identifier: GPL-2.0 27 /* Size of mbox info in bytes */ 29 /* Size of mbox host to fw queue info in bytes */ 31 /* Size of mbox fw to host queue info in bytes */ 66 return sz - (abs(pi - ci) % sz); in octep_ctrl_mbox_circq_space() 71 return (abs(pi - ci) % sz); in octep_ctrl_mbox_circq_depth() 74 int octep_ctrl_mbox_init(struct octep_ctrl_mbox *mbox) in octep_ctrl_mbox_init() argument 78 if (!mbox) in octep_ctrl_mbox_init() 79 return -EINVAL; in octep_ctrl_mbox_init() 81 if (!mbox->barmem) { in octep_ctrl_mbox_init() [all …]
|
/linux/drivers/crypto/marvell/octeontx2/ |
H A 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() 24 int otx2_cpt_send_ready_msg(struct otx2_mbox *mbox, struct pci_dev *pdev) in otx2_cpt_send_ready_msg() argument 28 req = otx2_mbox_alloc_msg_rsp(mbox, 0, sizeof(*req), in otx2_cpt_send_ready_msg() [all …]
|
H A 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/Documentation/devicetree/bindings/mailbox/ |
H A 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/drivers/net/ethernet/marvell/octeontx2/nic/ |
H A D | otx2_ptp.c | 1 // SPDX-License-Identifier: GPL-2.0 19 if (!ptp->nic) in is_tstmp_atomic_update_supported() 22 mutex_lock(&ptp->nic->mbox.lock); in is_tstmp_atomic_update_supported() 23 req = otx2_mbox_alloc_msg_ptp_get_cap(&ptp->nic->mbox); in is_tstmp_atomic_update_supported() 25 mutex_unlock(&ptp->nic->mbox.lock); in is_tstmp_atomic_update_supported() 29 err = otx2_sync_mbox_msg(&ptp->nic->mbox); in is_tstmp_atomic_update_supported() 31 mutex_unlock(&ptp->nic->mbox.lock); in is_tstmp_atomic_update_supported() 34 rsp = (struct ptp_get_cap_rsp *)otx2_mbox_get_rsp(&ptp->nic->mbox.mbox, 0, in is_tstmp_atomic_update_supported() 35 &req->hdr); in is_tstmp_atomic_update_supported() 36 mutex_unlock(&ptp->nic->mbox.lock); in is_tstmp_atomic_update_supported() [all …]
|
H A D | cn10k_macsec.c | 1 // SPDX-License-Identifier: GPL-2.0 61 dev_err(pfvf->dev, "failed to allocate transform for ecb-aes\n"); in cn10k_ecb_aes_encrypt() 67 dev_err(pfvf->dev, "failed to allocate request for skcipher\n"); in cn10k_ecb_aes_encrypt() 68 err = -ENOMEM; in cn10k_ecb_aes_encrypt() 74 dev_err(pfvf->dev, "failed to set key for skcipher\n"); in cn10k_ecb_aes_encrypt() 101 list_for_each_entry(txsc, &cfg->txsc_list, entry) { in cn10k_mcs_get_txsc() 102 if (txsc->sw_secy == secy) in cn10k_mcs_get_txsc() 115 list_for_each_entry(rxsc, &cfg->rxsc_list, entry) { in cn10k_mcs_get_rxsc() 116 if (rxsc->sw_rxsc == rx_sc && rxsc->sw_secy == secy) in cn10k_mcs_get_rxsc() 144 struct mbox *mbox = &pfvf->mbox; in cn10k_mcs_alloc_rsrc() local [all …]
|
/linux/drivers/net/wireless/ti/wl18xx/ |
H A 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/drivers/net/wireless/ti/wl1251/ |
H A 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/drivers/gpu/drm/i915/ |
H A D | intel_pcode.c | 1 // SPDX-License-Identifier: MIT 3 * Copyright © 2013-2021 Intel Corporation 10 static int gen6_check_mailbox_status(u32 mbox) in gen6_check_mailbox_status() argument 12 switch (mbox & GEN6_PCODE_ERROR_MASK) { in gen6_check_mailbox_status() 16 return -ENODEV; in gen6_check_mailbox_status() 18 return -ENXIO; in gen6_check_mailbox_status() 21 return -EOVERFLOW; in gen6_check_mailbox_status() 23 return -ETIMEDOUT; in gen6_check_mailbox_status() 25 MISSING_CASE(mbox & GEN6_PCODE_ERROR_MASK); in gen6_check_mailbox_status() 30 static int gen7_check_mailbox_status(u32 mbox) in gen7_check_mailbox_status() argument [all …]
|
/linux/drivers/rapidio/devices/ |
H A 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 56 * Returns: %0 on success or %-EINVAL on failure. 61 struct tsi721_device *priv = mport->priv; in tsi721_lcread() 64 return -EINVAL; /* only 32-bit access is supported */ in tsi721_lcread() 66 *data = ioread32(priv->regs + offset); in tsi721_lcread() [all …]
|