All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/12] Raspberry Pi 400/Compute Module 4 support
@ 2020-12-15 17:23 Nicolas Saenz Julienne
  2020-12-15 17:23 ` [PATCH v3 01/12] rpi: Add identifier for the new RPi400 Nicolas Saenz Julienne
                   ` (11 more replies)
  0 siblings, 12 replies; 31+ messages in thread
From: Nicolas Saenz Julienne @ 2020-12-15 17:23 UTC (permalink / raw)
  To: u-boot

This series could be split into at least two or even three parts, but I
kept it as is for now as it contains all the changes needed in order to
have u-boot working on the new Raspberry Pi 400 and Raspberry Pi Compute
Module 4.

There are core changes, specifically with regard to cpu to bus address
space translations. So far we had relied on hard-coded values but RPi
needs per device translations as it has at least three distinct bus
address spaces with different offsets. So it's a good opportunity to
implement bus translations the right way by parsing DT's dma-ranges.

Here's a more concrete example of what we're dealing with:

 - On a RPi4, SoC version BCM2711C0 with 8GB of memory

	[0x0 0x200000000]   [0x200000000 0x400000000]  [0xc0000000 0x100000000]  [0x00000000 0x100000000]
	 phys/cpu address       PCIe bus address           Legacy peripheral           emmc2 address
	     space                   space                   address space                space

 - On a RPi4, SoC version BCM2711C0 with 4GB of memory

	[0x0 0x100000000]   [0x100000000 0x200000000]  [0xc0000000 0x100000000]  [0x00000000 0x100000000]
	  phys/cpu address      PCIe bus address          Legacy peripheral            emmc2 address
	    space                  space                    address space                space

- On a RPi4, SoC version BCM2711B0 with 8GB of memory (bus can only access the
  lower 3GB of memory because of a SoC routing bug)

	[0x0 0x200000000]   [0x00000000 0xC0000000]   [0xc0000000 0x100000000]
	 phys/cpu address      PCIe bus address          Legacy peripheral
	    space                  space                   address space

---

Changes since v2:
 - Test builds not broken with buildman
 - Add tests to all DM changes
 - Make code conditional with config option
 - Correct OF refcount
 - Add config changes
 - Address small changes as per reviews

Changes since v1:
 - Fix some issues in 'dm: Introduce xxx_get_dma_range()'
 - Fix some typos in commit messages
 - Change DTB file name for RPi400
 - Address Matthias' comments

Nicolas Saenz Julienne (12):
  rpi: Add identifier for the new RPi400
  rpi: Add identifier for the new CM4
  pci: pcie-brcmstb: Fix inbound window configurations
  dm: Introduce xxx_get_dma_range()
  dm: test: Add test case for dev_get_dma_ranges()
  dm: Introduce DMA constraints into the core device model
  dm: test: Add test case for dev->dma_offset
  dm: Introduce dev_phys_to_bus()/dev_bus_to_phys()
  dm: test: Add test case for dev_phys_to_bus()/dev_bus_to_phys()
  xhci: translate virtual addresses into the bus's address space
  mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys()
  configs: rpi4: Enable DM_DMA across all RPi4 configurations

 arch/sandbox/dts/test.dts          | 21 ++++++++
 board/raspberrypi/rpi/rpi.c        | 10 ++++
 common/fdt_support.c               | 73 ++++++++++++++++++++++++++++
 configs/rpi_4_32b_defconfig        |  1 +
 configs/rpi_4_defconfig            |  1 +
 configs/rpi_arm64_defconfig        |  1 +
 configs/sandbox64_defconfig        |  1 +
 configs/sandbox_defconfig          |  1 +
 configs/sandbox_flattree_defconfig |  1 +
 configs/sandbox_spl_defconfig      |  1 +
 drivers/core/Kconfig               | 10 ++++
 drivers/core/device.c              | 35 ++++++++++++++
 drivers/core/of_addr.c             | 78 ++++++++++++++++++++++++++++++
 drivers/core/ofnode.c              |  9 ++++
 drivers/core/read.c                |  6 +++
 drivers/mmc/sdhci.c                |  7 +--
 drivers/pci/pcie_brcmstb.c         | 12 ++---
 drivers/usb/host/xhci-mem.c        | 45 +++++++++--------
 drivers/usb/host/xhci-ring.c       | 11 +++--
 drivers/usb/host/xhci.c            |  4 +-
 include/dm/device.h                |  3 ++
 include/dm/of_addr.h               | 17 +++++++
 include/dm/ofnode.h                | 16 ++++++
 include/dm/read.h                  | 21 ++++++++
 include/fdt_support.h              | 14 ++++++
 include/mmc.h                      | 10 ++++
 include/phys2bus.h                 | 16 ++++++
 include/usb/xhci.h                 | 22 ++++++++-
 test/dm/Makefile                   |  2 +
 test/dm/core.c                     | 30 ++++++++++++
 test/dm/phys2bus.c                 | 36 ++++++++++++++
 test/dm/read.c                     | 49 +++++++++++++++++++
 32 files changed, 526 insertions(+), 38 deletions(-)
 create mode 100644 test/dm/phys2bus.c
 create mode 100644 test/dm/read.c

-- 
2.29.2

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2020-12-21 20:23 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 17:23 [PATCH v3 00/12] Raspberry Pi 400/Compute Module 4 support Nicolas Saenz Julienne
2020-12-15 17:23 ` [PATCH v3 01/12] rpi: Add identifier for the new RPi400 Nicolas Saenz Julienne
2020-12-15 17:23 ` [PATCH v3 02/12] rpi: Add identifier for the new CM4 Nicolas Saenz Julienne
2020-12-15 17:23 ` [PATCH v3 03/12] pci: pcie-brcmstb: Fix inbound window configurations Nicolas Saenz Julienne
2020-12-15 17:23 ` [PATCH v3 04/12] dm: Introduce xxx_get_dma_range() Nicolas Saenz Julienne
2020-12-19  2:28   ` Simon Glass
2020-12-21 13:03     ` Nicolas Saenz Julienne
2020-12-21 16:47       ` Simon Glass
2020-12-15 17:23 ` [PATCH v3 05/12] dm: test: Add test case for dev_get_dma_ranges() Nicolas Saenz Julienne
2020-12-19  2:28   ` Simon Glass
2020-12-15 17:23 ` [PATCH v3 06/12] dm: Introduce DMA constraints into the core device model Nicolas Saenz Julienne
2020-12-19  2:28   ` Simon Glass
2020-12-15 17:23 ` [PATCH v3 07/12] dm: test: Add test case for dev->dma_offset Nicolas Saenz Julienne
2020-12-19  2:28   ` Simon Glass
2020-12-21 13:36     ` Nicolas Saenz Julienne
2020-12-15 17:23 ` [PATCH v3 08/12] dm: Introduce dev_phys_to_bus()/dev_bus_to_phys() Nicolas Saenz Julienne
2020-12-15 17:23 ` [PATCH v3 09/12] dm: test: Add test case for dev_phys_to_bus()/dev_bus_to_phys() Nicolas Saenz Julienne
2020-12-19  2:28   ` Simon Glass
2020-12-21 13:47     ` Nicolas Saenz Julienne
2020-12-21 16:47       ` Simon Glass
2020-12-15 17:23 ` [PATCH v3 10/12] xhci: translate virtual addresses into the bus's address space Nicolas Saenz Julienne
2020-12-19  2:28   ` Simon Glass
2020-12-21 13:51     ` Nicolas Saenz Julienne
2020-12-15 17:23 ` [PATCH v3 11/12] mmc: Introduce mmc_phys_to_bus()/mmc_bus_to_phys() Nicolas Saenz Julienne
2020-12-19  2:28   ` Simon Glass
2020-12-21 14:23     ` Nicolas Saenz Julienne
2020-12-21 16:47       ` Simon Glass
2020-12-21 19:52         ` Nicolas Saenz Julienne
2020-12-21 20:23           ` Simon Glass
2020-12-15 17:23 ` [PATCH v3 12/12] configs: rpi4: Enable DM_DMA across all RPi4 configurations Nicolas Saenz Julienne
2020-12-19  2:28   ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.