Skip to content

RFC MIPS: use kexec to load ELF linux images

Antony Pavlov barebox 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest10 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10MIPS: add initial cache support for R4000-class CPUsarch/mips/include/asm/cache.h arch/mips/include/asm/cacheops.h arch/mips/include/asm/io.h +3 more+159 -00 replies
2/10MIPS: introduce arch_shutdown()arch/mips/include/asm/common.h arch/mips/lib/Makefile arch/mips/lib/shutdown.c+12 -10 replies
3/10MIPS: use arch_shutdown() for flushing cachesarch/mips/lib/shutdown.c+2 -01 reply
4/10MIPS: add virt_to_phys() and phys_to_virt()arch/mips/include/asm/io.h+35 -00 replies
5/10resource: add create_resource() helper functioncommon/resource.c include/linux/ioport.h+17 -01 reply
6/10import initial kexec stuffcommands/Kconfig common/Kconfig lib/Makefile +6 more+1059 -00 replies
7/10filetype: add ELF typecommon/filetype.c include/filetype.h+6 -00 replies
8/10bootm: add kexec ELF supportinclude/linux/reboot.h lib/kexec/Makefile lib/kexec/kexec-bootm-elf.c+51 -01 reply
9/10MIPS: add ELF supportarch/mips/include/asm/elf.h arch/mips/lib/Makefile arch/mips/lib/kexec-mips.c +1 more+260 -10 replies
10/10MIPS: mach-malta: add kexec-capable reboot()arch/mips/Kconfig arch/mips/mach-malta/Makefile arch/mips/mach-malta/reboot.c+106 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC 00/10] MIPS: use kexec to load ELF linux images

This patchseries introduces a suitable way for loading ELF linux kernel images on MIPS. You can load normal vmlinux images or compressed self-extractable vmlinuz images.

The patchseries and additional patch with pre-compiled demo vmlinuz image for MIPS Malta can be obtained here:
https://github.com/frantony/barebox/tree/next.mips-malta-elf-linux.20140415

Linux kernel ELF images use KSEG1 ("cached") addresses, so this series adds elementary code for MIPS cache support.

The code for actual ELF loading and relocation is imported
from
kexec-tools (git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools)
and
linux kernel (http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git).

There is no common standard on passing cmdline to the linux kernel on MIPS machines. We have to realize it's own cmdline passing routine for every MIPS machine supported by barebox. The 'MIPS: mach-malta: add kexec-capable reboot()' patch demonstrates how to do it for MIPS Malta.

To separate common ELF handling routines and machine-specific cmdline handling the 'reboot()' call is introduced.
The common code checks and loads ELF-file, the MIPS-specific code arrange ELF segments in the appropriate memory places and tunes relocator; next reboot() is called and machine-specific code works on cmdline passing.

Antony Pavlov (10):
MIPS: add initial cache support for R4000-class CPUs
MIPS: introduce arch_shutdown()
MIPS: use arch_shutdown() for flushing caches
MIPS: add virt_to_phys() and phys_to_virt()
resource: add create_resource() helper function import initial kexec stuff
filetype: add ELF type
bootm: add kexec ELF support
MIPS: add ELF support
MIPS: mach-malta: add kexec-capable reboot()

 arch/mips/Kconfig                |   1 +
 arch/mips/include/asm/cache.h    |   8 +
 arch/mips/include/asm/cacheops.h |  27 ++
 arch/mips/include/asm/common.h   |   2 +-
 arch/mips/include/asm/elf.h      |   8 +-
 arch/mips/include/asm/io.h       |  42 +++
 arch/mips/lib/Makefile           |   5 +
 arch/mips/lib/c-r4k.c            |  89 ++++++
 arch/mips/lib/dma.c              |  27 ++
 arch/mips/lib/kexec-mips.c       | 170 +++++++++++
 arch/mips/lib/relocate_kernel.S  |  80 +++++
 arch/mips/lib/shutdown.c         |  12 +
 arch/mips/mach-malta/Makefile    |   1 +
 arch/mips/mach-malta/reboot.c    | 104 +++++++
 commands/Kconfig                 |   7 +
 common/Kconfig                   |   3 +
 common/filetype.c                |   5 +
 common/resource.c                |  15 +
 include/filetype.h               |   1 +
 include/linux/ioport.h           |   2 +
 include/linux/reboot.h           |  14 +
 lib/Makefile                     |   1 +
 lib/kexec/Makefile               |   4 +
 lib/kexec/kexec-bootm-elf.c      |  36 +++
 lib/kexec/kexec-elf-exec.c       |  82 +++++
 lib/kexec/kexec-elf.c            | 639 +++++++++++++++++++++++++++++++++++++++
 lib/kexec/kexec-elf.h            |  86 ++++++
 lib/kexec/kexec.c                | 149 +++++++++
 lib/kexec/kexec.h                |  89 ++++++
 29 files changed, 1707 insertions(+), 2 deletions(-)
 create mode 100644 arch/mips/include/asm/cache.h
 create mode 100644 arch/mips/include/asm/cacheops.h
 create mode 100644 arch/mips/lib/dma.c
 create mode 100644 arch/mips/lib/kexec-mips.c
 create mode 100644 arch/mips/lib/relocate_kernel.S
 create mode 100644 arch/mips/lib/shutdown.c
 create mode 100644 arch/mips/mach-malta/reboot.c
 create mode 100644 include/linux/reboot.h
 create mode 100644 lib/kexec/Makefile
 create mode 100644 lib/kexec/kexec-bootm-elf.c
 create mode 100644 lib/kexec/kexec-elf-exec.c
 create mode 100644 lib/kexec/kexec-elf.c
 create mode 100644 lib/kexec/kexec-elf.h
 create mode 100644 lib/kexec/kexec.c
 create mode 100644 lib/kexec/kexec.h
Signature · 7 lines
1.9.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox