Commit 73f97101 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.129pre2

parent ef6a1333
......@@ -3937,9 +3937,8 @@ CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS
this feature, enter 0 or 1 here (it doesn't matter which).
The default value is 8 and should be supported by most hard disks.
This option has no effect for adapters with NVRAM, since the driver
will get this information from the user set-up. It also can be
overridden using a boot setup option, as follows (example):
This value can be overridden from the boot command line using the
'tags' option as follows (example):
'ncr53c8xx=tags:4/t2t3q16/t0u2q10' will set default queue depth to
4, set queue depth to 16 for target 2 and target 3 on controller 0
and set queue depth to 10 for target 0 / lun 2 on controller 1.
......@@ -3954,12 +3953,10 @@ maximum number of queued commands
CONFIG_SCSI_NCR53C8XX_MAX_TAGS
This option allows you to specify the maximum number of commands
that can be queued to any device, when tagged command queuing is
possible. The default value is 32. Minimum is 2, maximum is 64. For
value less than 32, this option only saves a little memory
(8*7*(32-MAXTAGS) bytes), so using less than 32 isn't worth it. For
value greater than 32, latency on reselection will be increased by 1
or 2 micro-seconds.
possible. The default value is 32. Minimum is 2, maximum is 64.
Modern hard disks are able to support 64 tags and even more, but
donnot seem to be faster when more than 32 tags are being used.
So, the normal answer here is to go with the default value 32 unless
you are using very large hard disks with large cache (>= 1 MB) that
are able to take advantage of more than 32 tagged commands.
......@@ -9686,7 +9683,7 @@ CONFIG_TT_DMA_EMUL
Ariadne support
CONFIG_ARIADNE
If you have a VillageTronics Ariadne Ethernet adapter, say Y.
If you have a Village Tronic Ariadne Ethernet adapter, say Y.
Otherwise, say N.
This driver is also available as a module ( = code which can be
......@@ -9696,7 +9693,7 @@ CONFIG_ARIADNE
Ariadne II support
CONFIG_ARIADNE2
If you have a VillageTronics Ariadne II Ethernet adapter, say Y.
If you have a Village Tronic Ariadne II Ethernet adapter, say Y.
Otherwise, say N.
This driver is also available as a module ( = code which can be
......@@ -10272,7 +10269,7 @@ CONFIG_FRAME_POINTER
# LocalWords: INSNS Ataris AutoConfig ZORRO OCS AMIFB Agnus Denise ECS CDTV GB
# LocalWords: AGA Cybervision CYBER GSP TMS DMI Zorro ACSI ROMs SLM BioNet GVP
# LocalWords: PAMsNet TekMagic Cyberstorm MkI CYBERSTORMII MkII BLZ onboard cx
# LocalWords: VillageTronics ATARILANCE RieblCard PAMCard VME MFP sangoma LAPB
# LocalWords: Village Tronic ATARILANCE RieblCard PAMCard VME MFP sangoma LAPB
# LocalWords: Rhotron BioData's Multiface AMIGAMOUSE COPCON Amiga's bitplanes
# LocalWords: ATARIMOUSE MFPSER SCC's MegaSTE ESCC Atari's GVPIOEXT DMASOUND
# LocalWords: fdutils cisco univercd rpcg htm iface lapb LAPBETHER tpqic qic
......
......@@ -526,9 +526,9 @@ __initfunc(static unsigned long calibrate_tsc(void))
/* Now let's take care of CTC channel 2 */
"movb $0xb0, %%al\n\t" /* binary, mode 0, LSB/MSB, ch 2*/
"outb %%al, $0x43\n\t" /* Write to CTC command port */
"movb $0x0c, %%al\n\t"
"movl %1, %%eax\n\t"
"outb %%al, $0x42\n\t" /* LSB of count */
"movb $0xe9, %%al\n\t"
"shrl $8, %%eax\n\t"
"outb %%al, $0x42\n\t" /* MSB of count */
/* Read the TSC; counting has just started */
......@@ -562,12 +562,12 @@ __initfunc(static unsigned long calibrate_tsc(void))
* do a real 64-by-64 divide before that time's up. */
"movl %%eax, %%ecx\n\t"
"xorl %%eax, %%eax\n\t"
"movl %1, %%edx\n\t"
"movl %2, %%edx\n\t"
"divl %%ecx\n\t" /* eax= 2^32 / (1 * TSC counts per microsecond) */
/* Return eax for the use of fast_gettimeoffset */
"movl %%eax, %0\n\t"
: "=r" (retval)
: "r" (5 * 1000020/HZ)
: "r" (5 * LATCH), "r" (5 * 1000020/HZ)
: /* we clobber: */ "ax", "bx", "cx", "dx", "cc", "memory");
return retval;
}
......
......@@ -16,6 +16,8 @@ KERNELLOAD =0xc0000000
ifeq ($(shell uname -m),ppc)
CHECKS = checks
else
CROSS_COMPILE = ppc-linux-elf-
endif
ASFLAGS =
......
......@@ -108,6 +108,11 @@ __initfunc(void amiga_init_IRQ(void))
custom.intreq = 0x7fff;
#ifdef CONFIG_APUS
/* Clear any inter-CPU interupt requests. Circumvents bug in
Blizzard IPL emulation HW (or so it appears). */
APUS_WRITE(APUS_INT_LVL, INTLVL_SETRESET | INTLVL_MASK);
/* Init IPL emulation. */
APUS_WRITE(APUS_REG_INT, REGINT_INTMASTER | REGINT_ENABLEIPL);
APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT);
APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_IPLMASK);
......@@ -304,12 +309,14 @@ void amiga_enable_irq(unsigned int irq)
}
if (irq >= IRQ_AMIGA_CIAB) {
cia_set_irq(&ciab_base, (1 << (irq - IRQ_AMIGA_CIAB)));
cia_able_irq(&ciab_base, CIA_ICR_SETCLR |
(1 << (irq - IRQ_AMIGA_CIAB)));
return;
}
if (irq >= IRQ_AMIGA_CIAA) {
cia_set_irq(&ciaa_base, (1 << (irq - IRQ_AMIGA_CIAA)));
cia_able_irq(&ciaa_base, CIA_ICR_SETCLR |
(1 << (irq - IRQ_AMIGA_CIAA)));
return;
......
......@@ -434,10 +434,6 @@ __initfunc(void config_amiga(void))
*/
if (AMIGAHW_PRESENT(MAGIC_REKICK))
*(unsigned char *)ZTWO_VADDR(0xde0002) |= 0x80;
#ifdef CONFIG_ZORRO
zorro_init();
#endif
}
static unsigned short jiffy_ticks;
......@@ -739,33 +735,32 @@ static void amiga_savekmsg_init(void)
savekmsg = (struct savekmsg *)amiga_chip_alloc(SAVEKMSG_MAXMEM);
savekmsg->magic1 = SAVEKMSG_MAGIC1;
savekmsg->magic2 = SAVEKMSG_MAGIC2;
savekmsg->magicptr = VTOP(savekmsg);
savekmsg->magicptr = virt_to_phys(savekmsg);
savekmsg->size = 0;
}
static void amiga_serial_putc(char c)
{
custom.serdat = (unsigned char)c | 0x100;
#ifdef CONFIG_APUS
/* I'm sure this should not be necessary since the address is
marked non-cachable and coherent. Still, without it the
serial output is not usable. -jskov */
eieio ();
#endif
while (!(custom.serdatr & 0x2000))
;
custom.serdat = (unsigned char)c | 0x100;
iobarrier ();
while (!(custom.serdatr & 0x2000))
;
}
void amiga_serial_console_write(struct console *co, const char *s,
unsigned int count)
{
while (count--) {
if (*s == '\n')
amiga_serial_putc('\r');
amiga_serial_putc(*s++);
}
#if 0 /* def CONFIG_KGDB */
/* FIXME:APUS GDB doesn't seem to like O-packages before it is
properly connected with the target. */
__gdb_output_string (s, count);
#else
while (count--) {
if (*s == '\n')
amiga_serial_putc('\r');
amiga_serial_putc(*s++);
}
#endif
}
#ifdef CONFIG_SERIAL_CONSOLE
......
#include <linux/config.h> /* CONFIG_HEARTBEAT */
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
......@@ -68,3 +69,24 @@ static inline unsigned long mktime(unsigned int year, unsigned int mon,
}
void apus_heartbeat (void)
{
#ifdef CONFIG_HEARTBEAT
static unsigned cnt = 0, period = 0, dist = 0;
if (cnt == 0 || cnt == dist)
mach_heartbeat( 1 );
else if (cnt == 7 || cnt == dist+7)
mach_heartbeat( 0 );
if (++cnt > period) {
cnt = 0;
/* The hyperbolic function below modifies the heartbeat period
* length in dependency of the current (5min) load. It goes
* through the points f(0)=126, f(1)=86, f(5)=51,
* f(inf)->30. */
period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
dist = period / 4;
}
#endif
}
This diff is collapsed.
......@@ -24,15 +24,21 @@ ZOFF = 0
ZSZ = 0
IOFF = 0
ISZ = 0
ifeq ($(CONFIG_ALL_PPC),y)
# yes, we want to build prep stuff
CONFIG_PREP = y
endif
ifeq ($(CONFIG_MBX),y)
ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00100000
else
#ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00800000
ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00600000
endif
GZIP_FLAGS = -v9
OBJECTS := head.o misc.o ../coffboot/zlib.o # inflate.o unzip.o
OBJECTS := head.o misc.o ../coffboot/zlib.o
CFLAGS = -O2 -DSTDC_HEADERS -fno-builtin -I$(TOPDIR)/include
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJCOPY_ARGS = -O elf32-powerpc
......@@ -46,10 +52,6 @@ endif
all: zImage
ifeq ($(CONFIG_ALL_PPC),y)
CONFIG_PREP = y
endif
ifeq ($(CONFIG_PREP),y)
zvmlinux.initrd: zvmlinux
$(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS)
......@@ -93,14 +95,12 @@ ifeq ($(CONFIG_PREP),y)
zImage: zvmlinux mkprep
./mkprep -pbp zvmlinux zImage
else
ifeq ($(CONFIG_MBX),y)
zImage: zvmlinux
ln -sf zvmlinux zImage
else
zImage:
endif
endif
ifeq ($(CONFIG_PREP),y)
......
......@@ -23,6 +23,10 @@ OBJCOPY = $(CROSS_COMPILE)objcopy
OBJS = crt0.o start.o main.o misc.o ../coffboot/string.o ../coffboot/zlib.o image.o # initrd.o
LIBS = $(TOPDIR)/lib/lib.a
ifeq ($(CONFIG_ALL_PPC),y)
# yes, we want to build chrp stuff
CONFIG_CHRP = y
endif
all: $(TOPDIR)/zImage
......
......@@ -15,7 +15,6 @@ ifneq ($(shell uname -m),ppc)
CROSS_COMPILE =ppc-linux-elf-
endif
HOSTCC = gcc
HOSTCFLAGS = -O -I$(TOPDIR)/include
......@@ -31,6 +30,11 @@ GZ = gzip -9
OBJS = crt0.o start.o main.o misc.o string.o zlib.o
LIBS = $(TOPDIR)/lib/lib.a
ifeq ($(CONFIG_ALL_PPC),y)
# yes, we want to build pmac stuff
CONFIG_PMAC = y
endif
ifeq ($(CONFIG_PMAC),y)
hack-coff: hack-coff.c
$(HOSTCC) $(HOSTCFLAGS) -o hack-coff hack-coff.c
......@@ -80,8 +84,6 @@ vmlinux.coff.initrd: vmlinux.gz
floppy: vmlinux.gz
endif
vmlinux.gz: $(TOPDIR)/vmlinux
......
......@@ -21,7 +21,7 @@ CONFIG_ALL_PPC=y
CONFIG_EXPERIMENTAL=y
CONFIG_MODULES=y
CONFIG_MODVERSIONS=y
# CONFIG_KMOD is not set
CONFIG_KMOD=y
CONFIG_PCI=y
# CONFIG_PCI_QUIRKS is not set
CONFIG_PCI_OLD_PROC=y
......@@ -34,16 +34,20 @@ CONFIG_KERNEL_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_BINFMT_JAVA is not set
# CONFIG_PARPORT is not set
# CONFIG_VGA_CONSOLE is not set
CONFIG_FB=y
CONFIG_FB_COMPAT_XPMAC=y
# CONFIG_PMAC_PBOOK is not set
CONFIG_PMAC_PBOOK=y
CONFIG_MAC_KEYBOARD=y
# CONFIG_MAC_FLOPPY is not set
# CONFIG_MAC_SERIAL is not set
# CONFIG_MACMOUSE is not set
CONFIG_MAC_FLOPPY=y
CONFIG_MAC_SERIAL=y
CONFIG_ADBMOUSE=y
CONFIG_BLK_DEV_IDE_PMAC=y
CONFIG_PROC_DEVICETREE=y
# CONFIG_KGDB is not set
# CONFIG_XMON is not set
CONFIG_XMON=y
# CONFIG_TOTALMP is not set
# CONFIG_BOOTX_TEXT is not set
#
# Plug and Play support
......@@ -53,7 +57,7 @@ CONFIG_PROC_DEVICETREE=y
#
# Block devices
#
CONFIG_BLK_DEV_FD=y
# CONFIG_BLK_DEV_FD is not set
CONFIG_BLK_DEV_IDE=y
# CONFIG_BLK_DEV_HD_IDE is not set
CONFIG_BLK_DEV_IDEDISK=y
......@@ -66,7 +70,7 @@ CONFIG_BLK_DEV_IDECD=y
# CONFIG_BLK_DEV_IDEPCI is not set
CONFIG_BLK_DEV_SL82C105=y
# CONFIG_IDE_CHIPSETS is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_LOOP=m
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_MD is not set
CONFIG_BLK_DEV_RAM=y
......@@ -94,7 +98,7 @@ CONFIG_INET=y
# CONFIG_NET_IPGRE is not set
# CONFIG_IP_ALIAS is not set
CONFIG_SYN_COOKIES=y
CONFIG_INET_RARP=y
# CONFIG_INET_RARP is not set
# CONFIG_IP_NOSR is not set
CONFIG_SKB_LARGE=y
# CONFIG_IPV6 is not set
......@@ -116,7 +120,7 @@ CONFIG_SKB_LARGE=y
#
CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=y
CONFIG_CHR_DEV_ST=m
CONFIG_BLK_DEV_SR=y
CONFIG_BLK_DEV_SR_VENDOR=y
# CONFIG_CHR_DEV_SG is not set
......@@ -146,11 +150,11 @@ CONFIG_BLK_DEV_SR_VENDOR=y
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_NCR53C7xx is not set
CONFIG_SCSI_NCR53C8XX=y
# CONFIG_SCSI_NCR53C8XX_NVRAM_DETECT is not set
CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE=y
CONFIG_SCSI_NCR53C8XX_IOMAPPED=y
CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=8
CONFIG_SCSI_NCR53C8XX_MAX_TAGS=4
CONFIG_SCSI_NCR53C8XX_SYNC=5
# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
CONFIG_SCSI_NCR53C8XX_IOMAPPED=y
# CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set
# CONFIG_SCSI_PAS16 is not set
# CONFIG_SCSI_PCI2000 is not set
......@@ -166,7 +170,7 @@ CONFIG_SCSI_NCR53C8XX_SYNC=5
# CONFIG_SCSI_DEBUG is not set
CONFIG_SCSI_MESH=y
CONFIG_SCSI_MESH_SYNC_RATE=5
CONFIG_SCSI_MAC53C94=y
CONFIG_SCSI_MAC53C94=m
#
# Network device support
......@@ -176,17 +180,17 @@ CONFIG_NETDEVICES=y
# CONFIG_DUMMY is not set
# CONFIG_EQUALIZER is not set
CONFIG_NET_ETHERNET=y
# CONFIG_MACE is not set
# CONFIG_BMAC is not set
CONFIG_MACE=y
CONFIG_BMAC=y
# CONFIG_NET_VENDOR_3COM is not set
CONFIG_LANCE=y
# CONFIG_LANCE is not set
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_VENDOR_RACAL is not set
# CONFIG_RTL8139 is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_NET_ISA is not set
CONFIG_NET_EISA=y
CONFIG_PCNET32=y
CONFIG_PCNET32=m
# CONFIG_AC3200 is not set
# CONFIG_APRICOT is not set
# CONFIG_CS89x0 is not set
......@@ -195,19 +199,26 @@ CONFIG_DE4X5=y
# CONFIG_DGRS is not set
# CONFIG_EEXPRESS_PRO100 is not set
# CONFIG_LNE390 is not set
# CONFIG_NE3210 is not set
# CONFIG_NE2K_PCI is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
# CONFIG_ES3210 is not set
# CONFIG_EPIC100 is not set
# CONFIG_TLAN is not set
# CONFIG_ZNET is not set
# CONFIG_NET_POCKET is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_DLCI is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
CONFIG_PPP=y
CONFIG_SLIP=m
# CONFIG_SLIP_COMPRESSED is not set
# CONFIG_SLIP_SMART is not set
# CONFIG_SLIP_MODE_SLIP6 is not set
# CONFIG_NET_RADIO is not set
# CONFIG_TR is not set
# CONFIG_SHAPER is not set
# CONFIG_HOSTESS_SV11 is not set
#
# Amateur Radio support
......@@ -224,60 +235,28 @@ CONFIG_DE4X5=y
#
# CONFIG_CD_NO_IDESCSI is not set
#
# Filesystems
#
# CONFIG_QUOTA is not set
# CONFIG_MINIX_FS is not set
CONFIG_EXT2_FS=y
CONFIG_ISO9660_FS=y
# CONFIG_JOLIET is not set
# CONFIG_FAT_FS is not set
# CONFIG_MSDOS_FS is not set
# CONFIG_UMSDOS_FS is not set
# CONFIG_VFAT_FS is not set
CONFIG_PROC_FS=y
CONFIG_NFS_FS=y
# CONFIG_NFSD is not set
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_CODA_FS is not set
# CONFIG_SMB_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_AFFS_FS is not set
CONFIG_HFS_FS=y
# CONFIG_ROMFS_FS is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_UFS_FS is not set
# CONFIG_ADFS_FS is not set
# CONFIG_DEVPTS_FS is not set
CONFIG_MAC_PARTITION=y
# CONFIG_NLS is not set
#
# Console drivers
#
CONFIG_DUMMY_CONSOLE=y
CONFIG_FB_OF=y
# CONFIG_FB_S3TRIO is not set
# CONFIG_FB_ATY is not set
# CONFIG_FB_CT65550 is not set
CONFIG_FB_VGA=y
# CONFIG_FB_OF is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FBCON_ADVANCED is not set
CONFIG_FBCON_CFB8=y
CONFIG_FBCON_VGA=y
# CONFIG_FBCON_FONTWIDTH8_ONLY is not set
# CONFIG_FBCON_FONTS is not set
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
#
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
# CONFIG_SERIAL is not set
CONFIG_SERIAL=m
# CONFIG_SERIAL_EXTENDED is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_UNIX98_PTYS is not set
CONFIG_MOUSE=y
# CONFIG_ATIXL_BUSMOUSE is not set
# CONFIG_BUSMOUSE is not set
......@@ -285,21 +264,117 @@ CONFIG_MOUSE=y
CONFIG_PSMOUSE=y
# CONFIG_82C710_MOUSE is not set
# CONFIG_PC110_PAD is not set
# CONFIG_UMISC is not set
# CONFIG_QIC02_TAPE is not set
# CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set
# CONFIG_VIDEO_DEV is not set
# CONFIG_NVRAM is not set
# CONFIG_JOYSTICK is not set
# CONFIG_MISC_RADIO is not set
#
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
#
# Filesystems
#
# CONFIG_QUOTA is not set
# CONFIG_MINIX_FS is not set
CONFIG_EXT2_FS=y
CONFIG_ISO9660_FS=y
# CONFIG_JOLIET is not set
CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
# CONFIG_UMSDOS_FS is not set
# CONFIG_VFAT_FS is not set
CONFIG_PROC_FS=y
CONFIG_NFS_FS=y
CONFIG_NFSD=y
# CONFIG_NFSD_SUN is not set
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_CODA_FS is not set
# CONFIG_SMB_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_NTFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_AFFS_FS is not set
CONFIG_HFS_FS=y
# CONFIG_ROMFS_FS is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_UFS_FS is not set
# CONFIG_BSD_DISKLABEL is not set
# CONFIG_SMD_DISKLABEL is not set
# CONFIG_SOLARIS_X86_PARTITION is not set
# CONFIG_ADFS_FS is not set
# CONFIG_QNX4FS_FS is not set
CONFIG_MAC_PARTITION=y
CONFIG_NLS=y
#
# Native Language Support
#
# CONFIG_NLS_CODEPAGE_437 is not set
# CONFIG_NLS_CODEPAGE_737 is not set
# CONFIG_NLS_CODEPAGE_775 is not set
# CONFIG_NLS_CODEPAGE_850 is not set
# CONFIG_NLS_CODEPAGE_852 is not set
# CONFIG_NLS_CODEPAGE_855 is not set
# CONFIG_NLS_CODEPAGE_857 is not set
# CONFIG_NLS_CODEPAGE_860 is not set
# CONFIG_NLS_CODEPAGE_861 is not set
# CONFIG_NLS_CODEPAGE_862 is not set
# CONFIG_NLS_CODEPAGE_863 is not set
# CONFIG_NLS_CODEPAGE_864 is not set
# CONFIG_NLS_CODEPAGE_865 is not set
# CONFIG_NLS_CODEPAGE_866 is not set
# CONFIG_NLS_CODEPAGE_869 is not set
# CONFIG_NLS_CODEPAGE_874 is not set
# CONFIG_NLS_ISO8859_1 is not set
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set
# CONFIG_NLS_ISO8859_4 is not set
# CONFIG_NLS_ISO8859_5 is not set
# CONFIG_NLS_ISO8859_6 is not set
# CONFIG_NLS_ISO8859_7 is not set
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_ISO8859_9 is not set
# CONFIG_NLS_KOI8_R is not set
#
# Sound
#
# CONFIG_SOUND is not set
CONFIG_SOUND=y
CONFIG_DMASOUND=y
# CONFIG_SOUND_ES1370 is not set
# CONFIG_SOUND_ES1371 is not set
# CONFIG_SOUND_SONICVIBES is not set
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
CONFIG_SOUND_OSS=y
# CONFIG_SOUND_PAS is not set
# CONFIG_SOUND_SB is not set
# CONFIG_SOUND_ADLIB is not set
# CONFIG_SOUND_GUS is not set
# CONFIG_SOUND_MPU401 is not set
# CONFIG_SOUND_PSS is not set
# CONFIG_SOUND_MSS is not set
# CONFIG_SOUND_SSCAPE is not set
# CONFIG_SOUND_TRIX is not set
# CONFIG_SOUND_MAD16 is not set
# CONFIG_SOUND_WAVEFRONT is not set
# CONFIG_SOUND_CS4232 is not set
# CONFIG_SOUND_OPL3SA2 is not set
# CONFIG_SOUND_MAUI is not set
# CONFIG_SOUND_SGALAXY is not set
# CONFIG_SOUND_OPL3SA1 is not set
# CONFIG_SOUND_SOFTOSS is not set
# CONFIG_SOUND_YM3812 is not set
# CONFIG_SOUND_VMIDI is not set
# CONFIG_SOUND_UART6850 is not set
#
# Additional low level sound drivers
#
# CONFIG_LOWLEVEL_SOUND is not set
# $Id: config.in,v 1.72 1998/10/01 14:09:40 cort Exp $
# $Id: config.in,v 1.80 1998/11/11 03:54:56 paulus Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
mainmenu_name "Linux/PowerPC Kernel Configuration"
mainmenu_option next_comment
comment 'Cross development support'
bool 'Build using cross development tools' CONFIG_CROSSCOMPILE
if [ "$CONFIG_CROSSCOMPILE" = "y" ]; then
string ' Prefix for cross devel tools' CROSS_COMPILE "ppc-linux-elf-"
fi
endmenu
mainmenu_option next_comment
comment 'Platform support'
define_bool CONFIG_PPC y
......@@ -28,16 +18,16 @@ choice 'Machine Type' \
PowerMac/PReP/CHRP CONFIG_ALL_PPC \
APUS CONFIG_APUS \
MBX CONFIG_MBX" PowerMac
if [ "$CONFIG_ALL_PPC" != "y" ];then
define_bool CONFIG_MACH_SPECIFIC y
fi
endmenu
if [ "$CONFIG_MBX" = "y" ];then
define_bool CONFIG_SERIAL_CONSOLE y
fi
if [ "$CONFIG_ALL_PPC" != "y" ]; then
define_bool CONFIG_MACH_SPECIFIC y
fi
mainmenu_option next_comment
comment 'General setup'
......@@ -79,23 +69,23 @@ if [ "$CONFIG_PARPORT" != "n" ]; then
fi
fi
bool 'Support for VGA Console' CONFIG_VGA_CONSOLE
bool 'Support for frame buffer devices' CONFIG_FB
if [ "$CONFIG_FB" = "y" ]; then
bool 'Backward compatibility mode for Xpmac' CONFIG_FB_COMPAT_XPMAC
fi
if [ "$CONFIG_FB" != "y" ]; then
bool 'Support for VGA Console' CONFIG_VGA_CONSOLE
fi
bool 'Power management support for PowerBook 3400/2400' CONFIG_PMAC_PBOOK
bool 'Support for PowerMac keyboard' CONFIG_MAC_KEYBOARD
bool 'Support for PowerMac floppy' CONFIG_MAC_FLOPPY
bool 'Support for PowerMac serial ports' CONFIG_MAC_SERIAL
bool 'Support for PowerMac ADB mouse' CONFIG_ADBMOUSE
bool 'Support for PowerMac IDE devices (must also enable IDE)' CONFIG_BLK_DEV_IDE_PMAC
bool 'Support for Open Firmware device tree in /proc' CONFIG_PROC_DEVICETREE
bool 'Include kgdb kernel debugger' CONFIG_KGDB
bool 'Include xmon kernel debugger' CONFIG_XMON
bool 'Support for TotalImpact TotalMP' CONFIG_TOTALMP
bool 'Support for early boot text console (BootX only)' CONFIG_BOOTX_TEXT
if [ "$CONFIG_APUS" = "y" ]; then
define_bool CONFIG_FB_CONSOLE y
......@@ -105,6 +95,7 @@ if [ "$CONFIG_APUS" = "y" ]; then
define_bool CONFIG_ABSTRACT_CONSOLE y
define_bool CONFIG_FB y
tristate 'Amiga builtin serial support' CONFIG_AMIGA_BUILTIN_SERIAL
tristate 'Parallel printer support' CONFIG_M68K_PRINTER
tristate 'GVP IO-Extender support' CONFIG_GVPIOEXT
dep_tristate 'GVP IO-Extender parallel printer support' CONFIG_GVPIOEXT_LP $CONFIG_GVPIOEXT
dep_tristate 'GVP IO-Extender PLIP support' CONFIG_GVPIOEXT_PLIP $CONFIG_GVPIOEXT
......@@ -113,7 +104,8 @@ if [ "$CONFIG_APUS" = "y" ]; then
"$CONFIG_MULTIFACE_III_TTY" = "y" ]; then
bool 'Support for serial port console' CONFIG_SERIAL_CONSOLE
fi
bool '/proc/hardware support' CONFIG_PROC_HARDWARE
bool 'Use power LED as a heartbeat' CONFIG_HEARTBEAT
bool '/proc/hardware support' CONFIG_PROC_HARDWARE
fi
endmenu
......@@ -128,9 +120,7 @@ fi
mainmenu_option next_comment
comment 'SCSI support'
tristate 'SCSI support' CONFIG_SCSI
if [ "$CONFIG_SCSI" != "n" ]; then
source drivers/scsi/Config.in
fi
......@@ -173,22 +163,15 @@ source drivers/video/Config.in
endmenu
source drivers/char/Config.in
source fs/Config.in
source fs/nls/Config.in
mainmenu_option next_comment
comment 'Sound'
tristate 'Sound card support' CONFIG_SOUND
if [ "$CONFIG_SOUND" != "n" ]; then
if [ "$CONFIG_APUS" = "y" -o "$CONFIG_PMAC" = "y" ]; then
tristate 'Amiga or PowerMac DMA sound support' CONFIG_DMASOUND
fi
if [ "$CONFIG_PREP" = "y" -o "$CONFIG_CHRP" = "y" ]; then
source drivers/sound/Config.in
fi
tristate 'Amiga or PowerMac DMA sound support' CONFIG_DMASOUND
source drivers/sound/Config.in
fi
endmenu
......@@ -35,16 +35,20 @@ CONFIG_KERNEL_ELF=y
CONFIG_BINFMT_MISC=m
# CONFIG_BINFMT_JAVA is not set
# CONFIG_PARPORT is not set
# CONFIG_VGA_CONSOLE is not set
CONFIG_FB=y
CONFIG_FB_COMPAT_XPMAC=y
CONFIG_PMAC_PBOOK=y
CONFIG_MAC_KEYBOARD=y
CONFIG_MAC_FLOPPY=y
CONFIG_MAC_SERIAL=y
CONFIG_MACMOUSE=y
CONFIG_ADBMOUSE=y
CONFIG_BLK_DEV_IDE_PMAC=y
CONFIG_PROC_DEVICETREE=y
# CONFIG_KGDB is not set
CONFIG_XMON=y
# CONFIG_XMON is not set
# CONFIG_TOTALMP is not set
CONFIG_BOOTX_TEXT=y
#
# Plug and Play support
......@@ -70,6 +74,10 @@ CONFIG_BLK_DEV_IDEFLOPPY=y
# CONFIG_BLK_DEV_RZ1000 is not set
# CONFIG_BLK_DEV_IDEPCI is not set
# CONFIG_BLK_DEV_SL82C105 is not set
CONFIG_BLK_DEV_IDE_PMAC=y
CONFIG_BLK_DEV_IDEDMA_PMAC=y
CONFIG_BLK_DEV_IDEDMA=y
CONFIG_PMAC_IDEDMA_AUTO=y
# CONFIG_IDE_CHIPSETS is not set
#
......@@ -159,7 +167,7 @@ CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_AHA152X is not set
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
CONFIG_SCSI_AIC7XXX=m
CONFIG_SCSI_AIC7XXX=y
# CONFIG_OVERRIDE_CMDS is not set
CONFIG_AIC7XXX_PROC_STATS=y
CONFIG_AIC7XXX_RESET_DELAY=15
......@@ -216,23 +224,26 @@ CONFIG_NET_EISA=y
# CONFIG_AC3200 is not set
# CONFIG_APRICOT is not set
# CONFIG_CS89x0 is not set
CONFIG_DE4X5=m
CONFIG_DE4X5=y
CONFIG_DEC_ELCP=m
# CONFIG_DGRS is not set
# CONFIG_EEXPRESS_PRO100 is not set
# CONFIG_LNE390 is not set
# CONFIG_NE3210 is not set
# CONFIG_NE2K_PCI is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
# CONFIG_ES3210 is not set
# CONFIG_EPIC100 is not set
# CONFIG_ZNET is not set
# CONFIG_NET_POCKET is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_DLCI is not set
# CONFIG_LTPC is not set
# CONFIG_COPS is not set
# CONFIG_IPDDP is not set
CONFIG_PPP=m
CONFIG_PPP=y
#
# CCP compressors for PPP are only built as modules.
......@@ -241,6 +252,7 @@ CONFIG_PPP=m
# CONFIG_NET_RADIO is not set
# CONFIG_TR is not set
# CONFIG_SHAPER is not set
# CONFIG_HOSTESS_SV11 is not set
#
# Amateur Radio support
......@@ -264,11 +276,12 @@ CONFIG_DUMMY_CONSOLE=y
CONFIG_FB_OF=y
CONFIG_FB_CONTROL=y
CONFIG_FB_PLATINUM=y
CONFIG_FB_VALKYRIE=y
CONFIG_FB_ATY=y
CONFIG_FB_IMSTT=y
CONFIG_FB_CT65550=y
# CONFIG_FB_S3TRIO is not set
# CONFIG_FB_VGA is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FBCON_ADVANCED is not set
CONFIG_FBCON_CFB8=y
......@@ -293,8 +306,9 @@ CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=m
# CONFIG_SERIAL_EXTENDED is not set
# CONFIG_SERIAL_NONSTANDARD is not set
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
# CONFIG_MOUSE is not set
# CONFIG_UMISC is not set
# CONFIG_QIC02_TAPE is not set
# CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set
......@@ -322,6 +336,7 @@ CONFIG_VFAT_FS=m
CONFIG_PROC_FS=y
CONFIG_NFS_FS=y
CONFIG_NFSD=y
# CONFIG_NFSD_SUN is not set
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_CODA_FS is not set
......@@ -330,12 +345,16 @@ CONFIG_LOCKD=y
# CONFIG_NTFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_AFFS_FS is not set
CONFIG_HFS_FS=m
CONFIG_HFS_FS=y
# CONFIG_ROMFS_FS is not set
CONFIG_AUTOFS_FS=y
# CONFIG_UFS_FS is not set
# CONFIG_ADFS_FS is not set
# CONFIG_BSD_DISKLABEL is not set
# CONFIG_SMD_DISKLABEL is not set
# CONFIG_SOLARIS_X86_PARTITION is not set
CONFIG_DEVPTS_FS=y
# CONFIG_ADFS_FS is not set
# CONFIG_QNX4FS_FS is not set
CONFIG_MAC_PARTITION=y
CONFIG_NLS=y
......@@ -374,3 +393,9 @@ CONFIG_NLS_CODEPAGE_437=y
#
CONFIG_SOUND=y
CONFIG_DMASOUND=y
# CONFIG_SOUND_ES1370 is not set
# CONFIG_SOUND_ES1371 is not set
# CONFIG_SOUND_SONICVIBES is not set
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
# CONFIG_SOUND_OSS is not set
......@@ -15,7 +15,7 @@ OX_OBJS := ppc_ksyms.o setup.o
O_OBJS := traps.o irq.o idle.o time.o process.o signal.o syscalls.o misc.o \
bitops.o ptrace.o align.o ppc_htab.o
bitops.o ptrace.o align.o ppc_htab.o feature.o
ifdef CONFIG_PCI
O_OBJS += pci.o
......
......@@ -61,6 +61,8 @@ extern struct mem_info memory[NUM_MEMINFO];/* memory description */
extern void amiga_floppy_setup(char *, int *);
extern void config_amiga(void);
static int __60nsram = 0;
/*********************************************************** SETUP */
/* From arch/m68k/kernel/setup.c. */
__initfunc(void apus_setup_arch(unsigned long * memory_start_p,
......@@ -76,10 +78,17 @@ __initfunc(void apus_setup_arch(unsigned long * memory_start_p,
for( p = cmd_line; p && *p; ) {
i = 0;
if (!strncmp( p, "debug=", 6 )) {
strncpy( debug_device, p+6, sizeof(debug_device)-1 );
debug_device[sizeof(debug_device)-1] = 0;
if ((q = strchr( debug_device, ' ' ))) *q = 0;
i = 1;
strncpy( debug_device, p+6, sizeof(debug_device)-1 );
debug_device[sizeof(debug_device)-1] = 0;
if ((q = strchr( debug_device, ' ' ))) *q = 0;
i = 1;
} else if (!strncmp( p, "60nsram", 7 )) {
APUS_WRITE (APUS_REG_WAITSTATE,
REGWAITSTATE_SETRESET
|REGWAITSTATE_PPCR
|REGWAITSTATE_PPCW);
__60nsram = 1;
i = 1;
}
if (i) {
......@@ -96,67 +105,85 @@ __initfunc(void apus_setup_arch(unsigned long * memory_start_p,
config_amiga();
}
void get_current_tb(unsigned long long *time)
{
__asm __volatile ("1:mftbu 4 \n\t"
" mftb 5 \n\t"
" mftbu 6 \n\t"
" cmpw 4,6 \n\t"
" bne 1b \n\t"
" stw 4,0(%0)\n\t"
" stw 5,4(%0)\n\t"
:
: "r" (time)
: "r4", "r5", "r6");
}
void apus_calibrate_decr(void)
{
int freq, divisor;
unsigned char c = *(unsigned char*)ZTWO_VADDR(0xf00011);
printk ("CPU speed ID ('%c') ", c);
switch (c)
/* This algorithm for determining the bus speed was
contributed by Ralph Schmidt. */
unsigned long long start, stop;
int bus_speed;
{
case 'A':
case 'B':
if (amiga_model == AMI_1200 || amiga_model == AMI_2000){
freq = 1;
} else {
freq = 0;
}
break;
case 'C':
if (amiga_model == AMI_1200 || amiga_model == AMI_2000){
freq = 0;
} else {
freq = 1;
unsigned long loop = amiga_eclock / 10;
get_current_tb (&start);
while (loop--) {
unsigned char tmp;
tmp = ciaa.pra;
}
break;
case 'D':
freq = 1;
break;
default:
freq = 0;
printk (" *Unknown* ");
break;
get_current_tb (&stop);
}
bus_speed = (((unsigned long)(stop-start))*10*4) / 1000000;
if (AMI_1200 == amiga_model)
bus_speed /= 2;
if ((bus_speed >= 47) && (bus_speed < 53)) {
bus_speed = 50;
freq = 12500000;
} else if ((bus_speed >= 57) && (bus_speed < 63)) {
bus_speed = 60;
freq = 15000000;
} else if ((bus_speed >= 63) && (bus_speed < 69)) {
bus_speed = 66;
freq = 16500000;
} else {
printk ("APUS: Unable to determine bus speed (%d). "
"Defaulting to 50MHz", bus_speed);
bus_speed = 50;
freq = 12500000;
}
/* Ease diagnostics... */
{
int speed;
switch (freq)
{
case 0:
freq = 15000000;
speed = 60;
break;
case 1:
freq = 16500000;
speed =66;
break;
}
/* Use status of left mouse button to select
RAM speed. */
if (!(ciaa.pra & 0x40))
{
APUS_WRITE (APUS_REG_WAITSTATE,
REGWAITSTATE_SETRESET
|REGWAITSTATE_PPCR
|REGWAITSTATE_PPCW);
printk (" [RAM R/W waitstate removed. "
"(expecting 60ns RAM).] ");
extern int __map_without_bats;
printk ("APUS: BATs=%d, BUS=%dMHz, RAM=%dns\n",
(__map_without_bats) ? 0 : 1,
bus_speed,
(__60nsram) ? 60 : 70);
/* print a bit more if asked politely... */
if (!(ciaa.pra & 0x40)){
extern unsigned int bat_addrs[4][3];
int b;
for (b = 0; b < 4; ++b) {
printk ("APUS: BAT%d ", b);
printk ("%08x-%08x -> %08x\n",
bat_addrs[b][0],
bat_addrs[b][1],
bat_addrs[b][2]);
}
}
printk ("PowerUp Bus Speed: %dMHz\n", speed);
}
freq *= 60; /* try to make freq/1e6 an integer */
......
......@@ -39,6 +39,7 @@
#include <asm/ide.h>
#include <asm/prom.h>
#include <asm/gg2.h>
#include <asm/pci-bridge.h>
extern void hydra_init(void);
extern void w83c553f_init(void);
......@@ -191,7 +192,15 @@ chrp_setup_arch(unsigned long * memory_start_p, unsigned long * memory_end_p))
aux_device_present = 0xaa;
ROOT_DEV = to_kdev_t(0x0802); /* sda2 (sda1 is for the kernel) */
#ifdef CONFIG_BLK_DEV_INITRD
/* this is fine for chrp */
initrd_below_start_ok = 1;
if (initrd_start)
ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
else
#endif
ROOT_DEV = to_kdev_t(0x0802); /* sda2 (sda1 is for the kernel) */
printk("Boot arguments: %s\n", cmd_line);
......@@ -205,7 +214,6 @@ chrp_setup_arch(unsigned long * memory_start_p, unsigned long * memory_end_p))
/* PCI bridge config space access area -
* appears to be not in devtree on longtrail. */
ioremap(GG2_PCI_CONFIG_BASE, 0x80000);
/*
* Temporary fixes for PCI devices.
* -- Geert
......@@ -217,10 +225,13 @@ chrp_setup_arch(unsigned long * memory_start_p, unsigned long * memory_end_p))
* Fix the Super I/O configuration
*/
sio_init();
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif
/* my starmax 6000 needs this but the longtrail shouldn't do it -- Cort */
if ( !strncmp("MOT", get_property(find_path_device("/"),
"model", NULL),3) )
*memory_start_p = pmac_find_bridges(*memory_start_p, *memory_end_p);
}
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
......
/*
* arch/ppc/kernel/feature.c
*
* Copyright (C) 1996 Paul Mackerras (paulus@cs.anu.edu.au)
*
* 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/types.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <asm/errno.h>
#include <asm/ohare.h>
#include <asm/io.h>
#include <asm/prom.h>
#include <asm/feature.h>
#define MAX_FEATURE_REGS 2
#undef DEBUG_FEATURE
static u32 feature_bits_pbook[] = {
0, /* FEATURE_null */
OH_SCC_RESET, /* FEATURE_Serial_reset */
OH_SCC_ENABLE, /* FEATURE_Serial_enable */
OH_SCCA_IO, /* FEATURE_Serial_IO_A */
OH_SCCB_IO, /* FEATURE_Serial_IO_B */
OH_FLOPPY_ENABLE, /* FEATURE_SWIM3_enable */
OH_MESH_ENABLE, /* FEATURE_MESH_enable */
OH_IDE_ENABLE, /* FEATURE_IDE_enable */
OH_VIA_ENABLE, /* FEATURE_VIA_enable */
OH_IDECD_POWER, /* FEATURE_CD_power */
OH_BAY_RESET, /* FEATURE_Mediabay_reset */
OH_BAY_ENABLE, /* FEATURE_Mediabay_enable */
OH_BAY_PCI_ENABLE, /* FEATURE_Mediabay_PCI_enable */
OH_BAY_IDE_ENABLE, /* FEATURE_Mediabay_IDE_enable */
OH_BAY_FLOPPY_ENABLE, /* FEATURE_Mediabay_floppy_enable */
0, /* FEATURE_BMac_reset */
0, /* FEATURE_BMac_IO_enable */
0, /* FEATURE_Modem_PowerOn -> guess...*/
0 /* FEATURE_Modem_Reset -> guess...*/
};
/* assume these are the same as the ohare until proven otherwise */
static u32 feature_bits_heathrow[] = {
0, /* FEATURE_null */
OH_SCC_RESET, /* FEATURE_Serial_reset */
OH_SCC_ENABLE, /* FEATURE_Serial_enable */
OH_SCCA_IO, /* FEATURE_Serial_IO_A */
OH_SCCB_IO, /* FEATURE_Serial_IO_B */
OH_FLOPPY_ENABLE, /* FEATURE_SWIM3_enable */
OH_MESH_ENABLE, /* FEATURE_MESH_enable */
OH_IDE_ENABLE, /* FEATURE_IDE_enable */
OH_VIA_ENABLE, /* FEATURE_VIA_enable */
OH_IDECD_POWER, /* FEATURE_CD_power */
OH_BAY_RESET, /* FEATURE_Mediabay_reset */
OH_BAY_ENABLE, /* FEATURE_Mediabay_enable */
OH_BAY_PCI_ENABLE, /* FEATURE_Mediabay_PCI_enable */
OH_BAY_IDE_ENABLE, /* FEATURE_Mediabay_IDE_enable */
OH_BAY_FLOPPY_ENABLE, /* FEATURE_Mediabay_floppy_enable */
0x80000000, /* FEATURE_BMac_reset */
0x60000000, /* FEATURE_BMac_IO_enable */
0x02000000, /* FEATURE_Modem_PowerOn -> guess...*/
0x07000000 /* FEATURE_Modem_Reset -> guess...*/
};
/* definition of a feature controller object */
struct feature_controller
{
u32* bits;
volatile u32* reg;
struct device_node* device;
};
/* static functions */
static void
feature_add_controller(struct device_node *controller_device, u32* bits);
static int
feature_lookup_controller(struct device_node *device);
/* static varialbles */
static struct feature_controller controllers[MAX_FEATURE_REGS];
static int controller_count = 0;
void
feature_init(void)
{
struct device_node *np;
np = find_devices("mac-io");
while (np != NULL)
{
feature_add_controller(np, feature_bits_heathrow);
np = np->next;
}
if (controller_count == 0)
{
np = find_devices("ohare");
if (np)
{
if (find_devices("via-pmu") != NULL)
feature_add_controller(np, feature_bits_pbook);
else
/* else not sure; maybe this is a Starmax? */
feature_add_controller(np, NULL);
}
}
if (controller_count)
printk(KERN_INFO "Registered %d feature controller(s)\n", controller_count);
}
static void
feature_add_controller(struct device_node *controller_device, u32* bits)
{
struct feature_controller* controller;
if (controller_count >= MAX_FEATURE_REGS)
{
printk(KERN_INFO "Feature controller %s skipped(MAX:%d)\n",
controller_device->full_name, MAX_FEATURE_REGS);
return;
}
controller = &controllers[controller_count];
controller->bits = bits;
controller->device = controller_device;
if (controller_device->n_addrs == 0) {
printk(KERN_ERR "No addresses for %s\n",
controller_device->full_name);
return;
}
controller->reg = (volatile u32 *)ioremap(
controller_device->addrs[0].address + OHARE_FEATURE_REG, 4);
if (bits == NULL) {
printk(KERN_INFO "Twiddling the magic ohare bits\n");
out_le32(controller->reg, STARMAX_FEATURES);
return;
}
controller_count++;
}
static int
feature_lookup_controller(struct device_node *device)
{
int i;
if (device == NULL)
return -EINVAL;
while(device)
{
for (i=0; i<controller_count; i++)
if (device == controllers[i].device)
return i;
device = device->parent;
}
#ifdef DEBUG_FEATURE
printk("feature: <%s> not found on any controller\n",
device->name);
#endif
return -ENODEV;
}
int
feature_set(struct device_node* device, enum system_feature f)
{
int controller;
unsigned long flags;
if (f >= FEATURE_last)
return -EINVAL;
controller = feature_lookup_controller(device);
if (controller < 0)
return controller;
#ifdef DEBUG_FEATURE
printk("feature: <%s> setting feature %d in controller @0x%x\n",
device->name, (int)f, (unsigned int)controllers[controller].reg);
#endif
save_flags(flags);
cli();
st_le32( controllers[controller].reg,
ld_le32(controllers[controller].reg) |
controllers[controller].bits[f]);
restore_flags(flags);
udelay(10);
return 0;
}
int
feature_clear(struct device_node* device, enum system_feature f)
{
int controller;
unsigned long flags;
if (f >= FEATURE_last)
return -EINVAL;
controller = feature_lookup_controller(device);
if (controller < 0)
return controller;
#ifdef DEBUG_FEATURE
printk("feature: <%s> clearing feature %d in controller @0x%x\n",
device->name, (int)f, (unsigned int)controllers[controller].reg);
#endif
save_flags(flags);
cli();
st_le32( controllers[controller].reg,
ld_le32(controllers[controller].reg) &
~(controllers[controller].bits[f]));
restore_flags(flags);
udelay(10);
return 0;
}
int
feature_test(struct device_node* device, enum system_feature f)
{
int controller;
if (f >= FEATURE_last)
return -EINVAL;
controller = feature_lookup_controller(device);
if (controller < 0)
return controller;
return (ld_le32(controllers[controller].reg) &
controllers[controller].bits[f]) != 0;
}
/*
* arch/ppc/kernel/head.S
*
* $Id: head.S,v 1.107 1998/09/25 19:48:52 paulus Exp $
* $Id: head.S,v 1.111 1998/11/10 01:10:32 paulus Exp $
*
* PowerPC version
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
......@@ -210,7 +210,8 @@ __start:
mr r27,r7
#ifndef CONFIG_8xx
bl prom_init
.globl __secondary_start
__secondary_start:
/*
* Use the first pair of BAT registers to map the 1st 16MB
* of RAM to KERNELBASE. From this point on we can't safely
......@@ -1395,15 +1396,13 @@ hash_page_out:
next_slot:
.long 0
/*
* FPU stuff for the 6xx/7xx follows
* -- Cort
*/
load_up_fpu:
/*
* Disable FP for the task which had the FPU previously,
* and save its floating-point registers in its thread_struct.
* Enables the FPU for use in the kernel on return.
* On SMP we know the fpu is free, since we give it up every
* switch. -- Cort
*/
#ifndef CONFIG_APUS
lis r6,-KERNELBASE@h
......@@ -1411,28 +1410,23 @@ load_up_fpu:
lis r6,CYBERBASEp@h
lwz r6,0(r6)
#endif
addis r3,r6,last_task_used_math@ha
lwz r4,last_task_used_math@l(r3)
mfmsr r5
ori r5,r5,MSR_FP
SYNC
mtmsr r5 /* enable use of fpu now */
#ifndef __SMP__
SYNC
cmpi 0,r4,0
beq 1f
#else
/*
* All the saving of last_task_used_math is handled
* by a switch_to() call to smp_giveup_fpu() in SMP so
* last_task_used_math is not used.
*
* We should never be here on SMP anyway, since the fpu should
* always be on.
* -- Cort
*/
b 1f
#endif
#ifndef __SMP__
SYNC
cmpi 0,r4,0
beq 1f
add r4,r4,r6
addi r4,r4,TSS /* want TSS of last_task_used_math */
SAVE_32FPRS(0, r4)
......@@ -1444,19 +1438,17 @@ load_up_fpu:
li r20,MSR_FP|MSR_FE0|MSR_FE1
andc r4,r4,r20 /* disable FP for previous task */
stw r4,_MSR-STACK_FRAME_OVERHEAD(r5)
#endif /* __SMP__ */
1: ori r23,r23,MSR_FP|MSR_FE0|MSR_FE1 /* enable use of FP after return */
mfspr r5,SPRG3 /* current task's TSS (phys) */
lfd fr0,TSS_FPSCR-4(r5)
mtfsf 0xff,fr0
REST_32FPRS(0, r5)
/*
* on SMP we don't really use last_task_used_math but set it
* here anyway to avoid the ifdef's -- Cort
*/
subi r4,r5,TSS
sub r4,r4,r6
#ifndef __SMP__
stw r4,last_task_used_math@l(r3)
#endif /* __SMP__ */
/* restore registers and return */
lwz r3,_CCR(r21)
lwz r4,_LINK(r21)
......@@ -1516,8 +1508,10 @@ giveup_fpu:
cmpi 0,r4,0
beqlr- /* if no previous owner, done */
addi r4,r4,TSS /* want TSS of last_task_used_math */
#ifndef __SMP__
li r5,0
stw r5,last_task_used_math@l(r3)
#endif /* __SMP__ */
SAVE_32FPRS(0, r4)
mffs fr0
stfd fr0,TSS_FPSCR-4(r4)
......@@ -1628,14 +1622,27 @@ start_here:
5: mtspr HID0,r11 /* superscalar exec & br history tbl */
4:
#endif /* CONFIG_8xx */
#ifdef __SMP__
/* if we're the second cpu stack and r2 are different
* and we want to not clear the bss -- Cort */
lis r5,first_cpu_booted@h
ori r5,r5,first_cpu_booted@l
lwz r5,0(r5)
cmpi 0,r5,0
beq 99f
/* get current */
lis r2,current_set@h
ori r2,r2,current_set@l
addi r2,r2,4
lwz r2,0(r2)
b 10f
99:
#endif /* __SMP__ */
/* ptr to current */
lis r2,init_task_union@h
ori r2,r2,init_task_union@l
/* stack */
addi r1,r2,TASK_UNION_SIZE
li r0,0
stwu r0,-STACK_FRAME_OVERHEAD(r1)
/* Clear out the BSS */
lis r11,_end@ha
addi r11,r11,_end@l
......@@ -1651,6 +1658,15 @@ start_here:
3: stwu r0,4(r8)
bdnz 3b
2:
#ifdef __SMP__
10:
#endif /* __SMP__ */
/* stack */
addi r1,r2,TASK_UNION_SIZE
li r0,0
stwu r0,-STACK_FRAME_OVERHEAD(r1)
/*
* Decide what sort of machine this is and initialize the MMU.
*/
......@@ -1999,6 +2015,8 @@ int_return:
beq+ 1f
addi r3,r1,STACK_FRAME_OVERHEAD
bl do_IRQ
.globl lost_irq_ret
lost_irq_ret:
b 3b
1: lis r4,bh_mask@ha
lwz r4,bh_mask@l(r4)
......@@ -2007,6 +2025,8 @@ int_return:
and. r4,r4,r5
beq+ 2f
bl do_bottom_half
.globl do_bottom_half_ret
do_bottom_half_ret:
SYNC
mtmsr r30 /* disable interrupts again */
SYNC
......@@ -2024,6 +2044,8 @@ int_return:
li r3,0
addi r4,r1,STACK_FRAME_OVERHEAD
bl do_signal
.globl do_signal_ret
do_signal_ret:
b 0b
8: addi r4,r1,INT_FRAME_SIZE+STACK_UNDERHEAD /* size of frame */
stw r4,TSS+KSP(r2) /* save kernel stack pointer */
......
/*
* $Id: idle.c,v 1.50 1998/08/18 16:19:25 cort Exp $
* $Id: idle.c,v 1.56 1998/10/13 19:14:36 paulus Exp $
*
* Idle daemon for PowerPC. Idle daemon will handle any action
* that needs to be taken when the system becomes idle.
......@@ -11,8 +11,6 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#define __KERNEL_SYSCALLS__
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/sched.h>
......@@ -32,9 +30,6 @@
#include <asm/processor.h>
#include <asm/mmu.h>
#include <asm/cache.h>
#ifdef CONFIG_PMAC
#include <asm/mediabay.h>
#endif
void zero_paged(void);
void power_save(void);
......@@ -60,15 +55,7 @@ int idled(void *unused)
if ( !current->need_resched && zero_paged_on ) zero_paged();
if ( !current->need_resched && htab_reclaim_on ) htab_reclaim();
/*
* Only processor 1 may sleep now since processor 2 would
* never wake up. Need to add timer code for processor 2
* then it can sleep. -- Cort
*/
#ifndef __SMP__
if ( !current->need_resched ) power_save();
#endif /* __SMP__ */
run_task_queue(&tq_scheduler);
schedule();
}
......@@ -93,15 +80,9 @@ int cpu_idle(void *unused)
*/
asmlinkage int sys_idle(void)
{
extern int media_bay_task(void *);
if(current->pid != 0)
return -EPERM;
#ifdef CONFIG_PMAC
if (media_bay_present)
kernel_thread(media_bay_task, NULL, 0);
#endif
idled(NULL);
return 0; /* should never execute this but it makes gcc happy -- Cort */
}
......
This diff is collapsed.
......@@ -363,9 +363,25 @@ _GLOBAL(_get_THRM1)
mfspr r3,THRM1
blr
_GLOBAL(_get_THRM2)
mfspr r3,THRM2
blr
_GLOBAL(_get_THRM3)
mfspr r3,THRM3
blr
_GLOBAL(_set_THRM1)
mtspr THRM1,r3
blr
_GLOBAL(_set_THRM2)
mtspr THRM2,r3
blr
_GLOBAL(_set_THRM3)
mtspr THRM3,r3
blr
_GLOBAL(_get_L2CR)
mfspr r3,L2CR
......@@ -453,7 +469,6 @@ _GLOBAL(name) \
#define __NR__exit __NR_exit
SYSCALL(idle)
SYSCALL(setup)
SYSCALL(sync)
SYSCALL(setsid)
SYSCALL(write)
......@@ -490,12 +505,12 @@ sys_call_table:
.long sys_mknod
.long sys_chmod /* 15 */
.long sys_lchown
.long sys_ni_syscall
.long sys_ni_syscall /* old break syscall holder */
.long sys_stat
.long sys_lseek
.long sys_getpid /* 20 */
.long sys_mount
.long sys_umount
.long sys_oldumount
.long sys_setuid
.long sys_getuid
.long sys_stime /* 25 */
......@@ -504,11 +519,11 @@ sys_call_table:
.long sys_fstat
.long sys_pause
.long sys_utime /* 30 */
.long /*sys_stty*/ sys_ni_syscall
.long /*sys_gtty*/ sys_ni_syscall
.long sys_ni_syscall /* old stty syscall holder */
.long sys_ni_syscall /* old gtty syscall holder */
.long sys_access
.long sys_nice
.long /*sys_ftime*/ sys_ni_syscall /* 35 */
.long sys_ni_syscall /* 35 */ /* old ftime syscall holder */
.long sys_sync
.long sys_kill
.long sys_rename
......@@ -517,7 +532,7 @@ sys_call_table:
.long sys_dup
.long sys_pipe
.long sys_times
.long /*sys_prof*/ sys_ni_syscall
.long sys_ni_syscall /* old prof syscall holder */
.long sys_brk /* 45 */
.long sys_setgid
.long sys_getgid
......@@ -525,13 +540,13 @@ sys_call_table:
.long sys_geteuid
.long sys_getegid /* 50 */
.long sys_acct
.long /*sys_phys*/ sys_ni_syscall
.long /*sys_lock*/ sys_ni_syscall
.long sys_umount /* recycled never used phys() */
.long sys_ni_syscall /* old lock syscall holder */
.long sys_ioctl
.long sys_fcntl /* 55 */
.long /*sys_mpx*/ sys_ni_syscall
.long sys_ni_syscall /* old mpx syscall holder */
.long sys_setpgid
.long /*sys_ulimit*/ sys_ni_syscall
.long sys_ni_syscall /* old ulimit syscall holder */
.long sys_olduname
.long sys_umask /* 60 */
.long sys_chroot
......@@ -562,7 +577,7 @@ sys_call_table:
.long sys_uselib
.long sys_swapon
.long sys_reboot
.long old_readdir /* was sys_readdir */
.long old_readdir
.long sys_mmap /* 90 */
.long sys_munmap
.long sys_truncate
......@@ -571,7 +586,7 @@ sys_call_table:
.long sys_fchown /* 95 */
.long sys_getpriority
.long sys_setpriority
.long /*sys_profil*/ sys_ni_syscall
.long sys_ni_syscall /* old profil syscall holder */
.long sys_statfs
.long sys_fstatfs /* 100 */
.long sys_ioperm
......@@ -610,7 +625,7 @@ sys_call_table:
.long sys_bdflush
.long sys_sysfs /* 135 */
.long sys_personality
.long 0 /* for afs_syscall */
.long sys_ni_syscall /* for afs_syscall */
.long sys_setfsuid
.long sys_setfsgid
.long sys_llseek /* 140 */
......@@ -638,28 +653,28 @@ sys_call_table:
.long sys_nanosleep
.long sys_mremap
.long sys_setresuid
.long sys_getresuid /* 165 */
.long sys_getresuid /* 165 */
.long sys_query_module
.long sys_poll
.long sys_nfsservctl
.long sys_setresgid
.long sys_getresgid /* 170 */
.long sys_setresgid
.long sys_getresgid /* 170 */
.long sys_prctl
.long sys_rt_sigreturn
.long sys_rt_sigaction
.long sys_rt_sigprocmask
.long sys_rt_sigpending /* 175 */
.long sys_rt_sigpending /* 175 */
.long sys_rt_sigtimedwait
.long sys_rt_sigqueueinfo
.long sys_rt_sigsuspend
.long sys_pread
.long sys_pwrite /* 180 */
.long sys_pwrite /* 180 */
.long sys_chown
.long sys_getcwd
.long sys_capget
.long sys_capset
.long sys_sigaltstack /* 185 */
.long sys_sigaltstack /* 185 */
.long sys_sendfile
.long sys_ni_syscall
.long sys_ni_syscall
.long sys_ni_syscall /* streams1 */
.long sys_ni_syscall /* streams2 */
.space (NR_syscalls-183)*4
/*
* $Id: pci.c,v 1.38 1998/08/31 06:28:02 cort Exp $
* $Id: pci.c,v 1.39 1998/10/13 20:59:04 cort Exp $
* Common pmac/prep/chrp pci routines. -- Cort
*/
......@@ -164,7 +164,7 @@ __initfunc(void
get_property(find_path_device("/"), "model", NULL),3) )
{
isa_io_base = 0xfe000000;
set_config_access_method(raven);
set_config_access_method(grackle);
}
else
{
......
......@@ -40,7 +40,6 @@ static void add_bridges(struct device_node *dev, unsigned long *mem_ptr);
#define BANDIT_COHERENT 0x40
__pmac
void *pci_io_base(unsigned int bus)
{
struct bridge_data *bp;
......@@ -50,6 +49,7 @@ void *pci_io_base(unsigned int bus)
return bp->io_base;
}
__pmac
int pci_device_loc(struct device_node *dev, unsigned char *bus_ptr,
unsigned char *devfn_ptr)
{
......@@ -68,6 +68,7 @@ int pci_device_loc(struct device_node *dev, unsigned char *bus_ptr,
return 0;
}
__pmac
int pmac_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn,
unsigned char offset, unsigned char *val)
{
......@@ -90,6 +91,7 @@ int pmac_pcibios_read_config_byte(unsigned char bus, unsigned char dev_fn,
return PCIBIOS_SUCCESSFUL;
}
__pmac
int pmac_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn,
unsigned char offset, unsigned short *val)
{
......@@ -114,6 +116,7 @@ int pmac_pcibios_read_config_word(unsigned char bus, unsigned char dev_fn,
return PCIBIOS_SUCCESSFUL;
}
__pmac
int pmac_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn,
unsigned char offset, unsigned int *val)
{
......@@ -138,6 +141,7 @@ int pmac_pcibios_read_config_dword(unsigned char bus, unsigned char dev_fn,
return PCIBIOS_SUCCESSFUL;
}
__pmac
int pmac_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn,
unsigned char offset, unsigned char val)
{
......@@ -159,6 +163,7 @@ int pmac_pcibios_write_config_byte(unsigned char bus, unsigned char dev_fn,
return PCIBIOS_SUCCESSFUL;
}
__pmac
int pmac_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn,
unsigned char offset, unsigned short val)
{
......@@ -182,6 +187,7 @@ int pmac_pcibios_write_config_word(unsigned char bus, unsigned char dev_fn,
return PCIBIOS_SUCCESSFUL;
}
__pmac
int pmac_pcibios_write_config_dword(unsigned char bus, unsigned char dev_fn,
unsigned char offset, unsigned int val)
{
......@@ -406,7 +412,7 @@ __initfunc(static void add_bridges(struct device_node *dev, unsigned long *mem_p
ioremap(0xfec00000, 0x1000);
bp->cfg_data = (volatile unsigned char *)
ioremap(0xfee00000, 0x1000);
bp->io_base = (void *) ioremap(0xfe000000, 0x10000);
bp->io_base = (void *) ioremap(0xfe000000, 0x20000);
}
if (isa_io_base == 0)
isa_io_base = (unsigned long) bp->io_base;
......
......@@ -49,9 +49,9 @@
#include <asm/adb.h>
#include <asm/cuda.h>
#include <asm/pmu.h>
#include <asm/mediabay.h>
#include <asm/ohare.h>
#include <asm/mediabay.h>
#include <asm/feature.h>
#include "time.h"
unsigned char drive_info;
......@@ -64,7 +64,6 @@ extern void zs_kgdb_hook(int tty_num);
static void ohare_init(void);
__pmac
int
pmac_get_cpuinfo(char *buffer)
{
......@@ -151,6 +150,7 @@ pmac_get_cpuinfo(char *buffer)
#define MKDEV_SD_PARTITION(i) MKDEV(SD_MAJOR_NUMBER(i), SD_MINOR_NUMBER(i))
#define MKDEV_SD(index) MKDEV_SD_PARTITION((index) << 4)
__init
kdev_t sd_find_target(void *host, int tgt)
{
Scsi_Disk *dp;
......@@ -168,13 +168,13 @@ kdev_t sd_find_target(void *host, int tgt)
* Dummy mksound function that does nothing.
* The real one is in the dmasound driver.
*/
__pmac
static void
pmac_mksound(unsigned int hz, unsigned int ticks)
{
}
static volatile u32 *sysctrl_regs;
static volatile u32 *feature_addr;
__initfunc(void
pmac_setup_arch(unsigned long *memory_start_p, unsigned long *memory_end_p))
......@@ -206,10 +206,11 @@ pmac_setup_arch(unsigned long *memory_start_p, unsigned long *memory_end_p))
and some registers used by smp boards */
sysctrl_regs = (volatile u32 *) ioremap(0xf8000000, 0x1000);
__ioremap(0xffc00000, 0x400000, pgprot_val(PAGE_READONLY));
ohare_init();
*memory_start_p = pmac_find_bridges(*memory_start_p, *memory_end_p);
ohare_init();
feature_init();
#ifdef CONFIG_KGDB
zs_kgdb_hook(0);
......@@ -234,39 +235,19 @@ pmac_setup_arch(unsigned long *memory_start_p, unsigned long *memory_end_p))
__initfunc(static void ohare_init(void))
{
struct device_node *np;
np = find_devices("ohare");
if (np == 0)
return;
if (np->next != 0)
printk(KERN_WARNING "only using the first ohare\n");
if (np->n_addrs == 0) {
printk(KERN_ERR "No addresses for %s\n", np->full_name);
return;
}
feature_addr = (volatile u32 *)
ioremap(np->addrs[0].address + OHARE_FEATURE_REG, 4);
if (find_devices("via-pmu") == 0) {
printk(KERN_INFO "Twiddling the magic ohare bits\n");
out_le32(feature_addr, STARMAX_FEATURES);
} else {
out_le32(feature_addr, in_le32(feature_addr) | PBOOK_FEATURES);
printk(KERN_DEBUG "feature reg = %x\n", in_le32(feature_addr));
}
/*
* Turn on the L2 cache.
* We assume that we have a PSX memory controller iff
* we have an ohare I/O controller.
*/
if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) {
if (sysctrl_regs[4] & 0x10)
sysctrl_regs[4] |= 0x04000020;
else
sysctrl_regs[4] |= 0x04000000;
printk(KERN_INFO "Level 2 cache enabled\n");
if (find_devices("ohare") != NULL) {
if (((sysctrl_regs[2] >> 24) & 0xf) >= 3) {
if (sysctrl_regs[4] & 0x10)
sysctrl_regs[4] |= 0x04000020;
else
sysctrl_regs[4] |= 0x04000000;
printk(KERN_INFO "Level 2 cache enabled\n");
}
}
}
......@@ -277,8 +258,10 @@ int boot_target;
int boot_part;
kdev_t boot_dev;
__initfunc(void powermac_init(void))
void __init powermac_init(void)
{
if ( (_machine != _MACH_chrp) && (_machine != _MACH_Pmac) )
return;
adb_init();
pmac_nvram_init();
if (_machine == _MACH_Pmac) {
......@@ -363,7 +346,9 @@ __initfunc(void find_boot_device(void))
#endif
}
__initfunc(void note_bootable_part(kdev_t dev, int part))
/* can't be initfunc - can be called whenever a disk is first accessed */
__pmac
void note_bootable_part(kdev_t dev, int part)
{
static int found_boot = 0;
char *p;
......
......@@ -25,8 +25,7 @@ static int nvram_mult;
#define NVRAM_SIZE 0x2000 /* 8kB of non-volatile RAM */
__pmac
__init
void pmac_nvram_init(void)
{
struct device_node *dp;
......
......@@ -24,6 +24,7 @@
#include <asm/system.h>
#include <asm/pci-bridge.h>
#include <asm/irq.h>
#include <asm/feature.h>
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
......@@ -100,7 +101,6 @@ EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strspn);
EXPORT_SYMBOL(strcmp);
EXPORT_SYMBOL(strncmp);
EXPORT_SYMBOL(strnicmp);
EXPORT_SYMBOL(memset);
EXPORT_SYMBOL(memcpy);
EXPORT_SYMBOL(memmove);
......@@ -159,6 +159,10 @@ EXPORT_SYMBOL(giveup_fpu);
EXPORT_SYMBOL(flush_icache_range);
EXPORT_SYMBOL(xchg_u32);
#ifndef CONFIG_MACH_SPECIFIC
EXPORT_SYMBOL(_machine);
#endif
EXPORT_SYMBOL(adb_request);
EXPORT_SYMBOL(adb_autopoll);
EXPORT_SYMBOL(adb_register);
......@@ -174,10 +178,15 @@ EXPORT_SYMBOL(sleep_notifier_list);
EXPORT_SYMBOL(abort);
EXPORT_SYMBOL(find_devices);
EXPORT_SYMBOL(find_type_devices);
EXPORT_SYMBOL(find_compatible_devices);
EXPORT_SYMBOL(find_path_device);
EXPORT_SYMBOL(find_phandle);
EXPORT_SYMBOL(get_property);
EXPORT_SYMBOL(pci_io_base);
EXPORT_SYMBOL(pci_device_loc);
EXPORT_SYMBOL(feature_set);
EXPORT_SYMBOL(feature_clear);
EXPORT_SYMBOL(feature_test);
EXPORT_SYMBOL(note_scsi_host);
EXPORT_SYMBOL(kd_mksound);
#ifdef CONFIG_PMAC
......
/*
* $Id: prep_pci.c,v 1.22 1998/08/05 20:11:15 cort Exp $
* $Id: prep_pci.c,v 1.23 1998/10/21 10:52:24 cort Exp $
* PReP pci functions.
* Originally by Gary Thomas
* rewritten and updated by Cort Dougan (cort@cs.nmt.edu)
......@@ -462,6 +462,11 @@ __initfunc(unsigned long route_pci_interrupts(void))
Motherboard_map = Utah_pci_IRQ_map;
Motherboard_routes = Utah_pci_IRQ_routes;
break;
case 0xE0: /* MTX -- close enough?? to Genesis, so reuse it */
Motherboard_map_name = "Motorola MTX";
Motherboard_map = Genesis_pci_IRQ_map;
Motherboard_routes = Genesis_pci_IRQ_routes;
break;
case 0x40: /* PowerStack */
default: /* Can't hurt, can it? */
Motherboard_map_name = "Blackhawk (Powerstack)";
......
......@@ -196,7 +196,7 @@ prep_setup_arch(unsigned long * memory_start_p, unsigned long * memory_end_p))
sprintf(cmd_line,"%s console=tty0 console=ttyS0,9600n8", cmd_line);
printk("Boot arguments: %s\n", cmd_line);
#ifdef CONFIG_CS4232
#ifdef CONFIG_SOUND_CS4232
/*
* setup proper values for the cs4232 driver so we don't have
* to recompile for the motorola or ibm workstations sound systems.
......@@ -233,8 +233,7 @@ prep_setup_arch(unsigned long * memory_start_p, unsigned long * memory_end_p))
}
}
}
#endif /* CONFIG_CS4232 */
#endif /* CONFIG_SOUND_CS4232 */
/*print_residual_device_info();*/
request_region(0x20,0x20,"pic1");
......
......@@ -163,14 +163,19 @@ switch_to(struct task_struct *prev, struct task_struct *new)
#endif
#ifdef SHOW_TASK_SWITCHES
printk("%s/%d -> %s/%d NIP %08lx cpu %d sfr %d lock %x\n",
printk("%s/%d -> %s/%d NIP %08lx cpu %d lock %x root %x/%x\n",
prev->comm,prev->pid,
new->comm,new->pid,new->tss.regs->nip,new->processor,
new->tss.smp_fork_ret,scheduler_lock.lock);
scheduler_lock.lock,new->fs->root,prev->fs->root);
#endif
#ifdef __SMP__
/* avoid complexity of lazy save/restore of fpu
* by just saving it every time we switch out -- Cort
* by just saving it every time we switch out if
* this task used the fpu during the last quantum.
*
* If it tries to use the fpu again, it'll trap and
* reload its fp regs.
* -- Cort
*/
if ( prev->tss.regs->msr & MSR_FP )
smp_giveup_fpu(prev);
......@@ -383,6 +388,7 @@ asmlinkage int sys_fork(int p1, int p2, int p3, int p4, int p5, int p6,
{
int res;
lock_kernel();
res = do_fork(SIGCHLD, regs->gpr[1], regs);
/* only parent returns here */
......@@ -404,18 +410,23 @@ asmlinkage int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
{
int error;
char * filename;
lock_kernel();
filename = getname((char *) a0);
error = PTR_ERR(filename);
if (IS_ERR(filename))
goto out;
#ifdef __SMP__
if ( regs->msr & MSR_FP )
smp_giveup_fpu(current);
#else
if ( last_task_used_math == current )
last_task_used_math = NULL;
giveup_fpu();
#endif
error = do_execve(filename, (char **) a1, (char **) a2, regs);
putname(filename);
out:
unlock_kernel();
return error;
}
......
This diff is collapsed.
/*
* $Id: residual.c,v 1.12 1998/08/27 23:15:56 paulus Exp $
* $Id: residual.c,v 1.14 1998/10/11 17:38:10 cort Exp $
*
* Code to deal with the PReP residual data.
*
......@@ -49,7 +49,7 @@
#include <asm/ide.h>
const char * PnP_BASE_TYPES[]= {
const char * PnP_BASE_TYPES[] __initdata = {
"Reserved",
"MassStorageDevice",
"NetworkInterfaceController",
......@@ -65,7 +65,7 @@ const char * PnP_BASE_TYPES[]= {
/* Device Sub Type Codes */
const unsigned char * PnP_SUB_TYPES[] = {
const unsigned char * PnP_SUB_TYPES[] __initdata = {
"\001\000SCSIController",
"\001\001IDEController",
"\001\002FloppyController",
......@@ -122,7 +122,7 @@ const unsigned char * PnP_SUB_TYPES[] = {
/* Device Interface Type Codes */
const unsigned char * PnP_INTERFACES[]= {
const unsigned char * PnP_INTERFACES[] __initdata = {
"\000\000\000General",
"\001\000\000GeneralSCSI",
"\001\001\000GeneralIDE",
......@@ -240,7 +240,7 @@ const unsigned char * PnP_INTERFACES[]= {
NULL
};
static const unsigned char *PnP_SUB_TYPE_STR(unsigned char BaseType,
static const unsigned char __init *PnP_SUB_TYPE_STR(unsigned char BaseType,
unsigned char SubType) {
const unsigned char ** s=PnP_SUB_TYPES;
while (*s && !((*s)[0]==BaseType
......@@ -249,7 +249,7 @@ static const unsigned char *PnP_SUB_TYPE_STR(unsigned char BaseType,
else return("Unknown !");
};
static const unsigned char *PnP_INTERFACE_STR(unsigned char BaseType,
static const unsigned char __init *PnP_INTERFACE_STR(unsigned char BaseType,
unsigned char SubType,
unsigned char Interface) {
const unsigned char ** s=PnP_INTERFACES;
......@@ -260,7 +260,7 @@ static const unsigned char *PnP_INTERFACE_STR(unsigned char BaseType,
else return NULL;
};
static void printsmallvendor(PnP_TAG_PACKET *pkt, int size) {
static void __init printsmallvendor(PnP_TAG_PACKET *pkt, int size) {
int i, c;
char decomp[4];
#define p pkt->S14_Pack.S14_Data.S14_PPCPack
......@@ -285,7 +285,7 @@ static void printsmallvendor(PnP_TAG_PACKET *pkt, int size) {
#undef p
}
static void printsmallpacket(PnP_TAG_PACKET * pkt, int size) {
static void __init printsmallpacket(PnP_TAG_PACKET * pkt, int size) {
static const unsigned char * intlevel[] = {"high", "low"};
static const unsigned char * intsense[] = {"edge", "level"};
......@@ -352,7 +352,7 @@ static void printsmallpacket(PnP_TAG_PACKET * pkt, int size) {
}
}
static void printlargevendor(PnP_TAG_PACKET * pkt, int size) {
static void __init printlargevendor(PnP_TAG_PACKET * pkt, int size) {
static const unsigned char * addrtype[] = {"I/O", "Memory", "System"};
static const unsigned char * inttype[] = {"8259", "MPIC", "RS6k BUID %d"};
static const unsigned char * convtype[] = {"Bus Memory", "Bus I/O", "DMA"};
......@@ -462,7 +462,7 @@ static void printlargevendor(PnP_TAG_PACKET * pkt, int size) {
}
}
static void printlargepacket(PnP_TAG_PACKET * pkt, int size) {
static void __init printlargepacket(PnP_TAG_PACKET * pkt, int size) {
switch (tag_large_item_name(pkt->S1_Pack.Tag)) {
case LargeVendorItem:
printlargevendor(pkt, size);
......@@ -473,7 +473,7 @@ static void printlargepacket(PnP_TAG_PACKET * pkt, int size) {
break;
}
}
static void printpackets(PnP_TAG_PACKET * pkt, const char * cat) {
static void __init printpackets(PnP_TAG_PACKET * pkt, const char * cat) {
if (pkt->S1_Pack.Tag== END_TAG) {
printk(" No packets describing %s resources.\n", cat);
return;
......@@ -494,7 +494,7 @@ static void printpackets(PnP_TAG_PACKET * pkt, const char * cat) {
} while (pkt->S1_Pack.Tag != END_TAG);
}
void print_residual_device_info(void)
void __init print_residual_device_info(void)
{
int i;
PPC_DEVICE *dev;
......@@ -562,8 +562,8 @@ void print_residual_device_info(void)
}
static void printVPD(void) {
#if 0
static void __init printVPD(void) {
#define vpd res->VitalProductData
int ps=vpd.PageSize, i, j;
static const char* Usage[]={
......@@ -628,7 +628,6 @@ static void printVPD(void) {
/*
* Spit out some info about residual data
*/
#if 0
void print_residual_device_info(void)
{
int i;
......@@ -764,7 +763,7 @@ in this rarely used area we unencode and compare */
little endian in the heap, so we use two parameters to avoid writing
two very similar functions */
static int same_DevID(unsigned short vendor,
static int __init same_DevID(unsigned short vendor,
unsigned short Number,
char * str)
{
......@@ -780,7 +779,7 @@ static int same_DevID(unsigned short vendor,
return 0;
}
PPC_DEVICE *residual_find_device(unsigned long BusMask,
PPC_DEVICE __init *residual_find_device(unsigned long BusMask,
unsigned char * DevID,
int BaseType,
int SubType,
......@@ -803,7 +802,7 @@ PPC_DEVICE *residual_find_device(unsigned long BusMask,
return 0;
}
PPC_DEVICE *residual_find_device_id(unsigned long BusMask,
PPC_DEVICE __init *residual_find_device_id(unsigned long BusMask,
unsigned short DevID,
int BaseType,
int SubType,
......@@ -844,7 +843,7 @@ PnP_TAG_PACKET *PnP_find_packet(unsigned char *p,
return 0; /* not found */
}
PnP_TAG_PACKET *PnP_find_small_vendor_packet(unsigned char *p,
PnP_TAG_PACKET __init *PnP_find_small_vendor_packet(unsigned char *p,
unsigned packet_type,
int n)
{
......@@ -858,7 +857,7 @@ PnP_TAG_PACKET *PnP_find_small_vendor_packet(unsigned char *p,
return 0; /* not found */
}
PnP_TAG_PACKET *PnP_find_large_vendor_packet(unsigned char *p,
PnP_TAG_PACKET __init *PnP_find_large_vendor_packet(unsigned char *p,
unsigned packet_type,
int n)
{
......
/*
* $Id: setup.c,v 1.103 1998/09/18 09:14:56 paulus Exp $
* $Id: setup.c,v 1.117 1998/11/09 19:55:53 geert Exp $
* Common prep/pmac/chrp boot and setup code.
*/
......@@ -24,6 +24,7 @@
#include <asm/bootinfo.h>
#include <asm/setup.h>
#include <asm/amigappc.h>
#include <asm/smp.h>
#ifdef CONFIG_MBX
#include <asm/mbx.h>
#endif
......@@ -131,9 +132,7 @@ void machine_restart(char *cmd)
cuda_poll();
break;
case ADB_VIAPMU:
pmu_request(&req, NULL, 1, PMU_RESET);
for (;;)
pmu_poll();
pmu_restart();
break;
default:
}
......@@ -206,10 +205,7 @@ void machine_power_off(void)
cuda_poll();
break;
case ADB_VIAPMU:
pmu_request(&req, NULL, 5, PMU_SHUTDOWN,
'M', 'A', 'T', 'T');
for (;;)
pmu_poll();
pmu_shutdown();
break;
default:
}
......@@ -250,9 +246,11 @@ void ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq)
{
#if !defined(CONFIG_MBX) && !defined(CONFIG_APUS)
switch (_machine) {
#if defined(CONFIG_BLK_DEV_IDE_PMAC)
case _MACH_Pmac:
pmac_ide_init_hwif_ports(p,base,irq);
pmac_ide_init_hwif_ports(p,base,irq);
break;
#endif
case _MACH_chrp:
chrp_ide_init_hwif_ports(p,base,irq);
break;
......@@ -267,68 +265,31 @@ EXPORT_SYMBOL(ide_init_hwif_ports);
unsigned long cpu_temp(void)
{
#if 0
unsigned long i, temp, thrm1, dir;
int sanity;
unsigned char thres = 0;
/*
* setup thrm3 - need to give TAU at least 20us
* to do the compare so assume a 300MHz clock.
* We need 300*20 ticks then.
* -- Cort
*/
asm("mtspr 1020, %1\n\t"
"mtspr 1021, %1\n\t"
"mtspr 1022, %0\n\t"::
"r" ( ((300*20)<<18) | THRM3_E), "r" (0) );
#if 0
for ( i = 127 ; i >= 0 ; i-- )
{
asm("mtspr 1020, %0\n\t"::
"r" (THRM1_TID|THRM1_V|(i<<2)) );
/* check value */
while ( !( thrm1 & THRM1_TIV) )
asm("mfspr %0, 1020 \n\t": "=r" (thrm1) );
if ( thrm1 & THRM1_TIN )
{
printk("tin set: %x tiv %x\n", thrm1,thrm1&THRM1_TIV);
goto out;
}
}
#endif
#if 0
i = 32; /* increment */
dir = 1; /* direction we're checking 0=up 1=down */
temp = 64; /* threshold checking against */
while ( i )
{
_set_THRM1((1<<29) | THRM1_V | (temp<<2) );
printk("checking %d in dir %d thrm set to %x/%x\n", temp,dir,
( (1<<29) | THRM1_V | (temp<<2)),_get_THRM1());
/* check value */
sanity = 0x0fffffff;
while ( (!( thrm1 & THRM1_TIV)) && (sanity--) )
thrm1 = _get_THRM1();
/*asm("mfspr %0, 1020 \n\t": "=r" (thrm1) );*/
if ( ! sanity || sanity==0xffffffff ) printk("no sanity\n");
/* temp is not in that direction */
if ( !(thrm1 & THRM1_TIN) )
{
printk("not in that dir thrm1 %x\n",thrm1);
if ( dir == 0 ) dir = 1;
else dir = 0;
}
if ( dir ) temp -= i;
else temp += i;
i /= 2;
}
asm("mtspr 1020, %0\n\t"
"mtspr 1022, %0\n\t" ::"r" (0) );
/* disable thrm2 */
_set_THRM2( 0 );
/* threshold 0 C, tid: exceeding threshold, tie: don't generate interrupt */
_set_THRM1( THRM1_V );
/* we need 20us to do the compare - assume 300MHz processor clock */
_set_THRM3(0);
_set_THRM3(THRM3_E | (300*30)<<18 );
udelay(100);
/* wait for the compare to complete */
/*while ( !(_get_THRM1() & THRM1_TIV) ) ;*/
if ( !(_get_THRM1() & THRM1_TIV) )
printk("no tiv\n");
if ( _get_THRM1() & THRM1_TIN )
printk("crossed\n");
/* turn everything off */
_set_THRM3(0);
_set_THRM1(0);
#endif
#endif
return 0;
return thres;
}
int get_cpuinfo(char *buffer)
......@@ -342,12 +303,11 @@ int get_cpuinfo(char *buffer)
unsigned long i;
#ifdef __SMP__
extern unsigned long cpu_present_map;
extern struct cpuinfo_PPC cpu_data[NR_CPUS];
#define CPU_PRESENT(x) (cpu_callin_map[(x)])
#define GET_PVR ((long int)(cpu_data[i].pvr))
#define CD(x) (cpu_data[i].x)
#else
#define cpu_present_map 1L
#define CPU_PRESENT(x) ((x)==0)
#define smp_num_cpus 1
#define GET_PVR ((long int)_get_PVR())
#define CD(x) (x)
......@@ -355,7 +315,7 @@ int get_cpuinfo(char *buffer)
for ( i = 0; i < smp_num_cpus ; i++ )
{
if ( ! ( cpu_present_map & (1<<i) ) )
if ( !CPU_PRESENT(i) )
continue;
if ( i )
len += sprintf(len+buffer,"\n");
......@@ -509,9 +469,13 @@ identify_machine(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7))
{
extern void setup_pci_ptrs(void);
#ifdef __SMP__
if ( first_cpu_booted ) return 0;
#endif /* __SMP__ */
#ifndef CONFIG_MBX
#ifndef CONFIG_MACH_SPECIFIC
char *model;
/* boot loader will tell us if we're APUS */
if ( r3 == 0x61707573 )
{
......@@ -524,13 +488,22 @@ identify_machine(unsigned long r3, unsigned long r4, unsigned long r5,
_machine = _MACH_prep;
have_of = 0;
} else {
char *model;
have_of = 1;
/* ask the OF info if we're a chrp or pmac */
model = get_property(find_path_device("/"), "type", NULL);
if ( !strncmp("chrp",model,4) )
model = get_property(find_path_device("/"), "device_type", NULL);
if ( model && !strncmp("chrp",model,4) )
_machine = _MACH_chrp;
else
_machine = _MACH_Pmac;
else
{
model = get_property(find_path_device("/"),
"model", NULL);
if ( model && !strncmp(model, "IBM", 3))
_machine = _MACH_chrp;
else
_machine = _MACH_Pmac;
}
}
#endif /* CONFIG_MACH_SPECIFIC */
......@@ -714,6 +687,12 @@ identify_machine(unsigned long r3, unsigned long r4, unsigned long r5,
strcpy(cmd_line, (char *)(r6+KERNELBASE));
}
#endif /* CONFIG_MBX */
/* Check for nobats option (used in mapin_ram). */
if (strstr(cmd_line, "nobats")) {
extern int __map_without_bats;
__map_without_bats = 1;
}
return 0;
}
......@@ -753,20 +732,6 @@ __initfunc(void setup_arch(char **cmdline_p,
*memory_start_p = find_available_memory();
*memory_end_p = (unsigned long) end_of_DRAM;
#ifdef CONFIG_BLK_DEV_INITRD
/* initrd_start and size are setup by boot/head.S and kernel/head.S */
if ( initrd_start )
{
if (initrd_end > *memory_end_p)
{
printk("initrd extends beyond end of memory "
"(0x%08lx > 0x%08lx)\ndisabling initrd\n",
initrd_end,*memory_end_p);
initrd_start = 0;
}
}
#endif
#ifdef CONFIG_MBX
mbx_setup_arch(memory_start_p,memory_end_p);
#else /* CONFIG_MBX */
......
/*
* linux/arch/ppc/kernel/signal.c
*
* $Id: signal.c,v 1.20 1998/09/28 16:47:09 cort Exp $
* $Id: signal.c,v 1.21 1998/10/22 19:37:49 paulus Exp $
*
* PowerPC version
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
......@@ -245,7 +245,7 @@ int sys_sigreturn(struct pt_regs *regs)
goto badframe;
sr = (struct sigregs *) sigctx.regs;
regs->gpr[3] = ret = sigctx.signal;
regs->gpr[4] = (unsigned long) sr;
regs->gpr[4] = (unsigned long) sc;
regs->link = (unsigned long) &sr->tramp;
regs->nip = sigctx.handler;
......@@ -293,7 +293,7 @@ setup_frame(struct pt_regs *regs, struct sigregs *frame,
|| get_user(regs->gpr[3], &sc->signal))
goto badframe;
regs->gpr[1] = newsp;
regs->gpr[4] = (unsigned long) frame;
regs->gpr[4] = (unsigned long) sc;
regs->link = (unsigned long) frame->tramp;
return;
......
/*
* $Id: smp.c,v 1.33 1998/09/25 04:32:30 cort Exp $
* $Id: smp.c,v 1.36 1998/10/08 01:17:48 cort Exp $
*
* Smp support for ppc.
*
......@@ -35,24 +35,20 @@
int smp_threads_ready = 0;
volatile int smp_commenced = 0;
int smp_num_cpus = 1;
unsigned long cpu_present_map = 0;
volatile int cpu_number_map[NR_CPUS];
volatile unsigned long cpu_callin_map[NR_CPUS] = {0,};
volatile int __cpu_logical_map[NR_CPUS];
static unsigned char boot_cpu_id = 0;
struct cpuinfo_PPC cpu_data[NR_CPUS];
struct klock_info_struct klock_info = { KLOCK_CLEAR, 0 };
volatile unsigned char active_kernel_processor = NO_PROC_ID; /* Processor holding kernel spinlock */
volatile unsigned long ipi_count;
spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED;
unsigned int prof_multiplier[NR_CPUS];
unsigned int prof_counter[NR_CPUS];
int first_cpu_booted = 0;
int start_secondary(void *);
/* all cpu mappings are 1-1 -- Cort */
int cpu_number_map[NR_CPUS] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,};
volatile unsigned long cpu_callin_map[NR_CPUS] = {0,};
int start_secondary(void *);
extern int cpu_idle(void *unused);
void smp_local_timer_interrupt(struct pt_regs * regs)
......@@ -60,7 +56,6 @@ void smp_local_timer_interrupt(struct pt_regs * regs)
int cpu = smp_processor_id();
extern void update_one_process(struct task_struct *,unsigned long,
unsigned long,unsigned long,int);
if (!--prof_counter[cpu]) {
int user=0,system=0;
struct task_struct * p = current;
......@@ -106,7 +101,7 @@ void smp_local_timer_interrupt(struct pt_regs * regs)
* Right now it only works for stop cpu's but will be setup
* later for more general message passing.
*
* As it is now, if we're sending two message as the same time
* As it is now, if we're sending two message at the same time
* we have race conditions. I avoided doing locks here since
* all that works right now is the stop cpu message.
*
......@@ -117,17 +112,25 @@ void smp_message_recv(void)
{
int msg = smp_message[smp_processor_id()];
printk("SMP %d: smp_message_recv() msg %x\n", smp_processor_id(),msg);
/* clear interrupt */
*(volatile unsigned long *)(0xf80000c0) = ~0L;
eieio();
/* make sure msg is for us */
if ( msg == -1 ) return;
ipi_count++;
/*printk("SMP %d: smp_message_recv() msg %x\n", smp_processor_id(),msg);*/
switch( msg )
{
case MSG_STOP_CPU:
__cli();
while (1) ;
break;
case MSG_RESCHEDULE:
current->need_resched = 1;
break;
case 0xf0f0: /* syncing time bases - just return */
break;
default:
......@@ -141,19 +144,17 @@ void smp_message_recv(void)
void smp_send_reschedule(int cpu)
{
/* for now, nothing */
smp_message_pass(cpu, MSG_RESCHEDULE, 0, 0);
}
spinlock_t mesg_pass_lock = SPIN_LOCK_UNLOCKED;
void smp_message_pass(int target, int msg, unsigned long data, int wait)
{
printk("SMP %d: sending smp message\n", current->processor);
spin_lock(&mesg_pass_lock);
if ( _machine != _MACH_Pmac )
return;
/*printk("SMP %d: sending smp message\n", current->processor);*/
if (smp_processor_id() ) printk("pass from cpu 1\n");
spin_lock(&mesg_pass_lock);
#define OTHER (~smp_processor_id() & 1)
switch( target )
......@@ -169,9 +170,10 @@ void smp_message_pass(int target, int msg, unsigned long data, int wait)
break;
}
/* interrupt secondary processor */
/**(volatile unsigned long *)(0xf80000c0) = 0xffffffff;
eieio();*/
*(volatile unsigned long *)(0xf80000c0) = 0;
*(volatile unsigned long *)(0xf80000c0) = ~0L;
eieio();
*(volatile unsigned long *)(0xf80000c0) = 0L;
eieio();
/* interrupt primary */
/**(volatile unsigned long *)(0xf3019000);*/
spin_unlock(&mesg_pass_lock);
......@@ -180,6 +182,7 @@ void smp_message_pass(int target, int msg, unsigned long data, int wait)
__initfunc(void smp_boot_cpus(void))
{
extern struct task_struct *current_set[NR_CPUS];
extern void __secondary_start(void);
int i;
struct task_struct *p;
......@@ -189,21 +192,14 @@ __initfunc(void smp_boot_cpus(void))
dcbf(&first_cpu_booted);
for (i = 0; i < NR_CPUS; i++) {
cpu_number_map[i] = -1;
prof_counter[i] = 1;
prof_multiplier[i] = 1;
}
cpu_present_map = 0;
for(i=0; i < NR_CPUS; i++)
__cpu_logical_map[i] = -1;
smp_store_cpu_info(boot_cpu_id);
active_kernel_processor = boot_cpu_id;
current->processor = boot_cpu_id;
cpu_present_map |= 1;
cpu_number_map[boot_cpu_id] = 0;
__cpu_logical_map[0] = boot_cpu_id;
cpu_callin_map[0] = 1;
smp_store_cpu_info(0);
active_kernel_processor = 0;
current->processor = 0;
if ( _machine != _MACH_Pmac )
{
......@@ -211,10 +207,6 @@ __initfunc(void smp_boot_cpus(void))
return;
}
/* assume a 2nd processor for now */
cpu_present_map |= (1 << 1);
smp_num_cpus = 2;
/* create a process for second processor */
kernel_thread(start_secondary, NULL, CLONE_PID);
p = task[1];
......@@ -222,15 +214,16 @@ __initfunc(void smp_boot_cpus(void))
panic("No idle task for secondary processor\n");
p->processor = 1;
current_set[1] = p;
/* need to flush here since secondary bat's aren't setup */
dcbf((void *)&current_set[1]);
/* setup entry point of secondary processor */
/* *(volatile unsigned long *)(0xf2800000)
= (unsigned long)secondary_entry-KERNELBASE;*/
*(volatile unsigned long *)(0xf2800000) = 0x100;
*(volatile unsigned long *)(0xf2800000) =
(unsigned long)__secondary_start-KERNELBASE;
eieio();
/* interrupt secondary to begin executing code */
*(volatile unsigned long *)(0xf80000c0) = ~0L;
eieio();
*(volatile unsigned long *)(0xf80000c0) = 0L;
eieio();
/*
......@@ -241,24 +234,21 @@ __initfunc(void smp_boot_cpus(void))
*/
for ( i = 1000; i && !cpu_callin_map[1] ; i-- )
udelay(100);
if(cpu_callin_map[1]) {
cpu_number_map[1] = 1;
__cpu_logical_map[i] = 1;
printk("Processor 1 found.\n");
printk("Processor %d found.\n", smp_num_cpus);
smp_num_cpus++;
#if 0 /* this sync's the decr's, but we don't want this now -- Cort */
set_dec(decrementer_count);
#endif
/* interrupt secondary to start decr's on both cpus */
smp_message_pass(1,0xf0f0, 0, 0);
/* interrupt secondary to begin executing code */
/**(volatile unsigned long *)(0xf80000c0) = 0L;
eieio();*/
} else {
smp_num_cpus--;
printk("Processor %d is stuck.\n", 1);
printk("Processor %d is stuck. \n", smp_num_cpus);
}
/* reset the entry point so if we get another intr we won't
* try to startup again */
*(volatile unsigned long *)(0xf2800000) = 0x100;
/* send interrupt to other processors to start decr's on all cpus */
smp_message_pass(1,0xf0f0, 0, 0);
}
__initfunc(void smp_commence(void))
......@@ -278,7 +268,7 @@ __initfunc(void initialize_secondary(void))
}
/* Activate a secondary processor. */
__initfunc(int start_secondary(void *unused))
asmlinkage int __init start_secondary(void *unused)
{
printk("SMP %d: start_secondary()\n",current->processor);
smp_callin();
......@@ -288,16 +278,14 @@ __initfunc(int start_secondary(void *unused))
__initfunc(void smp_callin(void))
{
printk("SMP %d: smp_callin()\n",current->processor);
smp_store_cpu_info(1);
smp_store_cpu_info(current->processor);
set_dec(decrementer_count);
current->mm->mmap->vm_page_prot = PAGE_SHARED;
current->mm->mmap->vm_start = PAGE_OFFSET;
current->mm->mmap->vm_end = init_task.mm->mmap->vm_end;
/* assume we're just the secondary processor for now */
cpu_callin_map[1] = 1;
cpu_callin_map[current->processor] = current->processor;
while(!smp_commenced)
barrier();
__sti();
......@@ -317,6 +305,7 @@ __initfunc(void smp_store_cpu_info(int id))
{
struct cpuinfo_PPC *c = &cpu_data[id];
/* assume bogomips are same for everything */
c->loops_per_sec = loops_per_sec;
c->pvr = _get_PVR();
}
/*
* $Id: time.c,v 1.35 1998/07/24 11:05:47 geert Exp $
* $Id: time.c,v 1.36 1998/10/10 12:16:08 geert Exp $
* Common time routines among all ppc machines.
*
* Written by Cort Dougan (cort@cs.nmt.edu) to merge
......@@ -106,7 +106,12 @@ void timer_interrupt(struct pt_regs * regs)
#ifdef __SMP__
smp_local_timer_interrupt(regs);
#endif
#ifdef CONFIG_APUS
{
extern void apus_heartbeat (void);
apus_heartbeat ();
}
#endif
hardirq_exit(cpu);
/* restore the HID0 in case dcache was off - see idle.c
* this hack should leave for a better solution -- Cort */
......
/*
* $Id: locks.c,v 1.18 1998/07/28 03:50:27 cort Exp $
* $Id: locks.c,v 1.20 1998/10/08 01:17:32 cort Exp $
*
* Locks for smp ppc
*
......@@ -18,13 +18,13 @@
#define DEBUG_LOCKS 1
#undef INIT_STUCK
#define INIT_STUCK 10000
#define INIT_STUCK 0xffffffff
void _spin_lock(spinlock_t *lock)
{
int cpu = smp_processor_id();
#ifdef DEBUG_LOCKS
int stuck = INIT_STUCK;
unsigned int stuck = INIT_STUCK;
#endif /* DEBUG_LOCKS */
/* try expensive atomic load/store to get lock */
while((unsigned long )xchg_u32((void *)&lock->lock,0xffffffff)) {
......@@ -67,13 +67,13 @@ int spin_trylock(spinlock_t *lock)
void _spin_unlock(spinlock_t *lp)
{
#ifdef DEBUG_LOCKS
if ( !lp->lock )
panic("_spin_unlock(%p): no lock cpu %d %s/%d\n", lp,
smp_processor_id(),current->comm,current->pid);
if ( !lp->lock )
printk("_spin_unlock(%p): no lock cpu %d %s/%d\n", lp,
smp_processor_id(),current->comm,current->pid);
if ( lp->owner_cpu != smp_processor_id() )
panic("_spin_unlock(%p): cpu %d trying clear of cpu %d pc %lx val %lx\n",
lp, smp_processor_id(), (int)lp->owner_cpu,
lp->owner_pc,lp->lock);
printk("_spin_unlock(%p): cpu %d trying clear of cpu %d pc %lx val %lx\n",
lp, smp_processor_id(), (int)lp->owner_cpu,
lp->owner_pc,lp->lock);
#endif /* DEBUG_LOCKS */
lp->owner_pc = lp->owner_cpu = 0;
eieio();
......
......@@ -38,7 +38,7 @@
extern void (*debugger)(struct pt_regs *);
extern void (*debugger_fault_handler)(struct pt_regs *);
extern int (*debugger_dabr_match)(struct pt_regs *);
int debugger_kernel_faults = 0;
int debugger_kernel_faults = 1;
#endif
unsigned long htab_reloads = 0; /* updated by head.S:hash_page() */
......
/*
* $Id: init.c,v 1.123 1998/09/19 19:03:55 geert Exp $
* $Id: init.c,v 1.130 1998/11/10 10:09:20 paulus Exp $
*
* PowerPC version
* Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
......@@ -114,7 +114,8 @@ struct batrange { /* stores address ranges mapped by BATs */
* (i.e. page tables) instead of the bats.
* -- Cort
*/
#undef MAP_RAM_WITH_SEGREGS 1
int __map_without_bats = 0;
/* optimization for 603 to load the tlb directly from the linux table -- Cort */
#define NO_RELOAD_HTAB 1 /* change in kernel/head.S too! */
......@@ -243,20 +244,24 @@ void show_mem(void)
printk("%3d ", p->processor);
if ( (p->processor != NO_PROC_ID) &&
(p == current_set[p->processor]) )
{
iscur = 1;
printk("current");
}
#else
if ( p == current )
#endif /* __SMP__ */
{
iscur = 1;
printk("current");
}
if ( p == last_task_used_math )
{
if ( iscur )
printk(",");
printk("last math");
}
#endif /* __SMP__ */
printk("\n");
}
}
......@@ -677,18 +682,21 @@ __initfunc(static void sort_mem_pieces(struct mem_pieces *mp))
__initfunc(static void coalesce_mem_pieces(struct mem_pieces *mp))
{
unsigned long a, e;
unsigned long a, s, ns;
int i, j, d;
d = 0;
for (i = 0; i < mp->n_regions; i = j) {
a = mp->regions[i].address;
e = a + mp->regions[i].size;
s = mp->regions[i].size;
for (j = i + 1; j < mp->n_regions
&& mp->regions[j].address <= e; ++j)
e = mp->regions[j].address + mp->regions[j].size;
&& mp->regions[j].address - a <= s; ++j) {
ns = mp->regions[j].address + mp->regions[j].size - a;
if (ns > s)
s = ns;
}
mp->regions[d].address = a;
mp->regions[d].size = e - a;
mp->regions[d].size = s;
++d;
}
mp->n_regions = d;
......@@ -800,28 +808,41 @@ __initfunc(static void mapin_ram(void))
int i;
unsigned long v, p, s, f;
#ifndef CONFIG_8xx
unsigned long tot, mem_base, bl, done;
#ifndef MAP_RAM_WITH_SEGREGS
/* Set up BAT2 and if necessary BAT3 to cover RAM. */
mem_base = __pa(KERNELBASE);
tot = (unsigned long)end_of_DRAM - KERNELBASE;
for (bl = 128<<10; bl < 256<<20; bl <<= 1) {
if (bl * 2 > tot)
break;
}
setbat(2, KERNELBASE, mem_base, bl, RAM_PAGE);
done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
if (done < tot) {
/* use BAT3 to cover a bit more */
tot -= done;
for (bl = 128<<10; bl < 256<<20; bl <<= 1)
if (!__map_without_bats) {
unsigned long tot, mem_base, bl, done;
unsigned long max_size = (256<<20);
unsigned long align;
/* Set up BAT2 and if necessary BAT3 to cover RAM. */
mem_base = __pa(KERNELBASE);
/* Make sure we don't map a block larger than the
smallest alignment of the physical address. */
/* alignment of mem_base */
align = ~(mem_base-1) & mem_base;
/* set BAT block size to MIN(max_size, align) */
if (align && align < max_size)
max_size = align;
tot = (unsigned long)end_of_DRAM - KERNELBASE;
for (bl = 128<<10; bl < max_size; bl <<= 1) {
if (bl * 2 > tot)
break;
setbat(3, KERNELBASE+done, mem_base+done, bl, RAM_PAGE);
}
setbat(2, KERNELBASE, mem_base, bl, RAM_PAGE);
done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
if (done < tot) {
/* use BAT3 to cover a bit more */
tot -= done;
for (bl = 128<<10; bl < max_size; bl <<= 1)
if (bl * 2 > tot)
break;
setbat(3, KERNELBASE+done, mem_base+done, bl,
RAM_PAGE);
}
}
#endif
v = KERNELBASE;
for (i = 0; i < phys_mem.n_regions; ++i) {
......@@ -897,7 +918,10 @@ __initfunc(void free_initmem(void))
switch (_machine)
{
case _MACH_Pmac:
FREESEC(__prep_begin,__prep_end,num_prep_pages);
break;
case _MACH_chrp:
FREESEC(__pmac_begin,__pmac_end,num_pmac_pages);
FREESEC(__prep_begin,__prep_end,num_prep_pages);
break;
case _MACH_prep:
......@@ -965,8 +989,14 @@ __initfunc(void MMU_init(void))
setbat(0, 0xf8000000, 0xf8000000, 0x08000000, IO_PAGE);
break;
case _MACH_Pmac:
setbat(0, 0xf3000000, 0xf3000000, 0x100000, IO_PAGE);
ioremap_base = 0xf0000000;
{
unsigned long base = 0xf3000000;
struct device_node *macio = find_devices("mac-io");
if (macio && macio->n_addrs)
base = macio->addrs[0].address;
setbat(0, base, base, 0x100000, IO_PAGE);
ioremap_base = 0xf0000000;
}
break;
case _MACH_apus:
/* Map PPC exception vectors. */
......
......@@ -35,16 +35,20 @@ CONFIG_KERNEL_ELF=y
CONFIG_BINFMT_MISC=m
# CONFIG_BINFMT_JAVA is not set
# CONFIG_PARPORT is not set
# CONFIG_VGA_CONSOLE is not set
CONFIG_FB=y
CONFIG_FB_COMPAT_XPMAC=y
CONFIG_PMAC_PBOOK=y
CONFIG_MAC_KEYBOARD=y
CONFIG_MAC_FLOPPY=y
CONFIG_MAC_SERIAL=y
CONFIG_MACMOUSE=y
CONFIG_ADBMOUSE=y
CONFIG_BLK_DEV_IDE_PMAC=y
CONFIG_PROC_DEVICETREE=y
# CONFIG_KGDB is not set
CONFIG_XMON=y
# CONFIG_XMON is not set
# CONFIG_TOTALMP is not set
CONFIG_BOOTX_TEXT=y
#
# Plug and Play support
......@@ -70,6 +74,10 @@ CONFIG_BLK_DEV_IDEFLOPPY=y
# CONFIG_BLK_DEV_RZ1000 is not set
# CONFIG_BLK_DEV_IDEPCI is not set
# CONFIG_BLK_DEV_SL82C105 is not set
CONFIG_BLK_DEV_IDE_PMAC=y
CONFIG_BLK_DEV_IDEDMA_PMAC=y
CONFIG_BLK_DEV_IDEDMA=y
CONFIG_PMAC_IDEDMA_AUTO=y
# CONFIG_IDE_CHIPSETS is not set
#
......@@ -159,7 +167,7 @@ CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_AHA152X is not set
# CONFIG_SCSI_AHA1542 is not set
# CONFIG_SCSI_AHA1740 is not set
CONFIG_SCSI_AIC7XXX=m
CONFIG_SCSI_AIC7XXX=y
# CONFIG_OVERRIDE_CMDS is not set
CONFIG_AIC7XXX_PROC_STATS=y
CONFIG_AIC7XXX_RESET_DELAY=15
......@@ -216,23 +224,26 @@ CONFIG_NET_EISA=y
# CONFIG_AC3200 is not set
# CONFIG_APRICOT is not set
# CONFIG_CS89x0 is not set
CONFIG_DE4X5=m
CONFIG_DE4X5=y
CONFIG_DEC_ELCP=m
# CONFIG_DGRS is not set
# CONFIG_EEXPRESS_PRO100 is not set
# CONFIG_LNE390 is not set
# CONFIG_NE3210 is not set
# CONFIG_NE2K_PCI is not set
# CONFIG_TLAN is not set
# CONFIG_VIA_RHINE is not set
# CONFIG_ES3210 is not set
# CONFIG_EPIC100 is not set
# CONFIG_ZNET is not set
# CONFIG_NET_POCKET is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_DLCI is not set
# CONFIG_LTPC is not set
# CONFIG_COPS is not set
# CONFIG_IPDDP is not set
CONFIG_PPP=m
CONFIG_PPP=y
#
# CCP compressors for PPP are only built as modules.
......@@ -241,6 +252,7 @@ CONFIG_PPP=m
# CONFIG_NET_RADIO is not set
# CONFIG_TR is not set
# CONFIG_SHAPER is not set
# CONFIG_HOSTESS_SV11 is not set
#
# Amateur Radio support
......@@ -264,11 +276,12 @@ CONFIG_DUMMY_CONSOLE=y
CONFIG_FB_OF=y
CONFIG_FB_CONTROL=y
CONFIG_FB_PLATINUM=y
CONFIG_FB_VALKYRIE=y
CONFIG_FB_ATY=y
CONFIG_FB_IMSTT=y
CONFIG_FB_CT65550=y
# CONFIG_FB_S3TRIO is not set
# CONFIG_FB_VGA is not set
# CONFIG_FB_MATROX is not set
# CONFIG_FB_VIRTUAL is not set
# CONFIG_FBCON_ADVANCED is not set
CONFIG_FBCON_CFB8=y
......@@ -293,8 +306,9 @@ CONFIG_VT_CONSOLE=y
CONFIG_SERIAL=m
# CONFIG_SERIAL_EXTENDED is not set
# CONFIG_SERIAL_NONSTANDARD is not set
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256
# CONFIG_MOUSE is not set
# CONFIG_UMISC is not set
# CONFIG_QIC02_TAPE is not set
# CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set
......@@ -322,6 +336,7 @@ CONFIG_VFAT_FS=m
CONFIG_PROC_FS=y
CONFIG_NFS_FS=y
CONFIG_NFSD=y
# CONFIG_NFSD_SUN is not set
CONFIG_SUNRPC=y
CONFIG_LOCKD=y
# CONFIG_CODA_FS is not set
......@@ -330,12 +345,16 @@ CONFIG_LOCKD=y
# CONFIG_NTFS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_AFFS_FS is not set
CONFIG_HFS_FS=m
CONFIG_HFS_FS=y
# CONFIG_ROMFS_FS is not set
CONFIG_AUTOFS_FS=y
# CONFIG_UFS_FS is not set
# CONFIG_ADFS_FS is not set
# CONFIG_BSD_DISKLABEL is not set
# CONFIG_SMD_DISKLABEL is not set
# CONFIG_SOLARIS_X86_PARTITION is not set
CONFIG_DEVPTS_FS=y
# CONFIG_ADFS_FS is not set
# CONFIG_QNX4FS_FS is not set
CONFIG_MAC_PARTITION=y
CONFIG_NLS=y
......@@ -374,3 +393,9 @@ CONFIG_NLS_CODEPAGE_437=y
#
CONFIG_SOUND=y
CONFIG_DMASOUND=y
# CONFIG_SOUND_ES1370 is not set
# CONFIG_SOUND_ES1371 is not set
# CONFIG_SOUND_SONICVIBES is not set
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
# CONFIG_SOUND_OSS is not set
......@@ -41,7 +41,7 @@ CONFIG_VGA_CONSOLE=y
# CONFIG_MAC_KEYBOARD is not set
# CONFIG_MAC_FLOPPY is not set
# CONFIG_MAC_SERIAL is not set
# CONFIG_MACMOUSE is not set
# CONFIG_ADBMOUSE is not set
# CONFIG_PROC_DEVICETREE is not set
# CONFIG_KGDB is not set
# CONFIG_XMON is not set
......
......@@ -114,7 +114,7 @@
#define FD_HD_3 0x55555555 /* high-density 3.5" (1760K) drive */
#define FD_DD_5 0xaaaaaaaa /* double-density 5.25" (440K) drive */
static long int fd_def_df0 = 0; /* default for df0 if it doesn't identify */
static long int fd_def_df0 = FD_DD_3; /* default for df0 if it doesn't identify */
MODULE_PARM(fd_def_df0,"l");
......@@ -1859,20 +1859,6 @@ __initfunc(int amiga_floppy_init(void))
blksize_size[MAJOR_NR] = floppy_blocksizes;
blk_size[MAJOR_NR] = floppy_sizes;
#if 0 /* Doesn't seem to be correct */
if (fd_def_df0==0) {
if ((amiga.model == AMI_3000) || (amiga.model == AMI_3000T) ||
(amiga.model == AMI_3000PLUS) || (amiga.model == AMI_4000))
fd_def_df0=FD_HD_3;
else
fd_def_df0=FD_DD_3;
}
#else
/* Now we hope that every HD drive will identify itself correctly */
fd_def_df0 = FD_DD_3;
#endif
for (i = 0; i < 128; i++)
mfmdecode[i]=255;
for (i = 0; i < 16; i++)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -477,7 +477,7 @@ EXPORT_SYMBOL(lp_interrupt);
EXPORT_SYMBOL(register_parallel);
EXPORT_SYMBOL(unregister_parallel);
__initfunc(int lp_init(void))
__initfunc(int lp_m68k_init(void))
{
extern char m68k_debug_device[];
......@@ -517,12 +517,12 @@ __initfunc(void lp_setup(char *str, int *ints))
#ifdef MODULE
int init_module(void)
{
return lp_init();
return lp_m68k_init();
}
void cleanup_module(void)
{
unregister_chrdev(LP_MAJOR, "lp");
unregister_chrdev(LP_MAJOR, "lp");
}
#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.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -14,6 +14,7 @@
* a subset of the standard printer control lines connected.
*/
#include <linux/config.h>
#include <linux/tasks.h>
#include <linux/delay.h>
#include <linux/errno.h>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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