* [PATCH v4 00/11] ARM: sunxi: add Allwinner B288 and the PocketBook Verse
@ 2026-10-12 10:08 Pablo Mazzini
2026-10-12 10:08 ` [PATCH v4 05/11] dt-bindings: rtc: sun6i-a31: add Allwinner B288 Pablo Mazzini
2026-10-12 10:08 ` [PATCH v4 06/11] rtc: sun6i: add Allwinner B288 compatible Pablo Mazzini
0 siblings, 2 replies; 5+ messages in thread
From: Pablo Mazzini @ 2026-10-12 10:08 UTC (permalink / raw)
To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
Cc: Pablo Mazzini, Andre Przywara, devicetree, linux-arm-kernel,
linux-clk, linux-gpio, linux-i2c, linux-kernel, linux-rtc,
linux-sunxi, linux-watchdog
The Allwinner B288 (sun8iw10p1) is a dual Cortex-A7 SoC used in e-book
readers. This series adds the CCU and pin controller drivers, the RTC,
I2C, NMI and watchdog compatibles, the SoC .dtsi, and one board: the
PocketBook Verse (PB629), a 6" reader.
The B288 is closest to the A64: most of its PLLs are bit-identical.
The clock and pin descriptions come from Allwinner's BSP, cross-checked
against ccu-sun50i-a64.c. Tested on a PB629, boots to userspace.
The pin controller relies on "pinctrl: sunxi: dt: number the IRQ banks
from the first one that has IRQs" for correct PIO interrupt mapping.
Changes since v3:
- CCU: reference parents with clk_parent_data and clk_hw pointers,
as newer sunxi-ng drivers do; add the audio PLL's sigma-delta
settings, as on the A64; fix the PLL_24M rate and parent the PLLs
to it.
- RTC: register the 32 kHz clocks, reusing the A23 data (Sashiko).
- DTS: take osc32k from the RTC, as on the A64.
- DTS: allow the eMMC up to 150 MHz, as on the A523.
Changes since v2:
- Drop the MMC binding patch, applied by Ulf.
- Rebase onto sunxi/for-next.
- Constrain the RTC clock outputs and pinctrl interrupts in the
bindings (Sashiko).
- Add a B288 watchdog compatible (Andre).
- DTS: drop the memory node, the arch timer workaround and the
sunxi.c entry; add disable-wp and the eMMC 1.8V modes; DLDO1 no
longer always-on; mainline pin function names (Andre).
Changes since v1:
- Add this cover letter.
- Drop both new bindings; add the compatibles to the existing
allwinner,sun4i-a10-{ccu,pinctrl}.yaml instead.
- Rewrite the pinctrl driver in the DT-provided pinmux style.
Pablo Mazzini (11):
dt-bindings: clock: sun4i-a10-ccu: add Allwinner B288
clk: sunxi-ng: add Allwinner B288 CCU driver
dt-bindings: pinctrl: sun4i-a10: add Allwinner B288
pinctrl: sunxi: add Allwinner B288 pin controller driver
dt-bindings: rtc: sun6i-a31: add Allwinner B288
rtc: sun6i: add Allwinner B288 compatible
dt-bindings: i2c: mv64xxx: add Allwinner B288
dt-bindings: interrupt-controller: add Allwinner B288 NMI
dt-bindings: watchdog: sun4i-a10-wdt: add Allwinner B288
dt-bindings: arm: sunxi: add PocketBook Verse
ARM: dts: allwinner: add B288 and the PocketBook Verse
.../devicetree/bindings/arm/sunxi.yaml | 5 +
.../clock/allwinner,sun4i-a10-ccu.yaml | 1 +
.../bindings/i2c/marvell,mv64xxx-i2c.yaml | 1 +
.../allwinner,sun7i-a20-sc-nmi.yaml | 1 +
.../pinctrl/allwinner,sun4i-a10-pinctrl.yaml | 22 +
.../bindings/rtc/allwinner,sun6i-a31-rtc.yaml | 3 +
.../watchdog/allwinner,sun4i-a10-wdt.yaml | 1 +
arch/arm/boot/dts/allwinner/Makefile | 1 +
.../allwinner/sun8i-b288-pocketbook-verse.dts | 114 +++
arch/arm/boot/dts/allwinner/sun8i-b288.dtsi | 292 +++++++
drivers/clk/sunxi-ng/Kconfig | 5 +
drivers/clk/sunxi-ng/Makefile | 1 +
drivers/clk/sunxi-ng/ccu-sun8i-b288.c | 749 ++++++++++++++++++
drivers/clk/sunxi-ng/ccu-sun8i-b288.h | 10 +
drivers/pinctrl/sunxi/Kconfig | 10 +
drivers/pinctrl/sunxi/Makefile | 1 +
drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c | 49 ++
drivers/rtc/rtc-sun6i.c | 5 +
include/dt-bindings/clock/sun8i-b288-ccu.h | 82 ++
include/dt-bindings/reset/sun8i-b288-ccu.h | 45 ++
20 files changed, 1398 insertions(+)
create mode 100644 arch/arm/boot/dts/allwinner/sun8i-b288-pocketbook-verse.dts
create mode 100644 arch/arm/boot/dts/allwinner/sun8i-b288.dtsi
create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-b288.c
create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-b288.h
create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun8i-b288.c
create mode 100644 include/dt-bindings/clock/sun8i-b288-ccu.h
create mode 100644 include/dt-bindings/reset/sun8i-b288-ccu.h
--
2.52.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v4 05/11] dt-bindings: rtc: sun6i-a31: add Allwinner B288
2026-10-12 10:08 [PATCH v4 00/11] ARM: sunxi: add Allwinner B288 and the PocketBook Verse Pablo Mazzini
@ 2026-10-12 10:08 ` Pablo Mazzini
2026-10-12 10:15 ` sashiko-bot
2026-10-12 10:08 ` [PATCH v4 06/11] rtc: sun6i: add Allwinner B288 compatible Pablo Mazzini
1 sibling, 1 reply; 5+ messages in thread
From: Pablo Mazzini @ 2026-10-12 10:08 UTC (permalink / raw)
To: Alexandre Belloni, Chen-Yu Tsai, Conor Dooley, Jernej Skrabec,
Krzysztof Kozlowski, Maxime Ripard, Rob Herring, Samuel Holland
Cc: Pablo Mazzini, Andre Przywara, devicetree, linux-arm-kernel,
linux-kernel, linux-rtc, linux-sunxi
The B288 RTC wires one alarm interrupt, not two.
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
---
.../devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml b/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml
index f2b91186ed37..ebe35f893f8c 100644
--- a/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml
+++ b/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml
@@ -19,6 +19,7 @@ properties:
- enum:
- allwinner,sun6i-a31-rtc
- allwinner,sun8i-a23-rtc
+ - allwinner,sun8i-b288-rtc
- allwinner,sun8i-h3-rtc
- allwinner,sun8i-r40-rtc
- allwinner,sun8i-v3-rtc
@@ -82,6 +83,7 @@ allOf:
contains:
enum:
- allwinner,sun8i-a23-rtc
+ - allwinner,sun8i-b288-rtc
- allwinner,sun8i-r40-rtc
- allwinner,sun8i-v3-rtc
@@ -162,6 +164,7 @@ allOf:
compatible:
contains:
enum:
+ - allwinner,sun8i-b288-rtc
- allwinner,sun8i-r40-rtc
- allwinner,sun50i-h616-rtc
- allwinner,sun50i-r329-rtc
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v4 06/11] rtc: sun6i: add Allwinner B288 compatible
2026-10-12 10:08 [PATCH v4 00/11] ARM: sunxi: add Allwinner B288 and the PocketBook Verse Pablo Mazzini
2026-10-12 10:08 ` [PATCH v4 05/11] dt-bindings: rtc: sun6i-a31: add Allwinner B288 Pablo Mazzini
@ 2026-10-12 10:08 ` Pablo Mazzini
2026-10-12 10:19 ` sashiko-bot
1 sibling, 1 reply; 5+ messages in thread
From: Pablo Mazzini @ 2026-10-12 10:08 UTC (permalink / raw)
To: Alexandre Belloni, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
Cc: Pablo Mazzini, Andre Przywara, linux-arm-kernel, linux-kernel,
linux-rtc, linux-sunxi
The 32 kHz clocks are the same as the A23's. Only one alarm interrupt
is wired, which is all the driver uses.
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
---
drivers/rtc/rtc-sun6i.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
index 7fc60880e409..05004e80ac08 100644
--- a/drivers/rtc/rtc-sun6i.c
+++ b/drivers/rtc/rtc-sun6i.c
@@ -350,6 +350,10 @@ static void __init sun8i_a23_rtc_clk_init(struct device_node *node)
CLK_OF_DECLARE_DRIVER(sun8i_a23_rtc_clk, "allwinner,sun8i-a23-rtc",
sun8i_a23_rtc_clk_init);
+/* The B288 RTC clocks are the same as the A23's */
+CLK_OF_DECLARE_DRIVER(sun8i_b288_rtc_clk, "allwinner,sun8i-b288-rtc",
+ sun8i_a23_rtc_clk_init);
+
static const struct sun6i_rtc_clk_data sun8i_h3_rtc_data = {
.rc_osc_rate = 16000000,
.fixed_prescaler = 32,
@@ -859,6 +863,7 @@ static int sun6i_rtc_probe(struct platform_device *pdev)
static const struct of_device_id sun6i_rtc_dt_ids[] = {
{ .compatible = "allwinner,sun6i-a31-rtc" },
{ .compatible = "allwinner,sun8i-a23-rtc" },
+ { .compatible = "allwinner,sun8i-b288-rtc" },
{ .compatible = "allwinner,sun8i-h3-rtc" },
{ .compatible = "allwinner,sun8i-r40-rtc" },
{ .compatible = "allwinner,sun8i-v3-rtc" },
--
2.52.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v4 05/11] dt-bindings: rtc: sun6i-a31: add Allwinner B288
2026-10-12 10:08 ` [PATCH v4 05/11] dt-bindings: rtc: sun6i-a31: add Allwinner B288 Pablo Mazzini
@ 2026-10-12 10:15 ` sashiko-bot
0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-10-12 10:15 UTC (permalink / raw)
To: Pablo Mazzini
Cc: Alexandre Belloni, robh, devicetree, linux-sunxi, conor+dt,
linux-rtc
> The B288 RTC wires one alarm interrupt, not two.
>
> Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261012100816.331033-1-pmazzini@gmail.com?part=5
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v4 06/11] rtc: sun6i: add Allwinner B288 compatible
2026-10-12 10:08 ` [PATCH v4 06/11] rtc: sun6i: add Allwinner B288 compatible Pablo Mazzini
@ 2026-10-12 10:19 ` sashiko-bot
0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-10-12 10:19 UTC (permalink / raw)
To: Pablo Mazzini; +Cc: Alexandre Belloni, linux-sunxi, linux-rtc
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] rtc: sun6i: missing ERR_PTR check causes crash in probe on clk_register failure
- [Medium] rtc: sun6i: resource leak of losc clock on initialization error path
- [Low] rtc: sun6i: memory leak of rtc structure in sun6i_rtc_clk_init error path
--
commit 903d00f6b5cb6afede9ad6ad5fca01853d776ce4
Author: Pablo Mazzini <pmazzini@gmail.com>
Subject: rtc: sun6i: add Allwinner B288 compatible
This commit adds support for the Allwinner B288 RTC by reusing the A23
clock configuration. It maps the new compatible string
allwinner,sun8i-b288-rtc to the existing initialization functions.
> diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
> index 7fc60880e4094..05004e80ac089 100644
> --- a/drivers/rtc/rtc-sun6i.c
> +++ b/drivers/rtc/rtc-sun6i.c
> @@ -350,6 +350,10 @@ static void __init sun8i_a23_rtc_clk_init(struct device_node *node)
> CLK_OF_DECLARE_DRIVER(sun8i_a23_rtc_clk, "allwinner,sun8i-a23-rtc",
> sun8i_a23_rtc_clk_init);
>
> +/* The B288 RTC clocks are the same as the A23's */
> +CLK_OF_DECLARE_DRIVER(sun8i_b288_rtc_clk, "allwinner,sun8i-b288-rtc",
> + sun8i_a23_rtc_clk_init);
> +
[Severity: High]
Does adding this compatible string expose an issue in the error handling
of sun6i_rtc_clk_init on registration failure?
If clk_register fails for rtc->losc, the function returns an error
pointer and jumps to the err_register label. Since the global sun6i_rtc
pointer is already assigned to the allocated rtc struct earlier:
sun6i_rtc_clk_init()
/* Yes, I know, this is ugly. */
sun6i_rtc = rtc;
...
rtc->losc = clk_register(NULL, &rtc->hw);
if (IS_ERR(rtc->losc)) {
pr_crit("Couldn't register the LOSC clock\n");
goto err_register;
}
The probe function sun6i_rtc_probe later fetches this dangling pointer:
sun6i_rtc_probe()
struct sun6i_rtc_dev *chip = sun6i_rtc;
...
clk_prepare_enable(chip->losc);
Can this lead to a kernel panic when clk_prepare_enable attempts to
dereference the error pointer stored in chip->losc?
[Severity: Medium]
Additionally, if clk_register succeeds for rtc->losc but a later clock
registration fails, triggering the jump to err_register, does this
cleanup path leak the rtc->losc clock?
sun6i_rtc_clk_init()
err_register:
clk_hw_unregister_fixed_rate(rtc->int_osc);
err:
kfree(clk_data);
The err_register path unregisters rtc->int_osc but appears to omit
calling clk_unregister(rtc->losc).
[Severity: Low]
Does the err cleanup path also leak the dynamically allocated rtc
structure?
sun6i_rtc_clk_init()
rtc = kzalloc_obj(*rtc);
...
err:
kfree(clk_data);
The error path frees clk_data but seems to omit freeing the allocated
rtc structure.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261012100816.331033-1-pmazzini@gmail.com?part=6
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-12 10:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 10:08 [PATCH v4 00/11] ARM: sunxi: add Allwinner B288 and the PocketBook Verse Pablo Mazzini
2026-10-12 10:08 ` [PATCH v4 05/11] dt-bindings: rtc: sun6i-a31: add Allwinner B288 Pablo Mazzini
2026-10-12 10:15 ` sashiko-bot
2026-10-12 10:08 ` [PATCH v4 06/11] rtc: sun6i: add Allwinner B288 compatible Pablo Mazzini
2026-10-12 10:19 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox