Dave Stevenson [Tue, 5 Dec 2023 18:28:19 +0000 (18:28 +0000)]
drm/vc4: Correct HVS muxing setup for the moplet
The moplet registers as VC4_ENCODER_TYPE_TXP1 and can be
fed from mux output 2 of HVS channel 1.
Correct the option which checked for VC4_ENCODER_TYPE_TXP0
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Jonathan Bell [Tue, 5 Dec 2023 16:55:17 +0000 (16:55 +0000)]
dts: bcm2712: put usb under /axi not /soc
On 2712, the DWC USB controller is no longer attached to the Videocore
30-bit bus with its associated aliases, and can see the bottom 4GB of
RAM directly.
Ideally it should make use of IOMMU6 but for now software bounce buffers
get it working.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
JinShil [Tue, 28 Nov 2023 08:05:44 +0000 (17:05 +0900)]
overlays: ADS1115: allow specification of the i2c bus
Timon Skerutsch [Mon, 13 Nov 2023 21:52:35 +0000 (22:52 +0100)]
overlays: example overlay for using panel-dsi on RPi
Analog to the generic panel-dpi overlay to use panel-dsi with dtparam
to not require a panel specific overlay for simple use cases that
do not require setting more niche DSI modes.
Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
Timon Skerutsch [Mon, 13 Nov 2023 21:53:22 +0000 (22:53 +0100)]
dt-bindings: display: panel-dsi bindings
Bindings for the panel-dsi specific additions to panel-simple.
Allow for DSI specific bus settings and panel timing
to be define in devicetree. Very similar to panel-dpi.
Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
Timon Skerutsch [Mon, 13 Nov 2023 21:53:12 +0000 (22:53 +0100)]
drm/panel: add panel-dsi
Equivalent to panel-dpi for configuring a simple DSI panel with
device tree side timings and bus settings.
Motiviation is the same as for panel-dpi of wanting to support
new simple panels without needing to patch the kernel.
Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
Phil Elwell [Fri, 1 Dec 2023 16:09:05 +0000 (16:09 +0000)]
bcm270x.dtsi: Fix bad merge
This explains the complaints about alias names from dtc.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Joerg Schambacher [Fri, 29 Sep 2023 15:07:20 +0000 (17:07 +0200)]
ASoC: Adds support for TAS575x to the pcm512x driver
commit
1f817805262c2c34142291da376d4932d3c493bc upstream.
Enables the existing pcm512x driver to control the almost
compatible TAS5754 and -76 amplifers. Both amplifiers support
only an I2C interface and the internal PLL must be always
on to provide necessary clocks to the amplifier section.
Tested on TAS5756 with support from Andreas Arbesser-Krasser
from Texas Instruments <a-krasser@ti.com>
Signed-off-by: Joerg Schambacher <joerg.hifiberry@gmail.com>
Link: https://lore.kernel.org/r/20230929150722.405415-1-joerg.hifiberry@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Joerg Schambacher [Fri, 29 Sep 2023 15:05:55 +0000 (17:05 +0200)]
ASoC: pcm512x: Adds bindings for TAS575x devices
commit
736b884a7b68c4eeb66dbf75b97c8ec9b9eeff7f upstream.
The TAS5754/6 power amplifiers use the same pcm512x driver with
only minor restictions described in the bindings document.
Signed-off-by: Joerg Schambacher <joerg.hifiberry@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230929150555.405388-1-joerg.hifiberry@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Phil Elwell [Thu, 30 Nov 2023 17:16:40 +0000 (17:16 +0000)]
README: show rpi-6.6.y build status
Replace rpi-6.5.y with rpi-6.6.y in the build status list.
Phil Elwell [Tue, 28 Nov 2023 12:14:03 +0000 (12:14 +0000)]
ASoC: dwc: Fix full-duplex mode
Configuration of the DMA register was carelessly zeroing bits that may
used by a stream in the other direction. Preserve them instead.
See: https://github.com/raspberrypi/linux/issues/5741
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Ryan McClelland [Tue, 28 Nov 2023 00:55:08 +0000 (16:55 -0800)]
arch: arm: configs: add HID_NINTENDO to rpi defconfigs
Signed-off-by: Ryan McClelland <rymcclel@gmail.com>
Phil Elwell [Mon, 27 Nov 2023 12:16:04 +0000 (12:16 +0000)]
ASoC: dwc: Permit sample rates up to 384kHz
The BCM2835 I2S block advertises clock rates up to 384kHz, and there's
no reason why RP1's DWC I2S block shouldn't do the same.
See: https://github.com/raspberrypi/linux/issues/5748
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dave Stevenson [Mon, 27 Nov 2023 14:50:58 +0000 (14:50 +0000)]
dtoverlays: Add option for cam0 to camera-mux-Nport overlays
Seeing as the mux can be connected to either CAM/DISP1 or
CAM/DISP0 on a Pi5, add a cam0 override to allow configuration
of which is used. Default (as with all camera overlays) is CAM/DISP1.
The overlay does NOT update the camera regulator used by all the
sensors as doing so would be a nightmare. The Arducam mulitplexer
boards these overlays are initially supporting seem to tie the
regulator GPIO for all the sensors high anyway.
If it was viewed as necessary, then creating an additional
regulator that listed cam[01]_reg as the parent should work.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 24 Nov 2023 14:29:57 +0000 (14:29 +0000)]
drivers: media: cfe: Find the source pads on the sensor entity
The driver was assuming that pad 0 on the sensor entity was the
appropriate source pad, but this isn't necessarily the case.
With video-mux, it has the sink pads first, and then the source
pad as the last one.
Iterate through the sensor pads to find the relevant source pads.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Wed, 9 Aug 2023 20:04:40 +0000 (21:04 +0100)]
drm: panel: jdi-lt070me05000: Add prepare_upstream_first flag
The panel driver wants to send DCS commands from the prepare
hook, therefore the DSI host wants to be pre_enabled first.
Set the flag to achieve this.
https://forums.raspberrypi.com/viewtopic.php?t=354708
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Phil Elwell [Fri, 24 Nov 2023 13:57:09 +0000 (13:57 +0000)]
overlays: hat_map: Add pisound mapping
See: https://github.com/raspberrypi/linux/issues/5741
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Kenny [Thu, 23 Nov 2023 00:22:37 +0000 (16:22 -0800)]
overlays: i2c-sensor: Add adt7410 support
See https://github.com/raspberrypi/linux/pull/5738
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Kenny [Thu, 23 Nov 2023 00:22:37 +0000 (16:22 -0800)]
configs: Add the adt7410 module
Signed-off-by: Kenny <aSmig+github@romhat.net>
Dave Stevenson [Wed, 22 Nov 2023 19:17:44 +0000 (19:17 +0000)]
drm: vc4: Block swiotlb bounce buffers being imported as dmabuf
The dmabuf import already checks that the backing buffer is contiguous
and rejects it if it isn't. vc4 also requires that the buffer is
in the bottom 1GB of RAM, and this is all correctly defined via
dma-ranges.
However the kernel silently uses swiotlb to bounce dma buffers
around if they are in the wrong region. This relies on dma sync
functions to be called in order to copy the data to/from the
bounce buffer.
DRM is based on all memory allocations being coherent with the
GPU so that any updates to a framebuffer will be acted on without
the need for any additional update. This is fairly fundamentally
incompatible with needing to call dma_sync_ to handle the bounce
buffer copies, and therefore we have to detect and reject mappings
that use bounce buffers.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Wed, 8 Nov 2023 16:20:27 +0000 (16:20 +0000)]
input: goodix: Include I2C details in names for the devices
libinput uses the input device name alone. If you have two
identical input devices, then there is no way to differentiate
between them, and in the case of touchscreens that means no
way to associate them with the appropriate display device.
Add the I2C bus and address to the start of the input device
name so that the name is always unique within the system.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Wed, 8 Nov 2023 15:50:39 +0000 (15:50 +0000)]
input: edt-ft5x06: Include I2C details in names for the devices
libinput uses the input device name alone. If you have two
identical input devices, then there is no way to differentiate
between them, and in the case of touchscreens that means no
way to associate them with the appropriate display device.
Add the I2C bus and address to the start of the input device
name so that the name is always unique within the system.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Wed, 22 Nov 2023 18:36:54 +0000 (18:36 +0000)]
drm: vc4: Free the dlist alloc immediately if it never hit the hw
atomic_check creates a state, and allocates the dlist memory for
it such that atomic_flush can not fail.
On destroy that dlist allocation was being put in the stale list,
even though it had never been programmed into the hardware,
therefore doing lots of atomic_checks could consume all the dlist
memory and fail.
If the dlist has never been programmed into the hardware, then
free it immediately.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 17 Nov 2023 14:50:11 +0000 (14:50 +0000)]
drm/bridge: display-connector: Select DRM_KMS_HELPER
Commit
7cd70656d128 ("drm/bridge: display-connector: implement
bus fmts callbacks") added use of drm_atomic_helper_bridge_*
functions, but didn't select the dependency of DRM_KMS_HELPER.
If nothing else selected that dependency it resulted in a
build failure.
Select the missing dependency.
Fixes:
7cd70656d128 ("drm/bridge: display-connector: implement bus fmts callbacks")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 17 Nov 2023 14:43:44 +0000 (14:43 +0000)]
drm/vc4: Drop planes that are completely off-screen
It is permitted for a plane to be configured such that none
of it is on-screen via either negative dest rectangle X,Y
offset, or just an offset that is greater than the crtc
dimensions.
These planes were resized via drm_atomic_helper_check_plane_state
such that the source rectangle had a zero width or height, but
they still created a dlist entry even though they contributed
no pixels. In the case of vc6_plane_mode_set, that it could result
in negative values being written into registers, which caused
incorrect behaviour.
Drop planes that result in a source width or height of 0 pixels
to avoid the incorrect rendering.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 14 Nov 2023 18:36:19 +0000 (18:36 +0000)]
media/i2c: ov7251: Switch from V4L2_CID_GAIN to V4L2_CID_ANALOGUE_GAIN
The mainline driver has implemented analogue gain using the control
V4L2_CID_GAIN instead of V4L2_CID_ANALOGUE_GAIN.
libcamera requires V4L2_CID_ANALOGUE_GAIN, and therefore fails.
Update the driver to use V4L2_CID_ANALOGUE_GAIN.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 24 Nov 2023 16:22:10 +0000 (16:22 +0000)]
drm/vc4: vec: Add the margin properties to the connector
All the handling for the properties was present, but they
were never attached to the connector to allow userspace
to change them.
Add them to the connector.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Phil Elwell [Tue, 21 Nov 2023 15:08:38 +0000 (15:08 +0000)]
overlays: README: Fix cut-and-paste errors
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Tue, 21 Nov 2023 11:54:28 +0000 (11:54 +0000)]
configs: bcm2712_defconfig: Change LOCALVERSION
Debian seem to have rules about the content of the LOCALVERSION config
setting. Specifically, the underscore is not accepted.
Change it to a dash/hyphen.
See: https://github.com/raspberrypi/linux/issues/5719
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dom Cobley [Tue, 21 Nov 2023 12:55:03 +0000 (12:55 +0000)]
Revert "hwrng: bcm2835 - sleep more intelligently"
This reverts commit
6a825ed68f75bd768e31110ba825b75c5c09cf2d.
Phil Elwell [Mon, 20 Nov 2023 15:17:34 +0000 (15:17 +0000)]
ASoC: dwc: Remove check in set_bclk_ratio handling
A check added to dw_i2s_set_bclk_ratio that the data format is
consistent with the ratio seems reasonable but breaks when the
ratio is changed before the format. Remove the check - it is
unnecessary.
See: https://github.com/raspberrypi/linux/issues/5724
Fixes:
9c6694c24f26 ("ASOC: dwc: Fix 16-bit audio handling")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Naushir Patuck [Thu, 16 Nov 2023 14:29:47 +0000 (14:29 +0000)]
drivers: media: pisp_be: Add mono and 48-bit RGB pixel format support
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Thu, 16 Nov 2023 14:28:55 +0000 (14:28 +0000)]
drivers: media: cfe: Add 16-bit and compressed mono format support
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Thu, 16 Nov 2023 14:25:39 +0000 (14:25 +0000)]
include: uapi: v4l2: Add additional pixel formats for use with PiSP
Add the following formats:
- V4L2_PIX_FMT_RGB48/V4L2_PIX_FMT_BGR48
48-bit RGB where each colour sample is 16-bits.
- V4L2_PIX_FMT_PISP_COMP1_MONO/V4L2_PIX_FMT_PISP_COMP2_MONO
16-bit to 8-bit pisp compressed monochrome pixel format.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Phil Elwell [Mon, 20 Nov 2023 14:46:14 +0000 (14:46 +0000)]
w1: Disable kernel log spam
See: https://forums.raspberrypi.com/viewtopic.php?p=2159344
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 20 Nov 2023 10:16:10 +0000 (10:16 +0000)]
overlays: ov5647: cam0 mode should use cam0_reg
When the cam0 parameter is used, the vcm should be updated to refer to
the cam0 regulator.
See: https://github.com/raspberrypi/linux/issues/5722
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 20 Nov 2023 10:15:15 +0000 (10:15 +0000)]
overlays: ov5647: Regularise vcm node label name
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Fri, 17 Nov 2023 19:23:15 +0000 (19:23 +0000)]
configs: Add the drivetemp module
See: https://github.com/raspberrypi/linux/issues/5670
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Naushir Patuck [Wed, 15 Nov 2023 08:25:11 +0000 (08:25 +0000)]
overlays: imx296: Fix cam port override for regulators
The override was missing/incorrect for the regulator labels.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Wed, 8 Nov 2023 10:05:05 +0000 (10:05 +0000)]
drivers: media: cfe: Don't confuse MHz and Mbps
The driver was interchaning these units when talking about link rate.
Fix this to avoid confusion. Apart from the logging message change,
there is no function change in this commit.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Nick Hollinghurst [Tue, 14 Nov 2023 16:03:54 +0000 (16:03 +0000)]
Revert "media: i2c: imx296: Add 2ms delay after releasing standby"
This reverts commit
ecbc04aa0c2e7c8879764c9d2c769ecc74fd9093
which duplicated
5fb3b300557d6a6902e7321f42fdabb8c09eef54
Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Nick Hollinghurst [Wed, 8 Nov 2023 10:57:45 +0000 (10:57 +0000)]
drivers: media: imx708: Adjust broken line correction parameter
In full-resolution mode, the LPF_INTENSITY_EN and LPF_INTENSITY
registers control Quad Bayer Re-mosaic broken line correction.
Expose this as a module parameter "qbc_adjust": zero disables
the correction and values in the range 2 to 5 set its strength.
There is a trade-off between coloured and monochrome patterns.
The previous fixed value 4 could produce ladder/spots artefacts
in coloured textures. The new default value 2 may suit a wider
range of scenes.
Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Phil Elwell [Wed, 8 Nov 2023 19:17:33 +0000 (19:17 +0000)]
ASoC: bcm: audioinjector_octo: Add soundcard "owner"
See: https://github.com/raspberrypi/linux/issues/5697
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Jonathan Bell [Wed, 8 Nov 2023 16:14:25 +0000 (16:14 +0000)]
arm: dts: change RP1 SDHCI controller compatible string
Also add a sdio-pi5 overlay which enables mmc0 on GPIOs 22-27, as was
possible with earlier models of Pi.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Jonathan Bell [Wed, 8 Nov 2023 16:12:59 +0000 (16:12 +0000)]
drivers: mmc: sdhci-of-dwcmshc: add RP1 dt ID and quirks
Differentiate the RP1 variant of the Designware MSHC controller(s).
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Jonathan Bell [Wed, 8 Nov 2023 16:10:13 +0000 (16:10 +0000)]
dt-bindings: mmc: sdhci-of-dwcmhsc: Add Raspberry Pi RP1 support
The DWC MSHC controller on RP1 needs differentiating from the generic
version.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Jonathan Bell [Wed, 8 Nov 2023 11:52:16 +0000 (11:52 +0000)]
drivers: mmc: sdhci: add SPURIOUS_INT_RESP quirk
Certain controllers (dwc-mshc) generate timeout conditions separately to
command-completion conditions, where the end result is interrupts are
separated in time depending on the current SDCLK frequency.
This causes spurious interrupts if SDCLK is slow compared to the CPU's
ability to process and return from interrupt. This occurs during card
probe with an empty slot where all commands that would generate a
response time out.
Add a quirk to squelch command response interrupts when a command
timeout interrupt is received.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Dave Stevenson [Wed, 8 Nov 2023 12:04:20 +0000 (12:04 +0000)]
defconfigs: Drop FB_UDL from all Pi defconfigs
CONFIG_FB_UBL is the fbdev driver for DisplayLink USB displays.
CONFIG_UDL is the DRM driver for DisplayLink USB displays.
Both attach themselves to the same USB device alias, so both
get loaded for any attached display. You now have 2 drivers for
the same hardware, and a race as to which one will load.
DRM emulates the framebuffer interface, so disable the fbdev
driver.
https://github.com/raspberrypi/bookworm-feedback/issues/133
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Phil Elwell [Tue, 7 Nov 2023 14:49:47 +0000 (14:49 +0000)]
spi: dw-dma: Get the last DMA scoop out of the FIFO
With a DMA FIFO threshold greater than 1 (encoded as 0), it is possible
for data in the FIFO to be inaccessible, causing the transfer to fail
after a timeout. If the transfer includes a transmission, reduce the
RX threshold when the TX completes, otherwise use 1 for the whole
transfer (inefficient, but not catastrophic at SPI data rates).
See: https://github.com/raspberrypi/linux/issues/5696
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dom Cobley [Tue, 24 Oct 2023 15:20:42 +0000 (16:20 +0100)]
drm/vc4: crtc: Support odd horizontal timings on BCM2712
BCM2711 runs pixelvalve at two pixels per clock cycle which results
in an unfortunate limitation that odd horizontal timings are not
possible. This is apparent on the standard DMT mode of 1366x768@60
which cannot be driven with correct timing.
BCM2712 defaults to the same behaviour, but has a mode to support
odd timings. While internally it still runs at two pixels per clock,
setting the PV_VCONTROL_ODD_TIMING bit makes it appear externally
to behave as it is one pixel per clock.
Switching to this mode fixes 1366x768@60 mode, and other custom
resultions with odd horizontal timings.
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Dave Stevenson [Tue, 31 Oct 2023 11:15:38 +0000 (11:15 +0000)]
drm/vc4: Log the size of the dlist allocation that was attempted
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 27 Oct 2023 15:46:04 +0000 (16:46 +0100)]
drm/vc4: Add hvs_dlist_allocs debugfs function.
Users are reporting running out of DLIST memory. Add a
debugfs file to dump out all the allocations.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 26 Oct 2023 17:23:31 +0000 (18:23 +0100)]
drm/vc4: Free all stale dlists if channel is disabled
The code handling freeing stale dlists had 2 issues:
- it disabled the interrupt as soon as the first EOF interrupt
occurred, even if it didn't clear all stale allocations, thus
leading to stale entries
- It didn't free stale entries from disabled channels, so eg
"kmstest -c 0" could leave a stale alloc on channel 1 floating
around.
Keep the interrupt enabled whilst there are any outstanding
allocs, and discard those on disabled channels. This second
channel does require us to call vc4_hvs_stop_channel from
vc4_crtc_atomic_disable so that the channel actually gets stopped.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 26 Oct 2023 17:05:09 +0000 (18:05 +0100)]
drm/vc4: Drop WARN for HVS FIFOs not being empty
The reset condition for the EMPTY flag in DISPSTATx is 0,
so seeing as we've just reset the pipeline there is no
guarantee that the flag will denote empty if it hasn't been
enabled.
Drop the WARN.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 26 Oct 2023 16:46:13 +0000 (17:46 +0100)]
drm/vc4: Correct logic on stopping an HVS channel
When factoring out __vc4_hvs_stop_channel, the logic got inverted from
if (condition)
// stop channel
to
if (condition)
goto out
//stop channel
out:
and also changed the exact register writes used to stop the channel.
Correct the logic so that the channel is actually stopped, and revert
to the original register writes.
Fixes:
6d01a106b4c8 ("drm/vc4: crtc: Move HVS init and close to a function")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Naushir Patuck [Mon, 6 Nov 2023 09:42:37 +0000 (09:42 +0000)]
drivers: media: imx477: Correctly set IMX477_PIXEL_RATE as a r/o control
This control is meant to be read-only, mark it as such.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Mon, 6 Nov 2023 09:40:50 +0000 (09:40 +0000)]
drivers: media: imx477: Add V4L2_CID_LINK_FREQ control
Add V4L2_CID_LINK_FREQ as a read-only control with a value of 450 Mhz.
This will be used by the CFE driver to corretly setup the DPHY timing
parameters in the CSI-2 block.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Phil Elwell [Thu, 2 Nov 2023 17:05:46 +0000 (17:05 +0000)]
overlays: uart<n>-pi5: Add the pinctrl-0 property
Without the pinctrl-0 property in the overlays, the UARTs may not be
mapped correctly.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Thu, 2 Nov 2023 13:12:55 +0000 (13:12 +0000)]
dts: rp1: Add spi6, fix spi1 #address-cells
spi6 won't be useful on Pi 5 because it can't be enabled on the 40-pin
header, but include it for completeness.
Also fix the #address-cells value for spi1, otherwise the kernel will
reject attempts to apply the, say, spi1-2cs overlay at runtime.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Thu, 2 Nov 2023 10:39:11 +0000 (10:39 +0000)]
dts: bcm2712-rpi-5-b: Create some dummy nodes
The kernel now treats multiple fragments targeting the same node as an
error. For this reason, it is important that labels created just for
compatibility with other systems (e.g. i2c0if and i2c0mux) are
attached to unique nodes, not just tacked onto existing nodes.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Naushir Patuck [Wed, 1 Nov 2023 13:25:54 +0000 (13:25 +0000)]
drivers: media: cfe: Set the CSI-2 link frequency correctly
Use the sensor provided link frequency to set the DPHY timing parameters
on stream_on. This replaces the hard-coded 999 MHz value currently being
used. As a fallback, revert to the original 999 Mhz link frequency.
As a drive-by, fix a 80-character line formatting error.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Phil Elwell [Mon, 12 Jun 2023 14:23:55 +0000 (15:23 +0100)]
dts: bcm2710-rpi-zero-2-w: Remove WLAN firmwares
With careful use of qualified firmware names there is no need for the
ability to override the device names based on Device Tree properties.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 12 Jun 2023 14:22:20 +0000 (15:22 +0100)]
Revert "brcmfmac: Read alternative firmware names from DT"
This reverts commit
5dba6ec6f4f2ac9ed8556116481b107e50e15251.
With careful use of qualified firmware names there is no need for the
ability to override the device names based on Device Tree properties.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
David Plowman [Fri, 27 Oct 2023 11:14:22 +0000 (12:14 +0100)]
drivers: media: imx477: Set horizontal binning when disabling the scaler
The horizontal scaler has been disabled but actually the sensor is not
binning horizontally, resulting in images that are stretched 2x
horizontally (missing the right half of the field of view completely).
Therefore we must additionally set the horizontal binning mode. There
is only marginal change in output quality and noise levels.
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Fixes:
f075893e9b0e ("drivers: media: imx477: Disable the scaler")
Jonathan Bell [Wed, 20 Sep 2023 12:04:54 +0000 (13:04 +0100)]
arm: dt: add dtparams for PCIe reset timing override
The Pi 5 variant gets two parameters so that the CM4-compatible
name will also work on Pi 5.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Jonathan Bell [Wed, 20 Sep 2023 12:01:11 +0000 (13:01 +0100)]
drivers: pci: brcmstb: optionally extend Tperst_clk time during link-up
The RC has a feature that allows for manual control over the deassertion
of the PERST# output pin, which allows the time between refclk active
and reset deassert at the EP to be increased.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Phil Elwell [Wed, 1 Nov 2023 10:27:28 +0000 (10:27 +0000)]
dts: bcm2712-rpi-5-b: Set enable-mps-rcb for RP1
It is safe to set the MPS_RCB bit for RP1, but not necessarily for other
devices, so add the new enabling property to pcie2 on Pi 5.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Wed, 1 Nov 2023 10:13:29 +0000 (10:13 +0000)]
PCI: brcmstb: Change RCB_{MPS,64B}_MODE bits
Upstream commit [1] unconditionally sets the RCB_MPS and RCB_64B bits
that govern where packets are split. We think this is potentially
harmful, particularly on CM4 and Pi 5 where potentially any PCIe devices
could be attached.
Make RCB_MPS conditional on a DT property and never set RCB_64B.
[1] commit
602fb860945f ("PCI: brcmstb: Set RCB_{MPS,64B}_MODE bits")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Jonathan Bell [Wed, 20 Sep 2023 09:04:15 +0000 (10:04 +0100)]
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>
Naushir Patuck [Thu, 26 Oct 2023 07:55:24 +0000 (08:55 +0100)]
drivers: media: pisp_be: Add back V4L2_PIX_FMT_RPI_BE format
Add the opaque V4L2_PIX_FMT_RPI_BE format back to the format list as it
is needed for the verification test suite. Also set the default format
to YUV420 non-multiplanar.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Dave Stevenson [Mon, 23 Oct 2023 13:10:15 +0000 (14:10 +0100)]
dt: Add drm_fbN_vc4 overrides for Pi0-4
Follows up '
61b138adaead ("dt: Add overrides for drm framebuffer
allocations on Pi5")' with an equivalent for Pi0-4.
These will have no effect on most normal systems, but drm_fb0_vc4
will stop SPI displays jumping in and claiming /dev/fb0.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Naushir Patuck [Mon, 23 Oct 2023 09:03:03 +0000 (10:03 +0100)]
drivers: media: imx477: Disable the scaler
The horizontal scaler was enabled for the 2028x1520 and 2028x1080 modes,
with a scale factor of 1. It caused a single column of bad pixels on the
right edge of the image. Since scaling is not needed for these modes,
disable it entirely.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Dave Stevenson [Fri, 20 Oct 2023 16:12:09 +0000 (17:12 +0100)]
dt: Switch bcm2712 firmware-kms node to using the 2712 compatible
With the new compatible to handle the interrupts correctly, switch
the base dt to use it.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 20 Oct 2023 16:09:54 +0000 (17:09 +0100)]
drm/vc4_fkms: Fix up interrupt handler for both 2835/2711 and 2712
2712 has switched from using the SMI peripheral to another interrupt
source for the vsync interrupt, so handle both sources cleanly.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 20 Oct 2023 14:21:34 +0000 (15:21 +0100)]
Revert "vc4/fkms: Remove use of SMI peripheral"
This reverts commit
3fb20da9f3bff93f20b1a1fe2c950c6c8f4d1e1e.
Phil Elwell [Fri, 20 Oct 2023 16:15:25 +0000 (17:15 +0100)]
dts: bcm2712: Add the krnbt parameter
Add a Pi 5 implementation of the krnbt parameter, for symmetry and
for tinkering purposes.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Andrew Scheller [Thu, 19 Oct 2023 13:13:36 +0000 (14:13 +0100)]
Typo in overlays README
touchscreen-size-y for rpi-ft5406 defaults to 480, not 600
Dave Stevenson [Thu, 19 Oct 2023 09:29:20 +0000 (10:29 +0100)]
dt: Alter alias names from _ to - for drm_fbN_* overrides
Fixes:
61b138adaead ("dt: Add overrides for drm framebuffer allocations on Pi5")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 19 Oct 2023 09:32:04 +0000 (10:32 +0100)]
drm/fb_helper: Change query for FB designation from drm_fb to drm-fb
Fixes:
1216ea56c2e3 ("drm/fb-helper: Look up preferred fbdev node number from DT")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 19 Oct 2023 09:28:43 +0000 (10:28 +0100)]
dt: Alter alias names from _ to - for drm_dsiN
Fixes:
7ec42740a45b ("dt: Add DSI1 and DSI2 aliases to 2712")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 19 Oct 2023 09:34:58 +0000 (10:34 +0100)]
drm/connector: Change DRM card alias from underscore to hyphen
Apparently aliases are only allowed lower case and hyphens,
so swap the use of underscore to hyphen.
Fixes:
3aa1f2477545 ("drm: Look for an alias for the displays to use as the DRM device name")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Phil Elwell [Thu, 19 Oct 2023 08:17:25 +0000 (09:17 +0100)]
overlays: Add Pi 5 version of dwc2
Most bus masters on Pi 5 have access to at least the lower 4GB, but
the old DWC OTG controller is still restricted to the first 1GB.
Create a Pi 5-specific version of the overlay including a fragment
that ensures the swiotlb bounce buffers are allocated in that
area.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dave Stevenson [Wed, 11 Oct 2023 10:03:51 +0000 (11:03 +0100)]
dt: Add overrides for drm framebuffer allocations on Pi5
Adds dtparam overrides to the base Pi5 DT such that vc4,
DSI0, DSI1, or DPI can be requested to be /dev/fb[012].
No override is specified by default, so the order will be
based on probe order (aka semi-random). Any device that
doesn't have an override specified will be placed above
all specified overrides. Having an fb1 or fb2 override but
no fb0 one will result in no console via fbcon.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Mon, 9 Oct 2023 15:34:36 +0000 (16:34 +0100)]
drm/fb-helper: Look up preferred fbdev node number from DT
For situations where there are multiple DRM cards in a system,
add a query of DT for "drm_fb" designations for cards to set
their preferred /dev/fbN designation.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Mon, 9 Oct 2023 15:32:45 +0000 (16:32 +0100)]
fbdev: Allow client to request a particular /dev/fbN node
Add a flag custom_fb_num to denote that the client has
requested a specific fbdev node number via node.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Phil Elwell [Tue, 17 Oct 2023 16:28:11 +0000 (17:28 +0100)]
dts: bcm2712: Use the new model name
"Model B" is no more - "Raspberry Pi 5" is the official name.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Naushir Patuck [Tue, 17 Oct 2023 08:35:44 +0000 (09:35 +0100)]
drivers: media: rp1_cfe: Fix link validate test for pixel format
Now that we have removed unique PISP media bus codes, the cfe format
table has multiple entries with the same media bus code for 16-bit
formats. The test in cfe_video_link_validate() did not account for this.
Fix it by testing the media bus code and the V4L2 pixelformat 4cc
together.
As a drive-by, ensure we have a valid CSI2 datatype id when programming
the hardware block.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Dave Stevenson [Mon, 16 Oct 2023 11:13:38 +0000 (12:13 +0100)]
drm/vc4: Correct address offset for planes with src_[xy] offsets
11cf37e741b4 switched to using drm_fb_dma_get_gem_addr instead of
drm_fb_dma_get_gem_obj and adding fb->offset[].
However the tiled formats need to compute the offset in a more
involved manner than drm_fb_dma_get_gem_addr applies, and we
were ending up with the offset for src_[xy] being applied twice.
Switch back to using drm_fb_dma_get_gem_obj and fully computing
the offsets ourselves.
Fixes:
11cf37e741b4 ("drm/vc4: Move the buffer offset out of the vc4_plane_state")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Phil Elwell [Sat, 14 Oct 2023 13:57:49 +0000 (14:57 +0100)]
vc_mem: Add the DMA memcpy support from bcm2708_fb
bcm2708_fb is disabled by the vc4-kms-v3d overlay, which means that the
DMA memcpy support it provides is not available to allow vclog to read
the VC logs from the top 16MB on Pi 2 and Pi 3. Add the code to the
vc_mem driver, which will still be enabled.
It ought to be possible to do a proper DMA_MEM_TO_MEM copy via the
generic DMA customer API, but that can be a later step.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 16 Oct 2023 08:06:25 +0000 (09:06 +0100)]
dts: bcm2712: Set default I2C baudrates to 100kHz
The RP1 I2C interfaces were being left with their default clock rates,
apparently 400kHz.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Janis Streib [Sun, 15 Oct 2023 19:08:40 +0000 (21:08 +0200)]
overlays: mcp23017: allow specification of the i2c bus
Analogous to i2c-rtc-overlay.dts
See: https://github.com/raspberrypi/linux/pull/5650
Dom Cobley [Thu, 12 Oct 2023 14:52:38 +0000 (15:52 +0100)]
Revert "bcm2708_fb: Hack out dma support"
This reverts commit
d60956f30586ced37e2152f2ba338f547e6c64f7.
Dom Cobley [Thu, 12 Oct 2023 14:52:24 +0000 (15:52 +0100)]
Revert "bcm2708_fb: Fix more build warnings"
This reverts commit
7b11991e91e65ebeb315986fae05d363663d24c4.
Nick Hollinghurst [Wed, 11 Oct 2023 14:14:59 +0000 (15:14 +0100)]
input: touchscreen: edt-ft5x06: Suppress bogus data on startup
When polled without the use of IRQ, FT5x06 registers may return
undefined initial data, causing unwanted touches or event spamming.
A simple way to filter this out is to suppress touches until the
TD_STATUS register changes for the first time.
Increase the delay before first polling to 300ms, to avoid
transient I2C read flakiness that seems to occur after reset.
Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Phil Elwell [Fri, 6 Oct 2023 13:30:50 +0000 (14:30 +0100)]
configs: Enable more sound devices
See: https://github.com/raspberrypi/linux/issues/4179
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dave Stevenson [Wed, 11 Oct 2023 14:05:38 +0000 (15:05 +0100)]
vc04_services: bcm2835-codec: Correct alignment requirements for YUYV
The firmware wants the YUYV format stride alignment to be to a multiple
of 32pixels / 64 bytes. The kernel driver was configuring it to a multiple
of 16 pixels / 32 bytes, which then failed when it tried starting to
stream.
Correct the alignment requirements.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Naushir Patuck [Tue, 10 Oct 2023 11:41:15 +0000 (12:41 +0100)]
drivers: media: rp1_cfe: Remove PISP specific MBUS formats
Remove the MEDIA_BUS_FMT_PISP* format codcs entirely. For the image
pad formats, use the 16-bit Bayer format mbus codes instead. For the
config and stats pad formats, use MEDIA_BUS_FMT_FIXED.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
John Cox [Mon, 2 Oct 2023 14:15:13 +0000 (15:15 +0100)]
dts/bcm2712: Add iommu to rpivid
Add iommu to rpivid so it can cope with scatter/gather
Signed-off-by: John Cox <jc@kynesim.co.uk>
John Cox [Mon, 2 Oct 2023 14:12:52 +0000 (15:12 +0100)]
media/rpivid: Allow use of iommu in rpivid
In order to use iommu on hevc set dma mask_and_coherent in probe.
I am assured dma_set_mask_and_coherent is benign on Pi4 (which has
no iommu) and it seems to be so in practice.
Also adds a bit of debug to make internal buffer allocation failure
easier to spot in future
Signed-off-by: John Cox <jc@kynesim.co.uk>
Dave Stevenson [Wed, 11 Oct 2023 10:12:41 +0000 (11:12 +0100)]
media: i2c: ov9282: Read chip ID via 2 reads
Vision Components have made an OV9281 module which blocks reading
back the majority of registers to comply with NDAs, and in doing
so doesn't allow auto-increment register reading as used when
reading the chip ID.
Use two reads and manually combine the results.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>