mbox series

[V3,0/8] ARM: Add minimal Raspberry Pi 4 support

Message ID 1569672435-19823-1-git-send-email-wahrenst@gmx.net (mailing list archive)
Headers show
Series ARM: Add minimal Raspberry Pi 4 support | expand

Message

Stefan Wahren Sept. 28, 2019, 12:07 p.m. UTC
This series adds minimal support for the new Raspberry Pi 4, so we are able
to login via debug UART.

Patch 1-2:   Fix some DT schema warnings
Patch 3-4:   Prepare DTS for the new SoC BMC2711
Patch 5-7:   Add Raspberry Pi 4 DTS support
Patch 8:     Update MAINTAINERS

Unfortunately the Raspberry Pi Foundation didn't released a
peripheral documentation for the new SoC yet. So we only have a preliminary
datasheet [1] and reduced schematics [2].

Known issues:
Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
i reverted the following patch to test this series:

79a98672 "dma-mapping: remove dma_max_pfn"
7559d612 "mmc: core: let the dma map ops handle bouncing"

Changes in V3:
- rebased series
- add Reviewed-by
- enable ARM_GIC for ARCH_BCM2835 on arm64 too
- configure i2c pull-up in bcm2711.dtsi
- move i2c2 to bcm2835-common.dtsi
- add missing compatibles to DT schema as suggested by Rob
- fix DT schema warnings in dtsi files
- replace brcm pintrl with generic pinctrl as suggested by Linus
- make dma_zone_size depend on CONFIG_ZONE_DMA as suggested by Matthias

Changes in V2:
- use separate board file for BCM2711
- enable ARM_GIC for ARCH_BCM2835
- add Acked-by and Reviewed-by
- fix arm-pmu and timer nodes for BCM2711 reported by Marc Zyngier
- enable HDMI at board level
- move HDMI and pixelvalve into bcm2835-common.dtsi as suggested by Eric Anholt
- fix DWC2 probing warning by setting USB role to peripheral
- fix order of node references in bcm2711.dtsi
- disable I2C clock stretching quirk for BCM2711
- mark PLLD_PER as critical clock
- make PLLH clock unavailable on BCM2711
- fix compile warning in clk-bcm2835 for arm64

Changes since RFC:
- change BCM2838 -> BCM2711 as discussed in RFC
- update MAINTAINERS accordingly
- drop "spi: bcm2835: enable shared interrupt support" from series
- squash all pinctrl-bcm2835 changes into one patch
- introduce SoC specific clock registration as suggested by Florian
- fix watchdog probing for Raspberry Pi 4
- convert brcm,bcm2835.txt to json-schema
- move VC4 node to bcm2835-common.dtsi
- fallback to legacy pull config for Raspberry Pi 4
- revert unintended change of mailbox in bcm283x.dtsi
- add reference for arm64

[1] - https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/rpi_DATA_2711_1p0_preliminary.pdf
[2] - https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_4b_4p0_reduced.pdf

Stefan Wahren (8):
  ARM: dts: bcm283x: Remove simple-bus from fixed clocks
  ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
  ARM: dts: bcm283x: Move BCM2835/6/7 specific to bcm2835-common.dtsi
  dt-bindings: arm: Convert BCM2835 board/soc bindings to json-schema
  dt-bindings: arm: bcm2835: Add Raspberry Pi 4 to DT schema
  ARM: bcm: Add support for BCM2711 SoC
  ARM: dts: Add minimal Raspberry Pi 4 support
  MAINTAINERS: Add BCM2711 to BCM2835 ARCH

 .../devicetree/bindings/arm/bcm/bcm2835.yaml       |  54 ++
 .../devicetree/bindings/arm/bcm/brcm,bcm2835.txt   |  67 --
 MAINTAINERS                                        |   3 +-
 arch/arm/boot/dts/Makefile                         |   1 +
 arch/arm/boot/dts/bcm2711-rpi-4-b.dts              | 121 +++
 arch/arm/boot/dts/bcm2711.dtsi                     | 838 +++++++++++++++++++++
 arch/arm/boot/dts/bcm2835-common.dtsi              | 194 +++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi                 |   4 -
 arch/arm/boot/dts/bcm2835.dtsi                     |   1 +
 arch/arm/boot/dts/bcm2836.dtsi                     |   1 +
 arch/arm/boot/dts/bcm2837.dtsi                     |   1 +
 arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi  |   7 +
 arch/arm/boot/dts/bcm283x.dtsi                     | 190 +----
 arch/arm/mach-bcm/Kconfig                          |   3 +-
 arch/arm/mach-bcm/Makefile                         |   3 +-
 arch/arm/mach-bcm/bcm2711.c                        |  24 +
 arch/arm64/Kconfig.platforms                       |   5 +-
 17 files changed, 1257 insertions(+), 260 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
 delete mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
 create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b.dts
 create mode 100644 arch/arm/boot/dts/bcm2711.dtsi
 create mode 100644 arch/arm/boot/dts/bcm2835-common.dtsi
 create mode 100644 arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi
 create mode 100644 arch/arm/mach-bcm/bcm2711.c

--
2.7.4

Comments

Florian Fainelli Sept. 28, 2019, 8:01 p.m. UTC | #1
On 9/28/2019 5:07 AM, Stefan Wahren wrote:
> This series adds minimal support for the new Raspberry Pi 4, so we are able
> to login via debug UART.
> 
> Patch 1-2:   Fix some DT schema warnings
> Patch 3-4:   Prepare DTS for the new SoC BMC2711
> Patch 5-7:   Add Raspberry Pi 4 DTS support
> Patch 8:     Update MAINTAINERS
> 
> Unfortunately the Raspberry Pi Foundation didn't released a
> peripheral documentation for the new SoC yet. So we only have a preliminary
> datasheet [1] and reduced schematics [2].

Overall this looks good to me, just a few comments in specific patches,
if you can re-spin those patches we should try to get that in 5.5?

> 
> Known issues:
> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
> i reverted the following patch to test this series:
> 
> 79a98672 "dma-mapping: remove dma_max_pfn"
> 7559d612 "mmc: core: let the dma map ops handle bouncing"
> 
> Changes in V3:
> - rebased series
> - add Reviewed-by
> - enable ARM_GIC for ARCH_BCM2835 on arm64 too
> - configure i2c pull-up in bcm2711.dtsi
> - move i2c2 to bcm2835-common.dtsi
> - add missing compatibles to DT schema as suggested by Rob
> - fix DT schema warnings in dtsi files
> - replace brcm pintrl with generic pinctrl as suggested by Linus
> - make dma_zone_size depend on CONFIG_ZONE_DMA as suggested by Matthias
> 
> Changes in V2:
> - use separate board file for BCM2711
> - enable ARM_GIC for ARCH_BCM2835
> - add Acked-by and Reviewed-by
> - fix arm-pmu and timer nodes for BCM2711 reported by Marc Zyngier
> - enable HDMI at board level
> - move HDMI and pixelvalve into bcm2835-common.dtsi as suggested by Eric Anholt
> - fix DWC2 probing warning by setting USB role to peripheral
> - fix order of node references in bcm2711.dtsi
> - disable I2C clock stretching quirk for BCM2711
> - mark PLLD_PER as critical clock
> - make PLLH clock unavailable on BCM2711
> - fix compile warning in clk-bcm2835 for arm64
> 
> Changes since RFC:
> - change BCM2838 -> BCM2711 as discussed in RFC
> - update MAINTAINERS accordingly
> - drop "spi: bcm2835: enable shared interrupt support" from series
> - squash all pinctrl-bcm2835 changes into one patch
> - introduce SoC specific clock registration as suggested by Florian
> - fix watchdog probing for Raspberry Pi 4
> - convert brcm,bcm2835.txt to json-schema
> - move VC4 node to bcm2835-common.dtsi
> - fallback to legacy pull config for Raspberry Pi 4
> - revert unintended change of mailbox in bcm283x.dtsi
> - add reference for arm64
> 
> [1] - https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711/rpi_DATA_2711_1p0_preliminary.pdf
> [2] - https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_4b_4p0_reduced.pdf
> 
> Stefan Wahren (8):
>   ARM: dts: bcm283x: Remove simple-bus from fixed clocks
>   ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
>   ARM: dts: bcm283x: Move BCM2835/6/7 specific to bcm2835-common.dtsi
>   dt-bindings: arm: Convert BCM2835 board/soc bindings to json-schema
>   dt-bindings: arm: bcm2835: Add Raspberry Pi 4 to DT schema
>   ARM: bcm: Add support for BCM2711 SoC
>   ARM: dts: Add minimal Raspberry Pi 4 support
>   MAINTAINERS: Add BCM2711 to BCM2835 ARCH
> 
>  .../devicetree/bindings/arm/bcm/bcm2835.yaml       |  54 ++
>  .../devicetree/bindings/arm/bcm/brcm,bcm2835.txt   |  67 --
>  MAINTAINERS                                        |   3 +-
>  arch/arm/boot/dts/Makefile                         |   1 +
>  arch/arm/boot/dts/bcm2711-rpi-4-b.dts              | 121 +++
>  arch/arm/boot/dts/bcm2711.dtsi                     | 838 +++++++++++++++++++++
>  arch/arm/boot/dts/bcm2835-common.dtsi              | 194 +++++
>  arch/arm/boot/dts/bcm2835-rpi.dtsi                 |   4 -
>  arch/arm/boot/dts/bcm2835.dtsi                     |   1 +
>  arch/arm/boot/dts/bcm2836.dtsi                     |   1 +
>  arch/arm/boot/dts/bcm2837.dtsi                     |   1 +
>  arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi  |   7 +
>  arch/arm/boot/dts/bcm283x.dtsi                     | 190 +----
>  arch/arm/mach-bcm/Kconfig                          |   3 +-
>  arch/arm/mach-bcm/Makefile                         |   3 +-
>  arch/arm/mach-bcm/bcm2711.c                        |  24 +
>  arch/arm64/Kconfig.platforms                       |   5 +-
>  17 files changed, 1257 insertions(+), 260 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/arm/bcm/bcm2835.yaml
>  delete mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt
>  create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b.dts
>  create mode 100644 arch/arm/boot/dts/bcm2711.dtsi
>  create mode 100644 arch/arm/boot/dts/bcm2835-common.dtsi
>  create mode 100644 arch/arm/boot/dts/bcm283x-rpi-usb-peripheral.dtsi
>  create mode 100644 arch/arm/mach-bcm/bcm2711.c
> 
> --
> 2.7.4
>
Nicolas Saenz Julienne Oct. 3, 2019, 5:09 p.m. UTC | #2
On Sat, 2019-09-28 at 14:07 +0200, Stefan Wahren wrote:
> This series adds minimal support for the new Raspberry Pi 4, so we are able
> to login via debug UART.
> 
> Patch 1-2:   Fix some DT schema warnings
> Patch 3-4:   Prepare DTS for the new SoC BMC2711
> Patch 5-7:   Add Raspberry Pi 4 DTS support
> Patch 8:     Update MAINTAINERS
> 
> Unfortunately the Raspberry Pi Foundation didn't released a
> peripheral documentation for the new SoC yet. So we only have a preliminary
> datasheet [1] and reduced schematics [2].
> 
> Known issues:
> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
> i reverted the following patch to test this series:
> 
> 79a98672 "dma-mapping: remove dma_max_pfn"
> 7559d612 "mmc: core: let the dma map ops handle bouncing"

[ adding Matthias and Guillaume who first saw this ]
[ also adding Adrian Hunter just in case ]

Hi,
we stubled upon a bug in RPi's sdhci-iproc while testing this series.

It only shows-up on slow SD cards, the class 4 ones. On each SD operation we
get the following warning:

[    2.093328] mmc1: Got data interrupt 0x00000002 even though no data operation was in progress.
[    2.102072] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
[    2.108603] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
[    2.115134] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000000
[    2.121664] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000033
[    2.128195] mmc1: sdhci: Present:   0x1fff0000 | Host ctl: 0x00000017
[    2.134725] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
[    2.141255] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00000107
[    2.147785] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[    2.154314] mmc1: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
[    2.160843] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[    2.167373] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
[    2.173902] mmc1: sdhci: Cmd:       0x00000c1a | Max curr: 0x00080008
[    2.180432] mmc1: sdhci: Resp[0]:   0x00000b00 | Resp[1]:  0x00edc87f
[    2.186961] mmc1: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x00400e00
[    2.193490] mmc1: sdhci: Host ctl2: 0x00000001
[    2.197992] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xec040208
[    2.204521] mmc1: sdhci: ============================================

Aside from the serial console noise the RPi still boots alright. But as it's
printing one of these per SD operation which is a lot...

I've been able to reproduce this both with arm and arn64 on multiple SD cards.
Just copying the contents of a class 4 card into a class 10 one fixes the
issue.

Any ideas?

Regards,
Nicolas
Stefan Wahren Oct. 3, 2019, 5:24 p.m. UTC | #3
Hi Nicolas,

Am 03.10.19 um 19:09 schrieb Nicolas Saenz Julienne:
> On Sat, 2019-09-28 at 14:07 +0200, Stefan Wahren wrote:
>> This series adds minimal support for the new Raspberry Pi 4, so we are able
>> to login via debug UART.
>>
>> Patch 1-2:   Fix some DT schema warnings
>> Patch 3-4:   Prepare DTS for the new SoC BMC2711
>> Patch 5-7:   Add Raspberry Pi 4 DTS support
>> Patch 8:     Update MAINTAINERS
>>
>> Unfortunately the Raspberry Pi Foundation didn't released a
>> peripheral documentation for the new SoC yet. So we only have a preliminary
>> datasheet [1] and reduced schematics [2].
>>
>> Known issues:
>> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
>> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
>> i reverted the following patch to test this series:
>>
>> 79a98672 "dma-mapping: remove dma_max_pfn"
>> 7559d612 "mmc: core: let the dma map ops handle bouncing"
> [ adding Matthias and Guillaume who first saw this ]
> [ also adding Adrian Hunter just in case ]
>
> Hi,
> we stubled upon a bug in RPi's sdhci-iproc while testing this series.
>
> It only shows-up on slow SD cards, the class 4 ones. On each SD operation we
> get the following warning:
>
> [    2.093328] mmc1: Got data interrupt 0x00000002 even though no data operation was in progress.
> [    2.102072] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
> [    2.108603] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
> [    2.115134] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000000
> [    2.121664] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000033
> [    2.128195] mmc1: sdhci: Present:   0x1fff0000 | Host ctl: 0x00000017
> [    2.134725] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
> [    2.141255] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00000107
> [    2.147785] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
> [    2.154314] mmc1: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
> [    2.160843] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
> [    2.167373] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
> [    2.173902] mmc1: sdhci: Cmd:       0x00000c1a | Max curr: 0x00080008
> [    2.180432] mmc1: sdhci: Resp[0]:   0x00000b00 | Resp[1]:  0x00edc87f
> [    2.186961] mmc1: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x00400e00
> [    2.193490] mmc1: sdhci: Host ctl2: 0x00000001
> [    2.197992] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xec040208
> [    2.204521] mmc1: sdhci: ============================================
>
> Aside from the serial console noise the RPi still boots alright. But as it's
> printing one of these per SD operation which is a lot...
>
> I've been able to reproduce this both with arm and arn64 on multiple SD cards.
> Just copying the contents of a class 4 card into a class 10 one fixes the
> issue.
>
> Any ideas?
i saw this once during testing. AFAIR there has been some changes to
sdhci in the downstream tree, maybe they was related to this issue.
>
> Regards,
> Nicolas
>
Matthias Brugger Oct. 3, 2019, 10:42 p.m. UTC | #4
On 03/10/2019 19:24, Stefan Wahren wrote:
> Hi Nicolas,
> 
> Am 03.10.19 um 19:09 schrieb Nicolas Saenz Julienne:
>> On Sat, 2019-09-28 at 14:07 +0200, Stefan Wahren wrote:
>>> This series adds minimal support for the new Raspberry Pi 4, so we are able
>>> to login via debug UART.
>>>
>>> Patch 1-2:   Fix some DT schema warnings
>>> Patch 3-4:   Prepare DTS for the new SoC BMC2711
>>> Patch 5-7:   Add Raspberry Pi 4 DTS support
>>> Patch 8:     Update MAINTAINERS
>>>
>>> Unfortunately the Raspberry Pi Foundation didn't released a
>>> peripheral documentation for the new SoC yet. So we only have a preliminary
>>> datasheet [1] and reduced schematics [2].
>>>
>>> Known issues:
>>> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
>>> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
>>> i reverted the following patch to test this series:
>>>
>>> 79a98672 "dma-mapping: remove dma_max_pfn"
>>> 7559d612 "mmc: core: let the dma map ops handle bouncing"
>> [ adding Matthias and Guillaume who first saw this ]
>> [ also adding Adrian Hunter just in case ]
>>
>> Hi,
>> we stubled upon a bug in RPi's sdhci-iproc while testing this series.
>>
>> It only shows-up on slow SD cards, the class 4 ones. On each SD operation we
>> get the following warning:
>>
>> [    2.093328] mmc1: Got data interrupt 0x00000002 even though no data operation was in progress.
>> [    2.102072] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
>> [    2.108603] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
>> [    2.115134] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000000
>> [    2.121664] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000033
>> [    2.128195] mmc1: sdhci: Present:   0x1fff0000 | Host ctl: 0x00000017
>> [    2.134725] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
>> [    2.141255] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00000107
>> [    2.147785] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
>> [    2.154314] mmc1: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
>> [    2.160843] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
>> [    2.167373] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
>> [    2.173902] mmc1: sdhci: Cmd:       0x00000c1a | Max curr: 0x00080008
>> [    2.180432] mmc1: sdhci: Resp[0]:   0x00000b00 | Resp[1]:  0x00edc87f
>> [    2.186961] mmc1: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x00400e00
>> [    2.193490] mmc1: sdhci: Host ctl2: 0x00000001
>> [    2.197992] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xec040208
>> [    2.204521] mmc1: sdhci: ============================================
>>
>> Aside from the serial console noise the RPi still boots alright. But as it's
>> printing one of these per SD operation which is a lot...
>>
>> I've been able to reproduce this both with arm and arn64 on multiple SD cards.
>> Just copying the contents of a class 4 card into a class 10 one fixes the
>> issue.
>>
>> Any ideas?
> i saw this once during testing. AFAIR there has been some changes to
> sdhci in the downstream tree, maybe they was related to this issue.

I did a diff against drivers/mmc/host/sdhci-iproc.c of v5.4-rc1 and haven't
found any significant changes:
- compatible in the upstream driver is only bcm2711-emmc2 and not bcm2838-sdhci,
but DTS uses the former one.
- Upstream driver support probing via ACPI.
- pltfm_host->clk gets only set if we probe via DTS
- get_max_clock() is set to sdhci_iproc_get_max_clock() but this checks if
pltfm_host->clk is set and in that case invokes sdhci_pltfm_clk_get_max_clock()
(same function as the downstream driver).

So AFAIKS nothing relevant here.

Regards,
Matthias
Stefan Wahren Oct. 4, 2019, 1:03 a.m. UTC | #5
Hi,

Am 04.10.19 um 00:42 schrieb Matthias Brugger:
>
> On 03/10/2019 19:24, Stefan Wahren wrote:
>> Hi Nicolas,
>>
>> Am 03.10.19 um 19:09 schrieb Nicolas Saenz Julienne:
>>> On Sat, 2019-09-28 at 14:07 +0200, Stefan Wahren wrote:
>>>> This series adds minimal support for the new Raspberry Pi 4, so we are able
>>>> to login via debug UART.
>>>>
>>>> Patch 1-2:   Fix some DT schema warnings
>>>> Patch 3-4:   Prepare DTS for the new SoC BMC2711
>>>> Patch 5-7:   Add Raspberry Pi 4 DTS support
>>>> Patch 8:     Update MAINTAINERS
>>>>
>>>> Unfortunately the Raspberry Pi Foundation didn't released a
>>>> peripheral documentation for the new SoC yet. So we only have a preliminary
>>>> datasheet [1] and reduced schematics [2].
>>>>
>>>> Known issues:
>>>> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
>>>> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
>>>> i reverted the following patch to test this series:
>>>>
>>>> 79a98672 "dma-mapping: remove dma_max_pfn"
>>>> 7559d612 "mmc: core: let the dma map ops handle bouncing"
>>> [ adding Matthias and Guillaume who first saw this ]
>>> [ also adding Adrian Hunter just in case ]
>>>
>>> Hi,
>>> we stubled upon a bug in RPi's sdhci-iproc while testing this series.
>>>
>>> It only shows-up on slow SD cards, the class 4 ones. On each SD operation we
>>> get the following warning:
>>>
>>> [    2.093328] mmc1: Got data interrupt 0x00000002 even though no data operation was in progress.
>>> [    2.102072] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
>>> [    2.108603] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
>>> [    2.115134] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000000
>>> [    2.121664] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000033
>>> [    2.128195] mmc1: sdhci: Present:   0x1fff0000 | Host ctl: 0x00000017
>>> [    2.134725] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
>>> [    2.141255] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00000107
>>> [    2.147785] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
>>> [    2.154314] mmc1: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
>>> [    2.160843] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
>>> [    2.167373] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
>>> [    2.173902] mmc1: sdhci: Cmd:       0x00000c1a | Max curr: 0x00080008
>>> [    2.180432] mmc1: sdhci: Resp[0]:   0x00000b00 | Resp[1]:  0x00edc87f
>>> [    2.186961] mmc1: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x00400e00
>>> [    2.193490] mmc1: sdhci: Host ctl2: 0x00000001
>>> [    2.197992] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xec040208
>>> [    2.204521] mmc1: sdhci: ============================================
>>>
>>> Aside from the serial console noise the RPi still boots alright. But as it's
>>> printing one of these per SD operation which is a lot...
>>>
>>> I've been able to reproduce this both with arm and arn64 on multiple SD cards.
>>> Just copying the contents of a class 4 card into a class 10 one fixes the
>>> issue.
>>>
>>> Any ideas?
>> i saw this once during testing. AFAIR there has been some changes to
>> sdhci in the downstream tree, maybe they was related to this issue.
> I did a diff against drivers/mmc/host/sdhci-iproc.c of v5.4-rc1 and haven't
> found any significant changes:
> - compatible in the upstream driver is only bcm2711-emmc2 and not bcm2838-sdhci,
> but DTS uses the former one.
> - Upstream driver support probing via ACPI.
> - pltfm_host->clk gets only set if we probe via DTS
> - get_max_clock() is set to sdhci_iproc_get_max_clock() but this checks if
> pltfm_host->clk is set and in that case invokes sdhci_pltfm_clk_get_max_clock()
> (same function as the downstream driver).
>
> So AFAIKS nothing relevant here.

as i wrote about sdhci, i literally meant this driver [1]. But this
looks like a workaround only.

[1] -
https://github.com/raspberrypi/linux/commit/88b35d4338e238519bf4e6f73837b4ce44bfe4d6

>
> Regards,
> Matthias
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Matthias Brugger Oct. 4, 2019, 5:11 a.m. UTC | #6
Hi Stefan,

On 04/10/2019 03:03, Stefan Wahren wrote:
> Hi,
> 
> Am 04.10.19 um 00:42 schrieb Matthias Brugger:
>>
>> On 03/10/2019 19:24, Stefan Wahren wrote:
>>> Hi Nicolas,
>>>
>>> Am 03.10.19 um 19:09 schrieb Nicolas Saenz Julienne:
>>>> On Sat, 2019-09-28 at 14:07 +0200, Stefan Wahren wrote:
>>>>> This series adds minimal support for the new Raspberry Pi 4, so we are able
>>>>> to login via debug UART.
>>>>>
>>>>> Patch 1-2:   Fix some DT schema warnings
>>>>> Patch 3-4:   Prepare DTS for the new SoC BMC2711
>>>>> Patch 5-7:   Add Raspberry Pi 4 DTS support
>>>>> Patch 8:     Update MAINTAINERS
>>>>>
>>>>> Unfortunately the Raspberry Pi Foundation didn't released a
>>>>> peripheral documentation for the new SoC yet. So we only have a preliminary
>>>>> datasheet [1] and reduced schematics [2].
>>>>>
>>>>> Known issues:
>>>>> Since Linux 5.3-rc1 DMA doesn't work properly on that platform.
>>>>> Nicolas Saenz Julienne investigates on that issue. As a temporary workaround
>>>>> i reverted the following patch to test this series:
>>>>>
>>>>> 79a98672 "dma-mapping: remove dma_max_pfn"
>>>>> 7559d612 "mmc: core: let the dma map ops handle bouncing"
>>>> [ adding Matthias and Guillaume who first saw this ]
>>>> [ also adding Adrian Hunter just in case ]
>>>>
>>>> Hi,
>>>> we stubled upon a bug in RPi's sdhci-iproc while testing this series.
>>>>
>>>> It only shows-up on slow SD cards, the class 4 ones. On each SD operation we
>>>> get the following warning:
>>>>
>>>> [    2.093328] mmc1: Got data interrupt 0x00000002 even though no data operation was in progress.
>>>> [    2.102072] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
>>>> [    2.108603] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
>>>> [    2.115134] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000000
>>>> [    2.121664] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000033
>>>> [    2.128195] mmc1: sdhci: Present:   0x1fff0000 | Host ctl: 0x00000017
>>>> [    2.134725] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
>>>> [    2.141255] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00000107
>>>> [    2.147785] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
>>>> [    2.154314] mmc1: sdhci: Int enab:  0x03ff100b | Sig enab: 0x03ff100b
>>>> [    2.160843] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
>>>> [    2.167373] mmc1: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
>>>> [    2.173902] mmc1: sdhci: Cmd:       0x00000c1a | Max curr: 0x00080008
>>>> [    2.180432] mmc1: sdhci: Resp[0]:   0x00000b00 | Resp[1]:  0x00edc87f
>>>> [    2.186961] mmc1: sdhci: Resp[2]:   0x325b5900 | Resp[3]:  0x00400e00
>>>> [    2.193490] mmc1: sdhci: Host ctl2: 0x00000001
>>>> [    2.197992] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0xec040208
>>>> [    2.204521] mmc1: sdhci: ============================================
>>>>
>>>> Aside from the serial console noise the RPi still boots alright. But as it's
>>>> printing one of these per SD operation which is a lot...
>>>>
>>>> I've been able to reproduce this both with arm and arn64 on multiple SD cards.
>>>> Just copying the contents of a class 4 card into a class 10 one fixes the
>>>> issue.
>>>>
>>>> Any ideas?
>>> i saw this once during testing. AFAIR there has been some changes to
>>> sdhci in the downstream tree, maybe they was related to this issue.
>> I did a diff against drivers/mmc/host/sdhci-iproc.c of v5.4-rc1 and haven't
>> found any significant changes:
>> - compatible in the upstream driver is only bcm2711-emmc2 and not bcm2838-sdhci,
>> but DTS uses the former one.
>> - Upstream driver support probing via ACPI.
>> - pltfm_host->clk gets only set if we probe via DTS
>> - get_max_clock() is set to sdhci_iproc_get_max_clock() but this checks if
>> pltfm_host->clk is set and in that case invokes sdhci_pltfm_clk_get_max_clock()
>> (same function as the downstream driver).
>>
>> So AFAIKS nothing relevant here.
> 
> as i wrote about sdhci, i literally meant this driver [1]. But this
> looks like a workaround only.
> 
> [1] -
> https://github.com/raspberrypi/linux/commit/88b35d4338e238519bf4e6f73837b4ce44bfe4d6
> 

Yes I realized yesterday night already lying in bed, that I only inspected half
of the code. I just found this as well, which seems to fit exactly the behaviour
we are seeing. I'll have a look today.

Regards,
Matthias

>>
>> Regards,
>> Matthias
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>