platform/kernel/linux-rpi.git
4 years agoadd BME680 to i2c-sensor overlay
Willem Remie [Thu, 9 Jan 2020 20:16:49 +0000 (21:16 +0100)]
add BME680 to i2c-sensor overlay

4 years agodriver: char: rpivid: Fix access to freed memory
Dave Stevenson [Tue, 21 Jan 2020 16:44:14 +0000 (16:44 +0000)]
driver: char: rpivid: Fix access to freed memory

The error path during probe frees the private memory block, and
then promptly dereferences it to log an error message.

Use the base device instead of the pointer to it in the private
structure.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agodriver: char: rpimem: Add SPDX licence header.
Dave Stevenson [Wed, 15 Jan 2020 14:07:16 +0000 (14:07 +0000)]
driver: char: rpimem: Add SPDX licence header.

Stops checkpatch complaining.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agodriver: char: rpivid: Fix coding style whitespace issues.
Dave Stevenson [Wed, 15 Jan 2020 14:05:45 +0000 (14:05 +0000)]
driver: char: rpivid: Fix coding style whitespace issues.

Makes checkpatch happier.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agodriver: char: rpivid: Add error handling to the legacy device load
Dave Stevenson [Wed, 15 Jan 2020 14:02:43 +0000 (14:02 +0000)]
driver: char: rpivid: Add error handling to the legacy device load

The return value from device_create for the legacy device was never
checked or handled. Add the required error handling.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agodriver: char: rpivid: Clean up error handling use of ERR_PTR/IS_ERR
Dave Stevenson [Tue, 21 Jan 2020 16:24:45 +0000 (16:24 +0000)]
driver: char: rpivid: Clean up error handling use of ERR_PTR/IS_ERR

The driver used an unnecessary intermediate void* variable so it
only called ERR_PTR once to convert to the error value.

Switch to converting as the error arises to remove these intermediate
variables.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agodriver: char: rpivid: Destroy the legacy device on remove
Dave Stevenson [Wed, 15 Jan 2020 13:59:57 +0000 (13:59 +0000)]
driver: char: rpivid: Destroy the legacy device on remove

The legacy name support created a new device that was never destroyed.
If the driver was unloaded and reloaded, it failed due to the
device already existing.

Fixes: "75f1d14 driver: char: rpivid - also support legacy name"
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agoARM: dts: bcm2838: Add upstream RNG compatible
Stefan Wahren [Fri, 27 Dec 2019 11:01:17 +0000 (12:01 +0100)]
ARM: dts: bcm2838: Add upstream RNG compatible

This adds the ability to use the RNG with an upstream kernel.
Keep the old one for backward compatibility.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agohwrng: iproc-rng200 - Add support for BCM2711
Stefan Wahren [Fri, 27 Dec 2019 10:55:59 +0000 (11:55 +0100)]
hwrng: iproc-rng200 - Add support for BCM2711

commit 0f95b09a5f624964d520c8f6a2674090fb98ae25 upstream.

BCM2711 features a RNG200 hardware random number generator block.
So make the driver available.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: Stephen Brennan <stephen@brennan.io>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
4 years agoARM: bcm: Backport BCM2711 support from upstream
Stefan Wahren [Fri, 27 Dec 2019 10:40:56 +0000 (11:40 +0100)]
ARM: bcm: Backport BCM2711 support from upstream

Make the BCM2711 a different machine, but keep it in board_bcm2835.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agoARM: dts: bcm2838: Backport genet from upstream
Stefan Wahren [Wed, 25 Dec 2019 15:40:47 +0000 (16:40 +0100)]
ARM: dts: bcm2838: Backport genet from upstream

This backport all genet differences (different compatible, right PHY mode,
board specific stuff) from upstream.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agonet: bcmgenet: Add RGMII_RXID support
Stefan Wahren [Wed, 25 Dec 2019 15:35:54 +0000 (16:35 +0100)]
net: bcmgenet: Add RGMII_RXID support

This adds the missing support for the PHY mode RGMII_RXID.
It's necessary for the Raspberry Pi 4.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agoRevert "phy: broadcom: split out the BCM54213PE from the BCM54210E IDs"
Stefan Wahren [Fri, 27 Dec 2019 12:48:32 +0000 (13:48 +0100)]
Revert "phy: broadcom: split out the BCM54213PE from the BCM54210E IDs"

This reverts commit a377688aa4f69ebfe75c9dfc986e7d19605eb39f.

4 years agoRevert "phy: bcm54213pe: configure the LED outputs to be more user-friendly"
Stefan Wahren [Fri, 27 Dec 2019 12:48:08 +0000 (13:48 +0100)]
Revert "phy: bcm54213pe: configure the LED outputs to be more user-friendly"

This reverts commit 0f6693225eee62ee01c479c86fff76442979f906.

4 years agoARM: dts: bcm2838: Remove always-on from armv7-timer
Stefan Wahren [Wed, 25 Dec 2019 17:19:28 +0000 (18:19 +0100)]
ARM: dts: bcm2838: Remove always-on from armv7-timer

After moving bcm2835-system-timer to bcm283x.dtsi there is no need for
the always-on for armv7-timer anymore.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agoARM: dts: bcm283x: Move intc label to bcm2835-common.dtsi
Stefan Wahren [Wed, 25 Dec 2019 17:01:57 +0000 (18:01 +0100)]
ARM: dts: bcm283x: Move intc label to bcm2835-common.dtsi

The intc label isn't defined in bcm283x.dtsi, so we cannot use it there.
So move it to bcm2835-common.dtsi.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agoARM: dts: bcm2838: Backport node names from upstream
Stefan Wahren [Wed, 25 Dec 2019 14:55:29 +0000 (15:55 +0100)]
ARM: dts: bcm2838: Backport node names from upstream

According to devicetree specification the node name should describe
the general class of device like ethernet or interrupt-controller.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agoARM: dts: bcm2838-rpi-4-b: Backport BT part from upstream
Stefan Wahren [Wed, 25 Dec 2019 14:43:41 +0000 (15:43 +0100)]
ARM: dts: bcm2838-rpi-4-b: Backport BT part from upstream

The CYW43455 on the Raspberry Pi 4 doesn't use an external pin as lower
power clock anymore. So drop the GPIO clock from pinctrl. While we are at
this add the missing declaration of hardware flow control.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agoARM: dts: bcm2838-rpi-4-b: Fix memory node
Stefan Wahren [Wed, 25 Dec 2019 14:32:29 +0000 (15:32 +0100)]
ARM: dts: bcm2838-rpi-4-b: Fix memory node

We need to declare the proper device type, otherwise U-Boot won't boot
with this devicetree. While we are this let the bootloader set the actual
memory size.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agoARM: dts: bcm283x: Move pixelvalve to bcm2835-common.dtsi
Stefan Wahren [Fri, 27 Dec 2019 15:06:13 +0000 (16:06 +0100)]
ARM: dts: bcm283x: Move pixelvalve to bcm2835-common.dtsi

According to Eric Anholt the pixelvalves doesn't exists on BCM2711.
So move it to bcm2835-common.dtsi.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agoARM: dts: bcm283x: Move system timer back to bcm283x.dtsi
Stefan Wahren [Fri, 27 Dec 2019 10:15:00 +0000 (11:15 +0100)]
ARM: dts: bcm283x: Move system timer back to bcm283x.dtsi

During Raspberry Pi 4 upstream discussion Tim Gover confirmed that the
system timer also exists on BCM2711. So move it back to bcm283x.dtsi and
overwrite the interrupt definition in bcm2838.dtsi.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agoARM: dts: bcm283x: Remove simple-bus from fixed clocks
Stefan Wahren [Fri, 16 Aug 2019 20:32:02 +0000 (22:32 +0200)]
ARM: dts: bcm283x: Remove simple-bus from fixed clocks

commit 4b2d24662126b1e2a6b95c9dfe9e9044e105e5bd upstream.

The fixed clocks doesn't form some kind of bus. So let's remove it.
This fixes the follow DT schema warnings:

clocks: clock@3:reg:0: [3] is too short
clocks: clock@4:reg:0: [4] is too short
clocks: $nodename:0: 'clocks' does not match '^(bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$'
clocks: #size-cells:0:0: 0 is not one of [1, 2]
clocks: 'ranges' is a required property
clock@3: 'reg' does not match any of the regexes: 'pinctrl-[0-9]+'
clock@4: 'reg' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agoRevert "mmc: sdhci: Mask "spurious" interrupts"
Stefan Wahren [Sun, 8 Dec 2019 13:45:14 +0000 (14:45 +0100)]
Revert "mmc: sdhci: Mask "spurious" interrupts"

This reverts commit adac895210b88770190e9a501462f2100ab40ac8, because this
issue is already addressed by commit 19ec6bb80290e496021488084944b77f03a87dd7.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agobrcmfmac: Disable power management
Phil Elwell [Thu, 9 Jan 2020 14:15:39 +0000 (14:15 +0000)]
brcmfmac: Disable power management

Disable power management in the brcmfmac driver again as it is still
causing problems for some users.

4 years agopcie-brcmstb: Eliminate arch_dma_ops error message
Phil Elwell [Wed, 8 Jan 2020 17:21:09 +0000 (17:21 +0000)]
pcie-brcmstb: Eliminate arch_dma_ops error message

The driver attempts to set the dma_ops for the root complex, but doing
so causes an error message and only the end points need it. Fix the
error by making the code specific to the end point case.

Also copy some cosmetic tidy-ups from 5.5.y.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoPisound: MIDI communication fixes for scaled down CPU.
Giedrius [Tue, 7 Jan 2020 09:04:21 +0000 (11:04 +0200)]
Pisound: MIDI communication fixes for scaled down CPU.

* Increased maximum SPI communication speed to avoid running too slow
  when the CPU is scaled down and losing MIDI data.

* Keep track of buffer usage in millibytes for higher precision.

Signed-off-by: Giedrius Trainavičius <giedrius@blokas.io>
4 years agopinctrl: bcm2835: Change init order for gpio hogs
Phil Elwell [Mon, 6 Jan 2020 14:05:42 +0000 (14:05 +0000)]
pinctrl: bcm2835: Change init order for gpio hogs

pinctrl-bcm2835 is a combined pinctrl/gpio driver. Currently the gpio
side is registered first, but this breaks gpio hogs (which are
configured during gpiochip_add_data). Part of the hog initialisation
is a call to pinctrl_gpio_request, and since the pinctrl driver hasn't
yet been registered this results in an -EPROBE_DEFER from which it can
never recover.

Change the initialisation sequence to register the pinctrl driver
first.

See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=260600

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agopinctrl: bcm2835: Remove gpiochip on error
Phil Elwell [Mon, 6 Jan 2020 16:04:30 +0000 (16:04 +0000)]
pinctrl: bcm2835: Remove gpiochip on error

A failure in gpiochip_irqchip_add leads to a leak of a gpiochip. Fix
the leak with the use of devm_gpiochip_add_data.

Fixes: 85ae9e512f43 ("pinctrl: bcm2835: switch to GPIOLIB_IRQCHIP")
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agooverlays: i2c-rtc: Add pcf85363 support
Phil Elwell [Sun, 22 Dec 2019 15:29:40 +0000 (15:29 +0000)]
overlays: i2c-rtc: Add pcf85363 support

See: https://github.com/raspberrypi/firmware/issues/1309

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoconfigs: Add RTS_DRV_PCF85363
Phil Elwell [Sun, 22 Dec 2019 15:13:37 +0000 (15:13 +0000)]
configs: Add RTS_DRV_PCF85363

See: https://github.com/raspberrypi/firmware/issues/1309

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoconfigs: Add CONFIG_NET_SCH_CAKE=m
Phil Elwell [Fri, 20 Dec 2019 15:50:19 +0000 (15:50 +0000)]
configs: Add CONFIG_NET_SCH_CAKE=m

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agooverlays: dht11: Allow multiple instantiation
Phil Elwell [Wed, 18 Dec 2019 10:41:33 +0000 (10:41 +0000)]
overlays: dht11: Allow multiple instantiation

Add addresses to the dht11 and dht11_pins nodes to allow unique names
to be generated by assigning to the "reg" property.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoAllow simultaneous use of JustBoom DAC and Digi
Johannes Krude [Sat, 16 Nov 2019 12:14:43 +0000 (13:14 +0100)]
Allow simultaneous use of JustBoom DAC and Digi

Signed-off-by: Johannes Krude <johannes@krude.de>
4 years agosound/soc: only first codec is master in multicodec setup
Johannes Krude [Sat, 16 Nov 2019 11:41:06 +0000 (12:41 +0100)]
sound/soc: only first codec is master in multicodec setup

When using multiple codecs, at most one codec should generate the master
clock. All codecs except the first are therefore configured for slave
mode.

Signed-off-by: Johannes Krude <johannes@krude.de>
4 years agorpi-cirrus-wm5102-overlay: use reset-gpios instead of wlf,reset
Matthias Reichl [Mon, 16 Dec 2019 22:25:44 +0000 (23:25 +0100)]
rpi-cirrus-wm5102-overlay: use reset-gpios instead of wlf,reset

wlf,reset has been deprecated in favour of the standard reset-gpios
DT property in commit fced2963d84b44990f4aa99ed7268223c294c0df so
let's use that instead of the old property.

Signed-off-by: Matthias Reichl <hias@horus.com>
4 years agoconfig: arm64: Switch to upstream cpufreq driver
popcornmix [Fri, 29 Nov 2019 16:37:26 +0000 (16:37 +0000)]
config: arm64: Switch to upstream cpufreq driver

Signed-off-by: popcornmix <popcornmix@gmail.com>
4 years agooverlays: Make mcp342x run-time compatible
Phil Elwell [Mon, 9 Dec 2019 12:32:20 +0000 (12:32 +0000)]
overlays: Make mcp342x run-time compatible

The order of processing of run-time overlays differs from that done by
the firmware. This means that certain parameter processing techniques
are not compatible with run-time use.  The mcp342x overlay is one such
overlay, but it is easy to change the implementation without changing
the interface.

See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=258294

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agodwc_otg: checking the urb->transfer_buffer too early (#3332)
Hui Wang [Sun, 17 Nov 2019 02:31:46 +0000 (10:31 +0800)]
dwc_otg: checking the urb->transfer_buffer too early (#3332)

After enable the HIGHMEM and VMSPLIT_3G, the dwc_otg driver doesn't
work well on Pi2/3 boards with 1G physical ram. Users experience
the failure when copying a file of 600M size to the USB stick. And
at the same time, the dmesg shows:
usb 1-1.1.2: reset high-speed USB device number 8 using dwc_otg
sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
blk_update_request: I/O error, dev sda, sector 3024048 op 0x1:(WRITE) flags 0x4000 phys_seg 15 prio class 0

When this happens, the sg_buf sent to the driver is located in the
highmem region, the usb_sg_init() in the core/message.c will leave
transfer_buffer to NULL if the sg_buf is in highmem, but in the
dwc_otg driver, it returns -EINVAL unconditionally if transfer_buffer
is NULL.

The driver can handle the situation of buffer to be NULL, if it is in
DMA mode, it will convert an address from transfer_dma.

But if the conversion fails or it is in the PIO mode, we should check
buffer and return -EINVAL if it is NULL.

BugLink: https://bugs.launchpad.net/bugs/1852510
Signed-off-by: Hui Wang <hui.wang@canonical.com>
4 years agoRevert "staging: bcm2835_camera: Ensure all buffers are returned on disable"
Dave Stevenson [Thu, 5 Dec 2019 16:34:39 +0000 (16:34 +0000)]
Revert "staging: bcm2835_camera: Ensure all buffers are returned on disable"

This reverts commit d70c57a7c6a069977a0d827e1d5e2de53fb87e6d.

The patch has mutated beyond recognition and created merge errors
against 37c35be "staging: mmal-vchiq: Add support for event callbacks."

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agostaging: vchiq: Use the old dma controller for OF config on platform devices
Dave Stevenson [Tue, 18 Jun 2019 11:15:50 +0000 (12:15 +0100)]
staging: vchiq: Use the old dma controller for OF config on platform devices

vchiq on Pi4 is no longer under the soc node, therefore it
doesn't get the dma-ranges for the VPU.

Switch to using the configuration of the old dma controller as
that will set the dma-ranges correctly.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
4 years agostaging: vchiq_arm: Set up dma ranges on child devices
Dave Stevenson [Tue, 29 Jan 2019 16:13:25 +0000 (16:13 +0000)]
staging: vchiq_arm: Set up dma ranges on child devices

The VCHIQ driver now loads the audio, camera, codec, and vc-sm
drivers as platform drivers. However they were not being given
the correct DMA configuration.

Call of_dma_configure with the parent (VCHIQ) parameters to be
inherited by the child.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
4 years agorpi-cirrus-wm5102-overlay: fix pinctrl configuration
Matthias Reichl [Sat, 30 Nov 2019 22:10:26 +0000 (23:10 +0100)]
rpi-cirrus-wm5102-overlay: fix pinctrl configuration

Separate GPIOs connected to wm5102 and wm8804 into 2 pinctrl
blocks and properly reference them from the DT nodes to have
correct pinmux owners.

Setup spi0 to use only one CS line on GPIO7 so that GPIO8 is
no longer claimed by spi0 but can be used by wm8804.

Signed-off-by: Matthias Reichl <hias@horus.com>
4 years agoRevert "drm/vc4: Add support for H & V flips"
Dave Stevenson [Thu, 28 Nov 2019 15:51:58 +0000 (15:51 +0000)]
Revert "drm/vc4: Add support for H & V flips"

This reverts commit 3293cb5284bf7c80217cba8e7c3f67fba1953e1d.
This functionality has already been added via
"7cd3cf3 drm/vc4: Add support for X/Y reflection"
Calling drm_plane_create_rotation_property corrupts the
plane properties list.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agoarm/dts: 2711: Add 'pcie0' alias
Phil Elwell [Thu, 28 Nov 2019 15:49:08 +0000 (15:49 +0000)]
arm/dts: 2711: Add 'pcie0' alias

It is useful for the firmware to be able to locate the pcie DT node,
so add an alias pointing to it in the same way that "ethernet0"
points to the genet.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agodrm/v3d: Set dma_mask as well as coherent_dma_mask
Phil Elwell [Fri, 22 Nov 2019 16:23:32 +0000 (16:23 +0000)]
drm/v3d: Set dma_mask as well as coherent_dma_mask

Both coherent_dma_mask and dma_mask act as constraints on allocations
and bounce buffer usage, so be sure to set dma_mask to the appropriate
value otherwise the effective mask could be incorrect.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoarm/dts: Correct Pi 4B LED values
Phil Elwell [Fri, 22 Nov 2019 15:08:25 +0000 (15:08 +0000)]
arm/dts: Correct Pi 4B LED values

The initial PHY LED settings are wrong Pi 4B (the correct values got
dropped somewhere along the way). The PHY declaration should arguably
go in a separate file included by bcm2711-rpi-4-b.dts, but we can
fix that as we switch over to using more of the upstream BCM2711
support in 5.4 and later.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoconfigs:2711: Add V3D clock support on arm64
Phil Elwell [Fri, 22 Nov 2019 11:44:30 +0000 (11:44 +0000)]
configs:2711: Add V3D clock support on arm64

The V3D driver now depends on the CLK_RASPBERRYPI and
ARM_RASPBERRYPI_CPUFREQ drivers for dynamic clock control. Without
them the driver fails to load and the system reverts to software
rendering.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoconfigs: Regenerate defconfigs
Phil Elwell [Fri, 22 Nov 2019 11:38:09 +0000 (11:38 +0000)]
configs: Regenerate defconfigs

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoraspberrypi-cpufreq: Only report integer pll divisor frequencies
popcornmix [Fri, 13 Sep 2019 12:45:11 +0000 (13:45 +0100)]
raspberrypi-cpufreq: Only report integer pll divisor frequencies

4 years agoconfig: Switch to upstream cpufreq driver
popcornmix [Tue, 20 Aug 2019 16:53:47 +0000 (17:53 +0100)]
config: Switch to upstream cpufreq driver

Signed-off-by: popcornmix <popcornmix@gmail.com>
4 years agoclk-bcm2835: Disable v3d clock
popcornmix [Tue, 3 Sep 2019 19:28:00 +0000 (20:28 +0100)]
clk-bcm2835: Disable v3d clock

This is controlled by firmware, see clk-raspberrypi.c

Signed-off-by: popcornmix <popcornmix@gmail.com>
4 years agoclk-raspberrypi: Also support v3d clock
popcornmix [Wed, 21 Aug 2019 13:55:56 +0000 (14:55 +0100)]
clk-raspberrypi: Also support v3d clock

Signed-off-by: popcornmix <popcornmix@gmail.com>
4 years agoclk-raspberrypi: Allow cpufreq driver to also adjust gpu clocks
popcornmix [Mon, 9 Sep 2019 14:49:56 +0000 (15:49 +0100)]
clk-raspberrypi: Allow cpufreq driver to also adjust gpu clocks

For performance/power it is beneficial to adjust gpu clocks with arm clock.
This is how the downstream cpufreq driver works

Signed-off-by: popcornmix <popcornmix@gmail.com>
4 years agov3d_gem: Kick the clock so firmware knows we are using firmware clock interface
popcornmix [Thu, 5 Sep 2019 16:59:14 +0000 (17:59 +0100)]
v3d_gem: Kick the clock so firmware knows we are using firmware clock interface

Setting the v3d clock to low value allows firmware to handle dvfs in case
where v3d hardware is not being actively used (e.g. console use).

Signed-off-by: popcornmix <popcornmix@gmail.com>
4 years agov3d_drv: Allow clock retrieval by name
popcornmix [Mon, 9 Sep 2019 22:50:44 +0000 (23:50 +0100)]
v3d_drv: Allow clock retrieval by name

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agov3d_drv: Handle missing clock more gracefully
popcornmix [Fri, 23 Aug 2019 15:34:38 +0000 (16:34 +0100)]
v3d_drv: Handle missing clock more gracefully

Signed-off-by: popcornmix <popcornmix@gmail.com>
4 years agoarm: dts: overlays: pitft35-resistive: add upstream compatible
Peter Robinson [Sun, 17 Nov 2019 16:20:24 +0000 (16:20 +0000)]
arm: dts: overlays: pitft35-resistive: add upstream compatible

The upstream hx8357d driver uses "adafruit,yx350hv15" for the compatible
string explicitly for this screen config and not a hx8357d generic for
the controller so add that in as well so it will work with an unmodified
upstream kernel driver. We leave the downstream as the priority.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
4 years agoRevert "brcmfmac: Disable power management"
Phil Elwell [Wed, 13 Nov 2019 16:28:10 +0000 (16:28 +0000)]
Revert "brcmfmac: Disable power management"

Shortly after the release of the Pi 3B, a loss of SSH connectivity
over WiFi was traced to the power management handling, so power
management was disabled. And so it has remained ever since.

Enabling power management saves 55mA (~270mW) on a Pi 4B, so is very
much worth the minimal effort of reverting this patch, which was
squashed and rebased many times since then to the commit hash is
meaningless.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agooverlays: Remove hack from uart0 overlay
Phil Elwell [Tue, 1 Oct 2019 09:19:50 +0000 (10:19 +0100)]
overlays: Remove hack from uart0 overlay

The uart0 overlay contained a hack to return GPIOs 14 and 15 to inputs
when the UART0 function was moved to alternative pins. This has the
unwanted side effect of claiming GPIOs 14 & 15, preventing them being
used for something else.

See: https://github.com/raspberrypi/linux/issues/2856
     https://www.raspberrypi.org/forums/viewtopic.php?f=98&t=252911

Signed-off-by: Stefan Enge <stefan.enge@escatec.com>
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoconfigs: apds9960: add module to defconfigs
Michael Kaplan [Fri, 8 Nov 2019 10:13:25 +0000 (11:13 +0100)]
configs: apds9960: add module to defconfigs

Signed-off-by: Michael Kaplan <m.kaplan@evva.com>
4 years agooverlays: Add apds9960 overlay
Michael Kaplan [Fri, 8 Nov 2019 09:35:57 +0000 (10:35 +0100)]
overlays: Add apds9960 overlay

Add an overlay for the AVAGO APDS9960 digital proximity, ambient light, rgb and gesture sensor.
Also update overlay README and Makefile.

Signed-off-by: Michael Kaplan <m.kaplan@evva.com>
4 years agonet:phy:2711 Change the default ethernet LED actions
James Hughes [Thu, 7 Nov 2019 14:59:59 +0000 (14:59 +0000)]
net:phy:2711 Change the default ethernet LED actions

This should return default behaviour back to that of previous
releases.

4 years agooverlays: smi: fix typo in comment (#3320)
Pierre-jean Texier [Wed, 6 Nov 2019 09:00:43 +0000 (10:00 +0100)]
overlays: smi: fix typo in comment (#3320)

5 represent alt1 function not alt0.

Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io>
4 years agonet:phy:2711 Allow ethernet LED mode to be set via device tree
James Hughes [Thu, 31 Oct 2019 14:39:44 +0000 (14:39 +0000)]
net:phy:2711 Allow ethernet LED mode to be set via device tree

Add device tree entries and code to allow the specification of
the lighting modes for the LED's on the ethernet connector.

Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
4 years agorpi-poe-fan: fix def_pwm1 writes
Serge Schneider [Thu, 31 Oct 2019 13:37:16 +0000 (13:37 +0000)]
rpi-poe-fan: fix def_pwm1 writes

Signed-off-by: Serge Schneider <serge@raspberrypi.org>
4 years agodwc_otg: Declare DMA capability with HCD_DMA flag
Phil Elwell [Fri, 15 Nov 2019 08:48:08 +0000 (08:48 +0000)]
dwc_otg: Declare DMA capability with HCD_DMA flag

Following [1], USB controllers have to declare DMA capabilities in
order for them to be used by adding the HCD_DMA flag to their hc_driver
struct.

[1] 7b81cb6bddd2 ("usb: add a HCD_DMA flag instead of guestimating DMA capabilities")

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agodrm/v3d: The third IRQ is optional
Phil Elwell [Thu, 14 Nov 2019 12:00:43 +0000 (12:00 +0000)]
drm/v3d: The third IRQ is optional

As of 5.4, the kernel logs errors for absent IRQs unless requested
with platform_get_irq_optional.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agonet: bcmgenet: The second IRQ is optional
Phil Elwell [Thu, 14 Nov 2019 11:59:01 +0000 (11:59 +0000)]
net: bcmgenet: The second IRQ is optional

As of 5.4, the kernel logs errors for absent IRQs unless requested
with platform_get_irq_optional.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agostaging: vchiq_arm: Unify the unload handling of platform devs
Dave Stevenson [Wed, 6 Nov 2019 13:58:18 +0000 (13:58 +0000)]
staging: vchiq_arm: Unify the unload handling of platform devs

A helper function vchiq_register_child was added to deal with
adding the platform devices. This returns NULL on failure, and
that is assigned to the struct platform_device. There is
therefore no way for remove to encounter an error pointer, so
checking for IS_ERR() is redundant.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agostaging: bcm2835-codec: Fix potential memory leak of isp instance
Dave Stevenson [Wed, 6 Nov 2019 13:58:08 +0000 (13:58 +0000)]
staging: bcm2835-codec: Fix potential memory leak of isp instance

"d867785 staging: bcm2835-codec: add media controller support" added
a new error path that jumped to end, but didn't add the free
of the ISP device should that path be taken.
Fix this.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agostaging: vchiq_arm: Register bcm2835-codec as a platform driver
Dave Stevenson [Wed, 6 Nov 2019 13:57:58 +0000 (13:57 +0000)]
staging: vchiq_arm: Register bcm2835-codec as a platform driver

Following the same pattern as bcm2835-camera and bcm2835-audio,
register the V4L2 codec driver as a platform driver

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agostaging: vchiq_arm: Register vcsm-cma as a platform driver
Dave Stevenson [Wed, 6 Nov 2019 13:57:48 +0000 (13:57 +0000)]
staging: vchiq_arm: Register vcsm-cma as a platform driver

Following the same pattern as bcm2835-camera and bcm2835-audio,
register the vcsm-cma driver as a platform driver

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
4 years agodrm/v3d: Plug dma_fence leak
Phil Elwell [Tue, 12 Nov 2019 16:41:21 +0000 (16:41 +0000)]
drm/v3d: Plug dma_fence leak

The irq_fence and done_fence are given a reference that is never
released. The necessary dma_fence_put()s seem to have been
deleted in error in an earlier commit.

Fixes: 0b73676836b2 ("drm/v3d: Clock V3D down when not in use.")

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agodrm/v3d: Suppress all but the first MMU error
Phil Elwell [Mon, 11 Nov 2019 20:18:08 +0000 (20:18 +0000)]
drm/v3d: Suppress all but the first MMU error

The v3d driver currently encounters a lot of MMU PTE exceptions, so
only log the first to avoid swamping the kernel log.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agodrm/v3d: Don't clear MMU control bits on exception
Phil Elwell [Mon, 11 Nov 2019 14:01:41 +0000 (14:01 +0000)]
drm/v3d: Don't clear MMU control bits on exception

MMU exception conditions are reported in the V3D_MMU_CTRL register as
write-1-to-clear (W1C) bits. The MMU interrupt handling code clears any
exceptions, but does so by masking out any other bits and writing the
result back. There are some important control bits in that register,
including MMU_ENABLE, so a safer approach is to simply write back the
value just read unaltered.

This patch doesn't remove the cause of the apparent PTE errors, but it
does reduce the impact to just an error in the kernel log.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoRevert "pinctrl: bcm2835: Pass irqchip when adding gpiochip"
popcornmix [Tue, 5 Nov 2019 11:28:19 +0000 (11:28 +0000)]
Revert "pinctrl: bcm2835: Pass irqchip when adding gpiochip"

This reverts commit 73345a18d464b1b945b29f54f630ace6873344e2.

4 years agoconfigs: Rebuild with savedefconfig
popcornmix [Mon, 4 Nov 2019 00:52:35 +0000 (00:52 +0000)]
configs: Rebuild with savedefconfig

4 years agodrm:vc4 Added calls for firmware display blank/unblank
James Hughes [Wed, 16 Oct 2019 13:49:23 +0000 (14:49 +0100)]
drm:vc4 Added calls for firmware display blank/unblank

Requires new display power mailbox call to be present.

Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
4 years agostaging: bcm2835-codec: Fix imbalance in dma_buf_get/dma_buf_put
Dave Stevenson [Mon, 7 Oct 2019 13:02:57 +0000 (14:02 +0100)]
staging: bcm2835-codec: Fix imbalance in dma_buf_get/dma_buf_put

When represented with a dmabuf buffer that had previously been
imported, there was a call to dma_buf_get without a matching
dma_buf_put. This left dmabufs in limbo after all users had
supposedly released them.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
4 years agostaging: bcm2835-codec: Set default and error check timeperframe
Dave Stevenson [Fri, 13 Sep 2019 16:23:26 +0000 (17:23 +0100)]
staging: bcm2835-codec: Set default and error check timeperframe

G_PARM default was invalid as 0/0, and the driver didn't check
the value set in S_PARM wasn't 0/0.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
4 years agostaging: bcm2835-codec: Correct buffer type check on G_PARM
Dave Stevenson [Fri, 13 Sep 2019 16:22:08 +0000 (17:22 +0100)]
staging: bcm2835-codec: Correct buffer type check on G_PARM

The output queue buffer type is now OUTPUT_MPLANE.

Fixes: 5e484a3 staging: bcm2835-codec: switch to multi-planar API
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
4 years agostaging:bcm2835-codec: Add support for ENUM_FRAMESIZES
Dave Stevenson [Fri, 13 Sep 2019 16:19:33 +0000 (17:19 +0100)]
staging:bcm2835-codec: Add support for ENUM_FRAMESIZES

Required for compliance testing for the encoder.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
4 years agomedia: i2c: Add a driver for the Infineon IRS1125 depth sensor
Markus Proeller [Thu, 10 Oct 2019 17:12:36 +0000 (19:12 +0200)]
media: i2c: Add a driver for the Infineon IRS1125 depth sensor

The Infineon IRS1125 is a time of flight depth sensor that
has a CSI-2 interface.

Add a V4L2 subdevice driver for this device.

Signed-off-by: Markus Proeller <markus.proeller@pieye.org>
4 years agodt-bindings: Add binding for the Infineon IRS1125 sensor
Markus Proeller [Thu, 10 Oct 2019 17:12:08 +0000 (19:12 +0200)]
dt-bindings: Add binding for the Infineon IRS1125 sensor

Adds a binding for the Infineon IRS1125 time-of-flight depth
sensor.

Signed-off-by: Markus Proeller <markus.proeller@pieye.org>
4 years agobcm2711: Retain support for old dtbs
Phil Elwell [Wed, 9 Oct 2019 16:22:07 +0000 (17:22 +0100)]
bcm2711: Retain support for old dtbs

The recent series switching to bcm2711 as the DT identifier broke Pis
running with old DTBs. Add some bcm2838 compatible strings as a
temporary measure, at least until the next full Raspbian image with
bcm2711 DTBs.

See: https://github.com/raspberrypi/linux/pull/3244

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agodrm/vc4: Correct handling of rotation parameter in fkms
Dave Stevenson [Wed, 18 Sep 2019 14:49:13 +0000 (15:49 +0100)]
drm/vc4: Correct handling of rotation parameter in fkms

One bit within DRM_MODE_ROTATE_MASK will always be set to
determine the base rotation 0/90/180/270, and then REFLECT_X
and REFLECT_Y are on top.

Correct the handling which was assuming that REFLECT_[X|Y]
was instead of ROTATE_x.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
4 years agodrm/vc4: Add support for H & V flips
Dave Stevenson [Tue, 17 Sep 2019 17:36:32 +0000 (18:36 +0100)]
drm/vc4: Add support for H & V flips

The HVS supports horizontal and vertical flips whilst composing.

Expose these through the standard DRM rotation property.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
4 years agodrm/vc4: Add support for YUV color encodings and ranges
Dave Stevenson [Tue, 17 Sep 2019 17:28:17 +0000 (18:28 +0100)]
drm/vc4: Add support for YUV color encodings and ranges

The BT601/BT709 color encoding and limited vs full
range properties were not being exposed, defaulting
always to BT601 limited range.

Expose the parameters and set the registers appropriately.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
4 years agopcie-brcmstb-bounce64.c: dev_err() -> dev_info() for info messages
Floris Bos [Fri, 4 Oct 2019 14:41:30 +0000 (16:41 +0200)]
pcie-brcmstb-bounce64.c: dev_err() -> dev_info() for info messages

"dmabounce: initialised" is not an error, so do not log it as such.
Prevents screen polution on OS with "quiet" as kernel parameter.

Closes #3266

4 years agoRename HDMI ALSA device names, check for enable state
James Hughes [Tue, 24 Sep 2019 17:26:55 +0000 (18:26 +0100)]
Rename HDMI ALSA device names, check for enable state

HDMI Alsa devices renamed to match names used by DRM, to
HDMI 1 and HDMI 2

Check for which HDMI devices are connected and only create
devices for those that are present.

The rename of the devices might cause some backwards compatibility
issues, but since this particular part of the driver needs to be
specifically enabled, I suspect the number of people who will see
the problem will be very small.

Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
4 years agovchiq_2835_arm: suppress warning
Matteo Croce [Sun, 6 Oct 2019 01:23:15 +0000 (03:23 +0200)]
vchiq_2835_arm: suppress warning

Suppress the following warning by casting the pointer to and uintptr_t
before void*:

  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c: In function ‘vchiq_prepare_bulk_data’:
  drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c:260:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    bulk->data = (void *)VC_SAFE(pagelistinfo->dma_addr);
                 ^

Signed-off-by: Matteo Croce <mcroce@redhat.com>
4 years agopinctrl: bcm2835: Add support for BCM2711 pull-up functionality
Stefan Wahren [Sun, 21 Jul 2019 14:01:36 +0000 (16:01 +0200)]
pinctrl: bcm2835: Add support for BCM2711 pull-up functionality

commit e38a9a437fb93ddafab5030165e4c6a3a5021669 upstream.

The BCM2711 has a new way of selecting the pull-up/pull-down setting
for a GPIO pin. The registers used for the BCM2835, GP_PUD and
GP_PUDCLKn0, are no longer connected. A new set of registers,
GP_GPIO_PUP_PDN_CNTRL_REGx must be used. This commit will add
a new compatible string "brcm,bcm2711-gpio" and the kernel
driver will use it to select which method is used to select
pull-up/pull-down.

This patch based on a patch by Al Cooper which was intended for the
BCM7211. This is a bugfixed and improved version.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Eric Anholt <eric@anholt.net>
4 years agoARM: bcm: Switch board, clk and pinctrl to bcm2711 compatible
Stefan Wahren [Thu, 19 Sep 2019 18:45:30 +0000 (20:45 +0200)]
ARM: bcm: Switch board, clk and pinctrl to bcm2711 compatible

After the decision to use bcm2711 compatible for upstream, we should
switch all accepted compatibles to bcm2711. So we can boot with
one DTB the down- and the upstream kernel.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
4 years agodma-direct: Temporary DMA fix on arm64
Phil Elwell [Wed, 25 Sep 2019 08:49:58 +0000 (09:49 +0100)]
dma-direct: Temporary DMA fix on arm64

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agokbuild: Allow .dtbo overlays to be built piecemeal
Phil Elwell [Mon, 23 Sep 2019 08:26:41 +0000 (09:26 +0100)]
kbuild: Allow .dtbo overlays to be built piecemeal

Before 4.20, it was possible to build an arbitrary overlay by copying
it to arm/boot/dts/overlays/mytest-overlay.dts and running:

    make ARCH=arm overlays/mytest.dtbo

In 4.20 the .dtb build rules were centralised, requiring the dowstream
.dtbo build rules to be changed. They were, enough to support "make ...
dtbs", but not sufficiently to allow this ad-hoc, one-off building of
individual files.

Add the missing makefile rule to support this way of building.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agodrm/v3d: clean caches at the end of render jobs on request from user space
Iago Toral Quiroga [Tue, 3 Sep 2019 06:45:24 +0000 (08:45 +0200)]
drm/v3d: clean caches at the end of render jobs on request from user space

Extends the user space ioctl for CL submissions so it can include a request
to flush the cache once the CL execution has completed. Fixes memory
write violation messages reported by the kernel in workloads involving
shader memory writes (SSBOs, shader images, scratch, etc) which sometimes
also lead to GPU resets during Piglit and CTS workloads.

v2: if v3d_job_init() fails we need to kfree() the job instead of
    v3d_job_put() it (Eric Anholt).

v3 (Eric Anholt):
  - Drop _FLAG suffix from the new flag name.
  - Add a new param so userspace can tell whether cache flushing is
    implemented in the kernel.

Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
4 years agodts: Add DTS for Pi 2B rev 1.2 with BCM2837 (#3235)
Phil Elwell [Wed, 18 Sep 2019 08:02:10 +0000 (09:02 +0100)]
dts: Add DTS for Pi 2B rev 1.2 with BCM2837 (#3235)

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agoconfigs: Regenerate defconfigs
Phil Elwell [Thu, 19 Sep 2019 12:39:15 +0000 (13:39 +0100)]
configs: Regenerate defconfigs

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agodrm/v3d: Delete pm_runtime support
Phil Elwell [Wed, 18 Sep 2019 16:22:36 +0000 (17:22 +0100)]
drm/v3d: Delete pm_runtime support

The pm_runtime was blocking changelist submission, so delete it as a
temporary workaround.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
4 years agostaging: bcm2835-codec: Correct g/s_selection API MPLANE support
Dave Stevenson [Fri, 13 Sep 2019 14:11:47 +0000 (15:11 +0100)]
staging: bcm2835-codec: Correct g/s_selection API MPLANE support

The g_selection and s_selection API is messed up and requires
the driver to expect the non-MPLANE buffer types, not the MPLANE
ones even if they are supported. The V4L2 core will convert the
MPLANE ones to non-MPLANE should they be passed in

Fixes: 5e484a3 staging: bcm2835-codec: switch to multi-planar API
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>