-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport upstream CFE driver to 6.12 #6578
Draft
6by9
wants to merge
742
commits into
raspberrypi:rpi-6.12.y
Choose a base branch
from
6by9:rpi-6.12.y
base: rpi-6.12.y
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Automatic link power saving plus the ability of a root complex to buffer pending posted write transfers (and consider them complete before being transmitted on the wire) causes compression of updates to GPIO state. The large bandwidth of a Gen 2 x4 link means the writes toggle state inside RP1 as fast as it can go (~20MHz), which is bad for applications wanting bitbash with at least a few microseconds of delay between updates. By tailoring IO access patterns to a special Root Complex register, writes to GPIOs can be stalled until the link wakes - meaning all writes end up with a reasonably consistent minimum pacing (~200ns). Additionally, write barriers have no effect other than to arbitrarily delay some writes by a small, variable amount - so remove the vast majority of these in areas that could be hot-paths. Although the IO memory is mapped with Device strongly-ordered semantics, this doesn't prevent the splitter inside BCM2712 from letting an MMIO read request to a GPIO register get ahead of the pacing writes to the Root Complex register. So each pin state read must flush writes out to the Outer-Shareable domain. Signed-off-by: Jonathan Bell <[email protected]>
TMOD_TO is the transmit-only mode that doesn't put data into the receive FIFO. Using TMOD_TO when the user doesn't want the received data saves CPU time and memory bandwidth. Signed-off-by: Phil Elwell <[email protected]>
TMOD_RO is the receive-only mode that doesn't require data in the transmit FIFO in order to generate clock cycles. Using TMOD_RO when the device doesn't care about the data sent to it saves CPU time and memory bandwidth. Signed-off-by: Phil Elwell <[email protected]>
Disabling the peripheral resets controller state which has a dangerous side-effect of disabling the DMA handshake interface while it is active. This can cause DMA channels to hang. The error recovery pathway will wait for DMA to stop and reset the chip anyway, so mask further FIFO interrupts and let the transfer finish gracefully. Signed-off-by: Jonathan Bell <[email protected]>
There's no real need to constrain MEM access widths to 32-bit (or narrower), as the DMAC is intelligent enough to size memory accesses appropriately. Wider accesses are more efficient. Similarly, MEM burst lengths don't need to be a function of DEV burst lengths - the DMAC packs/unpacks data into/from its internal channel FIFOs appropriately. Longer accesses are more efficient. However, the DMAC doesn't have complete support for unaligned accesses, and blocks are always defined in integer multiples of SRC_WIDTH, so odd source lengths or buffer alignments will prevent wide accesses being used, as before. There is an implicit requirement to limit requested DEV read burst lengths to less than the hardware's maximum configured MSIZE - otherwise RX data will be left over at the end of a block. There is no config register that reports this value, so the AXI burst length parameter is used to produce a facsimile of it. Warn if such a request arrives that doesn't respect this. Signed-off-by: Jonathan Bell <[email protected]>
Do an end-run around ASoC in lieu of not being able to easily find the associated DMA controller capabilities. Signed-off-by: Jonathan Bell <[email protected]>
…ints Valid ranges for the I2S peripheral's FIFO configuration include a depth of 16 - unconditionally setting the burst length to 16 with a fifo threshold of size/2 will cause under/overflows. For DMA engines with restricted capabilities the requested burst length and FIFO thresholds need to be adjusted downward accordingly. Both the RX and TX FIFOs operate on "less-than" thresholds. Setting the TX threshold to fifo_size minus burst means the FIFO is kept nearly-full. Signed-off-by: Jonathan Bell <[email protected]>
Ensure the transmit FIFO has emptied before ending the transfer by dropping the TX threshold to 0 when the last byte has been pushed into the FIFO. Include a similar fix for the non-IRQ paths. See: raspberrypi#6285 Fixes: 6014649 ("spi: dw: Save bandwidth with the TMOD_TO feature") Signed-off-by: Phil Elwell <[email protected]>
The DW SPI interface has a 16-bit clock divider, where the bottom bit of the divisor must be 0. Limit how low the clock speed can go to prevent the clock divider from being truncated, as that could lead to a much higher clock rate than requested. Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Phil Elwell <[email protected]>
In the same way that other subsystems support the setting of device id numbers from Device Tree aliases, allow gpiochip numbers to be derived from "gpiochip<n>" aliases. Signed-off-by: Phil Elwell <[email protected]>
Although later functions can handle a NULL fwnode, fwnode can't handle being passed a NULL pointer. See: raspberrypi#6305 Signed-off-by: Phil Elwell <[email protected]>
The check if the oscillator stop bit is set was reading from Control_1 register instead of the Seconds register. This caused the Seconds register to be incorrectly changed if bit 7 of Control_1 happens to be set. Signed-off-by: Axel Hammarberg <[email protected]>
Add YAML device tree binding for the Sony IMX500 CMOS image sensor / CNN inference engine. Also, add a MAINTAINERS entry. Signed-off-by: Richard Oliver <[email protected]>
The Sony IMX500 is a stacked 1/2.3-inch CMOS digital image sensor and inbuilt AI processor with an active array CNN (Convolutional Neural Network) inference engine. The native sensor size is 4056H x 3040V, and the module also contains an in-built ISP for the CNN. The module is programmable through an I2C interface with firmware and neural network uploads being made over SPI. This driver supports imaging only. Signed-off-by: Richard Oliver <[email protected]> media: i2c: imx500: Inbuilt AI processor support Add support for the IMX500's inbuilt AI processor. The IMX500 program loader, AI processor firmware, DNN weights are accessed via the kernel's firmware interface on 'open' and are transferred to the IMX500 over SPI. Signed-off-by: Richard Oliver <[email protected]> media: i2c: imx500: Enable LED during SPI transfers The Raspberry Pi 'AI Camera' is equipped with an LED. Enable this LED during SPI transfers to indicate to the end-user that progress is being made during large tramsfers. Signed-off-by: Richard Oliver <[email protected]> drivers: media: imx500: Fixes for vblank control Reduce the default/max framerate of the 2x2 binned mode to 30fps. The current limit of 50fps can cause the sensor to produce corrupt frames and cause missing framing events. Also fixup the vblank control min/max/default/step paramters when setting up. Signed-off-by: Naushir Patuck <[email protected]> drivers: media: imx500: Simplify the vblank control init Set the VBLANK control minimum and default values to IMX500_VBLANK_MIN unconditionally everywhere. Remove the mode specific framerate_default parameter, it is now unused. Signed-off-by: Naushir Patuck <[email protected]>
Add EXPORT_SYMBOL_GPL() for find_cpio_data() so that loadable modules may also parse uncompressed cpio. Signed-off-by: Richard Oliver <[email protected]>
The driver did expose V4L2_CID_HBLANK, but as a READ_ONLY control. The sensor only uses the HTS register to control the line length, so convert this control to read/write, with the appropriate ranges. Adopt the old fixed values as the minimum values permitted in each mode to avoid issues of it not streaming. This should allow exposure times up to ~3 seconds (up from ~1sec). Signed-off-by: Dave Stevenson <[email protected]>
ili9881c_enable is always returning 0. ili9881c_disable was returning the error code from mipi_dsi_dcs_set_display_off. If non-zero, the drm_panel framework will leave the panel marked as enabled, and not run the enable hook next time around. That isn't helpful, particularly as we're expecting unprepare to disable resets and regulators. Change ili9881c_disable to match enable in always returning 0. Signed-off-by: Dave Stevenson <[email protected]>
The driver is typically asking for LP commands, but then tries to send set_display_[on|off] from enable/disable when the host will be in HS mode. It also sends shutdown commands just before it asserts reset and disables the regulator, which is rather redundant. Add an option to configure these two choices from the panel_desc. Signed-off-by: Dave Stevenson <[email protected]>
This correction is calibrated to approx 5000K. Signed-off-by: Naushir Patuck <[email protected]>
The i.MX8MP makes calls on it's source device to determine the link-frequency that should be configured on the CSI2 receiver. When the source is behind a video mux, we need to pass this call through to the connected device. Map the control handler of the source device to the video-mux, essentially proxying all controls on the mux to the device which has it's link enabled. Signed-off-by: Kieran Bingham <[email protected]>
The current order of locking between the driver mutex and the v4l2 subdev state lock causes a circuluar locking dependency when trying to set up a link. Fix this. Signed-off-by: Paul Elder <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Kieran Bingham <[email protected]>
To make comparisons of the mode registers easier, put the registers for the binned and VGA modes in the same order as the others. Signed-off-by: Dave Stevenson <[email protected]>
There are many registers in common between all the modes. Pull those out into one common table. Signed-off-by: Dave Stevenson <[email protected]>
…ed modes In order to simplify the driver slightly, use the same PLL configuration, and hence pixel rate and link frequency (to be added) for the full, 1080p, and binned modes. Signed-off-by: Dave Stevenson <[email protected]>
The link frequency can vary between modes, so add it as a control. Signed-off-by: Dave Stevenson <[email protected]>
system_heap.max_order=<uint> Signed-off-by: Tvrtko Ursulin <[email protected]>
Add numa_policy kernel argument to allow overriding the kernel's default NUMA policy at boot time. Syntax identical to what tmpfs accepts as it's mpol argument is accepted. Some examples: numa_policy=interleave numa_policy=interleave=skip-interleave numa_policy=bind:0-3,5,7,9-15 numa_policy=bind=static:1-2 Signed-off-by: Tvrtko Ursulin <[email protected]>
... Make sure CMA zones do not straddle the emulated NUMA nodes ... Signed-off-by: Tvrtko Ursulin <[email protected]>
Clients such as libcamera do not change the LS table dmabuf on every frame. In such cases instead of mapping/remapping the same dmabuf on every frame to send to the firmware, cache the dmabuf once and only update and remap if the dmabuf has been changed by the userland client. Signed-off-by: Naushir Patuck <[email protected]>
Floating point arithmetic is not supported in the kernel, so use fixed point instead. Signed-off-by: Phil Elwell <[email protected]>
No functional change. Signed-off-by: Phil Elwell <[email protected]>
Add kernel-facing implementations of pio_sm_config_xfer and pio_xm_xfer_data. Signed-off-by: Phil Elwell <[email protected]>
ws2812-pio-rp1 is a PIO-based driver for WS2812 LEDS. It creates a character device in /dev, the default name of which is /dev/leds<n>, where <n> is the instance number. The number of LEDS should be set in the DT overlay, as should whether it is RGB or RGBW, and the default brightness. Write data to the /dev/* entry in a 4 bytes-per-pixel format in RGBW order: RR GG BB WW RR GG BB WW ... The white values are ignored unless the rgbw flag is set for the device. To change the brightness, write a single byte to offset 0, 255 being full brightness and 0 being off. Signed-off-by: Phil Elwell <[email protected]>
Add an overlay to enable a WS2812 LED driver on a given GPIO. Signed-off-by: Phil Elwell <[email protected]>
Enable the WS2812_PIO_RP1 driver in both the defconfig files that support the Pi 5 family. Signed-off-by: Phil Elwell <[email protected]>
Add "i2c_csi_dsi0" parameters to overlays that already have an "i2c_csi_dsi" parameter. The I2C bus and GPIO mapping of i2c_csi_dsi and i2c_csi_dsi0 varies between platforms. Document the associations against the dtparams "i2c_csi_dsi" and "i2c_csi_dsi0" - run "dtparam -h i2c_csi_dsi" and "dtparam -h i2c_csi_dsi0" to read it. Signed-off-by: Phil Elwell <[email protected]>
By default, the antenna selection on CM4 and CM5 is fixed at boot time, with the dtparams ant1, ant2 and noant selecting which should be enabled. Add a new dtparam - noanthogs - which leaves the GPIOs free to be controlled at runtime by the OS. N.B. Using this parameter without suitable OS support will leave both antennae disabled, resulting in attenuated WiFi and Bluetooth signals. Signed-off-by: Phil Elwell <[email protected]>
The ezsound 6x8 soundcard requires the PCM3168A codec driver with I2C support. Signed-off-by: Stephen Gordon <[email protected]>
ASoC cannot configure the codec correctly when the ADC and DAC share clock lines and one of them is the clock producer. Add a DT binding that overrides ASoC and forces the component into clock consumer mode. Signed-off-by: Stephen Gordon <[email protected]>
Document the new force-adc-cons/force-dac-cons DT bindings. Signed-off-by: Stephen Gordon <[email protected]>
Add the DT overlay for the ezsound 6x8 soundcard. Signed-off-by: Stephen Gordon <[email protected]>
Compile the new ezsound-6x8iso overlay. Signed-off-by: Stephen Gordon <[email protected]>
Document the new ezsound-6x8iso overlay. Signed-off-by: Stephen Gordon <[email protected]>
This reverts commit ad50861. Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Nicolai Buchwitz <[email protected]>
* Update config.yml - Raspbian -> Raspberry Pi OS * Update config.yml * .org to .com * Update forum URL
Add and update files for pwm-gpio-fan overlay Signed-off-by: Kai-Uwe Herbing <[email protected]>
This reverts commit 4b61a24.
This reverts commit 4d0b6a2.
This reverts commit 0292dc2.
Add two meta formats for PiSP FE: V4L2_META_FMT_RPI_FE_CFG and V4L2_META_FMT_RPI_FE_STATS. The former is used to provide configuration for the FE and the latter is used to read the statistics from the FE. Signed-off-by: Tomi Valkeinen <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Commit 1358bb5 upstream Add DT bindings for raspberrypi,rp1-cfe. Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Commit 6edb685 upstream Add support for Raspberry Pi CFE. The CFE is a hardware block that contains: - MIPI D-PHY - MIPI CSI-2 receiver - Front End ISP (FE) The driver has been upported from the Raspberry Pi kernel commit 88a681d ("ARM: dts: bcm2712-rpi: Add i2c<n>_pins labels"). Co-developed-by: Naushir Patuck <[email protected]> Signed-off-by: Naushir Patuck <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Commit 40249b1 upstream Add documentation for rp1-cfe driver. Signed-off-by: Tomi Valkeinen <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
…haned" Commit fba1aff upstream There is a spelling mistake in a WARN message. Fix it. Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
Commit 3bb5080 upstream platform_get_irq() already provides a error message. This fixes the following cocci error: drivers/media/platform/raspberrypi/rp1-cfe/cfe.c:2326:2-9: line 2326 is redundant because platform_get_irq() already prints an error Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
Commit 8e9a03b upstream If devm_clk_get() fails then we need to free "cfe" before returning. Fixes: 6edb685 ("media: raspberrypi: Add support for RP1-CFE") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
Commit be7de82 upstream When using buffers from DRM, DMA-API gives a warning about: "mapping sg segment longer than device claims to support [len=307200] [max=65536]" Add a call to vb2_dma_contig_set_max_seg_size() to tell the DMA-API about the supported segment size (which is UINT_MAX). Fixes: 6edb685 ("media: raspberrypi: Add support for RP1-CFE") Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
popcornmix
force-pushed
the
rpi-6.12.y
branch
from
January 10, 2025 11:46
236f361
to
12cd284
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Our downstream CFE driver blows up on 6.12 in link validation :-(
This PR removes the downstream driver and backports the mainline one that has been merged in 6.13.
I haven't updated all necessary sensor drivers as yet (I was testing with imx415), hence draft status for the time being.
It needs the updated libcamera branch in raspberrypi/libcamera#200. That doesn't rebase cleanly on the next branch at present due to the CameraSensorFactory stuff having been merged through official libcamera, but not quite in the same form as in the PR.