Commit Graph

1399120 Commits

Author SHA1 Message Date
Phil Elwell
9fcadf1424 lan78xx: Read initial EEE status from DT
Add two new DT properties:
* microchip,eee-enabled  - a boolean to enable EEE
* microchip,tx-lpi-timer - time in microseconds to wait before entering
                           low power state

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Phil Elwell
3efecfb9e2 lan78xx: Enable LEDs and auto-negotiation
For applications of the LAN78xx that don't have valid programmed
EEPROMs or OTPs, enabling both LEDs and auto-negotiation by default
seems reasonable.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2025-11-24 14:23:40 +00:00
Phil Elwell
5b455d8d57 net: lan78xx: Ack pending PHY ints when resetting
lan78xx_link_reset explicitly clears the MAC's view of the PHY's IRQ
status. In doing so it potentially leaves the PHY with a pending
interrupt that will never be acknowledged, at which point no further
interrupts will be generated.

Avoid the problem by acknowledging any pending PHY interrupt after
clearing the MAC's status bit.

See: https://github.com/raspberrypi/linux/issues/2937

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Naushir Patuck
60fa5108ea media: pisp_be: Re-introduce multi-context support
Re-introduce multi-context support that was dropped from the mainline
driver version.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2025-11-24 14:23:40 +00:00
John Cox
5eb903dc0b arm64/dma-mapping: Fix arch_sync_dma_for_device to respect dir parameter
All other architectures do different cache operations depending on the
dir parameter. Fix arm64 to do the same.

This fixes udmabuf operations when syncing for read e.g. when the CPU
reads back a V4L2 decoded frame buffer.

Signed-off-by: John Cox <jc@kynesim.co.uk>
2025-11-24 14:23:40 +00:00
Naushir Patuck
01f12b5305 drivers: media: pisp_be: Add minimal alinment to the format structure
Add a new minimal alignment field to the format structure. This minimal
alignment will be used if a stride has been provided by userland. If no
stride has been provided by userland (bytesperline == 0), the optimal
alignemnt will be used in the stride calculation.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Naushir Patuck
08503a0f1f drivers: meida: pisp_be: Rename format align field
Rename the align field in the format structure to opt_align to indicate
the optimal alignment for the format.

There is no functional change in this commit.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Dave Stevenson
f26f585c6c drm/vc4: plane: Add support for P01[026] and Q01[026] formats
There are now formats defined for 2-plane YUV420 at 10, 12,
and 16 bit depth using the most significant bits of the 16bit
word (P010, P012, and P016), and 3-plane YUV420 at those
depths using the least significant bits of the 16 bit word
(S010, S012, and S016).

VC4_GEN_6 can support all those formats although only composing
using at most 10bits of resolution, so add them as supported
formats for all planes.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Maíra Canal
67c20b9c29 drm/vc4: tests: Use the correct return type in vc4_mock_atomic_add_output()
The function vc4_mock_atomic_add_output() should return a pointer, even
during error treatment. Use the proper macros to create pointers from
the error code.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
2025-11-24 14:23:40 +00:00
Jonathan Bell
fd5d560355 drivers: dwc2: better handle hardware length & alignment issues
The version of the dwc-otg core used in BCM2835 through BCM2712 only does
whole-word writes, as well as needing the documented requirement for DMA
buffers to start on a word boundary.

Also, the alignment method used in the dwc2 driver doesn't handle the
case where the URB has the NO_TRANSFER_DMA_MAP flag set, so reject
buffers that have unaligned DMA start addresses. At least one whole page
should be mapped, so the BCM283x whole-word-write bug should be benign
in this case.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Jacopo Mondi
a2e4a71816 media: pisp_be: Fix pm_runtime underrun in probe
During the probe() routine, the PiSP BE driver needs to power up the
interface in order to identify and initialize the hardware.

The driver resumes the interface by calling the
pispbe_runtime_resume() function directly, without going
through the pm_runtime helpers, but later suspends it by calling
pm_runtime_put_autosuspend().

This causes a PM usage count imbalance at probe time, notified by the
runtime_pm framework with the below message in the system log:

 pispbe 1000880000.pisp_be: Runtime PM usage count underflow!

Fix this by resuming the interface using the pm runtime helpers instead
of calling the resume function directly and use the pm_runtime framework
in the probe() error path. While at it, remove manual suspend of the
interface in the remove() function. The driver cannot be unloaded if in
use, so simply disable runtime pm.

To simplify the implementation, make the driver depend on PM as the
RPI5 platform where the ISP is integrated in uses the PM framework by
default.

Fixes: 12187bd5d4 ("media: raspberrypi: Add support for PiSP BE")
Cc: stable@vger.kernel.org
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2025-11-24 14:23:39 +00:00
Jonathan Bell
5dcb1bf3e8 drivers: dwc2: don't use shifted frame number internally
Shift it in the wrapper function, or scheduling periodic transfers breaks.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Richard Oliver
b007f52fc6 dt-bindings: clock: Add gpio-gate-clock-releasing
Document the gpio-gate-clock-releasing compatible string that enables
acquire/release GPIO semantics on gpio-gated clocks.

Signed-off-by: Richard Oliver <richard.oliver@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Richard Oliver
c1a9acfef0 clk: clk-gpio: Support acquire/release semantics
Add support for the 'gpio-gate-clock-releasing' compatible string. The
behaviour is identical to that of 'gpio-gate-clock' but the gpio is
acquired on 'enable' and released on 'disable'.

Signed-off-by: Richard Oliver <richard.oliver@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Dave Stevenson
beb34bb3a7 drm/probe-helper: Ensure cmdline mode matches interlace mode
drm_helper_probe_add_cmdline_mode was looking for a match for
the width, height, and refresh rate within the EDID modes, but
didn't check the interlacing flag. That meant that with
video=1920x1080@50i would match any 1920x1080@50 mode that was
found.
The converse would be possible too if an interlaced mode with
matching resolution & refresh rate was found first.

Check the interlacing flag as well.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Phil Elwell
0e56f6eb75 brcmfmac: On RPi, 43430 and 43455 are CYW parts
The brcmfmac driver uses the SDIO vendor ID values to identify which
vendor's driver extensions to use. However, the Cypress/Infineon devices
used by Rasperry Pi devices have a vendor ID of 02d0, which is Broadcom.

In order to use the Cypress driver extensions, modify the static mapping
for "43430" and "4345" (sic) to indicate that they are Cypress parts.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Jonathan Bell
dc30fdb974 usb: dwc2: limit "maximum packet size" for split-IN transfers
dwc2_hc_start_transfer() overwrites hc->xfer_len for split-IN transfers.
Drivers may not allocate buffers that are multiples of the endpoint max
packet size, which may cause buffer overruns in the last transfer.

The hardware needs HCTSIZ to be set to a multiple of HCCHAR.MPS, so trim
chan->max_packet in dwc2_assign_and_init_hc().

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Jonathan Bell
bd331e3ea4 usb: dwc2: return correct frame counts with high-speed host
The HFNUM register increments on every microframe in HS mode, and USB
device drivers expect the returned frame count to relate to the overall
frame. Right-shift the returned value by 3 to drop the microframe bits.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Jonathan Bell
b26421ea79 drivers: irq-bcm283x: swizzle interrupts on ARMv7 too
BCM2836 with Cortex-A7 cores has almost the same ARM_LOCAL interrupt
routing logic as BCM2837, so relax the compile guard to CONFIG_SMP not
CONFIG_ARM64.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Jonathan Bell
25d083a237 drivers: irq-bcm2836: preserve unrelated bits in LOCAL_GPU_ROUTING
Interrupts are dispatched round-robin but doing so trampled FIQ routing.
Taking a FIQ on a core without a handler installed is fatal.

Only modify bits 1:0 which are the IRQ route bits.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:39 +00:00
philippe baetens
9c0544e759 media/i2c: Add driver for ams Mira220
Adds a driver for the NIR-enhanced Mira220 1600x1400 global
shutter image sensor.

Signed-off-by: philippe baetens <philippe.baetens@ams-osram.com>
2025-11-24 14:23:39 +00:00
Phil Elwell
c876831ca7 gpiolib: Avoid the hotplug performance reduction
The 6.9 kernel introduced a large patchset [1] designed to make gpiochip
usage safe in the presence of potential hotplugging events. The changes
included protecting every gpiochip access with a claim of an interlock.

Running on a Pi 5 these changes reduce GPIO performance from userspace
by around 10%. The penalty would be proportionally higher from kernel,
as seen by SPI speed reductions.

Patch the gpiolib implementation to remove the protection of gpiochip
accesses. By providing alternative implementations of the relevant
macros, the changes are localised and therefore easier to verify.

See: https://github.com/raspberrypi/linux/issues/6854

[1] https://lwn.net/Articles/960024/

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:38 +00:00
Etienne Buira
7106f40707 firmware/raspberrypi: raise timeout to 3s
Raspberry firmware driver expected said firmware to answer by 1 second.
That seems to work fine for most cases, but with
RPI_FIRMWARE_NOTIFY_DISPLAY_DONE, that IIUC may need to reconfigure a
monitor, i end up reliably having timeouts:
[    2.861407] ------------[ cut here ]------------
[    2.865512] Firmware transaction 0x00030066 timeout
[    2.865549] WARNING: CPU: 3 PID: 42 at drivers/firmware/raspberrypi.c:128 rpi_firmware_property_list+0x21c/0x29c
[    2.880751] CPU: 3 UID: 0 PID: 42 Comm: kworker/u16:1 Not tainted 6.15.0-rc6 #1 PREEMPT
[    2.888944] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT)
[    2.894848] Workqueue: events_unbound deferred_probe_work_func
[    2.900752] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    2.907801] pc : rpi_firmware_property_list+0x21c/0x29c
[    2.913089] lr : rpi_firmware_property_list+0x21c/0x29c
[    2.918376] sp : ffffffc0803139c0
[    2.921725] x29: ffffffc0803139e0 x28: ffffff8040bbef50 x27: ffffff80410c0f40
[    2.928953] x26: ffffffd7055d9e28 x25: ffffffc0801e0008 x24: 0000000000001000
[    2.936179] x23: ffffff80410c1080 x22: 000000000000000a x21: ffffff80410c0f00
[    2.943405] x20: 000000000000000c x19: ffffffc0801e0000 x18: ffffffc08030d0a0
[    2.950632] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[    2.957858] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
[    2.965085] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
[    2.972311] x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000
[    2.979537] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
[    2.986764] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000
[    2.993992] Call trace:
[    2.996458]  rpi_firmware_property_list+0x21c/0x29c (P)
[    3.001747]  rpi_firmware_property+0x70/0xd8
[    3.006064]  vc4_drm_bind+0x12c/0x378
[    3.009765]  try_to_bring_up_aggregate_device+0x22c/0x308
[    3.015230]  __component_add+0xec/0x224
[    3.019106]  component_add+0x14/0x30
[    3.022720]  vc4_hdmi_dev_probe+0x1c/0x40
[    3.026773]  platform_probe+0x68/0xf0
[    3.030474]  really_probe+0xc0/0x3ac
[    3.034088]  __driver_probe_device+0x7c/0x174
[    3.038495]  driver_probe_device+0x40/0x100
[    3.042725]  __device_attach_driver+0x10c/0x1e0
[    3.047308]  bus_for_each_drv+0x88/0x100
[    3.051273]  __device_attach+0xa0/0x1c8
[    3.055151]  device_initial_probe+0x14/0x30
[    3.059381]  bus_probe_device+0xc8/0xcc
[    3.063259]  deferred_probe_work_func+0xb8/0x12c
[    3.067930]  process_one_work+0x160/0x2d4
[    3.071983]  worker_thread+0x2d8/0x400
[    3.075773]  kthread+0x12c/0x208
[    3.079034]  ret_from_fork+0x10/0x20
[    3.082647] ---[ end trace 0000000000000000 ]---

Raising the timeout to 3 seconds (ought to be enough®) doesn't trigger
timeouts anymore for me and proceeds to the next failure.

Signed-off-by: Etienne Buira <etienne.buira@free.fr>
2025-11-24 14:23:38 +00:00
Jonathan Bell
285b56da6b usb: xhci: set Input Slot Context bit in xhci_fixup_endpoint
The Renesas uPD controller is a bit more picky about validating Configure
Endpoint TRBs and requires that bit 0 of the ADD field is 1.

This is mentioned in xhci v1.2 s4.6.6.

Also drop a redundant helper function and reject invalid endpoints.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:38 +00:00
Phil Elwell
06e3e6600d wifi: brcmfmac: Include modinfo for 43456 CLM blob
Listing firmware files in the brcmfmac modinfo helps with e.g. initramfs
creation.

See: https://github.com/raspberrypi/linux/issues/6828

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:38 +00:00
Maíra Canal
7a0064102f drm/v3d: Don't retrieve the clock twice
Upstream commit d3976b4e38 ("drm/v3d: Add clock handling") introduced
clock handling. Therefore, delete the clock handling previously
introduced in downstream.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
2025-11-24 14:23:38 +00:00
Phil Elwell
10dcab8edc watchdog: Reduce severity of release without stop
Distinguish between releasing the watchdog without requesting that it is
stopped, and failing to stop it when requested. The former is standard
behaviour for systemd, while the latter may be unexpected.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:38 +00:00
Dave Stevenson
1170c9d49e drm/vc4: plane: Fix incorrect handling of GEN_6_D in vc4_plane_async_set_fb
A conditional had been left as == GEN_6_C, when it also applied
to GEN_6_D, resulting in an invalid change to the dlist on async
updates.

Fixes: b7b14b31c8 ("drm/vc4: plane: Add support for 2712 D-step.")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:38 +00:00
Umang Jain
905e54511a media: imx335: Support vertical flip
Support vertical flip by setting REG_VREVERSE.
Additional registers also needs to be set per mode, according
to the readout direction (normal/inverted) as mentioned in the
data sheet.

Since the register IMX335_REG_AREA3_ST_ADR_1 is based on the
flip (and is set via vflip related registers), it has been
moved out of the 2592x1944 mode regs.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-24 14:23:38 +00:00
Umang Jain
6a521c6397 media: imx335: Rectify name of mode struct
In commit 81495a59ba ("media: imx335: Fix active area height discrepency")
the height for the mode struct was rectified to '1944'. However, the
name of mode struct is still reflecting to '1940'. Update it.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Tommaso Merciai <tomm.merciai@gmail.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2025-11-24 14:23:38 +00:00
Josh Martinez
967bdc7d42 hwmon: aht10: Fix AHT20 initialization
The existing driver claims AHT20 support in i2c_device_id, but fails to:
1. Use the correct init command (0xBE for AHT20 vs 0xE1 for AHT10)
2. Omit AHT10_MODE_CYC which AHT20 doesn't support/require

Add proper initialization sequence and include "aosong,aht20" in the
device tree match table to fully support the AHT20.

Signed-off-by: Josh Martinez <8892161+joshermar@users.noreply.github.com>
2025-11-24 14:23:38 +00:00
Dave Stevenson
b37a350d4d drm/vc4: plane: Use nearest neighbour filter with YUV444 workaround
As a follow-up to commit ef79eea9e4 ("drm/vc4: plane: Enable scaler
for YUV444 on GEN6"), the image looks a little soft when rendering at
1:1 due to the scaling filter being enabled.

Switch to using the nearest neighbour filter automatically when
not scaling in YUV444 to compensate.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:38 +00:00
Dave Stevenson
950c8a1356 drm/vc4: plane: Enable scaler for YUV444 on GEN6
GEN6 requires the luma scaler to be enabled for YUV444 to
be rendered at 1:1, otherwise the source plane isn't rendered.

Fixes: 076eedaf76 ("drm/vc4: hvs: Add support for BCM2712 HVS")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:38 +00:00
Dave Stevenson
aca8c1d1b0 drm/vc4: plane: Increase UPM allocation size for YUV444
YUV444 support isn't officially supported by the hardware, but
worked if you told it the image was YUV422 with double the width
and altered chroma scaling.

Adding BCM2712 support gained a fetcher memory (UPM). The code
handling UPM allocations didn't have a case for YUV444, so only
allocated based on the base width, and therefore underflowed.

Increase the UPM allocation size for the luma plane of YUV444
to match.

Fixes: 076eedaf76 ("drm/vc4: hvs: Add support for BCM2712 HVS")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Vinay Varma
5048725dc7 media: i2c: imx219: fix binning and rate_factor for 480p and 1232p
At a high FPS with RAW10, there is frame corruption for 480p because the
rate_factor of 2 is used with the normal 2x2 bining [1]. This commit
ties the rate_factor to the selected binning mode. For the 480p mode,
analog 2x2 binning mode with a rate_factor of 2 is always used. For the
1232p mode the normal 2x2 binning mode is used for RAW10 while analog
2x2 binning mode is used for RAW8.

[1] raspberrypi#5493

Signed-off-by: Vinay Varma <varmavinaym@gmail.com>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reworked due to upstream changes
2025-11-24 14:23:37 +00:00
Naushir Patuck
6528d0fd0d drivers: media: imx219: Remove enum binning_mode
The enum binning_mode is redundant, it only uses values from the earlier
defined binning modes. Remove it.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Dave Stevenson
335715ba13 media: i2c: imx219: Restore the 1920x1080 to using a 1:1 PAR
Commit 0af46fbc33 ("media: i2c: imx219: Calculate crop rectangle
dynamically") meant that the 1920x1080 switched from using no binning
to using vertical binning but no horizontal binning.

Restore the original behaviour by ensuring the two binning settings
are the same.

Fixes: 0af46fbc33 ("media: i2c: imx219: Calculate crop rectangle dynamically")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Jonathan Bell
7ffabf70e0 usb: xhci: default to Intel scheme for calculating U1/U2 timeouts
By default, the System Exit Latency and Maximum Exit Latency are used to
calculate hub port U1 and U2 timeout values. This has the effect of
aggressively power-managing a SuperSpeed link but devices are known to
report unfeasibly short device exit latencies in their descriptors,
which under certain usage conditions can significantly degrade
throughput as the link spends longer retraining than being in a useable
state.

The Intel heuristic approach calculates a reasonably large
endpoint-dependent U1 timeout, and uses a minimum U2 timeout that is
several multiples of typical U2 exit latencies.

Add a module parameter that defaults to using this scheme.

This should have the effect of squelching interop edge-cases where LPM
noticeably degrades performance, and avoid the usual workaround where
userspace manually disables it.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Jonathan Bell
15af1e441c PCI: quirks: work around VL805 firmware ASPM meddling
Certain versions of the VL805 firmware manipulate the endpoint Link
Control register to toggle ASPM on/off based on workload, but these
versions also report 0 in the Device Capability Acceptable Latency field
leaving the RC with ASPM disabled.

As it turns out, this EP has a broken L0s implementation so a) override
L1 latency to a sensible value and b) mask L0s.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Jonathan Bell
412feb85c4 PCI: pcie-brcmstb: add more safeguards for clkreq "safe" mode
The existing implementation for clkreq-mode="safe" leaves the HARD_DEBUG
with both control bits clear. This can cause link failure if L1
sub-states are enabled and if either of these conditions occurrs:

- The platform does not connect the CLRKEQ# signal to the EP, and a
pull-up is present on the line
- The platform connects the signal to the EP, and the EP enters an L1.x
or ClkPM state

Additional register bits in the HARD_DEBUG register can be used to force
the RC to drive CLKREQ# low. Also, un-advertise L1ss as a) additional
power savings can't be realised and b) enabling L1ss may incur
additional wake latency from L1.0.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Dave Stevenson
86d4be9502 drm/vc4: plane: Ensure fetch_count is sufficient for hw in SAND mode
The number of words to fetch for SAND formats on vc6 needs to account
for all pixels requested by width.

If cropping fractional pixels, then the width was being increased, but
fetch_count had already been computed. That led to insufficient words
being fetched, and the HVS locked up solid.

Apply the fixup for fractional pixel source cropping before computing
fetch_count.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Dave Stevenson
2f544a1721 drm/vc4: plane: Correct SAND30 word sizing for cropping on BCM2712
BCM2712/vc6 uses 256bit words when reading in P030/SAND128,
increased from 128bit on BCM2711/vc5.

Update the code for cropping the read area to handle the correct
word length.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Jonathan Bell
19f19daa64 PCI: brcmstb: Add link statistics debug features
Add two features that assist in diagnosing link instability issues.

The debugfs additions allow for snapshots of the Physical Layer
statistics registers to be taken, during either free-running capture or
after a hardware-controlled capture interval.

To arm the capture engine (and reset the stats counters), write an
integer N to:
/sys/kernel/debug/pcie@<addr>/stats_trigger

The engine will run forever with a value of 0, or disarm after N
microseconds.

To snapshot the hardware stats counters, write to:
/sys/kernel/debug/pcie@<addr>/stats_snapshot

Reading this file will return the snapshot. If no writes have occurred
since boot, the snapshot will be of the initial link training period.

The ltssm_trace module parameter printk's the states during initial link
startup, in situations where failure to establish the link is a fatal
error.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Phil Elwell
47010c6324 dmaengine: dw-axi-dmac: Fix alignment checks
Remove a bogus memory alignment check - transfers will be run bytewise
if needed - and add a check that the overall length is multiple of the
register size, otherwise there is residue.

See: https://github.com/raspberrypi/linux/issues/6733

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Phil Elwell
796800fe4f dmaengine: dw-axi-dmac: Improve axi_desc_put
axi_desc_put often gets called in error paths, and so can't assume that
the descriptor passed in has been completely initialised. Guard against
unallocated LLIs.

See: https://github.com/raspberrypi/linux/issues/6733

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:37 +00:00
Dave Stevenson
1e93c19b8b drm/vc4: Correct arithmetic for shifting between columns of SAND images
Commit 69dbba71ac ("drm/vc4: Add algorithmic handling for SAND")
lost a multiplication by the tile width when doing the pointer arithmetic
for cropping off columns for vc6.

Correct that computation.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:36 +00:00
Dave Stevenson
ac1f355b1a drm/panel: Add panel driver for Ilitek ILI9806E panel
The Ilitek ILI9806E driver is used in the Pimoroni HyperPixel4
and potentially other displays. Whilst it can support multiple
interfaces, this driver only accounts for SPI configuration and
DPI video data.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:36 +00:00
Jonathan Bell
6fca76dcd5 dt-bindings: PCI: brcmstb: add optional property - "brcm,tperst-clk-ms"
This property can be used to delay deassertion of external fundamental
reset, which may be useful for endpoints that require an extended time for
internal setup to complete.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:36 +00:00
Jonathan Bell
89c085980b PCI: pcie-brcmstb: optionally extend Tperst_clk time
Some endpoints need longer than the minimum Tperst_clk time of 100us
that the PCIe specification allows for, as they may need to sequence
internal resets off the stable output of internal PLLs prior to removal
of fundamental reset. PCIe switches are an especially bad case, in some
cases requiring up to 100 milliseconds for stable downstream link
behaviour.

Parse the DT property brcm,tperst-clk-ms and use this to hold PERST# low
during brcm_pcie_start_link().

The BRCM RC typically outputs 200us of stable refclk before deasserting
PERST#. By masking/forcing the output signal while deasserting the
internal reset, the effect is to extend the length of time that the
refclk is active and stable before PERST# is released.

The TX lanes will enter the Polling state before PERST# is released, but
this appears to be harmless.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:36 +00:00
Jonathan Bell
3fd628bc68 dt-bindings: pci: pcie-brcmstb: add optional brcm,tperst-clk-ms property
Some platforms may require an extended time with refclk active before
PERST# is released. Add a property to let the RC driver know how long to
wait.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:36 +00:00