Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7fdd90b authored by Paul Mackerras's avatar Paul Mackerras
Browse files

[PATCH] ppc: Remove powermac support from ARCH=ppc



This makes it possible to build kernels for PReP and/or CHRP
with ARCH=ppc by removing the (non-building) powermac support.
It's now also possible to select PReP and CHRP independently.
Powermac users should now build with ARCH=powerpc instead of
ARCH=ppc.  (This does mean that it is no longer possible to
build a 32-bit kernel for a G5.)

Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e8625d46
Loading
Loading
Loading
Loading
+22 −51
Original line number Diff line number Diff line
@@ -58,11 +58,11 @@ config 6xx
	help
	  There are four types of PowerPC chips supported.  The more common
	  types (601, 603, 604, 740, 750, 7400), the Motorola embedded
	  versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the IBM embedded
	  versions (403 and 405) and the high end 64 bit Power processors
	  (POWER 3, POWER4, and IBM 970 also known as G5)
	  versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the IBM
	  embedded versions (403 and 405) and the POWER3 processor.
	  (For support for more recent 64-bit processors, set ARCH=powerpc.)
	  Unless you are building a kernel for one of the embedded processor
	  systems, 64 bit IBM RS/6000 or an Apple G5, choose 6xx.
	  systems or a POWER3-based IBM RS/6000, choose 6xx.
	  Note that the kernel runs in 32-bit mode even on 64-bit chips.
	  Also note that because the 52xx, 82xx, & 83xx family has a 603e core,
	  specific support for that chipset is asked later on.
@@ -77,10 +77,6 @@ config POWER3
	select PPC_FPU
	bool "POWER3"

config POWER4
	select PPC_FPU
	bool "POWER4 and 970 (G5)"

config 8xx
	bool "8xx"

@@ -123,7 +119,7 @@ config PHYS_64BIT

config ALTIVEC
	bool "AltiVec Support"
	depends on 6xx || POWER4
	depends on 6xx
	depends on !8260 && !83xx
	---help---
	  This option enables kernel support for the Altivec extensions to the
@@ -235,18 +231,9 @@ config KEXEC

source "drivers/cpufreq/Kconfig"

config CPU_FREQ_PMAC
	bool "Support for Apple PowerBooks"
	depends on CPU_FREQ && ADB_PMU
	select CPU_FREQ_TABLE
	help
	  This adds support for frequency switching on Apple PowerBooks,
	  this currently includes some models of iBook & Titanium
	  PowerBook.

config PPC601_SYNC_FIX
	bool "Workarounds for PPC601 bugs"
	depends on 6xx && (PPC_PREP || PPC_PMAC)
	depends on 6xx && PPC_PREP
	help
	  Some versions of the PPC601 (the first PowerPC chip) have bugs which
	  mean that extra synchronization instructions are required near
@@ -258,26 +245,17 @@ config PPC601_SYNC_FIX

	  If in doubt, say Y here.

config HOTPLUG_CPU
	bool "Support for enabling/disabling CPUs"
	depends on SMP && HOTPLUG && EXPERIMENTAL && PPC_PMAC
	---help---
	  Say Y here to be able to disable and re-enable individual
	  CPUs at runtime on SMP machines.

	  Say N if you are unsure.

source arch/ppc/platforms/4xx/Kconfig
source arch/ppc/platforms/85xx/Kconfig

config PPC64BRIDGE
	bool
	depends on POWER3 || POWER4
	depends on POWER3
	default y

config PPC_STD_MMU
	bool
	depends on 6xx || POWER3 || POWER4
	depends on 6xx || POWER3
	default y

config NOT_COHERENT_CACHE
@@ -505,7 +483,7 @@ endchoice

choice
	prompt "Machine Type"
	depends on 6xx || POWER3 || POWER4
	depends on 6xx || POWER3
	default PPC_MULTIPLATFORM
	---help---
	  Linux currently supports several different kinds of PowerPC-based
@@ -516,11 +494,15 @@ choice
	  Platform) machines (including all of the recent IBM RS/6000 and
	  pSeries machines), and several embedded PowerPC systems containing
	  4xx, 6xx, 7xx, 8xx, 74xx, and 82xx processors.  Currently, the
	  default option is to build a kernel which works on the first three.
	  default option is to build a kernel which works on PReP and CHRP.

	  Select CHRP/PowerMac/PReP if configuring for an IBM RS/6000 or
	  pSeries machine, a Power Macintosh (including iMacs, iBooks and
	  Powerbooks), or a PReP machine.
	  Note that support for Apple machines is now only available with
	  ARCH=powerpc, and has been removed from this menu.  If you wish
	  to build a kernel for an Apple machine, exit this configuration
	  process and re-run it with ARCH=powerpc.

	  Select CHRP/PReP if configuring for an IBM RS/6000 or
	  pSeries machine, or a PReP machine.

	  Select Gemini if configuring for a Synergy Microsystems' Gemini
	  series Single Board Computer.  More information is available at:
@@ -530,7 +512,7 @@ choice
	  available at: <http://linux-apus.sourceforge.net/>.

config PPC_MULTIPLATFORM
	bool "CHRP/PowerMac/PReP"
	bool "CHRP/PReP"

config APUS
	bool "Amiga-APUS"
@@ -768,25 +750,14 @@ config CPM2
	  on it (826x, 827x, 8560).

config PPC_CHRP
	bool
	bool "Support for CHRP (Common Hardware Reference Platform) machines"
	depends on PPC_MULTIPLATFORM
	select PPC_I8259
	select PPC_INDIRECT_PCI
	default y

config PPC_PMAC
	bool
	depends on PPC_MULTIPLATFORM
	select PPC_INDIRECT_PCI
	default y

config PPC_PMAC64
	bool
	depends on PPC_PMAC && POWER4
	default y

config PPC_PREP
	bool
	bool "Support for PReP (PowerPC Reference Platform) machines"
	depends on PPC_MULTIPLATFORM
	select PPC_I8259
	select PPC_INDIRECT_PCI
@@ -794,7 +765,7 @@ config PPC_PREP

config PPC_OF
	bool
	depends on PPC_PMAC || PPC_CHRP
	depends on PPC_CHRP
	default y

config PPC_GEN550
@@ -1166,7 +1137,7 @@ config ISA

config GENERIC_ISA_DMA
	bool
	depends on POWER3 || POWER4 || 6xx && !CPM2
	depends on POWER3 || 6xx && !CPM2
	default y

config PPC_I8259
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
bootdir-y			:= simple
bootdir-$(CONFIG_PPC_OF)	+= openfirmware
subdir-y			:= lib common images
subdir-$(CONFIG_PPC_OF)		+= of1275
subdir-$(CONFIG_PPC_MULTIPLATFORM)	+= of1275

# for cleaning
subdir-				+= simple openfirmware
+9 −87
Original line number Diff line number Diff line
@@ -21,26 +21,16 @@ bootlib := $(boot)/lib
of1275	:= $(boot)/of1275
images	:= $(boot)/images

OBJCOPY_ARGS	:= -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
COFF_LD_ARGS	:= -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x00500000 \
			-Bstatic
CHRP_LD_ARGS	:= -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x00800000
NEWWORLD_LD_ARGS:= -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x01000000

COMMONOBJS	:= start.o misc.o common.o
COFFOBJS	:= coffcrt0.o $(COMMONOBJS) coffmain.o
CHRPOBJS	:= crt0.o     $(COMMONOBJS) chrpmain.o
NEWWORLDOBJS	:= crt0.o     $(COMMONOBJS) newworldmain.o

targets 	:= $(COFFOBJS) $(CHRPOBJS) $(NEWWORLDOBJS) dummy.o
COFFOBJS	:= $(addprefix $(obj)/, $(COFFOBJS))
targets 	:= $(CHRPOBJS) dummy.o
CHRPOBJS	:= $(addprefix $(obj)/, $(CHRPOBJS))
NEWWORLDOBJS	:= $(addprefix $(obj)/, $(NEWWORLDOBJS))

LIBS		:= lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a

HACKCOFF := $(utils)/hack-coff

ifdef CONFIG_SMP
END := .smp
endif
@@ -72,56 +62,11 @@ targets += image.initrd.o
$(obj)/image.initrd.o: $(obj)/image.o $(images)/ramdisk.image.gz FORCE
	$(call if_changed,genimage-initrd)

# Create the note section for New-World PowerMacs.
quiet_cmd_mknote = MKNOTE  $@
     cmd_mknote  = $(utils)/mknote > $@
targets		+= note
$(obj)/note: $(utils)/mknote FORCE
	$(call if_changed,mknote)


$(obj)/coffcrt0.o: EXTRA_AFLAGS := -DXCOFF
targets += coffcrt0.o crt0.o
$(obj)/coffcrt0.o $(obj)/crt0.o: $(common)/crt0.S FORCE
targets += crt0.o
$(obj)/crt0.o: $(common)/crt0.S FORCE
	$(call if_changed_dep,as_o_S)

quiet_cmd_gencoffb = COFF    $@
      cmd_gencoffb = $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) $< $(LIBS) && \
                     $(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
targets += coffboot
$(obj)/coffboot: $(obj)/image.o $(COFFOBJS) $(LIBS) $(srctree)/$(boot)/ld.script FORCE
	$(call if_changed,gencoffb)
targets += coffboot.initrd
$(obj)/coffboot.initrd: $(obj)/image.initrd.o $(COFFOBJS) $(LIBS) \
			$(srctree)/$(boot)/ld.script FORCE
	$(call if_changed,gencoffb)


quiet_cmd_gen-coff = COFF    $@
      cmd_gen-coff = $(OBJCOPY) $(OBJCOPY_ARGS) $< $@ && \
			$(HACKCOFF) $@ && \
			ln -sf $(notdir $@) $(images)/zImage$(initrd).pmac

$(images)/vmlinux.coff: $(obj)/coffboot
	$(call cmd,gen-coff)

$(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd
	$(call cmd,gen-coff)

quiet_cmd_gen-elf-pmac = ELF     $@
      cmd_gen-elf-pmac = $(LD) $(NEWWORLD_LD_ARGS) -o $@ \
				$(NEWWORLDOBJS) $(LIBS) $< && \
			$(OBJCOPY) $@ $@ --add-section=.note=$(obj)/note \
					 -R .comment $(del-ramdisk-sec)

$(images)/vmlinux.elf-pmac: $(obj)/image.o $(NEWWORLDOBJS) $(LIBS) \
			$(obj)/note $(srctree)/$(boot)/ld.script
	$(call cmd,gen-elf-pmac)
$(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \
				   $(LIBS) $(obj)/note \
				   $(srctree)/$(boot)/ld.script
	$(call cmd,gen-elf-pmac)

quiet_cmd_gen-chrp = CHRP    $@
      cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $(CHRPOBJS) $< $(LIBS) && \
			$(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
@@ -139,46 +84,23 @@ $(images)/zImage.chrp-rs6k $(images)/zImage.initrd.chrp-rs6k: \
	%-rs6k: %
	$(call cmd,addnote)

quiet_cmd_gen-miboot = GEN     $@
      cmd_gen-miboot = $(OBJCOPY) $(OBJCOPY_ARGS) \
		       --add-section=$1=$(word 2, $^) $< $@
$(images)/miboot.image: $(obj)/dummy.o $(images)/vmlinux.gz
	$(call cmd,gen-miboot,image)

$(images)/miboot.initrd.image: $(images)/miboot.image $(images)/ramdisk.image.gz
	$(call cmd,gen-miboot,initrd)

# The targets used on the make command-line

.PHONY: zImage zImage.initrd
zImage:		 $(images)/vmlinux.coff 	\
		 $(images)/vmlinux.elf-pmac	\
		 $(images)/zImage.chrp		\
		 $(images)/zImage.chrp-rs6k	\
		 $(images)/miboot.image
zImage:		 $(images)/zImage.chrp		\
		 $(images)/zImage.chrp-rs6k
	@echo '  kernel: $@ is ready ($<)'
zImage.initrd:	 $(images)/vmlinux.initrd.coff 		\
		 $(images)/vmlinux.initrd.elf-pmac	\
		 $(images)/zImage.initrd.chrp		\
		 $(images)/zImage.initrd.chrp-rs6k	\
		 $(images)/miboot.initrd.image
zImage.initrd:	 $(images)/zImage.initrd.chrp		\
		 $(images)/zImage.initrd.chrp-rs6k
	@echo '  kernel: $@ is ready ($<)'

TFTPIMAGE	:= /tftpboot/zImage

.PHONY: znetboot znetboot.initrd
znetboot:	$(images)/vmlinux.coff		\
		$(images)/vmlinux.elf-pmac	\
		$(images)/zImage.chrp
	cp $(images)/vmlinux.coff     $(TFTPIMAGE).pmac$(END)
	cp $(images)/vmlinux.elf-pmac $(TFTPIMAGE).pmac$(END).elf
znetboot:	$(images)/zImage.chrp
	cp $(images)/zImage.chrp      $(TFTPIMAGE).chrp$(END)
	@echo '  kernel: $@ is ready ($<)'
znetboot.initrd:$(images)/vmlinux.initrd.coff		\
		$(images)/vmlinux.initrd.elf-pmac	\
		$(images)/zImage.initrd.chrp
	cp $(images)/vmlinux.initrd.coff     $(TFTPIMAGE).pmac$(END)
	cp $(images)/vmlinux.initrd.elf-pmac $(TFTPIMAGE).pmac$(END).elf
znetboot.initrd:$(images)/zImage.initrd.chrp
	cp $(images)/zImage.initrd.chrp      $(TFTPIMAGE).chrp$(END)
	@echo '  kernel: $@ is ready ($<)'
+0 −101
Original line number Diff line number Diff line
/*
 * Copyright (C) Paul Mackerras 1997.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */
#include <linux/string.h>
#include <asm/processor.h>
#include <asm/page.h>

#include "nonstdio.h"
#include "of1275.h"

/* Passed from the linker */
extern char __image_begin, __image_end;
extern char __ramdisk_begin[], __ramdisk_end;
extern char _start, _end;

extern char image_data[], initrd_data[];
extern int initrd_len, image_len;
extern unsigned int heap_max;
extern void flush_cache(void *start, unsigned int len);
extern void gunzip(void *, int, unsigned char *, int *);
extern void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
		unsigned int progend);
extern void setup_bats(unsigned long start);

char *avail_ram;
char *begin_avail, *end_avail;
char *avail_high;

#define SCRATCH_SIZE	(128 << 10)

static char heap[SCRATCH_SIZE];

static unsigned long ram_start = 0;
static unsigned long ram_end = 0x1000000;

static unsigned long prog_start = 0x800000;
static unsigned long prog_size = 0x700000;

typedef void (*kernel_start_t)(int, int, void *);

void boot(int a1, int a2, void *prom)
{
    unsigned sa, len;
    void *dst;
    unsigned char *im;
    unsigned initrd_start, initrd_size;

    printf("coffboot starting: loaded at 0x%p\n", &_start);
    setup_bats(ram_start);

    initrd_size = (char *)(&__ramdisk_end) - (char *)(&__ramdisk_begin);
    if (initrd_size) {
	initrd_start = (ram_end - initrd_size) & ~0xFFF;
	a1 = initrd_start;
	a2 = initrd_size;
	claim(initrd_start, ram_end - initrd_start, 0);
	printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n\r",
	       initrd_start, (char *)(&__ramdisk_begin), initrd_size);
	memcpy((char *)initrd_start, (char *)(&__ramdisk_begin), initrd_size);
	prog_size = initrd_start - prog_start;
    } else
	a2 = 0xdeadbeef;

    im = (char *)(&__image_begin);
    len = (char *)(&__image_end) - (char *)(&__image_begin);
    /* claim 4MB starting at PROG_START */
    claim(prog_start, prog_size, 0);
    map(prog_start, prog_start, prog_size);
    dst = (void *) prog_start;
    if (im[0] == 0x1f && im[1] == 0x8b) {
	/* set up scratch space */
	begin_avail = avail_high = avail_ram = heap;
	end_avail = heap + sizeof(heap);
	printf("heap at 0x%p\n", avail_ram);
	printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len);
	gunzip(dst, prog_size, im, &len);
	printf("done %u bytes\n", len);
	printf("%u bytes of heap consumed, max in use %u\n",
	       avail_high - begin_avail, heap_max);
    } else {
	memmove(dst, im, len);
    }

    flush_cache(dst, len);
    make_bi_recs(((unsigned long) dst + len), "coffboot", _MACH_Pmac,
		    (prog_start + prog_size));

    sa = (unsigned long)prog_start;
    printf("start address = 0x%x\n", sa);

    (*(kernel_start_t)sa)(a1, a2, prom);

    printf("returned?\n");

    pause();
}
+0 −94
Original line number Diff line number Diff line
/*
 * Copyright (C) Paul Mackerras 1997.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */
#include <linux/string.h>
#include "nonstdio.h"
#include "of1275.h"
#include <asm/processor.h>
#include <asm/page.h>

/* Passed from the linker */
extern char __image_begin, __image_end;
extern char __ramdisk_begin[], __ramdisk_end;
extern char _start, _end;

extern unsigned int heap_max;
extern void flush_cache(void *start, unsigned int len);
extern void gunzip(void *, int, unsigned char *, int *);
extern void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
		unsigned int progend);

char *avail_ram;
char *begin_avail, *end_avail;
char *avail_high;


#define RAM_END		(16 << 20)

#define PROG_START	0x00010000
#define PROG_SIZE	0x007f0000

#define SCRATCH_SIZE	(128 << 10)

typedef void (*kernel_start_t)(int, int, void *);

void boot(int a1, int a2, void *prom)
{
    unsigned sa, len;
    void *dst;
    unsigned char *im;
    unsigned initrd_start, initrd_size;

    printf("chrpboot starting: loaded at 0x%p\n", &_start);

    initrd_size = (char *)(&__ramdisk_end) - (char *)(&__ramdisk_begin);
    if (initrd_size) {
	initrd_start = (RAM_END - initrd_size) & ~0xFFF;
	a1 = initrd_start;
	a2 = initrd_size;
	claim(initrd_start, RAM_END - initrd_start, 0);
	printf("initial ramdisk moving 0x%x <- 0x%p (%x bytes)\n\r",
	       initrd_start, (char *)(&__ramdisk_begin), initrd_size);
	memcpy((char *)initrd_start, (char *)(&__ramdisk_begin), initrd_size);
    } else
	a2 = 0xdeadbeef;

    im = (char *)(&__image_begin);
    len = (char *)(&__image_end) - (char *)(&__image_begin);
    /* claim 3MB starting at PROG_START */
    claim(PROG_START, PROG_SIZE, 0);
    dst = (void *) PROG_START;
    if (im[0] == 0x1f && im[1] == 0x8b) {
	/* claim some memory for scratch space */
	avail_ram = (char *) claim(0, SCRATCH_SIZE, 0x10);
	begin_avail = avail_high = avail_ram;
	end_avail = avail_ram + SCRATCH_SIZE;
	printf("heap at 0x%p\n", avail_ram);
	printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len);
	gunzip(dst, PROG_SIZE, im, &len);
	printf("done %u bytes\n", len);
	printf("%u bytes of heap consumed, max in use %u\n",
	       avail_high - begin_avail, heap_max);
	release(begin_avail, SCRATCH_SIZE);
    } else {
	memmove(dst, im, len);
    }

    flush_cache(dst, len);
    make_bi_recs(((unsigned long) dst + len), "chrpboot", _MACH_Pmac,
		    (PROG_START + PROG_SIZE));

    sa = (unsigned long)PROG_START;
    printf("start address = 0x%x\n", sa);

    (*(kernel_start_t)sa)(a1, a2, prom);

    printf("returned?\n");

    pause();
}
Loading