Re: [PATCH] drm/rockchip: fix a -Werror fail on !CONFIG_PM_SLEEP

2021-09-12 Thread Nicolas Frattaroli
ct cdn_dp_device *dp = dev_get_drvdata(dev); > @@ -1135,6 +1136,7 @@ static int cdn_dp_resume(struct device *dev) > > return 0; > } > +#endif > > static int cdn_dp_probe(struct platform_device *pdev) > { Regards, Nicolas Frattaroli

Re: [PATCH 16/28] drm/scheduler: use new iterator in drm_sched_job_add_implicit_dependencies v2

2021-10-17 Thread Nicolas Frattaroli
3d horse back to spinning. It's possible this patch just uncovers a bug in lima, so I've added the lima list as a recipient to this reply as well. Since I doubt AMD has many Rockchip SoCs laying about, I'll gladly test any prospective fixes for this. Regards, Nicolas Frattaroli

Re: [PATCH] drm/scheduler: fix drm_sched_job_add_implicit_dependencies

2021-10-19 Thread Nicolas Frattaroli
ce); > if (ret) > return ret; > + > + /* Make sure to grab an additional ref on the added fence */ > + dma_fence_get(fence); > } > return 0; > } > Tested-by: Nicolas Frattaroli Fixes it, thank you!

Re: [PATCH] drm/scheduler: fix drm_sched_job_add_implicit_dependencies

2021-10-19 Thread Nicolas Frattaroli
checking for that. Did you review all other > > conversions you've pushed for this kind of bug? > > Yeah, currently double checking that. > > > Reviewed-by: Daniel Vetter > > > > Also > > > > Reported-by: Nicolas Frattaroli > > References: htt

Re: [PATCH 12/12] drm: rockchip: Add VOP2 driver

2021-11-17 Thread Nicolas Frattaroli
he monitor. For example, on an old 720p monitor I had laying around: [ 225.732342] rockchip-drm display-subsystem: [drm] Update mode to 1920x1080p60, type: 11 for vp0, output 0x0800 HDMI0 This results in a broken picture (all white with occasional glitches). Somebody else observed the same behaviour on a 1440p monitor. Thanks, Nicolas Frattaroli

Re: [PATCH v3 00/22] drm/rockchip: RK356x VOP2 support

2021-12-20 Thread Nicolas Frattaroli
12] clock handling, no longer hacks needed > - Complete regmap conversion Hi Sascha, for future reference, you can add `-v 3` to your git format-patch command line to mark the whole patch series as PATCH v3 and not just the cover letter. Thanks for your continued work on this, Nicolas Frattaroli

Re: [PATCH 22/22] drm: rockchip: Add VOP2 driver

2021-12-20 Thread Nicolas Frattaroli
if (!res) { > + drm_err(vop2->drm, "failed to get vop2 register byname\n"); > + return -EINVAL; > + } This seems to be the code that triggers it. Any ideas as to what could be causing this? Regards, Nicolas Frattaroli

Re: [PATCH 22/22] drm: rockchip: Add VOP2 driver

2021-12-20 Thread Nicolas Frattaroli
On Montag, 20. Dezember 2021 15:16:55 CET Nicolas Frattaroli wrote: > On Montag, 20. Dezember 2021 12:06:30 CET Sascha Hauer wrote: > > From: Andy Yan > > > > The VOP2 unit is found on Rockchip SoCs beginning with rk3566/rk3568. > > It replaces the VOP unit found

Re: [PATCH 22/22] drm: rockchip: Add VOP2 driver

2021-12-21 Thread Nicolas Frattaroli
K3568_VP_DSP_HTOTAL_HS_END, (h

Re: [PATCH 22/22] drm: rockchip: Add VOP2 driver

2021-12-22 Thread Nicolas Frattaroli
On Dienstag, 21. Dezember 2021 14:44:39 CET Nicolas Frattaroli wrote: > On Montag, 20. Dezember 2021 12:06:30 CET Sascha Hauer wrote: > > From: Andy Yan > > > > The VOP2 unit is found on Rockchip SoCs beginning with rk3566/rk3568. > > It replaces the VOP unit found

Re: [PATCH 08/22] dt-bindings: display: rockchip: dw-hdmi: use "ref" as clock name

2021-12-22 Thread Nicolas Frattaroli
On Mittwoch, 22. Dezember 2021 20:39:58 CET Heiko Stübner wrote: > Am Mittwoch, 22. Dezember 2021, 14:52:51 CET schrieb Rob Herring: > > On Wed, Dec 22, 2021 at 6:47 AM Sascha Hauer wrote: > > > > > > On Tue, Dec 21, 2021 at 10:31:23AM -0400, Rob Herring wrote: > > > > On Mon, Dec 20, 2021 at 12:0

Re: [RFC PATCH 00/16] drm/rockchip: Rockchip EBC ("E-Book Controller") display driver

2022-04-21 Thread Nicolas Frattaroli
e world agreed on not making the name of data structures imply some way they are to be processed, but humanity hasn't gotten there yet. > > Regards, > Andreas > Regards, Nicolas Frattaroli

Re: [PATCH v3 0/3] drm/rockchip: dw_hdmi: Add 4k@30 support

2023-01-18 Thread Nicolas Frattaroli
with unachievable pixelclocks > > drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 40 ----- > 1 file changed, 32 insertions(+), 8 deletions(-) For the whole series: Tested-by: Nicolas Frattaroli Tested on two monitors: Monitor 1 was an Iiyama ProLite G2773HS, which only does 1080p

Re: [PATCH 2/3] ASoC: dt-bindings: Reference common DAI properties

2022-12-04 Thread Nicolas Frattaroli
reset-names:0: 'm' is not one of ['tx-m', 'rx-m'] From schema: /home/fratti/Projekte/linux/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml Apparently we don't have separate resets for tx/rx on i2s2 on this hardware. Should we add 'm' to the allowed reset-names for this case? Cheers, Nicolas Frattaroli

Re: [PATCH 2/3] ASoC: dt-bindings: Reference common DAI properties

2022-12-04 Thread Nicolas Frattaroli
On Sonntag, 4. Dezember 2022 17:47:05 CET Krzysztof Kozlowski wrote: > On 04/12/2022 17:09, Nicolas Frattaroli wrote: > > On Samstag, 3. Dezember 2022 17:04:41 CET Krzysztof Kozlowski wrote: > >> Reference in all sound components which have '#sound-dai-cells' the > &

Re: [PATCH v2 1/7] dt-bindings: npu: rockchip,rknn: Add bindings

2025-04-25 Thread Nicolas Frattaroli
lar NPU design has the IOMMU at an offset of 0xb000 from the core's start of PC, so probably after any core specifics but before the global registers if I hazard a guess. For those without access to the TRM: splitting this up into multiple reg items per core precisely the way the TRM does it would result in no less than 10 reg items on RK3588, if I count correctly. Kind regards, Nicolas Frattaroli

Re: [PATCH v2 4/7] accel/rocket: Add a new driver for Rockchip's NPU

2025-04-25 Thread Nicolas Frattaroli
ne of the two cores enabled. As an aside note, my throwaway rocket-on-RK3576-hacking-branch is at [1] and contains some changes you may want to consider for v3, e.g. [2] and [3]+[4]. In [4], specifically the `domain-supply` part which means the NPU regulators don't have to be always-on. Thou

Re: [PATCH v2 4/7] accel/rocket: Add a new driver for Rockchip's NPU

2025-04-29 Thread Nicolas Frattaroli
me) > +}; > + > +static struct platform_driver rocket_driver = { > + .probe = rocket_probe, > + .remove = rocket_remove, > + .driver = { > + .name = "rocket", > + .pm = pm_ptr(&rocket_pm_ops), > + .of_match_table = dt_match, > + }, > +}; > +module_platform_driver(rocket_driver); > + > +MODULE_LICENSE("GPL"); > +MODULE_DESCRIPTION("DRM driver for the Rockchip NPU IP"); > +MODULE_AUTHOR("Tomeu Vizoso"); > > [...] I'll send a second reply with PM comments on the job stuff in the patch that adds it, since I found something peculiar there while experimenting on RK3576. Kind regards, Nicolas Frattaroli

Re: [PATCH v2 6/7] accel/rocket: Add job submission IOCTL

2025-04-29 Thread Nicolas Frattaroli
submission logic will > + * allocate memory with the GFP_KERNEL flag which can trigger memory > + * reclaim and exposes a lock ordering issue. > + */ > + dma_fence_end_signalling(cookie); > + drm_sched_resubmit_jobs(&core->sched); > + cookie = dma_fence_begin_signalling(); > + > + /* Restart the scheduler */ > + drm_sched_start(&core->sched, 0); > + > + dma_fence_end_signalling(cookie); > +} > > [...] > Kind regards, Nicolas Frattaroli

Re: [PATCH 2/2] drm/rockchip: Fix shutdown when no drm-device is set up

2025-02-26 Thread Nicolas Frattaroli
when the drm-device is never set, or has been > freed up already for example by a probe-defer during the component bind. > > Signed-off-by: Heiko Stuebner > --- > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by

Re: [PATCH v2 1/7] dt-bindings: npu: rockchip,rknn: Add bindings

2025-05-14 Thread Nicolas Frattaroli
On Wednesday, 14 May 2025 17:18:22 Central European Summer Time Tomeu Vizoso wrote: > Hi Nicolas, > > Thanks for looking at this. Some thoughts below: > > On Fri, Apr 25, 2025 at 8:50 PM Nicolas Frattaroli > wrote: > > > > On Tuesday, 25 February 2025 08:55:4

Re: [PATCH v2 1/7] dt-bindings: npu: rockchip,rknn: Add bindings

2025-05-16 Thread Nicolas Frattaroli
On Thursday, 15 May 2025 10:30:14 Central European Summer Time Tomeu Vizoso wrote: > On Wed, May 14, 2025 at 7:50 PM Nicolas Frattaroli > wrote: > > > > On Wednesday, 14 May 2025 17:18:22 Central European Summer Time Tomeu > > Vizoso wrote: > > > Hi Nicolas,

[PATCH] drm/connector: only call HDMI audio helper plugged cb if non-null

2025-05-27 Thread Nicolas Frattaroli
the callback if fn is non-null. This means the .plugged_cb and .plugged_cb_dev members still get appropriately cleared. Fixes: baf616647fe6 ("drm/connector: implement generic HDMI audio helpers") Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/display/drm_hdmi_audio_helper.c | 3 +

Re: [PATCH v3 3/9] drm/rockchip: Add RK3588 DPTX output support

2025-05-27 Thread Nicolas Frattaroli
p_pltfm_driver, > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h > b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h > index c183e82a42a51..2e86ad00979c4 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.h > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.h > @@ -87,6 +87,7 @@ int rockchip_drm_encoder_set_crtc_endpoint_id(struct > rockchip_encoder *rencoder, > struct device_node *np, int port, > int reg); > int rockchip_drm_endpoint_is_subdriver(struct device_node *ep); > extern struct platform_driver cdn_dp_driver; > +extern struct platform_driver dw_dp_driver; > extern struct platform_driver dw_hdmi_rockchip_pltfm_driver; > extern struct platform_driver dw_hdmi_qp_rockchip_pltfm_driver; > extern struct platform_driver dw_mipi_dsi_rockchip_driver; > Other than that, the driver looks great, thank you! I've tested it on my ROCK 5T over DP altmode, where it correctly interfaces with a DP monitor I have through an alt-mode adapter. So feel free to add a Tested-by: Nicolas Frattaroli Kind regards, Nicolas Frattaroli

Re: [PATCH 01/20] bitfield: introduce HWORD_UPDATE bitfield macros

2025-06-16 Thread Nicolas Frattaroli
Hello, On Friday, 13 June 2025 16:52:28 Central European Summer Time Yury Norov wrote: > On Fri, Jun 13, 2025 at 02:54:50PM +0100, Robin Murphy wrote: > > On 2025-06-12 7:56 pm, Nicolas Frattaroli wrote: > > > Hardware of various vendors, but very notably Rockchip, often

Re: [PATCH v7 10/10] arm64: dts: rockchip: enable NPU on ROCK 5B

2025-06-06 Thread Nicolas Frattaroli
Hi Tomeu, On Friday, 6 June 2025 08:28:30 Central European Summer Time Tomeu Vizoso wrote: > From: Nicolas Frattaroli > > The NPU on the ROCK5B uses the same regulator for both the sram-supply > and the npu's supply. Add this regulator, and enable all the NPU bits. > Also ad

[PATCH v2 07/20] drm/rockchip: dsi: switch to FIELD_PREP_WM16* macros

2025-06-23 Thread Nicolas Frattaroli
cks and shifting logic rely on contiguous masks. This is compile-tested only. Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 142 1 file changed, 68 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi

[PATCH v2 05/20] drm/rockchip: lvds: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
ss-trivial case of the 2-bit width instance, the results were checked during development to match all possible input values (0 to 3, inclusive). Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/rockchip_lvds.h | 21 +++-- 1 file changed, 11 insertions(+), 10 deletion

[PATCH v2 04/20] media: synopsys: hdmirx: replace macros with bitfield variants

2025-06-23 Thread Nicolas Frattaroli
ro in hw_bitfield.h, which also gives us additional error checking. The UPDATE/HIWORD_UPDATE macros are left as wrappers around the replacement macros, in order to not rock the boat too much, and keep the changes easy to review. Signed-off-by: Nicolas Frattaroli --- drivers/media/platform/synopsys/h

[PATCH v2 06/20] phy: rockchip-emmc: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
The era of hand-rolled HIWORD_UPDATE macros is over, at least for those drivers that use constant masks. Replace the implementation of the rockchip eMMC PHY driver's HIWORD_UPDATE macro with hw_bitfield.h's FIELD_PREP_WM16. This makes the change more easily reviewable. Signed-off-b

[PATCH v2 08/20] drm/rockchip: vop2: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
alent FIELD_PREP_WM16 instances. This gives us better error checking. Reviewed-by: Cristian Ciocaltea Tested-by: Cristian Ciocaltea Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 1 - drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 15 +-- 2 files ch

[PATCH v2 10/20] drm/rockchip: dw_hdmi_qp: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
with this patch has been tested on both RK3588 and RK3576. On the former, with both present HDMI connectors. Reviewed-by: Cristian Ciocaltea Tested-by: Cristian Ciocaltea Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 68 +- 1

[PATCH v2 09/20] phy: rockchip-samsung-dcphy: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
hw_bitfield.h macro. Still, get rid of FIELD_PREP_HIWORD now that a shared implementation exists, replacing the two instances of it with FIELD_PREP_WM16. This gives us slightly better error checking; the value is now checked to fit in 16 bits. Signed-off-by: Nicolas Frattaroli --- drivers/phy

[PATCH v2 11/20] drm/rockchip: inno-hdmi: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/inno_hdmi.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index db4b4038e51d5a963f9ddad5682824

[PATCH v2 13/20] drm/rockchip: dw_hdmi: switch to FIELD_PREP_WM16* macros

2025-06-23 Thread Nicolas Frattaroli
This was tested on an RK3568 ODROID M1, as well as an RK3399 ROCKPro64. Reviewed-by: Cristian Ciocaltea Tested-by: Cristian Ciocaltea Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 80 + 1 file changed, 36 insertions(+), 44

[PATCH v2 12/20] phy: rockchip-usb: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
f the same macro, and the shifted value helps as well. I do not have the hardware that uses this particular driver, so it's compile-tested only as far as my own testing goes. Signed-off-by: Nicolas Frattaroli --- drivers/phy/rockchip/phy-rockchip-usb.c | 51 +--

[PATCH v2 15/20] net: stmmac: dwmac-rk: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
o not use its own solution here would likely end up harder to review and less pretty for the time being. Signed-off-by: Nicolas Frattaroli --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/

[PATCH v2 14/20] ASoC: rockchip: i2s-tdm: switch to FIELD_PREP_WM16_CONST macro

2025-06-23 Thread Nicolas Frattaroli
ed in initializers. This gives us some compile-time error checking, while keeping the diff very small and easy to review. Acked-by: Mark Brown Signed-off-by: Nicolas Frattaroli --- sound/soc/rockchip/rockchip_i2s_tdm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/soun

[PATCH v2 00/20] BYEWORD_UPDATE: unifying (most) HIWORD_UPDATE macros

2025-06-23 Thread Nicolas Frattaroli
.org/all/aD8hB-qJ4Qm6IFuS@yury/ [1] Signed-off-by: Nicolas Frattaroli --- Changes in v2: - rebase onto next-20250623. This involved solving two conflicts in pcie-dw-rockchip. - move new macros to a new hw_bitfield.h, and rename them to FIELD_PREP_WM16*. All patches in the series have been updated

[PATCH v2 02/20] mmc: dw_mmc-rockchip: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
of it with the new macro, as I could test that they result in an equivalent value. Acked-by: Ulf Hansson Signed-off-by: Nicolas Frattaroli --- drivers/mmc/host/dw_mmc-rockchip.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/driver

[PATCH v2 03/20] soc: rockchip: grf: switch to FIELD_PREP_WM16_CONST macro

2025-06-23 Thread Nicolas Frattaroli
its definition are removed from the driver, as the conversion here is obvious, and static_asserts were used during development to make sure the ones greater than one bit in width were really equivalent. Signed-off-by: Nicolas Frattaroli --- drivers/soc/rockchip/grf.c | 35

[PATCH v2 01/20] bitmap: introduce hardware-specific bitfield operations

2025-06-23 Thread Nicolas Frattaroli
atter is a version that can be used in initializers, like FIELD_PREP_CONST. Suggested-by: Yury Norov [NVIDIA] Signed-off-by: Nicolas Frattaroli --- MAINTAINERS | 1 + include/linux/hw_bitfield.h | 62 + 2 files changed, 63 insertions(+)

[PATCH v2 17/20] PCI: dw-rockchip: Switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
2 controller), all in RC mode. Acked-by: Bjorn Helgaas Signed-off-by: Nicolas Frattaroli --- drivers/pci/controller/dwc/pcie-dw-rockchip.c | 42 +-- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/drivers/pci/controller/dwc/pci

[PATCH v2 16/20] PCI: rockchip: Switch to FIELD_PREP_WM16* macros

2025-06-23 Thread Nicolas Frattaroli
fits in the register, and also generally less icky code that writes shifted values when it actually just meant to set and clear a handful of bits. Acked-by: Bjorn Helgaas Signed-off-by: Nicolas Frattaroli --- drivers/pci/controller/pcie-rockchip.h | 35 +- 1 file

[PATCH v2 18/20] PM / devfreq: rockchip-dfi: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
n RK3568 ODROID-M1 board, and an RK3588 ROCK 5B board. Signed-off-by: Nicolas Frattaroli --- drivers/devfreq/event/rockchip-dfi.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockc

[PATCH v2 19/20] clk: sp7021: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
This was compile-tested with 32-bit ARM with Clang, no runtime tests were performed as I lack the hardware. However, I verified that fix commit 5c667d5a5a3e ("clk: sp7021: Adjust width of _m in HWM_FIELD_PREP()") is not regressed. No warning is produced. Signed-off-by: Nicolas Frattarol

[PATCH v2 20/20] phy: rockchip-pcie: switch to FIELD_PREP_WM16 macro

2025-06-23 Thread Nicolas Frattaroli
ve. Signed-off-by: Nicolas Frattaroli --- drivers/phy/rockchip/phy-rockchip-pcie.c | 72 ++-- 1 file changed, 21 insertions(+), 51 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-pcie.c b/drivers/phy/rockchip/phy-rockchip-p

Re: [PATCH 01/20] bitfield: introduce HWORD_UPDATE bitfield macros

2025-06-13 Thread Nicolas Frattaroli
Hello, On Friday, 13 June 2025 10:51:15 Central European Summer Time Jani Nikula wrote: > On Thu, 12 Jun 2025, Nicolas Frattaroli > wrote: > > Hardware of various vendors, but very notably Rockchip, often uses > > 32-bit registers where the upper 16-bit half of the regis

Re: [PATCH 17/20] PCI: dw-rockchip: switch to HWORD_UPDATE macro

2025-06-13 Thread Nicolas Frattaroli
Hello, On Friday, 13 June 2025 11:45:22 Central European Summer Time Niklas Cassel wrote: > Hello Nicolas, > > On Thu, Jun 12, 2025 at 08:56:19PM +0200, Nicolas Frattaroli wrote: > > > > PCIE_CLIENT_RC_MODE/PCIE_CLIENT_EP_MODE was another field that wasn't > > s

Re: [PATCH 0/3] arm64: dts: rockchip: Fix HDMI output on RK3576

2025-06-12 Thread Nicolas Frattaroli
list > linux-rockc...@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip > For the whole series: Tested-by: Nicolas Frattaroli This fixes HDMI output for 4K resolutions on my RK3576 ArmSoM Sige5. The DTB checks and bindings checks pass as well. Kind regards, Nicolas Frattaroli

Re: [PATCH 01/20] bitfield: introduce HWORD_UPDATE bitfield macros

2025-06-12 Thread Nicolas Frattaroli
On Thursday, 12 June 2025 21:44:15 Central European Summer Time Jakub Kicinski wrote: > On Thu, 12 Jun 2025 20:56:03 +0200 Nicolas Frattaroli wrote: > > Hardware of various vendors, but very notably Rockchip, often uses > > 32-bit registers where the upper 16-bit half of th

[PATCH 00/20] BYEWORD_UPDATE: unifying (most) HIWORD_UPDATE macros

2025-06-12 Thread Nicolas Frattaroli
@yury/ [1] Signed-off-by: Nicolas Frattaroli --- Nicolas Frattaroli (20): bitfield: introduce HWORD_UPDATE bitfield macros mmc: dw_mmc-rockchip: switch to HWORD_UPDATE macro soc: rockchip: grf: switch to HWORD_UPDATE_CONST macro media: synopsys: hdmirx: replace macros with bi

[PATCH 04/20] media: synopsys: hdmirx: replace macros with bitfield variants

2025-06-12 Thread Nicolas Frattaroli
DATE macro, which also gives us additional error checking. The UPDATE/HIWORD_UPDATE macros are left as wrappers around the bitfield.h macros, in order to not rock the boat too much, and keep the changes easy to review. Signed-off-by: Nicolas Frattaroli --- drivers/media/platform/synopsys/hdmirx/snp

[PATCH 01/20] bitfield: introduce HWORD_UPDATE bitfield macros

2025-06-12 Thread Nicolas Frattaroli
. Signed-off-by: Nicolas Frattaroli --- include/linux/bitfield.h | 47 +++ 1 file changed, 47 insertions(+) diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h index 6d9a53db54b66c0833973c880444bd289d9667b1

[PATCH 03/20] soc: rockchip: grf: switch to HWORD_UPDATE_CONST macro

2025-06-12 Thread Nicolas Frattaroli
definition are removed from the driver, as the conversion here is obvious, and static_asserts were used during development to make sure the ones greater than one bit in width were really equivalent. Signed-off-by: Nicolas Frattaroli --- drivers/soc/rockchip/grf.c | 35

[PATCH 02/20] mmc: dw_mmc-rockchip: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
h the new macro, as I could test that they result in an equivalent value. Signed-off-by: Nicolas Frattaroli --- drivers/mmc/host/dw_mmc-rockchip.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c

[PATCH 16/20] PCI: rockchip: switch to HWORD_UPDATE* macros

2025-06-12 Thread Nicolas Frattaroli
register, and also generally less icky code that writes shifted values when it actually just meant to set and clear a handful of bits. Signed-off-by: Nicolas Frattaroli --- drivers/pci/controller/pcie-rockchip.h | 35 +- 1 file changed, 18 insertions(+), 17 deletions

[PATCH 13/20] drm/rockchip: dw_hdmi: switch to HWORD_UPDATE* macros

2025-06-12 Thread Nicolas Frattaroli
sted on an RK3568 ODROID M1, as well as an RK3399 ROCKPro64. Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 80 + 1 file changed, 36 insertions(+), 44 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drive

[PATCH 15/20] net: stmmac: dwmac-rk: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
s own solution here would likely end up harder to review and less pretty for the time being. Signed-off-by: Nicolas Frattaroli --- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk

[PATCH 14/20] ASoC: rockchip: i2s-tdm: switch to HWORD_UPDATE_CONST macro

2025-06-12 Thread Nicolas Frattaroli
ed in initializers. This gives us some compile-time error checking, while keeping the diff very small and easy to review. Signed-off-by: Nicolas Frattaroli --- sound/soc/rockchip/rockchip_i2s_tdm.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/roc

[PATCH 20/20] phy: rockchip-pcie: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
gned-off-by: Nicolas Frattaroli --- drivers/phy/rockchip/phy-rockchip-pcie.c | 72 ++-- 1 file changed, 21 insertions(+), 51 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-pcie.c b/drivers/phy/rockchip/phy-rockchip-pcie.c index bd44af36c67a5a504801275c1b038

[PATCH 07/20] drm/rockchip: dsi: switch to HWORD_UPDATE* macros

2025-06-12 Thread Nicolas Frattaroli
on contiguous masks. This is compile-tested only. Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 142 1 file changed, 68 insertions(+), 74 deletions(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/driver

[PATCH 08/20] drm/rockchip: vop2: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
alent HWORD_UPDATE instances. This gives us better error checking. Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.h | 1 - drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 14 -- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/gp

[PATCH 05/20] drm/rockchip: lvds: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
ivial case of the 2-bit width instance, the results were checked during development to match all possible input values (0 to 3, inclusive). Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/rockchip_lvds.h | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-)

[PATCH 06/20] phy: rockchip-emmc: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
The era of hand-rolled HIWORD_UPDATE macros is over, at least for those drivers that use constant masks. Replace the implementation of the rockchip eMMC PHY driver's HIWORD_UPDATE macro with bitfield.h's HWORD_UPDATE. This makes the change more easily reviewable. Signed-off-b

[PATCH 12/20] phy: rockchip-usb: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
same macro, and the shifted value helps as well. I do not have the hardware that uses this particular driver, so it's compile-tested only as far as my own testing goes. Signed-off-by: Nicolas Frattaroli --- drivers/phy/rockchip/phy-rockchip-usb.c | 51 + 1 fi

[PATCH 10/20] drm/rockchip: dw_hdmi_qp: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
h has been tested on both RK3588 and RK3576. On the former, with both present HDMI connectors. Signed-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c | 68 +- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/roc

[PATCH 11/20] drm/rockchip: inno-hdmi: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
ned-off-by: Nicolas Frattaroli --- drivers/gpu/drm/rockchip/inno_hdmi.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index db4b4038e51d5a963f9ddad5682824

[PATCH 09/20] phy: rockchip-samsung-dcphy: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
bitfield.h macro. Still, get rid of FIELD_PREP_HIWORD now that a shared implementation exists, replacing the two instances of it with HWORD_UPDATE. This gives us slightly better error checking; the value is now checked to fit in 16 bits. Signed-off-by: Nicolas Frattaroli --- drivers/phy/rockchip/phy

[PATCH 19/20] clk: sp7021: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
s was compile-tested with 32-bit ARM with Clang, no runtime tests were performed as I lack the hardware. However, I verified that fix commit 5c667d5a5a3e ("clk: sp7021: Adjust width of _m in HWM_FIELD_PREP()") is not regressed. No warning is produced. Signed-off-by: Nicolas Frattaroli -

[PATCH 18/20] PM / devfreq: rockchip-dfi: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
ODROID-M1 board, and an RK3588 ROCK 5B board. Signed-off-by: Nicolas Frattaroli --- drivers/devfreq/event/rockchip-dfi.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockc

[PATCH 17/20] PCI: dw-rockchip: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
a 4 bit field. Replace it by actually writing the full values to the field, using the new HWORD_UPDATE macro, which grants us the benefit of better compile-time error checking. This patch was tested on RK3588 (PCIe3 x4 controller), RK3576 (PCIe2 x1 controller) and RK3568 (PCIe x2 controller)

Re: [PATCH 15/20] net: stmmac: dwmac-rk: switch to HWORD_UPDATE macro

2025-06-12 Thread Nicolas Frattaroli
On Thursday, 12 June 2025 21:08:20 Central European Summer Time Andrew Lunn wrote: > On Thu, Jun 12, 2025 at 08:56:17PM +0200, Nicolas Frattaroli wrote: > > The era of hand-rolled HIWORD_UPDATE macros is over, at least for those > > drivers that use constant masks. > >