History log of /linux-master/arch/powerpc/boot/Makefile
Revision Date Author Comments
# b751ed04 19-Jun-2023 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: drop MPC85xx_CDS platform support

The MPC8541/8548/8555 Configurable Development System (CDS) were the
vehicle used to provide evaluation of the 1st e500-v2 CPUs around 2007.

Similar to the earlier MPC83xx-MDS systems we removed, the "brains"
exist on a PCI-X card, but additional connectors exist to the right of
the PCI-X slot, two structural metal pins are used to provide stability
in a vertical ATX mounting, and the CPU is now on a daughter-card vs. a
clamped down BGA.

Given the extra complexity and risk of connector damage, the 8548CDS
I had access to came pre-assembled in a basic white Antec case common
for that era, and I'm inclined to assume that was the default.

Power was typical "Pentium4" 2005 ATX - the main 20 pin connector went
to the PCI ATX form factor backplane, and the 4 pin black/yellow went
to the CPU card.

Like previous evaluation boards, they attempted to provide break-out
connectors for as many features as possible, and that made for a fairly
complex looking system.

In any case, these are over 15 years old, and fairly complex systems,
originally made for a small group of industry related people, and made
for use where quiet fan operation wasn't important. Given that, it
makes sense to remove support from them in 2023.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230620043300.197546-3-paul.gortmaker@windriver.com


# 384e338a 19-Jun-2023 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: drop MPC8540_ADS and MPC8560_ADS platform support

Based on the revision history in the manual(s), these e500-v1
platforms were first available around 2002.

Like a lot of evaluation boards, they attempted to provide break-out
connectors for all possible features, and that combined with four
PCI-X slots (and the age/era) meant for a considerably large board.

As I recall it, from a Linux point of view, the biggest difference
between 8540 and 8560 was in the UART implementation, and that is
reflected in a diff of the defconfigs.

In any case, these are over 20 years old, and by today's standards
only have a small amount of DDR1 memory, and were not widely available.

Given that, it makes sense to remove support from them in 2023.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230620043300.197546-2-paul.gortmaker@windriver.com


# f5df87b8 06-Jun-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc/build: Remove -pipe from compilation flags

x86 removed -pipe in commit 437e88ab8f9e2 ("x86/build: Remove -pipe from
KBUILD_CFLAGS") and the newer arm64 and riscv seem to have never used it,
so that seems to be the way the world's going.

Compile performance building defconfig on a POWER10 PowerNV system
was in the noise after 10 builds each. No point in adding options unless
they help something, so remove it.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230606064830.184083-1-npiggin@gmail.com


# 8bce81db 06-Jun-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc/boot: Clean up Makefile after cflags and asflags separation

Tidy pass over boot Makefile. Move variables together where possible.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230606064657.183969-5-npiggin@gmail.com


# 54194a2f 06-Jun-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc/boot: Separate BOOTCFLAGS from BOOTASFLAGS

BOOTCFLAGS no longer contains anything that BOOTASFLAGS needs (except
-pipe). Separate them to avoid fragility with cross-contamination of
flags which has caused several build problems.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/lkml/CAHk-=whyWUdJDeOBN1hRWYSkQkvzYiQ5RbSW5rJjExgnbSNX9Q@mail.gmail.com/
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230606064657.183969-4-npiggin@gmail.com


# d1b7d40d 06-Jun-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc/boot: Separate CPP flags from BOOTCFLAGS

Add BOOTCPPFLAGS variable for the CPP options required by C and AS.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230606064657.183969-3-npiggin@gmail.com


# 689d592e 06-Jun-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc/boot: Separate target flags from BOOTCFLAGS

Add BOOTTARGETFLAGS variable with target / ABI options common to
CFLAGS and AFLAGS.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230606064657.183969-2-npiggin@gmail.com


# 2b694fc96 27-Apr-2023 Nathan Chancellor <nathan@kernel.org>

powerpc/boot: Disable power10 features after BOOTAFLAGS assignment

When building the boot wrapper assembly files with clang after
commit 648a1783fe25 ("powerpc/boot: Fix boot wrapper code generation
with CONFIG_POWER10_CPU"), the following warnings appear for each file
built:

'-prefixed' is not a recognized feature for this target (ignoring feature)
'-pcrel' is not a recognized feature for this target (ignoring feature)

While it is questionable whether or not LLVM should be emitting a
warning when passed negative versions of code generation flags when
building assembly files (since it does not emit a warning for the
altivec and vsx flags), it is easy enough to work around this by just
moving the disabled flags to BOOTCFLAGS after the assignment of
BOOTAFLAGS, so that they are not added when building assembly files.
Do so to silence the warnings.

Fixes: 648a1783fe25 ("powerpc/boot: Fix boot wrapper code generation with CONFIG_POWER10_CPU")
Link: https://github.com/ClangBuiltLinux/linux/issues/1839
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230427-remove-power10-args-from-boot-aflags-clang-v1-1-9107f7c943bc@kernel.org


# 859b21a0 24-Feb-2023 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: drop PowerQUICC II Family ADS platform support

Based on documentation revision dates, this MPC82xx pq2fads system
predates the MPC8272-ADS variant by about a year and only has 1/2
the amount of RAM (32MB) -- largely making it useless with a modern
v6.x kernel from today.

Similar to the MPC8272-ADS the pq2fads also supported other 82xx CPU
variants, had 8MB flash, and like the 8272 ADS platform, was on a fairly
large PCB in order to have space for breakout connectors for all features.

These 82xx platforms are two decades old, and originally made for a
small group of industry related people in order to assist in new OEM
board designs. Given that, it makes sense to remove support today.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230224204959.17425-3-paul.gortmaker@windriver.com


# 33777a4e 24-Feb-2023 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: drop MPC8272_ADS platform support

The MPC8272-ADS also supported other 82xx CPU variants, had 64MB RAM,
8MB flash, and like the 85xx ADS platforms, was on a fairly large PCB
in order to have space for breakout connectors for all the features.

These 82xx platforms are two decades old, and originally made for a
small group of industry related people in order to assist in new OEM
board designs. Given that, it makes sense to remove support today.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230224204959.17425-2-paul.gortmaker@windriver.com


# f03425a5 25-Feb-2023 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: drop HPC II (MPC7448) evaluation platform support.

This was an interesting platform - it was the 1st instance of a
respin of earlier 130nm 74xx CPUs on 90nm and systems using MPC7448
were positioned as a rack server platform solution.

Given that, the evaluation platform (at least the one I had) was shipped
in a horizontal 1/2 height Antec desktop case with retro styling and
colours, despite the fact the docs explicitly stated that the HPC II is
not a desktop machine (noting it had no gfx or legacy PC I/O support).

Historic trivia aside, this was the 1st introduction of the e600
procfam as an evolution from the earlier G4.

However even with the claim to being "1st e600" it seems the 2005+
era was turning its attention to multicore support and from my memory
this poor guy was quickly overshadowed by the dual core MPC8641D.

All that aside, we are once again looking at 15+ year old evaluation
platforms that were not widely distributed, so 2023 removal makes sense.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230225201318.3682-2-paul.gortmaker@windriver.com


# b8fa3af2 12-Apr-2023 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: drop MPC832x_MDS platform support

This final variant in the e300 family of Modular Development System
(MDS) in this series was actually aimed at feature reduction - things
like floating point and ethernet were removed in order to make for a
lower power and lower cost system.

Like all the MDS systems, it was meant as a vehicle to get the CPU out
early to hardware OEMs so software and board development could take place
in parallel.

These were made in limited numbers and availability preference was given
to partners who were planning to make their own boards.

Given that the whole reason for existence was to assist in enabling new
board designs [not happening for 10+ years], and that they weren't
generally available, and that the hardware wasn't really hobbyist friendly
even for retro computing, it makes sense to retire the support for this
particular platform.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Li Yang <leoyang.li@nxp.com>
[mpe: Drop stale reference to MPC832x_MDS in arch/powerpc/boot/Makefile]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230220115913.25811-5-paul.gortmaker@windriver.com


# 7840b08a 12-Apr-2023 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: drop MPC836x_MDS platform support

This 2006 era Modular Development System (MDS) has, at its core component,
a full length card with a PCI edge. No case. Serial and network
connectors were on card, so it could optionally be fitted with plastic
stand-offs and run stand-alone off a power brick.

This is very similar to the MPC834x_MDS removed in the prior commit, but
with this board variant as an evolutionary step. DDR2 was now an option,
and the card edge was revised down to PCI-32 as PCI-64 never got traction.
But overall the form factor and design goals were unchanged.

Like all the MDS systems, it was meant as a vehicle to get the CPU out
early to hardware OEMs so software and board development could take place
in parallel.

To that end, the BGA CPU was held in place with a mechanical spring loaded
pressure assembly (vs. solder) so that early rev silicon could be replaced
in the field. Not for COTS deployment!

These were made in limited numbers and availability preference was given
to partners who were planning to make their own boards.

Given that the whole reason for existence was to assist in enabling new
board designs [not happening for 10+ years], and that they weren't
generally available, and that the hardware wasn't really hobbyist friendly
even for retro computing, it makes sense to retire the support for this
particular platform.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Li Yang <leoyang.li@nxp.com>
[mpe: Drop stale reference to MPC836x_MDS in arch/powerpc/boot/Makefile]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230220115913.25811-3-paul.gortmaker@windriver.com


# da031017 12-Apr-2023 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: drop MPC834x_MDS platform support

This 2006 era Modular Development System (MDS) has, at its core
component, a full length card with a PCI-64 edge. No case. Serial
and network connectors were on card, so it could optionally be fitted
with plastic stand-offs and run stand-alone off a power brick.

Like all the MDS systems, it was meant as a vehicle to get the CPU
out early to hardware OEMs so software and board development could
take place in parallel.

To that end, the BGA CPU was held in place with a mechanical spring
loaded pressure assembly (vs. solder) so that early rev silicon could
be replaced in the field. Not for COTS deployment!

These were made in limited numbers and availability preference was
given to partners who were planning to make their own boards, like
our WR SBC8349 [since retired in v4.18 (2017, commit 3bc6cf5a86e5)]

Given that the whole reason for existence was to assist in enabling
new board designs [not happening for 10+ years], and that they weren't
generally available, and that the hardware wasn't really hobbyist
friendly even for retro computing, it makes sense to retire the
support for this platform.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Li Yang <leoyang.li@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230220115913.25811-2-paul.gortmaker@windriver.com


# 648a1783 06-Apr-2023 Nicholas Piggin <npiggin@gmail.com>

powerpc/boot: Fix boot wrapper code generation with CONFIG_POWER10_CPU

-mcpu=power10 will generate prefixed and pcrel code by default, which
we do not support. The general kernel disables these with cflags, but
those were missed for the boot wrapper.

Fixes: 4b2a9315f20d ("powerpc/64s: POWER10 CPU Kconfig build option")
Cc: stable@vger.kernel.org # v6.1+
Reported-by: Danny Tsen <dtsen@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230407040909.230998-1-npiggin@gmail.com


# d1c5acca 15-Feb-2023 Nathan Chancellor <nathan@kernel.org>

powerpc/boot: Only use '-mabi=elfv2' with CONFIG_PPC64_BOOT_WRAPPER

When CONFIG_PPC64_ELF_ABI_V2 is enabled with clang through
CONFIG_PPC64_BIG_ENDIAN_ELF_ABI_V2, building the powerpc boot wrapper
in 32-bit mode (i.e. with CONFIG_PPC64_BOOT_WRAPPER=n) fails with:

error: unknown target ABI 'elfv2'

The ABI cannot be changed with '-m32'; GCC silently accepts it but clang
errors out. Only provide '-mabi=elfv2' when CONFIG_PPC64_BOOT_WRAPPER is
enabled, which is the only way '-mabi=elfv2' will be useful.

Tested-by: "Erhard F." <erhard_f@mailbox.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230118-ppc64-elfv2-llvm-v1-1-b9e2ec9da11d@kernel.org


# ff7c76f6 25-Jan-2023 Pali Rohár <pali@kernel.org>

powerpc/boot: Don't always pass -mcpu=powerpc when building 32-bit uImage

When CONFIG_TARGET_CPU is specified then pass its value to the compiler
-mcpu option. This fixes following build error when building kernel with
powerpc e500 SPE capable cross compilers:

BOOTAS arch/powerpc/boot/crt0.o
powerpc-linux-gnuspe-gcc: error: unrecognized argument in option ‘-mcpu=powerpc’
powerpc-linux-gnuspe-gcc: note: valid arguments to ‘-mcpu=’ are: 8540 8548 native
make[1]: *** [arch/powerpc/boot/Makefile:231: arch/powerpc/boot/crt0.o] Error 1

Similar change was already introduced for the main powerpc Makefile in
commit 446cda1b21d9 ("powerpc/32: Don't always pass -mcpu=powerpc to the
compiler").

Fixes: 40a75584e526 ("powerpc/boot: Build wrapper for an appropriate CPU")
Cc: stable@vger.kernel.org # v5.19+
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/2ae3ae5887babfdacc34435bff0944b3f336100a.1674632329.git.christophe.leroy@csgroup.eu


# 110a58b9 27-Aug-2022 Pali Rohár <pali@kernel.org>

powerpc/boot: Explicitly disable usage of SPE instructions

uImage boot wrapper should not use SPE instructions, like kernel itself.
Boot wrapper has already disabled Altivec and VSX instructions but not SPE.
Options -mno-spe and -mspe=no already set when compilation of kernel, but
not when compiling uImage wrapper yet. Fix it.

Cc: stable@vger.kernel.org
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220827134454.17365-1-pali@kernel.org


# 661aa880 08-May-2022 Christophe Leroy <christophe.leroy@csgroup.eu>

powerpc: Add CONFIG_PPC64_ELF_ABI_V1 and CONFIG_PPC64_ELF_ABI_V2

At the time being, we use CONFIG_CPU_LITTLE_ENDIAN and
CONFIG_CPU_BIG_ENDIAN to pass -mabi=elfv1 or elfv2 to
compiler, then define a PPC64_ELF_ABI_v1 or PPC64_ELF_ABI_v2
macro in asm/types.h based on _CALL_ELF define set by the compiler.

Make it more straight forward with a CONFIG option that
is directly usable.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1eca1addbc550167da9841c7340a010d0c4b2200.1652074503.git.christophe.leroy@csgroup.eu


# 40a75584 30-Mar-2022 Joel Stanley <joel@jms.id.au>

powerpc/boot: Build wrapper for an appropriate CPU

Currently the boot wrapper lacks a -mcpu option, so it will be built for
the toolchain's default cpu. This is a problem if the toolchain defaults
to a cpu with newer instructions.

We could wire in TARGET_CPU but instead use the oldest supported option
so the wrapper runs anywhere.

The GCC documentation stays that -mcpu=powerpc64le will give us a
generic 64 bit powerpc machine:

-mcpu=powerpc, -mcpu=powerpc64, and -mcpu=powerpc64le specify pure
32-bit PowerPC (either endian), 64-bit big endian PowerPC and 64-bit
little endian PowerPC architecture machine types, with an appropriate,
generic processor model assumed for scheduling purposes.

So do that for each of the three machines.

This bug was found when building the kernel with a toolchain that
defaulted to powre10, resulting in a pcrel enabled wrapper which fails
to link:

arch/powerpc/boot/wrapper.a(crt0.o): in function `p_base':
(.text+0x150): call to `platform_init' lacks nop, can't restore toc; (toc save/adjust stub)
(.text+0x154): call to `start' lacks nop, can't restore toc; (toc save/adjust stub)
powerpc64le-buildroot-linux-gnu-ld: final link failed: bad value

Even with tha bug worked around the resulting kernel would crash on a
power9 box:

$ qemu-system-ppc64 -nographic -nodefaults -M powernv9 -kernel arch/powerpc/boot/zImage.epapr -serial mon:stdio
[ 7.069331356,5] INIT: Starting kernel at 0x20010020, fdt at 0x3068c628 25694 bytes
[ 7.130374661,3] ***********************************************
[ 7.131072886,3] Fatal Exception 0xe40 at 00000000200101e4 MSR 9000000000000001
[ 7.131290613,3] CFAR : 000000002001027c MSR : 9000000000000001
[ 7.131433759,3] SRR0 : 0000000020010050 SRR1 : 9000000000000001
[ 7.131577775,3] HSRR0: 00000000200101e4 HSRR1: 9000000000000001
[ 7.131733687,3] DSISR: 00000000 DAR : 0000000000000000
[ 7.131905162,3] LR : 0000000020010280 CTR : 0000000000000000
[ 7.132068356,3] CR : 44002004 XER : 00000000

Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
BugLink: https://github.com/linuxppc/issues/issues/400
Link: https://lore.kernel.org/r/20220330112437.540214-1-joel@jms.id.au


# 8d613a1d 30-Apr-2022 Masahiro Yamada <masahiroy@kernel.org>

kbuild: drop $(objtree)/ prefix support for clean-files

I think this hack is a bad idea. arch/powerpc/boot/Makefile is the
only and last user. Let's stop doing this.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)


# 129ab0d2 13-Dec-2021 Masahiro Yamada <masahiroy@kernel.org>

kbuild: do not quote string values in include/config/auto.conf

The previous commit fixed up all shell scripts to not include
include/config/auto.conf.

Now that include/config/auto.conf is only included by Makefiles,
we can change it into a more Make-friendly form.

Previously, Kconfig output string values enclosed with double-quotes
(both in the .config and include/config/auto.conf):

CONFIG_X="foo bar"

Unlike shell, Make handles double-quotes (and single-quotes as well)
verbatim. We must rip them off when used.

There are some patterns:

[1] $(patsubst "%",%,$(CONFIG_X))
[2] $(CONFIG_X:"%"=%)
[3] $(subst ",,$(CONFIG_X))
[4] $(shell echo $(CONFIG_X))

These are not only ugly, but also fragile.

[1] and [2] do not work if the value contains spaces, like
CONFIG_X=" foo bar "

[3] does not work correctly if the value contains double-quotes like
CONFIG_X="foo\"bar"

[4] seems to work better, but has a cost of forking a process.

Anyway, quoted strings were always PITA for our Makefiles.

This commit changes Kconfig to stop quoting in include/config/auto.conf.

These are the string type symbols referenced in Makefiles or scripts:

ACPI_CUSTOM_DSDT_FILE
ARC_BUILTIN_DTB_NAME
ARC_TUNE_MCPU
BUILTIN_DTB_SOURCE
CC_IMPLICIT_FALLTHROUGH
CC_VERSION_TEXT
CFG80211_EXTRA_REGDB_KEYDIR
EXTRA_FIRMWARE
EXTRA_FIRMWARE_DIR
EXTRA_TARGETS
H8300_BUILTIN_DTB
INITRAMFS_SOURCE
LOCALVERSION
MODULE_SIG_HASH
MODULE_SIG_KEY
NDS32_BUILTIN_DTB
NIOS2_DTB_SOURCE
OPENRISC_BUILTIN_DTB
SOC_CANAAN_K210_DTB_SOURCE
SYSTEM_BLACKLIST_HASH_LIST
SYSTEM_REVOCATION_KEYS
SYSTEM_TRUSTED_KEYS
TARGET_CPU
UNUSED_KSYMS_WHITELIST
XILINX_MICROBLAZE0_FAMILY
XILINX_MICROBLAZE0_HW_VER
XTENSA_VARIANT_NAME

I checked them one by one, and fixed up the code where necessary.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 6ffeb56e 11-Oct-2021 Cédric Le Goater <clg@kaod.org>

powerpc/boot: Use CONFIG_PPC_POWERNV to compile OPAL support

CONFIG_PPC64_BOOT_WRAPPER is selected by CPU_LITTLE_ENDIAN which is
used to compile support for other platforms such as Microwatt. There
is no need for OPAL calls on these.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211011070356.99952-1-clg@kaod.org


# 1619b69e 14-Sep-2021 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Fix build failure since GCC 4.9 removal

Stephen reported that the build was broken since commit
6d2ef226f2f1 ("compiler_attributes.h: drop __has_attribute() support for
gcc4"), with errors such as:

include/linux/compiler_attributes.h:296:5: warning: "__has_attribute" is not defined, evaluates to 0 [-Wundef]
296 | #if __has_attribute(__warning__)
| ^~~~~~~~~~~~~~~
make[2]: *** [arch/powerpc/boot/Makefile:225: arch/powerpc/boot/crt0.o] Error 1

But we expect __has_attribute() to always be defined now that we've
stopped using GCC 4.

Linus debugged it to the point of reading the GCC sources, and noticing
that the problem is that __has_attribute() is not defined when
preprocessing assembly files, which is what we're doing here.

Our assembly files don't include, or need, compiler_attributes.h, but
they are getting it unconditionally from the -include in BOOT_CFLAGS,
which is then added in its entirety to BOOT_AFLAGS.

That -include was added in commit 77433830ed16 ("powerpc: boot: include
compiler_attributes.h") so that we'd have "fallthrough" and other
attributes defined for the C files in arch/powerpc/boot. But it's not
needed for assembly files.

The minimal fix is to move the addition to BOOT_CFLAGS of -include
compiler_attributes.h until after we've copied BOOT_CFLAGS into
BOOT_AFLAGS. That avoids including compiler_attributes.h for asm files,
but makes no other change to BOOT_CFLAGS or BOOT_AFLAGS.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Debugged-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# c12adb06 07-Jan-2021 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: retire sbc8548 board support

The support was for this was mainlined 13 years ago, in v2.6.25
[0e0fffe88767] just around the ppc --> powerpc migration.

I believe the board was introduced a year or two before that, so it
is roughly a 15 year old platform - with the CPU speed and memory size
that was typical for that era.

I haven't had one of these boards for several years, and availability
was discontinued several years before that.

Given that, there is no point in adding a burden to testing coverage
that builds all possible defconfigs, so it makes sense to remove it.

Of course it will remain in the git history forever, for anyone who
happens to find a functional board and wants to tinker with it.

Acked-by: Scott Wood <oss@buserror.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 86ff0bce 29-Jul-2021 Masahiro Yamada <masahiroy@kernel.org>

powerpc: move the install rule to arch/powerpc/Makefile

Currently, the install target in arch/powerpc/Makefile descends into
arch/powerpc/boot/Makefile to invoke the shell script, but there is no
good reason to do so.

arch/powerpc/Makefile can run the shell script directly.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210729141937.445051-3-masahiroy@kernel.org


# 9bef456b 29-Jul-2021 Masahiro Yamada <masahiroy@kernel.org>

powerpc: make the install target not depend on any build artifact

The install target should not depend on any build artifact.

The reason is explained in commit 19514fc665ff ("arm, kbuild: make
"make install" not depend on vmlinux").

Change the PowerPC installation code in a similar way.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210729141937.445051-2-masahiroy@kernel.org


# 156ca4e6 29-Jul-2021 Masahiro Yamada <masahiroy@kernel.org>

powerpc: remove unused zInstall target from arch/powerpc/boot/Makefile

Commit c913e5f95e54 ("powerpc/boot: Don't install zImage.* from make
install") added the zInstall target to arch/powerpc/boot/Makefile,
but you cannot use it since the corresponding hook is missing in
arch/powerpc/Makefile.

It has never worked since its addition. Nobody has complained about
it for 7 years, which means this code was unneeded.

With this removal, the install.sh will be passed in with 4 parameters.
Simplify the shell script.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210729141937.445051-1-masahiroy@kernel.org


# 4a21192e 17-Jun-2021 Joel Stanley <joel@jms.id.au>

powerpc/boot: Add a boot wrapper for Microwatt

This allows microwatt's kernel to be built with an embedded device tree.

Load to arch/powerpc/boot/dtbImage.microwatt to 0x500000:

mw_debug -b fpga stop load arch/powerpc/boot/dtbImage.microwatt 500000 start

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/YMwX19wym3kQ7guu@thinks.paulus.ozlabs.org


# 710e6822 11-Jun-2021 Nicholas Piggin <npiggin@gmail.com>

powerpc/boot: add zImage.lds to targets

This prevents spurious rebuilds of the lds and then wrappers.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210611111104.1058991-1-npiggin@gmail.com


# b36f835b 14-Dec-2020 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Fix build of dts/fsl

The lkp robot reported that some configs fail to build, for example
mpc85xx_smp_defconfig, with:

cc1: fatal error: opening output file arch/powerpc/boot/dts/fsl/.mpc8540ads.dtb.dts.tmp: No such file or directory

This bisects to:
cc8a51ca6f05 ("kbuild: always create directories of targets")

Although that commit claims to be about in-tree builds, it somehow
breaks out-of-tree builds. But presumably it's just exposing a latent
bug in our Makefiles.

We can fix it by adding to targets for dts/fsl in the same way that we
do for dts.

Fixes: cc8a51ca6f05 ("kbuild: always create directories of targets")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201215032906.473460-1-mpe@ellerman.id.au


# 215fadfe 20-Nov-2020 Bill Wendling <morbo@google.com>

powerpc/boot: Use clang when CC is clang

The gcc compiler may not be available if CC is clang.

Signed-off-by: Bill Wendling <morbo@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201120224034.191382-3-morbo@google.com


# 77433830 15-Nov-2020 Nick Desaulniers <ndesaulniers@google.com>

powerpc: boot: include compiler_attributes.h

The kernel uses `-include` to include include/linux/compiler_types.h
into all translation units (see scripts/Makefile.lib), which #includes
compiler_attributes.h.

arch/powerpc/boot/ uses different compiler flags from the rest of the
kernel. As such, it doesn't contain the definitions from these headers,
and redefines a few that it needs.

For the purpose of enabling -Wimplicit-fallthrough for ppc, include
compiler_attributes.h via `-include`.

It was also noted in 6a9dc5fd6170 that we could -D__KERNEL__ and
-include compiler_types.h like the main kernel does, though testing that
produces a whole sea of warnings to cleanup. This approach is minimally
invasive. And it also helps to entice a cleanup.

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://github.com/ClangBuiltLinux/linux/issues/236
[ Gustavo: Massage a bit as per Miguel's suggestion. ]
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# 364b236a 24-Aug-2020 Jordan Niethe <jniethe5@gmail.com>

powerpc/boot: Update Makefile comment for 64bit wrapper

As of commit 147c05168fc8 ("powerpc/boot: Add support for 64bit little
endian wrapper") the comment in the Makefile is misleading. The wrapper
packaging 64bit kernel may built as a 32 or 64 bit elf. Update the
comment to reflect this.

Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200825035147.3239-1-jniethe5@gmail.com


# e5eff896 24-Jul-2020 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Fix CONFIG_PPC_MPC52XX references

Commit 866bfc75f40e ("powerpc: conditionally compile platform-specific
serial drivers") made some code depend on CONFIG_PPC_MPC52XX, which
doesn't exist.

Fix it to use CONFIG_PPC_MPC52xx.

Fixes: 866bfc75f40e ("powerpc: conditionally compile platform-specific serial drivers")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200724131728.1643966-7-mpe@ellerman.id.au


# 1bca5440 13-Jul-2020 Masahiro Yamada <masahiroy@kernel.org>

powerpc/boot: add DTB to 'targets'

PowerPC always re-builds DTB even if nothing has been changed.

As for other architectures, arch/*/boot/dts/Makefile builds DTB by
using the dtb-y syntax.

In contrast, arch/powerpc/boot/dts/(fsl/)Makefile does nothing unless
CONFIG_OF_ALL_DTBS is defined. Instead, arch/powerpc/boot/Makefile
builds DTB on demand. You need to add DTB to 'targets' explicitly
so .*.cmd files are included.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>


# 548ad77d 22-Dec-2016 Imre Kaloz <kaloz@openwrt.org>

powerpc/4xx: ppc4xx compile flag optimizations

This patch splits up the compile flags between ppc40x and ppc44x.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1482393968-60623-1-git-send-email-john@phrozen.org


# 548f5244 21-May-2020 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc/40x: Remove EP405

EP405 is an old type of board based on a 405GP which is obsolete.

Remove it.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/e9534caa51f327c841b3db5f48043a47ad70d246.1590079968.git.christophe.leroy@csgroup.eu


# 5786074b 21-May-2020 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc/40x: Remove WALNUT

CONFIG_WALNUT is not selected by any config and is based
on 405GP which is obsolete.

Remove it.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/ab46013d8d33346af68faf30a719a586c3befad9.1590079968.git.christophe.leroy@csgroup.eu


# 7ade8495 21-May-2020 Michal Simek <michal.simek@xilinx.com>

powerpc: Remove Xilinx PPC405/PPC440 support

The latest Xilinx design tools called ISE and EDK has been released in
October 2013. New tool doesn't support any PPC405/PPC440 new designs.
These platforms are no longer supported and tested.

PowerPC 405/440 port is orphan from 2013 by
commit cdeb89943bfc ("MAINTAINERS: Fix incorrect status tag") and
commit 19624236cce1 ("MAINTAINERS: Update Grant's email address and maintainership")
that's why it is time to remove the support fot these platforms.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/8c593895e2cb57d232d85ce4d8c3a1aa7f0869cc.1590079968.git.christophe.leroy@csgroup.eu


# d42c6d0f 18-Feb-2020 Michael Ellerman <mpe@ellerman.id.au>

powerpc/Makefile: Mark phony targets as PHONY

Some of our phony targets are not marked as such. This can lead to
confusing errors, eg:

$ make clean
$ touch install
$ make install
make: 'install' is up to date.
$

Fix it by adding them to the PHONY variable which is marked phony in
the top-level Makefile, or in scripts/Makefile.build for the boot
Makefile.

Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200219000434.15872-1-mpe@ellerman.id.au


# 5f2fb52f 01-Feb-2020 Masahiro Yamada <masahiroy@kernel.org>

kbuild: rename hostprogs-y/always to hostprogs/always-y

In old days, the "host-progs" syntax was used for specifying host
programs. It was renamed to the current "hostprogs-y" in 2004.

It is typically useful in scripts/Makefile because it allows Kbuild to
selectively compile host programs based on the kernel configuration.

This commit renames like follows:

always -> always-y
hostprogs-y -> hostprogs

So, scripts/Makefile will look like this:

always-$(CONFIG_BUILD_BIN2C) += ...
always-$(CONFIG_KALLSYMS) += ...
...
hostprogs := $(always-y) $(always-m)

I think this makes more sense because a host program is always a host
program, irrespective of the kernel configuration. We want to specify
which ones to compile by CONFIG options, so always-y will be handier.

The "always", "hostprogs-y", "hostprogs-m" will be kept for backward
compatibility for a while.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 13dc8c02 21-Sep-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: remove ar-option and KBUILD_ARFLAGS

Commit 40df759e2b9e ("kbuild: Fix build with binutils <= 2.19")
introduced ar-option and KBUILD_ARFLAGS to deal with old binutils.

According to Documentation/process/changes.rst, the current minimal
supported version of binutils is 2.21 so you can assume the 'D' option
is always supported. Not only GNU ar but also llvm-ar supports it.

With the 'D' option hard-coded, there is no more user of ar-option
or KBUILD_ARFLAGS.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>


# 4ba7f80f 05-Jul-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

powerpc/boot: pass CONFIG options in a simpler and more robust way

Commit 5e9dcb6188a4 ("powerpc/boot: Expose Kconfig symbols to wrapper")
was wrong, but commit e41b93a6be57 ("powerpc/boot: Fix build failures
with -j 1") was also wrong.

The correct dependency is:

$(obj)/serial.o: $(obj)/autoconf.h

However, I do not see the reason why we need to copy autoconf.h to
arch/power/boot/. Nor do I see consistency in the way of passing
CONFIG options.

decompress.c references CONFIG_KERNEL_GZIP and CONFIG_KERNEL_XZ, which
are passed via the command line.

serial.c includes autoconf.h to reference a couple of CONFIG options,
but this is fragile because we often forget to include "autoconf.h"
from source files.

In fact, it is already broken.

ppc_asm.h references CONFIG_PPC_8xx, but utils.S is not given any way
to access CONFIG options. So, CONFIG_PPC_8xx is never defined here.

Pass $(LINUXINCLUDE) to make sure CONFIG options are accessible from
all .c and .S files in arch/powerpc/boot/.

I also removed the -traditional flag to make include/linux/kconfig.h
work. This flag makes the preprocessor imitate the behavior of the
pre-standard C compiler, but I do not understand why it is necessary.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190705100144.28785-2-yamada.masahiro@socionext.com


# 264bffad 14-Jun-2019 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc/boot: Add lzo support for uImage

This patch allows to generate lzo compressed uImage

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 1cc9a21b 14-Jun-2019 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc/boot: Add lzma support for uImage

This patch allows to generate lzma compressed uImage

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# afa974b7 17-Jan-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: add real-prereqs shorthand for $(filter-out FORCE,$^)

In Kbuild, if_changed and friends must have FORCE as a prerequisite.

Hence, $(filter-out FORCE,$^) or $(filter-out $(PHONY),$^) is a common
idiom to get the names of all the prerequisites except phony targets.

Add real-prereqs as a shorthand.

Note:
We cannot replace $(filter %.o,$^) in cmd_link_multi-m because $^ may
include auto-generated dependencies from the .*.cmd file when a single
object module is changed into a multi object module. Refer to commit
69ea912fda74 ("kbuild: remove unneeded link_multi_deps"). I added some
comment to avoid accidental breakage.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Rob Herring <robh@kernel.org>


# e41b93a6 03-Dec-2018 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Fix build failures with -j 1

In commit 5e9dcb6188a4 ("powerpc/boot: Expose Kconfig symbols to
wrapper") we added a dependency to serial.c on autoconf.h:

$(obj)/serial.c: $(obj)/autoconf.h

This works when building in-tree (ie. with KBUILD_OUTPUT unset)
because the obj tree is the src tree.

But when building with eg. O=build and -j 1 the build fails:

gcc ... -I../arch/powerpc/boot -c -o arch/powerpc/boot/serial.o arch/powerpc/boot/serial.c
gcc: error: arch/powerpc/boot/serial.c: No such file or directory

Why this is only happening with -j 1 is not clear, when building with
-j greater than 1 somehow we decide to look for serial.c in the src
tree (../), eg:

gcc -I../arch/powerpc/boot -c -o arch/powerpc/boot/serial.o ../arch/powerpc/boot/serial.c

Regardless we shouldn't be specifying a dependency on serial.c in the
build tree, we want to add a dependency to the version in $(srctree)
so fix the rule to say that.

Fixes: 5e9dcb6188a4 ("powerpc/boot: Expose Kconfig symbols to wrapper")
Tested-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 813af51f 11-Nov-2018 Joel Stanley <joel@jms.id.au>

powerpc/boot: Set target when cross-compiling for clang

Clang needs to be told which target it is building for when cross
compiling.

Link: https://github.com/ClangBuiltLinux/linux/issues/259
Signed-off-by: Joel Stanley <joel@jms.id.au>
Tested-by: Daniel Axtens <dja@axtens.net> # powerpc 64-bit BE
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 747b2176 09-Oct-2018 Joel Stanley <joel@jms.id.au>

powerpc/boot: Build boot wrapper with optimisations

The boot wrapper is currently built with -Os. By building with O2 we
can meaningfully reduce the time decompressing the kernel.

I tested by comparing 10 runs of each option in Qemu and on hardware.
The kernel is compressed with KERNEL_XZ built with GCC 8.2.0-7ubuntu1.
The values are counts of the timebase.

Qemu TCG powernv Power8:

Os O2 O3
median 10221123889 6201518438 6568186825
stddev 1361267211 429090641 657930076
improvement 39.33% 35.74%

Palmetto Power8:

Os O2 O3
median 50279 50599 35790
stddev 992144533 627130655 623721078
improvement 36.79% 37.13%

Romulus Power9:

Os O2 O3
median 670312391 454733720 448881398
stddev 157569 107276 108760
improvement 32.16% 33.03%

TCG was quite noisy, with every few runs producing an outlier. Even so,
O2 is faster than O3. On hardware the numbers were less noisy and O3 is
slightly faster than O2.

The wrapper size increases when moving from Os. Comparing zImage.epapr
to the existing Os build using bloat-o-meter:

Before=43401, After=56837 (13KB), chg +30.96%
Before=43401, After=64305 (20KB), chg +48.16%

I chose O2 for a balance between Qemu and hardware speed up.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# e8e132e6 09-Oct-2018 Joel Stanley <joel@jms.id.au>

powerpc/boot: Disable vector instructions

This will avoid auto-vectorisation when building with higher
optimisation levels.

We don't know if the machine can support VSX and even if it's present
it's probably not going to be enabled at this point in boot.

These flag were both added prior to GCC 4.6 which is the minimum
compiler version supported by upstream, thanks to Segher for the
details.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 5e9dcb61 09-Oct-2018 Joel Stanley <joel@jms.id.au>

powerpc/boot: Expose Kconfig symbols to wrapper

Currently the wrapper is built without including anything in
$(src)/include/, which means there are no CONFIG_ symbols defined.
This means the platform specific serial drivers were never enabled.

We now copy the definitions into the boot directory, so any C file can
now include autoconf.h to depend on configuration options.

Fixes: 866bfc75f40e ("powerpc: conditionally compile platform-specific serial drivers")
Signed-off-by: Joel Stanley <joel@jms.id.au>
[mpe: Fix to use $(objtree) to find autoconf.h]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 1acf1cf8 13-Oct-2015 Rob Herring <robh@kernel.org>

powerpc: build .dtb files in dts directory

Align powerpc with other architectures which build the dtb files in the
same directory as the dts files. This is also in line with most other
build targets which are located in the same directory as the source.
This move will help enable the 'dtbs' target which builds all the dtbs
regardless of kernel config.

This transition could break some scripts if they expect dtb files in the
old location.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Rob Herring <robh@kernel.org>


# badf436f 06-Aug-2018 Rodrigo R. Galvao <rosattig@linux.vnet.ibm.com>

powerpc/Makefiles: Convert ifeq to ifdef where possible

In Makefiles if we're testing a CONFIG_FOO symbol for equality with 'y'
we can instead just use ifdef. The latter reads easily, so convert to
it where possible.

Signed-off-by: Rodrigo R. Galvao <rosattig@linux.vnet.ibm.com>
Reviewed-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 297f8314 05-Apr-2018 Mark Greer <mgreer@animalcreek.com>

powerpc/boot: Remove core support for Marvell mv64x60 hostbridges

There are no longer any platforms that use Marvell's mv64x60
hostbridges so remove the supporting boot code.

Signed-off-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 6bf17a83 05-Apr-2018 Mark Greer <mgreer@animalcreek.com>

powerpc/boot: Remove support for Marvell mv64x60 i2c controller

There are no longer any platforms that use Marvell's mv64x60's i2c
controller so remove its driver.

Signed-off-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Mark Greer &lt;<a href="mailto:mgreer@animalcreek.com">mgreer@animalcreek.com</a>&gt;<br>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 30f4bbe0 05-Apr-2018 Mark Greer <mgreer@animalcreek.com>

powerpc/boot: Remove support for Marvell MPSC serial controller

There are no longer any platforms that use Marvell's MPSC serial
controller so remove its driver.

Signed-off-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 92c8c16f 05-Apr-2018 Mark Greer <mgreer@animalcreek.com>

powerpc/embedded6xx: Remove C2K board support

The C2K platform appears to be orphaned so remove code supporting it.

CC: Remi Machet <rmachet@nvidia.com>
Signed-off-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Remi Machet <remi@machet.us>
Signed-off-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# af3901cb 30-May-2018 Nicholas Piggin <npiggin@gmail.com>

powerpc/kbuild: Remove CROSS32 defines from top level powerpc Makefile

Switch VDSO32 build over to use CROSS32_COMPILE directly, and have
it pass in -m32 after the standard c_flags. This allows endianness
overrides to be removed and the endian and bitness flags moved into
standard flags variables.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 64c3f648 23-Feb-2018 Guenter Roeck <linux@roeck-us.net>

powerpc/boot: Fix random libfdt related build errors

Once in a while I see build errors similar to the following
when building images from a clean tree.

Building powerpc:virtex-ml507:44x/virtex5_defconfig ... failed
------------
Error log:
arch/powerpc/boot/treeboot-akebono.c:37:20: fatal error:
libfdt.h: No such file or directory

Building powerpc:bamboo:smpdev:44x/bamboo_defconfig ... failed
------------
Error log:
arch/powerpc/boot/treeboot-akebono.c:37:20: fatal error:
libfdt.h: No such file or directory

arch/powerpc/boot/treeboot-currituck.c:35:20: fatal error:
libfdt.h: No such file or directory

Rebuilds will succeed.

Turns out that several source files in arch/powerpc/boot/ include
libfdt.h, but Makefile dependencies are incomplete. Let's fix that.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# c3bb690d 08-Nov-2017 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Only build CPM code when necessary

As far as I can tell CONFIG_CPM is the right symbol to use to
conditionally compile the cpm-serial.c code.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# f8e8e69c 08-Nov-2017 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Only build OPAL code when necessary

Only build the OPAL console code in when necessary. This looks like it
should use CONFIG_PPC_POWERNV, but because the opal-call.S code is
64-bit only, we must only build it when we're building the boot
wrapper 64-bit.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 3d6bf693 08-Nov-2017 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Only build uartlite if XILINX_VIRTEX=y

The serial code in uartlite.c only matches if we find one of two
Xilinx (xlnx) nodes in the device tree, there's no need to build or
link the code on other platforms.

As far as I can tell CONFIG_XILINX_VIRTEX is the appropriate symbol to
use to conditionally compile the code.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 74ce1896 01-Nov-2017 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: clean up *.dtb and *.dtb.S patterns from top-level Makefile

We need to add "clean-files" in Makfiles to clean up DT blobs, but we
often miss to do so.

Since there are no source files that end with .dtb or .dtb.S, so we
can clean-up those files from the top-level Makefile.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Herring <robh@kernel.org>


# b2441318 01-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

License cleanup: add SPDX GPL-2.0 license identifier to files with no license

Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.

By default all files without license information are under the default
license of the kernel, which is GPL version 2.

Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.

How this work was done:

Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,

Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.

The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.

The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.

Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).

All documentation files were explicitly excluded.

The following heuristics were used to determine which SPDX license
identifiers to apply.

- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.

For non */uapi/* files that summary was:

SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139

and resulted in the first patch in this series.

If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:

SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930

and resulted in the second patch in this series.

- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:

SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1

and that resulted in the third patch in this series.

- when the two scanners agreed on the detected license(s), that became
the concluded license(s).

- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.

- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).

- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.

- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.

In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.

Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.

Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.

In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.

Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct

This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.

These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 866bfc75 27-Jun-2017 Hannes Reinecke <hare@suse.de>

powerpc: conditionally compile platform-specific serial drivers

mpsc.c and mpc52xx-psc.c are platform-specific serial drivers, and
should be compiled for the respective platforms only.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Torsten Duwe <duwe@suse.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 968159c0 08-Aug-2017 Christophe Leroy <christophe.leroy@c-s.fr>

powerpc/8xx: Getting rid of remaining use of CONFIG_8xx

Two config options exist to define powerpc MPC8xx:
* CONFIG_PPC_8xx
* CONFIG_8xx

arch/powerpc/platforms/Kconfig.cputype has contained the following
comment about CONFIG_8xx item for some years:
"# this is temp to handle compat with arch=ppc"

arch/powerpc is now the only place with remaining use of
CONFIG_8xx: get rid of them.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 65c5ec11 26-Jul-2017 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Fix 64-bit boot wrapper build with non-biarch compiler

Historically the boot wrapper was always built 32-bit big endian, even
for 64-bit kernels. That was because old firmwares didn't necessarily
support booting a 64-bit image. Because of that arch/powerpc/boot/Makefile
uses CROSS32CC for compilation.

However when we added 64-bit little endian support, we also added
support for building the boot wrapper 64-bit. However we kept using
CROSS32CC, because in most cases it is just CC and everything works.

However if the user doesn't specify CROSS32_COMPILE (which no one ever
does AFAIK), and CC is *not* biarch (32/64-bit capable), then CROSS32CC
becomes just "gcc". On native systems that is probably OK, but if we're
cross building it definitely isn't, leading to eg:

gcc ... -m64 -mlittle-endian -mabi=elfv2 ... arch/powerpc/boot/cpm-serial.c
gcc: error: unrecognized argument in option ‘-mabi=elfv2’
gcc: error: unrecognized command line option ‘-mlittle-endian’
make: *** [zImage] Error 2

To fix it, stop using CROSS32CC, because we may or may not be building
32-bit. Instead setup a BOOTCC, which defaults to CC, and only use
CROSS32_COMPILE if it's set and we're building for 32-bit.

Fixes: 147c05168fc8 ("powerpc/boot: Add support for 64bit little endian wrapper")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Cyril Bur <cyrilbur@gmail.com>


# 7c868b66 11-May-2017 Nicholas Piggin <npiggin@gmail.com>

powerpc/64: Do not link crtsaveres.o in boot

crtsaveres.S is empty with 64-bit builds already, so just don't
build and link it to match the vmlinux build.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Use CONFIG_PPC64_BOOT_WRAPPER not CONFIG_PPC32 to fix BE build]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# f0f7fe1a 21-Nov-2016 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Fix rebuild when changing kernel endian

Now that we don't set ARCH incorrectly when calling the boot Makefile,
we can use the generic cpp_lds_S rule for converting our zImage.lds.S
into zImage.lds.

The main advantage of using the generic rule is that it correctly uses
if_changed, which means we correctly regenerate the linker script when
switching endian. Fixing that means we are finally able to build one
endian and then rebuild the other endian without requiring to clean
between builds.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 42d0c932 21-Nov-2016 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: All uses of if_changed should depend on FORCE

If we're using if_changed then we must depend on FORCE, so that
if_changed gets a chance to check if something changed.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 10c77dba 16-Nov-2016 Ben Hutchings <ben@decadent.org.uk>

powerpc/boot: Fix build failure in 32-bit boot wrapper

OPAL is not callable from 32-bit mode and the assembly code for it
may not even build (depending on how binutils was configured).

References: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=powerpcspe&ver=4.8.7-1&stamp=1479203712
Fixes: 656ad58ef19e ("powerpc/boot: Add OPAL console to epapr wrappers")
Cc: stable@vger.kernel.org # v4.8+
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


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

powerpc/boot: Add support for XZ compression

This patch adds an option to use XZ compression for the kernel image.

Currently this is only enabled for 64-bit Book3S targets, which is
roughly equivalent to the platforms that use the kernel's zImage
wrapper, and that have been tested.

The bulk of the 32-bit platforms and 64-bit BookE use uboot images,
which relies on uboot implementing XZ. In future we can enable XZ
support for those targets once someone has tested it.

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


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

powerpc/boot: Add XZ support to the wrapper script

This modifies the wrapper script so that the -Z option takes an argument
to specify the compression type. It can either be 'gz', 'xz' or 'none'.

The legazy --no-gzip and -z options are still supported and will set the
compression to none and gzip respectively, but they are not documented.

Only XZ -6 is used for compression rather than XZ -9. Using compression
levels higher than 6 requires the decompressor to build a large (64MB)
dictionary when decompressing and some environments cannot satisfy such
large allocations (e.g. POWER 6 LPAR partition firmware).

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


# 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 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>


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

powerpc/boot: Use CONFIG_KERNEL_GZIP

Most architectures allow the compression algorithm used to produced the
vmlinuz image to be selected as a kernel config option. In preperation
for supporting algorithms other than gzip in the powerpc boot wrapper
the makefile needs to be modified to use these config options.

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


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

powerpc/boot: Add sed script

The powerpc boot wrapper is potentially compiled with a separate
toolchain and/or toolchain flags than the rest of the kernel. The usual
case is a 64-bit big endian kernel builds a 32-bit big endian wrapper.

The main problem with this is that the wrapper does not have access to
the kernel headers (without a lot of gross hacks). To get around this
the required headers are copied into the build directory via several sed
scripts which rewrite problematic includes. This patch moves these
fixups out of the makefile into a separate .sed script file to clean up
makefile slightly.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
[mpe: Reword first paragraph of change log a little]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 6abe248e 11-Aug-2016 Michael Ellerman <mpe@ellerman.id.au>

powerpc/boot: Use $(Q) to quiet build rules not @

Some of the rules in the boot Makefile use @ to hide the command, this
means "make V=1" doesn't show them, which is confusing.

So use the Kbuild standard $(Q) which means KBUILD_VERBOSE=1 or V=1 will
work as expected.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 58ab5e0c 15-Jun-2016 Arnd Bergmann <arnd@arndb.de>

Kbuild: arch: look for generated headers in obtree

There are very few files that need add an -I$(obj) gcc for the preprocessor
or the assembler. For C files, we add always these for both the objtree and
srctree, but for the other ones we require the Makefile to add them, and
Kbuild then adds it for both trees.

As a preparation for changing the meaning of the -I$(obj) directive to
only refer to the srctree, this changes the two instances in arch/x86 to use
an explictit $(objtree) prefix where needed, otherwise we won't find the
headers any more, as reported by the kbuild 0day builder.

arch/x86/realmode/rm/realmode.lds.S:75:20: fatal error: pasyms.h: No such file or directory

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michal Marek <mmarek@suse.com>


# 97493e2e 30-May-2016 Alessio Igor Bogani <alessio.bogani@elettra.eu>

powerpc/86xx: Add support for Emerson/Artesyn MVME7100

Add support for the Artesyn MVME7100 Single Board Computer.

The MVME7100 is a 6U form factor VME64 computer with:

- A two e600 cores Freescale MPC8641D CPU
- 2 GB of DDR2 onboard memory
- Four Gigabit Ethernets
- Five 16550 compatible UARTs
- One USB 2.0 port
- Two PCI/PCI eXpress Mezzanine Card (PMC/XMC) Slots
- A DS1375 Real Time Clock (RTC)
- 512 KB of Non-Volatile Memory (NVRAM)
- Two 64 KB EEPROMs
- 128 MB NOR and 4/8 GB NAND Flash

This patch is based on linux-4.7-rc1 and has been only boot tested.

Limitations:
This patch covers only models 171 and 173
No plans to support CPLD timers

Know issues:
All four PHYs work in polling mode

Configuration is missing for:
PCI IDSEL and PCI Interrupt definition

Support is missing for:
Cache and memory controllers (which are very similar to the 85xx ones
but right now I don't know if we can re-use their support)
Watchdog, USB, NVRAM, NOR, NAND, EEPROMs, VME, PMC/XMC and RTC

Signed-off-by: Alessio Igor Bogani <alessio.bogani@elettra.eu>
Signed-off-by: Scott Wood <oss@buserror.net>


# 656ad58e 30-Jun-2016 Oliver O'Halloran <oohall@gmail.com>

powerpc/boot: Add OPAL console to epapr wrappers

This patch adds an OPAL console backend to the powerpc boot wrapper so
that decompression failures inside the wrapper can be reported to the
user. This is important since it typically indicates data corruption in
the firmware and other nasty things.

Currently this only works when building a little endian kernel. When
compiling a 64 bit BE kernel the wrapper is always build 32 bit to be
compatible with some 32 bit firmwares. BE support will be added at a
later date. Another limitation of this is that only the "raw" type of
OPAL console is supported, however machines that provide a hvsi console
also provide a raw console so this is not an issue in practice.

Actually-written-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
[mpe: Move #ifdef __powerpc64__ to avoid warnings on 32-bit]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 4680c9d5 18-Apr-2016 Alessio Igor Bogani <alessio.bogani@elettra.eu>

powerpc/fsl: Fix build of the dtb embedded kernel images

Commit dc37374b9c833 ("powerpc/fsl: Move Freescale device tree files
into fsl folder") moved a lot of device tree files into fsl directory,
fixing Makefile for cuImage target only. Unfortunately there are other
targets which require embedding a device tree into the kernel image
(e.g. dtbImage.%). So use a more generic approach.

Signed-off-by: Alessio Igor Bogani <alessio.bogani@elettra.eu>
[scottwood: cleaned up commit message]
Signed-off-by: Scott Wood <oss@buserror.net>


# 24ad1648 30-Nov-2015 Rashmica Gupta <rashmicy@gmail.com>

powerpc/cell: Remove the Cell QPACE code

All users of QPACE have upgraded to QPACE2 so remove the Cell QPACE code.

Signed-off-by: Rashmica Gupta <rashmicy@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# dc37374b 17-Sep-2015 Hongtao Jia <hongtao.jia@freescale.com>

powerpc/fsl: Move Freescale device tree files into fsl folder

It makes no sense that some Freescale device tree files are in fsl
directory while some others not. This patch move Freescale device tree
files into fsl folder. To do that the following two steps are made:
- Move Freescale device tree files into fsl folder.
- Update the include path in these files from "fsl/*.dtsi" to "*.dtsi".

Please add "fsl/" prefix when you make dtb using Makefile.

Signed-off-by: Jia Hongtao <hongtao.jia@freescale.com>
[scottwood: fixed cuImage rule]
Signed-off-by: Scott Wood <scottwood@freescale.com>


# 655471f5 14-Sep-2015 Benjamin Herrenschmidt <benh@kernel.crashing.org>

powerpc/boot: Specify ABI v2 when building an LE boot wrapper

The kernel does it, not the boot wrapper, which breaks with some
cross compilers that still default to ABI v1.

Fixes: 147c05168fc8 ("powerpc/boot: Add support for 64bit little endian wrapper")
Cc: stable@vger.kernel.org # v3.16+
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# bf4981a0 18-Mar-2015 Michael Ellerman <mpe@ellerman.id.au>

powerpc: Remove the celleb support

The celleb code has seen no actual development for ~7 years.

We (maintainers) have no access to test hardware, and it is highly
likely the code has bit-rotted.

As far as we're aware the hardware was never widely available, and is
certainly no longer available, and no one on the list has shown any
interest in it over the years.

So remove it. If anyone has one and cares please speak up.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Jeremy Kerr <jk@ozlabs.org>


# 755457f9 02-Oct-2014 Michal Marek <mmarek@suse.cz>

powerpc/boot: Makefile cleanup

The $(image-n) variable will never exist, because unset Kconfig options
are '' and not 'n'.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# c913e5f9 14-Aug-2014 Tony Breeds <tony@bakeyournoodle.com>

powerpc/boot: Don't install zImage.* from make install

in commit 29f1aff2c (powerpc: Copy bootable images in the default
install script) we changed to copying all the built boot targets based
on the assumption that it's backwards compatible. It turns out that
debian devived installkernel scripts will barf if not given exactly 4
args.

This change reverts make install to just install the vmlinux (we can
change the dfault in a seperate patch) and introduces a new make
zInstall which works with a more flexible installkernel script.

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# 699c659b 11-Jun-2014 Michal Marek <mmarek@suse.cz>

powerpc: Avoid circular dependency with zImage.%

The rule to create the final images uses a zImage.% pattern.
Unfortunately, this also matches the names of the zImage.*.lds linker
scripts, which appear as a dependency of the final images. This somehow
worked when $(srctree) used to be an absolute path, but now the pattern
matches too much. List only the images from $(image-y) as the target of
the rule, to avoid the circular dependency.

Reported-and-tested-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 2a2c74b2 05-Mar-2014 Alistair Popple <alistair@popple.id.au>

IBM Akebono: Add the Akebono platform

This patch adds support for the IBM Akebono board.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 147c0516 24-Apr-2014 Cédric Le Goater <clg@fr.ibm.com>

powerpc/boot: Add support for 64bit little endian wrapper

The code is only slightly modified : entry points now use the
FIXUP_ENDIAN trampoline to switch endian order. The 32bit wrapper
is kept for big endian kernels and 64bit is enforced for little
endian kernels with a PPC64_BOOT_WRAPPER config option.

The linker script is generated using the kernel preprocessor flags
to make use of the CONFIG_* definitions and the wrapper script is
modified to take into account the new elf64ppc format.

Finally, the zImage file is compiled as a position independent
executable (-pie) which makes it loadable at any address by the
firmware.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 2d9afb36 24-Apr-2014 Cédric Le Goater <clg@fr.ibm.com>

powerpc/boot: Add a global entry point for pseries

When entering the boot wrapper in little endian, we will need to fix
the endian order using a fixup trampoline like in the kernel. This
patch overrides the _zimage_start entry point for this purpose.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 3c8464a9 05-Feb-2014 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: Delete old PrPMC 280/2800 support

This processor/memory module was mostly used on ATCA blades and
before that, on cPCI blades. It wasn't really user friendly, with
custom non u-boot bootloaders (powerboot/motload) and no real way
to recover corrupted boot flash (which was a common problem).

As such, it had its day back before the big ppc --> powerpc move
to device trees, and that was largely through commercial BSPs that
started to dry up around 2007.

Systems using one were largely in a "deploy and sustain" mode,
so interest in upgrading to new kernels in the field was nil.
Also, requiring 50A, 48V power supplies and a 2'x2'x2' ATCA
chassis largely rules out any hobbyist/enthusiast interest.

The point of all this, is that we might as well delete the in
kernel files relating to this platform. No point in continuing
to build it via walking the defconfigs or via linux-next testing.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 78f3d050 09-Jan-2014 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: fix 8xx and 6xx final link failures

As of commit b81f18e55e9f4ea81759bcb00fea295de679bbe8 ("powerpc/boot:
Only build board support files when required.") the two defconfigs
ep88xc_defconfig and storcenter_defconfig would fail final link as
follows:

WRAP arch/powerpc/boot/dtbImage.ep88xc
arch/powerpc/boot/wrapper.a(mpc8xx.o): In function `mpc885_get_clock':
arch/powerpc/boot/mpc8xx.c:30: undefined reference to `fsl_get_immr'
make[1]: *** [arch/powerpc/boot/dtbImage.ep88xc] Error 1

...and...

WRAP arch/powerpc/boot/cuImage.storcenter
arch/powerpc/boot/cuboot-pq2.o: In function `pq2_platform_fixups':
cuboot-pq2.c:(.text+0x324): undefined reference to `fsl_get_immr'
make[1]: *** [arch/powerpc/boot/cuImage.storcenter] Error 1

We need the fsl-soc board files built for these two platforms.

Cc: Tony Breeds <tony@bakeyournoodle.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Fixes: b81f18e55e9f ("powerpc/boot: Only build board support files when required.")
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>


# be201981 08-Jan-2014 Stephen Chivers <schivers@mandarin.aust.csc.com>

powerpc/embedded6xx: Add support for Motorola/Emerson MVME5100

Add support for the Motorola/Emerson MVME5100 Single Board Computer.

The MVME5100 is a 6U form factor VME64 computer with:

- A single MPC7410 or MPC750 CPU
- A HAWK Processor Host Bridge (CPU to PCI) and
MultiProcessor Interrupt Controller (MPIC)
- Up to 500Mb of onboard memory
- A M48T37 Real Time Clock (RTC) and Non-Volatile Memory chip
- Two 16550 compatible UARTS
- Two Intel E100 Fast Ethernets
- Two PCI Mezzanine Card (PMC) Slots
- PPCBug Firmware

The HAWK PHB/MPIC is compatible with the MPC10x devices.

There is no onboard disk support. This is usually provided by installing a PMC
in first PMC slot.

This patch revives the board support, it was present in early 2.6
series kernels. The board support in those days was by Matt Porter of
MontaVista Software.

CSC Australia has around 31 of these boards in service. The kernel in use
for the boards is based on 2.6.31. The boards are operated without disks
from a file server.

This patch is based on linux-3.13-rc2 and has been boot tested.

Only boards with 512 Mb of memory are known to work.

Signed-off-by: Stephen Chivers <schivers@csc.com>
Tested-by: Alessio Igor Bogani <alessio.bogani@elettra.eu>
Signed-off-by: Scott Wood <scottwood@freescale.com>


# d72b0801 22-Sep-2013 Ian Munsie <imunsie@au1.ibm.com>

powerpc: Add ability to build little endian kernels

This patch allows the kbuild system to successfully compile a kernel
for the little endian PowerPC64 architecture. A subsequent patch
will add the CONFIG_CPU_LITTLE_ENDIAN kernel config option which
must be set to build such a kernel.

If cross compiling, CROSS_COMPILE must point to a suitable toolchain
(compiled for the powerpc64le-linux and powerpcle-linux targets).

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 0c9fa291 24-Sep-2013 Benjamin Herrenschmidt <benh@kernel.crashing.org>

powerpc/zImage: make the "OF" wrapper support ePAPR boot

This makes the "OF" zImage wrapper (zImage.pseries, zImage.pmac,
zImage.maple) work if booted via a flat device-tree (ePAPR boot
mode), and thus potentially usable with kexec.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 0090e02b 06-Sep-2012 Matthew McClintock <msm@freescale.com>

powerpc: Fix build dependencies for c files requiring libfdt.h

Several files in obj-plat depend on libfdt header file. Sometimes
when building one can see the following issue. This patch adds
libfdt as dependency to those object files

| In file included from arch/powerpc/boot/treeboot-iss4xx.c:33:0:
| arch/powerpc/boot/libfdt.h:854:1: error: unterminated comment
| In file included from arch/powerpc/boot/treeboot-iss4xx.c:33:0:
| arch/powerpc/boot/libfdt.h:1:0: error: unterminated #ifndef
| BOOTCC arch/powerpc/boot/inffast.o
| make[1]: *** [arch/powerpc/boot/treeboot-iss4xx.o] Error 1
| make[1]: *** Waiting for unfinished jobs....
| BOOTCC arch/powerpc/boot/inflate.o
| make: *** [uImage] Error 2
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (see /srv/home/pokybuild/yocto-autobuilder/yocto-slave/p1022ds/build/build/tmp/work/p1022ds-poky-linux-gnuspe/linux-qoriq-sdk-3.0.34-r5/temp/log.do_compile.2167 for further information)
NOTE: recipe linux-qoriq-sdk-3.0.34-r5: task do_compile: Failed

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# b048b4e1 26-Jun-2012 Paul Gortmaker <paul.gortmaker@windriver.com>

powerpc: remove Wind River SBC8560 support

This reference board dates back to 2004, and is largely a legacy
EOL product. The MPC8560 is a pre e500v2 CPU. The SBC8548 is
a more modern, better e500v2 target for people to use as a
reference board with today's kernels, should they require one.

Removing support for it will also allow us to remove some
sbc8560 specific quirk handling in 8250 UART code, and some
MTD mapping support.

Cc: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# b81f18e5 03-Apr-2012 Tony Breeds <tony@bakeyournoodle.com>

powerpc/boot: Only build board support files when required.

Currently we build all board files regardless of the final zImage
target. This is sub-optimal (in terms on compilation) and leads to
problems in one platform needlessly causing failures for other
platforms.

Use the Kconfig variables to selectively construct this board files to
build.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 1b041885 15-Mar-2012 Stephen Rothwell <sfr@canb.auug.org.au>

powerpc: Remove the remaining CONFIG_PPC_ISERIES pieces

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 0d4fdd32 06-Mar-2012 Zhao Chenhui <chenhui.zhao@freescale.com>

powerpc/85xx: Refactor mpc8548cds device tree

* Create mpc8548cds.dtsi
* Move lbc, soc and pci0 nodes to mpc8548cds_32b.dtsi
* Change cuImage.mpc8548cds to cuImage.mpc8548cds_32b
* Rename mpc8548cds.dts to mpc8548cds_32b.dts

Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# 7c431851 09-Jan-2012 Stephen Warren <swarren@nvidia.com>

Kbuild: Use dtc's -d (dependency) option

This hooks dtc into Kbuild's dependency system.

Thus, for example, "make dtbs" will rebuild tegra-harmony.dtb if only
tegra20.dtsi has changed yet tegra-harmony.dts has not. The previous
lack of this feature recently caused me to have very confusing "git
bisect" results.

For ARM, it's obvious what to add to $(targets). I'm not familiar enough
with other architectures to know what to add there. Powerpc appears to
already add various .dtb files into $(targets), but the other archs may
need something added to $(targets) to work.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
[mmarek: Dropped arch/c6x part to avoid merging commits from the middle
of the merge window]
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 228d5505 30-Nov-2011 Tony Breeds <tony@bakeyournoodle.com>

powerpc/47x: Add support for the new IBM currituck platform

Based on original work by David 'Shaggy' Kleikamp.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>


# 11eab297 01-Dec-2011 Benjamin Herrenschmidt <benh@kernel.crashing.org>

powerpc: Add support for OpenBlockS 600

So I've had one of these for a while and it looks like the vendor never
bothered submitting the support upstream.

This adds it using ppc40x_simple and provides a device-tree.

There are some changes to the boot wrapper because the way u-boot works
on this thing, it seems to expect a multipart image with the kernel,
initrd and dtb in it.

The USB support is missing as it needs the yet unmerged driver for
the DWC OTG part and the GPIOs may need further definition in the dts.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 55190f88 19-Sep-2011 Benjamin Herrenschmidt <benh@kernel.crashing.org>

powerpc: Add skeleton PowerNV platform

This adds a skeletton for the new Power "Non Virtualized"
platform which will be used by machines supporting running
without an hypervisor, for example in order to run KVM.

These machines will be using a new firmware called OPAL
for which the support will be provided by later patches.

The PowerNV platform is intended to be also usable under
the BML environment used internally for early CPU bringup
which is why the code also supports using RTAS instead of
OPAL in various places.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 73927693 19-Jul-2011 Matthew McClintock <msm@freescale.com>

powerpc: Fix build dependencies for epapr.c which needs libfdt.h

Currently, the build can (very rarely) fail to build because libfdt.h has
not been created or is in the process of being copied.

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 31355403 04-May-2011 Michal Marek <mmarek@suse.cz>

powerpc: Use the deterministic mode of ar

Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 6c5b59b9 14-Apr-2011 David Gibson <dwg@au1.ibm.com>

powerpc/boot: Add an ePAPR compliant boot wrapper

This is a first cut at making bootwrapper code which will
produce a zImage compliant with the requirements set down
by ePAPR.

This is a very simple bootwrapper, taking the device tree
blob supplied by the ePAPR boot program and passing it on
to the kernel. It builds on the earlier patch to build a
relocatable ET_DYN zImage to meet the other ePAPR image
requirements.

For good measure we have some paranoid checks which will
generate warnings if some of the ePAPR entry condition
guarantees are not met.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 4d9ef89d 08-Jan-2011 Ben Hutchings <ben@decadent.org.uk>

powerpc/boot/dts: Install dts from the right directory

The dts-installed variable is initialised using a wildcard path that
will be expanded relative to the build directory. Use the existing
variable dtstree to generate an absolute wildcard path that will work
when building in a separate directory.

Reported-by: Gerhard Pircher <gerhard_pircher@gmx.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Tested-by: Gerhard Pircher <gerhard_pircher@gmx.net> [against 2.6.32]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 63849340 22-Dec-2010 Dirk Brandewie <dirk.brandewie@gmail.com>

of/powerpc: Use generic rule to build dtb's

Modify arch/powerpc/boot/Makefile to use dtc command in
scripts/Makefile.lib

Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 97bb63e4 07-Jun-2010 Paul Mackerras <paulus@samba.org>

powerpc/boot: Remove addRamdisk.c since it is now unused

It was used in the dim distant past for adding initrds to images
for legacy iSeries, but it's not even used for that now that we
have initramfs. So remove it.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# b4e8c8dd 05-Mar-2010 Torez Smith <lnxtorez@linux.vnet.ibm.com>

powerpc/4xx: Simple platform for the ISS 4xx simulator

This is a trivial 4xx plaform that uses the new simple bsp from
Josh and is handy to use in simulators such as ISS or even Mambo
who don't properly implement most of the actual devices in the
SoC but really only the core.

Signed-off-by: Torez Smith <lnxtorez@linux.vnet.ibm.com>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# 58706ef9 29-Jan-2010 Corey Minyard <cminyard@mvista.com>

powerpc: Add a new zImage for maple using a different link address

The maple platform failed to load because it's firmware could not take a
link address of 0x4000000. A new platform type with a link address of
0x400000 had to be created for the maple.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 6846ee5c 12-Jan-2010 Benjamin Herrenschmidt <benh@kernel.crashing.org>

zlib: Fix build of powerpc boot wrapper

Commit ac4c2a3bbe5db5fc570b1d0ee1e474db7cb22585 broke the build
of all powerpc boot wrappers.

It attempts to add an include of autoconf.h but used the wrong
path for it. It also adds -D__KERNEL__ to our boot wrapper, both
things that we pretty much didn't do on purpose so far.

We want our boot wrapper to remain independent enough of the kernel
for various reasons, one of them being that you can "wrap" an existing
kernel at distro install time which allows to ship one kernel image
and a set of boot wrappers for different platforms, the wrappers
don't have to be built out of the same kernel build tree.

It's also incorrect to do what the patch does in our boot environment
since we may not have a proper alignment exception handler which means
we may not be able to fixup the few cases where an unaligned access will
need SW emulation (depends on the core variant, could be when crossing
page or segment boundaries for example).

This patch fixes it by putting the old code back in and using the
new "fancy" variant only when CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
is set, which happens not to be set on powerpc since we don't include
autoconf.h. It also reverts the changes to our boot wrapper Makefile.

This means that x86 should, afaik, keep the optimisations since its
boot wrapper does include autoconf.h and define __KERNEL__ (though I
doubt they make that much different outside of slow embedded processors).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# ac4c2a3b 08-Jan-2010 Joakim Tjernlund <Joakim.Tjernlund@transmode.se>

zlib: optimize inffast when copying direct from output

JFFS2 uses lesser compression ratio and inflate always ends up in "copy
direct from output" case.

This patch tries to optimize the direct copy procedure. Uses
get_unaligned() but only in one place.

The copy loop just above this one can also use this optimization, but I
havn't done so as I have not tested if it is a win there too.

On my MPC8321 this is about 17% faster on my JFFS2 root FS than the
original.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Cc: Roel Kluin <roel.kluin@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 6cdd2417 11-Dec-2009 Albert Herranz <albert_herranz@yahoo.es>

powerpc: wii: bootwrapper bits

Add support for the Nintendo Wii video game console to the powerpc
bootwrapper.

dtbImage.wii is a wrapped image that contains a flat device tree,
an entry point compatible with the Homebrew Channel and BootMii,
and an optional initrd.

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# b68a24bc 11-Dec-2009 Albert Herranz <albert_herranz@yahoo.es>

powerpc: gamecube: bootwrapper bits

Add support for the Nintendo GameCube video game console to the powerpc
bootwrapper.

dtbImage.gamecube is a wrapped image that contains a flat device tree,
an entry point compatible with SDload, and an optional initrd.

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 26054c95 11-Dec-2009 Albert Herranz <albert_herranz@yahoo.es>

powerpc: gamecube/wii: usbgecko bootwrapper console support

Add support for using the USB Gecko adapter as a bootwrapper console on
the Nintendo GameCube and Wii video game consoles.
The USB Gecko is a 3rd party memory card interface adapter that provides
a EXI (External Interface) to USB serial converter.

Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# c5b20d39 22-Aug-2009 Tiejun Chen <tiejun.chen@windriver.com>

powerpc/405ex: support cuImage via included dtb

To support cuImage, we need to initialize the required sections and
ensure that it is built.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# 0cdf50a7 20-Aug-2009 Solomon Peachy <solomon@linux-wlan.com>

powerpc/40x: Add support for the ESTeem 195E (PPC405EP) SBC

This patch adds support for the ESTeem 195E Hotfoot SBC.

There are several variants of the SBC deployed, single/dual
ethernet+serial, and also 4MB/8MB flash variations. In the interest of
having a single kernel image boot on all boards, the cuboot shim detects
the differences and mangles the DTS tree appropriately.

With the exception of the CF interface that was never populated on
production boards, this code/DTS supports all boardpop options.

Signed-off-by: Solomon Peachy <solomon@linux-wlan.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# be687518 14-May-2009 Grant Likely <grant.likely@secretlab.ca>

powerpc/boot: add simpleImage.* to clean-files list

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 9fffb55f 29-Apr-2009 David Gibson <david@gibson.dropbear.id.au>

Move dtc and libfdt sources from arch/powerpc/boot to scripts/dtc

The powerpc kernel always requires an Open Firmware like device tree
to supply device information. On systems without OF, this comes from
a flattened device tree blob. This blob is usually generated by dtc,
a tool which compiles a text description of the device tree into the
flattened format used by the kernel. Sometimes, the bootwrapper makes
small changes to the pre-compiled device tree blob (e.g. filling in
the size of RAM). To do this it uses the libfdt library.

Because these are only used on powerpc, the code for both these tools
is included under arch/powerpc/boot (these were imported and are
periodically updated from the upstream dtc tree).

However, the microblaze architecture, currently being prepared for
merging to mainline also uses dtc to produce device tree blobs. A few
other archs have also mentioned some interest in using dtc.
Therefore, this patch moves dtc and libfdt from arch/powerpc into
scripts, where it can be used by any architecture.

The vast bulk of this patch is a literal move, the rest is adjusting
the various Makefiles to use dtc and libfdt correctly from their new
locations.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 8f23735d 09-Feb-2009 Gerhard Pircher <gerhard_pircher@gmx.net>

powerpc/amigaone: Bootwrapper and serial console support for AmigaOne

This adds the bootwrapper for the cuImage target and a compatible property
check for "pnpPNP,501" to the generic serial console support code.
The default link address for the cuImage target is set to 0x800000. This
allows to boot the kernel with AmigaOS4's second level bootloader, which
always loads a uImage at 0x500000.

Signed-off-by: Gerhard Pircher <gerhard_pircher@gmx.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# bfee95bb 04-Feb-2009 Grant Likely <grant.likely@secretlab.ca>

powerpc/5200: Add support for the Media5200 board from Freescale

This patch adds board support for the Media5200 platform. Changes are:
- add the media5200 device tree
- add the media5200 platform support code and cascaded interrupt controller
- add media5200 to the build targets.

Note: this patch also includes a minor tweak to the lite5200(b) target
images list to add the .dtb files to the image list.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 29f1aff2 19-Dec-2008 Grant Likely <grant.likely@secretlab.ca>

powerpc: Copy bootable images in the default install script

This patch makes the default install script (arch/powerpc/boot/install.sh)
copy the bootable image files into the install directory. Before this
patch only the vmlinux image file was copied.

This patch makes the default 'make install' command useful for embedded
development when $(INSTALL_PATH) is set in the environment.

As a side effect, this patch changes the calling convention of the
install.sh script. Instead of a single 5th parameter, the script is now
passed a list of all the target images stored in the $(image-y) Makefile
variable. This should be backwards compatible with existing install scripts
since it just adds additional arguments and does not change existing ones.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 2a94739c 03-Jan-2009 Nick Andrew <nick@nick-andrew.net>

trivial: Fix misspelling of "firmware" in powerpc Makefile

Fix misspelling of "firmware" in powerpc Makefile

It's spelled "firmware".

Signed-off-by: Nick Andrew <nick@nick-andrew.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# def434c2 27-Nov-2008 Benjamin Krill <ben@codiert.org>

powerpc/cell: add QPACE as a separate Cell platform

Since the QPACE (Chromodynamics Parallel Computing on the
Cell Broadband Engine) platform doesn't use a iommu, doesn't
have PCI devices and a MPIC much lesser setup and
configurations are needed. So far all devices are detected
as OF device. A notifier function is used to set the dma_ops
for the of_platform bus. Further this patch splits the
PPC_CELL_NATIVE into PPC_CELL_COMMON which are parts that are
shared with the QPACE platform and the rest.

Signed-off-by: Benjamin Krill <ben@codiert.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>


# 9f3eefc4 24-Nov-2008 Josh Boyer <jwboyer@linux.vnet.ibm.com>

powerpc/40x: Add proper BOOTCFLAGS for cuboot-acadia

The cuboot-acadia.c wrapper can cause assembler errors on some
toolchains due to the lack of the proper BOOTCFLAGS. This adds
the proper flags for the file.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# a4292d7a 17-Oct-2008 Grant Likely <grant.likely@secretlab.ca>

powerpc: Add missing cuImage.initrd.% target

This target is needed to build cuImages with an embedded ramdisk image.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# 94c73a8f 03-Sep-2008 Josh Boyer <jwboyer@linux.vnet.ibm.com>

powerpc/40x: Add cuboot wrapper for Acadia board

This adds a cuboot wrapper for the AMCC PowerPC 405EZ Acadia board. The
clocking code is derived from U-Boot, originally written by Stefan Roese.

Signed-off-by: Josh Boyer <jwboyer@linux.ibm.com>


# 32dde0f9 08-Sep-2008 Josh Boyer <jwboyer@linux.vnet.ibm.com>

powerpc: Holly board needs dtbImage target

One of the changes in the bootwrapper makefile introduced the dtbImage
targets for boards that need a simple zImage with a DTB embedded in
them (595be948cce574ff2d5dde5d0426a636a4363c70, "[POWERPC]
bootwrapper: Build multiple cuImages"). When this was done, it broke
booting on the Holly board as the zImage.holly wrapper did not get the
DTB embedded properly.

This changes the target for the Holly board to a dtbImage so that the
wrapper includes the vmlinux, wrapper bits, and DTB.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 549e8152 29-Aug-2008 Paul Mackerras <paulus@samba.org>

powerpc: Make the 64-bit kernel as a position-independent executable

This implements CONFIG_RELOCATABLE for 64-bit by making the kernel as
a position-independent executable (PIE) when it is set. This involves
processing the dynamic relocations in the image in the early stages of
booting, even if the kernel is being run at the address it is linked at,
since the linker does not necessarily fill in words in the image for
which there are dynamic relocations. (In fact the linker does fill in
such words for 64-bit executables, though not for 32-bit executables,
so in principle we could avoid calling relocate() entirely when we're
running a 64-bit kernel at the linked address.)

The dynamic relocations are processed by a new function relocate(addr),
where the addr parameter is the virtual address where the image will be
run. In fact we call it twice; once before calling prom_init, and again
when starting the main kernel. This means that reloc_offset() returns
0 in prom_init (since it has been relocated to the address it is running
at), which necessitated a few adjustments.

This also changes __va and __pa to use an equivalent definition that is
simpler. With the relocatable kernel, PAGE_OFFSET and MEMORY_START are
constants (for 64-bit) whereas PHYSICAL_START is a variable (and
KERNELBASE ideally should be too, but isn't yet).

With this, relocatable kernels still copy themselves down to physical
address 0 and run there.

Signed-off-by: Paul Mackerras <paulus@samba.org>


# 4ff23fa9 06-Sep-2008 Hugh Dickins <hugh@veritas.com>

powerpc: Fix rare boot build breakage

A make -j20 powerpc kernel build broke a couple of months ago saying:
In file included from arch/powerpc/boot/gunzip_util.h:13,
from arch/powerpc/boot/prpmc2800.c:21:
arch/powerpc/boot/zlib.h:85: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘*’ token
arch/powerpc/boot/zlib.h:630: warning: type defaults to ‘int’ in declaration of ‘Byte’
arch/powerpc/boot/zlib.h:630: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token

It happened again yesterday: too rare for me to confirm the fix, but
it looks like the list of dependants on gunzip_util.h was incomplete.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 542a3a3b 17-Jul-2008 Adrian Bunk <bunk@kernel.org>

powerpc/boot: Change spaces to tabs

For C code spaces versus tabs is just a religious issue,
but for Makefiles it actually matters.

This patch fixes he following errors:
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/powerpc/boot/Makefile:166: *** missing separator. Stop.
/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/powerpc/boot/Makefile:171: *** missing separator. Stop.

Since this was inside an ifdef DTC_GENPARSER it was not a problem unless
someone wanted to regenerate the shipped generated files.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


# c356aa45 09-Jul-2008 Grant Likely <grant.likely@secretlab.ca>

powerpc/bootwrapper: Allow user to specify additional default targets

It is inconvenient to add additional default targets to the bootwrapper
Makefile for each new board supported which just needs a different dts
file. This change allows the defconfig to specify additional build
targets.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# d58577d8 02-Jul-2008 John Linn <john.linn@xilinx.com>

powerpc/virtex: Fix booting of Xilinx FPGAs with 16550 for 405 and 440

The following changes add processing to initialize the Xilinx 16550 UART
in the boot wrapper for Virtex targets without firmware. Normally the
boot wrapper assumes that the serial port has already been initialized by
firmware.

The wrapper was also modified to add the 440 build.

Signed-off-by: John Linn <john.linn@xilinx.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 5d1a0411 01-Jul-2008 John Linn <john.linn@xilinx.com>

powerpc/bootwrapper: update for initrd with simpleImage

This change to the makefile corrects the build of a simpleImage with initrd.

Signed-off-by: John Linn <john.linn@xilinx>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>


# 9d4ae9fc 26-Jun-2008 Kumar Gala <galak@kernel.crashing.org>

powerpc/bootwrapper: Pad .dtb by default

Since most bootloaders or wrappers tend to update or add some information
to the .dtb they a handled they need some working space to do that in.

By default add 1K of padding via a default setting of DTS_FLAGS.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 143580ec 12-Jun-2008 Kumar Gala <galak@kernel.crashing.org>

[POWERPC] Fix bootwrapper builds with newer gcc versions

GCC 4.4.x looks to be adding support for generating out-of-line register
saves/restores based on:

http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01678.html

This breaks the bootwrapper as we'd need to link with libgcc to get the
implementation of the register save/restores.

To workaround this issue, we just stole the save/restore code from gcc
and simplified it down for our needs (integer only).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# b6014e15 19-May-2008 Giuseppe Coviello <cjg@cruxppc.org>

powerpc/4xx: Sam440ep support

The Sam440ep is an high customizable general purpose mini-itx board,
based on the AMCC 440EP and with a LatticeXP FPGA onboard.

It's poduced by ACube Systems Srl (Bassano del Grappa, Italy),
http://www.acube-systems.biz.

Signed-off-by: Giuseppe Coviello <gicoviello@gmail.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# 6dd1b64a 06-Jun-2008 Wolfgang Grandegger <wg@grandegger.com>

powerpc/85xx: add board support for the TQM8548 modules

This patch adds support for the TQM8548 modules from TQ-Components
GmbH (http://www.tqc.de).

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# c6ec08e0 20-May-2008 Remi Machet <rmachet@slac.stanford.edu>

powerpc: Boot code for the C2K

Support for the C2K cPCI Single Board Computer from GEFanuc
(PowerPC MPC7448 with a Marvell MV64460 chipset).
All features of the board are not supported yet, but the board
boots, flash works, all Ethernet ports are working and PCI
devices are all found (USB and SATA on PCI1 do not work yet).

Part 2 of 5: support for the board in arch/powerpc/boot.

Signed-off-by: Remi Machet <rmachet@slac.stanford.edu>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# efa58fbf 21-May-2008 Adrian Bunk <bunk@kernel.org>

[POWERPC] boot/Makefile CONFIG_ variable fixes

This corrects the names of two CONFIG_ variables.

Note that the CONFIG_MPC86XADS fix uncovers another bug
(with mpc866_ads_defconfig) that will require fixing:

<-- snip -->

...
arch/powerpc/boot/dtc -O dtb -o arch/powerpc/boot/mpc866ads.dtb -b 0 /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/powerpc/boot/dts/mpc866ads.dts
DTC: dts->dtb on file "/home/bunk/linux/kernel-2.6/git/linux-2.6/arch/powerpc/boot/dts/mpc866ads.dts"
WRAP arch/powerpc/boot/cuImage.mpc866ads
powerpc64-linux-ld: arch/powerpc/boot/cuboot-mpc866ads.o: No such file: No such file or directory
make[2]: *** [arch/powerpc/boot/cuImage.mpc866ads] Error 1

<-- snip -->

Reported-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 59d13f9d 08-May-2008 Bryan O'Donoghue <bodonoghue@codehermit.ie>

[POWERPC] 83xx: Add support for Analogue & Micro ASP837E board

The following adds support for the Analogue & Micro ASP 8347E, running
Redboot.

http://www.analogue-micro.com/ASP8347.html

Signed-off-by: Bryan O'Donoghue <bodonoghue@codehermit.ie>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# b58a4575 18-May-2008 Kumar Gala <galak@kernel.crashing.org>

[POWERPC] Remove generated files on make clean

dtbImage.* and several zImage. targets get created but never cleaned up.

Also, moved zImage to the clean-files line associated with all other image
results (was previously duplicated).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# b9e4f176 24-Apr-2008 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] bootwrapper: fix build error on virtex405-head.S

virtex405-head.S is an assembler file, not a C file; therefore BOOTAFLAGS
is the correct place to set the needed -mcpu=405 flag.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# a7e695f6 07-Apr-2008 Dale Farnsworth <dale@farnsworth.org>

[POWERPC] prpmc2800 needs a dtbImage

The prpmc2800 platform requires a zImage formatted file with an
embedded dtb file. Rename the requested boot image file to
dtbImage.prpmc2800.

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# d2477b5c 18-Mar-2008 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] bootwrapper: Add a firmware-independent simpleboot target.

This target produces a flat binary rather than an ELF file,
fixes the entry point at the beginning of the image, and takes
a complete device tree with no fixups needed.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# e04018e8 24-Mar-2008 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] add target for building .dtb files

Call dtc from the Makefile instead of the wrapper script so that the dt
blobs can be generated with a simple make invocation.

Using this patch allows board ports to trigger automatic building of .dtb
files by adding them to the image-y target list.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# ff880112 04-Mar-2008 Alexandr Smirnov <asmirnov@ru.mvista.com>

[POWERPC] 85xx: Emerson KSI8560 bootwrapper

Add boot wrapper for Emerson KSI8560 board.

Signed-off-by: Alexandr Smirnov <asmirnov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# d0a48c9f 06-Mar-2008 Josh Boyer <jwboyer@linux.vnet.ibm.com>

[POWERPC] 4xx: Add bootwrapper for AMCC Yosemite board

Add the cuboot wrapper for the AMCC 440EP Yosemite board

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# a72a6f53 17-Mar-2008 Paul Gortmaker <paul.gortmaker@windriver.com>

[POWERPC] Fix build failure for tqm8540 and sbc85xx defconfigs

The wrapper script didn't have entries for the TQM8540 board and the
SBC8548 or SBC8560 boards. I've assumed that the TQM8540 console is
8250 based and not CPM based by looking at its defconfig. There was
also a trailing * on the TQM8555 entry that I removed too.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 595be948 21-Feb-2008 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] Fix zImage-dtb.initrd build error

The pattern substitution rules were failing when used with zImage-dtb
targets. If zImage-dtb.initrd was selected, the pattern substitution
would generate "zImage.initrd-dtb" instead of "zImage-dtb.initrd" which
caused the build to fail.

This renames zImage-dtb to dtbImage to avoid the problem entirely.
By not using the zImage prefix then is no potential for namespace
collisions.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# bf2e70ac 18-Feb-2008 Josh Boyer <jwboyer@linux.vnet.ibm.com>

[POWERPC] Fix bootwrapper builds with older gcc versions

GCC versions before 3.4 did not support the -mcpu=440 option. Use
-mcpu=405 for the 4xx specific bootwrapper files, as that has been
around for much longer.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# e4ccde02 11-Feb-2008 Kumar Gala <galak@kernel.crashing.org>

[POWERPC] Remove generated files on make clean

vmlinux.lds and dtc-parser.tab.h get created but never cleaned up.

Signed-off-by: Paul Mackerras <paulus@samba.org>


# 25431333 06-Feb-2008 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] bootwrapper: Build multiple cuImages

Currently, the kernel uses CONFIG_DEVICE_TREE to wrap a kernel image
with a fdt blob which means for any given configuration only one dts
file can be selected and so support for only one board can be built

This moves the selection of the default .dts file out of the kernel
config and into the bootwrapper makefile. The makefile chooses which
images to build based on the kernel config and the dts source file
name is taken directly from the image name. For example "cuImage.ebony"
will use "ebony.dts" as the device tree source file.

In addition, this patch allows a specific image to be requested from the
command line by adding "cuImage.%" and "treeImage.%" targets to the list
of valid built targets in arch/powerpc/Makefile. This allows the default
dts selection to be overridden.

Another advantage to this change is it allows a single defconfig to be
supplied for all boards using the same chip family and only differing in
the device tree.

Important note: This patch adds two new zImage targets; zImage.dtb.% and
zImage.dtb.initrd.% for zImages with embedded dtb files. Currently
there are 5 platforms which require this: ps3, ep405, mpc885ads, ep88xc,
adder875-redboot and ep8248e. This patch *changes the zImage filenames*
for those platforms. ie. 'zImage.ps3' is now 'zImage.dtb.ps3'.

This new zImage.dtb targets were added so that the .dts file could be
part of the dependancies list for building them.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 3ff6eecc 24-Jan-2008 Adrian Bunk <bunk@kernel.org>

remove __attribute_used__

Remove the deprecated __attribute_used__.

[Introduce __section in a few places to silence checkpatch /sam]

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 7858f747 24-Jan-2008 Kumar Gala <galak@kernel.crashing.org>

[POWERPC] Add a cuboot wrapper for 85xx with CPM2

The bd info struct changes if we have CPM2 enabled in u-boot.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# 1e12f3c5 10-Jan-2008 Sean MacLennan <smaclennan@pikatech.com>

[POWERPC] 4xx: PIKA Warp bootwrapper

Add the cuboot wrapper for the PIKA Warp board

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# 3490cba5 22-Jan-2008 Jon Loeliger <jdl@jdl.com>

[POWERPC] Add initial iomega StorCenter board port.

Use cuImage bootwrapper until U-Boot port is completed.
Derived heavily from Linkstation port.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Acked-by: Andy Wilcox <andy@protium.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# 0dde1a1d 17-Jan-2008 Scott Wood <scottwood@freescale.com>

[POWERPC] 82xx: Embedded Planet EP8248E support

This board is also resold by Freescale under the names
"QUICCStart MPC8248 Evaluation System" and "CWH-PPC-8248N-VE".

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# b09c1644 17-Jan-2008 Scott Wood <scottwood@freescale.com>

[POWERPC] 8xx: Analogue & Micro Adder875 board support.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# 295e7427 30-Oct-2007 Valentine Barshak <vbarshak@ru.mvista.com>

[POWERPC] 4xx: 440GRx Rainier bootwrapper.

Bootwrapper code for PowerPC 440GRx Rainier board.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# 3de9c9cd 20-Dec-2007 Benjamin Herrenschmidt <benh@kernel.crashing.org>

[POWERPC] 4xx: Base support for 440SPe "Katmai" eval board

This adds base support for the Katmai board, including PCI-X and
PCI-Express (but no RTC, nvram, etc... yet).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Stefan Roese <sr@denx.de>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# 6bbc5476 20-Dec-2007 Hugh Blemings <hugh@blemings.org>

[POWERPC] 4xx: Base support for 440GX Taishan eval board

This patch adds base support for the AMCC Taishan 440GX evaluation
board.

Signed-off-by: Hugh Blemings <hugh@blemings.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# 61974038 20-Dec-2007 Benjamin Herrenschmidt <benh@kernel.crashing.org>

[POWERPC] 4xx: EP405 boards support for arch/powerpc

Brings EP405 support to arch/powerpc. The IRQ routing for the CPLD
comes from a device-tree property, PCI is working to the point where
I can see the video card, USB device, and south bridge.

This should work with both EP405 and EP405PC.

I've not totally figured out how IRQs are wired on this hardware
though, thus at this stage, expect only USB interrupts working,
pretty much the same as what arch/ppc did.

Also, the flash, nvram, rtc and temp control still have to be wired.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# e2dc87a1 17-Dec-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Use embedded dtc in kernel builds

This patch alters the kernel makefiles to build dtc from the sources
embedded in the previous patch. It also changes the
arch/powerpc/boot/wrapper script to use the embedded dtc, rather than
expecting a copy of dtc already installed on the system.

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


# 430b01e8 09-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.

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


# 2f0dfeaa 09-Dec-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Use embedded libfdt in the bootwrapper

This incorporates libfdt (from the source embedded in an earlier
commit) into the wrapper.a library used by the bootwrapper. This
includes adding a libfdt_env.h file, which the libfdt sources need in
order to integrate into the bootwrapper environment, and a
libfdt-wrapper.c which provides glue to connect the bootwrapper's
abstract device tree callbacks to the libfdt functions.

In addition, this changes the various wrapper and platform files to
use libfdt functions instead of the older flatdevtree.c library.

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


# 773f76b1 02-Dec-2007 David Woodhouse <dwmw2@infradead.org>

[POWERPC] Implement 'make bootwrapper_install'

This adds a 'bootwrapper_install' make target for the powerpc
architecture, which installs the wrapper script, intermediate object
files and device-tree sources for later use.

This will then allow bootable zImages to be created other than in the
context of a kernel build.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 105c13dd 03-Oct-2007 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] Enable debug info on boot wrapper

Add '-g' to BOOTCFLAGS if CONFIG_DEBUG_INFO is set.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# c4e05bc5 24-Sep-2007 Roy Zang <tie-fei.zang@freescale.com>

[POWERPC] bootwrapper: adds cuboot for MPC7448HPC2 platform

This patch adds cuboot support for MPC7448HPC2 platform.
The cuImage can be used with legacy u-boot without FDT support.

Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# 11c146cc 14-Sep-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] 8xx/wrapper: Embedded Planet EP88xC support

This board is also resold by Freescale under the names
"QUICCStart MPC885 Evaluation System" and "CWH-PPC-885XN-VE".

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# bbc6fac3 27-Aug-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Add fsl_get_immr() and 8xx/pq2 clock functions.

fsl_get_immr() uses /soc/ranges to determine the immr.

mpc885_get_clock() transforms a crystal frequency into a system frequency
according to the PLL register settings.

pq2_get_clocks() does the same as the above for the PowerQUICC II,
except that it produces several different clocks.

The mpc8xx/pq2 set_clocks() functions modify common properties in
the device tree based on the given clock data.

The mpc885/pq2 fixup_clocks() functions call get_clocks(), and
pass the results to set_clocks().

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>


# 7ddc5f97 01-Oct-2007 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] Virtex: Add uartlite bootwrapper driver

Allows the bootwrapper to use the uartlite device for console output.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# 2e71cc0d 24-Sep-2007 Josh Boyer <jwboyer@linux.vnet.ibm.com>

[POWERPC] 4xx: Fix Walnut wrapper compile errors

Pass the appropriate -mcpu flag to the treeboot-walnut.o object to prevent
some toolchains from erroring out with unknown opcodes

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


# fec60470 24-Sep-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Add PlanetCore firmware support

This is a library that board code can use to extract information from the
PlanetCore configuration keys. PlanetCore is used on various boards from
Embedded Planet.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 85498ae8 31-Aug-2007 Grant Likely <grant.likely@secretlab.ca>

[POWERPC] mpc5200: Add cuimage support for mpc5200 boards

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 658e8170 14-Sep-2007 Josh Boyer <jwboyer@linux.vnet.ibm.com>

[POWERPC] cuimage for Bamboo board

Add a cuboot wrapper for the Bamboo board. Additionally, we enable MAC
address fixups for both cuboot and treeboot.

This also removes some obsoleted linker declarations that have been
moved into ops.h

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>


# 9de78277 05-Sep-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Add strtoull()

This will be needed by PlanetCore firmware support.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 5326152f 07-Sep-2007 Josh Boyer <jwboyer@linux.vnet.ibm.com>

[POWERPC] Walnut zImage wrapper

Add zImage wrapper for walnut board

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>


# 606d08bc 29-Aug-2007 Valentine Barshak <vbarshak@ru.mvista.com>

[POWERPC] PowerPC 440EPx: Sequoia bootwrapper

Bootwrapper code for AMCC PPC440EPx Sequoia.

Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>


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

[POWERPC] bootwrapper: Add PowerQUICC II (82xx with CPM) cuboot support

This allows booting on legacy, non-device-tree aware versions of U-boot.

It also fixes up the hardware to match the PCI and chipselect information
in the device tree, as u-boot is inconsistent in setting these up
correctly (or at all).

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 0b195812 20-Aug-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Add 8xx cuboot support

This allows booting on legacy, non-device-tree aware versions of U-boot.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


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

[POWERPC] bootwrapper: Add CPM serial driver

This serial port is used on all 8xx, many 82xx, and some 85xx chips.

The driver requires that the port has already been set up by the firmware
and/or platform code.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 2ba4573c 20-Aug-2007 Josh Boyer <jwboyer@linux.vnet.ibm.com>

[POWERPC] Bamboo zImage wrapper

Add a bootwrapper for the AMCC 440EP Bamboo Eval board. This also adds a
common fixup_clock function for all 440EP(x) chips.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>


# 869680c1 20-Aug-2007 Josh Boyer <jwboyer@linux.vnet.ibm.com>

[POWERPC] Rename 44x bootwrapper

Rename the 44x.c wrapper file to 4xx.c. This will allow us to add common
functions in a single file that can be shared across all of 4xx.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>


# 4bb09281 03-Jul-2007 Tony Breeds <tony@bakeyournoodle.com>

[POWERPC] Create a dummy zImage if no valid platform has been selected

This simply prevents a build error if no platform is selected.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# bafdb645 03-Jul-2007 Geoff Levand <geoffrey.levand@am.sony.com>

[POWERPC] PS3: Bootwrapper support.

Add support to build the PS3 flash rom image and remove some unneeded
lmb calls.

The PS3's lv1 loader supports loading gzipped binary images from flash
rom to addr zero. The loader enters the image at addr 0x100.

In this implementation a bootwrapper overlay is use to arrange for the
kernel to be loaded to addr zero and to have a suitable bootwrapper
entry at 0x100. To construct the rom image, 0x100 bytes from offset
0x100 in the kernel is copied to the bootwrapper symbol
__system_reset_kernel. The 0x100 bytes at the bootwrapper symbol
__system_reset_overlay is then copied to offset 0x100. At runtime the
bootwrapper program copies the 0x100 bytes at __system_reset_kernel to
addr 0x100.

zImage.ps3 is a wrapped image that contains a flat device tree, an lv1
compatible entry point, and an optional initrd. otheros.bld is the gzip
compresed rom image built from zImage.ps3. otheros.bld is suitable for
programming into the PS3 boot flash memory.

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


# b0e80206 31-May-2007 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Update holly to use new dts wrapping feature

The holly support currently has separate rules to wrap its device tree
with its zImage. This can now be done automatically without the extra
rules so update holly support to use the automatic feature.

Signed-off-by: Mark A. Greer <mgreer@mista.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# a00cec48 31-May-2007 Mark A. Greer <mgreer@mvista.com>

[POWERPC] When appropriate, wrap device tree with zImage

There are 2 config options that indicate whether the platform being built
has a device tree source file associated with it. Namely,
CONFIG_WANT_DEVICE_TREE and CONFIG_DEVICE_TREE. When CONFIG_WANT_DEVICE_TREE
is 'y' and CONFIG_DEVICE_TREE isn't an empty string, automatically wrap
the specified device tree with the zImage being built.

To achieve this, the 'dts' variable will only be set when the conditions
above are true. The changes to the zImage.initrd.% and zImage.% rules
cause the device tree to be wrapped when 'dts' is set; otherwise, they
will work as they previosly did (i.e., build a zImage with no device tree).

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 941b7adf 31-May-2007 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Remove 'make zImage.dts' feature

Being able to selectively wrap a device tree with the zIimage at build
time has been deemed unnecessary, so this removes Makefile support for
that feature.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 85aecac8 12-Jun-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Consolidate cuboot initialization code

The various cuboot platforms (i.e. pre-device tree aware u-boot for
83xx, 85xx and Ebony) share a certain amount of code for parsing the
boot parameters. To a certain extent that's inevitable, since they
platforms have different definitions of the bd_t structure. However,
with some macro work and a helper function, this patch improves the
situation a bit.

In the process, this fixes a bug on Ebony, which was incorrectly
handling the parameters passed form u-boot for the command line (the
bug was copied from 83xx and 85xx which have subsequently been fixed).

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


# 2e601613 12-Jun-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Split low-level OF-related bootloader code into separate files

Currently, all OF-related code in the bootloader is contained in of.c.
of.c also provides the platform specific things necessary to boot on
an OF platform.

However, there are platforms (such as PReP) which can include an OF
implementation, but are not bootable as pure OF systems. For use by
such platforms, this patch splits out the low-level parts of the OF
code (call_prom() and various wrappers thereof) into a new oflib.c
file. In addition, the code related to bootwrapper console output via
OF are moved to a new ofconsole.c file. Both these files are included
in the wrapper.a library where they can be used by both full-OF and
partial OF platforms.

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


# b610b978 28-May-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Don't use HOSTCFLAGS in BOOTCFLAGS

In the bootwrapper code for powerpc, we include HOSTCFLAGS into the
BOOTCFLAGS used for building the zImage wrapper code. Since the
wrapper code is not host code, this makes no sense. This patch
removes the use of HOSTCFLAGS here, instead including directly into
BOOTCFLAGS those flags from the normal kernel CFLAGS which also make
sense in the bootwrapper code.

In particular, this makes the bootwrapper use -msoft-float, preventing
the compiler from generating floating point instructions. Previously,
under some circumstances the compiler could generate floating point
instructions in the bootwrapper which would cause exceptions on
embedded CPUS which don't have floating point support.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 0570d4ed 28-May-2007 Stephen Rothwell <sfr@canb.auug.org.au>

[POWERPC] Create a zImage for legacy iSeries

This zImage is really just the stripped vmlinux, but it means that there
is one less special case for iSeries and also that the zImages will be
built for a combined kernel build that happens to include iSeries.

This zImage boots fine on legacy iSeries.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 988519ac 24-May-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Fix compiler/assembler flags for Ebony platform boot files

The recent addition of assembler flags for 44x.c and ebony.c in the
bootwrapper to make them compile on certain toolchains was not correct
and could break other platforms. This patch switches to using a
compiler flag instead, which implies the appropriate assembler flag,
and also stops the compiler itself generating instructions which are
invalid for the platform in question.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 60e41753 16-May-2007 Josh Boyer <jwboyer@linux.vnet.ibm.com>

[POWERPC] Pass per-file CFLAGs for platform specific op codes

As a result of compiling all of the wrapper files for every platform
now, the kernel build can fail for toolchains that don't support various
op codes by default. An example of this building a 7xx platform with
the ELD4.0 toolchain, is below:

/tmp/ccYjhJoL.s: Assembler messages:
/tmp/ccYjhJoL.s:42: Error: Unrecognized opcode: `mtdcr'
/tmp/ccYjhJoL.s:43: Error: Unrecognized opcode: `mfdcr'
make[1]: *** [arch/powerpc/boot/44x.o] Error 1

The following patch introduces additional CFLAGS for the 4xx specific
files and fixes the kernel compile.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 67ccd2fc 16-May-2007 Segher Boessenkool <segher@kernel.crashing.org>

[POWERPC] Fix sed command lines for zlib source construction

Not every sed understands \+ so use the more portable * instead.

Signed-off-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 6a32d085 14-May-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Fix make rules for treeImage.initrd

At present attempting to build treeImage.initrd.* boot images will
fail, because make will select the treeImage.% rule which also matches
instead of the correct and more specific treeImage.initrd.% rule.
This patch corrects the problem by listing the more specific rule
first.

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


# c368d921 11-May-2007 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Add bootwrapper support for Motorola PrPMC2800 platform

The Motorola PrPMC280 and PrPMC2800 processor modules sit on an F101 or
PrPMC2800 baseboard, respectively. There are several variants of each
type of processor module which can have different amounts of memory,
amounts of FLASH, cpu frequencies, and an mv64360 or an mv64362.

The bootwrapper code for that platform reads VPD from an I2C EEPROM
to determine the processor module variant. From the variant, the
amount of memory, etc. is determined and the device tree is updated
accordingly. If the variant cannot be determined (e.g., corrupted
VPD or a previously unknown variant), the property values already
in the device tree are used.

Also, the firmware for those platforms does not completely configure
the mv64x60 host bridge so that configuration is done here.

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


# ae4b3fbc 11-May-2007 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Add bootwrapper support for Marvell/mv64x60 I2C

Some platforms support a variety processor modules with no method of
determining which exact processor module is being used except by
examining Vital Product Data (VPD). The modules may have different
amounts of memory, clock frequencies, etc. so reading the VPD becomes
necessary to correctly set properties in the device tree before its
passed to the kernel.

Often the VPD is stored in I2C EEPROMs so an I2C driver becomes necessary.
This I2C driver is for the I2C controller that's embedded on the Marvel
mv64x60 line of host bridges.

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


# e12deb84 11-May-2007 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Add bootwrapper support for Marvell MPSC

The bootwrapper requires a serial driver to allow cmdline editing
and information reporting on the console. This driver is required
by platforms that boot a zImage and use the MPSC for the console.

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


# 0f81b11d 11-May-2007 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Add bootwrapper support for Marvell/mv64x60 hostbridge

The mv64x60 host bridge has many windows between its various components
(cpu, system memory, ethernet ctlr, MPSC, DMA ctlr, PCI MEM, PCI I/O).
Unfortunately, the firmware on some of mv64x60-based platforms do not
properly or completely configure those windows (e.g., MPSC->system memory
windows not configured or CPU->PCI MEM space not configured).

So, the missing configuration needs to be done in either the bootwrapper
or in the kernel. To keep the kernel as clean as possible, it is done
in the bootwrapper. Note that I/O controller configuration is NOT being
done, its only the windows to allow the I/O controllers and other components
to access memory, etc. that is being done--drivers assume that their
controllers can already access system memory).

Table of routines and the windows they configure:
mv64x60_config_ctlr_windows() ENET->System Memory
MPSC->System Memory
IDMA->System Memory

mv64x60_config_pci_windows() PCI MEM->System Memory
PCI I/O->Bridge's Registers

mv64x60_config_cpu2pci_window() CPU->PCI MEM
CPU->PCI I/O

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


# 916066d5 11-May-2007 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Add Makefile rules to wrap dts file in zImage

Add 'zImage.dts' and 'zImage.dts_initrd' build rules that automatically
compile and wrap a dts file from arch/powerpc/boot/dts into the zImage file.
The resulting zImage will be arch/powerpc/boot/zImage.dts.<platform> and
arch/powerpc/boot/zImage.dts_initrd.<platform>, respectively.

Having separate rules allows the user to choose whether to include a device
tree--and which device tree--at build time. This is useful when one Makefile
target builds a zImage that runs on several platforms except for differing
device trees. By just setting CONFIG_DEVICE_TREE and running "make zImage.dts"
the exact zImage you want is built without Makefile bloat or manually running
the wrapper script.

The dts file is expected to be arch/powerpc/boot/dts/$(CONFIG_DEVICE_TREE)

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


# f6dfc805 07-May-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Support for the Ebony 440GP reference board in arch/powerpc

This adds platform support code for the Ebony (440GP) evaluation
board. This includes both code in arch/powerpc/platforms/44x for
board initialization, and zImage wrapper code to correctly tweak the
flattened device tree based on information from the firmware. The
zImage supports both IBM OpenBIOS (aka "treeboot") and old versions of
uboot which don't support a flattened device tree.

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


# 7487a224 07-May-2007 Josh Boyer <jwboyer@linux.vnet.ibm.com>

[POWERPC] Holly bootwrapper

Add Holly/Hickory bootwrapper

Signed-off-by: Stephen Winiecki <stevewin@us.ibm.com>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# d25a9d66 04-May-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Fix some missing build dependencies in arch/powerpc/boot

This patch fixes a couple of missing dependencies in
arch/powerpc/boot/Makefile. First, it ensures that the zlib.h header
is linked in before attempting to build gunzip_util.o, as it is,
building gunzip_util.o usually works, but not always depending on make
order.

Second, it makes the final images which are built using a dts
dependent on that dts, so the image will be correctly rebuilt if the
dts changes. This in turn requires fixing the definition of the dts
variable. CONFIG_DEVICE_TREE from Kconfig will have quotes around it,
which don't matter when passing the variable to a shell, but which
need to be removed when incorporating it into a filename for make's
use.

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


# ac18c673 02-May-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Only build cuImage if CONFIG_DEVICE_TREE is non-empty

This allows the zImage target to once again be used to build
all supported image types, rather than requiring an explicit
"make uImage" to avoid failing to create an unneeded cuImage.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# a6afacb6 30-Apr-2007 David Gibson <david@gibson.dropbear.id.au>

[POWERPC] Small cleanups to the cuboot bootwrapper code

This patch makes a few small cleanups to the cuboot code.
- It removes the double layered selection of images, via
cuboot-plat-y, instead having the cuboot platforms directly select a
suitable image-y (this changes the name of the final cuboot image from
plain cuImage to cuImage.<platform>).
- Factors out some code in the wrapper that's potentially
useful to platforms other than uboot.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# d818d7ec 27-Apr-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: CONFIG_ -> CONFIG_DEVICE_TREE

A usage of CONFIG_DEVICE_TREE got accidentally truncated; this
fix allows out-of-tree dts files to work.

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


# 4536b937 26-Apr-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: cuImage for 85xx

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


# 928370c6 10-Apr-2007 Akinobu Mita <mita@fixstars.com>

[POWERPC] Enable make install

make help on powerpc says make install is available.
But it failed due to no rule to make install.

This patch enables make install to work.

Signed-off-by: Akinobu Mita <mita@fixstars.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 5cc5133a 16-Apr-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: cuboot for 83xx

This adds cuboot support for MPC83xx platforms.

A device tree used with this must have linux,stdout-path in /chosen and
linux,network-index in any network device nodes that need mac addresses
assigned.

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


# 0fdd717e 16-Apr-2007 Scott Wood <scottwood@freescale.com>

[POWERPC] bootwrapper: Add a cuboot platform and a cuImage target

The cuImage target will build a uImage with bootwrapper code and a device
tree. The default device tree and platform file are determined by the
kernel configuration.

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


# 1383a34f 28-Mar-2007 Milton Miller <miltonm@bga.com>

[POWERPC] bootwrapper: no-gzip fixes

Commit a9903811bf8d130a26004f9cb27b66513a267908 missed two uses of the
the .gz suffix in the wrapper script and didn't clean the additonal
possibly cached files.

Signed-off-by: Milton Miller <miltonm@bga.com>
Acked-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 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: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 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
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>


# 9da82a6d 21-Mar-2007 Milton Miller <miltonm@bga.com>

[POWERPC] boot: Use a common zImage rule

Before the plethora of platforms gets any worse, establish a common
rule to invoke the wrapper for any platform. Add arguments to
the rule for initrd, dts, dtb, etc. Show example usage with initrd.

Create default rules for zImage, and zImage.initrd. initrd targets
depend on the ramdisk file.

Don't consider targets for zImage.initrd that are targets for zImage.
This means uImage is no longer considered a target for zImage.initrd.

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


# 5d7960ff 21-Mar-2007 Milton Miller <miltonm@bga.com>

[POWERPC] boot: clean rule fixes

Now that obj-boot is in targets, we can remove (twice) it from clean-files.
zImage.initrd was missing, move zImage nearer where its used, and place
zImage.initrd next to it. Remove non-ported zImage.sandpoint, and add
auto-generation of unconfigured zImage.initrd* like image-.

Signed-off-by: Milton Miller <miltonm@bga.com>
--
Testing: did a few builds and cleans
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 235fd835 21-Mar-2007 Milton Miller <miltonm@bga.com>

[POWERPC] boot: Use FORCE

Kbuild if_changed and if_changed_dep require the use of the dummy
FORCE to get the dependencies right. Also add to targets to get
correct behavior.

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


# 65b58039 19-Mar-2007 Milton Miller <miltonm@bga.com>

[POWERPC] boot: rebuild when wrapper changes

Since there is magic defined per platform in the wrapper script, the
zImage targets should depend on it.

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


# cd197ffc 04-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.
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>


# ad9d2716 04-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
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>


# c347b798 02-Feb-2007 Ishizaki Kou <kou.ishizaki@toshiba.co.jp>

[POWERPC] Celleb: basic support

This patch adds base support for Celleb platform.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# d28d027a 18-Dec-2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>

[POWERPC] Fix build of cell zImage.initrd

The patch adding support for zImage.ps3 didn't add a zImage.initrd.ps3
target causing builds of zImage.initrd to fail when ps3 is included in
the .config. The current method of generating ps3 images doesn't support
initrd's yet, so we create a dummy target that only displays a warning
message instead.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 8a8944aa 04-Dec-2006 Geoff Levand <geoffrey.levand@am.sony.com>

[POWERPC] ps3: add a default zImage target

Add a powerpc make target that can be loaded by the ps3 bootloader (kboot) and
set this as the default image to build for that platform.

Until the compressed zImage wrapper is made, this arranges for a stripped
vmlinux image to be built.

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


# dc0f80aa 27-Nov-2006 Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>

[POWERPC] Clean images in arch/powerpc/boot

Add a rule to clean up the various generated image files in
arch/powerpc/boot.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 4ec64d56 27-Nov-2006 Arnd Bergmann <arnd@arndb.de>

[POWERPC] ps3: add a default zImage target

It's currently not possible to build the default zImage
target if PS3 is the only selected platform. This is
a hack to fall back to building the pseries style
zImage, so the build is successful. This will probably
change in the future, if someone writes a PS3 specific
boot wrapper.

Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>


# 7839af33 17-Nov-2006 Nicolas DET <nd@bplan-gmbh.de>

[POWERPC] Compile a zImage.chrp if PPC_EFIKA seleted

Signed-off-by: Nicolas DET <nd@bplan-gmbh.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 25787afa 08-Nov-2006 Mark A. Greer <mgreer@mvista.com>

[PATCH] Remove arch/powerpc/boot/zImage file.

The bootwrapper Makefile does not clean up the 'zImage' file that
may be left laying around. This patch removes it when cleaning that
directory.

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


# a0f46726 23-Oct-2006 Matthew McClintock <msm@freescale.com>

[POWERPC] Fixed some missing files to be deleted when running make clean

Fixed some missing files to be deleted when running make clean

Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 0cfcccb4 13-Oct-2006 Josh Boyer <jwboyer@linux.vnet.ibm.com>

[POWERPC] Add mktree utility to arch/powerpc/boot

This patch adds the mktree program that is needed to post process zImage
wrappers for various PowerPC 4xx boards

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 3688a0f4 18-Oct-2006 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Don't require execute perms on wrapper when building zImage.initrd

Don't require that the wrapper script be executable when building
zImage.initrds. This has already been fixed for zImages.

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


# 01a63720 16-Oct-2006 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Add simple memory allocator to bootwrapper

Provide primitive malloc, free, and realloc functions for bootwrapper.

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


# 0c176fa8 16-Oct-2006 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Add non-OF serial console support

Add serial console support for non-OF systems. There is a generic serial
console layer which calls a serial console driver. Included is the serial
console driver for the ns16550 class of uarts. Necessary support routines
are added as well.

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


# 6fb4efc6 16-Oct-2006 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Add flatdevtree source

Add the latest version of the flatdevtree code and corresponding glue.

A phandle table now tracks values returned by ft_find_device().
The value returned by ft_find_device() is a phandle which is really
an index into the phandle table. The phandle table contains the address
of the corresponding node. When the flat dt is edited/moved, the node
pointers in the phandle table are updated accordingly so no phandles kept
by the caller become stale.

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


# 020533ef 07-Oct-2006 Geoff Levand <geoffrey.levand@am.sony.com>

[POWERPC] cell: fix default zImage build target

Change CONFIG_PPC_CELL to CONFIG_PPC_IBM_CELL_BLADE in the powerpc boot
makefile.

CONFIG_PPC_CELL is used to build the generic cell processor support, and
is not an indication of platform.

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


# dcf90651 29-Sep-2006 Michael Ellerman <michael@ellerman.id.au>

[POWERPC] Fix boot wrapper invocation if CROSS_COMPILE contains spaces

My CROSS_COMPILE is "ccache /opt/compilers/blah", which confuses
the boot wrapper script. Quote CROSS_COMPILE and CROSS32_COMPILE
so they can safely contain spaces.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 5b9b5572 04-Oct-2006 Andrew Morton <akpm@osdl.org>

[PATCH] git-powerpc: wrapper: don't require execute permissions

If you lose the x bit (eg: by using patch(1)), powerpc won't build. Be
defensive about it...

Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 2bf11819 27-Sep-2006 Paul Mackerras <paulus@samba.org>

[POWERPC] Create a "wrapper" script and use it in arch/powerpc/boot

This puts the knowledge of how to create various sorts of zImage
wrappers into a script called "wrapper" that could be used outside of
the kernel tree. This changes arch/powerpc/boot so it first builds
the files that the wrapper script needs, then runs it to create
whatever flavours of zImage are required.

This version does uImages as well. The zImage names are changed
slightly; zImage.pseries is the one with the PT_NOTE program header
entry added, and zImage.pmac is the one without. If the
zImage.pseries gets made, it will also get hardlinked to zImage;
otherwise, if zImage.pmac is made, it gets hardlinked to zImage.

Signed-off-by: Paul Mackerras <paulus@samba.org>


# b2c5f619 18-Sep-2006 Mark A. Greer <mgreer@mvista.com>

[POWERPC] Start arch/powerpc/boot code reorganization

This abstracts the operations used in the bootwrapper, and defines
the operations needed for the bootwrapper to run on an OF platform.

The operations have been divided up into platform ops (platform_ops),
firmware ops (fw_ops), device tree ops (dt_ops), and console ops
(console_ops).

The proper operations will be hooked up at runtime to provide the
functionality that you need.

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


# fda7ffd2 02-Jul-2006 Niels Kristian Bech Jensen <nkbj@mail.tele.dk>

[POWERPC] Add -fno-stack-protector to BOOTCFLAGS in arch/powerpc/boot/Makefile.

I got some undefined references to __stack_chk_fail in
arch/powerpc/boot/stdio.o and arch/powerpc/boot/prom.o when I was trying
to build a kernel on Ubuntu Edgy Eft - which includes Stack Smashing
Protection.

This patch adds -fno-stack-protector to BOOTCFLAGS in
arch/powerpc/boot/Makefile (why does BOOTCFLAGS depend on HOSTCFLAGS and
not CFLAGS?).

Regards,
Niels Kristian Bech Jensen

Signed-off-by: Paul Mackerras <paulus@samba.org>


# 4f3865fb 22-Jun-2006 Richard Purdie <rpurdie@rpsys.net>

[PATCH] zlib_inflate: Upgrade library code to a recent version

Upgrade the zlib_inflate implementation in the kernel from a patched
version 1.1.3/4 to a patched 1.2.3.

The code in the kernel is about seven years old and I noticed that the
external zlib library's inflate performance was significantly faster (~50%)
than the code in the kernel on ARM (and faster again on x86_32).

For comparison the newer deflate code is 20% slower on ARM and 50% slower
on x86_32 but gives an approx 1% compression ratio improvement. I don't
consider this to be an improvement for kernel use so have no plans to
change the zlib_deflate code.

Various changes have been made to the zlib code in the kernel, the most
significant being the extra functions/flush option used by ppp_deflate.
This update reimplements the features PPP needs to ensure it continues to
work.

This code has been tested on ARM under both JFFS2 (with zlib compression
enabled) and ppp_deflate and on x86_32. JFFS2 sees an approx. 10% real
world file read speed improvement.

This patch also removes ZLIB_VERSION as it no longer has a correct value.
We don't need version checks anyway as the kernel's module handling will
take care of that for us. This removal is also more in keeping with the
zlib author's wishes (http://www.zlib.net/zlib_faq.html#faq24) and I've
added something to the zlib.h header to note its a modified version.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Joern Engel <joern@wh.fh-wedel.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 9216ad8c 14-Jan-2006 Paul Mackerras <paulus@samba.org>

powerpc/32: Generate miboot images with ARCH=powerpc

Miboot images are apparently still used on some old 32-bit powermacs,
so build them with ARCH=powerpc if we're 32-bit and powermac support
is enabled.

Signed-off-by: Paul Mackerras <paulus@samba.org>


# 66a45dd3 13-Jan-2006 Paul Mackerras <paulus@samba.org>

powerpc: Make COFF zImages for old 32-bit powermacs

This adds code to build zImage.coff and/or zImage.initrd.coff when
CONFIG_PPC32 and CONFIG_PPC_PMAC are defined. It also restructures
the OF client code and adds some workarounds for OF quirks on the
older machines.

Signed-off-by: Paul Mackerras <paulus@samba.org>


# 886c98d7 10-Jan-2006 Kumar Gala <galak@gate.crashing.org>

[PATCH] powerpc: Fix clean_files in arch/powerpc/boot Makefile

clean-files was being set twice rather than being appended to.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 706e6b2c 23-Nov-2005 Kumar Gala <galak@gate.crashing.org>

[PATCH] powerpc: Fix suboptimal uImage target

Sam Ravnborg pointed out that calling if_changed was redundant in the
rule since a prerequisite had to have changed for us to get there.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 8c441a57 22-Nov-2005 Kumar Gala <galak@gate.crashing.org>

[PATCH] powerpc: Add support for building uImages

powerpc: Add support for building uImages

Add support to build a kernel image bootable by u-boot.
Most of the makefile foo is taken from arch/ppc/boot/images/Makefile

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>


# 94b212c2 15-Nov-2005 Paul Mackerras <paulus@samba.org>

powerpc: Move ppc64 boot wrapper code over to arch/powerpc

This also extends the code to handle 32-bit ELF vmlinux files as well
as 64-bit ones. This is sufficient for booting on new-world 32-bit
powermacs (i.e. all recent machines).

Signed-off-by: Paul Mackerras <paulus@samba.org>