* [PATCH v4 0/2] Exynos850 AP-to-APM mailbox support
@ 2026-07-09 14:45 Alexey Klimov
2026-07-09 14:45 ` [PATCH v4 1/2] dt-bindings: mailbox: google,gs101-mbox: Add samsung,exynos850-mbox Alexey Klimov
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Alexey Klimov @ 2026-07-09 14:45 UTC (permalink / raw)
To: Krzysztof Kozlowski, Sam Protsenko, Rob Herring, Conor Dooley,
Tudor Ambarus, Peter Griffin, Jassi Brar, Alim Akhtar,
Peter Griffin
Cc: Krzysztof Kozlowski, linux-samsung-soc, linux-arm-kernel,
devicetree, linux-kernel, Krzysztof Kozlowski
This patch series introduces support for the AP-to-APM mailbox on the
Exynos850 SoC. This mailbox is required for communicating with the APM
co-processor using ACPM.
The Exynos850 mailbox operates similarly to the existing gs101
implementation, but the register offsets and IRQ mask bits differ.
This series abstracts these differences into platform-specific data
structures matched via the device tree.
It will be appreciated if it can be tested on gs101 to make sure that I
didn't break anything.
Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
Changes in v4:
- updated regs, masks types to u32 (as requested by Tudor)
- device_get_match_data() moved to the beginning of probe routine
(requested by Tudor)
- number of channels selection moved to driver data struct,
added description for that field, data->num_chans is used in probe
(requested by Tudor)
- new define for Exynos850 is added to hardcode the number
of channels
- updated trailers via b4
- Link to v3: https://lore.kernel.org/r/20260429-exynos850-ap2apm-mailbox-v3-0-8e2719608c46@linaro.org
Changes in v3:
- exynos850 dts change is split out to a separate patch;
- updated commit messages to a proper name AP-to-APM;
- added comment "ring the doorbell" right before generating an IRQ to APM;
- renamed regs callback names to intgr, intgr_shift, intmr, intmr_mask;
- Link to v2: https://lore.kernel.org/r/20260402-exynos850-ap2apm-mailbox-v2-0-ca5ffdff99d4@linaro.org
Changes in v2:
- dropped clock patches (they seem to be merged);
- patch 3: updated commit description mentioning that
exynos850 is not compatible to gs101 mbox (as suggested by Krzysztof);
- fixed comment description for struct exynos_mbox_driver_data
(reported by kernel test robot <lkp@intel.com>);
- Link to v1: https://lore.kernel.org/r/20260320-exynos850-ap2apm-mailbox-v1-0-983eb3f296fc@linaro.org
---
Alexey Klimov (2):
dt-bindings: mailbox: google,gs101-mbox: Add samsung,exynos850-mbox
mailbox: exynos: Add support for Exynos850 mailbox
.../bindings/mailbox/google,gs101-mbox.yaml | 4 +-
drivers/mailbox/exynos-mailbox.c | 72 ++++++++++++++++++++--
2 files changed, 69 insertions(+), 7 deletions(-)
---
base-commit: b9810cd75b9fb56a3425d391cba3f608502bd474
change-id: 20260320-exynos850-ap2apm-mailbox-cff0c8d69898
Best regards,
--
Alexey Klimov <alexey.klimov@linaro.org>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v4 1/2] dt-bindings: mailbox: google,gs101-mbox: Add samsung,exynos850-mbox 2026-07-09 14:45 [PATCH v4 0/2] Exynos850 AP-to-APM mailbox support Alexey Klimov @ 2026-07-09 14:45 ` Alexey Klimov 2026-07-09 14:45 ` [PATCH v4 2/2] mailbox: exynos: Add support for Exynos850 mailbox Alexey Klimov 2026-08-13 10:53 ` [PATCH v4 0/2] Exynos850 AP-to-APM mailbox support Alexey Klimov 2 siblings, 0 replies; 6+ messages in thread From: Alexey Klimov @ 2026-07-09 14:45 UTC (permalink / raw) To: Krzysztof Kozlowski, Sam Protsenko, Rob Herring, Conor Dooley, Tudor Ambarus, Peter Griffin, Jassi Brar, Alim Akhtar, Peter Griffin Cc: Krzysztof Kozlowski, linux-samsung-soc, linux-arm-kernel, devicetree, linux-kernel, Krzysztof Kozlowski Document support for a mailbox present on Exynos850-based platforms. The registers offsets are different from gs101 mailbox, but the workflow is similar, hence new compatible. Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org> --- Documentation/devicetree/bindings/mailbox/google,gs101-mbox.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mailbox/google,gs101-mbox.yaml b/Documentation/devicetree/bindings/mailbox/google,gs101-mbox.yaml index e249db4c1fbc..c109c1f7af24 100644 --- a/Documentation/devicetree/bindings/mailbox/google,gs101-mbox.yaml +++ b/Documentation/devicetree/bindings/mailbox/google,gs101-mbox.yaml @@ -20,7 +20,9 @@ description: properties: compatible: - const: google,gs101-mbox + enum: + - google,gs101-mbox + - samsung,exynos850-mbox reg: maxItems: 1 -- 2.51.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v4 2/2] mailbox: exynos: Add support for Exynos850 mailbox 2026-07-09 14:45 [PATCH v4 0/2] Exynos850 AP-to-APM mailbox support Alexey Klimov 2026-07-09 14:45 ` [PATCH v4 1/2] dt-bindings: mailbox: google,gs101-mbox: Add samsung,exynos850-mbox Alexey Klimov @ 2026-07-09 14:45 ` Alexey Klimov 2026-07-16 8:55 ` Tudor Ambarus 2026-07-23 12:25 ` Peter Griffin 2026-08-13 10:53 ` [PATCH v4 0/2] Exynos850 AP-to-APM mailbox support Alexey Klimov 2 siblings, 2 replies; 6+ messages in thread From: Alexey Klimov @ 2026-07-09 14:45 UTC (permalink / raw) To: Krzysztof Kozlowski, Sam Protsenko, Rob Herring, Conor Dooley, Tudor Ambarus, Peter Griffin, Jassi Brar, Alim Akhtar, Peter Griffin Cc: Krzysztof Kozlowski, linux-samsung-soc, linux-arm-kernel, devicetree, linux-kernel, Krzysztof Kozlowski Exynos850-based platforms support ACPM and has similar workflow of communicating with ACPM via mailbox, however mailbox controller registers are located at different offsets and writes/reads could be different. To distinguish between such different behaviours, the registers offsets for Exynos850 and the platform-specific data structs are introduced and configuration is described in such structs for gs101 and exynos850 based SoCs. Probe routine now selects the corresponding platform-specific data via device_get_match_data(). Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org> --- drivers/mailbox/exynos-mailbox.c | 72 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/drivers/mailbox/exynos-mailbox.c b/drivers/mailbox/exynos-mailbox.c index fa02f18948cf..ff75c1c7633c 100644 --- a/drivers/mailbox/exynos-mailbox.c +++ b/drivers/mailbox/exynos-mailbox.c @@ -24,14 +24,60 @@ #define EXYNOS_MBOX_CHAN_COUNT HWEIGHT32(EXYNOS_MBOX_INTGR1_MASK) +#define EXYNOS850_MBOX_INTGR0 0x8 /* Interrupt Generation Register 0 */ +#define EXYNOS850_MBOX_INTMR1 0x24 /* Interrupt Mask Register 1 */ + +#define EXYNOS850_MBOX_INTMR1_MASK GENMASK(15, 0) +#define EXYNOS850_MBOX_INTGR0_MASK GENMASK(31, 16) + +#define EXYNOS850_MBOX_CHAN_COUNT HWEIGHT32(EXYNOS850_MBOX_INTGR0_MASK) + +/** + * struct exynos_mbox_driver_data - platform-specific mailbox configuration. + * @intgr: offset to the IRQ generation register, doorbell + * to APM co-processor. + * @intgr_shift: shift to apply to the value written to IRQ generation + * register. + * @intmr: offset to the IRQ mask register. + * @intmr_mask: value to write to the mask register to mask out all + * interrupts. + * @num_chans: number of channels the mailbox can support (hardware + * capability). + */ +struct exynos_mbox_driver_data { + u32 intgr; + u32 intgr_shift; + u32 intmr; + u32 intmr_mask; + int num_chans; +}; + /** * struct exynos_mbox - driver's private data. * @regs: mailbox registers base address. * @mbox: pointer to the mailbox controller. + * @data: pointer to driver platform-specific data. */ struct exynos_mbox { void __iomem *regs; struct mbox_controller *mbox; + const struct exynos_mbox_driver_data *data; +}; + +static const struct exynos_mbox_driver_data exynos850_mbox_data = { + .intgr = EXYNOS850_MBOX_INTGR0, + .intgr_shift = 16, + .intmr = EXYNOS850_MBOX_INTMR1, + .intmr_mask = EXYNOS850_MBOX_INTMR1_MASK, + .num_chans = EXYNOS850_MBOX_CHAN_COUNT, +}; + +static const struct exynos_mbox_driver_data exynos_gs101_mbox_data = { + .intgr = EXYNOS_MBOX_INTGR1, + .intgr_shift = 0, + .intmr = EXYNOS_MBOX_INTMR0, + .intmr_mask = EXYNOS_MBOX_INTMR0_MASK, + .num_chans = EXYNOS_MBOX_CHAN_COUNT, }; static int exynos_mbox_send_data(struct mbox_chan *chan, void *data) @@ -50,7 +96,9 @@ static int exynos_mbox_send_data(struct mbox_chan *chan, void *data) return -EINVAL; } - writel(BIT(msg->chan_id), exynos_mbox->regs + EXYNOS_MBOX_INTGR1); + /* Ring the doorbell */ + writel(BIT(msg->chan_id) << exynos_mbox->data->intgr_shift, + exynos_mbox->regs + exynos_mbox->data->intgr); return 0; } @@ -80,19 +128,31 @@ static struct mbox_chan *exynos_mbox_of_xlate(struct mbox_controller *mbox, } static const struct of_device_id exynos_mbox_match[] = { - { .compatible = "google,gs101-mbox" }, + { + .compatible = "google,gs101-mbox", + .data = &exynos_gs101_mbox_data + }, + { + .compatible = "samsung,exynos850-mbox", + .data = &exynos850_mbox_data + }, {}, }; MODULE_DEVICE_TABLE(of, exynos_mbox_match); static int exynos_mbox_probe(struct platform_device *pdev) { + const struct exynos_mbox_driver_data *data; struct device *dev = &pdev->dev; struct exynos_mbox *exynos_mbox; struct mbox_controller *mbox; struct mbox_chan *chans; struct clk *pclk; + data = device_get_match_data(&pdev->dev); + if (!data) + return -ENODEV; + exynos_mbox = devm_kzalloc(dev, sizeof(*exynos_mbox), GFP_KERNEL); if (!exynos_mbox) return -ENOMEM; @@ -101,8 +161,7 @@ static int exynos_mbox_probe(struct platform_device *pdev) if (!mbox) return -ENOMEM; - chans = devm_kcalloc(dev, EXYNOS_MBOX_CHAN_COUNT, sizeof(*chans), - GFP_KERNEL); + chans = devm_kcalloc(dev, data->num_chans, sizeof(*chans), GFP_KERNEL); if (!chans) return -ENOMEM; @@ -115,7 +174,8 @@ static int exynos_mbox_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(pclk), "Failed to enable clock.\n"); - mbox->num_chans = EXYNOS_MBOX_CHAN_COUNT; + exynos_mbox->data = data; + mbox->num_chans = data->num_chans; mbox->chans = chans; mbox->dev = dev; mbox->ops = &exynos_mbox_chan_ops; @@ -126,7 +186,7 @@ static int exynos_mbox_probe(struct platform_device *pdev) platform_set_drvdata(pdev, exynos_mbox); /* Mask out all interrupts. We support just polling channels for now. */ - writel(EXYNOS_MBOX_INTMR0_MASK, exynos_mbox->regs + EXYNOS_MBOX_INTMR0); + writel(data->intmr_mask, exynos_mbox->regs + data->intmr); return devm_mbox_controller_register(dev, mbox); } -- 2.51.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v4 2/2] mailbox: exynos: Add support for Exynos850 mailbox 2026-07-09 14:45 ` [PATCH v4 2/2] mailbox: exynos: Add support for Exynos850 mailbox Alexey Klimov @ 2026-07-16 8:55 ` Tudor Ambarus 2026-07-23 12:25 ` Peter Griffin 1 sibling, 0 replies; 6+ messages in thread From: Tudor Ambarus @ 2026-07-16 8:55 UTC (permalink / raw) To: Alexey Klimov, Krzysztof Kozlowski, Sam Protsenko, Rob Herring, Conor Dooley, Peter Griffin, Jassi Brar, Alim Akhtar Cc: Krzysztof Kozlowski, linux-samsung-soc, linux-arm-kernel, devicetree, linux-kernel, Krzysztof Kozlowski, André Draszik, Juan Yescas Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org> Thanks, Alexey! ta ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v4 2/2] mailbox: exynos: Add support for Exynos850 mailbox 2026-07-09 14:45 ` [PATCH v4 2/2] mailbox: exynos: Add support for Exynos850 mailbox Alexey Klimov 2026-07-16 8:55 ` Tudor Ambarus @ 2026-07-23 12:25 ` Peter Griffin 1 sibling, 0 replies; 6+ messages in thread From: Peter Griffin @ 2026-07-23 12:25 UTC (permalink / raw) To: Alexey Klimov Cc: Krzysztof Kozlowski, Sam Protsenko, Rob Herring, Conor Dooley, Tudor Ambarus, Jassi Brar, Alim Akhtar, Krzysztof Kozlowski, linux-samsung-soc, linux-arm-kernel, devicetree, linux-kernel, Krzysztof Kozlowski On Thu, 9 Jul 2026 at 15:45, Alexey Klimov <alexey.klimov@linaro.org> wrote: > > Exynos850-based platforms support ACPM and has similar workflow > of communicating with ACPM via mailbox, however mailbox controller > registers are located at different offsets and writes/reads could be > different. To distinguish between such different behaviours, > the registers offsets for Exynos850 and the platform-specific data > structs are introduced and configuration is described in such structs > for gs101 and exynos850 based SoCs. Probe routine now selects the > corresponding platform-specific data via device_get_match_data(). > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> > Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org> > --- Reviewed-by: Peter Griffin <peter.griffin@linaro.org> > drivers/mailbox/exynos-mailbox.c | 72 ++++++++++++++++++++++++++++++++++++---- > 1 file changed, 66 insertions(+), 6 deletions(-) > > diff --git a/drivers/mailbox/exynos-mailbox.c b/drivers/mailbox/exynos-mailbox.c > index fa02f18948cf..ff75c1c7633c 100644 > --- a/drivers/mailbox/exynos-mailbox.c > +++ b/drivers/mailbox/exynos-mailbox.c > @@ -24,14 +24,60 @@ > > #define EXYNOS_MBOX_CHAN_COUNT HWEIGHT32(EXYNOS_MBOX_INTGR1_MASK) > > +#define EXYNOS850_MBOX_INTGR0 0x8 /* Interrupt Generation Register 0 */ > +#define EXYNOS850_MBOX_INTMR1 0x24 /* Interrupt Mask Register 1 */ > + > +#define EXYNOS850_MBOX_INTMR1_MASK GENMASK(15, 0) > +#define EXYNOS850_MBOX_INTGR0_MASK GENMASK(31, 16) > + > +#define EXYNOS850_MBOX_CHAN_COUNT HWEIGHT32(EXYNOS850_MBOX_INTGR0_MASK) > + > +/** > + * struct exynos_mbox_driver_data - platform-specific mailbox configuration. > + * @intgr: offset to the IRQ generation register, doorbell > + * to APM co-processor. > + * @intgr_shift: shift to apply to the value written to IRQ generation > + * register. > + * @intmr: offset to the IRQ mask register. > + * @intmr_mask: value to write to the mask register to mask out all > + * interrupts. > + * @num_chans: number of channels the mailbox can support (hardware > + * capability). > + */ > +struct exynos_mbox_driver_data { > + u32 intgr; > + u32 intgr_shift; > + u32 intmr; > + u32 intmr_mask; > + int num_chans; > +}; > + > /** > * struct exynos_mbox - driver's private data. > * @regs: mailbox registers base address. > * @mbox: pointer to the mailbox controller. > + * @data: pointer to driver platform-specific data. > */ > struct exynos_mbox { > void __iomem *regs; > struct mbox_controller *mbox; > + const struct exynos_mbox_driver_data *data; > +}; > + > +static const struct exynos_mbox_driver_data exynos850_mbox_data = { > + .intgr = EXYNOS850_MBOX_INTGR0, > + .intgr_shift = 16, > + .intmr = EXYNOS850_MBOX_INTMR1, > + .intmr_mask = EXYNOS850_MBOX_INTMR1_MASK, > + .num_chans = EXYNOS850_MBOX_CHAN_COUNT, > +}; > + > +static const struct exynos_mbox_driver_data exynos_gs101_mbox_data = { > + .intgr = EXYNOS_MBOX_INTGR1, > + .intgr_shift = 0, > + .intmr = EXYNOS_MBOX_INTMR0, > + .intmr_mask = EXYNOS_MBOX_INTMR0_MASK, > + .num_chans = EXYNOS_MBOX_CHAN_COUNT, > }; > > static int exynos_mbox_send_data(struct mbox_chan *chan, void *data) > @@ -50,7 +96,9 @@ static int exynos_mbox_send_data(struct mbox_chan *chan, void *data) > return -EINVAL; > } > > - writel(BIT(msg->chan_id), exynos_mbox->regs + EXYNOS_MBOX_INTGR1); > + /* Ring the doorbell */ > + writel(BIT(msg->chan_id) << exynos_mbox->data->intgr_shift, > + exynos_mbox->regs + exynos_mbox->data->intgr); > > return 0; > } > @@ -80,19 +128,31 @@ static struct mbox_chan *exynos_mbox_of_xlate(struct mbox_controller *mbox, > } > > static const struct of_device_id exynos_mbox_match[] = { > - { .compatible = "google,gs101-mbox" }, > + { > + .compatible = "google,gs101-mbox", > + .data = &exynos_gs101_mbox_data > + }, > + { > + .compatible = "samsung,exynos850-mbox", > + .data = &exynos850_mbox_data > + }, > {}, > }; > MODULE_DEVICE_TABLE(of, exynos_mbox_match); > > static int exynos_mbox_probe(struct platform_device *pdev) > { > + const struct exynos_mbox_driver_data *data; > struct device *dev = &pdev->dev; > struct exynos_mbox *exynos_mbox; > struct mbox_controller *mbox; > struct mbox_chan *chans; > struct clk *pclk; > > + data = device_get_match_data(&pdev->dev); > + if (!data) > + return -ENODEV; > + > exynos_mbox = devm_kzalloc(dev, sizeof(*exynos_mbox), GFP_KERNEL); > if (!exynos_mbox) > return -ENOMEM; > @@ -101,8 +161,7 @@ static int exynos_mbox_probe(struct platform_device *pdev) > if (!mbox) > return -ENOMEM; > > - chans = devm_kcalloc(dev, EXYNOS_MBOX_CHAN_COUNT, sizeof(*chans), > - GFP_KERNEL); > + chans = devm_kcalloc(dev, data->num_chans, sizeof(*chans), GFP_KERNEL); > if (!chans) > return -ENOMEM; > > @@ -115,7 +174,8 @@ static int exynos_mbox_probe(struct platform_device *pdev) > return dev_err_probe(dev, PTR_ERR(pclk), > "Failed to enable clock.\n"); > > - mbox->num_chans = EXYNOS_MBOX_CHAN_COUNT; > + exynos_mbox->data = data; > + mbox->num_chans = data->num_chans; > mbox->chans = chans; > mbox->dev = dev; > mbox->ops = &exynos_mbox_chan_ops; > @@ -126,7 +186,7 @@ static int exynos_mbox_probe(struct platform_device *pdev) > platform_set_drvdata(pdev, exynos_mbox); > > /* Mask out all interrupts. We support just polling channels for now. */ > - writel(EXYNOS_MBOX_INTMR0_MASK, exynos_mbox->regs + EXYNOS_MBOX_INTMR0); > + writel(data->intmr_mask, exynos_mbox->regs + data->intmr); > > return devm_mbox_controller_register(dev, mbox); > } > > -- > 2.51.0 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v4 0/2] Exynos850 AP-to-APM mailbox support 2026-07-09 14:45 [PATCH v4 0/2] Exynos850 AP-to-APM mailbox support Alexey Klimov 2026-07-09 14:45 ` [PATCH v4 1/2] dt-bindings: mailbox: google,gs101-mbox: Add samsung,exynos850-mbox Alexey Klimov 2026-07-09 14:45 ` [PATCH v4 2/2] mailbox: exynos: Add support for Exynos850 mailbox Alexey Klimov @ 2026-08-13 10:53 ` Alexey Klimov 2 siblings, 0 replies; 6+ messages in thread From: Alexey Klimov @ 2026-08-13 10:53 UTC (permalink / raw) To: Jassi Brar Cc: Krzysztof Kozlowski, linux-samsung-soc, linux-arm-kernel, devicetree, linux-kernel, Krzysztof Kozlowski, Krzysztof Kozlowski, Sam Protsenko, Rob Herring, Conor Dooley, Tudor Ambarus, Peter Griffin, Alim Akhtar Hi Jassi, On Thu Jul 9, 2026 at 3:45 PM BST, Alexey Klimov wrote: > This patch series introduces support for the AP-to-APM mailbox on the > Exynos850 SoC. This mailbox is required for communicating with the APM > co-processor using ACPM. Gentle ping. Is there anything else should be updated here or is it good to go? Thanks, Alexey ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-08-13 10:53 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-07-09 14:45 [PATCH v4 0/2] Exynos850 AP-to-APM mailbox support Alexey Klimov 2026-07-09 14:45 ` [PATCH v4 1/2] dt-bindings: mailbox: google,gs101-mbox: Add samsung,exynos850-mbox Alexey Klimov 2026-07-09 14:45 ` [PATCH v4 2/2] mailbox: exynos: Add support for Exynos850 mailbox Alexey Klimov 2026-07-16 8:55 ` Tudor Ambarus 2026-07-23 12:25 ` Peter Griffin 2026-08-13 10:53 ` [PATCH v4 0/2] Exynos850 AP-to-APM mailbox support Alexey Klimov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).