1

I read the answer the similar question at How ram addresses are differentiated from memory map address but I am still confused.

Assuming a System attaching 4GB RAM with some memory mapped peripherals attached, then the only RAM space I can use is 4GB minus amount of memory mapped space?

For example, a GPIO is mapped at address 0x500 then there is no way to use RAM address 0x500? I believe it is possible(hopefully?) if the MMU exists and is enabled, but otherwise I have no idea.

Jisung Kim
  • 133
  • 1
  • 9
  • You're correct. It's even an issue for 32-bit systems with MMU, since address space is 32-bit, so only 4GB of memory can be addressed at one time. – domen Sep 14 '18 at 09:35
  • Often the MMU can [address larger physical amounts](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka16339.html) using LPAE, so you can only have 4GB mapped for a single process, but larger amounts for the whole system. Also, the referenced Q/A is a x86 centric answer. – artless noise Sep 14 '18 at 14:50
  • 1
    You can certainly address more space than you have address bits to map, very common. But it is part of the overall system design, you need to specify the chip, board and as needed version in order to give a real answer to this question. – old_timer Sep 14 '18 at 18:13
  • any usable design you will have one item at one address, yes that is true. there are busses and other places where you toss out a request and the first one to answer wins, but that is part of that design. When you are talking about address decoders they are layered, the nearest layer responsible for that address will own that transaction it wont then also pass the transaction on to the next layer. – old_timer Sep 14 '18 at 18:15

1 Answers1

2

You tagged arm and other processors are not necessarily different.

Normally some percentage of the address space is carved out for memory mapped I/O, gpio, uart, nvic, etc. With arm you will have some internal address space that doesnt make it to the axi/amba bus(ses) for the chip vendor.

So if you wanted to use an arm with a 32 bit address bus then hooking up 4GB flat is a waste of time. You can certainly hook up more (I have an arm11 with 24GB)) but it is not linear you have to have an address scheme like PCIe hsa where you point a window of the address space you can get to into an address space beyond that (again think PCIe but reality not the illusion that they try to present in x86).

But you are overcomplicating this. Particularly with an ARM where it is all documented. You have a core you are a chip vendor you buy this core it has an address bus (see the amba/axi documentation) you hook up to that address bus if it is a cortex-m they have some guidelines as to where to put ram and rom and keep out of the way here. For the full sized arms its mostly fair game, you provide the base address to the core where certain peripherals are mapped (think nvic, timers, etc. Instead of like the cortex-m where the systick timer base address is hardcoded in the design, you feed the core the base address in your address space where the internal items life PERIPHBASE or some such signal/bus name). Beyond that it is the whim of the chip vendor as to how to divide up that address space, the arm can boot typically in one of two addresses but of course you can have as many address layers as you want, and for each layer have a conversion/translation to that address space. This includes peripherals, memory (ram/rom/flash) usb, pcie, etc address spaces, etc.

So it could be like a pc where the pcie window takes away the one or two gig of ram at that same space and you simply lose that memory, but in that case you are thinking about it a bit wrong because those are different address spaces/layers. Some pcs once 64 bit dominated over 32 bit and even though 32 bit isnt completely dead but we can now have bioses that default to 64 bit and allowing the pcie window to be above the memory instead of cutting a hole in it.

The nice thing about buying a core like arm or mips that you can to some extent if not completely design the address space however you like, dont have to conform to anything, etc.

There is no one answer to your question you need to specify the specific chip and board (and version of that system) to have this conversation, and if it were a real, available product, they wouldnt have bothered unless there was a windowed address scheme. folks like to think the segment offset thing was bad but it still exists in most usable systems we just cant use those terms any more, and we dont always have segment registers but we still have the address space carved out and windowed. MMUs make this much easier to segment the address spaces but make them look linear.

old_timer
  • 69,149
  • 8
  • 89
  • 168