Commit 1f068b65 authored by Paul Mackerras's avatar Paul Mackerras

Merge bk://stop.crashing.org/linux-2.6-misc

into samba.org:/stuff/paulus/kernel/for-linus-ppc
parents 024b1e31 8e1c75c9
......@@ -2278,7 +2278,7 @@ static void my_console_write(int idx, const char *s,
static void serial_console_write(struct console *c, const char *s,
unsigned count)
{
#if defined(CONFIG_KGDB) && !defined(CONFIG_USE_SERIAL2_KGDB)
#if defined(CONFIG_KGDB_CONSOLE) && !defined(CONFIG_USE_SERIAL2_KGDB)
/* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(s, count))
return;
......
......@@ -1068,7 +1068,7 @@ static int rs_8xx_write(struct tty_struct * tty, int from_user,
volatile cbd_t *bdp;
unsigned char *cp;
#ifdef CONFIG_KGDB
#ifdef CONFIG_KGDB_CONSOLE
/* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(buf, count))
return ret;
......@@ -2271,7 +2271,7 @@ static void my_console_write(int idx, const char *s,
static void serial_console_write(struct console *c, const char *s,
unsigned count)
{
#ifdef CONFIG_KGDB
#ifdef CONFIG_KGDB_CONSOLE
/* Try to let stub handle output. Returns true if it did. */
if (kgdb_output_string(s, count))
return;
......
......@@ -1426,20 +1426,12 @@ config DEBUG_SPINLOCK_SLEEP
config KGDB
bool "Include kgdb kernel debugger"
depends on DEBUG_KERNEL
select DEBUG_INFO
help
Include in-kernel hooks for kgdb, the Linux kernel source level
debugger. See <http://kgdb.sourceforge.net/> for more information.
Unless you are intending to debug the kernel, say N here.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
choice
prompt "Serial Port"
depends on KGDB
......@@ -1459,6 +1451,14 @@ config KGDB_TTYS3
endchoice
config KGDB_CONSOLE
bool "Enable serial console thru kgdb port"
depends on KGDB && 8xx || 8260
help
If you enable this, all serial console messages will be sent
over the gdb stub.
If unsure, say N.
config XMON
bool "Include xmon kernel debugger"
depends on DEBUG_KERNEL
......@@ -1474,18 +1474,16 @@ config BDI_SWITCH
Unless you are intending to debug the kernel with one of these
machines, say N here.
config MORE_COMPILE_OPTIONS
bool "Add any additional compile options"
depends on DEBUG_KERNEL && (KGDB || XMON || BDI_SWITCH)
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
default y if BDI_SWITCH || XMON
help
If you want to add additional CFLAGS to the kernel build, such as -g
for KGDB or the BDI2000, enable this option and then enter what you
would like to add in the next question.
config COMPILE_OPTIONS
string "Additional compile arguments"
depends on MORE_COMPILE_OPTIONS
default "-g -ggdb"
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use some sort of debugger to
debug the kernel.
If you don't debug the kernel, you can say N.
config BOOTX_TEXT
bool "Support for early boot text console (BootX or OpenFirmware only)"
......
......@@ -22,9 +22,6 @@ CPP = $(CC) -E $(CFLAGS)
cflags-$(CONFIG_4xx) += -Wa,-m405
cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
# Use sed to remove the quotes.
cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \
$(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
CFLAGS += $(cflags-y)
......
......@@ -60,7 +60,7 @@ unsigned long serial_init(int chan, void *ignored)
else {
/* Input clock. */
outb(com_port + (UART_DLL << shift),
(BASE_BAUD / SERIAL_BAUD));
(BASE_BAUD / SERIAL_BAUD) & 0xFF);
outb(com_port + (UART_DLM << shift),
(BASE_BAUD / SERIAL_BAUD) >> 8);
/* 8 data, 1 stop, no parity */
......
......@@ -160,9 +160,22 @@ _setup_L3CR:
blr
/* udelay (on non-601 processors) needs to know the period of the
* timebase in nanoseconds. This used to be hardcoded to be 60ns
* (period of 66MHz/4). Now a variable is used that is initialized to
* 60 for backward compatibility, but it can be overridden as necessary
* with code something like this:
* extern unsigned long timebase_period_ns;
* timebase_period_ns = 1000000000 / bd->bi_tbfreq;
*/
.data
.globl timebase_period_ns
timebase_period_ns:
.long 60
.text
/*
* Delay for a number of microseconds
* -- Use the BUS timer (assumes 66MHz)
*/
.globl udelay
udelay:
......@@ -180,8 +193,13 @@ udelay:
.udelay_not_601:
mulli r4,r3,1000 /* nanoseconds */
addi r4,r4,59
li r5,60
/* Change r4 to be the number of ticks using:
* (nanoseconds + (timebase_period_ns - 1 )) / timebase_period_ns
* timebase_period_ns defaults to 60 (16.6MHz) */
lis r5,timebase_period_ns@h
lwz r5,timebase_period_ns@l(r5)
addi r4,r4,r5
addi r4,r4,-1
divw r4,r4,r5 /* BUS ticks */
1: mftbu r5
mftb r6
......
......@@ -20,6 +20,7 @@
#ifdef CONFIG_40x
#include <asm/io.h>
#endif
extern unsigned long timebase_period_ns;
/* For those boards that don't provide one.
*/
......@@ -768,6 +769,7 @@ embed_config(bd_t **bdp)
#if defined(CONFIG_REDWOOD_5) || defined (CONFIG_REDWOOD_6)
bd->bi_tbfreq = 27 * 1000 * 1000;
#endif
timebase_period_ns = 1000000000 / bd->bi_tbfreq;
}
#endif /* CONFIG_BEECH */
#endif /* CONFIG_IBM_OPENBIOS */
......
......@@ -75,7 +75,7 @@ extern void gunzip(void *, int, unsigned char *, int *);
extern void embed_config(bd_t **bp);
unsigned long
decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp)
load_kernel(unsigned long load_addr, int num_words, unsigned long cksum, bd_t *bp)
{
char *cp, ch;
int timer = 0, zimage_size;
......
......@@ -147,7 +147,7 @@ unsigned long isa_io_base = SPRUCE_ISA_IO_BASE;
#define MEM_B2EA 0x60
unsigned long
decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
load_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
{
int timer = 0;
char *cp, ch;
......
......@@ -252,3 +252,10 @@ decompress_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
return (struct bi_record *)rec_loc;
}
/* Allow decompress_kernel to be hooked into. This is the default. */
void * __attribute__ ((weak))
load_kernel(unsigned long load_addr, int num_words, unsigned long cksum)
{
return decompress_kernel(load_addr, num_words, cksum);
}
......@@ -183,7 +183,7 @@ start_ldr:
mr r4,r7 /* Program length */
mr r5,r6 /* Checksum */
mr r6,r11 /* Residual data */
bl decompress_kernel
bl load_kernel
/*
* Make sure the kernel knows we don't have things set in
......
......@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
}
cksum = 0;
cp = (uint *)&bt;
cp = (void *)&bt;
for (i=0; i<sizeof(bt)/sizeof(uint); i++)
cksum += *cp++;
......
......@@ -19,6 +19,7 @@ CONFIG_SYSVIPC=y
CONFIG_SYSCTL=y
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_EMBEDDED is not set
CONFIG_KALLSYMS=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
......@@ -74,8 +75,8 @@ CONFIG_HIGHMEM=y
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
CONFIG_KERNEL_ELF=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_PCI_LEGACY_PROC is not set
# CONFIG_PCI_NAMES is not set
......@@ -103,6 +104,11 @@ CONFIG_KERNEL_START=0xc0000000
CONFIG_TASK_SIZE=0x80000000
CONFIG_BOOT_LOAD=0x00800000
#
# Generic Driver Options
#
# CONFIG_FW_LOADER is not set
#
# Memory Technology Devices (MTD)
#
......@@ -122,10 +128,12 @@ CONFIG_BOOT_LOAD=0x00800000
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_INITRD=y
# CONFIG_LBD is not set
#
# Multi-device support (RAID and LVM)
......@@ -133,12 +141,12 @@ CONFIG_BLK_DEV_INITRD=y
# CONFIG_MD is not set
#
# ATA/IDE/MFM/RLL support
# ATA/ATAPI/MFM/RLL support
#
# CONFIG_IDE is not set
#
# SCSI support
# SCSI device support
#
# CONFIG_SCSI is not set
......@@ -319,11 +327,6 @@ CONFIG_NET_PCI=y
#
# CONFIG_FB is not set
#
# Old CD-ROM drivers (not SCSI, not IDE)
#
# CONFIG_CD_NO_IDESCSI is not set
#
# Input device support
#
......@@ -526,7 +529,6 @@ CONFIG_MSDOS_PARTITION=y
# Kernel hacking
#
# CONFIG_DEBUG_KERNEL is not set
# CONFIG_KALLSYMS is not set
# CONFIG_SERIAL_TEXT_DEBUG is not set
#
......
......@@ -106,6 +106,7 @@
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <asm/cacheflush.h>
#include <asm/system.h>
#include <asm/signal.h>
#include <asm/kgdb.h>
......@@ -186,7 +187,7 @@ hex(unsigned char ch)
* return 0.
*/
static unsigned char *
mem2hex(char *mem, char *buf, int count)
mem2hex(const char *mem, char *buf, int count)
{
unsigned char ch;
unsigned short tmp_s;
......@@ -828,11 +829,11 @@ breakpoint(void)
return;
}
asm(" .globl breakinst
breakinst: .long 0x7d821008
");
asm(" .globl breakinst \n\
breakinst: .long 0x7d821008");
}
#ifdef CONFIG_KGDB_CONSOLE
/* Output string in GDB O-packet format if GDB has connected. If nothing
output, returns 0 (caller must then handle output). */
int
......@@ -852,3 +853,4 @@ kgdb_output_string (const char* s, unsigned int count)
return 1;
}
#endif
......@@ -200,6 +200,7 @@ EXPORT_SYMBOL(flush_dcache_range);
EXPORT_SYMBOL(flush_icache_user_range);
EXPORT_SYMBOL(flush_dcache_page);
EXPORT_SYMBOL(flush_tlb_kernel_range);
EXPORT_SYMBOL(flush_tlb_page);
#ifdef CONFIG_ALTIVEC
EXPORT_SYMBOL(last_task_used_altivec);
EXPORT_SYMBOL(giveup_altivec);
......
......@@ -31,6 +31,7 @@
/* Rate for the 1.8432 Mhz clock for the onboard serial chip */
#define BASE_BAUD ( 1843200 / 16 )
#define UART_CLK 1843200
#ifdef CONFIG_SERIAL_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
......
......@@ -31,6 +31,9 @@
#include <linux/ide.h>
#include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <linux/serial.h>
#include <linux/tty.h> /* for linux/serial_core.h */
#include <linux/serial_core.h>
#include <asm/system.h>
#include <asm/pgtable.h>
......@@ -49,36 +52,94 @@
#include <asm/pplus.h>
#include "mcpn765.h"
#include "mcpn765_serial.h"
static u_char mcpn765_openpic_initsenses[] __initdata = {
0, /* 16: i8259 cascade (active high) */
1, /* 17: COM1,2,3,4 */
1, /* 18: Enet 1 (front panel) */
1, /* 19: HAWK WDT XXXX */
1, /* 20: 21554 PCI-PCI bridge */
1, /* 21: cPCI INTA# */
1, /* 22: cPCI INTB# */
1, /* 23: cPCI INTC# */
1, /* 24: cPCI INTD# */
1, /* 25: PMC1 INTA#, PMC2 INTB# */
1, /* 26: PMC1 INTB#, PMC2 INTC# */
1, /* 27: PMC1 INTC#, PMC2 INTD# */
1, /* 28: PMC1 INTD#, PMC2 INTA# */
1, /* 29: Enet 2 (connected to J3) */
1, /* 30: Abort Switch */
1, /* 31: RTC Alarm */
(IRQ_SENSE_EDGE | IRQ_POLARITY_POSITIVE),/* 16: i8259 cascade */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 17: COM1,2,3,4 */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 18: Enet 1 (front) */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 19: HAWK WDT XXXX */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 20: 21554 bridge */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 21: cPCI INTA# */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 22: cPCI INTB# */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 23: cPCI INTC# */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 24: cPCI INTD# */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 25: PMC1 INTA#,PMC2 INTB#*/
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 26: PMC1 INTB#,PMC2 INTC#*/
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 27: PMC1 INTC#,PMC2 INTD#*/
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 28: PMC1 INTD#,PMC2 INTA#*/
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 29: Enet 2 (J3) */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 30: Abort Switch */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),/* 31: RTC Alarm */
};
extern u_int openpic_irq(void);
extern char cmd_line[];
extern void gen550_progress(char *, unsigned short);
extern void gen550_init(int, struct uart_port *);
int use_of_interrupt_tree = 0;
static void mcpn765_halt(void);
TODC_ALLOC();
#if defined(CONFIG_SERIAL_8250) && \
(defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG))
static void __init
mcpn765_early_serial_map(void)
{
struct uart_port serial_req;
/* Setup serial port access */
memset(&serial_req, 0, sizeof(serial_req));
serial_req.uartclk = UART_CLK;
serial_req.irq = 17;
serial_req.flags = STD_COM_FLAGS;
serial_req.iotype = SERIAL_IO_MEM;
serial_req.membase = (u_char *)MCPN765_SERIAL_1;
serial_req.regshift = 4;
gen550_init(0, &serial_req);
if (early_serial_setup(&serial_req) != 0)
printk(KERN_ERR "Early serial init of port 0 failed\n");
/* Assume early_serial_setup() doesn't modify serial_req */
serial_req.line = 1;
serial_req.irq = 17;
serial_req.membase = (u_char *)MCPN765_SERIAL_2;
gen550_init(1, &serial_req);
if (early_serial_setup(&serial_req) != 0)
printk(KERN_ERR "Early serial init of port 1 failed\n");
/* Assume early_serial_setup() doesn't modify serial_req */
serial_req.line = 2;
serial_req.irq = 17;
serial_req.membase = (u_char *)MCPN765_SERIAL_3;
gen550_init(2, &serial_req);
if (early_serial_setup(&serial_req) != 0)
printk(KERN_ERR "Early serial init of port 2 failed\n");
/* Assume early_serial_setup() doesn't modify serial_req */
serial_req.line = 3;
serial_req.irq = 17;
serial_req.membase = (u_char *)MCPN765_SERIAL_4;
gen550_init(3, &serial_req);
if (early_serial_setup(&serial_req) != 0)
printk(KERN_ERR "Early serial init of port 3 failed\n");
}
#endif
static void __init
mcpn765_setup_arch(void)
{
......@@ -187,12 +248,12 @@ mcpn765_init_IRQ(void)
if ( ppc_md.progress )
ppc_md.progress("init_irq: enter", 0);
openpic_init(1, NUM_8259_INTERRUPTS, NULL, -1);
openpic_init(NUM_8259_INTERRUPTS);
for(i=0; i < NUM_8259_INTERRUPTS; i++)
irq_desc[i].handler = &i8259_pic;
i8259_init(NULL);
i8259_init(0);
if ( ppc_md.progress )
ppc_md.progress("init_irq: exit", 0);
......@@ -361,62 +422,12 @@ mcpn765_ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port,
static __inline__ void
mcpn765_set_bat(void)
{
unsigned long bat3u, bat3l;
static int mapping_set = 0;
if (!mapping_set) {
__asm__ __volatile__(
" lis %0,0xf000\n \
ori %1,%0,0x002a\n \
ori %0,%0,0x1ffe\n \
mtspr 0x21e,%0\n \
mtspr 0x21f,%1\n \
isync\n \
sync "
: "=r" (bat3u), "=r" (bat3l));
mapping_set = 1;
}
return;
mb();
mtspr(DBAT1U, 0xfe8000fe);
mtspr(DBAT1L, 0xfe80002a);
mb();
}
#ifdef CONFIG_SERIAL_TEXT_DEBUG
#include <linux/serialP.h>
#include <linux/serial_reg.h>
#include <asm/serial.h>
static struct serial_state rs_table[RS_TABLE_SIZE] = {
SERIAL_PORT_DFNS /* Defined in <asm/serial.h> */
};
static void
mcpn765_progress(char *s, unsigned short hex)
{
volatile char c;
volatile unsigned long com_port;
u16 shift;
com_port = rs_table[0].port;
shift = rs_table[0].iomem_reg_shift;
while ((c = *s++) != 0) {
while ((*((volatile unsigned char *)com_port +
(UART_LSR << shift)) & UART_LSR_THRE) == 0)
;
*(volatile unsigned char *)com_port = c;
if (c == '\n') {
while ((*((volatile unsigned char *)com_port +
(UART_LSR << shift)) & UART_LSR_THRE) == 0)
;
*(volatile unsigned char *)com_port = '\r';
}
}
}
#endif /* CONFIG_SERIAL_TEXT_DEBUG */
void __init
platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7)
......@@ -458,11 +469,13 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.heartbeat_reset = 0;
ppc_md.heartbeat_count = 0;
#if defined(CONFIG_SERIAL_8250) && \
(defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG))
mcpn765_early_serial_map();
#ifdef CONFIG_SERIAL_TEXT_DEBUG
ppc_md.progress = mcpn765_progress;
#else /* !CONFIG_SERIAL_TEXT_DEBUG */
ppc_md.progress = NULL;
#endif /* CONFIG_SERIAL_TEXT_DEBUG */
ppc_md.progress = gen550_progress;
#endif
#endif
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.default_irq = mcpn765_ide_default_irq;
......
......@@ -356,6 +356,21 @@ sandpoint_setup_arch(void)
SANDPOINT_87308_CFG_OUTB(0x30, 0x01); \
}
/*
* Fix IDE interrupts.
*/
static int __init
sandpoint_fix_winbond_83553(void)
{
/* Make all 8259 interrupt level sensitive */
outb(0xf8, 0x4d0);
outb(0xde, 0x4d1);
return 0;
}
arch_initcall(sandpoint_fix_winbond_83553);
/*
* Initialize the ISA devices on the Nat'l PC87308VUL SuperIO chip.
*/
......@@ -391,21 +406,6 @@ sandpoint_setup_natl_87308(void)
arch_initcall(sandpoint_setup_natl_87308);
/*
* Fix IDE interrupts.
*/
static int __init
sandpoint_fix_winbond_83553(void)
{
/* Make all 8259 interrupt level sensitive */
outb(0xf8, 0x4d0);
outb(0xde, 0x4d1);
return 0;
}
arch_initcall(sandpoint_fix_winbond_83553);
static int __init
sandpoint_request_io(void)
{
......
......@@ -61,9 +61,9 @@
#define UART_CLK 1843200
#ifdef CONFIG_SERIAL_DETECT_IRQ
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST|ASYNC_AUTO_IRQ)
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_AUTO_IRQ)
#else
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF)
#endif
#define STD_SERIAL_PORT_DFNS \
......
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