Commit 932f84b6 authored by Anton Blanchard's avatar Anton Blanchard

Merge samba.org:/scratch/anton/linux-2.5

into samba.org:/scratch/anton/linux-2.5_ppc64_work
parents 0215bd74 dae01d33
......@@ -533,6 +533,10 @@ S: Tamsui town, Taipei county,
S: Taiwan 251
S: Republic of China
N: Michael Elizabeth Chastain
E: mec@shout.net
D: Configure, Menuconfig, xconfig
N: Raymond Chen
E: raymondc@microsoft.com
D: Author of Configure script
......@@ -562,7 +566,7 @@ S: USA
N: Randolph Chung
E: tausq@debian.org
D: Linux/PA-RISC hacker
S: Fremont, CA 94538
S: Los Altos, CA 94022
S: USA
N: Juan Jose Ciarlante
......@@ -1141,11 +1145,11 @@ S: Stellenbosch, Western Cape
S: South Africa
N: Grant Grundler
E: grundler@puffin.external.hp.com
W: http://www.grundler.net/
E: grundler@parisc-linux.org
W: http://obmouse.sourceforge.net/
W: http://www.parisc-linux.org/
D: obmouse - rewrote Olivier Florent's Omnibook 600 "pop-up" mouse driver
D: PA-RISC - IO Interrupt/PCI HBA/IO MMU author and architect
D: PA-RISC - Interrupt/PCI HBA/IOMMU author and architect
S: Mountain View, California
S: USA
......
......@@ -1247,7 +1247,7 @@ static struct block_device_operations opt_fops = {
bash, even though it looks like bash; the safe way is to use only
the constructs that you already see in
<filename>Config.in</filename> files (see
<filename>Documentation/kbuild/config-language.txt</filename>).
<filename>Documentation/kbuild/kconfig-language.txt</filename>).
It's good to run "make xconfig" at least once to test (because
it's the only one with a static parser).
</para>
......
......@@ -101,6 +101,14 @@ will not be included in the mainline until around 2011), and be based
on a recognized standard and/or have been subjected to appropriate
peer review.
Also check for any RFCs which may relate to the use of specific algorithms,
as well as general application notes such as RFC2451 ("The ESP CBC-Mode
Cipher Algorithms").
It's a good idea to avoid using lots of macros and use inlined functions
instead, as gcc does a good job with inlining, while excessive use of
macros can cause compilation problems on some platforms.
BUGS
......@@ -163,7 +171,8 @@ Original developers of the initial set of crypto algorithms:
Dana L. How (DES)
Andrew Tridgell and Steve French (MD4)
Colin Plumb (MD5)
Steve Raid (SHA1)
Steve Reid (SHA1)
Jean-Luc Cooke (SHA256)
Kazunori Miyazawa / USAGI (HMAC)
The DES code was subsequently redeveloped by:
......@@ -172,6 +181,11 @@ The DES code was subsequently redeveloped by:
Gisle Sælensminde
Niels Möller
The Blowfish code was subsequently redeveloped by:
Herbert Valerio Riedel
Kyle McMartin
Please send any credits updates or corrections to:
James Morris <jmorris@intercode.com.au>
......@@ -4,7 +4,7 @@ bug-list.txt
- known bugs in kbuild programs
commands.txt
- overview of kbuild commands
config-language.txt
- specification of Config Language, the language in Config.in files
kconfig-language.txt
- specification of Config Language, the language in Kconfig files
makefiles.txt
- developer information for linux kernel makefiles
This diff is collapsed.
Introduction
------------
The configuration database is collection of configuration options
organized in a tree structure:
+- Code maturity level options
| +- Prompt for development and/or incomplete code/drivers
+- General setup
| +- Networking support
| +- System V IPC
| +- BSD Process Accounting
| +- Sysctl support
+- Loadable module support
| +- Enable loadable module support
| +- Set version information on all module symbols
| +- Kernel module loader
+- ...
Every entry has its own dependencies. These dependencies are used
to determine the visible of an entry. Any child entry is only
visible if its parent entry is also visible.
Menu entries
------------
Most entries define a config option, all other entries help to organize
them. A single configuration option is defined like this:
config MODVERSIONS
bool "Set version information on all module symbols"
depends MODULES
help
Usually, modules have to be recompiled whenever you switch to a new
kernel. ...
Every line starts with a key word and can be followed by multiple
arguments. "config" starts a new config entry. The following lines
define attributes for this config option. Attributes can be the type of
the config option, input prompt, dependencies, help text and default
values. A config option can be defined multiple times with the same
name, but every definition can have only a single input prompt and the
type must not conflict.
Menu attributes
---------------
A menu entry can have a number of attributes. Not all of them are
applicable everywhere (see syntax).
- type definition: "bool"/"tristate"/"string"/"hex"/"integer"
Every config option must have a type. There are only two basic types:
tristate and string, the other types base on these two. The type
definition optionally accepts an input prompt, so these two examples
are equivalent:
bool "Networking support"
and
bool
prompt "Networking support"
- input prompt: "prompt" <prompt> ["if" <expr>]
Every menu entry can have at most one prompt, which is used to display
to the user. Optionally dependencies only for this prompt can be added
with "if".
- default value: "default" <symbol> ["if" <expr>]
A config option can have any number of default values. If multiple
default values are visible, only the first defined one is active.
Default values are not limited to the menu entry, where they are
defined, this means the default can be defined somewhere else or be
overriden by an earlier definition.
The default value is only assigned to the config symbol if no other
value was set by the user (via the input prompt above). If an input
prompt is visible the default value is presented to the user and can
be overridden by him.
Optionally dependencies only for this default value can be added with
"if".
- dependencies: "depends on"/"requires" <expr>
This defines a dependency for this menu entry. If multiple
dependencies are defined they are connected with '&&'. Dependencies
are applied to all other options within this menu entry (which also
accept "if" expression), so these two examples are equivalent:
bool "foo" if BAR
default y if BAR
and
depends on BAR
bool "foo"
default y
- help text: "help"
This defines a help text. The end of the help text is determined by
the level indentation, this means it ends at the first line which has
a smaller indentation than the first line of the help text.
Menu dependencies
-----------------
Dependencies define the visibility of a menu entry and can also reduce
the input range of tristate symbols. The tristate logic used in the
expressions uses one more state than normal boolean logic to express the
module state. Dependency expressions have the following syntax:
<expr> ::= <symbol> (1)
<symbol> '=' <symbol> (2)
<symbol> '!=' <symbol> (3)
'(' <expr> ')' (4)
'!' <expr> (5)
<expr> '||' <expr> (6)
<expr> '&&' <expr> (7)
Expressions are listed in decreasing order of precedence.
(1) Convert the symbol into an expression. Boolean and tristate symbols
are simply converted into the respective expression values. All
other symbol types result in 'n'.
(2) If the values of both symbols are equal, it returns 'y',
otherwise 'n'.
(3) If the values of both symbols are equal, it returns 'n',
otherwise 'y'.
(4) Returns the value of the expression. Used to override precedence.
(5) Returns the result of (2-/expr/).
(6) Returns the result of min(/expr/, /expr/).
(7) Returns the result of max(/expr/, /expr/).
An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2
respectively for calculations). A menu entry becomes visible when it's
expression evaluates to 'm' or 'y'.
There are two type of symbols: constant and nonconstant symbols.
Nonconstant symbols are the most common ones and are defined with the
'config' statement. Nonconstant symbols consist entirely of alphanumeric
characters or underscores.
Constant symbols are only part of expressions. Constant symbols are
always surrounded by single or double quotes. Within the quote any
other character is allowed and the quotes can be escaped using '\'.
Menu structure
--------------
The position of a menu entry in the tree is determined in two ways. First
it can be specified explicitely:
menu "Network device support"
depends NET
config NETDEVICES
...
endmenu
All entries within the "menu" ... "endmenu" block become a submenu of
"Network device support". All subentries inherit the dependencies from
the menu entry, e.g. this means the dependency "NET" is added to the
dependency list of the config option NETDEVICES.
The other way to generate the menu structure is done by analyzing the
dependencies. If a menu entry somehow depends on the previous entry, it
can be made a submenu of it. First the the previous (parent) symbol must
be part of the dependency list and then one of these two condititions
must be true:
- the child entry must become invisible, if the parent is set to 'n'
- the child entry must only be visible, if the parent is visible
config MODULES
bool "Enable loadable module support"
config MODVERSIONS
bool "Set version information on all module symbols"
depends MODULES
comment "module support disabled"
depends !MODULES
MODVERSIONS directly depends on MODULES, this means it's only visible if
MODULES is different from 'n'. The comment on the other hand is always
visible when MODULES it's visible (the (empty) dependency of MODULES is
also part of the comment dependencies).
Kconfig syntax
--------------
The configuration file describes a series of menu entries, where every
line starts with a keyword (except help texts). The following keywords
end a menu entry:
- config
- choice/endchoice
- comment
- menu/endmenu
- if/endif
- source
The first four also start the definition of a menu entry.
config:
"config" <symbol>
<config options>
This defines a config symbol <symbol> and accepts any of above
attributes as options.
choices:
"choice"
<choice options>
<choice block>
"endchoice"
This defines a choice group and accepts any of above attributes as
options. A choice can only be of type bool or tristate, while a boolean
choice only allows a single config entry to be selected, a tristate
choice also allows any number of config entries to be set to 'm'. This
can be used if multiple drivers for a single hardware exists and only a
single driver can be compiled/loaded into the kernel, but all drivers
can be compiled as modules.
A choice accepts another option "optional", which allows to set the
choice to 'n' and no entry needs to be selected.
comment:
"comment" <prompt>
<comment options>
This defines a comment which is displayed to the user during the
configuration process and is also echoed to the output files. The only
possible options are dependencies.
menu:
"menu" <prompt>
<menu options>
<menu block>
"endmenu"
This defines a menu block, see "Menu structure" above for more
information. The only possible options are dependencies.
if:
"if" <expr>
<if block>
"endif"
This defines an if block. The dependency expression <expr> is appended
to all enclosed menu entries.
source:
"source" <prompt>
This reads the specified configuration file. This file is always parsed.
......@@ -379,13 +379,6 @@ P: Gergely Madarasz
M: Gergely Madarasz <gorgo@itc.hu>
S: Supported
CONFIGURE, MENUCONFIG, XCONFIG
P: Michael Elizabeth Chastain
M: mec@shout.net
L: kbuild-devel@lists.sourceforge.net
W: http://kbuild.sourceforge.net
S: Maintained
COSA/SRP SYNC SERIAL DRIVER
P: Jan "Yenya" Kasprzak
M: kas@fi.muni.cz
......@@ -942,6 +935,12 @@ L: linux-joystick@atrey.karlin.mff.cuni.cz
W: http://www.suse.cz/development/joystick/
S: Maintained
KCONFIG
P: Roman Zippel
M: zippel@linux-m68k.org
L: kbuild-devel@lists.sourceforge.net
S: Maintained
KERNEL AUTOMOUNTER (AUTOFS)
P: H. Peter Anvin
M: hpa@zytor.com
......@@ -1283,6 +1282,15 @@ L: linux-parport@torque.net
W: http://www.torque.net/linux-pp.html
S: Maintained
PARISC ARCHITECTURE
P: Matthew Wilcox
M: matthew@wil.cx
P: Grant Grundler
M: grundler@parisc-linux.org
L: parisc-linux@parisc-linux.org
W: http://www.parisc-linux.org/
S: Maintained
PERSONALITY HANDLING
P: Christoph Hellwig
M: hch@infradead.org
......
......@@ -252,7 +252,7 @@ ifdef include_config
# In this section, we need .config
-include ..config.cmd
-include .config.cmd
ifdef CONFIG_MODULES
export EXPORT_FLAGS := -DEXPORT_SYMTAB
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
# see Documentation/kbuild/kconfig-language.txt.
#
config ALPHA
bool
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux Kernel Configuration"
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux Kernel Configuration"
......
......@@ -235,22 +235,55 @@ void huge_page_release(struct page *page)
free_huge_page(page);
}
static void
free_rsrc(struct inode * inode)
{
int i;
spin_lock(&htlbpage_lock);
for (i=0;i<MAX_ID;i++)
if (htlbpagek[i].key == inode->i_ino) {
htlbpagek[i].key = 0;
htlbpagek[i].in = NULL;
break;
}
spin_unlock(&htlbpage_lock);
kfree(inode);
}
void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
{
struct mm_struct *mm = vma->vm_mm;
unsigned long address;
pte_t *pte;
struct page *page;
int free_more = 0;
struct inode *inode = NULL;
BUG_ON(start & (HPAGE_SIZE - 1));
BUG_ON(end & (HPAGE_SIZE - 1));
if (start < end) {
pte = huge_pte_offset(mm, start);
page = pte_page(*pte);
if ((page->mapping != NULL) && (page_count(page) == 2) &&
((inode=page->mapping->host)->i_mapping->a_ops == NULL))
free_more = 1;
}
for (address = start; address < end; address += HPAGE_SIZE) {
pte = huge_pte_offset(mm, address);
page = pte_page(*pte);
if (free_more) {
ClearPageDirty(page);
SetPageLocked(page);
remove_from_page_cache(page);
ClearPageLocked(page);
set_page_count(page, 1);
}
huge_page_release(page);
pte_clear(pte);
}
if (free_more)
free_rsrc(inode);
mm->rss -= (end - start) >> PAGE_SHIFT;
flush_tlb_range(vma, start, end);
}
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
# see Documentation/kbuild/kconfig-language.txt.
#
config M68K
bool
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "uClinux/68k (w/o MMU) Kernel Configuration"
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
# see Documentation/kbuild/kconfig-language.txt.
#
config MIPS
bool
......
#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "Linux Kernel Configuration"
......
......@@ -22,6 +22,10 @@ config SWAP
bool
default y
config STACK_GROWSUP
bool
default y
config UID16
bool
......@@ -93,10 +97,27 @@ config PA11
config PARISC64
bool "64-bit kernel"
depends on PA8X00
help
Enable this if you want to support 64bit kernel on PA-RISC platform.
At the moment, only people willing to use more than 2GB of RAM,
or having a 64bit-only capable PA-RISC machine should say Y here.
Since there is no 64bit userland on PA-RISC, there is no point to
enable this option otherwise. The 64bit kernel is significantly bigger
and slower than the 32bit one.
config PDC_NARROW
bool "32-bit firmware"
depends on PARISC64
help
This option will enable owners of C160, C180, C200, C240, C360, J280,
J282, J2240 and some D/K/R class to run a 64bit kernel with their
32bit PDC firmware.
Nobody should try this option unless they know what they are doing.
If unsure, say N.
config SMP
bool "Symmetric multi-processing support"
......@@ -211,14 +232,11 @@ source "drivers/parport/Kconfig"
source "drivers/block/Kconfig"
menu "ATA/IDE/MFM/RLL support"
depends on SUPERIO
menu "ATA/IDE/MFM/RLL support"
config IDE
tristate "ATA/IDE/MFM/RLL support"
source "drivers/ide/Kconfig"
endmenu
menu "SCSI support"
......@@ -245,6 +263,7 @@ config SCSI
source drivers/scsi/Kconfig
endmenu
source "drivers/md/Kconfig"
......@@ -323,10 +342,22 @@ menu "Console drivers"
config STI_CONSOLE
bool "STI console"
help
The STI console is the builtin display/keyboard on HP-PARISC
machines. Say Y here to build support for it into your kernel.
STI refers to the HP "Standard Text Interface" which is a set of
BIOS routines contained in a ROM chip in HP PA-RISC based machines.
Enabling this option will give you an 8 color text console on
most of the PA-RISC systems.
Really old HP boxes may not have STI, in which case you must use the
PDC console or your primary serial port as a console.
The text console uses a strange memory layout, and changing the
plane mask to create colored characters requires calls to the STI
routines. Because of that do not expect it to be actually very fast,
but it is sufficient for basic text console functions, including fonts.
The alternative is to use your primary serial port as a console.
It is safe to enable this option, so you should probably say "Y".
config DUMMY_CONSOLE
bool
depends on STI_CONSOLE || SERIAL_8250_CONSOLE
......
......@@ -20,7 +20,7 @@
ifdef CONFIG_PARISC64
CROSS_COMPILE := hppa64-linux-
UTS_MACHINE := parisc64
#CFLAGS += -b hppa64-linux
LDFLAGS_BLOB := --format binary --oformat elf64-hppa-linux
else
MACHINE := $(subst 64,,$(shell uname -m))
......@@ -28,6 +28,7 @@ ifneq (${MACHINE},parisc)
# cross compilation
CROSS_COMPILE := hppa-linux-
endif
LDFLAGS_BLOB := --format binary --oformat elf32-hppa-linux
endif
FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align
......
......@@ -235,7 +235,7 @@ int show_interrupts(struct seq_file *p, void *v)
#ifdef CONFIG_SMP
for (; j < NR_CPUS; j++)
#endif
seq_printf(p, "%10u ", kstat.irqs[j][regnr][irq_no]);
seq_printf(p, "%10u ", kstat_cpu(j).irqs[regnr][irq_no]);
seq_printf(p, " %14s",
region->data.name ? region->data.name : "N/A");
......@@ -372,7 +372,7 @@ void do_irq(struct irqaction *action, int irq, struct pt_regs * regs)
int cpu = smp_processor_id();
irq_enter();
++kstat.irqs[cpu][IRQ_REGION(irq)][IRQ_OFFSET(irq)];
++kstat_cpu(cpu).irqs[IRQ_REGION(irq)][IRQ_OFFSET(irq)];
DBG_IRQ(irq, ("do_irq(%d) %d+%d\n", irq, IRQ_REGION(irq), IRQ_OFFSET(irq)));
......
......@@ -54,14 +54,14 @@ static void def_init_hw(void)
static char def_sysrq_xlate[NR_KEYS];
#define DEFAULT_KEYB_OPS \
setkeycode: def_setkeycode, \
getkeycode: def_getkeycode, \
translate: def_translate, \
unexpected_up: def_unexpected_up, \
leds: def_leds, \
init_hw: def_init_hw, \
sysrq_key: 0xff, \
sysrq_xlate: def_sysrq_xlate,
.setkeycode = def_setkeycode, \
.getkeycode = def_getkeycode, \
.translate = def_translate, \
.unexpected_up = def_unexpected_up, \
.leds = def_leds, \
.init_hw = def_init_hw, \
.sysrq_key = 0xff, \
.sysrq_xlate = def_sysrq_xlate,
static struct kbd_ops def_kbd_ops = {
DEFAULT_KEYB_OPS
......
......@@ -79,8 +79,8 @@ static int pdc_chassis_panic_event(struct notifier_block *this,
static struct notifier_block pdc_chassis_panic_block = {
notifier_call: pdc_chassis_panic_event,
priority: INT_MAX,
.notifier_call = pdc_chassis_panic_event,
.priority = INT_MAX,
};
......@@ -99,8 +99,8 @@ static int pdc_chassis_reboot_event(struct notifier_block *this,
static struct notifier_block pdc_chassis_reboot_block = {
notifier_call: pdc_chassis_reboot_event,
priority: INT_MAX,
.notifier_call = pdc_chassis_reboot_event,
.priority = INT_MAX,
};
......
......@@ -52,26 +52,23 @@ static int pdc_console_setup(struct console *co, char *options)
return 0;
}
#ifdef CONFIG_PDC_CONSOLE
#if defined(CONFIG_PDC_CONSOLE) || defined(CONFIG_SERIAL_MUX)
#define PDC_CONSOLE_DEVICE pdc_console_device
static kdev_t pdc_console_device (struct console *c)
{
return mk_kdev(PDCCONS_MAJOR, 0);
}
#endif
#ifdef CONFIG_PDC_CONSOLE
#define PDC_CONSOLE_DEVICE pdc_console_device
#else
#define PDC_CONSOLE_DEVICE NULL
#endif
static struct console pdc_cons = {
name: "ttyB",
write: pdc_console_write,
device: PDC_CONSOLE_DEVICE,
setup: pdc_console_setup,
flags: CON_PRINTBUFFER|CON_ENABLED,
index: -1,
.name = "ttyB",
.write = pdc_console_write,
.device = PDC_CONSOLE_DEVICE,
.setup = pdc_console_setup,
.flags = CON_BOOT|CON_PRINTBUFFER|CON_ENABLED,
.index = -1,
};
static int pdc_console_initialized;
......@@ -93,9 +90,9 @@ static void pdc_console_init_force(void)
register_console(&pdc_cons);
}
void pdc_console_init(void)
void __init pdc_console_init(void)
{
#if defined(EARLY_BOOTUP_DEBUG) || defined(CONFIG_PDC_CONSOLE)
#if defined(EARLY_BOOTUP_DEBUG) || defined(CONFIG_PDC_CONSOLE) || defined(CONFIG_SERIAL_MUX)
pdc_console_init_force();
#endif
#ifdef EARLY_BOOTUP_DEBUG
......
......@@ -481,12 +481,12 @@ static int perf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}
static struct file_operations perf_fops = {
llseek: no_llseek,
read: perf_read,
write: perf_write,
ioctl: perf_ioctl,
open: perf_open,
release: perf_release
.llseek = no_llseek,
.read = perf_read,
.write = perf_write,
.ioctl = perf_ioctl,
.open = perf_open,
.release = perf_release
};
static struct miscdevice perf_dev = {
......
......@@ -370,9 +370,9 @@ static struct parisc_device_id processor_tbl[] = {
};
static struct parisc_driver cpu_driver = {
name: "CPU",
id_table: processor_tbl,
probe: processor_probe
.name = "CPU",
.id_table = processor_tbl,
.probe = processor_probe
};
/**
......
......@@ -179,10 +179,10 @@ c_stop (struct seq_file *m, void *v)
}
struct seq_operations cpuinfo_op = {
start: c_start,
next: c_next,
stop: c_stop,
show: show_cpuinfo
.start = c_start,
.next = c_next,
.stop = c_stop,
.show = show_cpuinfo
};
static void parisc_proc_mkdir(void)
......@@ -216,24 +216,24 @@ static void parisc_proc_mkdir(void)
}
static struct resource central_bus = {
name: "Central Bus",
start: (unsigned long)0xfffffffffff80000,
end: (unsigned long)0xfffffffffffaffff,
flags: IORESOURCE_MEM,
.name = "Central Bus",
.start = (unsigned long)0xfffffffffff80000,
.end = (unsigned long)0xfffffffffffaffff,
.flags = IORESOURCE_MEM,
};
static struct resource local_broadcast = {
name: "Local Broadcast",
start: (unsigned long)0xfffffffffffb0000,
end: (unsigned long)0xfffffffffffdffff,
flags: IORESOURCE_MEM,
.name = "Local Broadcast",
.start = (unsigned long)0xfffffffffffb0000,
.end = (unsigned long)0xfffffffffffdffff,
.flags = IORESOURCE_MEM,
};
static struct resource global_broadcast = {
name: "Global Broadcast",
start: (unsigned long)0xfffffffffffe0000,
end: (unsigned long)0xffffffffffffffff,
flags: IORESOURCE_MEM,
.name = "Global Broadcast",
.start = (unsigned long)0xfffffffffffe0000,
.end = (unsigned long)0xffffffffffffffff,
.flags = IORESOURCE_MEM,
};
int __init parisc_init_resources(void)
......
......@@ -149,24 +149,42 @@ long sys_shmat_wrapper(int shmid, char *shmaddr, int shmflag)
/* Fucking broken ABI */
#ifdef CONFIG_PARISC64
extern asmlinkage long sys_truncate(const char *, unsigned long);
extern asmlinkage long sys_ftruncate(unsigned int, unsigned long);
asmlinkage long parisc_truncate64(const char * path,
unsigned int high, unsigned int low)
{
return sys_truncate(path, (long)high << 32 | low);
}
asmlinkage long parisc_ftruncate64(unsigned int fd,
unsigned int high, unsigned int low)
{
return sys_ftruncate(fd, (long)high << 32 | low);
}
#else
extern asmlinkage long sys_truncate64(const char *, loff_t);
extern asmlinkage long sys_ftruncate64(unsigned int, loff_t);
extern asmlinkage ssize_t sys_pread64(unsigned int fd, char *buf,
size_t count, loff_t pos);
extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char *buf,
size_t count, loff_t pos);
asmlinkage long parisc_truncate64(const char * path,
unsigned int high, unsigned int low)
{
return sys_truncate(path, (loff_t)high << 32 | low);
return sys_truncate64(path, (loff_t)high << 32 | low);
}
asmlinkage long parisc_ftruncate64(unsigned int fd,
unsigned int high, unsigned int low)
{
return sys_ftruncate(fd, (loff_t)high << 32 | low);
return sys_ftruncate64(fd, (loff_t)high << 32 | low);
}
#endif
extern asmlinkage ssize_t sys_pread64(unsigned int fd, char *buf,
size_t count, loff_t pos);
extern asmlinkage ssize_t sys_pwrite64(unsigned int fd, const char *buf,
size_t count, loff_t pos);
asmlinkage ssize_t parisc_pread64(unsigned int fd, char *buf, size_t count,
unsigned int high, unsigned int low)
......
......@@ -2,4 +2,5 @@
# Makefile for parisc-specific library files
#
L_TARGET := lib.a
obj-y := lusercopy.o bitops.o checksum.o io.o memset.o
......@@ -38,20 +38,20 @@ unsigned int maxchunkmap;
#endif
static struct resource data_resource = {
name: "Kernel data",
flags: IORESOURCE_BUSY | IORESOURCE_MEM,
.name = "Kernel data",
.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
};
static struct resource code_resource = {
name: "Kernel code",
flags: IORESOURCE_BUSY | IORESOURCE_MEM,
.name = "Kernel code",
.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
};
static struct resource pdcdata_resource = {
name: "PDC data (Page Zero)",
start: 0,
end: 0x9ff,
flags: IORESOURCE_BUSY | IORESOURCE_MEM,
.name = "PDC data (Page Zero)",
.start = 0,
.end = 0x9ff,
.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
};
static struct resource sysram_resources[MAX_PHYSMEM_RANGES];
......
......@@ -79,6 +79,10 @@ SECTIONS
*(.initcall7.init)
}
__initcall_end = .;
. = ALIGN(4096);
__initramfs_start = .;
.init.ramfs : { *(.init.ramfs) }
__initramfs_end = .;
. = ALIGN(32);
__per_cpu_start = .;
.data.percpu : { *(.data.percpu) }
......
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/config-language.txt.
# see Documentation/kbuild/kconfig-language.txt.
#
config MMU
......@@ -1209,6 +1209,9 @@ config ADVANCED_OPTIONS
Unless you know what you are doing, say N here.
comment "Default settings for advanced configuration options are used"
depends on !ADVANCED_OPTIONS
config HIGHMEM_START_BOOL
bool "Set high memory pool address"
depends on ADVANCED_OPTIONS && HIGHMEM
......@@ -1224,6 +1227,11 @@ config HIGHMEM_START
depends on HIGHMEM_START_BOOL
default "0xfe000000"
config HIGHMEM_START
hex
depends on !HIGHMEM_START_BOOL
default "0xfe000000"
config LOWMEM_SIZE_BOOL
bool "Set maximum low memory"
depends on ADVANCED_OPTIONS && HIGHMEM
......@@ -1241,6 +1249,11 @@ config LOWMEM_SIZE
depends on LOWMEM_SIZE_BOOL
default "0x20000000"
config LOWMEM_SIZE
hex
depends on !LOWMEM_SIZE_BOOL
default "0x20000000"
config KERNEL_START_BOOL
bool "Set custom kernel base address"
depends on ADVANCED_OPTIONS
......@@ -1257,6 +1270,11 @@ config KERNEL_START
depends on KERNEL_START_BOOL
default "0xc0000000"
config KERNEL_START
hex
depends on !KERNEL_START_BOOL
default "0xc0000000"
config TASK_SIZE_BOOL
bool "Set custom user task size"
depends on ADVANCED_OPTIONS
......@@ -1272,6 +1290,11 @@ config TASK_SIZE
depends on TASK_SIZE_BOOL
default "0x80000000"
config TASK_SIZE
hex
depends on !TASK_SIZE_BOOL
default "0x80000000"
config PIN_TLB
bool "Pinned Kernel TLBs (860 ONLY)"
depends on ADVANCED_OPTIONS && 8xx
......
......@@ -12,13 +12,10 @@
# Rewritten by Cort Dougan and Paul Mackerras
#
# Be sure to change PAGE_OFFSET in include/asm-ppc/page.h to match
ifdef CONFIG_KERNEL_START_BOOL
# This must match PAGE_OFFSET in include/asm-ppc/page.h.
KERNELLOAD =$(CONFIG_KERNEL_START)
else
KERNELLOAD =0xc0000000
endif
LDFLAGS_BLOB := --format binary --oformat elf32-powerpc
LDFLAGS_vmlinux = -Ttext $(KERNELLOAD) -Bstatic
CPPFLAGS := $(CPPFLAGS) -I$(TOPDIR)/arch/$(ARCH)
AFLAGS := $(AFLAGS) -I$(TOPDIR)/arch/$(ARCH)
......@@ -54,7 +51,7 @@ else
endif
core-y += arch/ppc/kernel/ arch/ppc/platforms/ \
arch/ppc/mm/ arch/ppc/lib/
arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/
core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/
core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/
core-$(CONFIG_XMON) += arch/ppc/xmon/
......@@ -68,6 +65,8 @@ makeboot = $(call descend,arch/ppc/boot,$(1))
BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd pImage vmlinux.sm
.PHONY: $(BOOT_TARGETS) clean archclean archmrproper
AFLAGS_vmlinux.lds.o := -Upowerpc
# All the instructions talk about "make bzImage".
......@@ -81,7 +80,7 @@ $(BOOT_TARGETS): vmlinux
cp -f arch/ppc/configs/$(@:config=defconfig) .config
archclean:
+@$(call makeboot,clean)
$(MAKE) -f scripts/Makefile.clean obj=arch/ppc/boot
archmrproper:
......
......@@ -15,8 +15,12 @@ CFLAGS += -fno-builtin -D__BOOTER__ -I$(TOPDIR)/arch/$(ARCH)/boot/include
AFLAGS += -D__BOOTER__
OBJCOPY_ARGS = -O elf32-powerpc
subdir-y := simple
subdir-$(CONFIG_ALL_PPC) := openfirmware prep
bootdir-y := simple
bootdir-$(CONFIG_ALL_PPC) := openfirmware prep
# for cleaning...
subdir- := images simple openfirmware prep \
lib common of1275
HOSTCFLAGS += -Iarch/$(ARCH)/boot/include
......@@ -35,20 +39,15 @@ all-tools := addnote mknote hack-coff mkprep mkbugboot mktree
host-progs := $(addprefix utils/,$(tools-y))
include $(TOPDIR)/Rules.make
zImage zImage.initrd znetboot znetboot.initrd: $(subdir-y)
simple openfirmware prep: lib common images
openfirmware prep: of1275
zImage zImage.initrd znetboot znetboot.initrd: $(addprefix $(obj)/,$(bootdir-y))
lib common of1275 images: FORCE
+@$(call descend,$(obj)/$@,)
.PHONY: FORCE
openfirmware prep simple: FORCE
+@$(call descend,$(obj)/$@,$(MAKECMDGOALS))
$(obj)/simple $(obj)/openfirmware $(obj)/prep: $(obj)/lib $(obj)/common $(obj)/images
$(obj)/openfirmware $(obj)/prep: $(obj)/of1275
CLEAN_FILES += $(addprefix $(obj)/utils,$(all-tools))
$(obj)/lib $(obj)/common $(obj)/of1275 $(obj)/images: FORCE
+@$(call descend,$@,)
clean: FORCE
+@$(call descend,$(obj)/images,clean)
$(obj)/openfirmware $(obj)/prep $(obj)/simple: FORCE
+@$(call descend,$@,$(MAKECMDGOALS))
......@@ -33,6 +33,7 @@
#include <stdarg.h> /* for va_ bits */
#include <linux/config.h>
#include <linux/string.h>
#include "zlib.h"
#include "nonstdio.h"
......
......@@ -2,15 +2,13 @@
# This dir holds all of the images for PPC machines.
# Tom Rini January 2001
all: $(obj)/vmlinux.gz
include $(TOPDIR)/Rules.make
EXTRA_TARGETS := vmlinux.gz
GZIP_FLAGS = -v9f
$(obj)/vmlinux.gz: vmlinux
$(OBJCOPY) -S -O binary vmlinux $(obj)/vmlinux
gzip $(GZIP_FLAGS) $(obj)/vmlinux
$(OBJCOPY) -O binary $< $(@:.gz=)
gzip $(GZIP_FLAGS) $(@:.gz=)
clean:
rm -f $(obj)/sImage $(obj)/vmapus $(obj)/vmlinux* $(obj)/miboot*
......
......@@ -21,12 +21,9 @@ extern FILE *stdin, *stdout;
extern int getc(void);
extern int printf(const char *format, ...);
extern int strlen(const char *s);
extern int sprintf(char *str, const char *format, ...);
extern int tstc(void);
extern void exit(void);
extern void *memcpy(void *dest, const void *src, int n);
extern void *memmove(void *dest, const void *src, int n);
extern void outb(int port, unsigned char val);
extern void putc(const char c);
extern void puthex(unsigned long val);
......
......@@ -6,6 +6,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/string.h>
#include "nonstdio.h"
#include "of1275.h"
#include <asm/processor.h>
......@@ -34,7 +35,7 @@ char *avail_high;
#define RAM_FREE ((unsigned long)(_end+0x1000)&~0xFFF)
#define PROG_START 0x00010000
#define PROG_SIZE 0x00400000 /* 4MB */
#define PROG_SIZE 0x007f0000 /* 8MB */
#define SCRATCH_SIZE (128 << 10)
......
......@@ -6,6 +6,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/string.h>
#include <asm/processor.h>
#include <asm/page.h>
......@@ -35,7 +36,7 @@ char *avail_high;
#define RAM_END (RAM_START + 0x800000) /* only 8M mapped with BATs */
#define PROG_START RAM_START
#define PROG_SIZE 0x00400000
#define PROG_SIZE 0x00700000
#define SCRATCH_SIZE (128 << 10)
......
......@@ -10,6 +10,7 @@
#include "zlib.h"
#include "nonstdio.h"
#include "of1275.h"
#include <linux/string.h>
#include <asm/bootinfo.h>
#include <asm/page.h>
......
......@@ -6,6 +6,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#include <linux/string.h>
#include "nonstdio.h"
#include "of1275.h"
#include <asm/processor.h>
......@@ -30,7 +31,7 @@ char *avail_high;
#define RAM_END (16 << 20)
#define PROG_START 0x00010000
#define PROG_SIZE 0x003f0000
#define PROG_SIZE 0x007f0000
#define SCRATCH_SIZE (128 << 10)
......
......@@ -26,6 +26,12 @@
boot: zImage
boot := arch/ppc/boot
common := $(boot)/common
utils := $(boot)/utils
bootlib := $(boot)/lib
images := $(boot)/images
# Normally, we use the 'misc.c' file for decompress_kernel and
# whatnot. Sometimes we need to override this however.
MISC := misc.o
......@@ -161,17 +167,9 @@ boot-$(CONFIG_8260) += m8260_tty.o
boot-$(CONFIG_GT64260_CONSOLE) += gt64260_tty.o
endif
boot := arch/ppc/boot
common := $(boot)/common
utils := $(boot)/utils
bootlib := $(boot)/lib
images := $(boot)/images
EXTRA_TARGETS := $(boot-y)
LIBS := $(common)/lib.a $(bootlib)/lib.a
include $(TOPDIR)/Rules.make
OBJS := $(addprefix $(obj)/,$(boot-y))
# Tools
......
......@@ -9,9 +9,6 @@ ifdef CONFIG_4xx
EXTRA_AFLAGS := -Wa,-m405
endif
CFLAGS_prom_init.o += -mrelocatable-lib
CFLAGS_btext.o += -mrelocatable-lib
# Start off with 'head.o', change as needed.
HEAD-y := head.o
HEAD-$(CONFIG_40x) := head_4xx.o
......@@ -20,71 +17,27 @@ HEAD-$(CONFIG_PPC_ISERIES) := iSeries_head.o
EXTRA_TARGETS := $(HEAD-y)
export-objs := ppc_ksyms.o time.o ppc405_dma.o
export-objs := ppc_ksyms.o time.o
obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
process.o signal.o ptrace.o align.o \
semaphore.o syscalls.o setup.o \
cputable.o ppc_htab.o
obj-$(CONFIG_6xx) += l2cr.o
obj-$(CONFIG_6xx) += l2cr.o ppc6xx_idle.o
obj-$(CONFIG_ALL_PPC) += ppc6xx_idle.o
obj-$(CONFIG_MODULES) += ppc_ksyms.o
obj-$(CONFIG_PCI) += pci.o
ifneq ($(CONFIG_PPC_ISERIES),y)
obj-$(CONFIG_PCI) += pci-dma.o
endif
obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o
obj-$(CONFIG_KGDB) += ppc-stub.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_TAU) += temp.o
ifeq ($(CONFIG_4xx),y)
obj-$(CONFIG_4xx) += ppc4xx_setup.o ppc4xx_pic.o ppc4xx_serial.o
obj-$(CONFIG_PPC_RTC) += todc_time.o
obj-$(CONFIG_KGDB) += ppc4xx_kgdb.o
obj-$(CONFIG_405_DMA) += ppc405_dma.o
obj-$(CONFIG_PCI) += ppc405_pci.o indirect_pci.o pci_auto.o
obj-$(CONFIG_PM) += ppc4xx_pm.o
endif
obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o
ifeq ($(CONFIG_8xx),y)
obj-$(CONFIG_PCI) += qspan_pci.o i8259.o
ifneq ($(CONFIG_MATH_EMULATION),n)
obj-y += softemu8xx.o
endif
endif
obj-$(CONFIG_ALL_PPC) += prom_init.o prom.o open_pic.o \
indirect_pci.o i8259.o
obj-$(CONFIG_ADIR) += i8259.o indirect_pci.o pci_auto.o \
todc_time.o
obj-$(CONFIG_EV64260) += gt64260_common.o gt64260_pic.o \
indirect_pci.o todc_time.o pci_auto.o
obj-$(CONFIG_GEMINI) += open_pic.o i8259.o indirect_pci.o
obj-$(CONFIG_K2) += i8259.o indirect_pci.o todc_time.o \
pci_auto.o
obj-$(CONFIG_LOPEC) += mpc10x_common.o indirect_pci.o pci_auto.o \
open_pic.o i8259.o todc_time.o
obj-$(CONFIG_MCPN765) += todc_time.o indirect_pci.o pci_auto.o \
open_pic.o i8259.o pplus_common.o
obj-$(CONFIG_MENF1) += todc_time.o i8259.o mpc10x_common.o \
pci_auto.o indirect_pci.o
obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o indirect_pci.o \
i8259.o pci_auto.o pplus_common.o
obj-$(CONFIG_PCORE) += mpc10x_common.o todc_time.o i8259.o \
indirect_pci.o pci_auto.o
obj-$(CONFIG_POWERPMC250) += open_pic.o mpc10x_common.o \
indirect_pci.o pci_auto.o
obj-$(CONFIG_PPLUS) += pplus_common.o open_pic.o i8259.o \
indirect_pci.o todc_time.o pci_auto.o
obj-$(CONFIG_PRPMC750) += open_pic.o indirect_pci.o pci_auto.o \
pplus_common.o
obj-$(CONFIG_PRPMC800) += open_pic.o indirect_pci.o pci_auto.o \
pplus_common.o harrier.o
obj-$(CONFIG_SANDPOINT) += i8259.o open_pic.o mpc10x_common.o \
pci_auto.o indirect_pci.o todc_time.o
obj-$(CONFIG_SPRUCE) += indirect_pci.o pci_auto.o todc_time.o
obj-$(CONFIG_ZX4500) += indirect_pci.o pci_auto.o mpc10x_common.o \
i8259.o open_pic.o
obj-$(CONFIG_8260) += m8260_setup.o ppc8260_pic.o
obj-$(CONFIG_BOOTX_TEXT) += btext.o
obj-$(CONFIG_PPC_ISERIES) += iSeries_misc.o
include $(TOPDIR)/Rules.make
......
......@@ -114,6 +114,7 @@ main(void)
DEFINE(RESULT, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, result));
DEFINE(TRAP, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, trap));
DEFINE(CLONE_VM, CLONE_VM);
DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
DEFINE(MM_PGD, offsetof(struct mm_struct, pgd));
/* About the CPU features table */
......
......@@ -358,9 +358,12 @@ MachineCheck:
#ifdef CONFIG_ALL_PPC
mfspr r4,SPRG2
cmpwi cr1,r4,0
bne cr1,machine_check_in_rtas
bne cr1,1f
#endif
EXC_XFER_STD(0x200, MachineCheckException)
#ifdef CONFIG_ALL_PPC
1: b machine_check_in_rtas
#endif
/* Data access exception. */
. = 0x300
......
/*
* BK Id: %F% %I% %G% %U% %#%
*/
/*
* Idle task for iSeries.
*
* 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/config.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/slab.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/mmu.h>
#include <asm/cache.h>
#include <asm/cputable.h>
#include <asm/machdep.h>
#include <asm/time.h>
#include <asm/iSeries/LparData.h>
#include <asm/iSeries/HvCall.h>
#include <asm/hardirq.h>
static void yield_shared_processor(void);
static void run_light_on(int on);
extern unsigned long yield_count;
void iSeries_idle(void)
{
if (!need_resched()) {
/* Turn off the run light */
run_light_on(0);
yield_shared_processor();
HMT_low();
#ifdef CONFIG_SMP
set_thread_flag(TIF_POLLING_NRFLAG);
while (!need_resched())
barrier();
clear_thread_flag(TIF_POLLING_NRFLAG);
#endif
}
if (need_resched()) {
run_light_on(1);
schedule();
return;
}
}
extern void fake_interrupt(void);
extern u64 get_tb64(void);
static void run_light_on(int on)
{
unsigned long CTRL;
CTRL = mfspr(CTRLF);
CTRL = on? (CTRL | RUNLATCH): (CTRL & ~RUNLATCH);
mtspr(CTRLT, CTRL);
}
static void yield_shared_processor(void)
{
struct Paca *paca;
u64 tb;
/* Poll for I/O events */
local_irq_disable();
local_irq_enable();
paca = (struct Paca *)mfspr(SPRG1);
if ( paca->xLpPaca.xSharedProc ) {
HvCall_setEnabledInterrupts( HvCall_MaskIPI |
HvCall_MaskLpEvent |
HvCall_MaskLpProd |
HvCall_MaskTimeout );
/*
* Check here for any of the above pending...
* IPI and Decrementers are indicated in ItLpPaca
* LpEvents are indicated on the LpQueue
*
* Disabling/enabling will check for LpEvents, IPIs
* and decrementers
*/
local_irq_disable();
local_irq_enable();
++yield_count;
/* Get current tb value */
tb = get_tb64();
/* Compute future tb value when yield will expire */
tb += tb_ticks_per_jiffy;
HvCall_yieldProcessor( HvCall_YieldTimed, tb );
/* Check here for any of the above pending or timeout expired*/
local_irq_disable();
/*
* The decrementer stops during the yield. Just force
* a fake decrementer now and the timer_interrupt
* code will straighten it all out
*/
paca->xLpPaca.xDecrInt = 1;
local_irq_enable();
}
}
......@@ -2,7 +2,8 @@
* Idle daemon for PowerPC. Idle daemon will handle any action
* that needs to be taken when the system becomes idle.
*
* Written by Cort Dougan (cort@cs.nmt.edu)
* Written by Cort Dougan (cort@cs.nmt.edu). Subsequently hacked
* on by Tom Rini, Armin Kuster, Paul Mackerras and others.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -29,175 +30,39 @@
#include <asm/mmu.h>
#include <asm/cache.h>
#include <asm/cputable.h>
#ifdef CONFIG_PPC_ISERIES
#include <asm/time.h>
#include <asm/iSeries/LparData.h>
#include <asm/iSeries/HvCall.h>
#include <asm/hardirq.h>
static void yield_shared_processor(void);
static void run_light_on(int on);
extern unsigned long yield_count;
#else /* CONFIG_PPC_ISERIES */
#define run_light_on(x) do { } while (0)
#endif /* CONFIG_PPC_ISERIES */
void power_save(void);
unsigned long zero_paged_on;
unsigned long powersave_nap;
#include <asm/machdep.h>
void default_idle(void)
{
int do_power_save = 0;
void (*powersave)(void);
/* Check if CPU can powersave */
if (cur_cpu_spec[smp_processor_id()]->cpu_features &
(CPU_FTR_CAN_DOZE | CPU_FTR_CAN_NAP))
do_power_save = 1;
powersave = ppc_md.power_save;
#ifdef CONFIG_PPC_ISERIES
if (!current->need_resched) {
/* Turn off the run light */
run_light_on(0);
yield_shared_processor();
}
HMT_low();
#endif
#ifdef CONFIG_SMP
if (!do_power_save) {
if (!need_resched()) {
if (powersave != NULL)
powersave();
#ifdef CONFIG_SMP
else {
set_thread_flag(TIF_POLLING_NRFLAG);
while (!test_thread_flag(TIF_NEED_RESCHED))
while (!need_resched())
barrier();
clear_thread_flag(TIF_POLLING_NRFLAG);
}
}
#endif
if (do_power_save && !need_resched())
power_save();
if (need_resched()) {
run_light_on(1);
schedule();
}
#ifdef CONFIG_PPC_ISERIES
else {
run_light_on(0);
yield_shared_processor();
HMT_low();
}
#endif /* CONFIG_PPC_ISERIES */
if (need_resched())
schedule();
}
/*
* SMP entry into the idle task - calls the same thing as the
* non-smp versions. -- Cort
* The body of the idle task.
*/
int cpu_idle(void)
{
for (;;)
if (ppc_md.idle != NULL)
ppc_md.idle();
else
default_idle();
return 0;
}
void power_save(void)
{
unsigned long hid0;
int nap = powersave_nap;
/* 7450 has no DOZE mode mode, we return if powersave_nap
* isn't enabled
*/
if (!(nap || (cur_cpu_spec[smp_processor_id()]->cpu_features & CPU_FTR_CAN_DOZE)))
return;
/*
* Disable interrupts to prevent a lost wakeup
* when going to sleep. This is necessary even with
* RTLinux since we are not guaranteed an interrupt
* didn't come in and is waiting for a local_irq_enable() before
* emulating one. This way, we really do hard disable.
*
* We assume that we're sti-ed when we come in here. We
* are in the idle loop so if we're cli-ed then it's a bug
* anyway.
* -- Cort
*/
_nmask_and_or_msr(MSR_EE, 0);
if (!need_resched())
{
asm("mfspr %0,1008" : "=r" (hid0) :);
hid0 &= ~(HID0_NAP | HID0_SLEEP | HID0_DOZE);
hid0 |= (powersave_nap? HID0_NAP: HID0_DOZE) | HID0_DPM;
asm("mtspr 1008,%0" : : "r" (hid0));
/* set the POW bit in the MSR, and enable interrupts
* so we wake up sometime! */
_nmask_and_or_msr(0, MSR_POW | MSR_EE);
}
_nmask_and_or_msr(0, MSR_EE);
}
#ifdef CONFIG_PPC_ISERIES
extern void fake_interrupt(void);
extern u64 get_tb64(void);
void run_light_on(int on)
{
unsigned long CTRL;
CTRL = mfspr(CTRLF);
CTRL = on? (CTRL | RUNLATCH): (CTRL & ~RUNLATCH);
mtspr(CTRLT, CTRL);
}
void yield_shared_processor(void)
{
struct Paca *paca;
u64 tb;
/* Poll for I/O events */
local_irq_disable();
local_irq_enable();
paca = (struct Paca *)mfspr(SPRG1);
if ( paca->xLpPaca.xSharedProc ) {
HvCall_setEnabledInterrupts( HvCall_MaskIPI |
HvCall_MaskLpEvent |
HvCall_MaskLpProd |
HvCall_MaskTimeout );
/*
* Check here for any of the above pending...
* IPI and Decrementers are indicated in ItLpPaca
* LpEvents are indicated on the LpQueue
*
* Disabling/enabling will check for LpEvents, IPIs
* and decrementers
*/
local_irq_disable();
local_irq_enable();
++yield_count;
/* Get current tb value */
tb = get_tb64();
/* Compute future tb value when yield will expire */
tb += tb_ticks_per_jiffy;
HvCall_yieldProcessor( HvCall_YieldTimed, tb );
/* Check here for any of the above pending or timeout expired*/
local_irq_disable();
/*
* The decrementer stops during the yield. Just force
* a fake decrementer now and the timer_interrupt
* code will straighten it all out
*/
paca->xLpPaca.xDecrInt = 1;
local_irq_enable();
}
}
#endif /* CONFIG_PPC_ISERIES */
......@@ -1290,6 +1290,11 @@ _GLOBAL(sys_call_table)
.long sys_ni_syscall /* reserved for alloc_hugepages */
.long sys_ni_syscall /* reserved for free_hugepages */
.long sys_exit_group
.long sys_lookup_dcookie /* 235 */
.long sys_epoll_create
.long sys_epoll_ctl
.long sys_epoll_wait
.long sys_remap_file_pages
.rept NR_syscalls-(.-sys_call_table)/4
.long sys_ni_syscall
......
/*
* BK Id: %F% %I% %G% %U% %#%
*/
/*
* power_save() rountine for classic PPC CPUs.
*
* Written by Cort Dougan (cort@cs.nmt.edu)
*
* 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/sched.h>
#include <linux/smp.h>
#include <linux/stringify.h>
#include <asm/cputable.h>
#include <asm/current.h>
#include <asm/processor.h>
unsigned long powersave_nap = 0;
#define DSSALL .long (0x1f<<26)+(0x10<<21)+(0x336<<1)
void
ppc6xx_idle(void)
{
unsigned long hid0;
int nap = powersave_nap;
/* 7450 has no DOZE mode mode, we return if powersave_nap
* isn't enabled
*/
if (!(nap || (cur_cpu_spec[smp_processor_id()]->cpu_features
& CPU_FTR_CAN_DOZE)))
return;
/*
* Disable interrupts to prevent a lost wakeup
* when going to sleep. This is necessary even with
* RTLinux since we are not guaranteed an interrupt
* didn't come in and is waiting for a __sti() before
* emulating one. This way, we really do hard disable.
*
* We assume that we're sti-ed when we come in here. We
* are in the idle loop so if we're cli-ed then it's a bug
* anyway.
* -- Cort
*/
_nmask_and_or_msr(MSR_EE, 0);
if (!need_resched()) {
__asm__ __volatile__("mfspr %0,1008":"=r"(hid0):);
hid0 &= ~(HID0_NAP | HID0_SLEEP | HID0_DOZE);
hid0 |= (powersave_nap ? HID0_NAP : HID0_DOZE) | HID0_DPM;
__asm__ __volatile__("mtspr 1008,%0"::"r"(hid0));
/* Flush pending data streams, consider this instruction
* exist on all altivec capable CPUs
*/
__asm__ __volatile__("98: " __stringify(DSSALL) "\n"
" sync\n"
"99:\n"
".section __ftr_fixup,\"a\"\n"
" .long %0\n"
" .long %1\n"
" .long 98b\n"
" .long 99b\n"
".previous"::"i"
(CPU_FTR_ALTIVEC), "i"(CPU_FTR_ALTIVEC));
/* set the POW bit in the MSR, and enable interrupts
* so we wake up sometime! */
_nmask_and_or_msr(0, MSR_POW | MSR_EE);
}
_nmask_and_or_msr(0, MSR_EE);
}
......@@ -44,6 +44,7 @@
#include <asm/time.h>
#include <asm/cputable.h>
#include <asm/btext.h>
#include <asm/div64.h>
#ifdef CONFIG_8xx
#include <asm/commproc.h>
......@@ -119,6 +120,7 @@ EXPORT_SYMBOL(strnlen);
EXPORT_SYMBOL(strcmp);
EXPORT_SYMBOL(strncmp);
EXPORT_SYMBOL(strcasecmp);
EXPORT_SYMBOL(__div64_32);
/* EXPORT_SYMBOL(csum_partial); already in net/netsyms.c */
EXPORT_SYMBOL(csum_partial_copy_generic);
......@@ -195,7 +197,6 @@ EXPORT_SYMBOL(enable_kernel_fp);
EXPORT_SYMBOL(flush_icache_range);
EXPORT_SYMBOL(flush_dcache_range);
EXPORT_SYMBOL(flush_icache_user_range);
EXPORT_SYMBOL(flush_icache_page);
EXPORT_SYMBOL(flush_dcache_page);
#ifdef CONFIG_ALTIVEC
EXPORT_SYMBOL(last_task_used_altivec);
......
......@@ -54,6 +54,8 @@ extern void xmon_map_scc(void);
extern void kgdb_map_scc(void);
#endif
extern void ppc6xx_idle(void);
extern boot_infos_t *boot_infos;
char saved_command_line[256];
unsigned char aux_device_present;
......@@ -528,6 +530,10 @@ machine_init(unsigned long r3, unsigned long r4, unsigned long r5,
strcpy(cmd_line, CONFIG_CMDLINE);
#endif /* CONFIG_CMDLINE */
#if defined(CONFIG_6xx) || defined(CONFIG_ALL_PPC)
ppc_md.power_save = ppc6xx_idle;
#endif
platform_init(r3, r4, r5, r6, r7);
if (ppc_md.progress)
......
......@@ -6,8 +6,6 @@ ifdef CONFIG_PPC64BRIDGE
EXTRA_AFLAGS := -Wa,-mppc64bridge
endif
AFLAGS_hashtable.o += -I$(TOPDIR)/arch/$(ARCH)/kernel
obj-y := fault.o init.o mem_pieces.o extable.o \
mmu_context.o pgtable.o
......
......@@ -47,11 +47,13 @@
#include "mem_pieces.h"
#include "mmu_decl.h"
#ifdef CONFIG_LOWMEM_SIZE_BOOL
#if defined(CONFIG_KERNEL_START_BOOL) || defined(CONFIG_LOWMEM_SIZE_BOOL)
/* The ammount of lowmem must be within 0xF0000000 - KERNELBASE. */
#if (CONFIG_LOWMEM_SIZE > (0xF0000000 - KERNELBASE))
#error "You must adjust CONFIG_LOWMEM_SIZE or CONFIG_START_KERNEL"
#endif
#endif
#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE
#else
#define MAX_LOW_MEM (0xF0000000UL - KERNELBASE)
#endif /* CONFIG_LOWMEM_SIZE_BOOL */
#ifdef CONFIG_PPC_ISERIES
extern void create_virtual_bus_tce_table(void);
......@@ -472,11 +474,23 @@ void __init mem_init(void)
if (agp_special_page)
printk(KERN_INFO "AGP special page: 0x%08lx\n", agp_special_page);
#endif /* defined(CONFIG_ALL_PPC) */
#ifdef CONFIG_PPC_ISERIES
#ifdef CONFIG_PPC_ISERIES
create_virtual_bus_tce_table();
#endif /* CONFIG_PPC_ISERIES */
/* Make sure all our pagetable pages have page->mapping
and page->index set correctly. */
for (addr = KERNELBASE; addr != 0; addr += PGDIR_SIZE) {
struct page *pg;
pmd_t *pmd = pmd_offset(pgd_offset_k(addr), addr);
if (pmd_present(*pmd)) {
pg = pmd_page(*pmd);
pg->mapping = (void *) &init_mm;
pg->index = addr;
}
}
mem_init_done = 1;
}
......@@ -556,28 +570,17 @@ void flush_dcache_page(struct page *page)
clear_bit(PG_arch_1, &page->flags);
}
void flush_icache_page(struct vm_area_struct *vma, struct page *page)
{
unsigned long phys;
if (page->mapping && !PageReserved(page)
&& !test_bit(PG_arch_1, &page->flags)) {
phys = page_to_pfn(page) << PAGE_SHIFT;
__flush_dcache_icache_phys(phys);
set_bit(PG_arch_1, &page->flags);
}
}
void clear_user_page(void *page, unsigned long vaddr, struct page *pg)
{
clear_page(page);
clear_bit(PG_arch_1, &pg->flags);
}
void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
struct page *pg)
{
copy_page(vto, vfrom);
__flush_dcache_icache(vto);
clear_bit(PG_arch_1, &pg->flags);
}
void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
......@@ -589,3 +592,38 @@ void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
flush_icache_range(maddr, maddr + len);
kunmap(page);
}
/*
* This is called at the end of handling a user page fault, when the
* fault has been handled by updating a PTE in the linux page tables.
* We use it to preload an HPTE into the hash table corresponding to
* the updated linux PTE.
*/
void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
pte_t pte)
{
/* handle i-cache coherency */
unsigned long pfn = pte_pfn(pte);
if (pfn_valid(pfn)) {
struct page *page = pfn_to_page(pfn);
if (!PageReserved(page)
&& !test_bit(PG_arch_1, &page->flags)) {
__flush_dcache_icache((void *) address);
set_bit(PG_arch_1, &page->flags);
}
}
#ifdef CONFIG_PPC_STD_MMU
/* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
if (Hash != 0 && pte_young(pte)) {
struct mm_struct *mm;
pmd_t *pmd;
mm = (address < TASK_SIZE)? vma->vm_mm: &init_mm;
pmd = pmd_offset(pgd_offset(mm, address), address);
if (!pmd_none(*pmd))
add_hash_page(mm->context, address, pmd_val(*pmd));
}
#endif
}
......@@ -280,27 +280,3 @@ void __init MMU_init_hw(void)
if ( ppc_md.progress ) ppc_md.progress("hash:done", 0x205);
}
/*
* This is called at the end of handling a user page fault, when the
* fault has been handled by updating a PTE in the linux page tables.
* We use it to preload an HPTE into the hash table corresponding to
* the updated linux PTE.
*/
void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
pte_t pte)
{
struct mm_struct *mm;
pmd_t *pmd;
static int nopreload;
if (Hash == 0 || nopreload)
return;
/* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
if (!pte_young(pte))
return;
mm = (address < TASK_SIZE)? vma->vm_mm: &init_mm;
pmd = pmd_offset(pgd_offset(mm, address), address);
if (!pmd_none(*pmd))
add_hash_page(mm->context, address, pmd_val(*pmd));
}
......@@ -17,8 +17,8 @@
#ifdef __KERNEL__
#ifndef __ASM_ASH_H__
#define __ASM_ASH_H__
#include <platforms/ibm_ocp.h>
#include <platforms/ibmnp405h.h>
#include <platforms/4xx/ibm_ocp.h>
#include <platforms/4xx/ibmnp405h.h>
#ifndef __ASSEMBLY__
/*
......
......@@ -17,7 +17,7 @@
#ifdef __KERNEL__
#ifndef __ASM_CEDER_H__
#define __ASM_CEDER_H__
#include <platforms/ibmnp405l.h>
#include <platforms/4xx/ibmnp405l.h>
#ifndef __ASSEMBLY__
/*
......
......@@ -12,7 +12,7 @@
#include <asm/pci-bridge.h>
#include <asm/machdep.h>
#include <asm/todc.h>
#include <platforms/ibm_ocp.h>
#include <platforms/4xx/ibm_ocp.h>
#undef DEBUG
#ifdef DEBUG
......
......@@ -13,7 +13,7 @@
#define __ASM_EP405_H__
/* We have a 405GP core */
#include <platforms/ibm405gp.h>
#include <platforms/4xx/ibm405gp.h>
#ifndef __ASSEMBLY__
typedef struct board_info {
......
......@@ -39,7 +39,7 @@
#include <linux/threads.h>
#include <linux/param.h>
#include <linux/string.h>
#include <platforms/ibm405gp.h>
#include <platforms/4xx/ibm405gp.h>
const struct pcil0_regs *PCIL_ADDR[] = {
(struct pcil0_regs *) PCIL0_BASE,
......
......@@ -50,7 +50,7 @@
#define __ASM_IBM405GP_H__
#include <linux/config.h>
#include <platforms/ibm_ocp.h>
#include <platforms/4xx/ibm_ocp.h>
/* ibm405.h at bottom of this file */
......@@ -189,7 +189,7 @@
#define DCRN_UIC0_BASE 0x0C0
#define UIC0 DCRN_UIC0_BASE
#include <platforms/ibm405.h>
#include <asm/ibm405.h>
#endif /* __ASM_IBM405GP_H__ */
#endif /* __KERNEL__ */
......@@ -39,7 +39,7 @@
#include <linux/threads.h>
#include <linux/param.h>
#include <linux/string.h>
#include <platforms/ibmnp405h.h>
#include <platforms/4xx/ibmnp405h.h>
const struct NS16550* COM_PORTS[] =
{
......
......@@ -42,7 +42,7 @@
#define __ASM_IBMNP405H_H__
#include <linux/config.h>
#include <platforms/ibm_ocp.h>
#include <platforms/4xx/ibm_ocp.h>
/* ibm405.h at bottom of this file */
......@@ -166,7 +166,7 @@
#define DCRN_UIC1_VCR (DCRN_UIC1_BASE + 0x8)
#endif
#include <platforms/ibm405.h>
#include <asm/ibm405.h>
#endif /* __ASM_IBMNP405H_H__ */
#endif /* __KERNEL__ */
......@@ -39,7 +39,7 @@
#include <linux/threads.h>
#include <linux/param.h>
#include <linux/string.h>
#include <platforms/ibmnp405l.h>
#include <platforms/4xx/ibmnp405l.h>
const struct NS16550* COM_PORTS[] =
{
......
......@@ -42,7 +42,7 @@
#define __ASM_IBMNP405L_H__
#include <linux/config.h>
#include <platforms/ibm_ocp.h>
#include <platforms/4xx/ibm_ocp.h>
/* ibm405.h at bottom of this file */
......@@ -150,7 +150,7 @@
#define DCRN_UIC1_VCR (DCRN_UIC1_BASE + 0x8)
#endif
#include <platforms/ibm405.h>
#include <asm/ibm405.h>
#endif /* __ASM_IBMNP405L_H__ */
#endif /* __KERNEL__ */
......@@ -34,7 +34,7 @@
*/
#include <linux/config.h>
#include <platforms/ibmstb3.h>
#include <platforms/4xx/ibmstb3.h>
const struct NS16550* COM_PORTS[] =
{
......
......@@ -48,7 +48,7 @@
#define __ASM_IBMSTBX_H__
#include <linux/config.h>
#include <platforms/ibm_ocp.h>
#include <platforms/4xx/ibm_ocp.h>
/* ibm405.h at bottom of this file */
......@@ -282,7 +282,7 @@
#define DCRN_OCMDSCR (DCRN_OCM0_BASE + 0x3) /* OCM Data Side Control */
#endif
#include <platforms/ibm405.h>
#include <asm/ibm405.h>
#endif /* __ASM_IBMSTBX_H__ */
#endif /* __KERNEL__ */
......@@ -34,7 +34,7 @@
*/
#include <linux/config.h>
#include <platforms/ibmstb4.h>
#include <platforms/4xx/ibmstb4.h>
const struct NS16550* COM_PORTS[] =
{
......
......@@ -42,7 +42,7 @@
#define __ASM_IBMSTB4_H__
#include <linux/config.h>
#include <platforms/ibm_ocp.h>
#include <platforms/4xx/ibm_ocp.h>
/* serial port defines */
#define STB04xxx_IO_BASE ((uint)0xe0000000)
......@@ -262,7 +262,7 @@
#define DCRN_BESR0 (DCRN_EBIMC_BASE + 0x21) /* Bus Error Status Register */
#define DCRN_BIUCR (DCRN_EBIMC_BASE + 0x2A) /* Bus Interfac Unit Ctrl Reg */
#include <platforms/ibm405.h>
#include <asm/ibm405.h>
#endif /* __ASM_IBMSTB4_H__ */
#endif /* __KERNEL__ */
......@@ -16,7 +16,7 @@
#define __ASM_REDWOOD_H__
/* Redwoods have an STB03xxx or STB04xxx core */
#include <platforms/ibmstb3.h>
#include <platforms/4xx/ibmstb3.h>
#ifndef __ASSEMBLY__
typedef struct board_info {
......
......@@ -16,7 +16,7 @@
#define __ASM_REDWOOD5_H__
/* Redwood5 has an STB04xxx core */
#include <platforms/ibmstb4.h>
#include <platforms/4xx/ibmstb4.h>
#ifndef __ASSEMBLY__
typedef struct board_info {
......
......@@ -39,7 +39,7 @@
#include <asm/page.h>
#include <asm/time.h>
#include <asm/io.h>
#include <platforms/ibm_ocp.h>
#include <platforms/4xx/ibm_ocp.h>
#ifdef CONFIG_PPC_RTC
#include <asm/todc.h>
......
......@@ -25,7 +25,7 @@
#define __ASM_WALNUT_H__
/* We have a 405GP core */
#include <platforms/ibm405gp.h>
#include <platforms/4xx/ibm405gp.h>
#ifndef __ASSEMBLY__
/*
......
......@@ -37,14 +37,14 @@ obj-$(CONFIG_LOPEC) += lopec_setup.o lopec_pci.o
obj-$(CONFIG_MCPN765) += mcpn765_setup.o mcpn765_pci.o
obj-$(CONFIG_MENF1) += menf1_setup.o menf1_pci.o
obj-$(CONFIG_MVME5100) += mvme5100_setup.o mvme5100_pci.o
obj-$(CONFIG_PAL4) += pal4_setup.o pal4_pci.o cpc700_pic.o
obj-$(CONFIG_PAL4) += pal4_setup.o pal4_pci.o
obj-$(CONFIG_PCORE) += pcore_setup.o pcore_pci.o
obj-$(CONFIG_POWERPMC250) += powerpmc250.o
obj-$(CONFIG_PPLUS) += pplus_pci.o pplus_setup.o
obj-$(CONFIG_PRPMC750) += prpmc750_setup.o prpmc750_pci.o
obj-$(CONFIG_PRPMC800) += prpmc800_setup.o prpmc800_pci.o
obj-$(CONFIG_SANDPOINT) += sandpoint_setup.o sandpoint_pci.o
obj-$(CONFIG_SPRUCE) += spruce_setup.o spruce_pci.o cpc700_pic.o
obj-$(CONFIG_SPRUCE) += spruce_setup.o spruce_pci.o
obj-$(CONFIG_ZX4500) += zx4500_setup.o zx4500_pci.o
obj-$(CONFIG_PPC_ISERIES) += iSeries_setup.o iSeries_time.o \
iSeries_dma.o iSeries_pic.o
......
......@@ -18,7 +18,7 @@
#include <asm/machdep.h>
#include <asm/pci-bridge.h>
#include "cpc710.h"
#include <syslib/cpc710.h>
#include "adir.h"
#undef DEBUG
......
......@@ -57,6 +57,7 @@ static void setup_iSeries_cache_sizes( void );
extern void iSeries_pci_Initialize(void);
static int iSeries_show_cpuinfo(struct seq_file *m);
static int iSeries_show_percpuinfo(struct seq_file *m, int i);
extern void iSeries_idle(void);
extern struct pci_ops iSeries_pci_ops;
/* Global Variables */
......@@ -537,6 +538,8 @@ iSeries_setup_arch(void)
mf_init();
viopath_init();
*/
ppc_md.idle = iSeries_idle;
}
/*
......
......@@ -24,7 +24,8 @@
#include <asm/machdep.h>
#include <asm/pci-bridge.h>
#include "cpc710.h"
#include <syslib/cpc710.h>
#include "k2.h"
#undef DEBUG
......
......@@ -23,7 +23,8 @@
#include <asm/pci-bridge.h>
#include <asm/uaccess.h>
#include "cpc700.h"
#include <syslib/cpc700.h>
#include "pal4.h"
/* not much to this.... */
......
......@@ -31,7 +31,8 @@
#include <asm/todc.h>
#include <asm/bootinfo.h>
#include "cpc700.h"
#include <syslib/cpc700.h>
#include "pal4.h"
extern void pal4_find_bridges(void);
......
......@@ -91,8 +91,6 @@ extern int pmac_pci_enable_device_hook(struct pci_dev *dev, int initial);
extern void pmac_pcibios_after_init(void);
extern int of_show_percpuinfo(struct seq_file *m, int i);
extern kdev_t sd_find_target(void *host, int tgt);
struct device_node *memory_node;
unsigned char drive_info;
......@@ -406,13 +404,6 @@ find_ide_boot(void)
void __init
find_boot_device(void)
{
#if defined(CONFIG_SCSI) && defined(CONFIG_BLK_DEV_SD)
if (boot_host != NULL) {
boot_dev = sd_find_target(boot_host, boot_target);
if (!kdev_same(boot_dev, NODEV))
return;
}
#endif
#if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC)
boot_dev = find_ide_boot();
#endif
......
......@@ -24,6 +24,7 @@
#include <asm/machdep.h>
#include <asm/open_pic.h>
extern void (*setup_ibm_pci)(char *irq_lo, char *irq_hi);
/* Which PCI interrupt line does a given device [slot] use? */
/* Note: This really should be two dimensional based in slot/pin used */
......@@ -612,6 +613,7 @@ static unsigned char prep_pci_intpins[4][4] __prepdata =
#define ELCRM_INT7_LVL 0x80
#define ELCRM_INT5_LVL 0x20
#if 0
/*
* PCI config space access.
*/
......@@ -686,6 +688,7 @@ static struct pci_ops prep_pci_ops =
prep_read_config,
prep_write_config
};
#endif
#define MOTOROLA_CPUTYPE_REG 0x800
#define MOTOROLA_BASETYPE_REG 0x803
......@@ -695,7 +698,7 @@ static struct pci_ops prep_pci_ops =
static u_char prep_openpic_initsenses[] __initdata = {
(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* MVME2600_INT_SIO */
(IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_FALCON_ECC_ERR */
(IRQ_SENSE_EDGE | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_FALCN_ECC_ERR */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_ETHERNET */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_SCSI */
(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE), /* MVME2600_INT_PCI_GRAPHICS */
......@@ -834,32 +837,51 @@ struct mot_info {
void __init
ibm_prep_init(void)
{
u32 addr;
#ifdef CONFIG_PREP_RESIDUAL
u32 addr, real_addr, len;
PPC_DEVICE *mpic;
#endif
PnP_TAG_PACKET *pkt;
/* Use the PReP residual data to determine if an OpenPIC is
* present. If so, get the large vendor packet which will
* tell us the base address and length in memory.
* If we are successful, ioremap the memory area and set
* OpenPIC_Addr (this indicates that the OpenPIC was found).
*/
mpic = residual_find_device(-1, NULL, SystemPeripheral,
ProgrammableInterruptController, MPIC, 0);
if (!mpic)
return;
pkt = PnP_find_large_vendor_packet(res->DevicePnPHeap +
mpic->AllocatedOffset, 9, 0);
if (!pkt)
return;
#define p pkt->L4_Pack.L4_Data.L4_PPCPack
if (!((p.PPCData[0] == 2) && (p.PPCData[1] == 32)))
return; /* not a 32-bit memory address */
real_addr = ld_le32((unsigned int *) (p.PPCData + 4));
if (real_addr == 0xffffffff)
return;
if (inb(0x0852) == 0xd5) {
/* This is for the 43p-140 */
early_read_config_dword(0, 0, PCI_DEVFN(13, 0),
PCI_BASE_ADDRESS_0, &addr);
if (addr != 0xffffffff
&& !(addr & PCI_BASE_ADDRESS_SPACE_IO)
&& (addr &= PCI_BASE_ADDRESS_MEM_MASK) != 0) {
addr += PREP_ISA_MEM_BASE;
OpenPIC_Addr = ioremap(addr, 0x40000);
/* Adjust address to be as seen by CPU */
addr = real_addr + PREP_ISA_MEM_BASE;
len = ld_le32((unsigned int *) (p.PPCData + 12));
if (!len)
return;
#undef p
OpenPIC_Addr = ioremap(addr, len);
ppc_md.get_irq = openpic_get_irq;
OpenPIC_InitSenses = prep_openpic_initsenses;
OpenPIC_NumInitSenses = sizeof(prep_openpic_initsenses);
}
}
#ifdef CONFIG_PREP_RESIDUAL
mpic = residual_find_device(-1, NULL, SystemPeripheral,
ProgrammableInterruptController, MPIC, 0);
if (mpic != NULL)
printk("mpic = %p\n", mpic);
printk(KERN_INFO "MPIC at 0x%08x (0x%08x), length 0x%08x "
"mapped to 0x%p\n", addr, real_addr, len, OpenPIC_Addr);
#endif
}
......@@ -879,6 +901,47 @@ ibm43p_pci_map_non0(struct pci_dev *dev)
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
}
void __init
prep_sandalfoot_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
{
Motherboard_map_name = "IBM 6015/7020 (Sandalfoot/Sandalbow)";
Motherboard_map = ibm6015_pci_IRQ_map;
Motherboard_routes = ibm6015_pci_IRQ_routes;
*irq_edge_mask_lo = 0x00; /* irq's 0-7 all edge-triggered */
*irq_edge_mask_hi = 0xA0; /* irq's 13, 15 level-triggered */
}
void __init
prep_thinkpad_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
{
Motherboard_map_name = "IBM Thinkpad 850/860";
Motherboard_map = Nobis_pci_IRQ_map;
Motherboard_routes = Nobis_pci_IRQ_routes;
*irq_edge_mask_lo = 0x00; /* irq's 0-7 all edge-triggered */
*irq_edge_mask_hi = 0xA0; /* irq's 13, 15 level-triggered */
}
void __init
prep_carolina_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
{
Motherboard_map_name = "IBM 7248, PowerSeries 830/850 (Carolina)";
Motherboard_map = ibm8xx_pci_IRQ_map;
Motherboard_routes = ibm8xx_pci_IRQ_routes;
*irq_edge_mask_lo = 0x00; /* irq's 0-7 all edge-triggered */
*irq_edge_mask_hi = 0xA4; /* irq's 10, 13, 15 level-triggered */
}
void __init
prep_tiger1_setup_pci(char *irq_edge_mask_lo, char *irq_edge_mask_hi)
{
Motherboard_map_name = "IBM 43P-140 (Tiger1)";
Motherboard_map = ibm43p_pci_IRQ_map;
Motherboard_routes = ibm43p_pci_IRQ_routes;
Motherboard_non0 = ibm43p_pci_map_non0;
*irq_edge_mask_lo = 0x00; /* irq's 0-7 all edge-triggered */
*irq_edge_mask_hi = 0xA0; /* irq's 13, 15 level-triggered */
}
void __init
prep_route_pci_interrupts(void)
{
......@@ -948,52 +1011,12 @@ prep_route_pci_interrupts(void)
outb( (irq_mode >> 8) & 0xff, 0x4d1 );
}
} else if ( _prep_type == _PREP_IBM ) {
unsigned char planar_id = inb(0x0852);
unsigned char irq_edge_mask_lo, irq_edge_mask_hi;
printk("IBM ID: %08x\n", planar_id);
switch(planar_id) {
case 0xff:
Motherboard_map_name = "IBM Thinkpad 850/860";
Motherboard_map = Nobis_pci_IRQ_map;
Motherboard_routes = Nobis_pci_IRQ_routes;
irq_edge_mask_lo = 0x00; /* irq's 0-7 all edge-triggered */
irq_edge_mask_hi = 0xA0; /* irq's 13, 15 level-triggered */
break;
case 0xfc:
Motherboard_map_name = "IBM 6015/7020 (Sandalfoot/Sandalbow)";
Motherboard_map = ibm6015_pci_IRQ_map;
Motherboard_routes = ibm6015_pci_IRQ_routes;
irq_edge_mask_lo = 0x00; /* irq's 0-7 all edge-triggered */
irq_edge_mask_hi = 0xA0; /* irq's 13, 15 level-triggered */
break;
case 0xd5:
Motherboard_map_name = "IBM 43P-140 (Tiger1)";
Motherboard_map = ibm43p_pci_IRQ_map;
Motherboard_routes = ibm43p_pci_IRQ_routes;
Motherboard_non0 = ibm43p_pci_map_non0;
irq_edge_mask_lo = 0x00; /* irq's 0-7 all edge-triggered */
irq_edge_mask_hi = 0xA0; /* irq's 13, 15 level-triggered */
break;
default:
printk(KERN_ERR "Unknown IBM motherboard! Defaulting to Carolina.\n");
case 0xf0: /* PowerSeries 830/850 */
case 0xf1: /* PowerSeries 830/850 */
case 0xf2: /* PowerSeries 830/850 */
case 0xf4: /* 7248-43P */
case 0xf5: /* 7248-43P */
case 0xf6: /* 7248-43P */
case 0xf7: /* 7248-43P (missing from Carolina Tech Spec) */
Motherboard_map_name = "IBM PS830/PS850/7248 (Carolina)";
Motherboard_map = ibm8xx_pci_IRQ_map;
Motherboard_routes = ibm8xx_pci_IRQ_routes;
irq_edge_mask_lo = 0x00; /* irq's 0-7 all edge-triggered */
irq_edge_mask_hi = 0xA4; /* irq's 10, 13, 15 level-triggered */
break;
}
setup_ibm_pci(&irq_edge_mask_lo, &irq_edge_mask_hi);
outb(inb(0x04d0)|irq_edge_mask_lo, 0x04d0); /* primary 8259 */
outb(inb(0x04d1)|irq_edge_mask_hi, 0x04d1); /* cascaded 8259 */
outb(inb(0x04d0)|irq_edge_mask_lo, 0x4d0); /* primary 8259 */
outb(inb(0x04d1)|irq_edge_mask_hi, 0x4d1); /* cascaded 8259 */
} else {
printk("No known machine pci routing!\n");
return;
......@@ -1151,7 +1174,6 @@ prep_pcibios_fixup(void)
struct pci_dev *dev;
extern unsigned char *Motherboard_map;
extern unsigned char *Motherboard_routes;
unsigned char i;
prep_route_pci_interrupts();
......@@ -1182,38 +1204,6 @@ prep_pcibios_fixup(void)
*/
unsigned char d = PCI_SLOT(dev->devfn);
dev->irq = Motherboard_routes[Motherboard_map[d]];
for ( i = 0 ; i <= 5 ; i++ ) {
/*
* Relocate PCI I/O resources if necessary so the
* standard 256MB BAT covers them.
*/
if ( (pci_resource_flags(dev, i) & IORESOURCE_IO) &&
(dev->resource[i].start > 0x10000000)) {
printk("Relocating PCI address %lx -> %lx\n",
dev->resource[i].start,
(dev->resource[i].start &
0x00FFFFFF)| 0x01000000);
dev->resource[i].start =
(dev->resource[i].start & 0x00FFFFFF)
| 0x01000000;
pci_write_config_dword(dev,
PCI_BASE_ADDRESS_0 + (i*0x4),
dev->resource[i].start);
dev->resource[i].end =
(dev->resource[i].end & 0x00FFFFFF)
| 0x01000000;
}
}
#if 0
/*
* If we have residual data and if it knows about this
* device ask it what the irq is.
* -- Cort
*/
ppcd = residual_find_device_id( ~0L, dev->device,
-1,-1,-1, 0);
#endif
}
}
......@@ -1270,9 +1260,8 @@ prep_find_bridges(void)
prep_init_resource(&hose->io_resource, 0, 0x007fffff, IORESOURCE_IO);
prep_init_resource(&hose->mem_resources[0], 0xc0000000, 0xfeffffff,
IORESOURCE_MEM);
/* XXX why can't we use the indirect config space access method? */
hose->cfg_data = ioremap(PREP_ISA_IO_BASE + 0x800000, 0x800000);
hose->ops = &prep_pci_ops;
setup_indirect_pci(hose, PREP_ISA_IO_BASE + 0xcf8,
PREP_ISA_IO_BASE + 0xcfc);
printk("PReP architecture\n");
#ifdef CONFIG_PREP_RESIDUAL
......
This diff is collapsed.
......@@ -41,7 +41,7 @@
#include <asm/pci-bridge.h>
#include <platforms/spruce.h>
#include "cpc700.h"
#include <syslib/cpc700.h>
static inline int
spruce_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
......
......@@ -57,7 +57,7 @@
#include <asm/todc.h>
#include <asm/bootinfo.h>
#include "cpc700.h"
#include <syslib/cpc700.h>
extern void spruce_init_IRQ(void);
extern int spruce_get_irq(struct pt_regs *);
......@@ -185,8 +185,6 @@ spruce_halt(void)
spruce_restart(NULL);
}
extern int boot_mem_size;
static void __init
spruce_map_io(void)
{
......
#
# Makefile for the linux kernel.
#
ifdef CONFIG_PPC64BRIDGE
EXTRA_AFLAGS := -Wa,-mppc64bridge
endif
ifdef CONFIG_4xx
EXTRA_AFLAGS := -Wa,-m405
endif
CFLAGS_prom_init.o += -mrelocatable-lib
CFLAGS_btext.o += -mrelocatable-lib
obj-$(CONFIG_PPCBUG_NVRAM) += prep_nvram.o
ifeq ($(CONFIG_4xx),y)
obj-$(CONFIG_4xx) += ppc4xx_setup.o ppc4xx_pic.o ppc4xx_serial.o
obj-$(CONFIG_PPC_RTC) += todc_time.o
obj-$(CONFIG_KGDB) += ppc4xx_kgdb.o
obj-$(CONFIG_405_DMA) += ppc405_dma.o
obj-$(CONFIG_PCI) += ppc405_pci.o indirect_pci.o pci_auto.o
obj-$(CONFIG_PM) += ppc4xx_pm.o
endif
obj-$(CONFIG_8xx) += m8xx_setup.o ppc8xx_pic.o
ifeq ($(CONFIG_8xx),y)
obj-$(CONFIG_PCI) += qspan_pci.o i8259.o
endif
obj-$(CONFIG_ALL_PPC) += prom_init.o prom.o open_pic.o \
indirect_pci.o i8259.o
obj-$(CONFIG_ADIR) += i8259.o indirect_pci.o pci_auto.o \
todc_time.o
obj-$(CONFIG_EV64260) += gt64260_common.o gt64260_pic.o \
indirect_pci.o todc_time.o pci_auto.o
obj-$(CONFIG_GEMINI) += open_pic.o i8259.o indirect_pci.o
obj-$(CONFIG_K2) += i8259.o indirect_pci.o todc_time.o \
pci_auto.o
obj-$(CONFIG_LOPEC) += mpc10x_common.o indirect_pci.o pci_auto.o \
open_pic.o i8259.o todc_time.o
obj-$(CONFIG_MCPN765) += todc_time.o indirect_pci.o pci_auto.o \
open_pic.o i8259.o pplus_common.o
obj-$(CONFIG_MENF1) += todc_time.o i8259.o mpc10x_common.o \
pci_auto.o indirect_pci.o
obj-$(CONFIG_MVME5100) += open_pic.o todc_time.o indirect_pci.o \
i8259.o pci_auto.o pplus_common.o
obj-$(CONFIG_PAL4) += cpc700_pic.o
obj-$(CONFIG_PCORE) += mpc10x_common.o todc_time.o i8259.o \
indirect_pci.o pci_auto.o
obj-$(CONFIG_POWERPMC250) += open_pic.o mpc10x_common.o \
indirect_pci.o pci_auto.o
obj-$(CONFIG_PPLUS) += pplus_common.o open_pic.o i8259.o \
indirect_pci.o todc_time.o pci_auto.o
obj-$(CONFIG_PRPMC750) += open_pic.o indirect_pci.o pci_auto.o \
pplus_common.o
obj-$(CONFIG_PRPMC800) += open_pic.o indirect_pci.o pci_auto.o \
pplus_common.o harrier.o
obj-$(CONFIG_SANDPOINT) += i8259.o open_pic.o mpc10x_common.o \
pci_auto.o indirect_pci.o todc_time.o
obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \
todc_time.o
obj-$(CONFIG_ZX4500) += indirect_pci.o pci_auto.o mpc10x_common.o \
i8259.o open_pic.o
obj-$(CONFIG_8260) += m8260_setup.o ppc8260_pic.o
obj-$(CONFIG_BOOTX_TEXT) += btext.o
include $(TOPDIR)/Rules.make
find_name : find_name.c
$(HOSTCC) $(HOSTCFLAGS) -o find_name find_name.c
......@@ -38,7 +38,7 @@
#include <linux/init.h>
#include <asm/ibm4xx.h>
#include <asm/pci-bridge.h>
#include <platforms/ibm_ocp.h>
#include <platforms/4xx/ibm_ocp.h>
#ifdef CONFIG_DEBUG_BRINGUP
#define DBG(x...) printk(x)
......
......@@ -14,7 +14,7 @@
#define LSR_TEMT 0x40 /* Xmitter empty */
#define LSR_ERR 0x80 /* Error */
#include <platforms/ibm_ocp.h>
#include <platforms/4xx/ibm_ocp.h>
extern struct NS16550* COM_PORTS[];
#ifndef NULL
......
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.
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.
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