Xilinx ZynqMP IPI Mailbox Controller Driver
Subsystems (3)
v7 cover Xilinx ZynqMP IPI Mailbox Controller Driver
Introduce mailbox controller driver for ZynqMP IPI(Inter-processor interrupt) IP core.
As the device tree bindings have been updated. Do not have "Reviewed-by" nor "Acked-by" in the dt-bindings commit.
v7:
- Fix sparse warning, and documentation check.
- Add emply block to the end of of_device_id.
v6:
- dts-binding, remove compatible property from IPI subnode
v5:
- fix check patch warning on write a paragraph to describe the kconfig symbol.
v4:
- make IPI mailboxes as subnodes to the IPI agent device node to properly describe the hardware.
v3:
- add NULL entry to of_device_id of IPI controller
v2:
- change SPDX-License-Identifier license text style in .c file
- replace xlnx-ipi-ids with xlnx,ipi-ids
Wendy Liang (2):
mailbox: ZynqMP IPI mailbox controller
dt-bindings: mailbox: Add Xilinx IPI Mailbox
.../bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt | 127 ++++ drivers/mailbox/Kconfig | 11 + drivers/mailbox/Makefile | 2 + drivers/mailbox/zynqmp-ipi-mailbox.c | 764 +++++++++++++++++++++ 4 files changed, 904 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt create mode 100644 drivers/mailbox/zynqmp-ipi-mailbox.c
Signature · 1 line
2.7.4
PATCH v7 1/2 mailbox: ZynqMP IPI mailbox controller
This patch is to introduce ZynqMP IPI mailbox controller driver to use the ZynqMP IPI block as mailboxes.
--- drivers/mailbox/Kconfig | 11 + drivers/mailbox/Makefile | 2 + drivers/mailbox/zynqmp-ipi-mailbox.c | 764 +++++++++++++++++++++++++++++++++++ 3 files changed, 777 insertions(+) create mode 100644 drivers/mailbox/zynqmp-ipi-mailbox.c
drivers/mailbox/Kconfig +11 -0
@@ -205,4 +205,15 @@ config MTK_CMDQ_MBOX mailbox driver. The CMDQ is used to help read/write registers with critical time limitation, such as updating display configuration during the vblank. + +config ZYNQMP_IPI_MBOX + bool "Xilinx ZynqMP IPI Mailbox" + depends on ARCH_ZYNQMP && OF + help + Say yes here to add support for Xilinx IPI mailbox driver. + This mailbox driver is used to send notification or short message + between processors with Xilinx ZynqMP IPI. It will place the + message to the IPI buffer and will access the IPI control + registers to kick the other processor or enquire status. + endif
drivers/mailbox/Makefile +2 -0
@@ -44,3 +44,5 @@ obj-$(CONFIG_TEGRA_HSP_MBOX) += tegra-hsp.o obj-$(CONFIG_STM32_IPCC) += stm32-ipcc.o obj-$(CONFIG_MTK_CMDQ_MBOX) += mtk-cmdq-mailbox.o + +obj-$(CONFIG_ZYNQMP_IPI_MBOX) += zynqmp-ipi-mailbox.o
drivers/mailbox/zynqmp-ipi-mailbox.c new file +764 -0
764 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v7 2/2 dt-bindings: mailbox: Add Xilinx IPI Mailbox
In reply to Wendy LiangXilinx ZynqMP IPI(Inter Processor Interrupt) is a hardware block in ZynqMP SoC used for the communication between various processor systems.
--- .../bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt | 127 +++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt
Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt new file +127 -0
@@ -0,0 +1,127 @@ +Xilinx IPI Mailbox Controller +======================================== + +The Xilinx IPI(Inter Processor Interrupt) mailbox controller is to manage +messaging between two Xilinx Zynq UltraScale+ MPSoC IPI agents. Each IPI +agent owns registers used for notification and buffers for message. + + +-------------------------------------+ + | Xilinx ZynqMP IPI Controller | + +-------------------------------------+ + +--------------------------------------------------+ +ATF | | + | | + | | + +--------------------------+ | + | | + | | + +--------------------------------------------------+ + +------------------------------------------+ + | +----------------+ +----------------+ | +Hardware | | IPI Agent | | IPI Buffers | | + | | Registers | | | | + | | | | | | + | +----------------+ +----------------+ | + | | + | Xilinx IPI Agent Block | + +------------------------------------------+ + + +Controller Device Node: +=========================== +Required properties: +-------------------- +IPI agent node: +- compatible: Shall be: "xlnx,zynqmp-ipi-mailbox" +- interrupt-parent: Phandle for the interrupt controller +- interrupts: Interrupt information corresponding to the + interrupt-names property. +- xlnx,ipi-id: local Xilinx IPI agent ID +- #address-cells: number of address cells of internal IPI mailbox nodes +- #size-cells: number of size cells of internal IPI mailbox nodes + +Internal IPI mailbox node: +- reg: IPI buffers address ranges +- reg-names: Names of the reg resources. It should have: + * local_request_region + - IPI request msg buffer written by local and read + by remote + * local_response_region + - IPI response msg buffer written by local and read + by remote + * remote_request_region + - IPI request msg buffer written by remote and read + by local + * remote_response_region + - IPI response msg buffer written by remote and read + by local +- #mbox-cells: Shall be 1. It contains: + * tx(0) or rx(1) channel +- xlnx,ipi-id: remote Xilinx IPI agent ID of which the mailbox is + connected to. + +Optional properties: +-------------------- +- method: The method of accessing the IPI agent registers. + Permitted values are: "smc" and "hvc". Default is + "smc". + +Client Device Node: +=========================== +Required properties: +-------------------- +- mboxes: Standard property to specify a mailbox + (See ./mailbox.txt) +- mbox-names: List of identifier strings for each mailbox + channel. + +Example: +=========================== + zynqmp_ipi { + compatible = "xlnx,zynqmp-ipi-mailbox"; + interrupt-parent = <&gic>; + interrupts = <0 29 4>; + xlnx,ipi-id = <0>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + /* APU<->RPU0 IPI mailbox controller */ + ipi_mailbox_rpu0: mailbox@ff90400 { + reg = <0xff990400 0x20>, + <0xff990420 0x20>, + <0xff990080 0x20>, + <0xff9900a0 0x20>; + reg-names = "local_request_region", + "local_response_region", + "remote_request_region", + "remote_response_region"; + #mbox-cells = <1>; + xlnx,ipi-id = <1>; + }; + /* APU<->RPU1 IPI mailbox controller */ + ipi_mailbox_rpu1: mailbox@ff990440 { + reg = <0xff990440 0x20>, + <0xff990460 0x20>, + <0xff990280 0x20>, + <0xff9902a0 0x20>; + reg-names = "local_request_region", + "local_response_region", + "remote_request_region", + "remote_response_region"; + #mbox-cells = <1>; + xlnx,ipi-id = <2>; + }; + }; + rpu0 { + ... + mboxes = <&ipi_mailbox_rpu0 0>, + <&ipi_mailbox_rpu0 1>; + mbox-names = "tx", "rx"; + }; + rpu1 { + ... + mboxes = <&ipi_mailbox_rpu1 0>, + <&ipi_mailbox_rpu1 1>; + mbox-names = "tx", "rx"; + };
Signature · 1 line
2.7.4
Jassi Brar
maintainerRe: [PATH v7 1/2] mailbox: ZynqMP IPI mailbox controller
In reply to Wendy LiangQuoted 6 lines · Wendy Liang
drivers/mailbox/zynqmp-ipi-mailbox.c new file +0
-0@@ -0,0 +1,764 @@
......
Quoted 8 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +8
-0+ +/* IPI SMC Macros */ +#define IPI_SMC_OPEN_IRQ_MASK 0x00000001UL/* IRQ enable bit in IPI +* open SMC call +*/ +#define IPI_SMC_NOTIFY_BLOCK_MASK 0x00000001UL/* Flag to indicate if +* IPI notification needs +* to be blocking.
drivers/mailbox/zynqmp-ipi-mailbox.c line 55
Quoted 10 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +10
-0+*/ +#define IPI_SMC_ENQUIRY_DIRQ_MASK 0x00000001UL/* Flag to indicate if +* notification interrupt +* to be disabled. +*/ +#define IPI_SMC_ACK_EIRQ_MASK 0x00000001UL/* Flag to indicate if +* notification interrupt +* to be enabled. +*/ +
The first two are unused.
drivers/mailbox/zynqmp-ipi-mailbox.c line 117
Quoted 5 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +4
-0+struct zynqmp_ipi_pdata { +struct device *dev; +int irq; +unsigned int method;
'method' doesn't track the HVC option in the driver. Please have a look.
......
drivers/mailbox/zynqmp-ipi-mailbox.c line 132
Quoted 7 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +6
-0+ +static void zynqmp_ipi_fw_call (struct zynqmp_ipi_mbox *ipi_mbox, +unsigned long a0,unsigned long a3, +unsigned long a4,unsigned long a5, +unsigned long a6,unsigned long a7, +struct arm_smccc_res *res)
[a4,a7] are always 0, so maybe just drop them?
Quoted 16 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +16
-0+static bool zynqmp_ipi_last_tx_done (struct mbox_chan *chan) +{ +struct device *dev = chan->mbox->dev; +struct zynqmp_ipi_mbox *ipi_mbox =dev_get_drvdata (dev); +struct zynqmp_ipi_mchan *mchan = chan->con_priv; +int ret; +u64 arg0; +struct arm_smccc_res res; +struct zynqmp_ipi_message *msg; + +if (WARN_ON (!ipi_mbox)) { +dev_err (dev,"no platform drv data??\n" ); +return false; + } + +if (mchan->chan_type ==IPI_MB_CHNL_TX ) {
drivers/mailbox/zynqmp-ipi-mailbox.c line 261
Quoted 10 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +10
-0+/* We only need to check if the message been taken +* by the remote in the TX channel +*/ + arg0 =SMC_IPI_MAILBOX_STATUS_ENQUIRY ; +zynqmp_ipi_fw_call (ipi_mbox, arg0,0 ,0 ,0 ,0 ,0 , &res); +/* Check the SMC call status, a0 of the result */ + ret = (int )(res.a0 &0xFFFFFFFF ); +if (ret <0 || ret &IPI_MB_STATUS_SEND_PENDING ) +return false; +
OK, but ...
drivers/mailbox/zynqmp-ipi-mailbox.c line 265
Quoted 5 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +4
-0+ msg = mchan->rx_buf; + msg->len = mchan->resp_buf_size; +memcpy_fromio (msg->data, mchan->resp_buf, msg->len); +mbox_chan_received_data (chan, (void *)msg);
.... wouldn't this be done from zynqmp_ipi_interrupt()?
Quoted 2 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +2
-0+static int zynqmp_ipi_send_data (struct mbox_chan *chan,void *data) +{
.........
Quoted 13 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +12
-0+/* Enquire if the mailbox is free to send message */ + arg0 =SMC_IPI_MAILBOX_STATUS_ENQUIRY ; + timeout =10 ; +if (msg && msg->len) { + timeout =10 ; + do { + zynqmp_ipi_fw_call(ipi_mbox, arg0, + 0, 0, 0, 0, 0, &res); + ret = res.a0 & 0xFFFFFFFF; + if (ret >= 0 && + !(ret & IPI_MB_STATUS_SEND_PENDING)) + break;
drivers/mailbox/zynqmp-ipi-mailbox.c line 325
Quoted 10 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +10
-0+usleep_range (1 ,2 ); + timeout--; + }while (timeout); +if (!timeout) { +dev_warn (dev,"chan %d sending msg timeout.\n" , + ipi_mbox->remote_id); +return -ETIME ; + } +memcpy_toio (mchan->req_buf, msg->data, msg->len); + }
This check should be done in last_tx_done, and not here. send_data is never called unless last_tx_done returns true.
Quoted 8 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +7
-0+/* Kick IPI mailbox to send message */ + arg0 =SMC_IPI_MAILBOX_NOTIFY ; +zynqmp_ipi_fw_call (ipi_mbox, arg0,0 ,0 ,0 ,0 ,0 , &res); + }else { +/* Send response message */ +if (msg && msg->len > mchan->resp_buf_size) { + dev_err(dev, "channel %d message length %u > max %lu\n",
drivers/mailbox/zynqmp-ipi-mailbox.c line 340
Quoted 10 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +8
-0+ mchan->chan_type, (unsigned int )msg->len, + mchan->resp_buf_size); +return -EINVAL ; + } +if (msg && msg->len) +memcpy_toio (mchan->resp_buf, msg->data, msg->len); + arg0 =SMC_IPI_MAILBOX_NOTIFY ; + arg0 =SMC_IPI_MAILBOX_ACK ;
This is obviously wrong.
....
drivers/mailbox/zynqmp-ipi-mailbox.c line 639
Quoted 7 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +6
-0+ mbox->chans = chans; + chans[IPI_MB_CHNL_TX ].con_priv = &ipi_mbox->mchans[IPI_MB_CHNL_TX ]; + chans[IPI_MB_CHNL_RX ].con_priv = &ipi_mbox->mchans[IPI_MB_CHNL_RX ]; + ipi_mbox->mchans[IPI_MB_CHNL_TX ].chan_type =IPI_MB_CHNL_TX ; + ipi_mbox->mchans[IPI_MB_CHNL_RX ].chan_type =IPI_MB_CHNL_RX ; + ret =mbox_controller_register (mbox);
while at it, you may want to start using devm_mbox_controller_register() recently added by Thierry.
drivers/mailbox/zynqmp-ipi-mailbox.c line 644
Quoted 6 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +5
-0+if (ret) +dev_err (mdev, +"Failed to register mbox_controller(%d)\n" , ret); +else +dev_info (mdev,"Probed ZynqMP IPI Mailbox driver.\n" );
You may want to also print something instance specific here.
drivers/mailbox/zynqmp-ipi-mailbox.c line 678
Quoted 12 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +11
-0+static int zynqmp_ipi_probe (struct platform_device *pdev) +{ +struct device *dev = &pdev->dev; +struct device_node *nc, *np = pdev->dev.of_node; +struct zynqmp_ipi_pdata *pdata; +struct zynqmp_ipi_mbox *mbox; +int i, ret = -EINVAL ; + + i =0 ; +for_each_available_child_of_node (np, nc) + i++;
of_get_child_count() ?
Thnx
RE: [PATH v7 1/2] mailbox: ZynqMP IPI mailbox controller
Quoted 42 lines
-----Original Message-----
From: Jassi Brar [mailto:[email protected]]
Sent: Friday, December 21, 2018 6:00 PM
To: Jiaying Liang <[email protected]>
Cc: Michal Simek <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Linux Kernel Mailing List <linux- [email protected]>; [email protected]; Devicetree List <[email protected]>
Subject: Re: [PATH v7 1/2] mailbox: ZynqMP IPI mailbox controllerQuoted 7 lines · Wendy Liang
drivers/mailbox/zynqmp-ipi-mailbox.c new file +0
-0@@ -0,0 +1,764 @@......
drivers/mailbox/zynqmp-ipi-mailbox.c
Quoted 3 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +3
-0+ +/* IPI SMC Macros */ +#define IPI_SMC_OPEN_IRQ_MASK 0x00000001UL/* IRQ enable bit in IPI
drivers/mailbox/zynqmp-ipi-mailbox.c
Quoted 3 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +3
-0+* open SMC call +*/ +#define IPI_SMC_NOTIFY_BLOCK_MASK 0x00000001UL/* Flag to indicate if
drivers/mailbox/zynqmp-ipi-mailbox.c
Quoted 4 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +4
-0+* IPI notification needs +* to be blocking. +*/ +#define IPI_SMC_ENQUIRY_DIRQ_MASK 0x00000001UL/* Flag to indicate if
drivers/mailbox/zynqmp-ipi-mailbox.c
Quoted 4 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +4
-0+* notification interrupt +* to be disabled. +*/ +#define IPI_SMC_ACK_EIRQ_MASK 0x00000001UL/* Flag to indicate
Quoted 6 lines
if
drivers/mailbox/zynqmp-ipi-mailbox.c line 55
Quoted 4 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +4
-0+* notification interrupt +* to be enabled. +*/ +The first two are unused.
[Wendy] Will remove the unused macros
Quoted 8 lines
drivers/mailbox/zynqmp-ipi-mailbox.c line 117
Quoted 7 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +4
-0+struct zynqmp_ipi_pdata { +struct device *dev; +int irq; +unsigned int method;'method' doesn't track the HVC option in the driver. Please have a look.
[Wendy] I will add one more checking in the function implementation to check HVC and error if it is neither SMC nor HVC.
Quoted 10 lines
......
drivers/mailbox/zynqmp-ipi-mailbox.c line 132
Quoted 7 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +6
-0+ +static void zynqmp_ipi_fw_call (struct zynqmp_ipi_mbox *ipi_mbox, +unsigned long a0,unsigned long a3, +unsigned long a4,unsigned long a5, +unsigned long a6,unsigned long a7, +struct arm_smccc_res *res)[a4,a7] are always 0, so maybe just drop them?
[Wendy] Will drop them from the API, and set them to 0.
Quoted 29 lines
Quoted 17 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +15
-0+static bool zynqmp_ipi_last_tx_done (struct mbox_chan *chan) { +struct device *dev = chan->mbox->dev; +struct zynqmp_ipi_mbox *ipi_mbox =dev_get_drvdata (dev); +struct zynqmp_ipi_mchan *mchan = chan->con_priv; +int ret; +u64 arg0; +struct arm_smccc_res res; +struct zynqmp_ipi_message *msg; + +if (WARN_ON (!ipi_mbox)) { +dev_err (dev,"no platform drv data??\n" ); +return false; + } + +if (mchan->chan_type ==IPI_MB_CHNL_TX ) {drivers/mailbox/zynqmp-ipi-mailbox.c line 261
Quoted 10 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +10
-0+/* We only need to check if the message been taken +* by the remote in the TX channel +*/ + arg0 =SMC_IPI_MAILBOX_STATUS_ENQUIRY ; +zynqmp_ipi_fw_call (ipi_mbox, arg0,0 ,0 ,0 ,0 ,0 , &res); +/* Check the SMC call status, a0 of the result */ + ret = (int )(res.a0 &0xFFFFFFFF ); +if (ret <0 || ret &IPI_MB_STATUS_SEND_PENDING ) +return false; +OK, but ...
Quoted 6 lines
drivers/mailbox/zynqmp-ipi-mailbox.c line 265
Quoted 5 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +4
-0+ msg = mchan->rx_buf; + msg->len = mchan->resp_buf_size; +memcpy_fromio (msg->data, mchan->resp_buf, msg->len); +mbox_chan_received_data (chan, (void *)msg);.... wouldn't this be done from
zynqmp_ipi_interrupt()?
[Wendy] The IPI hardware supports both the synchronous mode and Asynchronous mode.
The rx interrupt used for remote to notify host, or for responding asynchronous Request. In synchronous mode, the IPI hardware allow remote to write response To the tx response buffer, and the host side can poll the observation register And get the response if the remote has acked.
The last_tx_done is implemented for this purpose.
Quoted 28 lines
Quoted 4 lines
+static int
zynqmp_ipi_send_data(struct mbox_chan *chan, void *data){.........
Quoted 13 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +12
-0+/* Enquire if the mailbox is free to send message */ + arg0 =SMC_IPI_MAILBOX_STATUS_ENQUIRY ; + timeout =10 ; +if (msg && msg->len) { + timeout =10 ; + do { + zynqmp_ipi_fw_call(ipi_mbox, arg0, + 0, 0, 0, 0, 0, &res); + ret = res.a0 & 0xFFFFFFFF; + if (ret >= 0 && + !(ret & IPI_MB_STATUS_SEND_PENDING)) + break;drivers/mailbox/zynqmp-ipi-mailbox.c line 325
Quoted 10 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +10
-0+usleep_range (1 ,2 ); + timeout--; + }while (timeout); +if (!timeout) { +dev_warn (dev,"chan %d sending msg timeout.\n" , + ipi_mbox->remote_id); +return -ETIME ; + } +memcpy_toio (mchan->req_buf, msg->data, msg->len); + }
Quoted 2 lines
This check should be done in
last_tx_done, and not here.send_datais never called unlesslast_tx_donereturns true.
[Wendy] will remove it.
Quoted 17 lines
Quoted 16 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +14
-0+/* Kick IPI mailbox to send message */ + arg0 =SMC_IPI_MAILBOX_NOTIFY ; +zynqmp_ipi_fw_call (ipi_mbox, arg0,0 ,0 ,0 ,0 ,0 , &res); + }else { +/* Send response message */ +if (msg && msg->len > mchan->resp_buf_size) { +dev_err (dev,"channel %d message length %u > max %lu\n" , + mchan->chan_type, (unsigned int )msg->len, + mchan->resp_buf_size); +return -EINVAL ; + } +if (msg && msg->len) +memcpy_toio (mchan->resp_buf, msg->data, + msg->len);
Quoted 4 lines
drivers/mailbox/zynqmp-ipi-mailbox.c
Quoted 3 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +2
-0+ arg0 =SMC_IPI_MAILBOX_NOTIFY ; + arg0 =SMC_IPI_MAILBOX_ACK ;This is obviously wrong.
[Wendy] will fix
Quoted 11 lines
....
drivers/mailbox/zynqmp-ipi-mailbox.c line 639
Quoted 9 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +2
-0+ mbox->chans = chans; + chans[IPI_MB_CHNL_TX].con_priv = &ipi_mbox-mchans[IPI_MB_CHNL_TX];
+ chans[IPI_MB_CHNL_RX].con_priv = &ipi_mbox-
mchans[IPI_MB_CHNL_RX];drivers/mailbox/zynqmp-ipi-mailbox.c new file +3
-0+ ipi_mbox->mchans[IPI_MB_CHNL_TX ].chan_type =IPI_MB_CHNL_TX ; + ipi_mbox->mchans[IPI_MB_CHNL_RX ].chan_type =IPI_MB_CHNL_RX ; + ret =mbox_controller_register (mbox);
Quoted 2 lines
while at it, you may want to start using
devm_mbox_controller_register()recently added by Thierry.
[Wendy] will take a look at this function call
Quoted 8 lines
drivers/mailbox/zynqmp-ipi-mailbox.c line 644
Quoted 7 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +5
-0+if (ret) +dev_err (mdev, +"Failed to register mbox_controller(%d)\n" , ret); +else +dev_info (mdev,"Probed ZynqMP IPI Mailbox driver.\n" );You may want to also print something instance specific here.
[Wendy] will add more information such as the number of channels.
Quoted 14 lines
drivers/mailbox/zynqmp-ipi-mailbox.c line 678
Quoted 13 lines
drivers/mailbox/zynqmp-ipi-mailbox.c new file +10
-0+static int zynqmp_ipi_probe (struct platform_device *pdev) { +struct device *dev = &pdev->dev; +struct device_node *nc, *np = pdev->dev.of_node; +struct zynqmp_ipi_pdata *pdata; +struct zynqmp_ipi_mbox *mbox; +int i, ret = -EINVAL ; + + i =0 ; +for_each_available_child_of_node (np, nc) + i++;
of_get_child_count()?
[Wendy] Will change.
Thanks,
Wendy
Quoted 3 lines
Thnx