Skip to content

Massive x86 Update - Bring x86 in line with ARM and PPC

Graeme Russ u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest32 patches 0 repliesNew

Changes since RFC from the cover letter

- Ran checkpatch.pl and fixed (most) errors and warnings (a few long lines remain for readability and sc520_enable_ecc() in arch\i386\cpu\sc520 contains raw asm which is #ifdef'd out - This is ECC initialisation copied from the original asm file which is retained in case someone with ECC capable hardware (which I do not have) would care to implement properly
- Merged some patches that logically belonged together
- Added a code tidy-up for eNET
- #defined all 'magic numbers' in the eNET configuration file
- rebased to u-boot/master

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/32x86: Fix definition of global_data struct for asm-offsets.carch/i386/include/asm/global_data.h+1 -10 replies
1/32x86: Fix definition of global_data struct for asm-offsets.c+0 -00 replies
2/32x86: Align config.mk and linker scripts with other archesarch/i386/config.mk arch/i386/cpu/config.mk arch/i386/cpu/u-boot.lds +2 more+114 -1152 replies
2/32x86: Align config.mk and linker scripts with other arches+0 -00 replies
2/32x86: Align config.mk and linker scripts with other arches+0 -00 replies
3/32eNET: Create distinct board configurationsboard/eNET/config.mk boards.cfg+2 -20 replies
3/32eNET: Create distinct board configurations+0 -00 replies
4/32x86: Parametize values used in linker scriptarch/i386/config.mk arch/i386/cpu/config.mk arch/i386/cpu/u-boot.lds +2 more+20 -200 replies
4/32x86: Parametize values used in linker script+0 -00 replies
5/32sc520: Sort Makefilearch/i386/cpu/sc520/Makefile+1 -10 replies
5/32sc520: Sort Makefile+0 -00 replies
5/32sc520: Sort Makefile+0 -00 replies
6/32x86: Fix mangled umlautsarch/i386/cpu/start.S arch/i386/lib/board.c+2 -20 replies
6/32x86: Fix mangled umlauts+0 -00 replies
7/32x86: Add stack dump to register dumparch/i386/cpu/interrupts.c+16 -00 replies
7/32x86: Add stack dump to register dump+0 -00 replies
8/32x86: Move Global Descriptor Table defines to processor.harch/i386/cpu/cpu.c arch/i386/include/asm/processor.h+7 -100 replies
8/32x86: Move Global Descriptor Table defines to processor.h+0 -00 replies
9/32x86: Add processor flags header from linuxarch/i386/cpu/cpu.c arch/i386/cpu/interrupts.c arch/i386/cpu/sc520/sc520.c +3 more+121 -100 replies
9/32x86: Add processor flags header from linux+0 -00 replies
10/32x86: Call early_board_init when warm bootingarch/i386/cpu/start.S+5 -50 replies
10/32x86: Call early_board_init when warm booting+0 -00 replies
11/32x86: Make cpu init functions weakarch/i386/cpu/cpu.c arch/i386/cpu/sc520/sc520.c arch/i386/include/asm/u-boot-i386.h +1 more+17 -320 replies
11/32x86: Make cpu init functions weak+0 -00 replies
12/32sc520: Define MMCR address in include filearch/i386/cpu/sc520/sc520.c arch/i386/cpu/sc520/sc520_asm.S arch/i386/include/asm/ic/sc520.h +1 more+55 -390 replies
12/32sc520: Define MMCR address in include file+0 -00 replies
13/32sc520: Move board specific settings to board init functionarch/i386/cpu/sc520/sc520.c board/eNET/eNET.c+9 -190 replies
13/32sc520: Move board specific settings to board init function+0 -00 replies
14/32sc520: Remove printf calls from cpu_init_farch/i386/cpu/sc520/sc520.c+0 -20 replies
14/32sc520: Remove printf calls from cpu_init_f+0 -00 replies
15/32eNET: Fix eNET Interrupt Setup for Linuxboard/eNET/eNET.c+9 -60 replies
15/32eNET: Fix eNET Interrupt Setup for Linux+0 -00 replies
16/32eNET: Add RTC support to eNETdrivers/rtc/mc146818.c include/configs/eNET.h+8 -00 replies
16/32eNET: Add RTC support to eNET+0 -00 replies
17/32eNET: Define MMCR values in config.hboard/eNET/eNET.c board/eNET/eNET_start16.S include/configs/eNET.h+445 -460 replies
17/32eNET: Define MMCR values in config.h+0 -00 replies
18/32eNET: Rearrange PAR assignmentsboard/eNET/eNET.c include/configs/eNET.h+46 -300 replies
18/32eNET: Rearrange PAR assignments+0 -00 replies
19/32eNET: General code cleanupboard/eNET/eNET.c board/eNET/eNET_start.S include/configs/eNET.h+129 -1850 replies
19/32eNET: General code cleanup+0 -00 replies
20/32x86: Move initial gd to fixed locationarch/i386/cpu/start.S arch/i386/include/asm/global_data.h arch/i386/lib/board.c +1 more+39 -190 replies
20/32x86: Move initial gd to fixed location+0 -00 replies
21/32x86: Use Cache-As-RAM for initial stackarch/i386/cpu/sc520/Makefile arch/i386/cpu/sc520/sc520_asm.S arch/i386/cpu/sc520/sc520_car.S +2 more+135 -210 replies
21/32x86: Use Cache-As-RAM for initial stack+0 -00 replies
22/32sc520: Move RAM sizing code from asm to Carch/i386/cpu/sc520/Makefile arch/i386/cpu/sc520/sc520.c arch/i386/cpu/sc520/sc520_asm.S +7 more+612 -7680 replies
22/32sc520: Move RAM sizing code from asm to C+0 -00 replies
23/32x86: Defer setup of final stackarch/i386/cpu/start.S arch/i386/lib/board.c+33 -170 replies
23/32x86: Defer setup of final stack+0 -00 replies
24/32x86: Move call to dram_init_f into board_init_farch/i386/cpu/start.S arch/i386/include/asm/u-boot-i386.h arch/i386/lib/board.c+4 -30 replies
24/32x86: Move call to dram_init_f into board_init_f+0 -00 replies
25/32x86: Move test for cold boot into init functionsarch/i386/cpu/sc520/sc520.c arch/i386/lib/board.c+11 -130 replies
25/32x86: Move test for cold boot into init functions+0 -00 replies
26/32x86: Move console initialisation into board_init_farch/i386/lib/board.c+12 -30 replies
26/32x86: Move console initialisation into board_init_f+0 -00 replies
27/32x86: Fix incorrect usage of relocation offsetarch/i386/cpu/start.S arch/i386/lib/board.c+6 -60 replies
27/32x86: Fix incorrect usage of relocation offset+0 -00 replies
28/32x86: Split board_init_f() into init_fnc_t compatible functionsarch/i386/include/asm/global_data.h arch/i386/lib/board.c+74 -490 replies
28/32x86: Split board_init_f() into init_fnc_t compatible functions+0 -00 replies
29/32x86: Rearrange function calls in board_init_farch/i386/lib/board.c+8 -80 replies
29/32x86: Rearrange function calls in board_init_f+0 -00 replies
30/32x86: Convert board_init_f to use an init_sequencearch/i386/lib/board.c+29 -410 replies
30/32x86: Convert board_init_f to use an init_sequence+0 -00 replies
31/32sc520: Release CAR and enable cachingarch/i386/cpu/sc520/sc520.c+11 -50 replies
31/32sc520: Release CAR and enable caching+0 -00 replies
32/32eNET: Move initial Global Data into CARinclude/configs/eNET.h+1 -10 replies
32/32eNET: Move initial Global Data into CAR+0 -00 replies

Reviews trailers per patch

3 of 66 patches have a Reviewed-by or Acked-by.

PatchLo?c Minier
1/32
1/32
2/32A-b
2/32A-b
2/32A-b
3/32
3/32
4/32
4/32
5/32
5/32
5/32
6/32
6/32
7/32
7/32
8/32
8/32
9/32
9/32
10/32
10/32
11/32
11/32
12/32
12/32
13/32
13/32
14/32
14/32
15/32
15/32
16/32
16/32
17/32
17/32
18/32
18/32
19/32
19/32
20/32
20/32
21/32
21/32
22/32
22/32
23/32
23/32
24/32
24/32
25/32
25/32
26/32
26/32
27/32
27/32
28/32
28/32
29/32
29/32
30/32
30/32
31/32
31/32
32/32
32/32

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [U-Boot] [PATCH 00/32] Massive x86 Update - Bring x86 in line with ARM and PPC

This patch series marks a considerably significant milestone in the x86 port of U-Boot - Running the initial init sequence from Flash using the CPU on-die cache as a temporary stack.

Prior to this patch series, the low-level assembler code running in Flash was responsible for initialising SDRAM and getting the C environment (the stack) set up. The C code would then simply copy the U-Boot image to RAM, do some relocation adjustments and jump into the in-RAM copy - only then would the init sequence run.

Thank to the assistance of Juergen Beisert (who had done a Cache-As-RAM implementation for the sc520 quite some time ago), the x86 boot sequence is more 'standard':
- Initialise Cache-As-RAM (CAR)
- Setup a restricted 'C' environment
- Setup initial global data in CAR
- Run init sequence from Flash
- Copy global data to a newly malloc'd block
- Jump to RAM

This patch does have three 'negative' impacts:
- Boot time is slightly slower due to running the init sequence from Flash rather than SDRAM
- The image is no longer position independent - If you want to create a warm-boot u-boot image, you need to link it to a different address
- You can no longer do a warm-boot to a new u-boot image from SDARM (SDRAM is always re-initialised during the init sequence)

Regards,

Graeme

Changes since RFC:
- Ran checkpatch.pl and fixed (most) errors and warnings (a few long lines remain for readability and sc520_enable_ecc() in arch\i386\cpu\sc520 contains raw asm which is #ifdef'd out - This is ECC initialisation copied from the original asm file which is retained in case someone with ECC capable hardware (which I do not have) would care to implement properly
- Merged some patches that logically belonged together
- Added a code tidy-up for eNET
- #defined all 'magic numbers' in the eNET configuration file
- rebased to u-boot/master

Graeme Russ (32):
x86: Fix definition of global_data struct for asm-offsets.c
x86: Align config.mk and linker scripts with other arches
eNET: Create distinct board configurations
x86: Parametize values used in linker script
sc520: Sort Makefile
x86: Fix mangled umlauts
x86: Add stack dump to register dump
x86: Move Global Descriptor Table defines to processor.h
x86: Add processor flags header from linux
x86: Call early_board_init when warm booting
x86: Make cpu init functions weak
sc520: Define MMCR address in include file
sc520: Move board specific settings to board init function
sc520: Remove printf calls from cpu_init_f
eNET: Fix eNET Interrupt Setup for Linux
eNET: Add RTC support to eNET
eNET: Define MMCR values in config.h
eNET: Rearrange PAR assignments
eNET: General code cleanup
x86: Move initial gd to fixed location
x86: Use Cache-As-RAM for initial stack
sc520: Move RAM sizing code from asm to C
x86: Defer setup of final stack
x86: Move call to dram_init_f into board_init_f
x86: Move test for cold boot into init functions
x86: Move console initialisation into board_init_f
x86: Fix incorrect usage of relocation offset
x86: Split board_init_f() into init_fnc_t compatible functions
x86: Rearrange function calls in board_init_f
x86: Convert board_init_f to use an init_sequence
sc520: Release CAR and enable caching
eNET: Move initial Global Data into CAR

 arch/i386/config.mk                     |   14 +-
 arch/i386/cpu/config.mk                 |   10 +-
 arch/i386/cpu/cpu.c                     |   35 +-
 arch/i386/cpu/interrupts.c              |   19 +-
 arch/i386/cpu/sc520/Makefile            |    5 +-
 arch/i386/cpu/sc520/sc520.c             |  148 +-------
 arch/i386/cpu/sc520/sc520_asm.S         |  615 ----------------------------
 arch/i386/cpu/sc520/sc520_car.S         |   94 +++++
 arch/i386/cpu/sc520/sc520_sdram.c       |  532 ++++++++++++++++++++++++
 arch/i386/cpu/start.S                   |  107 +++---
 arch/i386/cpu/start16.S                 |    5 +-
 arch/i386/cpu/u-boot.lds                |   96 +++++
 arch/i386/include/asm/global_data.h     |   21 +-
 arch/i386/include/asm/ic/sc520.h        |   93 ++++-
 arch/i386/include/asm/processor-flags.h |  100 +++++
 arch/i386/include/asm/processor.h       |    9 +-
 arch/i386/include/asm/u-boot-i386.h     |    3 +
 arch/i386/lib/board.c                   |  144 ++++---
 arch/i386/lib/realmode.c                |    8 +-
 board/eNET/config.mk                    |    6 +-
 board/eNET/eNET.c                       |  192 +++++----
 board/eNET/eNET_start.S                 |    7 -
 board/eNET/eNET_start16.S               |   15 +-
 board/eNET/u-boot.lds                   |  104 -----
 boards.cfg                              |    3 +-
 drivers/rtc/mc146818.c                  |    6 +
 include/configs/eNET.h                  |  678 +++++++++++++++++++++++--------
 27 files changed, 1786 insertions(+), 1283 deletions(-)
 delete mode 100644 arch/i386/cpu/sc520/sc520_asm.S
 create mode 100644 arch/i386/cpu/sc520/sc520_car.S
 create mode 100644 arch/i386/cpu/sc520/sc520_sdram.c
 create mode 100644 arch/i386/cpu/u-boot.lds
 create mode 100644 arch/i386/include/asm/processor-flags.h
 delete mode 100644 board/eNET/u-boot.lds