Dom Cobley [Fri, 12 Jan 2024 15:48:14 +0000 (15:48 +0000)]
vc4/hvs: Updates to support D0 alpha and csc changes
2712D0 has a simpler colourspace conversion matrix block
so set that up.
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Dom Cobley [Tue, 14 Nov 2023 16:43:03 +0000 (16:43 +0000)]
vc4/hvs: Add support for D0 register changes
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Phil Elwell [Thu, 30 Nov 2023 12:57:03 +0000 (12:57 +0000)]
pinctrl: bcm2712: Fix for the first valid GPIO
A non-zero mux bit number is used to detect a valid entry in the
pin_regs tables, but GPIO 0 (GPIO 1 on D0) is a valid GPIO with a mux
bit number of zero, so add a high-bit on all valid entries to
distinguish this from an uninitialised row in the table.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Wed, 15 Nov 2023 14:49:55 +0000 (14:49 +0000)]
pinctrl: bcm2712: Fix for sparse GPIOs
BCM2712D0's sparse GPIO map revealed that it is not safe to treat
group_selector as the GPIO number - it is an index into the array of
pinctrl_pin_descs, and the "number" member says which GPIO it refers to.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Thu, 16 Nov 2023 15:18:29 +0000 (15:18 +0000)]
ARM: dts: overlays: Add a bcm2712d0 overlay
The bcm2712d0 overlay encapsulates the differences between BCM2712C0/1
and D0.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Wed, 15 Nov 2023 14:48:43 +0000 (14:48 +0000)]
ARM: dts: Add BCM2712 D0 dts
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Thu, 16 Nov 2023 16:03:47 +0000 (16:03 +0000)]
ARM: dts: bcm2712: Prune the non-D0 hardware
There is no point describing hardware blocks in C0/1 that aren't also
in D0, so delete them.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Lee Jackson [Wed, 10 Jan 2024 01:06:16 +0000 (09:06 +0800)]
drivers: media: arducam_64mp: Add V4L2_CID_LINK_FREQ control
Add V4L2_CID_LINK_FREQ as a read-only control with a value of 456 Mhz.
This will be used by the CFE driver to corretly setup the DPHY timing
parameters in the CSI-2 block.
Signed-off-by: Lee Jackson <lee.jackson@arducam.com>
Lee Jackson [Wed, 10 Jan 2024 00:52:54 +0000 (08:52 +0800)]
drivers: media: imx519: Add V4L2_CID_LINK_FREQ control
Add V4L2_CID_LINK_FREQ as a read-only control with a value of 408 Mhz.
This will be used by the CFE driver to corretly setup the DPHY timing
parameters in the CSI-2 block.
Signed-off-by: Lee Jackson <lee.jackson@arducam.com>
Phil Elwell [Mon, 8 Jan 2024 11:42:57 +0000 (11:42 +0000)]
spi: bcm2835: Support spi0-0cs and SPI_NO_CS mode
The forced conversion of native CS lines into software CS lines is done
whether or not the controller has been given any CS lines to use. This
breaks the use of the spi0-0cs overlay to prevent SPI from claiming any
CS lines, particularly with spidev which doesn't pass in the SPI_NO_CS
flag at creation.
Use the presence of an empty cs-gpios property as an indication that no
CS lines should be used, bypassing the native CS conversion code.
See: https://github.com/raspberrypi/linux/issues/5835
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 8 Jan 2024 08:45:21 +0000 (08:45 +0000)]
ARM: dts: bcm2712-rpi-5-b: Use common LED labels
As of 6.6, the names of the labels on the Pi LEDs was swapped to match
the upstream code, i.e. led_act rather than act_led.
Apply the same change to Pi 5.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Maíra Canal [Fri, 5 Jan 2024 18:07:34 +0000 (15:07 -0300)]
drm/vc4: don't check if plane->state->fb == state->fb
Currently, when using non-blocking commits, we can see the following
kernel warning:
[ 110.908514] ------------[ cut here ]------------
[ 110.908529] refcount_t: underflow; use-after-free.
[ 110.908620] WARNING: CPU: 0 PID: 1866 at lib/refcount.c:87 refcount_dec_not_one+0xb8/0xc0
[ 110.908664] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep hid_logitech_hidpp vc4 brcmfmac hci_uart btbcm brcmutil bluetooth snd_soc_hdmi_codec cfg80211 cec drm_display_helper drm_dma_helper drm_kms_helper snd_soc_core snd_compress snd_pcm_dmaengine fb_sys_fops sysimgblt syscopyarea sysfillrect raspberrypi_hwmon ecdh_generic ecc rfkill libaes i2c_bcm2835 binfmt_misc joydev snd_bcm2835(C) bcm2835_codec(C) bcm2835_isp(C) v4l2_mem2mem videobuf2_dma_contig snd_pcm bcm2835_v4l2(C) raspberrypi_gpiomem bcm2835_mmal_vchiq(C) videobuf2_v4l2 snd_timer videobuf2_vmalloc videobuf2_memops videobuf2_common snd videodev vc_sm_cma(C) mc hid_logitech_dj uio_pdrv_genirq uio i2c_dev drm fuse dm_mod drm_panel_orientation_quirks backlight ip_tables x_tables ipv6
[ 110.909086] CPU: 0 PID: 1866 Comm: kodi.bin Tainted: G C 6.1.66-v8+ #32
[ 110.909104] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
[ 110.909114] pstate:
60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 110.909132] pc : refcount_dec_not_one+0xb8/0xc0
[ 110.909152] lr : refcount_dec_not_one+0xb4/0xc0
[ 110.909170] sp :
ffffffc00913b9c0
[ 110.909177] x29:
ffffffc00913b9c0 x28:
000000556969bbb0 x27:
000000556990df60
[ 110.909205] x26:
0000000000000002 x25:
0000000000000004 x24:
ffffff8004448480
[ 110.909230] x23:
ffffff800570b500 x22:
ffffff802e03a7bc x21:
ffffffecfca68c78
[ 110.909257] x20:
ffffff8002b42000 x19:
ffffff802e03a600 x18:
0000000000000000
[ 110.909283] x17:
0000000000000011 x16:
ffffffffffffffff x15:
0000000000000004
[ 110.909308] x14:
0000000000000fff x13:
ffffffed577e47e0 x12:
0000000000000003
[ 110.909333] x11:
0000000000000000 x10:
0000000000000027 x9 :
c912d0d083728c00
[ 110.909359] x8 :
c912d0d083728c00 x7 :
65646e75203a745f x6 :
746e756f63666572
[ 110.909384] x5 :
ffffffed579f62ee x4 :
ffffffed579eb01e x3 :
0000000000000000
[ 110.909409] x2 :
0000000000000000 x1 :
ffffffc00913b750 x0 :
0000000000000001
[ 110.909434] Call trace:
[ 110.909441] refcount_dec_not_one+0xb8/0xc0
[ 110.909461] vc4_bo_dec_usecnt+0x4c/0x1b0 [vc4]
[ 110.909903] vc4_cleanup_fb+0x44/0x50 [vc4]
[ 110.910315] drm_atomic_helper_cleanup_planes+0x88/0xa4 [drm_kms_helper]
[ 110.910669] vc4_atomic_commit_tail+0x390/0x9dc [vc4]
[ 110.911079] commit_tail+0xb0/0x164 [drm_kms_helper]
[ 110.911397] drm_atomic_helper_commit+0x1d0/0x1f0 [drm_kms_helper]
[ 110.911716] drm_atomic_commit+0xb0/0xdc [drm]
[ 110.912569] drm_mode_atomic_ioctl+0x348/0x4b8 [drm]
[ 110.913330] drm_ioctl_kernel+0xec/0x15c [drm]
[ 110.914091] drm_ioctl+0x24c/0x3b0 [drm]
[ 110.914850] __arm64_sys_ioctl+0x9c/0xd4
[ 110.914873] invoke_syscall+0x4c/0x114
[ 110.914897] el0_svc_common+0xd0/0x118
[ 110.914917] do_el0_svc+0x38/0xd0
[ 110.914936] el0_svc+0x30/0x8c
[ 110.914958] el0t_64_sync_handler+0x84/0xf0
[ 110.914979] el0t_64_sync+0x18c/0x190
[ 110.914996] ---[ end trace
0000000000000000 ]---
This happens because, although `prepare_fb` and `cleanup_fb` are
perfectly balanced, we cannot guarantee consistency in the check
plane->state->fb == state->fb. This means that sometimes we can increase
the refcount in `prepare_fb` and don't decrease it in `cleanup_fb`. The
opposite can also be true.
In fact, the struct drm_plane .state shouldn't be accessed directly
but instead, the `drm_atomic_get_new_plane_state()` helper function should
be used. So, we could stick to this check, but using
`drm_atomic_get_new_plane_state()`. But actually, this check is not really
needed. We can increase and decrease the refcount symmetrically without
problems.
This is going to make the code more simple and consistent.
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Phil Elwell [Thu, 4 Jan 2024 12:09:10 +0000 (12:09 +0000)]
ARM: dts: bcm2712-rpi-5-b: Add fan speed dtparams
Add dtparams for adjusting the Pi 5 cooling fan speeds and temperature
thresholds.
See: https://github.com/raspberrypi/linux/issues/5820
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Thu, 4 Jan 2024 13:56:39 +0000 (13:56 +0000)]
ARM: dts: bcm2712-rpi-5-b: Add eth_ledx parameters
Include the dtparams controlling the Ethernet jack LEDs, as used on
other Pis.
See: https://github.com/raspberrypi/linux/issues/5825
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dave Stevenson [Fri, 22 Dec 2023 11:53:52 +0000 (11:53 +0000)]
media: rp1: cfe: Add a csi_dt value for 16bit formats
Raw 16bit formats didn't have a csi_dt value defined, which
presumably would trip the WARN_ON(!fmt->csi_dt); in
cfe_start_channel.
The value is defined in CSI2 v2.0 as 0x2e, so set it accordingly.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Fri, 22 Dec 2023 11:50:38 +0000 (11:50 +0000)]
media: rp1: cfe: Use the MIPI_CSI2_DT_xxx defines for csi_dt
Seeing as we now have the CSI2 data types defined, make use of
them instead of hardcoding the values.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 21 Dec 2023 18:03:34 +0000 (18:03 +0000)]
media: i2c: adv7180: Add support for V4L2_CID_LINK_FREQ
For CSI2 receivers that need to know the link frequency,
add it as a control to the driver.
Interlaced modes are 216Mbp/s or 108MHz, whilst going through
the I2P to deinterlace gives 432Mb/s or 216MHz.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 21 Dec 2023 18:01:59 +0000 (18:01 +0000)]
media: i2c: adv7180: Use MEDIA_BUS_FMT_UYVY8_1X16 for CSI2 output
CSI2 devices are meant to use the 1Xnn formats rather than 2Xnn
such as MEDIA_BUS_FMT_UYVY8_2X8.
For devices with ADV7180_FLAG_MIPI_CSI2 set, use
MEDIA_BUS_FMT_UYVY8_1X16.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 21 Dec 2023 17:59:15 +0000 (17:59 +0000)]
media: rp1: cfe: Fix error paths in cfe_start_streaming
Noted that if we get "node link is not enabled", then we also
get the videobuf2 splat for the driver not cleaning up correctly
on a failed start_streaming, and indeed we weren't returning the
buffers.
Checking the other error paths, noted that the "FE enabled, but
FE_CONFIG node is not" path was not calling pm_runtime_put.
Fix both paths.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 2 Jan 2024 19:32:25 +0000 (19:32 +0000)]
drm/vc4: Fixup of patches adding debugfs functions
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Thu, 4 Jan 2024 12:02:43 +0000 (12:02 +0000)]
drm/vc4: Fix reading of frame count on GEN5 / Pi4
The frame count values moved within registers DISPSTAT1 and
DISPSTAT2 with GEN5, so update the accessor function to
accommodate that.
Fixes:
b51cd7ad143d ("drm/vc4: hvs: Fix frame count register readout")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Phil Elwell [Wed, 3 Jan 2024 14:43:43 +0000 (14:43 +0000)]
ASoC: dwc: Defer bclk_ratio handling to hw_params
bclk_ratio is only a factor in clock producer mode, and needs to
override the default value of num_channels * sample_size.
Move the bclk_ratio handling into the hw_params method, only latching
the value in set_bclk_ratio, to address both of those matters.
See: https://github.com/raspberrypi/linux/issues/5817
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Yangyu Chen [Mon, 18 Dec 2023 15:26:59 +0000 (23:26 +0800)]
configs: rpi: Disable CONFIG_IRQSOFF_TRACER by default
This configuration hindered performance by ~74% measured from RPI 4B
from ~680Mbps to ~390Mbps when benchmarking wireguard locally using
netns and iperf3. Remove it by default for better performance.
Signed-off-by: Yangyu Chen <cyy@cyyself.name>
Phil Elwell [Tue, 19 Dec 2023 11:27:20 +0000 (11:27 +0000)]
dts: rp1: Add I2C timings
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Tue, 19 Dec 2023 11:16:25 +0000 (11:16 +0000)]
i2c: designware: Look for *CNT values in DT
The i2c-designware driver supports reading precise timing values from
ACPI, but the Device Tree support relies on a combination of standard
rise and fall times and hard-coded minimum timings. The result of this
is that it is difficult to get optimum timings, particularly given that
the values are bus speed-specific and only one set can be stored in
DT at a time.
Add support for initialisation from DT that is similar to that for
ACPI.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Tue, 19 Dec 2023 14:55:21 +0000 (14:55 +0000)]
ARM: dts: bcm2712-rpi-5-b: Allow RTC to be disabled
Add a dtparam "rtc", so that "dtparam=rtc=off" can be used to disable
the Pi 5's onboard RTC.
See: https://forums.raspberrypi.com/viewtopic.php?t=361813
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dave Stevenson [Wed, 27 Dec 2023 19:51:45 +0000 (19:51 +0000)]
fixup downstream patch post driver conversion to CCI_REG
HTS was still using the raw register ID.
Fixes:
dd26d43ddb7f ("media: i2c: imx219: make HBLANK r/w to allow longer exposures")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Phil Elwell [Thu, 21 Dec 2023 15:52:42 +0000 (15:52 +0000)]
dts: bcm271-rpi-3-b: Make brcmvirt-gpio a firmware child
The driver makes use of the fact that the firmware node is its parent,
so we'd better make it so.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Thu, 21 Dec 2023 15:13:37 +0000 (15:13 +0000)]
bcm2835-virtgpio: Update for Linux 6.6
The gpio subsystem is happier if the gpiochip is given a parent, and
if it doesn't have a fixed base gpio number. While we're in here,
use the fact that the firmware node is the parent to locate it,
and use the devm_ version of rpi_firmware_get.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Naushir Patuck [Mon, 18 Dec 2023 09:52:45 +0000 (09:52 +0000)]
drivers: media: cfe: Add more robust ISR handlers
Update the ISR logic to be more robust to sensors in problematic states
where interrupts may start arriving overlapped and/or missing.
1) Test for cur_frame in the FE handler, and if present, dequeue it in
an error state so that it does not get orphaned.
2) Move the sequence counter and timestamp variables to the node
structures. This allows the ISR to track channels running ahead when
interrupts arrive unordered.
3) Add a test to ensure we don't have a spurios (but harmlesS) call to
the FE handler in some circumstances.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Naushir Patuck [Wed, 29 Nov 2023 13:09:05 +0000 (13:09 +0000)]
drivers: media: pisp_be: pisp_fe: Update UAPI header licenses
Update the license tags on the pisp UAPI header files with the
"Linux-syscall-note" clause. Also replace the "GPL-2.0" tag with the
preferred "GPL-2.0-only" tag.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Dave Stevenson [Mon, 18 Dec 2023 11:49:36 +0000 (11:49 +0000)]
input: edt-ft5x06: Correct prefix length in snprintf
snprintf takes the length of the array that we can print into,
and has to fit the NULL terminator in there too.
Printing the prefix is generally "12-3456 " which is 8 desired
characters (the length of EDT_NAME_PREFIX_LEN) and the NULL.
The space is therefore being truncated to fit the NULL in.
Increase the length snprintf is allowed to use.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Nick Hollinghurst [Wed, 6 Dec 2023 14:38:03 +0000 (14:38 +0000)]
overlays: Add "always-on" parameter to imx477 and imx296
Leave the camera's power supplies up, to prevent the camera
clamping its 1.8V digital I/Os to ground. This may be useful
when synchronizing multiple camera systems using XVS or XTRIG.
Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Nick Hollinghurst [Wed, 6 Dec 2023 14:27:57 +0000 (14:27 +0000)]
drivers: media: i2c: imx296,imx477: Configure tigger_mode every time
Don't assume the camera has been reset each time we start streaming,
but always write registers relating to trigger_mode, even in mode 0.
IMX477: Stop driving XVS on stop streaming, to avoid spurious pulses.
Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Jonathan Bell [Wed, 13 Dec 2023 14:28:22 +0000 (14:28 +0000)]
dts: rp1: add SNPS quirk to USB3 host controllers
Set snps,parkmode-disable-ss-quirk for usb0 and usb1.
Enabling this test/debug feature seems to prevent controller lockups
with bidirectional SS bulk endpoints active.
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Phil Elwell [Wed, 13 Dec 2023 10:26:19 +0000 (10:26 +0000)]
ARM: dts: bcm2711-rpi-400: Don't delete the ACT LED
The Pi 400 only has one user-accessible LED (green), which is intended
to be used as a power indication. Therefore there is no activity LED.
However, a user may wish to remap the activity LED functionality to a
GPIO in the 40-way header, so preserve the led-act node in a disabled
state.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 11 Dec 2023 17:00:56 +0000 (17:00 +0000)]
dts: bcm2712-rpi-5-b: Enable warm reboot mode
Switch to warm reboot mode so that the partition number is preserved.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Mon, 11 Dec 2023 16:58:07 +0000 (16:58 +0000)]
firmware/psci: Pass given partition number through
Pi 5 uses BL31 as its armstub file, so the reset goes via PSCI. Parse
any "reboot" parameter as a partition number to reboot into.
N.B. This code path is only used if reboot mode has been set to warm
or soft.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
eng33 [Mon, 11 Dec 2023 07:06:45 +0000 (15:06 +0800)]
drivers/gpu/drm/panel:fix waveshare panel software restart/shutdown display is abnormal
Fixed the screen stays white when the user restarts or shuts down
Signed-off-by: eng33 <eng33@waveshare.com>
Phil Elwell [Tue, 12 Dec 2023 13:45:20 +0000 (13:45 +0000)]
configs: Add XILLYBUS support modules
See: https://github.com/raspberrypi/linux/issues/5786
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Leon Anavi [Tue, 12 Dec 2023 11:53:37 +0000 (13:53 +0200)]
drivers/pinctrl/bcm/Kconfig: Fix BCM2712 help
Replace "Broadcom BCM2835 GPIO" with "Broadcom BCM2712 PINCONF"
in the help message. This work was sponsored by GOVCERT.LU.
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Phil Elwell [Mon, 11 Dec 2023 11:20:28 +0000 (11:20 +0000)]
bcm2835-sdhost: Fail gracefully with bad dtb
The logging timestamps depend on the existence of a bcm2835-system-timer
node. If this node doesn't exist, leave the logging disabled rather than
crashing.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Fri, 8 Dec 2023 15:29:38 +0000 (15:29 +0000)]
ARM: dts: bcm2712: PWM references include polarity
Increase #pwm-cells to 3 to allow for the extra polarity word.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Phil Elwell [Fri, 8 Dec 2023 15:16:39 +0000 (15:16 +0000)]
overlays: rpi-poe: Add PWM polarity value
Newer kernels expect PWM references to include a polarity value as the
third parameter.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dom Cobley [Thu, 7 Dec 2023 17:30:53 +0000 (17:30 +0000)]
dwc_otg: Avoid the use of align_buf for short packets
Recent kernels (from 6.5) fail to boot on Pi0-3.
This has been tracked down to the call to:
ret = usb_get_std_status(hdev, USB_RECIP_DEVICE, 0, &hubstatus);
returning garbage in hubstatus (it gets the uninitialised contents of
a kmalloc buffer that is not overwritten as expected).
As we don't have strong evidence that this code path has ever worked,
and it is causing a clear problem currently, lets disable it to
allow wider use of newer kernels.
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
Timon [Thu, 7 Dec 2023 21:31:52 +0000 (22:31 +0100)]
configs: rpi: Compile TSC2007 as module
Compile the TSC2007 touchscreen driver as a module
and enable the optional IIO module.
Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
Tomi Valkeinen [Tue, 3 Oct 2023 11:29:44 +0000 (14:29 +0300)]
media: rp1: cfe: Improve link validation for metadata
Improve the link validation for metadata by:
- Allowing capture buffers that are larger than the incoming frame
(instead of requiring exact match).
- Instead of assuming that a metadata unit ("pixel") is 8 bits, use
find_format_by_code() to get the format and use the bit depth from
there. E.g. bit depth for RAW10 metadata will be 10 bits, when we
move to the upstream metadata formats.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Tue, 3 Oct 2023 11:34:43 +0000 (14:34 +0300)]
media: rp1: fe: Use standard link_validate
The current pisp_fe_link_validate() skips some important checks. Let's
rather use the standard v4l2_subdev_link_validate_default() as the
link_validate hook.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Tue, 3 Oct 2023 10:59:02 +0000 (13:59 +0300)]
media: rp1: csi2: Use standard link_validate
The current csi2_link_validate() skips some important checks. Let's
rather use the standard v4l2_subdev_link_validate_default() as the
link_validate hook.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Tue, 16 May 2023 12:51:54 +0000 (15:51 +0300)]
media: rp1: Drop LE handling
The driver registers for line-end interrupts, but never uses them. This
just causes extra interrupt load, with more complexity in the driver.
Drop the LE handling. It can easily be added back if later needed.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Wed, 27 Sep 2023 14:18:09 +0000 (17:18 +0300)]
media: rp1: cfe: Dual purpose video nodes
The RP1 CSI-2 DMA can capture both video and metadata just fine, but at
the moment the video nodes are only set to support either video or
metadata.
Make the changes to support both video and metadata. This mostly means
tracking both video format and metadata format separately for each video
node, and using vb2_queue_change_type() to change the vb2 queue type
when needed.
Briefly, this means that the user can get/set both video and meta
formats to a single video node. The vb2 queue buffer type will be
changed when the user calls REQBUFS or CREATE_BUFS ioctls. This buffer
type will be then used as the "mode" for the video node when the user
starts the streaming, and based on that either the video or the meta
format will be used.
A bunch of macros are added (node_supports_xxx()), which tell if a node
can support a particular mode, whereas the existing macros
(is_xxx_node()) will tell if the node is currently in a particular mode.
Note that the latter will only work correctly between the start of the
streaming and the end of the streaming, and thus should be only used in
those code paths.
However, as the userspace (libcamera) does not support dual purpose
video nodes, for the time being let's keep the second video node as
V4L2_CAP_META_CAPTURE only to keep the userspace working.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Fri, 22 Sep 2023 10:47:10 +0000 (13:47 +0300)]
media: rp1: cfe: Add is_image_node()
The hardware supports streaming from memory (in addition to streaming
from the CSI-2 RX), but the driver does not support this at the moment.
There are multiple places in the driver which uses
is_image_output_node(), even if the "output" part is not relevant. Thus,
in a minor preparation for the possible support for streaming from
memory, and to make it more obvious that the pieces of code are not
about the "output", add is_image_node() which will return true for both
input and output video nodes.
While at it, reformat also the metadata related macros to fit inside 80
columns.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Thu, 21 Sep 2023 12:28:20 +0000 (15:28 +0300)]
media: rp1: csi2: Use get_frame_desc to get CSI-2 VC and DT
Use get_frame_desc pad op for asking the CSI-2 VC and DT from the source
device driver, instead of hardcoding to VC 0, and getting the DT from a
formats table. To keep backward compatibility with sources that do not
implement get_frame_desc, implement a fallback mechanism that always
uses VC 0, and gets the DT from the formats table, based on the CSI2's
sink pad's format.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Fri, 29 Sep 2023 14:15:20 +0000 (17:15 +0300)]
media: rp1: fe: Fix pisp_fe_pad_set_fmt()
pisp_fe_pad_set_fmt() allows setting the pad formats quite freely. This
is not correct, and the function should only allow formats as supported
by the hardware. Fix this by:
Allow no format changes for FE_CONFIG_PAD and FE_STATS_PAD. They should
always be the hardcoded initial ones.
Allow setting FE_STREAM_PAD freely (but the mbus code must be
supported), and propagate the format to the FE_OUTPUT0_PAD and
FE_OUTPUT1_PAD pads.
Allow changing the mbus code for FE_OUTPUT0_PAD and FE_OUTPUT1_PAD pads
only if the mbus code is the compressed version of the sink side code.
TODO: FE supports scaling and cropping. This should be represented here
too?
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Fri, 29 Sep 2023 13:25:10 +0000 (16:25 +0300)]
media: rp1: csi2: Fix csi2_pad_set_fmt()
The CSI-2 subdev's set_fmt currently allows setting the source and sink
pad formats quite freely. This is not right, as the CSI-2 block can only
do one of the following when processing the stream: 1) pass through as
is, 2) expand to 16-bits, 3) compress.
The csi2_pad_set_fmt() should take this into account, and only allow
changing the source side mbus code, compared to the sink side format.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Fri, 29 Sep 2023 14:14:11 +0000 (17:14 +0300)]
media: rp1: cfe: Add cfe_find_16bit_code() and cfe_find_compressed_code()
Add helper functions which, given an mbus code, return the 16-bit
remapped mbus code or the compressed mbus code.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Fri, 29 Sep 2023 14:14:31 +0000 (17:14 +0300)]
media: rp1: cfe: Add missing compressed remaps
16-bit bayer formats are missing compressed remap definitions. Add them.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Fri, 29 Sep 2023 13:24:14 +0000 (16:24 +0300)]
media: rp1: cfe: Add missing remaps
8-bit bayer formats are missing remap definitions. Add them.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Tomi Valkeinen [Fri, 29 Sep 2023 13:23:58 +0000 (16:23 +0300)]
media: rp1: cfe: Expose find_format_by_pix()
Make find_format_by_pix() accessible to other files in the driver.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Jacopo Mondi [Tue, 17 Oct 2023 12:41:56 +0000 (14:41 +0200)]
configs: rpi: Compile OV64A40 and BU64754 as modules
Compile both the OV64A40 and the BU64754 drivers used by the Arducam
64MP camera module based as modules in the defconfig files for
- rpi5
- rpi4
- rpi2/3
- rpi1/0
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Jacopo Mondi [Thu, 20 Jul 2023 11:18:34 +0000 (13:18 +0200)]
overlays: Add overlay for the OV64A40 Arducam Camera Module
Arducam have integrated an Omnivision OV64A40 with a ROHM BU64754 VCM
with a Raspberry Pi compatible cable pinout.
Provide an overlay to support the module.
Also add support to the camera mux overlays.
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Kieran Bingham [Wed, 13 Sep 2023 16:53:54 +0000 (17:53 +0100)]
media: i2c: Add ROHM BU64754 Camera Autofocus Actuator
Add support for the ROHM BU64754 Motor Driver for Camera Autofocus. A
V4L2 Subdevice is registered and provides a single
V4L2_CID_FOCUS_ABSOLUTE control.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Jacopo Mondi [Thu, 20 Jul 2023 09:44:40 +0000 (11:44 +0200)]
media: i2c: Add driver for OmniVision OV64A40
Add a driver for the OmniVision OV64A40 image sensor.
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Kieran Bingham [Thu, 14 Sep 2023 16:03:24 +0000 (17:03 +0100)]
media: dt-bindings: i2c: Add Rohm BU64754 bindings
Add YAML device tree bindings for the ROHM BU64754 VCM Motor Driver for
Camera Autofocus.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Jacopo Mondi [Sun, 1 Oct 2023 11:20:12 +0000 (13:20 +0200)]
media: dt-bindings: Add OmniVision OV64A40
Add bindings for OmniVision OV64A40.
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Phil Elwell [Tue, 5 Dec 2023 20:48:46 +0000 (20:48 +0000)]
Revert "overlays: Add Pi 5 version of dwc2"
This reverts commit
72cd5eef1825f9ab3502d0c5584b13c43ad4c840.
We don't need a special dwc2 overlay for Pi 5, with a node to limit the
DMA zone to the first 1GB, since it turns out that the USB2 controller
has a 4GB range after all.
See https://github.com/raspberrypi/linux/pull/5772
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Dave Stevenson [Tue, 5 Dec 2023 18:31:25 +0000 (18:31 +0000)]
arm: dt: bcm2712: Correct the size of the register range for MOP
The Mop covers 0x28 bytes of registers, so ensure the range is
defined appropriately.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Dave Stevenson [Tue, 5 Dec 2023 18:29:34 +0000 (18:29 +0000)]
drm/vc4: Mop and moplet have different register offsets for high addr
MOP uses register offset 0x24 for the high bits of the address,
whilst Moplet uses 0x1c.
Handle this difference between the block types.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
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>