When taking a look at the manual of the BCM2835 (which seems to be the correct one for the BCM2711), we can see, for example, that the base address of the SPI device is 0x7E204000 (page 152). Assume we want to communicate with this device, then we should not attempt to ioremap this address, as is explained on page 6: the kernel uses a different, virtual, address. From the text

Peripherals (at physical address 0x20000000 on) are mapped into the kernel virtual address space starting at address 0xF2000000. Thus a peripheral advertised here at bus address 0x7Ennnnnn is available in the ARM kenel at virtual address 0xF2nnnnnn.

We seem to be able to derive that the address we should ioremap is 0xF22040000. But its not.

sudo cat /proc/iomem
00000000-3bffffff : System RAM
  00008000-011fffff : Kernel code
  01400000-015ae3cf : Kernel data
40000000-fbffffff : System RAM
fd500000-fd50930f : pcie@7d500000
fd580000-fd58ffff : genet@7d580000
  fd580e14-fd580e1c : unimac-mdio.-19
fd5d2200-fd5d222b : thermal@7d5d2200
fe007000-fe007aff : dma@7e007000
fe007b00-fe007eff : dma@7e007b00
fe00a000-fe00a023 : watchdog@7e100000
fe00b840-fe00b87b : mailbox@7e00b840
fe00b880-fe00b8bf : mailbox@7e00b880
fe100000-fe100113 : watchdog@7e100000
fe101000-fe102fff : cprman@7e101000
fe104000-fe10400f : rng@7e104000
fe200000-fe2000b3 : gpio@7e200000
fe201000-fe2011ff : serial@7e201000
  fe201000-fe2011ff : serial@7e201000
fe204000-fe2041ff : spi@7e204000
fe215000-fe215007 : aux@7e215000
fe215040-fe21507f : serial@7e215040
fe300000-fe3000ff : mmcnr@7e300000
fe340000-fe3400ff : emmc2@7e340000
fec11000-fec1101f : watchdog@7e100000
600000000-603ffffff : pcie@7d500000
  600000000-6000fffff : PCI Bus 0000:01
    600000000-600000fff : 0000:01:00.0
      600000000-600000fff : xhci-hcd

It is actually 0xfe204000. How could I have known this, just looking at the documentation?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.