public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RESEND][PATCH 00/24] sh: add generic board support and fixes
@ 2016-11-27 22:15 Vladimir Zapolskiy
  2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 01/24] sh4: cache: correct dcache flush to invalidate with write-back Vladimir Zapolskiy
                   ` (24 more replies)
  0 siblings, 25 replies; 68+ messages in thread
From: Vladimir Zapolskiy @ 2016-11-27 22:15 UTC (permalink / raw)
  To: u-boot

This is a combined series of the fixes to SH2/SH3/SH4/SH4A architecture port
of U-boot on top of the master branch, there is no functional difference
between this series and 3 my series sent in August 2016 for 2016.09, however
due to many positive generalization updates to U-boot sources the old
unreviewed series can not be cleanly applied anymore:

* [PATCH 0/6] sh4: fix and simplify cache manipulation
* [PATCH 0/5] sh4: fixes to SH7751 PCI host controller
* [PATCH] common: sh: add necessary define bits to board_f
* [PATCH 00/12] sh: change arch and boards code to generic board

I have to resend the changes, because apparently Nobuhiro Iwamatsu is
too busy to maintain SH port and I ask Tom/Simon/Marek and other active
U-boot developers to review and apply the changes, it is highly desirable
to have a possibility to run modern U-boot on boards powered by SH cores.

The changeset implements initial support of relocatable U-Boot code
for SH2/SH3/SH4 architectures and boards, as weel as it restores
a possibility to boot U-Boot on SH boards, which has not been converted
to generic board in time (for more details see commit f41e6088eb1
("sh: Fix build errors for generic board")). Special attention from
maintainers of all touched boards is required, due to inaccessibility
of hardware for me it would be a troublesome task.

*** CACHE SUPPORT COVER LETTER ***

In my tests I experience that sometimes SH4 does not properly
fetch instructions after immediate jump to a code loaded by
means of rtl8139, the problem is gone if "icache off" is
executed after load or if cache invalidation and write-back
is used on data load instead of just cache invalidation,
which is apparently an improper backbone of flush_dcache_range()
function.

The changeset contains a couple of bugfixes and a general
simplification of the code related to cache manipulation. Note
that while caches are found on SH2 and SH3 for long time
they were inactive in U-Boot, because I don't have SH2/SH3
hardware for testing I don't spread SH4 cache fixes to those
cpus, however generally it should be the same, in that case
arch/sh/cpu/sh4/cache.c file can be moved to arch/sh/lib
folder

*** PCI CONTROLLER CHANGES COVER LETTER ***

This series fixes 2 bugs found in SH7751 PCI host controller driver,
also it restores r2dplus defconfig and slightly simplifies the code
related to the SH7751 PCI controller, more improvements may follow
in future.

The change is independent on the following conversion to generic
board, however it adds some bits to simplify porting of r2dplus
board by moving board specific CONFIG_SYS_TEXT_BASE into P1 area,

Before the change even if rtl8139 driver is selected in a defconfig
the device was unusable due to invalid phys to bus mapping (e.g. test
with 'dhcp' command shows it), this most probably was caused by some
unnoticed generic change in PCI driver framework, however now it is
fixed by the series.

*** GENERIC BOARD CHANGES COVER LETTER ***

Now code/data initialization and relocation in general resemble the
procedure on ARM with minor peculiarities (same one relocation from a
storage device if calculated reloc_off == 0, otherwise two relocations),
however please note that the change does *not* add PIE support (only PIC),
so it may end up that there are persistent pointers to some non-relocated
data, this point requires better investion.

Only r2dplus board is actually converted to support new architectural
changes, the rest of the boards require attention from board maintainers
or they will be removed. Board maintainers may pay attention to
CONFIG_SYS_MALLOC_CLEAR_ON_INIT, CONFIG_NEEDS_MANUAL_RELOC,
CONFIG_SYS_GENERIC_GLOBAL_DATA etc. options.

This r2dplus board change allows immediately check the correctness of
the series on a r2dplus qemu target, note that the second copy is
not avoided in this case, also for simplicity SDRAM area up to text base
is large enough to store malloc pool and two copies of loaded code/data.

The change was tested on one custom SH4 (SH7551R) board, r2dplus qemu
target (see also SH7751 PCI change under review), the rest of the boards
are compile tested only.

Multiple kudos to Simon for great patience and a decision to not remove
the code.

Vladimir Zapolskiy (24):
  sh4: cache: correct dcache flush to invalidate with write-back
  sh4: cache: correct flush_cache() to writeback and invalidate
  sh3: remove unused cache.c file from being built
  sh: cache use jump_to_P2() and back_to_P1() from asm/system.h
  sh: cache: don't modify CCR from P1 area
  sh4: cache: move exported cache manipulation functions into cache.c
  pci: sh7751: fix up PCI I/O space address
  pci: sh7751: map PCI memory space into SDRAM
  sh4: remove __io config options from r2dplus and r7780mp boards
  r2dplus: use P1 area space for text base and PCI system memory
  r2dplus: select rtl8139 driver in defconfig
  common: sh: add necessary define bits to board_f
  sh4: use single u-boot linker script for all boards
  sh: place board lowlevel_init code in the beginning of .text
  sh: define entry point and reloc_dst inside a linker script
  sh: add MEMORY command to a shared linker script
  sh: remove undefined DEBUG preprocessor token from board config files
  sh: define CONFIG_DISPLAY_BOARDINFO to print board information
  sh: add common dram_init() function for all boards
  sh: add shared relocate_code() function and call board_init_r()
  sh4: fix start.S by calling board_init_f() after first code relocation
  sh: share the correct version of start.S among all cpus
  sh: generate position independent code for all platforms
  r2dplus: fixup CONFIG_SYS_TEXT_BASE to account arch/sh changes

 arch/sh/Makefile                           |  2 +-
 arch/sh/config.mk                          |  2 +-
 arch/sh/cpu/sh2/Makefile                   |  1 -
 arch/sh/cpu/sh2/cpu.c                      |  6 --
 arch/sh/cpu/sh3/Makefile                   |  3 +-
 arch/sh/cpu/sh3/cache.c                    | 96 ------------------------------
 arch/sh/cpu/sh3/cpu.c                      |  6 --
 arch/sh/cpu/sh3/start.S                    | 65 --------------------
 arch/sh/cpu/sh4/Makefile                   |  1 -
 arch/sh/cpu/sh4/cache.c                    | 88 +++++++++++++--------------
 arch/sh/cpu/sh4/cpu.c                      | 40 -------------
 arch/sh/cpu/sh4/start.S                    | 62 -------------------
 arch/sh/cpu/u-boot.lds                     | 44 +++++++-------
 arch/sh/include/asm/cache.h                |  2 -
 arch/sh/include/asm/io.h                   | 10 ----
 arch/sh/lib/Makefile                       |  2 +
 arch/sh/lib/board.c                        | 35 +++++++++++
 arch/sh/{cpu/sh2 => lib}/start.S           | 33 +++++-----
 board/alphaproject/ap_sh4a_4a/Makefile     |  2 +-
 board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c | 11 ----
 board/espt/Makefile                        |  2 +-
 board/espt/espt.c                          | 10 ----
 board/mpr2/Makefile                        |  2 +-
 board/mpr2/mpr2.c                          | 10 ----
 board/ms7720se/Makefile                    |  2 +-
 board/ms7720se/ms7720se.c                  | 10 ----
 board/ms7722se/Makefile                    |  2 +-
 board/ms7722se/ms7722se.c                  | 10 ----
 board/ms7750se/Makefile                    |  2 +-
 board/ms7750se/ms7750se.c                  | 10 ----
 board/renesas/MigoR/Makefile               |  2 +-
 board/renesas/MigoR/migo_r.c               | 10 ----
 board/renesas/ap325rxa/Makefile            |  2 +-
 board/renesas/ap325rxa/ap325rxa.c          | 10 ----
 board/renesas/ecovec/Makefile              |  2 +-
 board/renesas/ecovec/ecovec.c              | 10 ----
 board/renesas/r0p7734/Makefile             |  2 +-
 board/renesas/r0p7734/r0p7734.c            | 11 ----
 board/renesas/r2dplus/Makefile             |  2 +-
 board/renesas/r2dplus/r2dplus.c            | 10 ----
 board/renesas/r7780mp/Makefile             |  2 +-
 board/renesas/r7780mp/r7780mp.c            | 10 ----
 board/renesas/rsk7203/Makefile             |  2 +-
 board/renesas/rsk7203/rsk7203.c            | 10 ----
 board/renesas/rsk7264/Makefile             |  2 +-
 board/renesas/rsk7264/rsk7264.c            | 10 ----
 board/renesas/rsk7269/Makefile             |  2 +-
 board/renesas/rsk7269/rsk7269.c            | 10 ----
 board/renesas/sh7752evb/Makefile           |  2 +-
 board/renesas/sh7752evb/sh7752evb.c        | 11 ----
 board/renesas/sh7752evb/u-boot.lds         | 82 -------------------------
 board/renesas/sh7753evb/Makefile           |  2 +-
 board/renesas/sh7753evb/sh7753evb.c        | 11 ----
 board/renesas/sh7753evb/u-boot.lds         | 82 -------------------------
 board/renesas/sh7757lcr/Makefile           |  2 +-
 board/renesas/sh7757lcr/sh7757lcr.c        | 25 --------
 board/renesas/sh7757lcr/u-boot.lds         | 83 --------------------------
 board/renesas/sh7763rdp/Makefile           |  2 +-
 board/renesas/sh7763rdp/sh7763rdp.c        | 10 ----
 board/renesas/sh7785lcr/Makefile           |  2 +-
 board/renesas/sh7785lcr/sh7785lcr.c        | 10 ----
 board/shmin/Makefile                       |  2 +-
 board/shmin/shmin.c                        | 10 ----
 common/board_f.c                           | 15 +++--
 configs/r2dplus_defconfig                  |  2 +
 drivers/pci/pci_sh7751.c                   | 12 ++--
 include/configs/MigoR.h                    |  2 +-
 include/configs/ap325rxa.h                 |  2 +-
 include/configs/ap_sh4a_4a.h               |  2 +-
 include/configs/ecovec.h                   |  2 +-
 include/configs/espt.h                     |  1 +
 include/configs/mpr2.h                     |  2 +
 include/configs/ms7720se.h                 |  1 +
 include/configs/ms7722se.h                 |  1 +
 include/configs/ms7750se.h                 |  2 +
 include/configs/r0p7734.h                  |  2 +-
 include/configs/r2dplus.h                  | 15 +++--
 include/configs/r7780mp.h                  |  4 +-
 include/configs/rsk7203.h                  |  2 +-
 include/configs/rsk7264.h                  |  3 +-
 include/configs/rsk7269.h                  |  3 +-
 include/configs/sh7752evb.h                |  3 +-
 include/configs/sh7753evb.h                |  3 +-
 include/configs/sh7757lcr.h                |  3 +-
 include/configs/sh7763rdp.h                |  1 +
 include/configs/sh7785lcr.h                |  2 +-
 include/configs/shmin.h                    |  1 +
 87 files changed, 190 insertions(+), 912 deletions(-)
 delete mode 100644 arch/sh/cpu/sh3/cache.c
 delete mode 100644 arch/sh/cpu/sh3/start.S
 delete mode 100644 arch/sh/cpu/sh4/start.S
 create mode 100644 arch/sh/lib/board.c
 rename arch/sh/{cpu/sh2 => lib}/start.S (56%)
 delete mode 100644 board/renesas/sh7752evb/u-boot.lds
 delete mode 100644 board/renesas/sh7753evb/u-boot.lds
 delete mode 100644 board/renesas/sh7757lcr/u-boot.lds

-- 
2.10.2

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

end of thread, other threads:[~2016-12-04  0:44 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-27 22:15 [U-Boot] [RESEND][PATCH 00/24] sh: add generic board support and fixes Vladimir Zapolskiy
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 01/24] sh4: cache: correct dcache flush to invalidate with write-back Vladimir Zapolskiy
2016-12-03 23:48   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 02/24] sh4: cache: correct flush_cache() to writeback and invalidate Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-03 23:48   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 03/24] sh3: remove unused cache.c file from being built Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-03 23:49   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 04/24] sh: cache use jump_to_P2() and back_to_P1() from asm/system.h Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-03 23:52   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 05/24] sh: cache: don't modify CCR from P1 area Vladimir Zapolskiy
2016-12-03 23:52   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 06/24] sh4: cache: move exported cache manipulation functions into cache.c Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-03 23:53   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 07/24] pci: sh7751: fix up PCI I/O space address Vladimir Zapolskiy
2016-12-03 23:53   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 08/24] pci: sh7751: map PCI memory space into SDRAM Vladimir Zapolskiy
2016-12-03 23:56   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 09/24] sh4: remove __io config options from r2dplus and r7780mp boards Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-04  0:35   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 10/24] r2dplus: use P1 area space for text base and PCI system memory Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-04  0:36   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 11/24] r2dplus: select rtl8139 driver in defconfig Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-04  0:36   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 12/24] common: sh: add necessary define bits to board_f Vladimir Zapolskiy
2016-12-04  0:37   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 13/24] sh4: use single u-boot linker script for all boards Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-04  0:37   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 14/24] sh: place board lowlevel_init code in the beginning of .text Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-04  0:38   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 15/24] sh: define entry point and reloc_dst inside a linker script Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-04  0:39   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 16/24] sh: add MEMORY command to a shared " Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-04  0:39   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 17/24] sh: remove undefined DEBUG preprocessor token from board config files Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-04  0:40   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 18/24] sh: define CONFIG_DISPLAY_BOARDINFO to print board information Vladimir Zapolskiy
2016-11-30  0:33   ` Simon Glass
2016-12-04  0:41   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 19/24] sh: add common dram_init() function for all boards Vladimir Zapolskiy
2016-11-30  0:34   ` Simon Glass
2016-12-04  0:41   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 20/24] sh: add shared relocate_code() function and call board_init_r() Vladimir Zapolskiy
2016-11-30  0:34   ` Simon Glass
2016-12-04  0:42   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 21/24] sh4: fix start.S by calling board_init_f() after first code relocation Vladimir Zapolskiy
2016-11-30  0:34   ` Simon Glass
2016-12-04  0:42   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 22/24] sh: share the correct version of start.S among all cpus Vladimir Zapolskiy
2016-11-30  0:34   ` Simon Glass
2016-12-04  0:43   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 23/24] sh: generate position independent code for all platforms Vladimir Zapolskiy
2016-12-04  0:43   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
2016-11-27 22:15 ` [U-Boot] [RESEND][PATCH 24/24] r2dplus: fixup CONFIG_SYS_TEXT_BASE to account arch/sh changes Vladimir Zapolskiy
2016-12-04  0:44   ` [U-Boot] [U-Boot, RESEND, " Tom Rini
     [not found] ` <20161128154357.GD2546@bill-the-cat>
2016-11-29  0:58   ` [U-Boot] [RESEND][PATCH 00/24] sh: add generic board support and fixes Vladimir Zapolskiy
2016-11-29  1:22     ` Tom Rini

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