Skip to content

sh: add generic board support and fixes

Tom Rini u-boot 1 version New

Get series with b4
b4 am 20161129012203.GN2546@bill-the-cat

Versions newest first

  1. v1 Latest24 patches 0 repliesNew

Patches in v1 No applies recorded yet

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

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [U-Boot] [RESEND][PATCH 00/24] sh: add generic board support and fixes
Quoted 36 lines · Vladimir Zapolskiy

Hi Tom,

Quoted 13 lines · Tom Rini
Quoted 11 lines · Vladimir Zapolskiy

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

Quoted 6 lines
Quoted 4 lines

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.

First, would you be interested in taking up the SH maintainership?

clearly Renesas abandoned SH architecture as a legacy one (and probably as a competing with R-Car one), but until J4 core as a replacement for Renesas SH4 is released by j-core.org project it is desirable to keep U-Boot running on SH platforms.

I'm interested in maintainership of SH and thereafter J-Core cores, but practically I have only one SH4 powered board on hand, unfortunately begging for hardware donations was not so successful. At the moment U-Boot contains SH2A/SH3/SH4/SH4A arch support and boards, I have to figure out where to get more boards to cover more SoC flavours, and getting legacy hardware is always a problem, because it is not on a store's shelf.

Quoted 3 lines

To start from I would recommend to decouple u-boot-sh.git fork into independent SH and ARM R-Car repositories, the latter one will be maintained by Renesas associates.

I'm interesting in having J-Core work and be maintained in U-Boot, so lets make this work. With regards to legacy platforms, I'm happy to drop things which are unavailable / non-functional and just note in doc/README.scrapyard when things were removed. We did this a lot around a year ago and probably should again.

And then yes, the R-Car patches should come in via another repository rather than u-boot.sh as was previously convenient.

Quoted 22 lines
Quoted 22 lines

Second, I know before you told me how to get QEMU to run, but with this series and:
qemu-system-sh4 -M r2d -kernel r2dplus/current/r2dplus/u-boot.bin -nographic -serial null -serial vc

I get:
QEMU 2.5.91 monitor - type 'help' for more information (qemu) long write to SH7750_WCR1_A7 (0x000000001f800008) ignored long write to SH7750_WCR2_A7 (0x000000001f80000c) ignored long write to SH7750_WCR3_A7 (0x000000001f800010) ignored long write to SH7750_MCR_A7 (0x000000001f800014) ignored word write to SH7750_RTCNT_A7 (0x000000001f800020) ignored word write to SH7750_RTCOR_A7 (0x000000001f800024) ignored Write access to refresh count register
word write to SH7750_RTCSR_A7 (0x000000001f80001c) ignored Read access to refresh count register, incrementing long write to SH7750_MCR_A7 (0x000000001f800014) ignored long read to SH7750_WCR1_A7 (0x000000001f800008) ignored long read to SH7750_WCR2_A7 (0x000000001f80000c) ignored long read to SH7750_WCR3_A7 (0x000000001f800010) ignored long read to SH7750_MCR_A7 (0x000000001f800014) ignored

Quoted 5 lines
Quoted 1 line

and the qemu monitor/debug prompt.

The displayed qemu output is expected and can be ignored, currently SH port in qemu is in "odd fixes" maintainership stage, hopefully I'll find time to send a patch to silence this.

Ah, OK.

Quoted 70 lines
Quoted 4 lines

Without -serial args I just get the
hang. Any ideas? I ask since I'm keen to add r2dplus to test.py and travis-ci once it's working, thanks!

I use this list of components to build and test U-Boot on r2dplus qemu target and SH7751 powered board I have on hand (it is quite similar to r2dplus devkit):

* SH4 toolchain from buildroot distro with musl (libc flavour most probably is unrelated to U-boot or kernel):
- gcc-5.3.0
- musl-1.1.12
- linux-4.4 headers

* qemu-system-sh4 is from standard Debian qemu-system-misc package:
- qemu-system-misc-1:2.6+dfsg-3
- qemu-2.6.50 vanilla build also works for me fine

* U-Boot compilation:

% make ARCH=sh CROSS_COMPILE=sh4-buildroot-linux-musl- CC='sh4-buildroot-linux-musl-gcc -Wall' r2dplus_defconfig

% make ARCH=sh CROSS_COMPILE=sh4-buildroot-linux-musl- CC='sh4-buildroot-linux-musl-gcc -Wall' u-boot.bin

Command to run qemu with output directly to a console is similar to the command you mentioned above (press Ctrl-C to terminate):

% qemu-system-sh4 -M r2d -kernel u-boot.bin -monitor null -serial null -serial stdio -nographic

This is an example of testing on my end (omitting "long write .. ignored" messages):

U-Boot 2016.11-00195-ge01f392eab43 (Nov 29 2016 - 02:55:25 +0200)

CPU: SH4
BOARD: Renesas Solutions R2D Plus
DRAM: 64 MiB
Flash: ERROR: too many flash sectors
8 MiB
*** Warning - bad CRC, using default environment

PCI: SH7751 PCI host bridge found.
long read to SH7750_WCR1_A7 (0x000000001f800008) ignored long read to SH7750_WCR2_A7 (0x000000001f80000c) ignored long read to SH7750_WCR3_A7 (0x000000001f800010) ignored long read to SH7750_MCR_A7 (0x000000001f800014) ignored
PCI: Bus Dev VenId DevId Class Int
PCI:
00:00.0 - 1054:350e - Bridge device
00:02.0 - 10ec:8139 - Network controller

In:    serial
Out:   serial
Err:   serial
Net:   RTL8139#0
Error: RTL8139#0 address not set.

IDE: Bus 0: not available
=> bdinfo

mem start      = 0x8C000000
mem size       = 0x04000000
flash start    = 0xA0000000
flash size     = 0x00800000
flash offset   = 0xFFE5D444
ethaddr     = (not set)
IP addr     = <NULL>
baudrate    = 115200 bps
Quoted 6 lines

=> pci
Scanning PCI devices on bus 0
BusDevFun VendorId DeviceId Device Class Sub-Class
_____________________________________________________________

00.00.00   0x1054     0x350e     Bridge device           0x00
00.02.00   0x10ec     0x8139     Network controller      0x00

Ah, OK. With that exact command line I can get things going. My gut feeling, having played with other qemu boards as a user, is that there's something odd going on in how qemu is parsing the arguments and assigning things as the defaults "should" provide this too, but instead we're disabling the defaults for monitor and serial (which can usually be multiplexed) and then only giving serial to stdio.

But, the good news is that this means I can get travis-ci going and make add r2dplus to the list of tested-every-time platforms. I'll follow up to your series with patches for that hopefully tomorrow.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161128/0f683deb/attachment.sig>