History log of /linux/arch/powerpc/boot/main.c (Results 1 – 25 of 33)
Revision Date Author Comments
# 0ddbbb89 03-Jan-2024 Bjorn Helgaas <bhelgaas@google.com>

powerpc: Fix typos

Fix typos, most reported by "codespell arch/powerpc". Only touches
comments, no code changes.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Michael Ellerman

powerpc: Fix typos

Fix typos, most reported by "codespell arch/powerpc". Only touches
comments, no code changes.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240103231605.1801364-8-helgaas@kernel.org

show more ...


# df4232d9 24-Jun-2020 Nathan Chancellor <natechancellor@gmail.com>

powerpc/boot: Use address-of operator on section symbols

Clang warns:

arch/powerpc/boot/main.c:107:18: warning: array comparison always
evaluates to a constant [-Wtautological-compare]
if (

powerpc/boot: Use address-of operator on section symbols

Clang warns:

arch/powerpc/boot/main.c:107:18: warning: array comparison always
evaluates to a constant [-Wtautological-compare]
if (_initrd_end > _initrd_start) {
^
arch/powerpc/boot/main.c:155:20: warning: array comparison always
evaluates to a constant [-Wtautological-compare]
if (_esm_blob_end <= _esm_blob_start)
^
2 warnings generated.

These are not true arrays, they are linker defined symbols, which are
just addresses. Using the address of operator silences the warning
and does not change the resulting assembly with either clang/ld.lld
or gcc/ld (tested with diff + objdump -Dr).

Reported-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200624035920.835571-1-natechancellor@gmail.com

show more ...


# 528229d2 20-Aug-2019 Benjamin Herrenschmidt <benh@kernel.crashing.org>

powerpc: Add support for adding an ESM blob to the zImage wrapper

For secure VMs, the signing tool will create a ticket called the "ESM blob"
for the Enter Secure Mode ultravisor call with the signa

powerpc: Add support for adding an ESM blob to the zImage wrapper

For secure VMs, the signing tool will create a ticket called the "ESM blob"
for the Enter Secure Mode ultravisor call with the signatures of the kernel
and initrd among other things.

This adds support to the wrapper script for adding that blob via the "-e"
option to the zImage.pseries.

It also adds code to the zImage wrapper itself to retrieve and if necessary
relocate the blob, and pass its address to Linux via the device-tree, to be
later consumed by prom_init.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ bauerman: Minor adjustments to some comments. ]
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190820021326.6884-4-bauerman@linux.ibm.com

show more ...


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of th

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

show more ...


# a1ff5741 23-Nov-2016 Oliver O'Halloran <oohall@gmail.com>

powerpc/boot: Fix the early OPAL console wrappers

When configured with CONFIG_PPC_EARLY_DEBUG_OPAL=y the kernel expects
the OPAL entry and base addresses to be passed in r8 and r9
respectively. Curr

powerpc/boot: Fix the early OPAL console wrappers

When configured with CONFIG_PPC_EARLY_DEBUG_OPAL=y the kernel expects
the OPAL entry and base addresses to be passed in r8 and r9
respectively. Currently the wrapper does not attempt to restore these
values before entering the decompressed kernel which causes the kernel
to branch into whatever happens to be in r9 when doing a write to the
OPAL console in early boot.

This patch adds a platform_ops hook that can be used to branch into the
new kernel. The OPAL console driver patches this at runtime so that if
the console is used it will be restored just prior to entering the
kernel.

Fixes: 656ad58ef19e ("powerpc/boot: Add OPAL console to epapr wrappers")
Cc: stable@vger.kernel.org # v4.8+
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

show more ...


# 65bc3ece 12-Oct-2016 Heiner Kallweit <hkallweit1@gmail.com>

powerpc/boot: Fix boot on systems with uncompressed kernel image

This commit broke boot on systems with an uncompressed kernel image,
namely systems using a cuImage. On such systems the compressed b

powerpc/boot: Fix boot on systems with uncompressed kernel image

This commit broke boot on systems with an uncompressed kernel image,
namely systems using a cuImage. On such systems the compressed boot
image (boot wrapper, uncompressed kernel image, ..) is decompressed
by u-boot already, therefore the boot wrapper code sees an
uncompressed kernel image.

The old decompression code silently assumed an uncompressed kernel
image if it found no valid gzip signature, whilst the new code
bailed out in this case.

Fix this by re-introducing such a fallback if no valid compressed
image is found.

Fixes: 1b7898ee276b ("Use the pre-boot decompression API")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

show more ...


# 1b7898ee 22-Sep-2016 Oliver O'Halloran <oohall@gmail.com>

powerpc/boot: Use the pre-boot decompression API

Currently the powerpc boot wrapper has its own wrapper around zlib to
handle decompressing gzipped kernels. The kernel decompressor library
functions

powerpc/boot: Use the pre-boot decompression API

Currently the powerpc boot wrapper has its own wrapper around zlib to
handle decompressing gzipped kernels. The kernel decompressor library
functions now provide a generic interface that can be used in the
pre-boot environment. This allows boot wrappers to easily support
different compression algorithms. This patch converts the wrapper to use
this new API, but does not add support for using new algorithms.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

show more ...


# 4b4b13d5 28-Oct-2014 Simon Kagstrom <simon.kagstrom@netinsight.net>

powerpc/boot: Parse chosen/cmdline-timeout parameter

On some platforms a 5 second timeout during boot might be quite long, so
make it configurable. Run the loop at least once to let the user stop
th

powerpc/boot: Parse chosen/cmdline-timeout parameter

On some platforms a 5 second timeout during boot might be quite long, so
make it configurable. Run the loop at least once to let the user stop
the boot by holding a key pressed. If the timeout is set to 0, don't
wait for input, which can be used as a workaround if the boot hangs on
random data coming in on the serial port.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
[mpe: Changelog wording & whitespace]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

show more ...


# a2dd5da7 14-Apr-2014 Anton Blanchard <anton@samba.org>

powerpc: Rename duplicate COMMAND_LINE_SIZE define

We have two definitions of COMMAND_LINE_SIZE, one for the kernel
and one for the boot wrapper. I assume this is so the boot
wrapper can be self suf

powerpc: Rename duplicate COMMAND_LINE_SIZE define

We have two definitions of COMMAND_LINE_SIZE, one for the kernel
and one for the boot wrapper. I assume this is so the boot
wrapper can be self sufficient and not rely on kernel headers.

Having two defines with the same name is confusing, I just
updated the wrong one when trying to bump it.

Make the boot wrapper define unique by calling it
BOOT_COMMAND_LINE_SIZE.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

show more ...


# 8ba4773a 30-Oct-2008 Jon Smirl <jonsmirl@gmail.com>

powerpc: Fix format string warning in arch/powerpc/boot/main.c

Fix format string warning in arch/powerpc/boot/main.c. Also correct
a typo ("uncomressed") on the same line.

BOOTCC arch/powerpc/bo

powerpc: Fix format string warning in arch/powerpc/boot/main.c

Fix format string warning in arch/powerpc/boot/main.c. Also correct
a typo ("uncomressed") on the same line.

BOOTCC arch/powerpc/boot/main.o
arch/powerpc/boot/main.c: In function 'prep_kernel':
arch/powerpc/boot/main.c:65: warning: format '%08x' expects type
'unsigned int', but argument 3 has type 'long unsigned int'

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# c10c178a 12-Oct-2008 Sebastian Siewior <bigeasy@linutronix.de>

powerpc/boot: Compare _start against ei.loadsize instead ei.memsize

If the vmlinux binary in memory is larger than 4 MiB than it collides
with the initial boot code which is linked at 4 MiB in case

powerpc/boot: Compare _start against ei.loadsize instead ei.memsize

If the vmlinux binary in memory is larger than 4 MiB than it collides
with the initial boot code which is linked at 4 MiB in case of cuBoot.
If the the uncompressed image size (on disk size) is less than 4 MiB
then it would fit. The difference between those two sizes is the bss
section. In cuBoot we have the dtb embedded right after the data
section so it is very likely that the reset of the bss section (in
kernel's start up code) will overwrite the dtb blob. Therefore we
reallocate the dtb. Something similar is allready done to the initrd.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

show more ...


# 430b01e8 10-Dec-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Kill flatdevtree.c

Now that earlier patches have switched the bootwrapper to using libfdt
for device tree manipulation, this patch removes the now unused
flatdevtree.c and related files.

[POWERPC] Kill flatdevtree.c

Now that earlier patches have switched the bootwrapper to using libfdt
for device tree manipulation, this patch removes the now unused
flatdevtree.c and related files.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# 2f1d4899 20-Aug-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Move linker symbols into ops.h

Most of these were previously used by numerous C files and
redeclared in each one.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-o

[POWERPC] bootwrapper: Move linker symbols into ops.h

Most of these were previously used by numerous C files and
redeclared in each one.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# 62cf6a9d 15-Jun-2007 Geoff Levand <geoffrey.levand@am.sony.com>

[POWERPC] Make kernel_entry_t have global scope in bootwrapper

For the convenience of custom platform code make the powerpc
bootwrapper typdef kernel_entry_t global in scope.

Signed-off-by: Geoff L

[POWERPC] Make kernel_entry_t have global scope in bootwrapper

For the convenience of custom platform code make the powerpc
bootwrapper typdef kernel_entry_t global in scope.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# 02cc5114 29-Mar-2007 Milton Miller <miltonm@bga.com>

[POWERPC] bootwrapper: Decompress less, check more

Our kernels put everything in the first load segment, and we read that.
Instead of decompressing to the end of the gzip stream or supplied image
an

[POWERPC] bootwrapper: Decompress less, check more

Our kernels put everything in the first load segment, and we read that.
Instead of decompressing to the end of the gzip stream or supplied image
and hoping we get it all, decompress the expected size and complain if
it is not available.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# 88e68731 27-Mar-2007 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Move bootwrapper ELF parsing routines to a file

The ELF parsing routines local to arch/powerpc/boot/main.c are useful
to other callers therefore move them to their own file.

Signed-off-by

[POWERPC] Move bootwrapper ELF parsing routines to a file

The ELF parsing routines local to arch/powerpc/boot/main.c are useful
to other callers therefore move them to their own file.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# 3af82a8b 22-Mar-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Clean up zImage handling of the command line

This cleans up how the zImage code manipulates the kernel
command line. Notable improvements from the old handling:
- Command line manipulati

[POWERPC] Clean up zImage handling of the command line

This cleans up how the zImage code manipulates the kernel
command line. Notable improvements from the old handling:
- Command line manipulation is consolidated into a new
prep_cmdline() function, rather than being scattered across start()
and some helper functions
- Less stack space use: we use just a single global command
line buffer, which can be initialized by an external tool as before,
we no longer need another command line sized buffer on the stack.
- Easier to support platforms whose firmware passes a
commandline, but not a device tree. Platform code can now point new
loader_info fields to the firmware's command line, rather than having
to do early manipulation of the /chosen bootargs property which may
then be rewritten again by the core.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# 27fbaa97 22-Mar-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Add device tree utility functions to zImage

This patch adds a library of useful device tree manipulation functions
to the zImage library, for use by platform code. These functions are
bas

[POWERPC] Add device tree utility functions to zImage

This patch adds a library of useful device tree manipulation functions
to the zImage library, for use by platform code. These functions are
based on the hooks already in dt_ops, so they're not dependent on a
particular device tree implementation. This patch also slightly
streamlines the code in main.c using these new functions.

This is a consolidation of my work in this area with Scott Wood's
patches to a very similar end.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# e5a2072b 22-Mar-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] New reg.h for the zImage

This patch adds a reg.h to the zImage code, with common definitions
for accessing system registers. For now, this includes functions for
retrieving the PVR and th

[POWERPC] New reg.h for the zImage

This patch adds a reg.h to the zImage code, with common definitions
for accessing system registers. For now, this includes functions for
retrieving the PVR and the stack pointer. This patch then uses the
new reg.h to let start() display the running stack address without
having to explicitly pass the stack as a parameter from the asm code.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# fae59c39 22-Mar-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Add gcc format warnings to zImage printf()

This patch adds the correct attributes to the zImage's versions of
printf to make gcc generate format string mismatch warnings. It also
corrects

[POWERPC] Add gcc format warnings to zImage printf()

This patch adds the correct attributes to the zImage's versions of
printf to make gcc generate format string mismatch warnings. It also
corrects several minor problems with format strings in the zImage thus
discovered.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# 6a923216 21-Mar-2007 Milton Miller <miltonm@bga.com>

[POWERPC] bootwrapper: Add a fatal error helper

Add a macro fatal that calls printf then exit. User must include stdio.h.

Typically replaces 3 lines with 1, although I added back some whitespace.

[POWERPC] bootwrapper: Add a fatal error helper

Add a macro fatal that calls printf then exit. User must include stdio.h.

Typically replaces 3 lines with 1, although I added back some whitespace.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# 0e680673 19-Mar-2007 Milton Miller <miltonm@bga.com>

[POWERPC] boot: export flush_cache

Move the declaration of flush_cache to ops.h for use by platform code.

Signed-off-by: Milton Miller <miltonm@bga.com>
Acked-by: David Gibson <david@gibson.dropbea

[POWERPC] boot: export flush_cache

Move the declaration of flush_cache to ops.h for use by platform code.

Signed-off-by: Milton Miller <miltonm@bga.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# cd197ffc 05-Mar-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] zImage: Cleanup and improve zImage entry point

This patch re-organises the way the zImage wrapper code is entered, to
allow more flexibility on platforms with unusual entry conditions.
Aft

[POWERPC] zImage: Cleanup and improve zImage entry point

This patch re-organises the way the zImage wrapper code is entered, to
allow more flexibility on platforms with unusual entry conditions.
After this patch, a platform .o file has two options:

1) It can define a _zimage_start, in which case the platform code gets
control from the very beginning of execution. In this case the
platform code is responsible for relocating the zImage if necessary,
clearing the BSS, performing any platform specific initialization, and
finally calling start() to load and enter the kernel.

2) It can define platform_init(). In this case the generic crt0.S
handles initial entry, and calls platform_init() before calling
start(). The signature of platform_init() is changed, however, to
take up to 5 parameters (in r3..r7) as they come from the platform's
initial loader, instead of a fixed set of parameters based on OF's
usage.

When using the generic crt0.S, the platform .o can optionally
supply a custom stack to use, using the BSS_STACK() macro. If this
is not supplied, the crt0.S will assume that the loader has
supplied a usable stack.

In either case, the platform code communicates information to the
generic code (specifically, a PROM pointer for OF systems, and/or an
initrd image address supplied by the bootloader) via a global
structure "loader_info".

In addition the wrapper script is rearranged to ensure that the
platform .o is always linked first. This means that platforms where
the zImage entry point is at a fixed address or offset, rather than
being encoded in the binary header can be supported using option (1).

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# 79c85419 05-Mar-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] zImage: Cleanup and improve prep_kernel()

This patch rewrites prep_kernel() in the zImage wrapper code to be
clearer and more flexible. Notable changes:

- Handling of the initrd image f

[POWERPC] zImage: Cleanup and improve prep_kernel()

This patch rewrites prep_kernel() in the zImage wrapper code to be
clearer and more flexible. Notable changes:

- Handling of the initrd image from prep_kernel() has moved
into a new prep_initrd() function.
- The address of the initrd image is now added as device tree
properties, as the kernel expects.
- We only copy a packaged initrd image to a new location if it
is in danger of being clobbered when the kernel moves to its final
location, instead of always.
- By default we decompress the kernel directly to address 0,
instead of requiring it to relocate itself. Platforms (such as OF)
where doing this could clobber still-live firmware data structures can
override the vmlinux_alloc hook to provide an alternate place to
decompress the kernel.
- We no longer pass lots of information between functions in
global variables.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


# ad9d2716 05-Mar-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] zImage: Add more flexible gunzip convenience functions

At present, arch/powerpc/boot/main.c includes a gunzip() function
which is a convenient wrapper around zlib. However, it doesn't
con

[POWERPC] zImage: Add more flexible gunzip convenience functions

At present, arch/powerpc/boot/main.c includes a gunzip() function
which is a convenient wrapper around zlib. However, it doesn't
conveniently allow decompressing part of an image to one location,
then the remainder to a different address.

This patch adds a new set of more flexible convenience wrappers around
zlib, moving them to their own file, gunzip_util.c, in the process.
These wrappers allow decompressing sections of the compressed image to
different locations. In addition, they transparently handle
uncompressed data, avoiding special case code to handle uncompressed
vmlinux images.

The patch also converts main.c to use the new wrappers, using the new
flexibility to avoid decompressing the vmlinux's ELF header twice as
we did previously. That in turn means we avoid extending our
allocations for the vmlinux to allow space for the extra copy of the
ELF header.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

show more ...


12