Commit 710d2b9d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc: netboot build fixes

From: Tom Rini <trini@kernel.crashing.org>

The following patch fixes the 'znetboot' and 'znetbootrd' targets so that
they work again.

- Update the comments to reflect how things work with the correct
  usages now.

- Fix the znetboot / znetbootrd targets.  We now always set end-y,
  and use this to figure out what image will be tftpboot'ed.
parent 6bac5cc7
...@@ -4,30 +4,38 @@ ...@@ -4,30 +4,38 @@
# Author: Tom Rini <trini@mvista.com> # Author: Tom Rini <trini@mvista.com>
# #
# Notes: # Notes:
# (1) For machine targets which produce more than one image, define # (1) For machines that do not want to use the ELF image directly (including
# ZNETBOOT and ZNETBOOTRD to the image which should be available for # stripping just the ELF header off), they must set the variables
# 'znetboot' and 'znetboot.initrd` # zimage-$(CONFIG_MACHINE) and zimagerd-$(CONFIG_MACHINE) to the target
# (2) Also, for machine targets which just need to remove the ELF header, # that produces the desired image and they must set end-$(CONFIG_MACHINE)
# define END to be the machine name you want in the image. # to what will be suffixed to the image filename.
# (3) For machine targets which use the mktree program, define END to be # (2) Regardless of (1), to have the resulting image be something other
# the machine name you want in the image, and you can optionally set # than 'zImage.elf', set end-$(CONFIG_MACHINE) to be the suffix used for
# ENTRYPOINT which the image should be loaded at. The optimal setting # the zImage, znetboot, and znetbootrd targets.
# for ENTRYPOINT is the link address. # (3) For machine targets which use the mktree program, you can optionally
# set entrypoint-$(CONFIG_MACHINE) to the location which the image should be
# loaded at. The optimal setting for entrypoint-$(CONFIG_MACHINE) is the link
# address.
# (4) It is advisable to pass in the memory size using BI_MEMSIZE and # (4) It is advisable to pass in the memory size using BI_MEMSIZE and
# get_mem_size(), which is memory controller dependent. Add in the correct # get_mem_size(), which is memory controller dependent. Add in the correct
# XXX_memory.o file for this to work, as well as editing the $(MISC) file. # XXX_memory.o file for this to work, as well as editing the
# misc-$(CONFIG_MACHINE) variable.
boot := arch/ppc/boot boot := arch/ppc/boot
common := $(boot)/common common := $(boot)/common
utils := $(boot)/utils utils := $(boot)/utils
bootlib := $(boot)/lib bootlib := $(boot)/lib
images := $(boot)/images images := $(boot)/images
tftpboot := /tftpboot
# Normally, we use the 'misc.c' file for decompress_kernel and # Normally, we use the 'misc.c' file for decompress_kernel and
# whatnot. Sometimes we need to override this however. # whatnot. Sometimes we need to override this however.
misc-y := misc.o misc-y := misc.o
# Normally, we have our images end in .elf, but something we want to
# change this.
end-y := elf
# Additionally, we normally don't need to mess with the L2 / L3 caches # Additionally, we normally don't need to mess with the L2 / L3 caches
# if present on 'classic' PPC. # if present on 'classic' PPC.
cacheflag-y := -DCLEAR_CACHES="" cacheflag-y := -DCLEAR_CACHES=""
...@@ -41,35 +49,31 @@ clear_L2_L3 := $(boot)/simple/clear.S ...@@ -41,35 +49,31 @@ clear_L2_L3 := $(boot)/simple/clear.S
zimage-$(CONFIG_IBM_OPENBIOS) := zImage-TREE zimage-$(CONFIG_IBM_OPENBIOS) := zImage-TREE
zimageinitrd-$(CONFIG_IBM_OPENBIOS) := zImage.initrd-TREE zimageinitrd-$(CONFIG_IBM_OPENBIOS) := zImage.initrd-TREE
end-$(CONFIG_IBM_OPENBIOS) := treeboot end-$(CONFIG_IBM_OPENBIOS) := treeboot
tftpimage-$(CONFIG_IBM_OPENBIOS) := /tftpboot/zImage.$(end-y)
misc-$(CONFIG_IBM_OPENBIOS) := misc-embedded.o misc-$(CONFIG_IBM_OPENBIOS) := misc-embedded.o
tftpimage-$(CONFIG_EMBEDDEDBOOT) := /tftpboot/zImage.embedded end-$(CONFIG_EMBEDDEDBOOT) := embedded
misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o misc-$(CONFIG_EMBEDDEDBOOT) := misc-embedded.o
zimage-$(CONFIG_EBONY) := zImage-TREE zimage-$(CONFIG_EBONY) := zImage-TREE
zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE zimageinitrd-$(CONFIG_EBONY) := zImage.initrd-TREE
end-$(CONFIG_EBONY) := ebony end-$(CONFIG_EBONY) := ebony
entrypoint-$(CONFIG_EBONY) := 0x01000000 entrypoint-$(CONFIG_EBONY) := 0x01000000
tftpimage-$(CONFIG_EBONY) := /tftpboot/zImage.$(end-y)
zimage-$(CONFIG_OCOTEA) := zImage-TREE zimage-$(CONFIG_OCOTEA) := zImage-TREE
zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE zimageinitrd-$(CONFIG_OCOTEA) := zImage.initrd-TREE
end-$(CONFIG_OCOTEA) := ocotea end-$(CONFIG_OCOTEA) := ocotea
entrypoint-$(CONFIG_OCOTEA) := 0x01000000 entrypoint-$(CONFIG_OCOTEA) := 0x01000000
tftpimage-$(CONFIG_OCOTEA) := /tftpboot/zImage.$(end-y)
extra.o-$(CONFIG_EV64260) := direct.o misc-ev64260.o extra.o-$(CONFIG_EV64260) := direct.o misc-ev64260.o
tftpimage-$(CONFIG_EV64260) := /tftpboot/zImage.ev64260 end-$(CONFIG_EV64260) := ev64260
cacheflag-$(CONFIG_EV64260) := -include $(clear_L2_L3) cacheflag-$(CONFIG_EV64260) := -include $(clear_L2_L3)
zimage-$(CONFIG_GEMINI) := zImage-STRIPELF zimage-$(CONFIG_GEMINI) := zImage-STRIPELF
zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF zimageinitrd-$(CONFIG_GEMINI) := zImage.initrd-STRIPELF
end-$(CONFIG_GEMINI) := gemini end-$(CONFIG_GEMINI) := gemini
tftpimage-$(CONFIG_GEMINI) := /tftpboot/zImage.$(end-y)
extra.o-$(CONFIG_K2) := legacy.o extra.o-$(CONFIG_K2) := legacy.o
tftpimage-$(CONFIG_K2) := /tftpboot/zImage.k2 end-$(CONFIG_K2) := k2
cacheflag-$(CONFIG_K2) := -include $(clear_L2_L3) cacheflag-$(CONFIG_K2) := -include $(clear_L2_L3)
# kconfig 'feature', only one of these will ever be 'y' at a time. # kconfig 'feature', only one of these will ever be 'y' at a time.
...@@ -81,9 +85,7 @@ pcore := $(CONFIG_PCORE)$(CONFIG_POWERPMC250) ...@@ -81,9 +85,7 @@ pcore := $(CONFIG_PCORE)$(CONFIG_POWERPMC250)
zimage-$(motorola) := zImage-PPLUS zimage-$(motorola) := zImage-PPLUS
zimageinitrd-$(motorola) := zImage.initrd-PPLUS zimageinitrd-$(motorola) := zImage.initrd-PPLUS
tftpimage-$(motorola) := /tftpboot/zImage.pplus end-$(motorola) := pplus
znetboot-$(motorola) := zImage.pplus
znetbootrd-$(motorola) := zImage.initrd.pplus
# Overrides previous assingment # Overrides previous assingment
extra.o-$(CONFIG_PPLUS) := legacy.o extra.o-$(CONFIG_PPLUS) := legacy.o
...@@ -92,10 +94,9 @@ zimageinitrd-$(motorola) := zImage.initrd-PPLUS ...@@ -92,10 +94,9 @@ zimageinitrd-$(motorola) := zImage.initrd-PPLUS
zimageinitrd-$(pcore) := zImage.initrd-STRIPELF zimageinitrd-$(pcore) := zImage.initrd-STRIPELF
extra.o-$(pcore) := chrpmap.o extra.o-$(pcore) := chrpmap.o
end-$(pcore) := pcore end-$(pcore) := pcore
tftpimage-$(pcore) := /tftpboot/zImage.$(end-y)
cacheflag-$(pcore) := -include $(clear_L2_L3) cacheflag-$(pcore) := -include $(clear_L2_L3)
tftpimage-$(CONFIG_SANDPOINT) := /tftpboot/zImage.sandpoint end-$(CONFIG_SANDPOINT) := sandpoint
cacheflag-$(CONFIG_SANDPOINT) := -include $(clear_L2_L3) cacheflag-$(CONFIG_SANDPOINT) := -include $(clear_L2_L3)
zimage-$(CONFIG_SPRUCE) := zImage-TREE zimage-$(CONFIG_SPRUCE) := zImage-TREE
...@@ -103,11 +104,9 @@ zimageinitrd-$(CONFIG_SPRUCE) := zImage.initrd-TREE ...@@ -103,11 +104,9 @@ zimageinitrd-$(CONFIG_SPRUCE) := zImage.initrd-TREE
end-$(CONFIG_SPRUCE) := spruce end-$(CONFIG_SPRUCE) := spruce
entrypoint-$(CONFIG_SPRUCE) := 0x00800000 entrypoint-$(CONFIG_SPRUCE) := 0x00800000
misc-$(CONFIG_SPRUCE) := misc-spruce.o misc-$(CONFIG_SPRUCE) := misc-spruce.o
tftpimage-$(CONFIG_SPRUCE) := /tftpboot/zImage.$(end-y)
# tftp image is prefixed with .smp if compiled for SMP # SMP images should have a '.smp' suffix.
tftpimage-$(CONFIG_SMP) += .smp end-$(CONFIG_SMP) += .smp
# This is a treeboot that needs init functions until the # This is a treeboot that needs init functions until the
# boot rom is sorted out (i.e. this is short lived) # boot rom is sorted out (i.e. this is short lived)
...@@ -181,18 +180,10 @@ zImage.initrd: $(images)/$(zimageinitrd-y) $(obj)/zvmlinux.initrd ...@@ -181,18 +180,10 @@ zImage.initrd: $(images)/$(zimageinitrd-y) $(obj)/zvmlinux.initrd
rm -f $(obj)/zvmlinux.initrd rm -f $(obj)/zvmlinux.initrd
znetboot: zImage znetboot: zImage
ifneq ($(ZNETBOOT),) cp $(images)/zImage.$(end-y) $(tftpboot)/zImage.$(end-y)
cp $(images)/$(ZNETBOOT) $(tftpimage-y)
else
cp $(images)/zImage.* $(tftpimage-y)
endif
znetboot.initrd: zImage.initrd znetboot.initrd: zImage.initrd
ifneq ($(znetbootrd-y),) cp $(images)/zImage.initrd.$(end-y) $(tftpboot)/zImage.initrd.$(end-y)
cp $(images)/$(znetbootrd-y) $(tftpimage-y)
else
cp $(images)/zImage.* $(tftpimage-y)
endif
$(images)/zImage-STRIPELF: $(obj)/zvmlinux $(images)/zImage-STRIPELF: $(obj)/zvmlinux
dd if=$(obj)/zvmlinux of=$(images)/zImage.$(end-y) skip=64 bs=1k dd if=$(obj)/zvmlinux of=$(images)/zImage.$(end-y) skip=64 bs=1k
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment