- Sep 29, 2023
-
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Don't assume that DMA addresses of devices are the same as their physical addresses - convert correctly. The CFG2 register layout is used when there are more than 8 channels, but also when configured for more than 16 target peripheral devices because the index of the handshake signal has to be made wider. Reset the DMAC on probe The driver goes to the trouble of tracking when transfers have been paused, but then doesn't report that state when queried. Not having APB registers is not an error - for most use cases it's not even of interest, it's expected. Demote the message to debug level, which is disabled by default. Each channel has a descriptor pool, which is shared between transfers. It is unsafe to treat the total number of descriptors allocated from a pool as the number allocated to a specific transfer; doing so leads to releasing buffers that shouldn't be released and walking off the ends of descriptor lists. Instead, give each transfer descriptor its own count. Support partial transfers: Some use cases involve streaming from a device where the transfer only proceeds when the device's FIFO occupancy exceeds a certain threshold. In such cases (e.g. when pulling data from a UART) it is important to know how much data has been transferred so far, in order that remaining bytes can be read from the FIFO directly by software. Add the necessary code to provide this "residue" value with a finer, sub-transfer granularity. In order to prevent the occasional byte getting stuck in the DMA controller's internal buffers, restrict the destination memory width to the source register width. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
The SMBUS emulation code turns an SMBUS quick command into a zero- length read. This controller can't do zero length accesses, but it can do quick commands, so reverse the emulation. The alternative would be to properly implement the SMBUS support but that is a lot more work, and unnecessary just to get i2cdetect working. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Liam Fraser authored
Signed-off-by: Liam Fraser <liam@raspberrypi.com>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
RP1 exposes GPIOs. Add a pinctrl driver to allow control of those. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
RP1 contains various PLLs and clocks for driving the hardware blocks, so add a driver to configure these. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
RP1 is a multifunction PCIe device that exposes a range of peripherals. Add the parent driver to manage these. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
-
Naushir Patuck authored
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
-
Naushir Patuck authored
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
-
Jim Quinlan authored
PCI: brcmstb: differing register offsets on 2712 pcie-brcmstb: Add 2712 bridge reset support pcie: 2712 PORT_MASK and rescal support pcie-brcmstb: don't alter the L1SS debug register For reasons unknown, this disables the reference clock pcie-brcmstb: fix BAR2 enable and window decode Set UBUS ACCESS_EN to let inbound DMA work. Also BCM2712 has grown an index in the inbound window size decode register. PCIe: brcmstb: Enable support for 64 MSI-Xs Signed-off-by: Phil Elwell <phil@raspberrypi.com> pcie-brcmstb: Suppress read error responses If the link is down or the EP fails to return a read completion, the RC's default behaviour is to return an AXI error. This causes fatal exceptions on A76, so it's better to respond with all 1s instead. pcie-brcmstb: increase UBUS timeout to cater for link retrain events pcie-brcmstb: Handle additional inbound regions Signed-off-by: Phil Elwell <phil@raspberrypi.com> pcie-brcmstb: Add support for external MSI controller pcie-brcmstb: add a reasonable default traffic class to priority map BCM2712 supports multiple traffic classes (TCs) with independent maximally sized transfer queues for each TC. Traffic classes have no transaction ordering requirements between them, which facilitates out-of-order completions and arbitration between posted writes for data streams that have no dependence on each other. In addition to the above benefits of splitting endpoint traffic into individual queues, priorities can be assigned to traffic classes by a heuristic or deterministic mechanism. The heuristic elevates AXI QOS priority in accordance with the number of pending transfers in each TC's queue, but for true priority signalling a forwarding mechanism using vendor-defined messages is implemented. Receipt of a 3 DWORD VDM assigns a priority tag to a TC on-the-fly, and this tag corresponds to a configurable AXI QOS value. As a simple baseline, assign a linear map of AXI QOS to each tag. pcie: brcmstb: set up the VDM forwarding interface when setting up QoS pcie-brcmstb: add DT bindings for MPS-size Read Completion Mode This controller has an optional feature that allows read completion TLPs to be sized up to the Maximum Packet Size of a configured link. This can exceed the Read Completion Boundary of 128B specified in the PCIe specification, but depending on endpoint support may increase link read bandwidth significantly. pcie-brcmstb: clean up debug messages pcie-brcmstb: fix BCM2712A0 PHY PM errata The power management clock is 54MHz not 50MHz, so adjust the PM clock period to suit. Powering off the PHY PLL in L1.2 is unsafe, so force it on. pcie-brcmstb: set CLKREQ functionality according to link partner support The RC supports either L1 with clock PM or L1 sub-state control, not both at the same time. Examine the link partner's capabilities to determine which is the most suitable scheme to use. pcie: brcmstb: don't reset block bridges in suspend or removal cases BCM2712 has a single rescal block for all three root complexes, and holding PCIE1's bridge in reset will hang the chip if a different RC wants to access any of the rescal registers. pcie: brcmstb: guard 2712-specific setup with a RC type check BCM2711 doesn't implement the UBUS control registers. pcie: brcmstb: On 2712 keeping the PLL powered in L1.x is not required A separate misconfiguration when enabling SSC (the MDIO registers no longer do the same thing on BCM2712) had the side-effect of breaking PLL powerdown and resume sequencing. Allow entry into a true L1.2 state where analogue is depowered. pcie: brcmstb: Fix reset warning on probe failure Signed-off-by: Phil Elwell <phil@raspberrypi.com> bcm2712: pcie: adjust PHY PLL setup to use a 54MHz input refclk Use canned MDIO writes from Broadcom that switch the ref_clk output pair to run from the internal fractional PLL, and set the internal PLL to expect a 54MHz input reference clock. Gen3 operation is not guaranteed to be stable in this setup, so default to gen2. This only works if the LCPLL is bypassed (requires latest bootloader). pcie: brcmstb: add missing register writes drivers: pcie: brcmstb: cater for BCM2712C0 bug dropping QoS on the floor The AXI QoS value extracted from the request fifo ends up as zero forever. Disabling this means that "panic" signalling doesn't do anything useful, but static priorites do work. Also align the selected TC:QoS map with RP1's expectations of service. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> drivers: pcie: brcmstb: shuffle TC priorities up to 8 Use the range 8-11 which puts the highest below HVS but leaves space below for other 2712 masters. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> drivers: pcie: brcmstb: optionally enable QoS features by DT for BCM2712 It's a bad idea to universally enable "realtime" priorities for TCs across all the RC instances on the chip. Endpoints other than RP1 may make use of these, so you don't want e.g. NVMe descriptor fetches getting higher priority than your remote display. Add two optional DT properties controlling the behaviour - FIFO-based backpressure QoS or "message-based". Message-based signalling is fundamentally broken due to a chip bug, so it collapses into a set of static assignments that RP1 needs. The default if neither property is specified is to assign everything a QoS of 0. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> drivers: pcie: brcmstb: adjust completion timeouts for bcm2712 Setting the RC config retry timeout makes CRS auto-polling work, but the UBUS timeout will override the config retry. Both need to be large. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
-
Nick Hollinghurst authored
This avoids failures in cases where the panel is enabled or re-probed very soon after being disabled or probed. These can occur because the Atmel device can mis-behave over I2C for a few ms after any write to the POWERON register.
-
Jonathan Bell authored
dwc3 allocates scratch and event buffers in the top-level driver. Hack the probe function to set the DMA mask before trying to allocate these. I think the event buffers are only used in device mode, but the scratch buffers may be used if core hibernation is enabled. usb: dwc3: add support for new DT quirks Apply the optional axi-pipe-limit and dis-in-autoretry-quirk properties during driver probe. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> phy: phy-brcm-usb: Add 2712 support usb: dwc3: if the host controller instance number is present in DT, use it If two instances of a dwc3 host controller are specified in devicetree, then the probe order may be arbitrary which results in the device names swapping on a per-boot basis. If a "usb" alias with the instance number is specified, then use that to construct the device name instead of autogenerating one. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> rp1 dwc3 changes drivers: usb: dwc3: allow setting GTXTHRCFG on dwc_usb3.0 hardware Equivalent register fields exist in the SuperSpeed Host version of the hardware, so allow the use of TX thresholds if specified in devicetree. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> drivers: usb: dwc3: remove downstream quirk dis-in-autoretry Upstream have unilaterally disabled the feature. Partially reverts 6e9142a26ee0fdc3a5adc49ed6cedc0b16ec2ed1 (downstream) Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
-
Phil Elwell authored
macb: Add device tree properties that allow configuration of the AXI max pipeline register net: macb: add support for ethtool interrupt moderation configuration Only global throttling of rx or tx by time quanta is supported. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> macb: add platform device shutdown function. Prevents AXI master over PCIE from hanging when the host is rebooted. net: macb: increase polling interval for MDIO completion MDIO is a slow bus (single-digit MHz). Polling at 1us intervals is a bit aggressive, so increase to 100us as the transaction usually takes 100-200us to complete. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> net: macb: Several patches for RP1 64-bit RX fix Also set DMA coherent mask Add device tree properties that allow configuration of the AXI max pipeline register Add support for ethtool interrupt moderation configuration Only global throttling of rx or tx by time quanta is supported. Add platform device shutdown function. Prevents AXI master over PCIE from hanging when the host is rebooted. Increase polling interval for MDIO completion MDIO is a slow bus (single-digit MHz). Polling at 1us intervals is a bit aggressive, so increase to 100us as the transaction usually takes 100-200us to complete. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> net: macb: Support the phy-reset-gpios property Allow a PHY to be reset with an optional GPIO. The reset duration can be specified in milliseconds - the default is 10ms. Signed-off-by: Phil Elwell <phil@raspberrypi.com> drivers: net: macb: close device on driver shutdown Fix some suspicious locking and instead call into macb_close, which deregisters and frees all resources the corresponding macb_open claimed. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> net: macb: add hack to prevent TX stalls in a quiet system See https://github.com/raspberrypi/linux-2712/issues/89 There is some critical window during TX where a further write to the TSTART bit while TX is active does not cause newly queued TX descriptors to be consumed. For now "wait a bit, then try anyway" seems to work. Requires further investigation, but this unsticks NFS reliably. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> net: macb: set default interrupt moderation for GEM hardware Defaulting to intmod = 0 is antisocial, as the MAC can generate over 130,000 interrupts per second. 50us is a sensible default. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
-
Phil Elwell authored
reset_control_reset should not be used with shared reset controllers. Add support for reset_control_assert and _deassert to get the desired behaviour and avoid ugly warnings in the kernel log. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
irqchip: irq-bcm2712-mip: specify bitmap search size as ilog2(N) not N Freeing also has the same interface. irqchip: irq-bcm2712-mip: Fix build warnings Signed-off-by: Phil Elwell <phil@raspberrypi.com> irqchip: bcm2712-mip: add a quick hack to optionally shift MSI vectors There are two MIP peripherals in bcm2712, the first gets a first-class treatment where 64 consecutive GIC SPIs are assigned to all 64 output vectors. The second gets an agglomeration of 17 GIC SPIs, but only 8 of these are consecutive starting at the 8th output vector. For now, allow the use of this smaller contiguous range within a larger whole. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
-
Nick Hollinghurst authored
media: bcm2712: Initial commit of the PiSP BE driver Signed-off-by: Naushir Patuck <naush@raspberrypi.com> media: bcm2712_pisp_be: PiSP driver updates. - Start registering video nodes from /dev/video20 - Formatting fixes - Define MODULE_DEVICE_TABLE() to probe correctly Signed-off-by: Naushir Patuck <naush@raspberrypi.com> media: pisp_be: Improve image format support Add a new format table that lists the V4L2 format enums and their properties. Keep the exising 'RPBP' format to support the userland verification tools. This format requires userland to fill all plane properties. Standard V4L2 formats will derive these properties from the format table. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> media: pisp_be: Advertise the meta output format explictily. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> drivers: pisp_be: Various updates and cleanups - Switch to a single node group for now. - Add a node description table to simplify node handling. - Switch HoG output to V4L2_CAP_META_CAPTURE type. - Use string descriptions for node names in logging messages. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> pisp_be: Updates for libcamera usage: - Remove indexes from device entity names - Add enumframesize and enumfmts ioctls - Add default format to all nodes. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> v4l2: pisp_be: Move format definitions into v4l2 core Signed-off-by: Naushir Patuck <naush@raspberrypi.com> media: raspberrypi: Move PiSP common headers to a single location Signed-off-by: Naushir Patuck <naush@raspberrypi.com> media: raspberrypi: Remove old pispbe driver. This is now supersede by the driver in drivers/media/platform/raspberrypi/ Signed-off-by: Naushir Patuck <naush@raspberrypi.com> PISP-BE Driver: Automate buffer-cycling for TDN and Stitch state. Remove "tdn-input" and "stitch-input" nodes altogether (the output nodes must still be opened and REQBUFS called with 1 or 2 buffers). Also, a bit of tidying of buffer address handling and locking. PISP-BE driver: Turn debug level right down to reduce overly-chatty messages media: bcm2712: Depend on CONFIG_PM Depend on CONFIG_PM as the driver uses the runtime_pm infrastructure. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> drivers: media: pisp_be: Move BE driver to a raspberrypi directory Move the pisp_be driver from drivers/media/platform/raspberrypi/ to drivers/media/platform/raspberrypi/pisp_be/. This seems the accepted convention in the drivers/media/platform/ directory structure. Also rename the driver module from bcm2712_pisp_be to pisp_be. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> pisp_be: Updates for libcamera streaming: - Add some required v4l2 formats - Add buf_prepare ioctl - Set plane offsets correctly before reprogramming pisp_be: Reduce logging verbosity Signed-off-by: Naushir Patuck <naush@raspberrypi.com> pisp_be: Add buffer timestamps While at it, remove duplicate code when checking if the HW has completed multiple jobs. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> pisp_be: Remove queue size allocation constraint PISP-BE driver: Fix ISR to handle multiple done/start events. PISP-BE: Fix variable-name shadowing bugette PISP-BE: Support for two node groups. Reorganize the driver. To support 2 concurrent libcamera applications, we need 2 node groups, need to allow multiple opens of each node (because libcamera does this) and create a separate media device per group (to support file-locking). This triggered significant rearrangement of the driver. Some calls that we formerly intercepted have been delegated back to v4l2/vb2. Logging changes arising from multiple v4l2_dev. Refactored probe() and initialization. Avoid dynamically-allocated entity name strings. drivers: media: pisp_be: Add vidioc_enum_fmt_meta_out This was missing in the struct v4l2_ioctl_ops definition. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> drivers: media: pispe_be: Add Bayer compressed formats Add PiSP Bayer compressed formats to the list of supported pixel formats for the PiSP backend driver. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> drivers: meida: pisp_be: Fix overflow in plane size calculations The calculations for buffer plane sizes can overflow because of the plane factor shift. Fix this by using u64 integers for the calculations. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> drivers: media: pisp_be: Use 0P3 for plane factors Use less precision for the plane factors to avoid any nasty overflows. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> media: pisp: Checkpatch and coding style fixups Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> media: pisp_be: More coding style fixups media: platform: bcm2712: pisp_be: Fix crash when buffer format not set Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> media: platform: bcm2712: pisp_be: Allow non-SRGB colour spaces on RGB outputs Allow colour spaces other than SRGB when the output format in question is an RGB output. This commit merely ports over existing changes from the vc4 ISP driver. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> media: platform: bcm2712: Tweak list of BE supported image formats Remove RGB565 and 10- and 12-bit packed raw formats, which ISP-BE can't support for input or output. Add NV12M and NV21M which it can. (I didn't bother adding YUV422P, which apparently is not widely used.) Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> pisp_be: Fill the hardware revision in the media entity struct This can be used by userland to determine the hardware capabilities. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> bcm2712: Use BIT() macro Use the BIT() macro instead of plain bit shifting. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> bcm2712: Invert condition in pispbe_schedule_internal() Return earlier and save one indentation level Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> bcm2712: Invert condition in for loop Save one indentation level by continuing if the node is not streaming. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> bcm2712: Do not declare a local variable There already is a truct pispbe_node *node in the function scope. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> bcm21712: Siplify pispbe_schedule_one() A little more verbose but easier to follow ? Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> bcm2712: Rename pispbe_schedule_all() to pispbe_schedule_any() The pispbe_schedule_all() function name is misleading, as the function schedule a single job from any of the node groups. Rename it. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: platform: bcm2712: Remove buffer auto-cycling from ISP-BE Previously, the ISP-BE driver tried to automate "ping pong" buffers for TDN and HDR state, but did not fully conceal them from users. The automation has been removed: there are now separate output and capture queues for each of TDN and Stitch, which must be managed by user code (DMABUFs may be used to circulate buffers between queues). Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> drivers: media: pisp_be: Cache BE config buffer vaddr When programming a new job, we access at the config buffer, possibly from ISR context. So fetch and the virtual address when queuing the buffer. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> drivers: media: pisp_be: Remove all traces of ctrls and request API These APIs are not (and will not) be used by the driver, so remove them. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> media: bcm2712: Replace v4l2_dbg with dev_dbg Replace the v4l2 debug helpers with the device debug once, which are preferred. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Remove of_match_ptr() The of_match_ptr() usage could cause a compiler warning if CONFIG_OF is not enabled, as the pispbe_of_match variable would result unused. As the of_match_table field of struct platform_driver exists unconditionally, drop of_match_ptr() to avoid a warning. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> drivers: media: pispbe: Add local config buffer DMA allocation When initialiasing the driver, allocate a number of tiles + config structures used for storing hardware config internally in the driver. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> drivers: media: pispbe: Use local config buffers Store a copy of the config + tiles buffer locally when the buffer gets queued. This resolves the security issue where a userland process may modify the config buffer after it has been queued. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> drivers: media: pispbe: Validate config buffers Perform a basic config validation on the device output nodes to ensure the buffer size and stride values do not result in a buffer overrun. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> media: bcm2712: Rework probe sequence order Rework the probe sequence to: 1) Use dev_err_probe() when failing to get clocks 2) Disable clock on error path 3) Disable the node groups if they have been enabled and propagate the error up Also disable clocks in the remove() function. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Use pm_runtime_ops Introduce usage of runtime resume and suspend operations. The diver only uses a single clock source which is enable/disabled at resume and suspend time. Implement file open and release operations to control enablement of the clock provider. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Demote info message Demote info message about clock enablement to dev_dbg() Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Move pm_runtime calls to streamon/streamoff Move the calls to pm_runtime_resume_and_get() and pm_runtime_put() to the streamon and streamoff ioctl handlers. Remove custom handlers for the open and close file operations and use the framework provided helpers. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Use pm_runtime_autosuspend() Use the _autosuspend() version of runtime_pm_put() in order to avoid resuming and suspending the peripheral in between streaming sessions closely apart one from the other. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> drivers: media: pisp_be: Conditionally check buffers when preparing jobs When preparing a job, check the global enables in the config structure to see if the Output0/1, Tdn and Stitch blocks are enabled, and only test for a buffer queued if they are. This will allow userland to control the outputs selectively without disabling/re-enabling the respective device nodes. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> media: bcm2712: Rework media controller registration The current implementation register the v4l2_device and the video devices first, then creates the media controller and manually registers entities there. Rework the registration procedure to first create the v4l2_device and register the media_device with it. Then create the video nodes which gets automatically registered in the media graph by the core. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Create v4l2_subdev for ISP entity Create a v4l2 subdevice to represent the PISPBE ISP entity. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Fix v4l2-compliance warn on QUERYCAP Fix: warn: v4l2-compliance.cpp(669): media bus_info 'platform:1000880000.pisp_be' differs from V4L2 bus_info 'platform:pispbe' by populating the driver caps bus_info by using dev_name(). Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Fix v4l2-compliance warn on invalid pixfmt The V4L2 API for the TRY_FMT/S_FMT ioctl allows the ioctl handler to return an error code only in specific conditions. If an invalid pixel format is supplied it should be adjusted instead of an error being returned. Albeit, v4l2-compliance treats this situation as a warning and not as an error because the behaviour has been discussed in length in the past. warn: v4l2-test-formats.cpp(794): TRY_FMT cannot handle an invalid pixelformat. warn: v4l2-test-formats.cpp(795): This may or may not be a problem. For more information see: warn: v4l2-test-formats.cpp(796): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html VIDIOC_TRY_FMT returned -1 (Invalid argument) Regardless of the warning vs failure decision, adjust the try_format() function implementation to use V4L2_PIX_FMT_YUV420M as default pixel format if the supplied one is invalid. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Fix v4l2-compliance warn on HOG pix format The try_format() implementation for the HOG video device node returns an error if the supplied pixel format is not correct. As per the video device output and capture video nodes, this contradicts the V4L2 specification even if it is treated as a warning by v4l2-compliance. Fix this by forcing the buffer pixel format and size to the default supported one. While at here, use the BIT() macro in the format initialization function. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Fix formats enumeration Right now a single implementation of enum_fmt() is used for all nodes in a group. This means that all the BE supported formats are listed for all the nodes. This is incorrect as the meta capture and output node formats should be restricted, and the meta formats should not be enumerated for video output and capture devices. Fix this by restricting the enumeration of META formats to the config and hog nodes. Split out from the list of supported_formats the V4L2_META_FMT_RPI_BE_CFG which is only used for the meta_out node, while V4L2_PIX_FMT_RPI_BE is kept in the list of supported_formats as it can be used as an opaque format for both meta_cap, video_cap and video_out nodes. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> media: bcm2712: Minor fixes to support PiSP regression tests Allow RGB input, not just Bayer (but only of those at once); Allow Wallpaper image formats. XXX They are not yet size-checked; Set "chicken bits" to test BURST_TRIM and AXI AWID/BID variation. Convert some v4l2_err() to dev_err() Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com> drivers: media: pisp_be: Use the maximum number of config buffers Set PISP_BE_NUM_CONFIG_BUFFERS the the maximum number of possible buffers. In the worst case, this overallocates config buffers, but given their size, it's not too much of a problem. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> media: pisp_be: Fix extra PM runtime put vidioc_streamoff callback can be called even if vidioc_streamon was never called. The driver currently does PM runtime get/put in these callbacks, which may lead to a put without a matching get. Fix this by moving the PM runtime get/put to vb2_ops's start_streaming & stop_streaming, which the framework makes sure won't get extra calls. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> drivers: media: pisp_be: Don't report V4L2_PIX_FMT_RPI_BE format This is an internal opaque format, not to be reported in enum_fmt. Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
-
Phil Elwell authored
sdhci: remove PYA0_INTR_BUG quirk. Add quirks to disable some of the higher SDR speeds at 1.8v.
-
Ulf Hansson authored
BCM2712 has an SD Express capable SDHCI implementation and uses the SDIO CFG register block present on other STB chips. Add plumbing for SD Express handover and BCM2712-specific functions. Due to the common bus infrastructure between BCM2711 and BCM2712, the driver also needs to implement 32-bit IO accessors. mmc: brcmstb: override card presence if broken-cd is set Not just if the card is declared as nonremovable. sdhci: brcmstb: align SD express switchover with SD spec v8.00 Part 1 of the Physical specification, figure 3-24, details the switch sequence for cards initially probed as SD. Add a missing check for DAT2 level after switching VDD2 on. sdhci: brcmstb: clean up SD Express probe and error handling Refactor to avoid spurious error messages in dmesg if the requisite SD Express DT nodes aren't present. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> mmc: sdhci-brcmstb: only use the delay line PHY for tuneable speeds The MMC core has a 200MHz core clock which allows the use of DDR50 and below without incremental phase tuning. SDR50/SDR104 and the EMMC HS200 speeds require tuning. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
-
Dom Cobley authored
-
Phil Elwell authored
pinctrl: bcm2712: Reject invalid pulls Reject attempts to set pulls on aon-sgpios, and fix pull shift values. pinctrl: bcm2712: Add 7712 support, fix 2712 count Signed-off-by: Phil Elwell <phil@raspberrypi.com> pinctrl-bcm2712: add EMMC pins so pulls can be set These pins have pad controls but not mux controls. They look enough like GPIOs to squeeze in at the end of the list though. pinctrl: bcm2712: correct BCM2712C0 AON_GPIO pad pull control offset Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> pinctrl: bcm2712: on C0 the regular GPIO pad control register moves too Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com> pinctrl: bcm2712: Implement (partially) pinconf_get Signed-off-by: Phil Elwell <phil@raspberrypi.com> pinctrl: bcm2712: Convert to generic pinconf Remove the legacy brcm,* pin configuration support and replace it with a proper generic pinconf interface, using named functions instead of alt function numbers. This is nicer for users, less error-prone, and immune to some of the C0->D0 changes. Signed-off-by: Phil Elwell <phil@raspberrypi.com> pinctrl: bcm2712: Remove vestigial pull parameter Now the legacy brcm, pinconf parameters are no longer supported, this custom pin config parameter is not needed. Signed-off-by: Phil Elwell <phil@raspberrypi.com> pinctrl: bcm2712: Guard against bad func numbers Signed-off-by: Phil Elwell <phil@raspberrypi.com> pinctrl: bcm2712: A better attempt at D0 support The BCM2712D0 sparse pinctrl maps play havoc with the old GPIO_REGS macro, so make the bit positions explicit. And delete the unwanted GPIO and pinmux declarations on D0. Note that a Pi 5 with D0 requires a separate DTS file with "bcm2712d0" compatible strings. Signed-off-by: Phil Elwell <phil@raspberrypi.com> pinctrl: bcm2712: Delete base register constants BCM2712D0 deletes many GPIOs and their associated mux and pad bits, so much so that the offsets to the start of the pad control registers changes. Remove the constant offsets from the *GPIO_REGS macros, compensating by adjusting the per-GPIO values. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
Phil Elwell authored
-
Dom Cobley authored
gpio-brcmstb: Report the correct bank width gpio: brcmstb: Use bank address as gpiochip label If the path to the device node is used as gpiochip label then gpio-brcmstb instances with multiple banks end up with duplicated names. Instead, use a combination of the driver name with the physical address of the bank, which is both unique and helpful for devmem debugging. Signed-off-by: Phil Elwell <phil@raspberrypi.com> gpio: mmio: Add DIRECT mode for shared access The generic MMIO GPIO library uses shadow registers for efficiency, but this breaks attempts by raspi-gpio to change other GPIOs in the same bank. Add a DIRECT mode that makes fewer assumptions about the existing register contents, but note that genuinely simultaneous accesses are likely to lose updates. Signed-off-by: Phil Elwell <phil@raspberrypi.com> gpio: brcmstb: Don't always clear interrupt mask If the GPIO controller is not being used as an interrupt source leave the interrupt mask register alone. On BCM2712 it might be used to generate interrupts to the VPU firmware, and on other devices it doesn't matter since no interrupts will be generated. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
popcornmix authored
-
Dom Cobley authored
dtoverlays: Fix up edt5406 entries to match with vc4-kms-dsi-7inch vc4-kms-dsi-7inch expects the touch fragment to be named ts_i2c_frag, but edt5406 didn't do this. Fixes: 736d601fb38c ("dts: 2712: Update for device tree") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
-
Dom Cobley authored
-
Dom Cobley authored
This reverts commit c0ea202f.
-
- Sep 23, 2023
-
-
Phil Elwell authored
The HAT map is way of associating named overlays with HATs whose EEPROMs were programmed with the contents of the overlay. Unfortunately, change in the DT and kernel drivers has meant that some of these embedded overlays no longer function, or even don't apply. The HAT map is a mapping from HAT UUIDs to overlay names. If a HAT with a listed UUID is detected, the embedded overlay is ignored and the overlay named in the mapping is loaded in its place. Signed-off-by: Phil Elwell <phil@raspberrypi.com>
-
- Sep 20, 2023
-
-
Dom Cobley authored
This reverts commit 2bcf744d.
-
- Sep 19, 2023
-
-
Dom Cobley authored
-
Dom Cobley authored
Hardware that fails to read the edid is quite common. The kernel provides a mechanism to use one a of a few pre-built generic edid files for getting a basic video mode. However there is no easy was to add basic audio support, which requires a CTA extension block to report capabilities. Add an module option to request this. Signed-off-by: Dom Cobley <popcornmix@gmail.com>
-
Greg Kroah-Hartman authored
Link: https://lore.kernel.org/r/20230917191040.964416434@linuxfoundation.org Tested-by: SeongJae Park <sj@kernel.org> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Bagas Sanjaya <bagasdotme@gmail.com> Tested-by: Conor Dooley <conor.dooley@microchip.com> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org> Tested-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Wesley Chalmers authored
commit 3d028d5d upstream. [WHY] Currently, when insert_plane is called with insert_above_mpcc parameter that is equal to tree->opp_list, the function returns NULL. [HOW] Instead, the function should insert the plane at the top of the tree. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Jun Lei <jun.lei@amd.com> Acked-by: Tom Chung <chiahsuan.chung@amd.com> Signed-off-by: Wesley Chalmers <wesley.chalmers@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Maciej W. Rozycki authored
commit 4fe4a637 upstream. We have originally guarded fiddling with CHECKFLAGS in our arch Makefile by checking for the CONFIG_MIPS variable, not set for targets such as `distclean', etc. that neither include `.config' nor use the compiler. Starting from commit 805b2e1d ("kbuild: include Makefile.compiler only when compiler is needed") we have had a generic `need-compiler' variable explicitly telling us if the compiler will be used and thus its capabilities need to be checked and expressed in the form of compilation flags. If this variable is not set, then `make' functions such as `cc-option' are undefined, causing all kinds of weirdness to happen if we expect specific results to be returned, most recently: cc1: error: '-mloongson-mmi' must be used with '-mhard-float' messages with configurations such as `fuloong2e_defconfig' and the `modules_install' target, which does include `.config' and yet does not use the compiler. Replace the check for CONFIG_MIPS with one for `need-compiler' instead, so as to prevent the compiler from being ever called for CHECKFLAGS when not needed. Reported-by: Guillaume Tucker <guillaume.tucker@collabora.com> Closes: https://lore.kernel.org/r/85031c0c-d981-031e-8a50-bc4fad2ddcd8@collabora.com/ Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk> Fixes: 805b2e1d ("kbuild: include Makefile.compiler only when compiler is needed") Cc: stable@vger.kernel.org # v5.13+ Reported-by: "kernelci.org bot" <bot@kernelci.org> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-