mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/6] memory: fuse overlapping memory banks
@ 2021-05-31  7:12 Ahmad Fatoum
  2021-05-31  7:12 ` [PATCH 1/6] common: memory: allocate all memory devices at once Ahmad Fatoum
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Ahmad Fatoum @ 2021-05-31  7:12 UTC (permalink / raw)
  To: barebox; +Cc: mol

The request region code makes sense to ensure drivers don't try to claim
(I/O) memory region claimed by another driver or by the memory
allocator. It doesn't make as much sense for registering available
memory banks, because there is often overlap:

 - device tree often defines the (minimally) available /memory across
   variants
 - subarchitectures like i.MX, STM32MP, OMAP or SAMA5 query the main
   RAM size from controller registers

So far, overlap went mostly unnoticed, because the RAM controller
drivers didn't check for errors. However, if barebox is already running
from RAM outside that described by the device tree, there will be errors
and /delete-node/ annotations that need to be added into device trees.

Upstream device tree can be extended later on with a /memory node, which
in turn will break barebox. This series fixes all of that. Overlapping
memory banks are combined into one. Errors are propagated everywhere.
/delete-node/ memory@X shouldn't be needed for new boards.

Ahmad Fatoum (6):
  common: memory: allocate all memory devices at once
  memory: fuse overlapping memory banks
  of: propagate errors inside barebox_register_{of,fdt} into initcalls
  of: warn about of_add_memory_bank errors
  ARM: <asm/memory.h>: propagate error codes from arm_add_mem_device()
  ARM: report probe error at arm_add_mem_device() callsites on failure

 arch/arm/boards/qemu-virt/board.c |  3 +-
 arch/arm/cpu/dtb.c                |  4 +-
 arch/arm/include/asm/memory.h     |  6 +--
 arch/arm/mach-at91/ddramc.c       |  4 +-
 arch/arm/mach-imx/esdctl.c        | 56 +++++++++++++--------------
 arch/arm/mach-omap/am33xx_scrm.c  |  4 +-
 arch/arm/mach-stm32mp/ddrctrl.c   |  4 +-
 arch/kvx/lib/dtb.c                |  4 +-
 arch/mips/boot/dtb.c              | 13 ++++---
 arch/openrisc/lib/dtb.c           |  4 +-
 arch/riscv/lib/dtb.c              |  5 ++-
 arch/sandbox/board/dtb.c          |  4 +-
 common/memory.c                   | 64 +++++++++++++++++++++++++++----
 common/resource.c                 | 22 +++++++++++
 drivers/of/base.c                 | 40 ++++++++++++-------
 drivers/of/mem_generic.c          |  5 ++-
 include/linux/ioport.h            | 20 ++++++++++
 include/memory.h                  |  1 -
 include/of.h                      |  6 +--
 19 files changed, 181 insertions(+), 88 deletions(-)

-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2021-06-02  6:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31  7:12 [PATCH 0/6] memory: fuse overlapping memory banks Ahmad Fatoum
2021-05-31  7:12 ` [PATCH 1/6] common: memory: allocate all memory devices at once Ahmad Fatoum
2021-05-31  7:12 ` [PATCH 2/6] memory: fuse overlapping memory banks Ahmad Fatoum
2021-05-31  7:12 ` [PATCH 3/6] of: propagate errors inside barebox_register_{of, fdt} into initcalls Ahmad Fatoum
2021-05-31  7:12 ` [PATCH 4/6] of: warn about of_add_memory_bank errors Ahmad Fatoum
2021-05-31  7:12 ` [PATCH 5/6] ARM: <asm/memory.h>: propagate error codes from arm_add_mem_device() Ahmad Fatoum
2021-05-31  7:12 ` [PATCH 6/6] ARM: report probe error at arm_add_mem_device() callsites on failure Ahmad Fatoum
2021-06-02  6:38 ` [PATCH 0/6] memory: fuse overlapping memory banks Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox