public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 00/27] Clean up address mapping functions & CONFIG_SYS_SDRAM_BASE
@ 2016-10-01 14:19 Paul Burton
  2016-10-01 14:19 ` [U-Boot] [PATCH 01/27] Provide a generic io.h & address mapping functions Paul Burton
                   ` (27 more replies)
  0 siblings, 28 replies; 46+ messages in thread
From: Paul Burton @ 2016-10-01 14:19 UTC (permalink / raw)
  To: u-boot

README states that CONFIG_SYS_SDRAM_BASE should be the physical address
of the base of SDRAM memory. This is expected by some code such as the
PCI layer, which uses CONFIG_SYS_SDRAM_BASE to set up a region for
system memory. Other code such as the image loading code used by bootm
or the generic board_f.c expect CONFIG_SYS_SDRAM_BASE to be directly
accessible by the CPU, which necessitates that it be a virtual address.

Where virtual & physical addresses aren't identity mapped, as is the
case for MIPS, we cannot possibly satisfy both. Until now MIPS has used
a virtual CONFIG_SYS_SDRAM_BASE. This series fixes up the mess by doing
a few things:

  - Ensuring that we provide virt_to_phys() on all architectures.

  - Fixing code that expects to use CONFIG_SYS_SDRAM_BASE as a virtual
    address to instead convert it to a physical address using
    virt_to_phys().

  - Converts MIPS code & all MIPS boards to provide a physical
    CONFIG_SYS_SDRAM_BASE, which typically is zero.


Paul Burton (27):
  Provide a generic io.h & address mapping functions
  arc: Use asm-generic/io.h
  arm: Use asm-generic/io.h
  blackfin: Use asm-generic/io.h
  m68k: Use asm-generic/io.h
  microblaze: Use asm-generic/io.h
  nds32: Use asm-generic/io.h
  openrisc: Use asm-generic/io.h
  sh: Use asm-generic/io.h
  sparc: Use asm-generic/io.h
  x86: Use asm-generic/io.h
  xtensa: Use asm-generic/io.h
  mips: Use asm-generic/io.h
  mips: Fix map_physmem for cached mappings
  nios2: Use asm-generic/io.h
  powerpc: Use asm-generic/io.h
  sandbox: Use asm-generic/io.h
  board_f: Account for CONFIG_SYS_SDRAM_BASE being physical
  image: Account for CONFIG_SYS_SDRAM_BASE being physical
  image: Use ram_top, not bi_memsize, in getenv_bootm_size
  mips: Use ram_top, not bi_memsize, in arch_lmb_reserve
  mips: Ensure stack is at a virtual address
  boston: Provide physical CONFIG_SYS_SDRAM_BASE
  malta: Use a physical CONFIG_SYS_SDRAM_BASE
  xilfpga: Use a physical CONFIG_SYS_SDRAM_BASE
  mips: Use a physical CONFIG_SYS_SDRAM_BASE for remaining boards
  mips: Remove virt_to_phys call on bi_memstart

 arch/arc/include/asm/io.h        |  29 +----------
 arch/arm/include/asm/io.h        |  30 +----------
 arch/blackfin/include/asm/io.h   |  31 +----------
 arch/m68k/include/asm/io.h       |  29 +----------
 arch/microblaze/include/asm/io.h |  29 +----------
 arch/mips/cpu/start.S            |   3 +-
 arch/mips/include/asm/io.h       |  19 +++----
 arch/mips/lib/bootm.c            |   4 +-
 arch/nds32/include/asm/io.h      |  32 ++----------
 arch/nios2/include/asm/io.h      |  15 +++---
 arch/openrisc/include/asm/io.h   |  35 +------------
 arch/powerpc/include/asm/io.h    |  25 ++-------
 arch/sandbox/cpu/cpu.c           |  12 ++++-
 arch/sandbox/include/asm/io.h    |  17 +++---
 arch/sh/include/asm/io.h         |  29 +----------
 arch/sparc/include/asm/io.h      |  30 +----------
 arch/x86/include/asm/io.h        |  31 +----------
 arch/xtensa/include/asm/io.h     |  25 +--------
 board/imgtec/boston/ddr.c        |   8 +--
 common/board_f.c                 |   4 +-
 common/image.c                   |   6 +--
 include/asm-generic/io.h         | 110 +++++++++++++++++++++++++++++++++++++++
 include/configs/ap121.h          |   2 +-
 include/configs/ap143.h          |   2 +-
 include/configs/boston.h         |  21 ++++----
 include/configs/dbau1x00.h       |   2 +-
 include/configs/imgtec_xilfpga.h |   4 +-
 include/configs/malta.h          |  18 ++++---
 include/configs/pb1x00.h         |   2 +-
 include/configs/pic32mzdask.h    |   2 +-
 include/configs/qemu-mips.h      |   2 +-
 include/configs/qemu-mips64.h    |   2 +-
 include/configs/tplink_wdr4300.h |   2 +-
 include/configs/vct.h            |   2 +-
 34 files changed, 208 insertions(+), 406 deletions(-)
 create mode 100644 include/asm-generic/io.h

-- 
2.10.0

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

end of thread, other threads:[~2016-11-27 21:17 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-01 14:19 [U-Boot] [PATCH 00/27] Clean up address mapping functions & CONFIG_SYS_SDRAM_BASE Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 01/27] Provide a generic io.h & address mapping functions Paul Burton
2016-10-02  6:49   ` Angelo Dureghello
2016-10-03 21:49   ` Simon Glass
2016-11-17 15:32     ` Paul Burton
2016-11-19 13:47       ` Simon Glass
2016-10-01 14:19 ` [U-Boot] [PATCH 02/27] arc: Use asm-generic/io.h Paul Burton
2016-10-03  9:13   ` Alexey Brodkin
2016-10-01 14:19 ` [U-Boot] [PATCH 03/27] arm: " Paul Burton
2016-10-03 21:49   ` Simon Glass
2016-10-01 14:19 ` [U-Boot] [PATCH 04/27] blackfin: " Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 05/27] m68k: " Paul Burton
2016-10-02  6:36   ` Angelo Dureghello
2016-10-01 14:19 ` [U-Boot] [PATCH 06/27] microblaze: " Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 07/27] nds32: " Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 08/27] openrisc: " Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 09/27] sh: " Paul Burton
2016-11-24  1:49   ` Vladimir Zapolskiy
2016-11-27 21:17   ` Vladimir Zapolskiy
2016-10-01 14:19 ` [U-Boot] [PATCH 10/27] sparc: " Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 11/27] x86: " Paul Burton
2016-10-03 21:49   ` Simon Glass
2016-10-01 14:19 ` [U-Boot] [PATCH 12/27] xtensa: " Paul Burton
2016-10-03 18:22   ` Max Filippov
2016-10-01 14:19 ` [U-Boot] [PATCH 13/27] mips: " Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 14/27] mips: Fix map_physmem for cached mappings Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 15/27] nios2: Use asm-generic/io.h Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 16/27] powerpc: " Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 17/27] sandbox: " Paul Burton
2016-10-03 21:49   ` Simon Glass
2016-10-13 16:16   ` [U-Boot] [U-Boot,17/27] " Tom Rini
2016-10-01 14:19 ` [U-Boot] [PATCH 18/27] board_f: Account for CONFIG_SYS_SDRAM_BASE being physical Paul Burton
2016-10-03 21:49   ` Simon Glass
2016-10-01 14:19 ` [U-Boot] [PATCH 19/27] image: " Paul Burton
2016-10-03 21:49   ` Simon Glass
2016-10-01 14:19 ` [U-Boot] [PATCH 20/27] image: Use ram_top, not bi_memsize, in getenv_bootm_size Paul Burton
2016-10-03 21:49   ` Simon Glass
2016-10-01 14:19 ` [U-Boot] [PATCH 21/27] mips: Use ram_top, not bi_memsize, in arch_lmb_reserve Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 22/27] mips: Ensure stack is at a virtual address Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 23/27] boston: Provide physical CONFIG_SYS_SDRAM_BASE Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 24/27] malta: Use a " Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 25/27] xilfpga: " Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 26/27] mips: Use a physical CONFIG_SYS_SDRAM_BASE for remaining boards Paul Burton
2016-10-01 14:19 ` [U-Boot] [PATCH 27/27] mips: Remove virt_to_phys call on bi_memstart Paul Burton
2016-10-02 13:46 ` [U-Boot] [PATCH 00/27] Clean up address mapping functions & CONFIG_SYS_SDRAM_BASE Masahiro Yamada
2016-10-03 10:41   ` Paul Burton

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