Commit 0a26b136 authored by Paul Mackerras's avatar Paul Mackerras

ppc: Remove CHRP, POWER3 and POWER4 support from arch/ppc

32-bit CHRP machines are now supported only in arch/powerpc, as are
all 64-bit PowerPC processors.  This means that we don't use
Open Firmware on any platform in arch/ppc any more.

This makes PReP support a single-platform option like every other
platform support option in arch/ppc now, thus CONFIG_PPC_MULTIPLATFORM
is gone from arch/ppc.  CONFIG_PPC_PREP is the option that selects
PReP support and is generally what has replaced
CONFIG_PPC_MULTIPLATFORM within arch/ppc.

_machine is all but dead now, being #defined to 0.

Updated Makefiles, comments and Kconfig options generally to reflect
these changes.
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent ff2e6d7e
...@@ -61,15 +61,15 @@ config 6xx ...@@ -61,15 +61,15 @@ config 6xx
select PPC_FPU select PPC_FPU
help help
There are four types of PowerPC chips supported. The more common There are four types of PowerPC chips supported. The more common
types (601, 603, 604, 740, 750, 7400), the Motorola embedded types (601, 603, 604, 740, 750, 7400), the older Freescale
versions (821, 823, 850, 855, 860, 52xx, 82xx, 83xx), the IBM (formerly Motorola) embedded versions (821, 823, 850, 855, 860,
embedded versions (403 and 405) and the POWER3 processor. 52xx, 82xx, 83xx), the IBM embedded versions (403 and 405) and
(For support for more recent 64-bit processors, set ARCH=powerpc.) the Book E embedded processors from IBM (44x) and Freescale (85xx).
For support for 64-bit processors, set ARCH=powerpc.
Unless you are building a kernel for one of the embedded processor Unless you are building a kernel for one of the embedded processor
systems or a POWER3-based IBM RS/6000, choose 6xx. systems, 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 have a 603e
Also note that because the 52xx, 82xx, & 83xx family has a 603e core, core, specific support for that chipset is asked later on.
specific support for that chipset is asked later on.
config 40x config 40x
bool "40x" bool "40x"
...@@ -77,10 +77,6 @@ config 40x ...@@ -77,10 +77,6 @@ config 40x
config 44x config 44x
bool "44x" bool "44x"
config POWER3
select PPC_FPU
bool "POWER3"
config 8xx config 8xx
bool "8xx" bool "8xx"
...@@ -252,14 +248,9 @@ config PPC601_SYNC_FIX ...@@ -252,14 +248,9 @@ config PPC601_SYNC_FIX
source arch/ppc/platforms/4xx/Kconfig source arch/ppc/platforms/4xx/Kconfig
source arch/ppc/platforms/85xx/Kconfig source arch/ppc/platforms/85xx/Kconfig
config PPC64BRIDGE
bool
depends on POWER3
default y
config PPC_STD_MMU config PPC_STD_MMU
bool bool
depends on 6xx || POWER3 depends on 6xx
default y default y
config NOT_COHERENT_CACHE config NOT_COHERENT_CACHE
...@@ -534,8 +525,8 @@ endmenu ...@@ -534,8 +525,8 @@ endmenu
choice choice
prompt "Machine Type" prompt "Machine Type"
depends on 6xx || POWER3 depends on 6xx
default PPC_MULTIPLATFORM default PPC_PREP
---help--- ---help---
Linux currently supports several different kinds of PowerPC-based Linux currently supports several different kinds of PowerPC-based
machines: Apple Power Macintoshes and clones (such as the Motorola machines: Apple Power Macintoshes and clones (such as the Motorola
...@@ -545,15 +536,14 @@ choice ...@@ -545,15 +536,14 @@ choice
Platform) machines (including all of the recent IBM RS/6000 and Platform) machines (including all of the recent IBM RS/6000 and
pSeries machines), and several embedded PowerPC systems containing pSeries machines), and several embedded PowerPC systems containing
4xx, 6xx, 7xx, 8xx, 74xx, and 82xx processors. Currently, the 4xx, 6xx, 7xx, 8xx, 74xx, and 82xx processors. Currently, the
default option is to build a kernel which works on PReP and CHRP. default option is to build a kernel which works on PReP.
Note that support for Apple machines is now only available with Note that support for Apple and CHRP machines is now only available
ARCH=powerpc, and has been removed from this menu. If you wish with ARCH=powerpc, and has been removed from this menu. If you
to build a kernel for an Apple machine, exit this configuration wish to build a kernel for an Apple or CHRP machine, exit this
process and re-run it with ARCH=powerpc. configuration process and re-run it with ARCH=powerpc.
Select CHRP/PReP if configuring for an IBM RS/6000 or Select PReP if configuring for a PReP machine.
pSeries machine, or a PReP machine.
Select Gemini if configuring for a Synergy Microsystems' Gemini Select Gemini if configuring for a Synergy Microsystems' Gemini
series Single Board Computer. More information is available at: series Single Board Computer. More information is available at:
...@@ -562,8 +552,8 @@ choice ...@@ -562,8 +552,8 @@ choice
Select APUS if configuring for a PowerUP Amiga. More information is Select APUS if configuring for a PowerUP Amiga. More information is
available at: <http://linux-apus.sourceforge.net/>. available at: <http://linux-apus.sourceforge.net/>.
config PPC_MULTIPLATFORM config PPC_PREP
bool "CHRP/PReP" bool "PReP"
config APUS config APUS
bool "Amiga-APUS" bool "Amiga-APUS"
...@@ -807,25 +797,6 @@ config CPM2 ...@@ -807,25 +797,6 @@ config CPM2
you wish to build a kernel for a machine with a CPM2 coprocessor you wish to build a kernel for a machine with a CPM2 coprocessor
on it (826x, 827x, 8560). on it (826x, 827x, 8560).
config PPC_CHRP
bool "Support for CHRP (Common Hardware Reference Platform) machines"
depends on PPC_MULTIPLATFORM
select PPC_I8259
select PPC_INDIRECT_PCI
default y
config PPC_PREP
bool "Support for PReP (PowerPC Reference Platform) machines"
depends on PPC_MULTIPLATFORM
select PPC_I8259
select PPC_INDIRECT_PCI
default y
config PPC_OF
bool
depends on PPC_CHRP
default y
config PPC_GEN550 config PPC_GEN550
bool bool
depends on SANDPOINT || SPRUCE || PPLUS || \ depends on SANDPOINT || SPRUCE || PPLUS || \
...@@ -984,14 +955,6 @@ source "mm/Kconfig" ...@@ -984,14 +955,6 @@ source "mm/Kconfig"
source "fs/Kconfig.binfmt" source "fs/Kconfig.binfmt"
config PROC_DEVICETREE
bool "Support for Open Firmware device tree in /proc"
depends on PPC_OF && PROC_FS
help
This option adds a device-tree directory under /proc which contains
an image of the device tree that the kernel copies from Open
Firmware. If unsure, say Y here.
config PREP_RESIDUAL config PREP_RESIDUAL
bool "Support for PReP Residual Data" bool "Support for PReP Residual Data"
depends on PPC_PREP depends on PPC_PREP
...@@ -1184,8 +1147,7 @@ menu "Bus options" ...@@ -1184,8 +1147,7 @@ menu "Bus options"
config ISA config ISA
bool "Support for ISA-bus hardware" bool "Support for ISA-bus hardware"
depends on PPC_PREP || PPC_CHRP depends on PPC_PREP
select PPC_I8259
help help
Find out whether you have ISA slots on your motherboard. ISA is the Find out whether you have ISA slots on your motherboard. ISA is the
name of a bus system, i.e. the way the CPU talks to the other stuff name of a bus system, i.e. the way the CPU talks to the other stuff
...@@ -1195,18 +1157,18 @@ config ISA ...@@ -1195,18 +1157,18 @@ config ISA
config GENERIC_ISA_DMA config GENERIC_ISA_DMA
bool bool
depends on POWER3 || 6xx && !CPM2 depends on 6xx && !CPM2
default y default y
config PPC_I8259 config PPC_I8259
bool bool
default y if 85xx default y if 85xx || PPC_PREP
default n default n
config PPC_INDIRECT_PCI config PPC_INDIRECT_PCI
bool bool
depends on PCI depends on PCI
default y if 40x || 44x || 85xx || 83xx default y if 40x || 44x || 85xx || 83xx || PPC_PREP
default n default n
config EISA config EISA
...@@ -1397,7 +1359,7 @@ config CONSISTENT_SIZE ...@@ -1397,7 +1359,7 @@ config CONSISTENT_SIZE
config BOOT_LOAD_BOOL config BOOT_LOAD_BOOL
bool "Set the boot link/load address" bool "Set the boot link/load address"
depends on ADVANCED_OPTIONS && !PPC_MULTIPLATFORM depends on ADVANCED_OPTIONS && !PPC_PREP
help help
This option allows you to set the initial load address of the zImage This option allows you to set the initial load address of the zImage
or zImage.initrd file. This can be useful if you are on a board or zImage.initrd file. This can be useful if you are on a board
......
...@@ -53,13 +53,6 @@ config BDI_SWITCH ...@@ -53,13 +53,6 @@ config BDI_SWITCH
Unless you are intending to debug the kernel with one of these Unless you are intending to debug the kernel with one of these
machines, say N here. machines, say N here.
config BOOTX_TEXT
bool "Support for early boot text console (BootX or OpenFirmware only)"
depends PPC_OF
help
Say Y here to see progress messages from the boot firmware in text
mode. Requires either BootX or Open Firmware.
config SERIAL_TEXT_DEBUG config SERIAL_TEXT_DEBUG
bool "Support for early boot texts over serial port" bool "Support for early boot texts over serial port"
depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \ depends on 4xx || LOPEC || MV64X60 || PPLUS || PRPMC800 || \
......
...@@ -40,10 +40,8 @@ ifndef CONFIG_FSL_BOOKE ...@@ -40,10 +40,8 @@ ifndef CONFIG_FSL_BOOKE
CFLAGS += -mstring CFLAGS += -mstring
endif endif
cpu-as-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
cpu-as-$(CONFIG_4xx) += -Wa,-m405 cpu-as-$(CONFIG_4xx) += -Wa,-m405
cpu-as-$(CONFIG_6xx) += -Wa,-maltivec cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
cpu-as-$(CONFIG_E500) += -Wa,-me500 cpu-as-$(CONFIG_E500) += -Wa,-me500
cpu-as-$(CONFIG_E200) += -Wa,-me200 cpu-as-$(CONFIG_E200) += -Wa,-me200
......
...@@ -19,14 +19,13 @@ HOSTCFLAGS += -Iarch/$(ARCH)/boot/include ...@@ -19,14 +19,13 @@ HOSTCFLAGS += -Iarch/$(ARCH)/boot/include
BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd
bootdir-y := simple bootdir-y := simple
bootdir-$(CONFIG_PPC_OF) += openfirmware
subdir-y := lib common images subdir-y := lib common images
subdir-$(CONFIG_PPC_MULTIPLATFORM) += of1275 subdir-$(CONFIG_PPC_PREP) += of1275
# for cleaning # for cleaning
subdir- += simple openfirmware subdir- += simple
hostprogs-y := $(addprefix utils/, addnote mknote hack-coff mkprep mkbugboot mktree) hostprogs-y := $(addprefix utils/, mkprep mkbugboot mktree)
PHONY += $(BOOT_TARGETS) $(bootdir-y) PHONY += $(BOOT_TARGETS) $(bootdir-y)
......
# Makefile for making bootable images on various OpenFirmware machines.
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies.
#
# Paul Mackerras January 1997
# XCOFF bootable images for PowerMacs
# Geert Uytterhoeven September 1997
# ELF bootable iamges for CHRP machines.
# Tom Rini January 2001
# Cleaned up, moved into arch/ppc/boot/pmac
# Tom Rini July/August 2002
# Merged 'chrp' and 'pmac' into 'openfirmware', and cleaned up the
# rules.
zImage.initrd znetboot.initrd: del-ramdisk-sec := -R .ramdisk
zImage.initrd znetboot.initrd: initrd := .initrd
boot := arch/ppc/boot
common := $(boot)/common
utils := $(boot)/utils
bootlib := $(boot)/lib
of1275 := $(boot)/of1275
images := $(boot)/images
CHRP_LD_ARGS := -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x00800000
COMMONOBJS := start.o misc.o common.o
CHRPOBJS := crt0.o $(COMMONOBJS) chrpmain.o
targets := $(CHRPOBJS) dummy.o
CHRPOBJS := $(addprefix $(obj)/, $(CHRPOBJS))
LIBS := lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a
ifdef CONFIG_SMP
END := .smp
endif
ifdef CONFIG_PPC64BRIDGE
END += .64
endif
$(images)/ramdisk.image.gz:
@echo ' MISSING $@'
@echo ' RAM disk image must be provided separately'
@/bin/false
quiet_cmd_genimage = GEN $@
cmd_genimage = $(OBJCOPY) -R .comment \
--add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data $< $@
targets += image.o
$(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz FORCE
$(call if_changed,genimage)
# Place the ramdisk in the initrd image.
quiet_cmd_genimage-initrd = GEN $@
cmd_genimage-initrd = $(OBJCOPY) $< $@ \
--add-section=.ramdisk=$(images)/ramdisk.image.gz \
--set-section-flags=.ramdisk=contents,alloc,load,readonly,data
targets += image.initrd.o
$(obj)/image.initrd.o: $(obj)/image.o $(images)/ramdisk.image.gz FORCE
$(call if_changed,genimage-initrd)
targets += crt0.o
$(obj)/crt0.o: $(common)/crt0.S FORCE
$(call if_changed_dep,as_o_S)
quiet_cmd_gen-chrp = CHRP $@
cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $(CHRPOBJS) $< $(LIBS) && \
$(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
$(images)/zImage.chrp: $(obj)/image.o $(CHRPOBJS) $(LIBS) \
$(srctree)/$(boot)/ld.script
$(call cmd,gen-chrp)
$(images)/zImage.initrd.chrp: $(obj)/image.initrd.o $(CHRPOBJS) $(LIBS) \
$(srctree)/$(boot)/ld.script
$(call cmd,gen-chrp)
quiet_cmd_addnote = ADDNOTE $@
cmd_addnote = cat $< > $@ && $(utils)/addnote $@
$(images)/zImage.chrp-rs6k $(images)/zImage.initrd.chrp-rs6k: \
%-rs6k: %
$(call cmd,addnote)
# The targets used on the make command-line
PHONY += zImage zImage.initrd
zImage: $(images)/zImage.chrp \
$(images)/zImage.chrp-rs6k
@echo ' kernel: $@ is ready ($<)'
zImage.initrd: $(images)/zImage.initrd.chrp \
$(images)/zImage.initrd.chrp-rs6k
@echo ' kernel: $@ is ready ($<)'
TFTPIMAGE := /tftpboot/zImage
PHONY += znetboot znetboot.initrd
znetboot: $(images)/zImage.chrp
cp $(images)/zImage.chrp $(TFTPIMAGE).chrp$(END)
@echo ' kernel: $@ is ready ($<)'
znetboot.initrd:$(images)/zImage.initrd.chrp
cp $(images)/zImage.initrd.chrp $(TFTPIMAGE).chrp$(END)
@echo ' kernel: $@ is ready ($<)'
/*
* 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 *, unsigned long);
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_START 0x00000000
#define RAM_END (64<<20)
#define BOOT_START ((unsigned long)_start)
#define BOOT_END ((unsigned long)(_end + 0xFFF) & ~0xFFF)
#define RAM_FREE ((unsigned long)(_end+0x1000)&~0xFFF)
#define PROG_START 0x00010000
#define PROG_SIZE 0x007f0000 /* 8MB */
#define SCRATCH_SIZE (128 << 10)
static char scratch[SCRATCH_SIZE]; /* 128k of scratch space for gunzip */
typedef void (*kernel_start_t)(int, int, void *, unsigned int, unsigned int);
void
boot(int a1, int a2, void *prom)
{
unsigned sa, len;
void *dst;
unsigned char *im;
unsigned int initrd_size, initrd_start;
printf("chrpboot starting: loaded at 0x%p\n\r", &_start);
initrd_size = &__ramdisk_end - &__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, &__ramdisk_begin, initrd_size);
memcpy((char *)initrd_start, &__ramdisk_begin, initrd_size);
} else {
initrd_start = 0;
initrd_size = 0;
a2 = 0xdeadbeef;
}
im = &__image_begin;
len = &__image_end - &__image_begin;
/* claim 4MB starting at PROG_START */
claim(PROG_START, PROG_SIZE - PROG_START, 0);
dst = (void *) PROG_START;
if (im[0] == 0x1f && im[1] == 0x8b) {
avail_ram = scratch;
begin_avail = avail_high = avail_ram;
end_avail = scratch + sizeof(scratch);
printf("gunzipping (0x%p <- 0x%p:0x%p)...", dst, im, im+len);
gunzip(dst, PROG_SIZE - PROG_START, im, &len);
printf("done %u bytes\n\r", len);
printf("%u bytes of heap consumed, max in use %u\n\r",
avail_high - begin_avail, heap_max);
} else {
memmove(dst, im, len);
}
flush_cache(dst, len);
make_bi_recs(((unsigned long) dst + len), "chrpboot", _MACH_chrp,
(PROG_START + PROG_SIZE));
sa = PROG_START;
printf("start address = 0x%x\n\r", sa);
(*(kernel_start_t)sa)(a1, a2, prom, initrd_start, initrd_size);
printf("returned?\n\r");
pause();
}
/*
* 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 "nonstdio.h"
#include "of1275.h"
#include <linux/string.h>
#include <linux/zlib.h>
#include <asm/bootinfo.h>
#include <asm/page.h>
/* Information from the linker */
extern int strcmp(const char *s1, const char *s2);
extern char *avail_ram, *avail_high;
extern char *end_avail;
unsigned int heap_use, heap_max;
struct memchunk {
unsigned int size;
struct memchunk *next;
};
static struct memchunk *freechunks;
static void *zalloc(unsigned size)
{
void *p;
struct memchunk **mpp, *mp;
size = (size + 7) & -8;
heap_use += size;
if (heap_use > heap_max)
heap_max = heap_use;
for (mpp = &freechunks; (mp = *mpp) != 0; mpp = &mp->next) {
if (mp->size == size) {
*mpp = mp->next;
return mp;
}
}
p = avail_ram;
avail_ram += size;
if (avail_ram > avail_high)
avail_high = avail_ram;
if (avail_ram > end_avail) {
printf("oops... out of memory\n\r");
pause();
}
return p;
}
#define HEAD_CRC 2
#define EXTRA_FIELD 4
#define ORIG_NAME 8
#define COMMENT 0x10
#define RESERVED 0xe0
void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
{
z_stream s;
int r, i, flags;
/* skip header */
i = 10;
flags = src[3];
if (src[2] != Z_DEFLATED || (flags & RESERVED) != 0) {
printf("bad gzipped data\n\r");
exit();
}
if ((flags & EXTRA_FIELD) != 0)
i = 12 + src[10] + (src[11] << 8);
if ((flags & ORIG_NAME) != 0)
while (src[i++] != 0)
;
if ((flags & COMMENT) != 0)
while (src[i++] != 0)
;
if ((flags & HEAD_CRC) != 0)
i += 2;
if (i >= *lenp) {
printf("gunzip: ran out of data in header\n\r");
exit();
}
/* Initialize ourself. */
s.workspace = zalloc(zlib_inflate_workspacesize());
r = zlib_inflateInit2(&s, -MAX_WBITS);
if (r != Z_OK) {
printf("zlib_inflateInit2 returned %d\n\r", r);
exit();
}
s.next_in = src + i;
s.avail_in = *lenp - i;
s.next_out = dst;
s.avail_out = dstlen;
r = zlib_inflate(&s, Z_FINISH);
if (r != Z_OK && r != Z_STREAM_END) {
printf("inflate returned %d msg: %s\n\r", r, s.msg);
exit();
}
*lenp = s.next_out - (unsigned char *) dst;
zlib_inflateEnd(&s);
}
/* Make a bi_rec in OF. We need to be passed a name for BI_BOOTLOADER_ID,
* a machine type for BI_MACHTYPE, and the location where the end of the
* bootloader is (PROG_START + PROG_SIZE)
*/
void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
unsigned long progend)
{
struct bi_record *rec;
/* leave a 1MB gap then align to the next 1MB boundary */
addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
/* oldworld machine seem very unhappy about this. -- Tom */
if (addr >= progend)
claim(addr, 0x1000, 0);
rec = (struct bi_record *)addr;
rec->tag = BI_FIRST;
rec->size = sizeof(struct bi_record);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
rec->tag = BI_BOOTLOADER_ID;
sprintf( (char *)rec->data, name);
rec->size = sizeof(struct bi_record) + strlen(name) + 1;
rec = (struct bi_record *)((unsigned long)rec + rec->size);
rec->tag = BI_MACHTYPE;
rec->data[0] = mach;
rec->data[1] = 1;
rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
rec->tag = BI_LAST;
rec->size = sizeof(struct bi_record);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
}
/*
* 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.
*/
.text
/*
* Use the BAT2 & 3 registers to map the 1st 16MB of RAM to
* the address given as the 1st argument.
*/
.globl setup_bats
setup_bats:
mfpvr 5
rlwinm 5,5,16,16,31 /* r3 = 1 for 601, 4 for 604 */
cmpwi 0,5,1
li 0,0
bne 4f
mtibatl 3,0 /* invalidate BAT first */
ori 3,3,4 /* set up BAT registers for 601 */
li 4,0x7f
mtibatu 2,3
mtibatl 2,4
oris 3,3,0x80
oris 4,4,0x80
mtibatu 3,3
mtibatl 3,4
b 5f
4: mtdbatu 3,0 /* invalidate BATs first */
mtibatu 3,0
ori 3,3,0xff /* set up BAT registers for 604 */
li 4,2
mtdbatl 2,4
mtdbatu 2,3
mtibatl 2,4
mtibatu 2,3
oris 3,3,0x80
oris 4,4,0x80
mtdbatl 3,4
mtdbatu 3,3
mtibatl 3,4
mtibatu 3,3
5: sync
isync
blr
/*
* Flush the dcache and invalidate the icache for a range of addresses.
*
* flush_cache(addr, len)
*/
.global flush_cache
flush_cache:
addi 4,4,0x1f /* len = (len + 0x1f) / 0x20 */
rlwinm. 4,4,27,5,31
mtctr 4
beqlr
1: dcbf 0,3
icbi 0,3
addi 3,3,0x20
bdnz 1b
sync
isync
blr
/*
* 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 <stdarg.h>
#include "of1275.h"
extern int strlen(const char *s);
extern void boot(int a1, int a2, void *prom);
phandle stdin;
phandle stdout;
phandle stderr;
void printk(char *fmt, ...);
void
start(int a1, int a2, void *promptr)
{
ofinit(promptr);
if (ofstdio(&stdin, &stdout, &stderr))
exit();
boot(a1, a2, promptr);
for (;;)
exit();
}
int writestring(void *f, char *ptr, int nb)
{
int w = 0, i;
char *ret = "\r";
for (i = 0; i < nb; ++i) {
if (ptr[i] == '\n') {
if (i > w) {
write(f, ptr + w, i - w);
w = i;
}
write(f, ret, 1);
}
}
if (w < nb)
write(f, ptr + w, nb - w);
return nb;
}
int
putc(int c, void *f)
{
char ch = c;
return writestring(f, &ch, 1) == 1? c: -1;
}
int
putchar(int c)
{
return putc(c, stdout);
}
int
fputs(char *str, void *f)
{
int n = strlen(str);
return writestring(f, str, n) == n? 0: -1;
}
int
readchar(void)
{
char ch;
for (;;) {
switch (read(stdin, &ch, 1)) {
case 1:
return ch;
case -1:
printk("read(stdin) returned -1\n");
return -1;
}
}
}
static char line[256];
static char *lineptr;
static int lineleft;
int
getchar(void)
{
int c;
if (lineleft == 0) {
lineptr = line;
for (;;) {
c = readchar();
if (c == -1 || c == 4)
break;
if (c == '\r' || c == '\n') {
*lineptr++ = '\n';
putchar('\n');
break;
}
switch (c) {
case 0177:
case '\b':
if (lineptr > line) {
putchar('\b');
putchar(' ');
putchar('\b');
--lineptr;
}
break;
case 'U' & 0x1F:
while (lineptr > line) {
putchar('\b');
putchar(' ');
putchar('\b');
--lineptr;
}
break;
default:
if (lineptr >= &line[sizeof(line) - 1])
putchar('\a');
else {
putchar(c);
*lineptr++ = c;
}
}
}
lineleft = lineptr - line;
lineptr = line;
}
if (lineleft == 0)
return -1;
--lineleft;
return *lineptr++;
}
extern int vsprintf(char *buf, const char *fmt, va_list args);
static char sprint_buf[1024];
void
printk(char *fmt, ...)
{
va_list args;
int n;
va_start(args, fmt);
n = vsprintf(sprint_buf, fmt, args);
va_end(args);
writestring(stdout, sprint_buf, n);
}
int
printf(char *fmt, ...)
{
va_list args;
int n;
va_start(args, fmt);
n = vsprintf(sprint_buf, fmt, args);
va_end(args);
writestring(stdout, sprint_buf, n);
return n;
}
...@@ -50,10 +50,10 @@ MPC10X_PCI_OP(read, dword, u32 *, in_le32, 0) ...@@ -50,10 +50,10 @@ MPC10X_PCI_OP(read, dword, u32 *, in_le32, 0)
* the system. This assumes that the firmware has correctly set up the memory * the system. This assumes that the firmware has correctly set up the memory
* controller registers. On CONFIG_PPC_PREP, we know we are being called * controller registers. On CONFIG_PPC_PREP, we know we are being called
* under a PReP memory map. On all other machines, we assume we are under * under a PReP memory map. On all other machines, we assume we are under
* a CHRP memory map. Further, on CONFIG_PPC_MULTIPLATFORM we must rename * a CHRP memory map. Further, on CONFIG_PPC_PREP we must rename
* this function. * this function.
*/ */
#ifdef CONFIG_PPC_MULTIPLATFORM #ifdef CONFIG_PPC_PREP
#define get_mem_size mpc10x_get_mem_size #define get_mem_size mpc10x_get_mem_size
#endif #endif
unsigned long unsigned long
......
...@@ -194,7 +194,7 @@ start_ldr: ...@@ -194,7 +194,7 @@ start_ldr:
/* /*
* Start at the begining. * Start at the begining.
*/ */
#ifdef CONFIG_PPC_MULTIPLATFORM #ifdef CONFIG_PPC_PREP
li r9,0xc li r9,0xc
mtlr r9 mtlr r9
/* tell kernel we're prep, by putting 0xdeadc0de at KERNELLOAD, /* tell kernel we're prep, by putting 0xdeadc0de at KERNELLOAD,
......
/*
* Program to hack in a PT_NOTE program header entry in an ELF file.
* This is needed for OF on RS/6000s to load an image correctly.
* Note that OF needs a program header entry for the note, not an
* ELF section.
*
* Copyright 2000 Paul Mackerras.
*
* 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.
*
* Usage: addnote zImage
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
char arch[] = "PowerPC";
#define N_DESCR 6
unsigned int descr[N_DESCR] = {
#if 1
/* values for IBM RS/6000 machines */
0xffffffff, /* real-mode = true */
0x00c00000, /* real-base, i.e. where we expect OF to be */
0xffffffff, /* real-size */
0xffffffff, /* virt-base */
0xffffffff, /* virt-size */
0x4000, /* load-base */
#else
/* values for longtrail CHRP */
0, /* real-mode = false */
0xffffffff, /* real-base */
0xffffffff, /* real-size */
0xffffffff, /* virt-base */
0xffffffff, /* virt-size */
0x00600000, /* load-base */
#endif
};
unsigned char buf[512];
#define GET_16BE(off) ((buf[off] << 8) + (buf[(off)+1]))
#define GET_32BE(off) ((GET_16BE(off) << 16) + GET_16BE((off)+2))
#define PUT_16BE(off, v) (buf[off] = ((v) >> 8) & 0xff, \
buf[(off) + 1] = (v) & 0xff)
#define PUT_32BE(off, v) (PUT_16BE((off), (v) >> 16), \
PUT_16BE((off) + 2, (v)))
/* Structure of an ELF file */
#define E_IDENT 0 /* ELF header */
#define E_PHOFF 28
#define E_PHENTSIZE 42
#define E_PHNUM 44
#define E_HSIZE 52 /* size of ELF header */
#define EI_MAGIC 0 /* offsets in E_IDENT area */
#define EI_CLASS 4
#define EI_DATA 5
#define PH_TYPE 0 /* ELF program header */
#define PH_OFFSET 4
#define PH_FILESZ 16
#define PH_HSIZE 32 /* size of program header */
#define PT_NOTE 4 /* Program header type = note */
#define ELFCLASS32 1
#define ELFDATA2MSB 2
unsigned char elf_magic[4] = { 0x7f, 'E', 'L', 'F' };
int main(int ac, char **av)
{
int fd, n, i;
int ph, ps, np;
int nnote, ns;
if (ac != 2) {
fprintf(stderr, "Usage: %s elf-file\n", av[0]);
exit(1);
}
fd = open(av[1], O_RDWR);
if (fd < 0) {
perror(av[1]);
exit(1);
}
nnote = strlen(arch) + 1 + (N_DESCR + 3) * 4;
n = read(fd, buf, sizeof(buf));
if (n < 0) {
perror("read");
exit(1);
}
if (n < E_HSIZE || memcmp(&buf[E_IDENT+EI_MAGIC], elf_magic, 4) != 0)
goto notelf;
if (buf[E_IDENT+EI_CLASS] != ELFCLASS32
|| buf[E_IDENT+EI_DATA] != ELFDATA2MSB) {
fprintf(stderr, "%s is not a big-endian 32-bit ELF image\n",
av[1]);
exit(1);
}
ph = GET_32BE(E_PHOFF);
ps = GET_16BE(E_PHENTSIZE);
np = GET_16BE(E_PHNUM);
if (ph < E_HSIZE || ps < PH_HSIZE || np < 1)
goto notelf;
if (ph + (np + 1) * ps + nnote > n)
goto nospace;
for (i = 0; i < np; ++i) {
if (GET_32BE(ph + PH_TYPE) == PT_NOTE) {
fprintf(stderr, "%s already has a note entry\n",
av[1]);
exit(0);
}
ph += ps;
}
/* XXX check that the area we want to use is all zeroes */
for (i = 0; i < ps + nnote; ++i)
if (buf[ph + i] != 0)
goto nospace;
/* fill in the program header entry */
ns = ph + ps;
PUT_32BE(ph + PH_TYPE, PT_NOTE);
PUT_32BE(ph + PH_OFFSET, ns);
PUT_32BE(ph + PH_FILESZ, nnote);
/* fill in the note area we point to */
/* XXX we should probably make this a proper section */
PUT_32BE(ns, strlen(arch) + 1);
PUT_32BE(ns + 4, N_DESCR * 4);
PUT_32BE(ns + 8, 0x1275);
strcpy(&buf[ns + 12], arch);
ns += 12 + strlen(arch) + 1;
for (i = 0; i < N_DESCR; ++i)
PUT_32BE(ns + i * 4, descr[i]);
/* Update the number of program headers */
PUT_16BE(E_PHNUM, np + 1);
/* write back */
lseek(fd, (long) 0, SEEK_SET);
i = write(fd, buf, n);
if (i < 0) {
perror("write");
exit(1);
}
if (i < n) {
fprintf(stderr, "%s: write truncated\n", av[1]);
exit(1);
}
exit(0);
notelf:
fprintf(stderr, "%s does not appear to be an ELF file\n", av[0]);
exit(1);
nospace:
fprintf(stderr, "sorry, I can't find space in %s to put the note\n",
av[0]);
exit(1);
}
/*
* hack-coff.c - hack the header of an xcoff file to fill in
* a few fields needed by the Open Firmware xcoff loader on
* Power Macs but not initialized by objcopy.
*
* 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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include "rs6000.h"
#define AOUT_MAGIC 0x010b
#define get_16be(x) ((((unsigned char *)(x))[0] << 8) \
+ ((unsigned char *)(x))[1])
#define put_16be(x, v) (((unsigned char *)(x))[0] = (v) >> 8, \
((unsigned char *)(x))[1] = (v) & 0xff)
#define get_32be(x) ((((unsigned char *)(x))[0] << 24) \
+ (((unsigned char *)(x))[1] << 16) \
+ (((unsigned char *)(x))[2] << 8) \
+ ((unsigned char *)(x))[3])
int
main(int ac, char **av)
{
int fd;
int i, nsect;
int aoutsz;
struct external_filehdr fhdr;
AOUTHDR aout;
struct external_scnhdr shdr;
if (ac != 2) {
fprintf(stderr, "Usage: hack-coff coff-file\n");
exit(1);
}
if ((fd = open(av[1], 2)) == -1) {
perror(av[2]);
exit(1);
}
if (read(fd, &fhdr, sizeof(fhdr)) != sizeof(fhdr))
goto readerr;
i = get_16be(fhdr.f_magic);
if (i != U802TOCMAGIC && i != U802WRMAGIC && i != U802ROMAGIC) {
fprintf(stderr, "%s: not an xcoff file\n", av[1]);
exit(1);
}
aoutsz = get_16be(fhdr.f_opthdr);
if (read(fd, &aout, aoutsz) != aoutsz)
goto readerr;
nsect = get_16be(fhdr.f_nscns);
for (i = 0; i < nsect; ++i) {
if (read(fd, &shdr, sizeof(shdr)) != sizeof(shdr))
goto readerr;
if (strcmp(shdr.s_name, ".text") == 0) {
put_16be(aout.o_snentry, i+1);
put_16be(aout.o_sntext, i+1);
} else if (strcmp(shdr.s_name, ".data") == 0) {
put_16be(aout.o_sndata, i+1);
} else if (strcmp(shdr.s_name, ".bss") == 0) {
put_16be(aout.o_snbss, i+1);
}
}
put_16be(aout.magic, AOUT_MAGIC);
if (lseek(fd, (long) sizeof(struct external_filehdr), 0) == -1
|| write(fd, &aout, aoutsz) != aoutsz) {
fprintf(stderr, "%s: write error\n", av[1]);
exit(1);
}
close(fd);
exit(0);
readerr:
fprintf(stderr, "%s: read error or file too short\n", av[1]);
exit(1);
}
/*
* Copyright (C) Cort Dougan 1999.
*
* 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.
*
* Generate a note section as per the CHRP specification.
*
*/
#include <stdio.h>
#include <string.h>
#define PL(x) printf("%c%c%c%c", ((x)>>24)&0xff, ((x)>>16)&0xff, ((x)>>8)&0xff, (x)&0xff );
int main(void)
{
/* header */
/* namesz */
PL(strlen("PowerPC")+1);
/* descrsz */
PL(6*4);
/* type */
PL(0x1275);
/* name */
printf("PowerPC"); printf("%c", 0);
/* descriptor */
/* real-mode */
PL(0xffffffff);
/* real-base */
PL(0x00c00000);
/* real-size */
PL(0xffffffff);
/* virt-base */
PL(0xffffffff);
/* virt-size */
PL(0xffffffff);
/* load-base */
PL(0x4000);
return 0;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -930,55 +930,3 @@ END_FTR_SECTION_IFSET(CPU_FTR_601) ...@@ -930,55 +930,3 @@ END_FTR_SECTION_IFSET(CPU_FTR_601)
b 4b b 4b
.comm ee_restarts,4 .comm ee_restarts,4
/*
* PROM code for specific machines follows. Put it
* here so it's easy to add arch-specific sections later.
* -- Cort
*/
#ifdef CONFIG_PPC_OF
/*
* On CHRP, the Run-Time Abstraction Services (RTAS) have to be
* called with the MMU off.
*/
_GLOBAL(enter_rtas)
stwu r1,-INT_FRAME_SIZE(r1)
mflr r0
stw r0,INT_FRAME_SIZE+4(r1)
lis r4,rtas_data@ha
lwz r4,rtas_data@l(r4)
lis r6,1f@ha /* physical return address for rtas */
addi r6,r6,1f@l
tophys(r6,r6)
tophys(r7,r1)
lis r8,rtas_entry@ha
lwz r8,rtas_entry@l(r8)
mfmsr r9
stw r9,8(r1)
LOAD_MSR_KERNEL(r0,MSR_KERNEL)
SYNC /* disable interrupts so SRR0/1 */
MTMSRD(r0) /* don't get trashed */
li r9,MSR_KERNEL & ~(MSR_IR|MSR_DR)
mtlr r6
CLR_TOP32(r7)
mtspr SPRN_SPRG2,r7
mtspr SPRN_SRR0,r8
mtspr SPRN_SRR1,r9
RFI
1: tophys(r9,r1)
lwz r8,INT_FRAME_SIZE+4(r9) /* get return address */
lwz r9,8(r9) /* original msr value */
FIX_SRR1(r9,r0)
addi r1,r1,INT_FRAME_SIZE
li r0,0
mtspr SPRN_SPRG2,r0
mtspr SPRN_SRR0,r8
mtspr SPRN_SRR1,r9
RFI /* return to caller */
.globl machine_check_in_rtas
machine_check_in_rtas:
twi 31,0,0
/* XXX load up BATs and panic */
#endif /* CONFIG_PPC_OF */
This diff is collapsed.
This diff is collapsed.
...@@ -104,7 +104,7 @@ static char *pmc2_lookup(unsigned long mmcr0) ...@@ -104,7 +104,7 @@ static char *pmc2_lookup(unsigned long mmcr0)
static int ppc_htab_show(struct seq_file *m, void *v) static int ppc_htab_show(struct seq_file *m, void *v)
{ {
unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0; unsigned long mmcr0 = 0, pmc1 = 0, pmc2 = 0;
#if defined(CONFIG_PPC_STD_MMU) && !defined(CONFIG_PPC64BRIDGE) #if defined(CONFIG_PPC_STD_MMU)
unsigned int kptes = 0, uptes = 0; unsigned int kptes = 0, uptes = 0;
PTE *ptr; PTE *ptr;
#endif /* CONFIG_PPC_STD_MMU */ #endif /* CONFIG_PPC_STD_MMU */
...@@ -133,7 +133,6 @@ static int ppc_htab_show(struct seq_file *m, void *v) ...@@ -133,7 +133,6 @@ static int ppc_htab_show(struct seq_file *m, void *v)
return 0; return 0;
} }
#ifndef CONFIG_PPC64BRIDGE
for (ptr = Hash; ptr < Hash_end; ptr++) { for (ptr = Hash; ptr < Hash_end; ptr++) {
unsigned int mctx, vsid; unsigned int mctx, vsid;
...@@ -147,7 +146,6 @@ static int ppc_htab_show(struct seq_file *m, void *v) ...@@ -147,7 +146,6 @@ static int ppc_htab_show(struct seq_file *m, void *v)
else else
uptes++; uptes++;
} }
#endif
seq_printf(m, seq_printf(m,
"PTE Hash Table Information\n" "PTE Hash Table Information\n"
...@@ -155,20 +153,16 @@ static int ppc_htab_show(struct seq_file *m, void *v) ...@@ -155,20 +153,16 @@ static int ppc_htab_show(struct seq_file *m, void *v)
"Buckets\t\t: %lu\n" "Buckets\t\t: %lu\n"
"Address\t\t: %08lx\n" "Address\t\t: %08lx\n"
"Entries\t\t: %lu\n" "Entries\t\t: %lu\n"
#ifndef CONFIG_PPC64BRIDGE
"User ptes\t: %u\n" "User ptes\t: %u\n"
"Kernel ptes\t: %u\n" "Kernel ptes\t: %u\n"
"Percent full\t: %lu%%\n" "Percent full\t: %lu%%\n"
#endif
, (unsigned long)(Hash_size>>10), , (unsigned long)(Hash_size>>10),
(Hash_size/(sizeof(PTE)*8)), (Hash_size/(sizeof(PTE)*8)),
(unsigned long)Hash, (unsigned long)Hash,
Hash_size/sizeof(PTE) Hash_size/sizeof(PTE)
#ifndef CONFIG_PPC64BRIDGE
, uptes, , uptes,
kptes, kptes,
((kptes+uptes)*100) / (Hash_size/sizeof(PTE)) ((kptes+uptes)*100) / (Hash_size/sizeof(PTE))
#endif
); );
seq_printf(m, seq_printf(m,
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <linux/adb.h> #include <linux/adb.h>
#include <linux/cuda.h> #include <linux/cuda.h>
#include <linux/pmu.h> #include <linux/pmu.h>
#include <asm/prom.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -207,27 +206,6 @@ EXPORT_SYMBOL(adb_try_handler_change); ...@@ -207,27 +206,6 @@ EXPORT_SYMBOL(adb_try_handler_change);
EXPORT_SYMBOL(cuda_request); EXPORT_SYMBOL(cuda_request);
EXPORT_SYMBOL(cuda_poll); EXPORT_SYMBOL(cuda_poll);
#endif /* CONFIG_ADB_CUDA */ #endif /* CONFIG_ADB_CUDA */
#ifdef CONFIG_PPC_OF
EXPORT_SYMBOL(find_devices);
EXPORT_SYMBOL(find_type_devices);
EXPORT_SYMBOL(find_compatible_devices);
EXPORT_SYMBOL(find_path_device);
EXPORT_SYMBOL(device_is_compatible);
EXPORT_SYMBOL(machine_is_compatible);
EXPORT_SYMBOL(find_all_nodes);
EXPORT_SYMBOL(get_property);
EXPORT_SYMBOL(request_OF_resource);
EXPORT_SYMBOL(release_OF_resource);
EXPORT_SYMBOL(of_find_node_by_name);
EXPORT_SYMBOL(of_find_node_by_type);
EXPORT_SYMBOL(of_find_compatible_node);
EXPORT_SYMBOL(of_find_node_by_path);
EXPORT_SYMBOL(of_find_all_nodes);
EXPORT_SYMBOL(of_get_parent);
EXPORT_SYMBOL(of_get_next_child);
EXPORT_SYMBOL(of_node_get);
EXPORT_SYMBOL(of_node_put);
#endif /* CONFIG_PPC_OF */
#if defined(CONFIG_BOOTX_TEXT) #if defined(CONFIG_BOOTX_TEXT)
EXPORT_SYMBOL(btext_update_display); EXPORT_SYMBOL(btext_update_display);
#endif #endif
......
This diff is collapsed.
...@@ -74,12 +74,6 @@ _GLOBAL(hash_page_sync) ...@@ -74,12 +74,6 @@ _GLOBAL(hash_page_sync)
*/ */
.text .text
_GLOBAL(hash_page) _GLOBAL(hash_page)
#ifdef CONFIG_PPC64BRIDGE
mfmsr r0
clrldi r0,r0,1 /* make sure it's in 32-bit mode */
MTMSRD(r0)
isync
#endif
tophys(r7,0) /* gets -KERNELBASE into r7 */ tophys(r7,0) /* gets -KERNELBASE into r7 */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
addis r8,r7,mmu_hash_lock@h addis r8,r7,mmu_hash_lock@h
...@@ -303,7 +297,6 @@ Hash_base = 0xc0180000 ...@@ -303,7 +297,6 @@ Hash_base = 0xc0180000
Hash_bits = 12 /* e.g. 256kB hash table */ Hash_bits = 12 /* e.g. 256kB hash table */
Hash_msk = (((1 << Hash_bits) - 1) * 64) Hash_msk = (((1 << Hash_bits) - 1) * 64)
#ifndef CONFIG_PPC64BRIDGE
/* defines for the PTE format for 32-bit PPCs */ /* defines for the PTE format for 32-bit PPCs */
#define PTE_SIZE 8 #define PTE_SIZE 8
#define PTEG_SIZE 64 #define PTEG_SIZE 64
...@@ -317,21 +310,6 @@ Hash_msk = (((1 << Hash_bits) - 1) * 64) ...@@ -317,21 +310,6 @@ Hash_msk = (((1 << Hash_bits) - 1) * 64)
#define SET_V(r) oris r,r,PTE_V@h #define SET_V(r) oris r,r,PTE_V@h
#define CLR_V(r,t) rlwinm r,r,0,1,31 #define CLR_V(r,t) rlwinm r,r,0,1,31
#else
/* defines for the PTE format for 64-bit PPCs */
#define PTE_SIZE 16
#define PTEG_SIZE 128
#define LG_PTEG_SIZE 7
#define LDPTEu ldu
#define STPTE std
#define CMPPTE cmpd
#define PTE_H 2
#define PTE_V 1
#define TST_V(r) andi. r,r,PTE_V
#define SET_V(r) ori r,r,PTE_V
#define CLR_V(r,t) li t,PTE_V; andc r,r,t
#endif /* CONFIG_PPC64BRIDGE */
#define HASH_LEFT 31-(LG_PTEG_SIZE+Hash_bits-1) #define HASH_LEFT 31-(LG_PTEG_SIZE+Hash_bits-1)
#define HASH_RIGHT 31-LG_PTEG_SIZE #define HASH_RIGHT 31-LG_PTEG_SIZE
...@@ -349,14 +327,8 @@ BEGIN_FTR_SECTION ...@@ -349,14 +327,8 @@ BEGIN_FTR_SECTION
END_FTR_SECTION_IFSET(CPU_FTR_NEED_COHERENT) END_FTR_SECTION_IFSET(CPU_FTR_NEED_COHERENT)
/* Construct the high word of the PPC-style PTE (r5) */ /* Construct the high word of the PPC-style PTE (r5) */
#ifndef CONFIG_PPC64BRIDGE
rlwinm r5,r3,7,1,24 /* put VSID in 0x7fffff80 bits */ rlwinm r5,r3,7,1,24 /* put VSID in 0x7fffff80 bits */
rlwimi r5,r4,10,26,31 /* put in API (abbrev page index) */ rlwimi r5,r4,10,26,31 /* put in API (abbrev page index) */
#else /* CONFIG_PPC64BRIDGE */
clrlwi r3,r3,8 /* reduce vsid to 24 bits */
sldi r5,r3,12 /* shift vsid into position */
rlwimi r5,r4,16,20,24 /* put in API (abbrev page index) */
#endif /* CONFIG_PPC64BRIDGE */
SET_V(r5) /* set V (valid) bit */ SET_V(r5) /* set V (valid) bit */
/* Get the address of the primary PTE group in the hash table (r3) */ /* Get the address of the primary PTE group in the hash table (r3) */
...@@ -540,14 +512,8 @@ _GLOBAL(flush_hash_pages) ...@@ -540,14 +512,8 @@ _GLOBAL(flush_hash_pages)
add r3,r3,r0 /* note code below trims to 24 bits */ add r3,r3,r0 /* note code below trims to 24 bits */
/* Construct the high word of the PPC-style PTE (r11) */ /* Construct the high word of the PPC-style PTE (r11) */
#ifndef CONFIG_PPC64BRIDGE
rlwinm r11,r3,7,1,24 /* put VSID in 0x7fffff80 bits */ rlwinm r11,r3,7,1,24 /* put VSID in 0x7fffff80 bits */
rlwimi r11,r4,10,26,31 /* put in API (abbrev page index) */ rlwimi r11,r4,10,26,31 /* put in API (abbrev page index) */
#else /* CONFIG_PPC64BRIDGE */
clrlwi r3,r3,8 /* reduce vsid to 24 bits */
sldi r11,r3,12 /* shift vsid into position */
rlwimi r11,r4,16,20,24 /* put in API (abbrev page index) */
#endif /* CONFIG_PPC64BRIDGE */
SET_V(r11) /* set V (valid) bit */ SET_V(r11) /* set V (valid) bit */
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
......
...@@ -412,14 +412,6 @@ void __init mem_init(void) ...@@ -412,14 +412,6 @@ void __init mem_init(void)
} }
#endif /* CONFIG_BLK_DEV_INITRD */ #endif /* CONFIG_BLK_DEV_INITRD */
#ifdef CONFIG_PPC_OF
/* mark the RTAS pages as reserved */
if ( rtas_data )
for (addr = (ulong)__va(rtas_data);
addr < PAGE_ALIGN((ulong)__va(rtas_data)+rtas_size) ;
addr += PAGE_SIZE)
SetPageReserved(virt_to_page(addr));
#endif
for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory; for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory;
addr += PAGE_SIZE) { addr += PAGE_SIZE) {
if (!PageReserved(virt_to_page(addr))) if (!PageReserved(virt_to_page(addr)))
...@@ -494,11 +486,6 @@ set_phys_avail(unsigned long total_memory) ...@@ -494,11 +486,6 @@ set_phys_avail(unsigned long total_memory)
initrd_end - initrd_start, 1); initrd_end - initrd_start, 1);
} }
#endif /* CONFIG_BLK_DEV_INITRD */ #endif /* CONFIG_BLK_DEV_INITRD */
#ifdef CONFIG_PPC_OF
/* remove the RTAS pages from the available memory */
if (rtas_data)
mem_pieces_remove(&phys_avail, rtas_data, rtas_size, 1);
#endif
} }
/* Mark some memory as reserved by removing it from phys_avail. */ /* Mark some memory as reserved by removing it from phys_avail. */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* This file contains the routines for handling the MMU on those * This file contains the routines for handling the MMU on those
* PowerPC implementations where the MMU substantially follows the * PowerPC implementations where the MMU substantially follows the
* architecture specification. This includes the 6xx, 7xx, 7xxx, * architecture specification. This includes the 6xx, 7xx, 7xxx,
* 8260, and POWER3 implementations but excludes the 8xx and 4xx. * 8260, and 83xx implementations but excludes the 8xx and 4xx.
* -- paulus * -- paulus
* *
* Derived from arch/ppc/mm/init.c: * Derived from arch/ppc/mm/init.c:
......
...@@ -39,7 +39,7 @@ unsigned long ioremap_base; ...@@ -39,7 +39,7 @@ unsigned long ioremap_base;
unsigned long ioremap_bot; unsigned long ioremap_bot;
int io_bat_index; int io_bat_index;
#if defined(CONFIG_6xx) || defined(CONFIG_POWER3) #if defined(CONFIG_6xx)
#define HAVE_BATS 1 #define HAVE_BATS 1
#endif #endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* This file contains the routines for handling the MMU on those * This file contains the routines for handling the MMU on those
* PowerPC implementations where the MMU substantially follows the * PowerPC implementations where the MMU substantially follows the
* architecture specification. This includes the 6xx, 7xx, 7xxx, * architecture specification. This includes the 6xx, 7xx, 7xxx,
* 8260, and POWER3 implementations but excludes the 8xx and 4xx. * 8260, and 83xx implementations but excludes the 8xx and 4xx.
* -- paulus * -- paulus
* *
* Derived from arch/ppc/mm/init.c: * Derived from arch/ppc/mm/init.c:
...@@ -42,11 +42,7 @@ unsigned long _SDR1; ...@@ -42,11 +42,7 @@ unsigned long _SDR1;
union ubat { /* BAT register values to be loaded */ union ubat { /* BAT register values to be loaded */
BAT bat; BAT bat;
#ifdef CONFIG_PPC64BRIDGE
u64 word[2];
#else
u32 word[2]; u32 word[2];
#endif
} BATS[4][2]; /* 4 pairs of IBAT, DBAT */ } BATS[4][2]; /* 4 pairs of IBAT, DBAT */
struct batrange { /* stores address ranges mapped by BATs */ struct batrange { /* stores address ranges mapped by BATs */
...@@ -83,9 +79,6 @@ unsigned long p_mapped_by_bats(unsigned long pa) ...@@ -83,9 +79,6 @@ unsigned long p_mapped_by_bats(unsigned long pa)
unsigned long __init mmu_mapin_ram(void) unsigned long __init mmu_mapin_ram(void)
{ {
#ifdef CONFIG_POWER4
return 0;
#else
unsigned long tot, bl, done; unsigned long tot, bl, done;
unsigned long max_size = (256<<20); unsigned long max_size = (256<<20);
unsigned long align; unsigned long align;
...@@ -122,7 +115,6 @@ unsigned long __init mmu_mapin_ram(void) ...@@ -122,7 +115,6 @@ unsigned long __init mmu_mapin_ram(void)
} }
return done; return done;
#endif
} }
/* /*
...@@ -205,27 +197,10 @@ void __init MMU_init_hw(void) ...@@ -205,27 +197,10 @@ void __init MMU_init_hw(void)
if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105); if ( ppc_md.progress ) ppc_md.progress("hash:enter", 0x105);
#ifdef CONFIG_PPC64BRIDGE
#define LG_HPTEG_SIZE 7 /* 128 bytes per HPTEG */
#define SDR1_LOW_BITS (lg_n_hpteg - 11)
#define MIN_N_HPTEG 2048 /* min 256kB hash table */
#else
#define LG_HPTEG_SIZE 6 /* 64 bytes per HPTEG */ #define LG_HPTEG_SIZE 6 /* 64 bytes per HPTEG */
#define SDR1_LOW_BITS ((n_hpteg - 1) >> 10) #define SDR1_LOW_BITS ((n_hpteg - 1) >> 10)
#define MIN_N_HPTEG 1024 /* min 64kB hash table */ #define MIN_N_HPTEG 1024 /* min 64kB hash table */
#endif
#ifdef CONFIG_POWER4
/* The hash table has already been allocated and initialized
in prom.c */
n_hpteg = Hash_size >> LG_HPTEG_SIZE;
lg_n_hpteg = __ilog2(n_hpteg);
/* Remove the hash table from the available memory */
if (Hash)
reserve_phys_mem(__pa(Hash), Hash_size);
#else /* CONFIG_POWER4 */
/* /*
* Allow 1 HPTE (1/8 HPTEG) for each page of memory. * Allow 1 HPTE (1/8 HPTEG) for each page of memory.
* This is less than the recommended amount, but then * This is less than the recommended amount, but then
...@@ -248,7 +223,6 @@ void __init MMU_init_hw(void) ...@@ -248,7 +223,6 @@ void __init MMU_init_hw(void)
Hash = mem_pieces_find(Hash_size, Hash_size); Hash = mem_pieces_find(Hash_size, Hash_size);
cacheable_memzero(Hash, Hash_size); cacheable_memzero(Hash, Hash_size);
_SDR1 = __pa(Hash) | SDR1_LOW_BITS; _SDR1 = __pa(Hash) | SDR1_LOW_BITS;
#endif /* CONFIG_POWER4 */
Hash_end = (PTE *) ((unsigned long)Hash + Hash_size); Hash_end = (PTE *) ((unsigned long)Hash + Hash_size);
......
...@@ -2,18 +2,10 @@ ...@@ -2,18 +2,10 @@
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
# Extra CFLAGS so we don't have to do relative includes
CFLAGS_chrp_setup.o += -Iarch/$(ARCH)/mm
obj-$(CONFIG_APUS) += apus_setup.o obj-$(CONFIG_APUS) += apus_setup.o
ifeq ($(CONFIG_APUS),y) ifeq ($(CONFIG_APUS),y)
obj-$(CONFIG_PCI) += apus_pci.o obj-$(CONFIG_PCI) += apus_pci.o
endif endif
obj-$(CONFIG_PPC_CHRP) += chrp_setup.o chrp_time.o chrp_pci.o \
chrp_pegasos_eth.o
ifeq ($(CONFIG_PPC_CHRP),y)
obj-$(CONFIG_NVRAM) += chrp_nvram.o
endif
obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o obj-$(CONFIG_PPC_PREP) += prep_pci.o prep_setup.o
obj-$(CONFIG_PREP_RESIDUAL) += residual.o obj-$(CONFIG_PREP_RESIDUAL) += residual.o
obj-$(CONFIG_PQ2ADS) += pq2ads.o obj-$(CONFIG_PQ2ADS) += pq2ads.o
...@@ -40,7 +32,3 @@ obj-$(CONFIG_EV64360) += ev64360.o ...@@ -40,7 +32,3 @@ obj-$(CONFIG_EV64360) += ev64360.o
obj-$(CONFIG_MPC86XADS) += mpc866ads_setup.o obj-$(CONFIG_MPC86XADS) += mpc866ads_setup.o
obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o
obj-$(CONFIG_ADS8272) += mpc8272ads_setup.o obj-$(CONFIG_ADS8272) += mpc8272ads_setup.o
ifeq ($(CONFIG_SMP),y)
obj-$(CONFIG_PPC_CHRP) += chrp_smp.o
endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -38,8 +38,6 @@ endif ...@@ -38,8 +38,6 @@ endif
obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \ obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \
ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o
obj-$(CONFIG_PCI_QSPAN) += qspan_pci.o obj-$(CONFIG_PCI_QSPAN) += qspan_pci.o
obj-$(CONFIG_PPC_OF) += prom_init.o prom.o
obj-$(CONFIG_PPC_CHRP) += open_pic.o
obj-$(CONFIG_PPC_PREP) += open_pic.o todc_time.o obj-$(CONFIG_PPC_PREP) += open_pic.o todc_time.o
obj-$(CONFIG_BAMBOO) += pci_auto.o todc_time.o obj-$(CONFIG_BAMBOO) += pci_auto.o todc_time.o
obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o obj-$(CONFIG_CPCI690) += todc_time.o pci_auto.o
......
...@@ -216,7 +216,7 @@ static void openpic_safe_writefield(volatile u_int __iomem *addr, u_int mask, ...@@ -216,7 +216,7 @@ static void openpic_safe_writefield(volatile u_int __iomem *addr, u_int mask,
u_int openpic_read_IPI(volatile u_int __iomem * addr) u_int openpic_read_IPI(volatile u_int __iomem * addr)
{ {
u_int val = 0; u_int val = 0;
#if defined(OPENPIC_BIG_ENDIAN) || defined(CONFIG_POWER3) #if defined(OPENPIC_BIG_ENDIAN)
val = in_be32(addr); val = in_be32(addr);
#else #else
val = in_le32(addr); val = in_le32(addr);
......
This diff is collapsed.
This diff is collapsed.
...@@ -58,7 +58,7 @@ static struct sysrq_key_op sysrq_xmon_op = ...@@ -58,7 +58,7 @@ static struct sysrq_key_op sysrq_xmon_op =
void void
xmon_map_scc(void) xmon_map_scc(void)
{ {
#ifdef CONFIG_PPC_MULTIPLATFORM #ifdef CONFIG_PPC_PREP
volatile unsigned char *base; volatile unsigned char *base;
#elif defined(CONFIG_GEMINI) #elif defined(CONFIG_GEMINI)
......
This diff is collapsed.
...@@ -104,9 +104,6 @@ struct machdep_calls { ...@@ -104,9 +104,6 @@ struct machdep_calls {
unsigned long size, unsigned long size,
pgprot_t vma_prot); pgprot_t vma_prot);
/* this is for modules, since _machine can be a define -- Cort */
int ppc_machine;
/* Motherboard/chipset features. This is a kind of general purpose /* Motherboard/chipset features. This is a kind of general purpose
* hook used to control some machine specific features (like reset * hook used to control some machine specific features (like reset
* lines, chip power control, etc...). * lines, chip power control, etc...).
......
This diff is collapsed.
This diff is collapsed.
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