Skip to content

dcache support for Raspberry Pi 1

Alexander Stein u-boot 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 0 repliesNew
  2. v37 patches 0 repliesSuperseded
  3. v26 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v10 of 5 patches0 repliesSuperseded

Changes in v4 from the cover letter

* Added Acked-By and Tested-By of Stephen Warren
* Set CONFIG_SYS_CACHELINE_SIZE for rpi and rpi2 appropriately
* Updated USB buffer comment about required alignment
* Used git format-patch -M to generate patches

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7arm1136: Remove dead codearch/arm/cpu/arm1136/cpu.c+0 -101 reply
2/7arm1136/arm1176: Merge cache handling codearch/arm/cpu/arm11/Makefile arch/arm/cpu/arm11/cpu.c arch/arm/cpu/arm1136/Makefile +2 more+11 -531 reply
3/7ARM: bcm283x: Define CONFIG_SYS_CACHELINE_SIZEinclude/configs/rpi.h include/configs/rpi_2.h+3 -01 reply
4/7ARM: bcm283x: Allocate all mailbox buffers cacheline alignedboard/raspberrypi/rpi/rpi.c drivers/video/bcm2835.c+7 -71 reply
5/7arm/mach-bcm283x/mbox: Flush and invalidate dcache when using fw mailboxarch/arm/mach-bcm283x/include/mach/mbox.h arch/arm/mach-bcm283x/mbox.c+12 -01 reply
6/7dwc2: Add dcache supportdrivers/usb/host/dwc2.c+14 -41 reply
7/7arm/rpi: Enable dcacheinclude/configs/rpi-common.h include/configs/rpi_2.h+1 -11 reply

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchStephen Warren
1/7A-b T-b
2/7A-b T-b
3/7A-b T-b
4/7A-b T-b
5/7A-b T-b
6/7A-b
7/7A-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [U-Boot] [PATCH v4 0/7] dcache support for Raspberry Pi 1

This patchset enables dcache support for Raspberry Pi 1.
First the cache support code for arm1136 and 1176 was merged. CONFIG_SYS_CACHELINE_SIZE is defined as 32 bytes which is used as alignment for mailbox buffer allocations.
Then rpi mailbox code has now dcache flush for writing the mailbox request and a dcache invalidation for receiving the mailbox answer.
Finally the CONFIG_SYS_DCACHE_OFF switch got removed from rpi1 config. It is still set for rpi2 config.

dcache supprt increases the MMC read performance on RPI 1 from 5,4 MiB/s to 12.3 MiB/s. TFTP download over USB Ethernet increases from 2,3 MiB/s to 2,6 to 3,3 MiB/s (seems to vary a lot).

This was tested by the following commands:

Quoted 1 line

fatload mmc 0:1 ${kernel_addr_r} zImage

and

Quoted 1 line

tftp u-boot.bin

Changes in v4:
* Added Acked-By and Tested-By of Stephen Warren
* Set CONFIG_SYS_CACHELINE_SIZE for rpi and rpi2 appropriately
* Updated USB buffer comment about required alignment
* Used git format-patch -M to generate patches

Changes in v3:
* dwc2 dcache support
* Use ALLOC_CACHE_ALIGN_BUFFER for mailbox buffer allocation
* Use ARCH_DMA_MINALIGN for size to roundup

Changes in v2:
* Merge arm1136/1176 cache code
* Use cacheline size as mailbox buffer alignment
* Flush/invalidate mailbox buffer up to cacheline size

Alexander Stein (7):
arm1136: Remove dead code
arm1136/arm1176: Merge cache handling code
ARM: bcm283x: Define CONFIG_SYS_CACHELINE_SIZE
ARM: bcm283x: Allocate all mailbox buffers cacheline aligned arm/mach-bcm283x/mbox: Flush and invalidate dcache when using fw
mailbox
dwc2: Add dcache support
arm/rpi: Enable dcache

 arch/arm/cpu/arm11/Makefile               |  8 +++++
 arch/arm/cpu/{arm1136 => arm11}/cpu.c     | 10 ------
 arch/arm/cpu/arm1136/Makefile             |  1 -
 arch/arm/cpu/arm1176/Makefile             |  4 ++-
 arch/arm/cpu/arm1176/cpu.c                | 51 -------------------------------
 arch/arm/mach-bcm283x/include/mach/mbox.h |  3 ++
 arch/arm/mach-bcm283x/mbox.c              |  9 ++++++
 board/raspberrypi/rpi/rpi.c               | 10 +++---
 drivers/usb/host/dwc2.c                   | 18 ++++++++---
 drivers/video/bcm2835.c                   |  4 +--
 include/configs/rpi-common.h              |  1 -
 include/configs/rpi.h                     |  2 ++
 include/configs/rpi_2.h                   |  2 ++
 13 files changed, 48 insertions(+), 75 deletions(-)
 create mode 100644 arch/arm/cpu/arm11/Makefile
 rename arch/arm/cpu/{arm1136 => arm11}/cpu.c (94%)
 delete mode 100644 arch/arm/cpu/arm1176/cpu.c
Signature · 1 line
2.4.6