Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
This commit is contained in:
commit
1d9564ea0a
446 changed files with 9563 additions and 5631 deletions
|
@ -480,7 +480,7 @@ r2 argument 0 / return value 0 call-clobbered
|
||||||
r3 argument 1 / return value 1 (if long long) call-clobbered
|
r3 argument 1 / return value 1 (if long long) call-clobbered
|
||||||
r4 argument 2 call-clobbered
|
r4 argument 2 call-clobbered
|
||||||
r5 argument 3 call-clobbered
|
r5 argument 3 call-clobbered
|
||||||
r6 argument 5 saved
|
r6 argument 4 saved
|
||||||
r7 pointer-to arguments 5 to ... saved
|
r7 pointer-to arguments 5 to ... saved
|
||||||
r8 this & that saved
|
r8 this & that saved
|
||||||
r9 this & that saved
|
r9 this & that saved
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Linux Magic System Request Key Hacks
|
Linux Magic System Request Key Hacks
|
||||||
Documentation for sysrq.c version 1.15
|
Documentation for sysrq.c
|
||||||
Last update: $Date: 2001/01/28 10:15:59 $
|
Last update: 2007-JAN-06
|
||||||
|
|
||||||
* What is the magic SysRq key?
|
* What is the magic SysRq key?
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -35,7 +35,7 @@ You can set the value in the file by the following command:
|
||||||
|
|
||||||
Note that the value of /proc/sys/kernel/sysrq influences only the invocation
|
Note that the value of /proc/sys/kernel/sysrq influences only the invocation
|
||||||
via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
|
via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
|
||||||
allowed.
|
allowed (by a user with admin privileges).
|
||||||
|
|
||||||
* How do I use the magic SysRq key?
|
* How do I use the magic SysRq key?
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -58,7 +58,7 @@ On PowerPC - Press 'ALT - Print Screen (or F13) - <command key>,
|
||||||
On other - If you know of the key combos for other architectures, please
|
On other - If you know of the key combos for other architectures, please
|
||||||
let me know so I can add them to this section.
|
let me know so I can add them to this section.
|
||||||
|
|
||||||
On all - write a character to /proc/sysrq-trigger. eg:
|
On all - write a character to /proc/sysrq-trigger. e.g.:
|
||||||
|
|
||||||
echo t > /proc/sysrq-trigger
|
echo t > /proc/sysrq-trigger
|
||||||
|
|
||||||
|
@ -74,6 +74,8 @@ On all - write a character to /proc/sysrq-trigger. eg:
|
||||||
|
|
||||||
'c' - Will perform a kexec reboot in order to take a crashdump.
|
'c' - Will perform a kexec reboot in order to take a crashdump.
|
||||||
|
|
||||||
|
'd' - Shows all locks that are held.
|
||||||
|
|
||||||
'o' - Will shut your system off (if configured and supported).
|
'o' - Will shut your system off (if configured and supported).
|
||||||
|
|
||||||
's' - Will attempt to sync all mounted filesystems.
|
's' - Will attempt to sync all mounted filesystems.
|
||||||
|
@ -87,21 +89,26 @@ On all - write a character to /proc/sysrq-trigger. eg:
|
||||||
|
|
||||||
'm' - Will dump current memory info to your console.
|
'm' - Will dump current memory info to your console.
|
||||||
|
|
||||||
|
'n' - Used to make RT tasks nice-able
|
||||||
|
|
||||||
'v' - Dumps Voyager SMP processor info to your console.
|
'v' - Dumps Voyager SMP processor info to your console.
|
||||||
|
|
||||||
|
'w' - Dumps tasks that are in uninterruptable (blocked) state.
|
||||||
|
|
||||||
|
'x' - Used by xmon interface on ppc/powerpc platforms.
|
||||||
|
|
||||||
'0'-'9' - Sets the console log level, controlling which kernel messages
|
'0'-'9' - Sets the console log level, controlling which kernel messages
|
||||||
will be printed to your console. ('0', for example would make
|
will be printed to your console. ('0', for example would make
|
||||||
it so that only emergency messages like PANICs or OOPSes would
|
it so that only emergency messages like PANICs or OOPSes would
|
||||||
make it to your console.)
|
make it to your console.)
|
||||||
|
|
||||||
'f' - Will call oom_kill to kill a memory hog process
|
'f' - Will call oom_kill to kill a memory hog process.
|
||||||
|
|
||||||
'e' - Send a SIGTERM to all processes, except for init.
|
'e' - Send a SIGTERM to all processes, except for init.
|
||||||
|
|
||||||
'i' - Send a SIGKILL to all processes, except for init.
|
'g' - Used by kgdb on ppc platforms.
|
||||||
|
|
||||||
'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system
|
'i' - Send a SIGKILL to all processes, except for init.
|
||||||
will be non-functional after this.)
|
|
||||||
|
|
||||||
'h' - Will display help (actually any other key than those listed
|
'h' - Will display help (actually any other key than those listed
|
||||||
above will display help. but 'h' is easy to remember :-)
|
above will display help. but 'h' is easy to remember :-)
|
||||||
|
@ -110,15 +117,15 @@ On all - write a character to /proc/sysrq-trigger. eg:
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Well, un'R'aw is very handy when your X server or a svgalib program crashes.
|
Well, un'R'aw is very handy when your X server or a svgalib program crashes.
|
||||||
|
|
||||||
sa'K' (Secure Access Key) is useful when you want to be sure there are no
|
sa'K' (Secure Access Key) is useful when you want to be sure there is no
|
||||||
trojan program is running at console and which could grab your password
|
trojan program running at console which could grab your password
|
||||||
when you would try to login. It will kill all programs on given console
|
when you would try to login. It will kill all programs on given console,
|
||||||
and thus letting you make sure that the login prompt you see is actually
|
thus letting you make sure that the login prompt you see is actually
|
||||||
the one from init, not some trojan program.
|
the one from init, not some trojan program.
|
||||||
IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT
|
IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT
|
||||||
IMPORTANT: c2 compliant system, and it should not be mistaken as :IMPORTANT
|
IMPORTANT: c2 compliant system, and it should not be mistaken as :IMPORTANT
|
||||||
IMPORTANT: such. :IMPORTANT
|
IMPORTANT: such. :IMPORTANT
|
||||||
It seems other find it useful as (System Attention Key) which is
|
It seems others find it useful as (System Attention Key) which is
|
||||||
useful when you want to exit a program that will not let you switch consoles.
|
useful when you want to exit a program that will not let you switch consoles.
|
||||||
(For example, X or a svgalib program.)
|
(For example, X or a svgalib program.)
|
||||||
|
|
||||||
|
@ -139,8 +146,8 @@ OK or Done message...)
|
||||||
Again, the unmount (remount read-only) hasn't taken place until you see the
|
Again, the unmount (remount read-only) hasn't taken place until you see the
|
||||||
"OK" and "Done" message appear on the screen.
|
"OK" and "Done" message appear on the screen.
|
||||||
|
|
||||||
The loglevel'0'-'9' is useful when your console is being flooded with
|
The loglevels '0'-'9' are useful when your console is being flooded with
|
||||||
kernel messages you do not want to see. Setting '0' will prevent all but
|
kernel messages you do not want to see. Selecting '0' will prevent all but
|
||||||
the most urgent kernel messages from reaching your console. (They will
|
the most urgent kernel messages from reaching your console. (They will
|
||||||
still be logged if syslogd/klogd are alive, though.)
|
still be logged if syslogd/klogd are alive, though.)
|
||||||
|
|
||||||
|
@ -152,7 +159,7 @@ processes.
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
That happens to me, also. I've found that tapping shift, alt, and control
|
That happens to me, also. I've found that tapping shift, alt, and control
|
||||||
on both sides of the keyboard, and hitting an invalid sysrq sequence again
|
on both sides of the keyboard, and hitting an invalid sysrq sequence again
|
||||||
will fix the problem. (ie, something like alt-sysrq-z). Switching to another
|
will fix the problem. (i.e., something like alt-sysrq-z). Switching to another
|
||||||
virtual console (ALT+Fn) and then back again should also help.
|
virtual console (ALT+Fn) and then back again should also help.
|
||||||
|
|
||||||
* I hit SysRq, but nothing seems to happen, what's wrong?
|
* I hit SysRq, but nothing seems to happen, what's wrong?
|
||||||
|
@ -174,11 +181,11 @@ handler function you will use, B) a help_msg string, that will print when SysRQ
|
||||||
prints help, and C) an action_msg string, that will print right before your
|
prints help, and C) an action_msg string, that will print right before your
|
||||||
handler is called. Your handler must conform to the prototype in 'sysrq.h'.
|
handler is called. Your handler must conform to the prototype in 'sysrq.h'.
|
||||||
|
|
||||||
After the sysrq_key_op is created, you can call the macro
|
After the sysrq_key_op is created, you can call the kernel function
|
||||||
register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in
|
register_sysrq_key(int key, struct sysrq_key_op *op_p); this will
|
||||||
sysrq.h, this will register the operation pointed to by 'op_p' at table
|
register the operation pointed to by 'op_p' at table key 'key',
|
||||||
key 'key', if that slot in the table is blank. At module unload time, you must
|
if that slot in the table is blank. At module unload time, you must call
|
||||||
call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
|
the function unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
|
||||||
will remove the key op pointed to by 'op_p' from the key 'key', if and only if
|
will remove the key op pointed to by 'op_p' from the key 'key', if and only if
|
||||||
it is currently registered in that slot. This is in case the slot has been
|
it is currently registered in that slot. This is in case the slot has been
|
||||||
overwritten since you registered it.
|
overwritten since you registered it.
|
||||||
|
@ -186,15 +193,12 @@ overwritten since you registered it.
|
||||||
The Magic SysRQ system works by registering key operations against a key op
|
The Magic SysRQ system works by registering key operations against a key op
|
||||||
lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has
|
lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has
|
||||||
a number of operations registered into it at compile time, but is mutable,
|
a number of operations registered into it at compile time, but is mutable,
|
||||||
and 4 functions are exported for interface to it: __sysrq_lock_table,
|
and 2 functions are exported for interface to it:
|
||||||
__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The
|
register_sysrq_key and unregister_sysrq_key.
|
||||||
functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined
|
Of course, never ever leave an invalid pointer in the table. I.e., when
|
||||||
in the header itself, and the REGISTER and UNREGISTER macros are built from
|
your module that called register_sysrq_key() exits, it must call
|
||||||
these. More complex (and dangerous!) manipulations of the table are possible
|
unregister_sysrq_key() to clean up the sysrq key table entry that it used.
|
||||||
using these functions, but you must be careful to always lock the table before
|
Null pointers in the table are always safe. :)
|
||||||
you read or write from it, and to unlock it again when you are done. (And of
|
|
||||||
course, to never ever leave an invalid pointer in the table). Null pointers in
|
|
||||||
the table are always safe :)
|
|
||||||
|
|
||||||
If for some reason you feel the need to call the handle_sysrq function from
|
If for some reason you feel the need to call the handle_sysrq function from
|
||||||
within a function called by handle_sysrq, you must be aware that you are in
|
within a function called by handle_sysrq, you must be aware that you are in
|
||||||
|
|
20
MAINTAINERS
20
MAINTAINERS
|
@ -598,8 +598,6 @@ W: http://linux-atm.sourceforge.net
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
ATMEL MACB ETHERNET DRIVER
|
ATMEL MACB ETHERNET DRIVER
|
||||||
P: Atmel AVR32 Support Team
|
|
||||||
M: avr32@atmel.com
|
|
||||||
P: Haavard Skinnemoen
|
P: Haavard Skinnemoen
|
||||||
M: hskinnemoen@atmel.com
|
M: hskinnemoen@atmel.com
|
||||||
S: Supported
|
S: Supported
|
||||||
|
@ -620,8 +618,6 @@ T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
AVR32 ARCHITECTURE
|
AVR32 ARCHITECTURE
|
||||||
P: Atmel AVR32 Support Team
|
|
||||||
M: avr32@atmel.com
|
|
||||||
P: Haavard Skinnemoen
|
P: Haavard Skinnemoen
|
||||||
M: hskinnemoen@atmel.com
|
M: hskinnemoen@atmel.com
|
||||||
W: http://www.atmel.com/products/AVR32/
|
W: http://www.atmel.com/products/AVR32/
|
||||||
|
@ -630,8 +626,6 @@ W: http://avrfreaks.net/
|
||||||
S: Supported
|
S: Supported
|
||||||
|
|
||||||
AVR32/AT32AP MACHINE SUPPORT
|
AVR32/AT32AP MACHINE SUPPORT
|
||||||
P: Atmel AVR32 Support Team
|
|
||||||
M: avr32@atmel.com
|
|
||||||
P: Haavard Skinnemoen
|
P: Haavard Skinnemoen
|
||||||
M: hskinnemoen@atmel.com
|
M: hskinnemoen@atmel.com
|
||||||
S: Supported
|
S: Supported
|
||||||
|
@ -2797,7 +2791,7 @@ M: schwidefsky@de.ibm.com
|
||||||
P: Heiko Carstens
|
P: Heiko Carstens
|
||||||
M: heiko.carstens@de.ibm.com
|
M: heiko.carstens@de.ibm.com
|
||||||
M: linux390@de.ibm.com
|
M: linux390@de.ibm.com
|
||||||
L: linux-390@vm.marist.edu
|
L: linux-s390@vger.kernel.org
|
||||||
W: http://www.ibm.com/developerworks/linux/linux390/
|
W: http://www.ibm.com/developerworks/linux/linux390/
|
||||||
S: Supported
|
S: Supported
|
||||||
|
|
||||||
|
@ -2805,7 +2799,7 @@ S390 NETWORK DRIVERS
|
||||||
P: Frank Pavlic
|
P: Frank Pavlic
|
||||||
M: fpavlic@de.ibm.com
|
M: fpavlic@de.ibm.com
|
||||||
M: linux390@de.ibm.com
|
M: linux390@de.ibm.com
|
||||||
L: linux-390@vm.marist.edu
|
L: linux-s390@vger.kernel.org
|
||||||
W: http://www.ibm.com/developerworks/linux/linux390/
|
W: http://www.ibm.com/developerworks/linux/linux390/
|
||||||
S: Supported
|
S: Supported
|
||||||
|
|
||||||
|
@ -2813,7 +2807,7 @@ S390 ZFCP DRIVER
|
||||||
P: Swen Schillig
|
P: Swen Schillig
|
||||||
M: swen@vnet.ibm.com
|
M: swen@vnet.ibm.com
|
||||||
M: linux390@de.ibm.com
|
M: linux390@de.ibm.com
|
||||||
L: linux-390@vm.marist.edu
|
L: linux-s390@vger.kernel.org
|
||||||
W: http://www.ibm.com/developerworks/linux/linux390/
|
W: http://www.ibm.com/developerworks/linux/linux390/
|
||||||
S: Supported
|
S: Supported
|
||||||
|
|
||||||
|
@ -3599,6 +3593,12 @@ M: ysato@users.sourceforge.jp
|
||||||
W: http://uclinux-h8.sourceforge.jp/
|
W: http://uclinux-h8.sourceforge.jp/
|
||||||
S: Supported
|
S: Supported
|
||||||
|
|
||||||
|
UFS FILESYSTEM
|
||||||
|
P: Evgeniy Dushistov
|
||||||
|
M: dushistov@mail.ru
|
||||||
|
L: linux-kernel@vger.kernel.org
|
||||||
|
S: Maintained
|
||||||
|
|
||||||
USB DIAMOND RIO500 DRIVER
|
USB DIAMOND RIO500 DRIVER
|
||||||
P: Cesar Miquel
|
P: Cesar Miquel
|
||||||
M: miquel@df.uba.ar
|
M: miquel@df.uba.ar
|
||||||
|
@ -3647,7 +3647,7 @@ S: Maintained
|
||||||
W83L51xD SD/MMC CARD INTERFACE DRIVER
|
W83L51xD SD/MMC CARD INTERFACE DRIVER
|
||||||
P: Pierre Ossman
|
P: Pierre Ossman
|
||||||
M: drzeus-wbsd@drzeus.cx
|
M: drzeus-wbsd@drzeus.cx
|
||||||
L: wbsd-devel@list.drzeus.cx
|
L: linux-kernel@vger.kernel.org
|
||||||
W: http://projects.drzeus.cx/wbsd
|
W: http://projects.drzeus.cx/wbsd
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
||||||
|
|
17
Makefile
17
Makefile
|
@ -1,7 +1,7 @@
|
||||||
VERSION = 2
|
VERSION = 2
|
||||||
PATCHLEVEL = 6
|
PATCHLEVEL = 6
|
||||||
SUBLEVEL = 20
|
SUBLEVEL = 20
|
||||||
EXTRAVERSION =-rc7
|
EXTRAVERSION =
|
||||||
NAME = Homicidal Dwarf Hamster
|
NAME = Homicidal Dwarf Hamster
|
||||||
|
|
||||||
# *DOCUMENTATION*
|
# *DOCUMENTATION*
|
||||||
|
@ -776,7 +776,7 @@ $(vmlinux-dirs): prepare scripts
|
||||||
# $(EXTRAVERSION) eg, -rc6
|
# $(EXTRAVERSION) eg, -rc6
|
||||||
# $(localver-full)
|
# $(localver-full)
|
||||||
# $(localver)
|
# $(localver)
|
||||||
# localversion* (all localversion* files)
|
# localversion* (files without backups, containing '~')
|
||||||
# $(CONFIG_LOCALVERSION) (from kernel config setting)
|
# $(CONFIG_LOCALVERSION) (from kernel config setting)
|
||||||
# $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set)
|
# $(localver-auto) (only if CONFIG_LOCALVERSION_AUTO is set)
|
||||||
# ./scripts/setlocalversion (SCM tag, if one exists)
|
# ./scripts/setlocalversion (SCM tag, if one exists)
|
||||||
|
@ -787,16 +787,11 @@ $(vmlinux-dirs): prepare scripts
|
||||||
# moment, only git is supported but other SCMs can edit the script
|
# moment, only git is supported but other SCMs can edit the script
|
||||||
# scripts/setlocalversion and add the appropriate checks as needed.
|
# scripts/setlocalversion and add the appropriate checks as needed.
|
||||||
|
|
||||||
nullstring :=
|
pattern = ".*/localversion[^~]*"
|
||||||
space := $(nullstring) # end of line
|
string = $(shell cat /dev/null \
|
||||||
|
`find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort`)
|
||||||
|
|
||||||
___localver = $(objtree)/localversion* $(srctree)/localversion*
|
localver = $(subst $(space),, $(string) \
|
||||||
__localver = $(sort $(wildcard $(___localver)))
|
|
||||||
# skip backup files (containing '~')
|
|
||||||
_localver = $(foreach f, $(__localver), $(if $(findstring ~, $(f)),,$(f)))
|
|
||||||
|
|
||||||
localver = $(subst $(space),, \
|
|
||||||
$(shell cat /dev/null $(_localver)) \
|
|
||||||
$(patsubst "%",%,$(CONFIG_LOCALVERSION)))
|
$(patsubst "%",%,$(CONFIG_LOCALVERSION)))
|
||||||
|
|
||||||
# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called
|
# If CONFIG_LOCALVERSION_AUTO is set scripts/setlocalversion is called
|
||||||
|
|
|
@ -43,6 +43,8 @@ static int is_safe_abs_reloc(const char* sym_name)
|
||||||
/* Match found */
|
/* Match found */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (strncmp(sym_name, "__crc_", 6) == 0)
|
||||||
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,7 @@ static void __cpuinit geode_configure(void)
|
||||||
ccr4 = getCx86(CX86_CCR4);
|
ccr4 = getCx86(CX86_CCR4);
|
||||||
ccr4 |= 0x38; /* FPU fast, DTE cache, Mem bypass */
|
ccr4 |= 0x38; /* FPU fast, DTE cache, Mem bypass */
|
||||||
|
|
||||||
setCx86(CX86_CCR4, ccr4);
|
setCx86(CX86_CCR3, ccr3);
|
||||||
|
|
||||||
set_cx86_memwb();
|
set_cx86_memwb();
|
||||||
set_cx86_reorder();
|
set_cx86_reorder();
|
||||||
|
|
|
@ -472,6 +472,70 @@ static inline void __init check_range_for_systab(efi_memory_desc_t *md)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Wrap all the virtual calls in a way that forces the parameters on the stack.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define efi_call_virt(f, args...) \
|
||||||
|
((efi_##f##_t __attribute__((regparm(0)))*)efi.systab->runtime->f)(args)
|
||||||
|
|
||||||
|
static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc)
|
||||||
|
{
|
||||||
|
return efi_call_virt(get_time, tm, tc);
|
||||||
|
}
|
||||||
|
|
||||||
|
static efi_status_t virt_efi_set_time (efi_time_t *tm)
|
||||||
|
{
|
||||||
|
return efi_call_virt(set_time, tm);
|
||||||
|
}
|
||||||
|
|
||||||
|
static efi_status_t virt_efi_get_wakeup_time (efi_bool_t *enabled,
|
||||||
|
efi_bool_t *pending,
|
||||||
|
efi_time_t *tm)
|
||||||
|
{
|
||||||
|
return efi_call_virt(get_wakeup_time, enabled, pending, tm);
|
||||||
|
}
|
||||||
|
|
||||||
|
static efi_status_t virt_efi_set_wakeup_time (efi_bool_t enabled,
|
||||||
|
efi_time_t *tm)
|
||||||
|
{
|
||||||
|
return efi_call_virt(set_wakeup_time, enabled, tm);
|
||||||
|
}
|
||||||
|
|
||||||
|
static efi_status_t virt_efi_get_variable (efi_char16_t *name,
|
||||||
|
efi_guid_t *vendor, u32 *attr,
|
||||||
|
unsigned long *data_size, void *data)
|
||||||
|
{
|
||||||
|
return efi_call_virt(get_variable, name, vendor, attr, data_size, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static efi_status_t virt_efi_get_next_variable (unsigned long *name_size,
|
||||||
|
efi_char16_t *name,
|
||||||
|
efi_guid_t *vendor)
|
||||||
|
{
|
||||||
|
return efi_call_virt(get_next_variable, name_size, name, vendor);
|
||||||
|
}
|
||||||
|
|
||||||
|
static efi_status_t virt_efi_set_variable (efi_char16_t *name,
|
||||||
|
efi_guid_t *vendor,
|
||||||
|
unsigned long attr,
|
||||||
|
unsigned long data_size, void *data)
|
||||||
|
{
|
||||||
|
return efi_call_virt(set_variable, name, vendor, attr, data_size, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static efi_status_t virt_efi_get_next_high_mono_count (u32 *count)
|
||||||
|
{
|
||||||
|
return efi_call_virt(get_next_high_mono_count, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void virt_efi_reset_system (int reset_type, efi_status_t status,
|
||||||
|
unsigned long data_size,
|
||||||
|
efi_char16_t *data)
|
||||||
|
{
|
||||||
|
efi_call_virt(reset_system, reset_type, status, data_size, data);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function will switch the EFI runtime services to virtual mode.
|
* This function will switch the EFI runtime services to virtual mode.
|
||||||
* Essentially, look through the EFI memmap and map every region that
|
* Essentially, look through the EFI memmap and map every region that
|
||||||
|
@ -525,22 +589,15 @@ void __init efi_enter_virtual_mode(void)
|
||||||
* pointers in the runtime service table to the new virtual addresses.
|
* pointers in the runtime service table to the new virtual addresses.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
efi.get_time = (efi_get_time_t *) efi.systab->runtime->get_time;
|
efi.get_time = virt_efi_get_time;
|
||||||
efi.set_time = (efi_set_time_t *) efi.systab->runtime->set_time;
|
efi.set_time = virt_efi_set_time;
|
||||||
efi.get_wakeup_time = (efi_get_wakeup_time_t *)
|
efi.get_wakeup_time = virt_efi_get_wakeup_time;
|
||||||
efi.systab->runtime->get_wakeup_time;
|
efi.set_wakeup_time = virt_efi_set_wakeup_time;
|
||||||
efi.set_wakeup_time = (efi_set_wakeup_time_t *)
|
efi.get_variable = virt_efi_get_variable;
|
||||||
efi.systab->runtime->set_wakeup_time;
|
efi.get_next_variable = virt_efi_get_next_variable;
|
||||||
efi.get_variable = (efi_get_variable_t *)
|
efi.set_variable = virt_efi_set_variable;
|
||||||
efi.systab->runtime->get_variable;
|
efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count;
|
||||||
efi.get_next_variable = (efi_get_next_variable_t *)
|
efi.reset_system = virt_efi_reset_system;
|
||||||
efi.systab->runtime->get_next_variable;
|
|
||||||
efi.set_variable = (efi_set_variable_t *)
|
|
||||||
efi.systab->runtime->set_variable;
|
|
||||||
efi.get_next_high_mono_count = (efi_get_next_high_mono_count_t *)
|
|
||||||
efi.systab->runtime->get_next_high_mono_count;
|
|
||||||
efi.reset_system = (efi_reset_system_t *)
|
|
||||||
efi.systab->runtime->reset_system;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init
|
void __init
|
||||||
|
|
|
@ -102,7 +102,7 @@ void __init time_init_hook(void)
|
||||||
* along the MCA bus. Use this to hook into that chain if you will need
|
* along the MCA bus. Use this to hook into that chain if you will need
|
||||||
* it.
|
* it.
|
||||||
**/
|
**/
|
||||||
void __init mca_nmi_hook(void)
|
void mca_nmi_hook(void)
|
||||||
{
|
{
|
||||||
/* If I recall correctly, there's a whole bunch of other things that
|
/* If I recall correctly, there's a whole bunch of other things that
|
||||||
* we can do to check for NMI problems, but that's all I know about
|
* we can do to check for NMI problems, but that's all I know about
|
||||||
|
|
|
@ -609,6 +609,9 @@ EXPORT_SYMBOL(acpi_register_gsi);
|
||||||
|
|
||||||
void acpi_unregister_gsi(u32 gsi)
|
void acpi_unregister_gsi(u32 gsi)
|
||||||
{
|
{
|
||||||
|
if (acpi_irq_model == ACPI_IRQ_MODEL_PLATFORM)
|
||||||
|
return;
|
||||||
|
|
||||||
iosapic_unregister_intr(gsi);
|
iosapic_unregister_intr(gsi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,6 +122,9 @@ static void migrate_irqs(void)
|
||||||
for (irq=0; irq < NR_IRQS; irq++) {
|
for (irq=0; irq < NR_IRQS; irq++) {
|
||||||
desc = irq_desc + irq;
|
desc = irq_desc + irq;
|
||||||
|
|
||||||
|
if (desc->status == IRQ_DISABLED)
|
||||||
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* No handling for now.
|
* No handling for now.
|
||||||
* TBD: Implement a disable function so we can now
|
* TBD: Implement a disable function so we can now
|
||||||
|
|
|
@ -575,6 +575,7 @@ config SGI_IP27
|
||||||
select DMA_IP27
|
select DMA_IP27
|
||||||
select EARLY_PRINTK
|
select EARLY_PRINTK
|
||||||
select HW_HAS_PCI
|
select HW_HAS_PCI
|
||||||
|
select NR_CPUS_DEFAULT_64
|
||||||
select PCI_DOMAINS
|
select PCI_DOMAINS
|
||||||
select SYS_HAS_CPU_R10000
|
select SYS_HAS_CPU_R10000
|
||||||
select SYS_SUPPORTS_64BIT_KERNEL
|
select SYS_SUPPORTS_64BIT_KERNEL
|
||||||
|
@ -612,6 +613,7 @@ config SIBYTE_BIGSUR
|
||||||
bool "Sibyte BCM91480B-BigSur"
|
bool "Sibyte BCM91480B-BigSur"
|
||||||
select BOOT_ELF32
|
select BOOT_ELF32
|
||||||
select DMA_COHERENT
|
select DMA_COHERENT
|
||||||
|
select NR_CPUS_DEFAULT_4
|
||||||
select PCI_DOMAINS
|
select PCI_DOMAINS
|
||||||
select SIBYTE_BCM1x80
|
select SIBYTE_BCM1x80
|
||||||
select SWAP_IO_SPACE
|
select SWAP_IO_SPACE
|
||||||
|
@ -623,6 +625,7 @@ config SIBYTE_SWARM
|
||||||
bool "Sibyte BCM91250A-SWARM"
|
bool "Sibyte BCM91250A-SWARM"
|
||||||
select BOOT_ELF32
|
select BOOT_ELF32
|
||||||
select DMA_COHERENT
|
select DMA_COHERENT
|
||||||
|
select NR_CPUS_DEFAULT_2
|
||||||
select SIBYTE_SB1250
|
select SIBYTE_SB1250
|
||||||
select SWAP_IO_SPACE
|
select SWAP_IO_SPACE
|
||||||
select SYS_HAS_CPU_SB1
|
select SYS_HAS_CPU_SB1
|
||||||
|
@ -635,6 +638,7 @@ config SIBYTE_SENTOSA
|
||||||
depends on EXPERIMENTAL
|
depends on EXPERIMENTAL
|
||||||
select BOOT_ELF32
|
select BOOT_ELF32
|
||||||
select DMA_COHERENT
|
select DMA_COHERENT
|
||||||
|
select NR_CPUS_DEFAULT_2
|
||||||
select SIBYTE_SB1250
|
select SIBYTE_SB1250
|
||||||
select SWAP_IO_SPACE
|
select SWAP_IO_SPACE
|
||||||
select SYS_HAS_CPU_SB1
|
select SYS_HAS_CPU_SB1
|
||||||
|
@ -668,6 +672,7 @@ config SIBYTE_PTSWARM
|
||||||
depends on EXPERIMENTAL
|
depends on EXPERIMENTAL
|
||||||
select BOOT_ELF32
|
select BOOT_ELF32
|
||||||
select DMA_COHERENT
|
select DMA_COHERENT
|
||||||
|
select NR_CPUS_DEFAULT_2
|
||||||
select SIBYTE_SB1250
|
select SIBYTE_SB1250
|
||||||
select SWAP_IO_SPACE
|
select SWAP_IO_SPACE
|
||||||
select SYS_HAS_CPU_SB1
|
select SYS_HAS_CPU_SB1
|
||||||
|
@ -680,6 +685,7 @@ config SIBYTE_LITTLESUR
|
||||||
depends on EXPERIMENTAL
|
depends on EXPERIMENTAL
|
||||||
select BOOT_ELF32
|
select BOOT_ELF32
|
||||||
select DMA_COHERENT
|
select DMA_COHERENT
|
||||||
|
select NR_CPUS_DEFAULT_2
|
||||||
select SIBYTE_SB1250
|
select SIBYTE_SB1250
|
||||||
select SWAP_IO_SPACE
|
select SWAP_IO_SPACE
|
||||||
select SYS_HAS_CPU_SB1
|
select SYS_HAS_CPU_SB1
|
||||||
|
@ -790,23 +796,6 @@ config TOSHIBA_RBTX4938
|
||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config KEXEC
|
|
||||||
bool "Kexec system call (EXPERIMENTAL)"
|
|
||||||
depends on EXPERIMENTAL
|
|
||||||
help
|
|
||||||
kexec is a system call that implements the ability to shutdown your
|
|
||||||
current kernel, and to start another kernel. It is like a reboot
|
|
||||||
but it is indepedent of the system firmware. And like a reboot
|
|
||||||
you can start any kernel with it, not just Linux.
|
|
||||||
|
|
||||||
The name comes from the similiarity to the exec system call.
|
|
||||||
|
|
||||||
It is an ongoing process to be certain the hardware in a machine
|
|
||||||
is properly shutdown, so do not be surprised if this code does not
|
|
||||||
initially work for you. It may help to enable device hotplugging
|
|
||||||
support. As of this writing the exact hardware interface is
|
|
||||||
strongly in flux, so no good recommendation can be made.
|
|
||||||
|
|
||||||
source "arch/mips/ddb5xxx/Kconfig"
|
source "arch/mips/ddb5xxx/Kconfig"
|
||||||
source "arch/mips/gt64120/ev64120/Kconfig"
|
source "arch/mips/gt64120/ev64120/Kconfig"
|
||||||
source "arch/mips/jazz/Kconfig"
|
source "arch/mips/jazz/Kconfig"
|
||||||
|
@ -1541,6 +1530,8 @@ config MIPS_MT_SMTC
|
||||||
select CPU_MIPSR2_IRQ_VI
|
select CPU_MIPSR2_IRQ_VI
|
||||||
select CPU_MIPSR2_SRS
|
select CPU_MIPSR2_SRS
|
||||||
select MIPS_MT
|
select MIPS_MT
|
||||||
|
select NR_CPUS_DEFAULT_2
|
||||||
|
select NR_CPUS_DEFAULT_8
|
||||||
select SMP
|
select SMP
|
||||||
select SYS_SUPPORTS_SMP
|
select SYS_SUPPORTS_SMP
|
||||||
help
|
help
|
||||||
|
@ -1756,13 +1747,34 @@ config SMP
|
||||||
config SYS_SUPPORTS_SMP
|
config SYS_SUPPORTS_SMP
|
||||||
bool
|
bool
|
||||||
|
|
||||||
|
config NR_CPUS_DEFAULT_2
|
||||||
|
bool
|
||||||
|
|
||||||
|
config NR_CPUS_DEFAULT_4
|
||||||
|
bool
|
||||||
|
|
||||||
|
config NR_CPUS_DEFAULT_8
|
||||||
|
bool
|
||||||
|
|
||||||
|
config NR_CPUS_DEFAULT_16
|
||||||
|
bool
|
||||||
|
|
||||||
|
config NR_CPUS_DEFAULT_32
|
||||||
|
bool
|
||||||
|
|
||||||
|
config NR_CPUS_DEFAULT_64
|
||||||
|
bool
|
||||||
|
|
||||||
config NR_CPUS
|
config NR_CPUS
|
||||||
int "Maximum number of CPUs (2-64)"
|
int "Maximum number of CPUs (2-64)"
|
||||||
range 2 64
|
range 2 64
|
||||||
depends on SMP
|
depends on SMP
|
||||||
default "64" if SGI_IP27
|
default "2" if NR_CPUS_DEFAULT_2
|
||||||
default "2"
|
default "4" if NR_CPUS_DEFAULT_4
|
||||||
default "8" if MIPS_MT_SMTC
|
default "8" if NR_CPUS_DEFAULT_8
|
||||||
|
default "16" if NR_CPUS_DEFAULT_16
|
||||||
|
default "32" if NR_CPUS_DEFAULT_32
|
||||||
|
default "64" if NR_CPUS_DEFAULT_64
|
||||||
help
|
help
|
||||||
This allows you to specify the maximum number of CPUs which this
|
This allows you to specify the maximum number of CPUs which this
|
||||||
kernel will support. The maximum supported value is 32 for 32-bit
|
kernel will support. The maximum supported value is 32 for 32-bit
|
||||||
|
@ -1859,6 +1871,40 @@ config MIPS_INSANE_LARGE
|
||||||
This will result in additional memory usage, so it is not
|
This will result in additional memory usage, so it is not
|
||||||
recommended for normal users.
|
recommended for normal users.
|
||||||
|
|
||||||
|
config KEXEC
|
||||||
|
bool "Kexec system call (EXPERIMENTAL)"
|
||||||
|
depends on EXPERIMENTAL
|
||||||
|
help
|
||||||
|
kexec is a system call that implements the ability to shutdown your
|
||||||
|
current kernel, and to start another kernel. It is like a reboot
|
||||||
|
but it is indepedent of the system firmware. And like a reboot
|
||||||
|
you can start any kernel with it, not just Linux.
|
||||||
|
|
||||||
|
The name comes from the similiarity to the exec system call.
|
||||||
|
|
||||||
|
It is an ongoing process to be certain the hardware in a machine
|
||||||
|
is properly shutdown, so do not be surprised if this code does not
|
||||||
|
initially work for you. It may help to enable device hotplugging
|
||||||
|
support. As of this writing the exact hardware interface is
|
||||||
|
strongly in flux, so no good recommendation can be made.
|
||||||
|
|
||||||
|
config SECCOMP
|
||||||
|
bool "Enable seccomp to safely compute untrusted bytecode"
|
||||||
|
depends on PROC_FS && BROKEN
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
This kernel feature is useful for number crunching applications
|
||||||
|
that may need to compute untrusted bytecode during their
|
||||||
|
execution. By using pipes or other transports made available to
|
||||||
|
the process as file descriptors supporting the read/write
|
||||||
|
syscalls, it's possible to isolate those applications in
|
||||||
|
their own address space using seccomp. Once seccomp is
|
||||||
|
enabled via /proc/<pid>/seccomp, it cannot be disabled
|
||||||
|
and the task is only allowed to execute a few safe syscalls
|
||||||
|
defined by each seccomp mode.
|
||||||
|
|
||||||
|
If unsure, say Y. Only embedded should say N here.
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
config RWSEM_GENERIC_SPINLOCK
|
config RWSEM_GENERIC_SPINLOCK
|
||||||
|
@ -2025,23 +2071,6 @@ config BINFMT_ELF32
|
||||||
bool
|
bool
|
||||||
default y if MIPS32_O32 || MIPS32_N32
|
default y if MIPS32_O32 || MIPS32_N32
|
||||||
|
|
||||||
config SECCOMP
|
|
||||||
bool "Enable seccomp to safely compute untrusted bytecode"
|
|
||||||
depends on PROC_FS && BROKEN
|
|
||||||
default y
|
|
||||||
help
|
|
||||||
This kernel feature is useful for number crunching applications
|
|
||||||
that may need to compute untrusted bytecode during their
|
|
||||||
execution. By using pipes or other transports made available to
|
|
||||||
the process as file descriptors supporting the read/write
|
|
||||||
syscalls, it's possible to isolate those applications in
|
|
||||||
their own address space using seccomp. Once seccomp is
|
|
||||||
enabled via /proc/<pid>/seccomp, it cannot be disabled
|
|
||||||
and the task is only allowed to execute a few safe syscalls
|
|
||||||
defined by each seccomp mode.
|
|
||||||
|
|
||||||
If unsure, say Y. Only embedded should say N here.
|
|
||||||
|
|
||||||
config PM
|
config PM
|
||||||
bool "Power Management support (EXPERIMENTAL)"
|
bool "Power Management support (EXPERIMENTAL)"
|
||||||
depends on EXPERIMENTAL && SOC_AU1X00
|
depends on EXPERIMENTAL && SOC_AU1X00
|
||||||
|
|
|
@ -77,7 +77,7 @@ static struct smatch * __init string_to_mach(const char *s)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < (sizeof(mach_table) / sizeof (mach_table[0])); i++) {
|
for (i = 0; i < ARRAY_SIZE(mach_table); i++) {
|
||||||
if (!strcmp(s, mach_table[i].arcname))
|
if (!strcmp(s, mach_table[i].arcname))
|
||||||
return &mach_table[i];
|
return &mach_table[i];
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,30 +141,20 @@ void __init prom_meminit(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
unsigned long freed = 0;
|
|
||||||
unsigned long addr;
|
unsigned long addr;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (prom_flags & PROM_FLAG_DONT_FREE_TEMP)
|
if (prom_flags & PROM_FLAG_DONT_FREE_TEMP)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < boot_mem_map.nr_map; i++) {
|
for (i = 0; i < boot_mem_map.nr_map; i++) {
|
||||||
if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA)
|
if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
addr = boot_mem_map.map[i].addr;
|
addr = boot_mem_map.map[i].addr;
|
||||||
while (addr < boot_mem_map.map[i].addr
|
free_init_pages("prom memory",
|
||||||
+ boot_mem_map.map[i].size) {
|
addr, addr + boot_mem_map.map[i].size);
|
||||||
ClearPageReserved(virt_to_page(__va(addr)));
|
|
||||||
init_page_count(virt_to_page(__va(addr)));
|
|
||||||
free_page((unsigned long)__va(addr));
|
|
||||||
addr += PAGE_SIZE;
|
|
||||||
freed += PAGE_SIZE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printk(KERN_INFO "Freeing prom memory: %ldkb freed\n", freed >> 10);
|
|
||||||
|
|
||||||
return freed;
|
|
||||||
}
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ void restore_local_and_enable(int controller, unsigned long mask)
|
||||||
|
|
||||||
|
|
||||||
static struct irq_chip rise_edge_irq_type = {
|
static struct irq_chip rise_edge_irq_type = {
|
||||||
.typename = "Au1000 Rise Edge",
|
.name = "Au1000 Rise Edge",
|
||||||
.ack = mask_and_ack_rise_edge_irq,
|
.ack = mask_and_ack_rise_edge_irq,
|
||||||
.mask = local_disable_irq,
|
.mask = local_disable_irq,
|
||||||
.mask_ack = mask_and_ack_rise_edge_irq,
|
.mask_ack = mask_and_ack_rise_edge_irq,
|
||||||
|
@ -242,7 +242,7 @@ static struct irq_chip rise_edge_irq_type = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct irq_chip fall_edge_irq_type = {
|
static struct irq_chip fall_edge_irq_type = {
|
||||||
.typename = "Au1000 Fall Edge",
|
.name = "Au1000 Fall Edge",
|
||||||
.ack = mask_and_ack_fall_edge_irq,
|
.ack = mask_and_ack_fall_edge_irq,
|
||||||
.mask = local_disable_irq,
|
.mask = local_disable_irq,
|
||||||
.mask_ack = mask_and_ack_fall_edge_irq,
|
.mask_ack = mask_and_ack_fall_edge_irq,
|
||||||
|
@ -251,7 +251,7 @@ static struct irq_chip fall_edge_irq_type = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct irq_chip either_edge_irq_type = {
|
static struct irq_chip either_edge_irq_type = {
|
||||||
.typename = "Au1000 Rise or Fall Edge",
|
.name = "Au1000 Rise or Fall Edge",
|
||||||
.ack = mask_and_ack_either_edge_irq,
|
.ack = mask_and_ack_either_edge_irq,
|
||||||
.mask = local_disable_irq,
|
.mask = local_disable_irq,
|
||||||
.mask_ack = mask_and_ack_either_edge_irq,
|
.mask_ack = mask_and_ack_either_edge_irq,
|
||||||
|
@ -260,7 +260,7 @@ static struct irq_chip either_edge_irq_type = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct irq_chip level_irq_type = {
|
static struct irq_chip level_irq_type = {
|
||||||
.typename = "Au1000 Level",
|
.name = "Au1000 Level",
|
||||||
.ack = mask_and_ack_level_irq,
|
.ack = mask_and_ack_level_irq,
|
||||||
.mask = local_disable_irq,
|
.mask = local_disable_irq,
|
||||||
.mask_ack = mask_and_ack_level_irq,
|
.mask_ack = mask_and_ack_level_irq,
|
||||||
|
|
|
@ -76,14 +76,18 @@ static int __init au1x_pci_setup(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DMA_NONCOHERENT
|
#ifdef CONFIG_DMA_NONCOHERENT
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
* Set the NC bit in controller for Au1500 pre-AC silicon
|
* Set the NC bit in controller for Au1500 pre-AC silicon
|
||||||
*/
|
*/
|
||||||
u32 prid = read_c0_prid();
|
u32 prid = read_c0_prid();
|
||||||
|
|
||||||
if ((prid & 0xFF000000) == 0x01000000 && prid < 0x01030202) {
|
if ((prid & 0xFF000000) == 0x01000000 && prid < 0x01030202) {
|
||||||
au_writel( 1<<16 | au_readl(Au1500_PCI_CFG), Au1500_PCI_CFG);
|
au_writel((1 << 16) | au_readl(Au1500_PCI_CFG),
|
||||||
|
Au1500_PCI_CFG);
|
||||||
printk("Non-coherent PCI accesses enabled\n");
|
printk("Non-coherent PCI accesses enabled\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
set_io_port_base(virt_io_addr);
|
set_io_port_base(virt_io_addr);
|
||||||
|
|
|
@ -149,9 +149,8 @@ int get_ethernet_addr(char *ethernet_addr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(prom_getcmdline);
|
EXPORT_SYMBOL(prom_getcmdline);
|
||||||
|
|
|
@ -141,17 +141,20 @@ void __init plat_mem_setup(void)
|
||||||
/* This routine should be valid for all Au1x based boards */
|
/* This routine should be valid for all Au1x based boards */
|
||||||
phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
|
phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
|
||||||
{
|
{
|
||||||
u32 start, end;
|
|
||||||
|
|
||||||
/* Don't fixup 36 bit addresses */
|
/* Don't fixup 36 bit addresses */
|
||||||
if ((phys_addr >> 32) != 0) return phys_addr;
|
if ((phys_addr >> 32) != 0)
|
||||||
|
return phys_addr;
|
||||||
|
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
|
{
|
||||||
|
u32 start, end;
|
||||||
|
|
||||||
start = (u32)Au1500_PCI_MEM_START;
|
start = (u32)Au1500_PCI_MEM_START;
|
||||||
end = (u32)Au1500_PCI_MEM_END;
|
end = (u32)Au1500_PCI_MEM_END;
|
||||||
/* check for pci memory window */
|
/* check for pci memory window */
|
||||||
if ((phys_addr >= start) && ((phys_addr + size) < end)) {
|
if ((phys_addr >= start) && ((phys_addr + size) < end))
|
||||||
return (phys_t)((phys_addr - start) + Au1500_PCI_MEM_START);
|
return (phys_t)
|
||||||
|
((phys_addr - start) + Au1500_PCI_MEM_START);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,7 @@ void board_reset (void)
|
||||||
|
|
||||||
void __init board_setup(void)
|
void __init board_setup(void)
|
||||||
{
|
{
|
||||||
u32 pin_func;
|
volatile void __iomem * base = (volatile void __iomem *) 0xac000000UL;
|
||||||
u32 sys_freqctrl, sys_clksrc;
|
|
||||||
|
|
||||||
// set AUX clock to 12MHz * 8 = 96 MHz
|
// set AUX clock to 12MHz * 8 = 96 MHz
|
||||||
au_writel(8, SYS_AUXPLL);
|
au_writel(8, SYS_AUXPLL);
|
||||||
|
@ -56,6 +55,9 @@ void __init board_setup(void)
|
||||||
udelay(100);
|
udelay(100);
|
||||||
|
|
||||||
#ifdef CONFIG_USB_OHCI
|
#ifdef CONFIG_USB_OHCI
|
||||||
|
{
|
||||||
|
u32 pin_func, sys_freqctrl, sys_clksrc;
|
||||||
|
|
||||||
// configure pins GPIO[14:9] as GPIO
|
// configure pins GPIO[14:9] as GPIO
|
||||||
pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x80);
|
pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x80);
|
||||||
|
|
||||||
|
@ -95,19 +97,20 @@ void __init board_setup(void)
|
||||||
// 2nd USB port is USB host
|
// 2nd USB port is USB host
|
||||||
pin_func |= 0x8000;
|
pin_func |= 0x8000;
|
||||||
au_writel(pin_func, SYS_PINFUNC);
|
au_writel(pin_func, SYS_PINFUNC);
|
||||||
|
}
|
||||||
#endif // defined (CONFIG_USB_OHCI)
|
#endif // defined (CONFIG_USB_OHCI)
|
||||||
|
|
||||||
/* Enable sys bus clock divider when IDLE state or no bus activity. */
|
/* Enable sys bus clock divider when IDLE state or no bus activity. */
|
||||||
au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
|
au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL);
|
||||||
|
|
||||||
// Enable the RTC if not already enabled
|
// Enable the RTC if not already enabled
|
||||||
if (!(readb(0xac000028) & 0x20)) {
|
if (!(readb(base + 0x28) & 0x20)) {
|
||||||
writeb(readb(0xac000028) | 0x20, 0xac000028);
|
writeb(readb(base + 0x28) | 0x20, base + 0x28);
|
||||||
au_sync();
|
au_sync();
|
||||||
}
|
}
|
||||||
// Put the clock in BCD mode
|
// Put the clock in BCD mode
|
||||||
if (readb(0xac00002C) & 0x4) { /* reg B */
|
if (readb(base + 0x2C) & 0x4) { /* reg B */
|
||||||
writeb(readb(0xac00002c) & ~0x4, 0xac00002c);
|
writeb(readb(base + 0x2c) & ~0x4, base + 0x2c);
|
||||||
au_sync();
|
au_sync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,33 +137,20 @@ static void pb1200_shutdown_irq( unsigned int irq_nr )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void pb1200_mask_and_ack_irq(unsigned int irq_nr)
|
|
||||||
{
|
|
||||||
pb1200_disable_irq( irq_nr );
|
|
||||||
}
|
|
||||||
|
|
||||||
static void pb1200_end_irq(unsigned int irq_nr)
|
|
||||||
{
|
|
||||||
if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
|
|
||||||
pb1200_enable_irq(irq_nr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct irq_chip external_irq_type =
|
static struct irq_chip external_irq_type =
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_MIPS_PB1200
|
#ifdef CONFIG_MIPS_PB1200
|
||||||
"Pb1200 Ext",
|
.name = "Pb1200 Ext",
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_MIPS_DB1200
|
#ifdef CONFIG_MIPS_DB1200
|
||||||
"Db1200 Ext",
|
.name = "Db1200 Ext",
|
||||||
#endif
|
#endif
|
||||||
pb1200_startup_irq,
|
.startup = pb1200_startup_irq,
|
||||||
pb1200_shutdown_irq,
|
.shutdown = pb1200_shutdown_irq,
|
||||||
pb1200_enable_irq,
|
.ack = pb1200_disable_irq,
|
||||||
pb1200_disable_irq,
|
.mask = pb1200_disable_irq,
|
||||||
pb1200_mask_and_ack_irq,
|
.mask_ack = pb1200_disable_irq,
|
||||||
pb1200_end_irq,
|
.unmask = pb1200_enable_irq,
|
||||||
NULL
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void _board_init_irq(void)
|
void _board_init_irq(void)
|
||||||
|
@ -172,7 +159,8 @@ void _board_init_irq(void)
|
||||||
|
|
||||||
for (irq_nr = PB1200_INT_BEGIN; irq_nr <= PB1200_INT_END; irq_nr++)
|
for (irq_nr = PB1200_INT_BEGIN; irq_nr <= PB1200_INT_END; irq_nr++)
|
||||||
{
|
{
|
||||||
irq_desc[irq_nr].chip = &external_irq_type;
|
set_irq_chip_and_handler(irq_nr, &external_irq_type,
|
||||||
|
handle_level_irq);
|
||||||
pb1200_disable_irq(irq_nr);
|
pb1200_disable_irq(irq_nr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,9 +47,9 @@ extern asmlinkage void excite_handle_int(void);
|
||||||
*/
|
*/
|
||||||
void __init arch_init_irq(void)
|
void __init arch_init_irq(void)
|
||||||
{
|
{
|
||||||
mips_cpu_irq_init(0);
|
mips_cpu_irq_init();
|
||||||
rm7k_cpu_irq_init(8);
|
rm7k_cpu_irq_init();
|
||||||
rm9k_cpu_irq_init(12);
|
rm9k_cpu_irq_init();
|
||||||
|
|
||||||
#ifdef CONFIG_KGDB
|
#ifdef CONFIG_KGDB
|
||||||
excite_kgdb_init();
|
excite_kgdb_init();
|
||||||
|
|
|
@ -104,7 +104,7 @@ void __init arch_init_irq(void)
|
||||||
GT_WRITE(GT_INTRMASK_OFS, 0);
|
GT_WRITE(GT_INTRMASK_OFS, 0);
|
||||||
|
|
||||||
init_i8259_irqs(); /* 0 ... 15 */
|
init_i8259_irqs(); /* 0 ... 15 */
|
||||||
mips_cpu_irq_init(COBALT_CPU_IRQ); /* 16 ... 23 */
|
mips_cpu_irq_init(); /* 16 ... 23 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mask all cpu interrupts
|
* Mask all cpu interrupts
|
||||||
|
|
|
@ -204,8 +204,7 @@ void __init prom_init(void)
|
||||||
add_memory_region(0x0, memsz, BOOT_MEM_RAM);
|
add_memory_region(0x0, memsz, BOOT_MEM_RAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
/* Nothing to do! */
|
/* Nothing to do! */
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,9 +59,8 @@ void __init prom_init(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_DDB5477)
|
#if defined(CONFIG_DDB5477)
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <linux/ptrace.h>
|
#include <linux/ptrace.h>
|
||||||
|
|
||||||
#include <asm/i8259.h>
|
#include <asm/i8259.h>
|
||||||
|
#include <asm/irq_cpu.h>
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/debug.h>
|
#include <asm/debug.h>
|
||||||
|
@ -73,7 +74,6 @@ set_pci_int_attr(u32 pci, u32 intn, u32 active, u32 trigger)
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void vrc5477_irq_init(u32 base);
|
extern void vrc5477_irq_init(u32 base);
|
||||||
extern void mips_cpu_irq_init(u32 base);
|
|
||||||
static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
|
static struct irqaction irq_cascade = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL };
|
||||||
|
|
||||||
void __init arch_init_irq(void)
|
void __init arch_init_irq(void)
|
||||||
|
@ -125,7 +125,7 @@ void __init arch_init_irq(void)
|
||||||
|
|
||||||
/* init all controllers */
|
/* init all controllers */
|
||||||
init_i8259_irqs();
|
init_i8259_irqs();
|
||||||
mips_cpu_irq_init(CPU_IRQ_BASE);
|
mips_cpu_irq_init();
|
||||||
vrc5477_irq_init(VRC5477_IRQ_BASE);
|
vrc5477_irq_init(VRC5477_IRQ_BASE);
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,8 +146,7 @@ u8 i8259_interrupt_ack(void)
|
||||||
irq = *(volatile u8 *) KSEG1ADDR(DDB_PCI_IACK_BASE);
|
irq = *(volatile u8 *) KSEG1ADDR(DDB_PCI_IACK_BASE);
|
||||||
ddb_out32(DDB_PCIINIT10, reg);
|
ddb_out32(DDB_PCIINIT10, reg);
|
||||||
|
|
||||||
/* i8259.c set the base vector to be 0x0 */
|
return irq;
|
||||||
return irq + I8259_IRQ_BASE;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* the first level int-handler will jump here if it is a vrc5477 irq
|
* the first level int-handler will jump here if it is a vrc5477 irq
|
||||||
|
@ -177,7 +176,7 @@ static void vrc5477_irq_dispatch(void)
|
||||||
/* check for i8259 interrupts */
|
/* check for i8259 interrupts */
|
||||||
if (intStatus & (1 << VRC5477_I8259_CASCADE)) {
|
if (intStatus & (1 << VRC5477_I8259_CASCADE)) {
|
||||||
int i8259_irq = i8259_interrupt_ack();
|
int i8259_irq = i8259_interrupt_ack();
|
||||||
do_IRQ(I8259_IRQ_BASE + i8259_irq);
|
do_IRQ(i8259_irq);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ vrc5477_irq_end(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct irq_chip vrc5477_irq_controller = {
|
struct irq_chip vrc5477_irq_controller = {
|
||||||
.typename = "vrc5477_irq",
|
.name = "vrc5477_irq",
|
||||||
.ack = vrc5477_irq_ack,
|
.ack = vrc5477_irq_ack,
|
||||||
.mask = vrc5477_irq_disable,
|
.mask = vrc5477_irq_disable,
|
||||||
.mask_ack = vrc5477_irq_ack,
|
.mask_ack = vrc5477_irq_ack,
|
||||||
|
|
|
@ -62,7 +62,7 @@ static inline void end_ioasic_irq(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip ioasic_irq_type = {
|
static struct irq_chip ioasic_irq_type = {
|
||||||
.typename = "IO-ASIC",
|
.name = "IO-ASIC",
|
||||||
.ack = ack_ioasic_irq,
|
.ack = ack_ioasic_irq,
|
||||||
.mask = mask_ioasic_irq,
|
.mask = mask_ioasic_irq,
|
||||||
.mask_ack = ack_ioasic_irq,
|
.mask_ack = ack_ioasic_irq,
|
||||||
|
@ -84,7 +84,7 @@ static inline void end_ioasic_dma_irq(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip ioasic_dma_irq_type = {
|
static struct irq_chip ioasic_dma_irq_type = {
|
||||||
.typename = "IO-ASIC-DMA",
|
.name = "IO-ASIC-DMA",
|
||||||
.ack = ack_ioasic_dma_irq,
|
.ack = ack_ioasic_dma_irq,
|
||||||
.mask = mask_ioasic_dma_irq,
|
.mask = mask_ioasic_dma_irq,
|
||||||
.mask_ack = ack_ioasic_dma_irq,
|
.mask_ack = ack_ioasic_dma_irq,
|
||||||
|
|
|
@ -58,7 +58,7 @@ static void ack_kn02_irq(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip kn02_irq_type = {
|
static struct irq_chip kn02_irq_type = {
|
||||||
.typename = "KN02-CSR",
|
.name = "KN02-CSR",
|
||||||
.ack = ack_kn02_irq,
|
.ack = ack_kn02_irq,
|
||||||
.mask = mask_kn02_irq,
|
.mask = mask_kn02_irq,
|
||||||
.mask_ack = ack_kn02_irq,
|
.mask_ack = ack_kn02_irq,
|
||||||
|
|
|
@ -92,9 +92,9 @@ void __init prom_meminit(u32 magic)
|
||||||
rex_setup_memory_region();
|
rex_setup_memory_region();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
unsigned long addr, end;
|
unsigned long end;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Free everything below the kernel itself but leave
|
* Free everything below the kernel itself but leave
|
||||||
|
@ -114,16 +114,5 @@ unsigned long __init prom_free_prom_memory(void)
|
||||||
#endif
|
#endif
|
||||||
end = __pa(&_text);
|
end = __pa(&_text);
|
||||||
|
|
||||||
addr = PAGE_SIZE;
|
free_init_pages("unused PROM memory", PAGE_SIZE, end);
|
||||||
while (addr < end) {
|
|
||||||
ClearPageReserved(virt_to_page(__va(addr)));
|
|
||||||
init_page_count(virt_to_page(__va(addr)));
|
|
||||||
free_page((unsigned long)__va(addr));
|
|
||||||
addr += PAGE_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
printk("Freeing unused PROM memory: %ldkb freed\n",
|
|
||||||
(end - PAGE_SIZE) >> 10);
|
|
||||||
|
|
||||||
return end - PAGE_SIZE;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,7 +234,7 @@ static void __init dec_init_kn01(void)
|
||||||
memcpy(&cpu_mask_nr_tbl, &kn01_cpu_mask_nr_tbl,
|
memcpy(&cpu_mask_nr_tbl, &kn01_cpu_mask_nr_tbl,
|
||||||
sizeof(kn01_cpu_mask_nr_tbl));
|
sizeof(kn01_cpu_mask_nr_tbl));
|
||||||
|
|
||||||
mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
|
mips_cpu_irq_init();
|
||||||
|
|
||||||
} /* dec_init_kn01 */
|
} /* dec_init_kn01 */
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ static void __init dec_init_kn230(void)
|
||||||
memcpy(&cpu_mask_nr_tbl, &kn230_cpu_mask_nr_tbl,
|
memcpy(&cpu_mask_nr_tbl, &kn230_cpu_mask_nr_tbl,
|
||||||
sizeof(kn230_cpu_mask_nr_tbl));
|
sizeof(kn230_cpu_mask_nr_tbl));
|
||||||
|
|
||||||
mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
|
mips_cpu_irq_init();
|
||||||
|
|
||||||
} /* dec_init_kn230 */
|
} /* dec_init_kn230 */
|
||||||
|
|
||||||
|
@ -403,7 +403,7 @@ static void __init dec_init_kn02(void)
|
||||||
memcpy(&asic_mask_nr_tbl, &kn02_asic_mask_nr_tbl,
|
memcpy(&asic_mask_nr_tbl, &kn02_asic_mask_nr_tbl,
|
||||||
sizeof(kn02_asic_mask_nr_tbl));
|
sizeof(kn02_asic_mask_nr_tbl));
|
||||||
|
|
||||||
mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
|
mips_cpu_irq_init();
|
||||||
init_kn02_irqs(KN02_IRQ_BASE);
|
init_kn02_irqs(KN02_IRQ_BASE);
|
||||||
|
|
||||||
} /* dec_init_kn02 */
|
} /* dec_init_kn02 */
|
||||||
|
@ -504,7 +504,7 @@ static void __init dec_init_kn02ba(void)
|
||||||
memcpy(&asic_mask_nr_tbl, &kn02ba_asic_mask_nr_tbl,
|
memcpy(&asic_mask_nr_tbl, &kn02ba_asic_mask_nr_tbl,
|
||||||
sizeof(kn02ba_asic_mask_nr_tbl));
|
sizeof(kn02ba_asic_mask_nr_tbl));
|
||||||
|
|
||||||
mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
|
mips_cpu_irq_init();
|
||||||
init_ioasic_irqs(IO_IRQ_BASE);
|
init_ioasic_irqs(IO_IRQ_BASE);
|
||||||
|
|
||||||
} /* dec_init_kn02ba */
|
} /* dec_init_kn02ba */
|
||||||
|
@ -601,7 +601,7 @@ static void __init dec_init_kn02ca(void)
|
||||||
memcpy(&asic_mask_nr_tbl, &kn02ca_asic_mask_nr_tbl,
|
memcpy(&asic_mask_nr_tbl, &kn02ca_asic_mask_nr_tbl,
|
||||||
sizeof(kn02ca_asic_mask_nr_tbl));
|
sizeof(kn02ca_asic_mask_nr_tbl));
|
||||||
|
|
||||||
mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
|
mips_cpu_irq_init();
|
||||||
init_ioasic_irqs(IO_IRQ_BASE);
|
init_ioasic_irqs(IO_IRQ_BASE);
|
||||||
|
|
||||||
} /* dec_init_kn02ca */
|
} /* dec_init_kn02ca */
|
||||||
|
@ -702,7 +702,7 @@ static void __init dec_init_kn03(void)
|
||||||
memcpy(&asic_mask_nr_tbl, &kn03_asic_mask_nr_tbl,
|
memcpy(&asic_mask_nr_tbl, &kn03_asic_mask_nr_tbl,
|
||||||
sizeof(kn03_asic_mask_nr_tbl));
|
sizeof(kn03_asic_mask_nr_tbl));
|
||||||
|
|
||||||
mips_cpu_irq_init(DEC_CPU_IRQ_BASE);
|
mips_cpu_irq_init();
|
||||||
init_ioasic_irqs(IO_IRQ_BASE);
|
init_ioasic_irqs(IO_IRQ_BASE);
|
||||||
|
|
||||||
} /* dec_init_kn03 */
|
} /* dec_init_kn03 */
|
||||||
|
|
|
@ -57,7 +57,7 @@ static void emma2rh_irq_disable(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct irq_chip emma2rh_irq_controller = {
|
struct irq_chip emma2rh_irq_controller = {
|
||||||
.typename = "emma2rh_irq",
|
.name = "emma2rh_irq",
|
||||||
.ack = emma2rh_irq_disable,
|
.ack = emma2rh_irq_disable,
|
||||||
.mask = emma2rh_irq_disable,
|
.mask = emma2rh_irq_disable,
|
||||||
.mask_ack = emma2rh_irq_disable,
|
.mask_ack = emma2rh_irq_disable,
|
||||||
|
|
|
@ -106,7 +106,7 @@ void __init arch_init_irq(void)
|
||||||
emma2rh_irq_init(EMMA2RH_IRQ_BASE);
|
emma2rh_irq_init(EMMA2RH_IRQ_BASE);
|
||||||
emma2rh_sw_irq_init(EMMA2RH_SW_IRQ_BASE);
|
emma2rh_sw_irq_init(EMMA2RH_SW_IRQ_BASE);
|
||||||
emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE);
|
emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE);
|
||||||
mips_cpu_irq_init(CPU_IRQ_BASE);
|
mips_cpu_irq_init();
|
||||||
|
|
||||||
/* setup cascade interrupts */
|
/* setup cascade interrupts */
|
||||||
setup_irq(EMMA2RH_IRQ_BASE + EMMA2RH_SW_CASCADE, &irq_cascade);
|
setup_irq(EMMA2RH_IRQ_BASE + EMMA2RH_SW_CASCADE, &irq_cascade);
|
||||||
|
|
|
@ -49,7 +49,7 @@ static void emma2rh_sw_irq_disable(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct irq_chip emma2rh_sw_irq_controller = {
|
struct irq_chip emma2rh_sw_irq_controller = {
|
||||||
.typename = "emma2rh_sw_irq",
|
.name = "emma2rh_sw_irq",
|
||||||
.ack = emma2rh_sw_irq_disable,
|
.ack = emma2rh_sw_irq_disable,
|
||||||
.mask = emma2rh_sw_irq_disable,
|
.mask = emma2rh_sw_irq_disable,
|
||||||
.mask_ack = emma2rh_sw_irq_disable,
|
.mask_ack = emma2rh_sw_irq_disable,
|
||||||
|
@ -115,7 +115,7 @@ static void emma2rh_gpio_irq_end(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct irq_chip emma2rh_gpio_irq_controller = {
|
struct irq_chip emma2rh_gpio_irq_controller = {
|
||||||
.typename = "emma2rh_gpio_irq",
|
.name = "emma2rh_gpio_irq",
|
||||||
.ack = emma2rh_gpio_irq_ack,
|
.ack = emma2rh_gpio_irq_ack,
|
||||||
.mask = emma2rh_gpio_irq_disable,
|
.mask = emma2rh_gpio_irq_disable,
|
||||||
.mask_ack = emma2rh_gpio_irq_ack,
|
.mask_ack = emma2rh_gpio_irq_ack,
|
||||||
|
|
|
@ -88,7 +88,7 @@ static void end_ev64120_irq(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip ev64120_irq_type = {
|
static struct irq_chip ev64120_irq_type = {
|
||||||
.typename = "EV64120",
|
.name = "EV64120",
|
||||||
.ack = disable_ev64120_irq,
|
.ack = disable_ev64120_irq,
|
||||||
.mask = disable_ev64120_irq,
|
.mask = disable_ev64120_irq,
|
||||||
.mask_ack = disable_ev64120_irq,
|
.mask_ack = disable_ev64120_irq,
|
||||||
|
|
|
@ -59,9 +59,8 @@ extern void galileo_machine_power_off(void);
|
||||||
*/
|
*/
|
||||||
extern struct pci_ops galileo_pci_ops;
|
extern struct pci_ops galileo_pci_ops;
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
|
|
||||||
#ifdef CONFIG_KGDB
|
|
||||||
|
|
||||||
#include <asm/serial.h> /* For the serial port location and base baud */
|
#include <asm/serial.h> /* For the serial port location and base baud */
|
||||||
|
|
||||||
/* --- CONFIG --- */
|
/* --- CONFIG --- */
|
||||||
|
@ -121,5 +119,3 @@ int putDebugChar(uint8 byte)
|
||||||
UART16550_WRITE(OFS_SEND_BUFFER, byte);
|
UART16550_WRITE(OFS_SEND_BUFFER, byte);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -90,6 +90,6 @@ void __init arch_init_irq(void)
|
||||||
clear_c0_status(ST0_IM);
|
clear_c0_status(ST0_IM);
|
||||||
local_irq_disable();
|
local_irq_disable();
|
||||||
|
|
||||||
mips_cpu_irq_init(0);
|
mips_cpu_irq_init();
|
||||||
rm7k_cpu_irq_init(8);
|
rm7k_cpu_irq_init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,6 @@ void __init prom_init(void)
|
||||||
add_memory_region(0, 64 << 20, BOOT_MEM_RAM);
|
add_memory_region(0, 64 << 20, BOOT_MEM_RAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ void gt64120_init_pic(void)
|
||||||
void __init arch_init_irq(void)
|
void __init arch_init_irq(void)
|
||||||
{
|
{
|
||||||
/* IRQ 0 - 7 are for MIPS common irq_cpu controller */
|
/* IRQ 0 - 7 are for MIPS common irq_cpu controller */
|
||||||
mips_cpu_irq_init(0);
|
mips_cpu_irq_init();
|
||||||
|
|
||||||
gt64120_init_pic();
|
gt64120_init_pic();
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,9 +93,8 @@ void __init wrppmc_early_printk(const char *fmt, ...)
|
||||||
}
|
}
|
||||||
#endif /* WRPPMC_EARLY_DEBUG */
|
#endif /* WRPPMC_EARLY_DEBUG */
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SERIAL_8250
|
#ifdef CONFIG_SERIAL_8250
|
||||||
|
|
|
@ -40,7 +40,7 @@ void disable_r4030_irq(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip r4030_irq_type = {
|
static struct irq_chip r4030_irq_type = {
|
||||||
.typename = "R4030",
|
.name = "R4030",
|
||||||
.ack = disable_r4030_irq,
|
.ack = disable_r4030_irq,
|
||||||
.mask = disable_r4030_irq,
|
.mask = disable_r4030_irq,
|
||||||
.mask_ack = disable_r4030_irq,
|
.mask_ack = disable_r4030_irq,
|
||||||
|
|
|
@ -75,7 +75,6 @@ void __init prom_init_cmdline(void)
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -439,7 +439,7 @@ void __init arch_init_irq(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip jmr3927_irq_controller = {
|
static struct irq_chip jmr3927_irq_controller = {
|
||||||
.typename = "jmr3927_irq",
|
.name = "jmr3927_irq",
|
||||||
.ack = jmr3927_irq_ack,
|
.ack = jmr3927_irq_ack,
|
||||||
.mask = jmr3927_irq_disable,
|
.mask = jmr3927_irq_disable,
|
||||||
.mask_ack = jmr3927_irq_ack,
|
.mask_ack = jmr3927_irq_ack,
|
||||||
|
|
|
@ -434,7 +434,7 @@ void __init tx3927_setup(void)
|
||||||
|
|
||||||
/* DMA */
|
/* DMA */
|
||||||
tx3927_dmaptr->mcr = 0;
|
tx3927_dmaptr->mcr = 0;
|
||||||
for (i = 0; i < sizeof(tx3927_dmaptr->ch) / sizeof(tx3927_dmaptr->ch[0]); i++) {
|
for (i = 0; i < ARRAY_SIZE(tx3927_dmaptr->ch); i++) {
|
||||||
/* reset channel */
|
/* reset channel */
|
||||||
tx3927_dmaptr->ch[i].ccr = TX3927_DMA_CCR_CHRST;
|
tx3927_dmaptr->ch[i].ccr = TX3927_DMA_CCR_CHRST;
|
||||||
tx3927_dmaptr->ch[i].ccr = 0;
|
tx3927_dmaptr->ch[i].ccr = 0;
|
||||||
|
|
|
@ -234,10 +234,6 @@ void output_mm_defines(void)
|
||||||
constant("#define _PMD_SHIFT ", PMD_SHIFT);
|
constant("#define _PMD_SHIFT ", PMD_SHIFT);
|
||||||
constant("#define _PGDIR_SHIFT ", PGDIR_SHIFT);
|
constant("#define _PGDIR_SHIFT ", PGDIR_SHIFT);
|
||||||
linefeed;
|
linefeed;
|
||||||
constant("#define _PGD_ORDER ", PGD_ORDER);
|
|
||||||
constant("#define _PMD_ORDER ", PMD_ORDER);
|
|
||||||
constant("#define _PTE_ORDER ", PTE_ORDER);
|
|
||||||
linefeed;
|
|
||||||
constant("#define _PTRS_PER_PGD ", PTRS_PER_PGD);
|
constant("#define _PTRS_PER_PGD ", PTRS_PER_PGD);
|
||||||
constant("#define _PTRS_PER_PMD ", PTRS_PER_PMD);
|
constant("#define _PTRS_PER_PMD ", PTRS_PER_PMD);
|
||||||
constant("#define _PTRS_PER_PTE ", PTRS_PER_PTE);
|
constant("#define _PTRS_PER_PTE ", PTRS_PER_PTE);
|
||||||
|
|
|
@ -231,28 +231,3 @@ NESTED(smp_bootstrap, 16, sp)
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
|
||||||
__FINIT
|
__FINIT
|
||||||
|
|
||||||
.comm kernelsp, NR_CPUS * 8, 8
|
|
||||||
.comm pgd_current, NR_CPUS * 8, 8
|
|
||||||
|
|
||||||
.comm fw_arg0, SZREG, SZREG # firmware arguments
|
|
||||||
.comm fw_arg1, SZREG, SZREG
|
|
||||||
.comm fw_arg2, SZREG, SZREG
|
|
||||||
.comm fw_arg3, SZREG, SZREG
|
|
||||||
|
|
||||||
.macro page name, order
|
|
||||||
.comm \name, (_PAGE_SIZE << \order), (_PAGE_SIZE << \order)
|
|
||||||
.endm
|
|
||||||
|
|
||||||
/*
|
|
||||||
* On 64-bit we've got three-level pagetables with a slightly
|
|
||||||
* different layout ...
|
|
||||||
*/
|
|
||||||
page swapper_pg_dir, _PGD_ORDER
|
|
||||||
#ifdef CONFIG_64BIT
|
|
||||||
#if defined(CONFIG_MODULES) && !defined(CONFIG_BUILD_ELF64)
|
|
||||||
page module_pg_dir, _PGD_ORDER
|
|
||||||
#endif
|
|
||||||
page invalid_pmd_table, _PMD_ORDER
|
|
||||||
#endif
|
|
||||||
page invalid_pte_table, _PTE_ORDER
|
|
||||||
|
|
|
@ -54,9 +54,11 @@ static unsigned int cached_irq_mask = 0xffff;
|
||||||
|
|
||||||
void disable_8259A_irq(unsigned int irq)
|
void disable_8259A_irq(unsigned int irq)
|
||||||
{
|
{
|
||||||
unsigned int mask = 1 << irq;
|
unsigned int mask;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
|
irq -= I8259A_IRQ_BASE;
|
||||||
|
mask = 1 << irq;
|
||||||
spin_lock_irqsave(&i8259A_lock, flags);
|
spin_lock_irqsave(&i8259A_lock, flags);
|
||||||
cached_irq_mask |= mask;
|
cached_irq_mask |= mask;
|
||||||
if (irq & 8)
|
if (irq & 8)
|
||||||
|
@ -68,9 +70,11 @@ void disable_8259A_irq(unsigned int irq)
|
||||||
|
|
||||||
void enable_8259A_irq(unsigned int irq)
|
void enable_8259A_irq(unsigned int irq)
|
||||||
{
|
{
|
||||||
unsigned int mask = ~(1 << irq);
|
unsigned int mask;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
|
irq -= I8259A_IRQ_BASE;
|
||||||
|
mask = ~(1 << irq);
|
||||||
spin_lock_irqsave(&i8259A_lock, flags);
|
spin_lock_irqsave(&i8259A_lock, flags);
|
||||||
cached_irq_mask &= mask;
|
cached_irq_mask &= mask;
|
||||||
if (irq & 8)
|
if (irq & 8)
|
||||||
|
@ -82,10 +86,12 @@ void enable_8259A_irq(unsigned int irq)
|
||||||
|
|
||||||
int i8259A_irq_pending(unsigned int irq)
|
int i8259A_irq_pending(unsigned int irq)
|
||||||
{
|
{
|
||||||
unsigned int mask = 1 << irq;
|
unsigned int mask;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
irq -= I8259A_IRQ_BASE;
|
||||||
|
mask = 1 << irq;
|
||||||
spin_lock_irqsave(&i8259A_lock, flags);
|
spin_lock_irqsave(&i8259A_lock, flags);
|
||||||
if (irq < 8)
|
if (irq < 8)
|
||||||
ret = inb(PIC_MASTER_CMD) & mask;
|
ret = inb(PIC_MASTER_CMD) & mask;
|
||||||
|
@ -134,9 +140,11 @@ static inline int i8259A_irq_real(unsigned int irq)
|
||||||
*/
|
*/
|
||||||
void mask_and_ack_8259A(unsigned int irq)
|
void mask_and_ack_8259A(unsigned int irq)
|
||||||
{
|
{
|
||||||
unsigned int irqmask = 1 << irq;
|
unsigned int irqmask;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
|
irq -= I8259A_IRQ_BASE;
|
||||||
|
irqmask = 1 << irq;
|
||||||
spin_lock_irqsave(&i8259A_lock, flags);
|
spin_lock_irqsave(&i8259A_lock, flags);
|
||||||
/*
|
/*
|
||||||
* Lightweight spurious IRQ detection. We do not want
|
* Lightweight spurious IRQ detection. We do not want
|
||||||
|
@ -322,8 +330,8 @@ void __init init_i8259_irqs (void)
|
||||||
|
|
||||||
init_8259A(0);
|
init_8259A(0);
|
||||||
|
|
||||||
for (i = 0; i < 16; i++)
|
for (i = I8259A_IRQ_BASE; i < I8259A_IRQ_BASE + 16; i++)
|
||||||
set_irq_chip_and_handler(i, &i8259A_chip, handle_level_irq);
|
set_irq_chip_and_handler(i, &i8259A_chip, handle_level_irq);
|
||||||
|
|
||||||
setup_irq(PIC_CASCADE_IR, &irq2);
|
setup_irq(I8259A_IRQ_BASE + PIC_CASCADE_IR, &irq2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
* Copyright (C) 1996 - 2004 David S. Miller <dm@engr.sgi.com>
|
* Copyright (C) 1996 - 2004 David S. Miller <dm@engr.sgi.com>
|
||||||
* Copyright (C) 2004 - 2005 Steven J. Hill <sjhill@realitydiluted.com>
|
* Copyright (C) 2004 - 2005 Steven J. Hill <sjhill@realitydiluted.com>
|
||||||
*/
|
*/
|
||||||
|
#undef DEBUG
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/stat.h>
|
#include <linux/stat.h>
|
||||||
|
@ -40,8 +42,6 @@
|
||||||
|
|
||||||
#include <linux/elf.h>
|
#include <linux/elf.h>
|
||||||
|
|
||||||
#undef DEBUG
|
|
||||||
|
|
||||||
static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs);
|
static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs);
|
||||||
static int load_irix_library(struct file *);
|
static int load_irix_library(struct file *);
|
||||||
static int irix_core_dump(long signr, struct pt_regs * regs,
|
static int irix_core_dump(long signr, struct pt_regs * regs,
|
||||||
|
@ -52,55 +52,86 @@ static struct linux_binfmt irix_format = {
|
||||||
irix_core_dump, PAGE_SIZE
|
irix_core_dump, PAGE_SIZE
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
/* Debugging routines. */
|
/* Debugging routines. */
|
||||||
static char *get_elf_p_type(Elf32_Word p_type)
|
static char *get_elf_p_type(Elf32_Word p_type)
|
||||||
{
|
{
|
||||||
int i = (int) p_type;
|
#ifdef DEBUG
|
||||||
|
switch (p_type) {
|
||||||
|
case PT_NULL:
|
||||||
|
return "PT_NULL";
|
||||||
|
break;
|
||||||
|
|
||||||
switch(i) {
|
case PT_LOAD:
|
||||||
case PT_NULL: return("PT_NULL"); break;
|
return "PT_LOAD";
|
||||||
case PT_LOAD: return("PT_LOAD"); break;
|
break;
|
||||||
case PT_DYNAMIC: return("PT_DYNAMIC"); break;
|
|
||||||
case PT_INTERP: return("PT_INTERP"); break;
|
case PT_DYNAMIC:
|
||||||
case PT_NOTE: return("PT_NOTE"); break;
|
return "PT_DYNAMIC";
|
||||||
case PT_SHLIB: return("PT_SHLIB"); break;
|
break;
|
||||||
case PT_PHDR: return("PT_PHDR"); break;
|
|
||||||
case PT_LOPROC: return("PT_LOPROC/REGINFO"); break;
|
case PT_INTERP:
|
||||||
case PT_HIPROC: return("PT_HIPROC"); break;
|
return "PT_INTERP";
|
||||||
default: return("PT_BOGUS"); break;
|
break;
|
||||||
|
|
||||||
|
case PT_NOTE:
|
||||||
|
return "PT_NOTE";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PT_SHLIB:
|
||||||
|
return "PT_SHLIB";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PT_PHDR:
|
||||||
|
return "PT_PHDR";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PT_LOPROC:
|
||||||
|
return "PT_LOPROC/REGINFO";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PT_HIPROC:
|
||||||
|
return "PT_HIPROC";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return "PT_BOGUS";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_elfhdr(struct elfhdr *ehp)
|
static void print_elfhdr(struct elfhdr *ehp)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printk("ELFHDR: e_ident<");
|
pr_debug("ELFHDR: e_ident<");
|
||||||
for(i = 0; i < (EI_NIDENT - 1); i++) printk("%x ", ehp->e_ident[i]);
|
for (i = 0; i < (EI_NIDENT - 1); i++)
|
||||||
printk("%x>\n", ehp->e_ident[i]);
|
pr_debug("%x ", ehp->e_ident[i]);
|
||||||
printk(" e_type[%04x] e_machine[%04x] e_version[%08lx]\n",
|
pr_debug("%x>\n", ehp->e_ident[i]);
|
||||||
|
pr_debug(" e_type[%04x] e_machine[%04x] e_version[%08lx]\n",
|
||||||
(unsigned short) ehp->e_type, (unsigned short) ehp->e_machine,
|
(unsigned short) ehp->e_type, (unsigned short) ehp->e_machine,
|
||||||
(unsigned long) ehp->e_version);
|
(unsigned long) ehp->e_version);
|
||||||
printk(" e_entry[%08lx] e_phoff[%08lx] e_shoff[%08lx] "
|
pr_debug(" e_entry[%08lx] e_phoff[%08lx] e_shoff[%08lx] "
|
||||||
"e_flags[%08lx]\n",
|
"e_flags[%08lx]\n",
|
||||||
(unsigned long) ehp->e_entry, (unsigned long) ehp->e_phoff,
|
(unsigned long) ehp->e_entry, (unsigned long) ehp->e_phoff,
|
||||||
(unsigned long) ehp->e_shoff, (unsigned long) ehp->e_flags);
|
(unsigned long) ehp->e_shoff, (unsigned long) ehp->e_flags);
|
||||||
printk(" e_ehsize[%04x] e_phentsize[%04x] e_phnum[%04x]\n",
|
pr_debug(" e_ehsize[%04x] e_phentsize[%04x] e_phnum[%04x]\n",
|
||||||
(unsigned short) ehp->e_ehsize, (unsigned short) ehp->e_phentsize,
|
(unsigned short) ehp->e_ehsize,
|
||||||
|
(unsigned short) ehp->e_phentsize,
|
||||||
(unsigned short) ehp->e_phnum);
|
(unsigned short) ehp->e_phnum);
|
||||||
printk(" e_shentsize[%04x] e_shnum[%04x] e_shstrndx[%04x]\n",
|
pr_debug(" e_shentsize[%04x] e_shnum[%04x] e_shstrndx[%04x]\n",
|
||||||
(unsigned short) ehp->e_shentsize, (unsigned short) ehp->e_shnum,
|
(unsigned short) ehp->e_shentsize,
|
||||||
|
(unsigned short) ehp->e_shnum,
|
||||||
(unsigned short) ehp->e_shstrndx);
|
(unsigned short) ehp->e_shstrndx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_phdr(int i, struct elf_phdr *ep)
|
static void print_phdr(int i, struct elf_phdr *ep)
|
||||||
{
|
{
|
||||||
printk("PHDR[%d]: p_type[%s] p_offset[%08lx] p_vaddr[%08lx] "
|
pr_debug("PHDR[%d]: p_type[%s] p_offset[%08lx] p_vaddr[%08lx] "
|
||||||
"p_paddr[%08lx]\n", i, get_elf_p_type(ep->p_type),
|
"p_paddr[%08lx]\n", i, get_elf_p_type(ep->p_type),
|
||||||
(unsigned long) ep->p_offset, (unsigned long) ep->p_vaddr,
|
(unsigned long) ep->p_offset, (unsigned long) ep->p_vaddr,
|
||||||
(unsigned long) ep->p_paddr);
|
(unsigned long) ep->p_paddr);
|
||||||
printk(" p_filesz[%08lx] p_memsz[%08lx] p_flags[%08lx] "
|
pr_debug(" p_filesz[%08lx] p_memsz[%08lx] p_flags[%08lx] "
|
||||||
"p_align[%08lx]\n", (unsigned long) ep->p_filesz,
|
"p_align[%08lx]\n", (unsigned long) ep->p_filesz,
|
||||||
(unsigned long) ep->p_memsz, (unsigned long) ep->p_flags,
|
(unsigned long) ep->p_memsz, (unsigned long) ep->p_flags,
|
||||||
(unsigned long) ep->p_align);
|
(unsigned long) ep->p_align);
|
||||||
|
@ -117,7 +148,6 @@ static void dump_phdrs(struct elf_phdr *ep, int pnum)
|
||||||
print_phdr(i, ep);
|
print_phdr(i, ep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* DEBUG */
|
|
||||||
|
|
||||||
static void set_brk(unsigned long start, unsigned long end)
|
static void set_brk(unsigned long start, unsigned long end)
|
||||||
{
|
{
|
||||||
|
@ -156,11 +186,10 @@ static unsigned long * create_irix_tables(char * p, int argc, int envc,
|
||||||
elf_addr_t *envp;
|
elf_addr_t *envp;
|
||||||
elf_addr_t *sp, *csp;
|
elf_addr_t *sp, *csp;
|
||||||
|
|
||||||
#ifdef DEBUG
|
pr_debug("create_irix_tables: p[%p] argc[%d] envc[%d] "
|
||||||
printk("create_irix_tables: p[%p] argc[%d] envc[%d] "
|
|
||||||
"load_addr[%08x] interp_load_addr[%08x]\n",
|
"load_addr[%08x] interp_load_addr[%08x]\n",
|
||||||
p, argc, envc, load_addr, interp_load_addr);
|
p, argc, envc, load_addr, interp_load_addr);
|
||||||
#endif
|
|
||||||
sp = (elf_addr_t *) (~15UL & (unsigned long) p);
|
sp = (elf_addr_t *) (~15UL & (unsigned long) p);
|
||||||
csp = sp;
|
csp = sp;
|
||||||
csp -= exec ? DLINFO_ITEMS*2 : 2;
|
csp -= exec ? DLINFO_ITEMS*2 : 2;
|
||||||
|
@ -245,9 +274,7 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
|
||||||
last_bss = 0;
|
last_bss = 0;
|
||||||
error = load_addr = 0;
|
error = load_addr = 0;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
print_elfhdr(interp_elf_ex);
|
print_elfhdr(interp_elf_ex);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* First of all, some simple consistency checks */
|
/* First of all, some simple consistency checks */
|
||||||
if ((interp_elf_ex->e_type != ET_EXEC &&
|
if ((interp_elf_ex->e_type != ET_EXEC &&
|
||||||
|
@ -286,9 +313,7 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
|
||||||
(char *) elf_phdata,
|
(char *) elf_phdata,
|
||||||
sizeof(struct elf_phdr) * interp_elf_ex->e_phnum);
|
sizeof(struct elf_phdr) * interp_elf_ex->e_phnum);
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
dump_phdrs(elf_phdata, interp_elf_ex->e_phnum);
|
dump_phdrs(elf_phdata, interp_elf_ex->e_phnum);
|
||||||
#endif
|
|
||||||
|
|
||||||
eppnt = elf_phdata;
|
eppnt = elf_phdata;
|
||||||
for (i = 0; i < interp_elf_ex->e_phnum; i++, eppnt++) {
|
for (i = 0; i < interp_elf_ex->e_phnum; i++, eppnt++) {
|
||||||
|
@ -296,17 +321,25 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
|
||||||
int elf_type = MAP_PRIVATE | MAP_DENYWRITE;
|
int elf_type = MAP_PRIVATE | MAP_DENYWRITE;
|
||||||
int elf_prot = 0;
|
int elf_prot = 0;
|
||||||
unsigned long vaddr = 0;
|
unsigned long vaddr = 0;
|
||||||
if (eppnt->p_flags & PF_R) elf_prot = PROT_READ;
|
if (eppnt->p_flags & PF_R)
|
||||||
if (eppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
|
elf_prot = PROT_READ;
|
||||||
if (eppnt->p_flags & PF_X) elf_prot |= PROT_EXEC;
|
if (eppnt->p_flags & PF_W)
|
||||||
|
elf_prot |= PROT_WRITE;
|
||||||
|
if (eppnt->p_flags & PF_X)
|
||||||
|
elf_prot |= PROT_EXEC;
|
||||||
elf_type |= MAP_FIXED;
|
elf_type |= MAP_FIXED;
|
||||||
vaddr = eppnt->p_vaddr;
|
vaddr = eppnt->p_vaddr;
|
||||||
|
|
||||||
pr_debug("INTERP do_mmap(%p, %08lx, %08lx, %08lx, %08lx, %08lx) ",
|
pr_debug("INTERP do_mmap"
|
||||||
|
"(%p, %08lx, %08lx, %08lx, %08lx, %08lx) ",
|
||||||
interpreter, vaddr,
|
interpreter, vaddr,
|
||||||
(unsigned long) (eppnt->p_filesz + (eppnt->p_vaddr & 0xfff)),
|
(unsigned long)
|
||||||
(unsigned long) elf_prot, (unsigned long) elf_type,
|
(eppnt->p_filesz + (eppnt->p_vaddr & 0xfff)),
|
||||||
(unsigned long) (eppnt->p_offset & 0xfffff000));
|
(unsigned long)
|
||||||
|
elf_prot, (unsigned long) elf_type,
|
||||||
|
(unsigned long)
|
||||||
|
(eppnt->p_offset & 0xfffff000));
|
||||||
|
|
||||||
down_write(¤t->mm->mmap_sem);
|
down_write(¤t->mm->mmap_sem);
|
||||||
error = do_mmap(interpreter, vaddr,
|
error = do_mmap(interpreter, vaddr,
|
||||||
eppnt->p_filesz + (eppnt->p_vaddr & 0xfff),
|
eppnt->p_filesz + (eppnt->p_vaddr & 0xfff),
|
||||||
|
@ -315,7 +348,8 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
|
||||||
up_write(¤t->mm->mmap_sem);
|
up_write(¤t->mm->mmap_sem);
|
||||||
|
|
||||||
if (error < 0 && error > -1024) {
|
if (error < 0 && error > -1024) {
|
||||||
printk("Aieee IRIX interp mmap error=%d\n", error);
|
printk("Aieee IRIX interp mmap error=%d\n",
|
||||||
|
error);
|
||||||
break; /* Real error */
|
break; /* Real error */
|
||||||
}
|
}
|
||||||
pr_debug("error=%08lx ", (unsigned long) error);
|
pr_debug("error=%08lx ", (unsigned long) error);
|
||||||
|
@ -324,17 +358,20 @@ static unsigned int load_irix_interp(struct elfhdr * interp_elf_ex,
|
||||||
pr_debug("load_addr = error ");
|
pr_debug("load_addr = error ");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the end of the file mapping for this phdr, and keep
|
/*
|
||||||
* track of the largest address we see for this.
|
* Find the end of the file mapping for this phdr, and
|
||||||
|
* keep track of the largest address we see for this.
|
||||||
*/
|
*/
|
||||||
k = eppnt->p_vaddr + eppnt->p_filesz;
|
k = eppnt->p_vaddr + eppnt->p_filesz;
|
||||||
if(k > elf_bss) elf_bss = k;
|
if (k > elf_bss)
|
||||||
|
elf_bss = k;
|
||||||
|
|
||||||
/* Do the same thing for the memory mapping - between
|
/* Do the same thing for the memory mapping - between
|
||||||
* elf_bss and last_bss is the bss section.
|
* elf_bss and last_bss is the bss section.
|
||||||
*/
|
*/
|
||||||
k = eppnt->p_memsz + eppnt->p_vaddr;
|
k = eppnt->p_memsz + eppnt->p_vaddr;
|
||||||
if(k > last_bss) last_bss = k;
|
if (k > last_bss)
|
||||||
|
last_bss = k;
|
||||||
pr_debug("\n");
|
pr_debug("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -604,9 +641,7 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
|
||||||
if (elf_ex.e_shnum > 20)
|
if (elf_ex.e_shnum > 20)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
print_elfhdr(&elf_ex);
|
print_elfhdr(&elf_ex);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Now read in all of the header information */
|
/* Now read in all of the header information */
|
||||||
size = elf_ex.e_phentsize * elf_ex.e_phnum;
|
size = elf_ex.e_phentsize * elf_ex.e_phnum;
|
||||||
|
@ -622,9 +657,7 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
|
||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
goto out_free_ph;
|
goto out_free_ph;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
dump_phdrs(elf_phdata, elf_ex.e_phnum);
|
dump_phdrs(elf_phdata, elf_ex.e_phnum);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set some things for later. */
|
/* Set some things for later. */
|
||||||
for (i = 0; i < elf_ex.e_phnum; i++) {
|
for (i = 0; i < elf_ex.e_phnum; i++) {
|
||||||
|
@ -889,9 +922,7 @@ unsigned long irix_mapelf(int fd, struct elf_phdr __user *user_phdrp, int cnt)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
dump_phdrs(user_phdrp, cnt);
|
dump_phdrs(user_phdrp, cnt);
|
||||||
#endif
|
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++, hp++) {
|
for (i = 0; i < cnt; i++, hp++) {
|
||||||
if (__get_user(type, &hp->p_type))
|
if (__get_user(type, &hp->p_type))
|
||||||
|
@ -1015,8 +1046,6 @@ static int notesize(struct memelfnote *en)
|
||||||
return sz;
|
return sz;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #define DEBUG */
|
|
||||||
|
|
||||||
#define DUMP_WRITE(addr, nr) \
|
#define DUMP_WRITE(addr, nr) \
|
||||||
if (!dump_write(file, (addr), (nr))) \
|
if (!dump_write(file, (addr), (nr))) \
|
||||||
goto end_coredump;
|
goto end_coredump;
|
||||||
|
@ -1093,9 +1122,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
|
||||||
|
|
||||||
segs++;
|
segs++;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
pr_debug("irix_core_dump: %d segs taking %d bytes\n", segs, size);
|
||||||
printk("irix_core_dump: %d segs taking %d bytes\n", segs, size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Set up header. */
|
/* Set up header. */
|
||||||
memcpy(elf.e_ident, ELFMAG, SELFMAG);
|
memcpy(elf.e_ident, ELFMAG, SELFMAG);
|
||||||
|
@ -1284,9 +1311,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
|
||||||
if (!maydump(vma))
|
if (!maydump(vma))
|
||||||
continue;
|
continue;
|
||||||
i++;
|
i++;
|
||||||
#ifdef DEBUG
|
pr_debug("elf_core_dump: writing %08lx %lx\n", addr, len);
|
||||||
printk("elf_core_dump: writing %08lx %lx\n", addr, len);
|
|
||||||
#endif
|
|
||||||
DUMP_WRITE((void __user *)addr, len);
|
DUMP_WRITE((void __user *)addr, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ msc_bind_eic_interrupt (unsigned int irq, unsigned int set)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct irq_chip msc_levelirq_type = {
|
struct irq_chip msc_levelirq_type = {
|
||||||
.typename = "SOC-it-Level",
|
.name = "SOC-it-Level",
|
||||||
.ack = level_mask_and_ack_msc_irq,
|
.ack = level_mask_and_ack_msc_irq,
|
||||||
.mask = mask_msc_irq,
|
.mask = mask_msc_irq,
|
||||||
.mask_ack = level_mask_and_ack_msc_irq,
|
.mask_ack = level_mask_and_ack_msc_irq,
|
||||||
|
@ -122,7 +122,7 @@ struct irq_chip msc_levelirq_type = {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct irq_chip msc_edgeirq_type = {
|
struct irq_chip msc_edgeirq_type = {
|
||||||
.typename = "SOC-it-Edge",
|
.name = "SOC-it-Edge",
|
||||||
.ack = edge_mask_and_ack_msc_irq,
|
.ack = edge_mask_and_ack_msc_irq,
|
||||||
.mask = mask_msc_irq,
|
.mask = mask_msc_irq,
|
||||||
.mask_ack = edge_mask_and_ack_msc_irq,
|
.mask_ack = edge_mask_and_ack_msc_irq,
|
||||||
|
|
|
@ -92,7 +92,7 @@ void ll_mv64340_irq(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct irq_chip mv64340_irq_type = {
|
struct irq_chip mv64340_irq_type = {
|
||||||
.typename = "MV-64340",
|
.name = "MV-64340",
|
||||||
.ack = mask_mv64340_irq,
|
.ack = mask_mv64340_irq,
|
||||||
.mask = mask_mv64340_irq,
|
.mask = mask_mv64340_irq,
|
||||||
.mask_ack = mask_mv64340_irq,
|
.mask_ack = mask_mv64340_irq,
|
||||||
|
|
|
@ -17,28 +17,27 @@
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
|
|
||||||
static int irq_base;
|
|
||||||
|
|
||||||
static inline void unmask_rm7k_irq(unsigned int irq)
|
static inline void unmask_rm7k_irq(unsigned int irq)
|
||||||
{
|
{
|
||||||
set_c0_intcontrol(0x100 << (irq - irq_base));
|
set_c0_intcontrol(0x100 << (irq - RM7K_CPU_IRQ_BASE));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void mask_rm7k_irq(unsigned int irq)
|
static inline void mask_rm7k_irq(unsigned int irq)
|
||||||
{
|
{
|
||||||
clear_c0_intcontrol(0x100 << (irq - irq_base));
|
clear_c0_intcontrol(0x100 << (irq - RM7K_CPU_IRQ_BASE));
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip rm7k_irq_controller = {
|
static struct irq_chip rm7k_irq_controller = {
|
||||||
.typename = "RM7000",
|
.name = "RM7000",
|
||||||
.ack = mask_rm7k_irq,
|
.ack = mask_rm7k_irq,
|
||||||
.mask = mask_rm7k_irq,
|
.mask = mask_rm7k_irq,
|
||||||
.mask_ack = mask_rm7k_irq,
|
.mask_ack = mask_rm7k_irq,
|
||||||
.unmask = unmask_rm7k_irq,
|
.unmask = unmask_rm7k_irq,
|
||||||
};
|
};
|
||||||
|
|
||||||
void __init rm7k_cpu_irq_init(int base)
|
void __init rm7k_cpu_irq_init(void)
|
||||||
{
|
{
|
||||||
|
int base = RM7K_CPU_IRQ_BASE;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
clear_c0_intcontrol(0x00000f00); /* Mask all */
|
clear_c0_intcontrol(0x00000f00); /* Mask all */
|
||||||
|
@ -46,6 +45,4 @@ void __init rm7k_cpu_irq_init(int base)
|
||||||
for (i = base; i < base + 4; i++)
|
for (i = base; i < base + 4; i++)
|
||||||
set_irq_chip_and_handler(i, &rm7k_irq_controller,
|
set_irq_chip_and_handler(i, &rm7k_irq_controller,
|
||||||
handle_level_irq);
|
handle_level_irq);
|
||||||
|
|
||||||
irq_base = base;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,16 +18,14 @@
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
|
|
||||||
static int irq_base;
|
|
||||||
|
|
||||||
static inline void unmask_rm9k_irq(unsigned int irq)
|
static inline void unmask_rm9k_irq(unsigned int irq)
|
||||||
{
|
{
|
||||||
set_c0_intcontrol(0x1000 << (irq - irq_base));
|
set_c0_intcontrol(0x1000 << (irq - RM9K_CPU_IRQ_BASE));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void mask_rm9k_irq(unsigned int irq)
|
static inline void mask_rm9k_irq(unsigned int irq)
|
||||||
{
|
{
|
||||||
clear_c0_intcontrol(0x1000 << (irq - irq_base));
|
clear_c0_intcontrol(0x1000 << (irq - RM9K_CPU_IRQ_BASE));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void rm9k_cpu_irq_enable(unsigned int irq)
|
static inline void rm9k_cpu_irq_enable(unsigned int irq)
|
||||||
|
@ -39,15 +37,6 @@ static inline void rm9k_cpu_irq_enable(unsigned int irq)
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rm9k_cpu_irq_disable(unsigned int irq)
|
|
||||||
{
|
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
local_irq_save(flags);
|
|
||||||
mask_rm9k_irq(irq);
|
|
||||||
local_irq_restore(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Performance counter interrupts are global on all processors.
|
* Performance counter interrupts are global on all processors.
|
||||||
*/
|
*/
|
||||||
|
@ -81,7 +70,7 @@ static void rm9k_perfcounter_irq_shutdown(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip rm9k_irq_controller = {
|
static struct irq_chip rm9k_irq_controller = {
|
||||||
.typename = "RM9000",
|
.name = "RM9000",
|
||||||
.ack = mask_rm9k_irq,
|
.ack = mask_rm9k_irq,
|
||||||
.mask = mask_rm9k_irq,
|
.mask = mask_rm9k_irq,
|
||||||
.mask_ack = mask_rm9k_irq,
|
.mask_ack = mask_rm9k_irq,
|
||||||
|
@ -89,7 +78,7 @@ static struct irq_chip rm9k_irq_controller = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct irq_chip rm9k_perfcounter_irq = {
|
static struct irq_chip rm9k_perfcounter_irq = {
|
||||||
.typename = "RM9000",
|
.name = "RM9000",
|
||||||
.startup = rm9k_perfcounter_irq_startup,
|
.startup = rm9k_perfcounter_irq_startup,
|
||||||
.shutdown = rm9k_perfcounter_irq_shutdown,
|
.shutdown = rm9k_perfcounter_irq_shutdown,
|
||||||
.ack = mask_rm9k_irq,
|
.ack = mask_rm9k_irq,
|
||||||
|
@ -102,8 +91,9 @@ unsigned int rm9000_perfcount_irq;
|
||||||
|
|
||||||
EXPORT_SYMBOL(rm9000_perfcount_irq);
|
EXPORT_SYMBOL(rm9000_perfcount_irq);
|
||||||
|
|
||||||
void __init rm9k_cpu_irq_init(int base)
|
void __init rm9k_cpu_irq_init(void)
|
||||||
{
|
{
|
||||||
|
int base = RM9K_CPU_IRQ_BASE;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
clear_c0_intcontrol(0x0000f000); /* Mask all */
|
clear_c0_intcontrol(0x0000f000); /* Mask all */
|
||||||
|
@ -115,6 +105,4 @@ void __init rm9k_cpu_irq_init(int base)
|
||||||
rm9000_perfcount_irq = base + 1;
|
rm9000_perfcount_irq = base + 1;
|
||||||
set_irq_chip_and_handler(rm9000_perfcount_irq, &rm9k_perfcounter_irq,
|
set_irq_chip_and_handler(rm9000_perfcount_irq, &rm9k_perfcounter_irq,
|
||||||
handle_level_irq);
|
handle_level_irq);
|
||||||
|
|
||||||
irq_base = base;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
* Don't even think about using this on SMP. You have been warned.
|
* Don't even think about using this on SMP. You have been warned.
|
||||||
*
|
*
|
||||||
* This file exports one global function:
|
* This file exports one global function:
|
||||||
* void mips_cpu_irq_init(int irq_base);
|
* void mips_cpu_irq_init(void);
|
||||||
*/
|
*/
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
|
@ -36,22 +36,20 @@
|
||||||
#include <asm/mipsmtregs.h>
|
#include <asm/mipsmtregs.h>
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
|
|
||||||
static int mips_cpu_irq_base;
|
|
||||||
|
|
||||||
static inline void unmask_mips_irq(unsigned int irq)
|
static inline void unmask_mips_irq(unsigned int irq)
|
||||||
{
|
{
|
||||||
set_c0_status(0x100 << (irq - mips_cpu_irq_base));
|
set_c0_status(0x100 << (irq - MIPS_CPU_IRQ_BASE));
|
||||||
irq_enable_hazard();
|
irq_enable_hazard();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void mask_mips_irq(unsigned int irq)
|
static inline void mask_mips_irq(unsigned int irq)
|
||||||
{
|
{
|
||||||
clear_c0_status(0x100 << (irq - mips_cpu_irq_base));
|
clear_c0_status(0x100 << (irq - MIPS_CPU_IRQ_BASE));
|
||||||
irq_disable_hazard();
|
irq_disable_hazard();
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip mips_cpu_irq_controller = {
|
static struct irq_chip mips_cpu_irq_controller = {
|
||||||
.typename = "MIPS",
|
.name = "MIPS",
|
||||||
.ack = mask_mips_irq,
|
.ack = mask_mips_irq,
|
||||||
.mask = mask_mips_irq,
|
.mask = mask_mips_irq,
|
||||||
.mask_ack = mask_mips_irq,
|
.mask_ack = mask_mips_irq,
|
||||||
|
@ -70,7 +68,7 @@ static unsigned int mips_mt_cpu_irq_startup(unsigned int irq)
|
||||||
{
|
{
|
||||||
unsigned int vpflags = dvpe();
|
unsigned int vpflags = dvpe();
|
||||||
|
|
||||||
clear_c0_cause(0x100 << (irq - mips_cpu_irq_base));
|
clear_c0_cause(0x100 << (irq - MIPS_CPU_IRQ_BASE));
|
||||||
evpe(vpflags);
|
evpe(vpflags);
|
||||||
unmask_mips_mt_irq(irq);
|
unmask_mips_mt_irq(irq);
|
||||||
|
|
||||||
|
@ -84,13 +82,13 @@ static unsigned int mips_mt_cpu_irq_startup(unsigned int irq)
|
||||||
static void mips_mt_cpu_irq_ack(unsigned int irq)
|
static void mips_mt_cpu_irq_ack(unsigned int irq)
|
||||||
{
|
{
|
||||||
unsigned int vpflags = dvpe();
|
unsigned int vpflags = dvpe();
|
||||||
clear_c0_cause(0x100 << (irq - mips_cpu_irq_base));
|
clear_c0_cause(0x100 << (irq - MIPS_CPU_IRQ_BASE));
|
||||||
evpe(vpflags);
|
evpe(vpflags);
|
||||||
mask_mips_mt_irq(irq);
|
mask_mips_mt_irq(irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip mips_mt_cpu_irq_controller = {
|
static struct irq_chip mips_mt_cpu_irq_controller = {
|
||||||
.typename = "MIPS",
|
.name = "MIPS",
|
||||||
.startup = mips_mt_cpu_irq_startup,
|
.startup = mips_mt_cpu_irq_startup,
|
||||||
.ack = mips_mt_cpu_irq_ack,
|
.ack = mips_mt_cpu_irq_ack,
|
||||||
.mask = mask_mips_mt_irq,
|
.mask = mask_mips_mt_irq,
|
||||||
|
@ -99,8 +97,9 @@ static struct irq_chip mips_mt_cpu_irq_controller = {
|
||||||
.eoi = unmask_mips_mt_irq,
|
.eoi = unmask_mips_mt_irq,
|
||||||
};
|
};
|
||||||
|
|
||||||
void __init mips_cpu_irq_init(int irq_base)
|
void __init mips_cpu_irq_init(void)
|
||||||
{
|
{
|
||||||
|
int irq_base = MIPS_CPU_IRQ_BASE;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Mask interrupts. */
|
/* Mask interrupts. */
|
||||||
|
@ -118,6 +117,4 @@ void __init mips_cpu_irq_init(int irq_base)
|
||||||
for (i = irq_base + 2; i < irq_base + 8; i++)
|
for (i = irq_base + 2; i < irq_base + 8; i++)
|
||||||
set_irq_chip_and_handler(i, &mips_cpu_irq_controller,
|
set_irq_chip_and_handler(i, &mips_cpu_irq_controller,
|
||||||
handle_level_irq);
|
handle_level_irq);
|
||||||
|
|
||||||
mips_cpu_irq_base = irq_base;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,6 +96,10 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
retval = security_task_setscheduler(p, 0, NULL);
|
||||||
|
if (retval)
|
||||||
|
goto out_unlock;
|
||||||
|
|
||||||
/* Record new user-specified CPU set for future reference */
|
/* Record new user-specified CPU set for future reference */
|
||||||
p->thread.user_cpus_allowed = new_mask;
|
p->thread.user_cpus_allowed = new_mask;
|
||||||
|
|
||||||
|
@ -141,8 +145,9 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len,
|
||||||
p = find_process_by_pid(pid);
|
p = find_process_by_pid(pid);
|
||||||
if (!p)
|
if (!p)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
retval = security_task_getscheduler(p);
|
||||||
retval = 0;
|
if (retval)
|
||||||
|
goto out_unlock;
|
||||||
|
|
||||||
cpus_and(mask, p->thread.user_cpus_allowed, cpu_possible_map);
|
cpus_and(mask, p->thread.user_cpus_allowed, cpu_possible_map);
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,6 @@
|
||||||
#include <asm/isadep.h>
|
#include <asm/isadep.h>
|
||||||
#include <asm/inst.h>
|
#include <asm/inst.h>
|
||||||
#include <asm/stacktrace.h>
|
#include <asm/stacktrace.h>
|
||||||
#ifdef CONFIG_MIPS_MT_SMTC
|
|
||||||
#include <asm/mipsmtregs.h>
|
|
||||||
extern void smtc_idle_loop_hook(void);
|
|
||||||
#endif /* CONFIG_MIPS_MT_SMTC */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The idle thread. There's no useful work to be done, so just try to conserve
|
* The idle thread. There's no useful work to be done, so just try to conserve
|
||||||
|
@ -57,6 +53,8 @@ ATTRIB_NORET void cpu_idle(void)
|
||||||
while (1) {
|
while (1) {
|
||||||
while (!need_resched()) {
|
while (!need_resched()) {
|
||||||
#ifdef CONFIG_MIPS_MT_SMTC
|
#ifdef CONFIG_MIPS_MT_SMTC
|
||||||
|
extern void smtc_idle_loop_hook(void);
|
||||||
|
|
||||||
smtc_idle_loop_hook();
|
smtc_idle_loop_hook();
|
||||||
#endif /* CONFIG_MIPS_MT_SMTC */
|
#endif /* CONFIG_MIPS_MT_SMTC */
|
||||||
if (cpu_wait)
|
if (cpu_wait)
|
||||||
|
|
|
@ -114,6 +114,14 @@ LEAF(_save_fp_context32)
|
||||||
*/
|
*/
|
||||||
LEAF(_restore_fp_context)
|
LEAF(_restore_fp_context)
|
||||||
EX lw t0, SC_FPC_CSR(a0)
|
EX lw t0, SC_FPC_CSR(a0)
|
||||||
|
|
||||||
|
/* Fail if the CSR has exceptions pending */
|
||||||
|
srl t1, t0, 5
|
||||||
|
and t1, t0
|
||||||
|
andi t1, 0x1f << 7
|
||||||
|
bnez t1, fault
|
||||||
|
nop
|
||||||
|
|
||||||
#ifdef CONFIG_64BIT
|
#ifdef CONFIG_64BIT
|
||||||
EX ldc1 $f1, SC_FPREGS+8(a0)
|
EX ldc1 $f1, SC_FPREGS+8(a0)
|
||||||
EX ldc1 $f3, SC_FPREGS+24(a0)
|
EX ldc1 $f3, SC_FPREGS+24(a0)
|
||||||
|
@ -157,6 +165,14 @@ LEAF(_restore_fp_context)
|
||||||
LEAF(_restore_fp_context32)
|
LEAF(_restore_fp_context32)
|
||||||
/* Restore an o32 sigcontext. */
|
/* Restore an o32 sigcontext. */
|
||||||
EX lw t0, SC32_FPC_CSR(a0)
|
EX lw t0, SC32_FPC_CSR(a0)
|
||||||
|
|
||||||
|
/* Fail if the CSR has exceptions pending */
|
||||||
|
srl t1, t0, 5
|
||||||
|
and t1, t0
|
||||||
|
andi t1, 0x1f << 7
|
||||||
|
bnez t1, fault
|
||||||
|
nop
|
||||||
|
|
||||||
EX ldc1 $f0, SC32_FPREGS+0(a0)
|
EX ldc1 $f0, SC32_FPREGS+0(a0)
|
||||||
EX ldc1 $f2, SC32_FPREGS+16(a0)
|
EX ldc1 $f2, SC32_FPREGS+16(a0)
|
||||||
EX ldc1 $f4, SC32_FPREGS+32(a0)
|
EX ldc1 $f4, SC32_FPREGS+32(a0)
|
||||||
|
@ -177,9 +193,10 @@ LEAF(_restore_fp_context32)
|
||||||
jr ra
|
jr ra
|
||||||
li v0, 0 # success
|
li v0, 0 # success
|
||||||
END(_restore_fp_context32)
|
END(_restore_fp_context32)
|
||||||
.set reorder
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
.set reorder
|
||||||
|
|
||||||
.type fault@function
|
.type fault@function
|
||||||
.ent fault
|
.ent fault
|
||||||
fault: li v0, -EFAULT # failure
|
fault: li v0, -EFAULT # failure
|
||||||
|
|
|
@ -63,7 +63,7 @@ extern void *vpe_get_shared(int index);
|
||||||
|
|
||||||
static void rtlx_dispatch(void)
|
static void rtlx_dispatch(void)
|
||||||
{
|
{
|
||||||
do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ);
|
do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_RTLX_IRQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -491,7 +491,7 @@ static struct irqaction rtlx_irq = {
|
||||||
.name = "RTLX",
|
.name = "RTLX",
|
||||||
};
|
};
|
||||||
|
|
||||||
static int rtlx_irq_num = MIPSCPU_INT_BASE + MIPS_CPU_RTLX_IRQ;
|
static int rtlx_irq_num = MIPS_CPU_IRQ_BASE + MIPS_CPU_RTLX_IRQ;
|
||||||
|
|
||||||
static char register_chrdev_failed[] __initdata =
|
static char register_chrdev_failed[] __initdata =
|
||||||
KERN_ERR "rtlx_module_init: unable to register device\n";
|
KERN_ERR "rtlx_module_init: unable to register device\n";
|
||||||
|
|
|
@ -384,7 +384,7 @@ EXPORT(sysn32_call_table)
|
||||||
PTR sys_readlinkat
|
PTR sys_readlinkat
|
||||||
PTR sys_fchmodat
|
PTR sys_fchmodat
|
||||||
PTR sys_faccessat
|
PTR sys_faccessat
|
||||||
PTR sys_pselect6
|
PTR compat_sys_pselect6
|
||||||
PTR sys_ppoll /* 6265 */
|
PTR sys_ppoll /* 6265 */
|
||||||
PTR sys_unshare
|
PTR sys_unshare
|
||||||
PTR sys_splice
|
PTR sys_splice
|
||||||
|
|
|
@ -506,7 +506,7 @@ sys_call_table:
|
||||||
PTR sys_readlinkat
|
PTR sys_readlinkat
|
||||||
PTR sys_fchmodat
|
PTR sys_fchmodat
|
||||||
PTR sys_faccessat /* 4300 */
|
PTR sys_faccessat /* 4300 */
|
||||||
PTR sys_pselect6
|
PTR compat_sys_pselect6
|
||||||
PTR sys_ppoll
|
PTR sys_ppoll
|
||||||
PTR sys_unshare
|
PTR sys_unshare
|
||||||
PTR sys_splice
|
PTR sys_splice
|
||||||
|
|
|
@ -271,8 +271,7 @@ static void __init bootmem_init(void)
|
||||||
static void __init bootmem_init(void)
|
static void __init bootmem_init(void)
|
||||||
{
|
{
|
||||||
unsigned long reserved_end;
|
unsigned long reserved_end;
|
||||||
unsigned long highest = 0;
|
unsigned long mapstart = ~0UL;
|
||||||
unsigned long mapstart = -1UL;
|
|
||||||
unsigned long bootmap_size;
|
unsigned long bootmap_size;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -283,6 +282,13 @@ static void __init bootmem_init(void)
|
||||||
*/
|
*/
|
||||||
reserved_end = max(init_initrd(), PFN_UP(__pa_symbol(&_end)));
|
reserved_end = max(init_initrd(), PFN_UP(__pa_symbol(&_end)));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* max_low_pfn is not a number of pages. The number of pages
|
||||||
|
* of the system is given by 'max_low_pfn - min_low_pfn'.
|
||||||
|
*/
|
||||||
|
min_low_pfn = ~0UL;
|
||||||
|
max_low_pfn = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find the highest page frame number we have available.
|
* Find the highest page frame number we have available.
|
||||||
*/
|
*/
|
||||||
|
@ -296,8 +302,10 @@ static void __init bootmem_init(void)
|
||||||
end = PFN_DOWN(boot_mem_map.map[i].addr
|
end = PFN_DOWN(boot_mem_map.map[i].addr
|
||||||
+ boot_mem_map.map[i].size);
|
+ boot_mem_map.map[i].size);
|
||||||
|
|
||||||
if (end > highest)
|
if (end > max_low_pfn)
|
||||||
highest = end;
|
max_low_pfn = end;
|
||||||
|
if (start < min_low_pfn)
|
||||||
|
min_low_pfn = start;
|
||||||
if (end <= reserved_end)
|
if (end <= reserved_end)
|
||||||
continue;
|
continue;
|
||||||
if (start >= mapstart)
|
if (start >= mapstart)
|
||||||
|
@ -305,22 +313,36 @@ static void __init bootmem_init(void)
|
||||||
mapstart = max(reserved_end, start);
|
mapstart = max(reserved_end, start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (min_low_pfn >= max_low_pfn)
|
||||||
|
panic("Incorrect memory mapping !!!");
|
||||||
|
if (min_low_pfn > ARCH_PFN_OFFSET) {
|
||||||
|
printk(KERN_INFO
|
||||||
|
"Wasting %lu bytes for tracking %lu unused pages\n",
|
||||||
|
(min_low_pfn - ARCH_PFN_OFFSET) * sizeof(struct page),
|
||||||
|
min_low_pfn - ARCH_PFN_OFFSET);
|
||||||
|
} else if (min_low_pfn < ARCH_PFN_OFFSET) {
|
||||||
|
printk(KERN_INFO
|
||||||
|
"%lu free pages won't be used\n",
|
||||||
|
ARCH_PFN_OFFSET - min_low_pfn);
|
||||||
|
}
|
||||||
|
min_low_pfn = ARCH_PFN_OFFSET;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Determine low and high memory ranges
|
* Determine low and high memory ranges
|
||||||
*/
|
*/
|
||||||
if (highest > PFN_DOWN(HIGHMEM_START)) {
|
if (max_low_pfn > PFN_DOWN(HIGHMEM_START)) {
|
||||||
#ifdef CONFIG_HIGHMEM
|
#ifdef CONFIG_HIGHMEM
|
||||||
highstart_pfn = PFN_DOWN(HIGHMEM_START);
|
highstart_pfn = PFN_DOWN(HIGHMEM_START);
|
||||||
highend_pfn = highest;
|
highend_pfn = max_low_pfn;
|
||||||
#endif
|
#endif
|
||||||
highest = PFN_DOWN(HIGHMEM_START);
|
max_low_pfn = PFN_DOWN(HIGHMEM_START);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the boot-time allocator with low memory only.
|
* Initialize the boot-time allocator with low memory only.
|
||||||
*/
|
*/
|
||||||
bootmap_size = init_bootmem(mapstart, highest);
|
bootmap_size = init_bootmem_node(NODE_DATA(0), mapstart,
|
||||||
|
min_low_pfn, max_low_pfn);
|
||||||
/*
|
/*
|
||||||
* Register fully available low RAM pages with the bootmem allocator.
|
* Register fully available low RAM pages with the bootmem allocator.
|
||||||
*/
|
*/
|
||||||
|
@ -541,3 +563,6 @@ int __init dsp_disable(char *s)
|
||||||
}
|
}
|
||||||
|
|
||||||
__setup("nodsp", dsp_disable);
|
__setup("nodsp", dsp_disable);
|
||||||
|
|
||||||
|
unsigned long kernelsp[NR_CPUS];
|
||||||
|
unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
#include <asm/mipsregs.h>
|
#include <asm/mipsregs.h>
|
||||||
#include <asm/mipsmtregs.h>
|
#include <asm/mipsmtregs.h>
|
||||||
#include <asm/mips_mt.h>
|
#include <asm/mips_mt.h>
|
||||||
#include <asm/mips-boards/maltaint.h> /* This is f*cking wrong */
|
|
||||||
|
|
||||||
#define MIPS_CPU_IPI_RESCHED_IRQ 0
|
#define MIPS_CPU_IPI_RESCHED_IRQ 0
|
||||||
#define MIPS_CPU_IPI_CALL_IRQ 1
|
#define MIPS_CPU_IPI_CALL_IRQ 1
|
||||||
|
@ -108,12 +107,12 @@ void __init sanitize_tlb_entries(void)
|
||||||
|
|
||||||
static void ipi_resched_dispatch(void)
|
static void ipi_resched_dispatch(void)
|
||||||
{
|
{
|
||||||
do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ);
|
do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_RESCHED_IRQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ipi_call_dispatch(void)
|
static void ipi_call_dispatch(void)
|
||||||
{
|
{
|
||||||
do_IRQ(MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ);
|
do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
|
static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
|
||||||
|
@ -270,8 +269,8 @@ void __init plat_prepare_cpus(unsigned int max_cpus)
|
||||||
set_vi_handler(MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch);
|
set_vi_handler(MIPS_CPU_IPI_CALL_IRQ, ipi_call_dispatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
cpu_ipi_resched_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_RESCHED_IRQ;
|
cpu_ipi_resched_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_RESCHED_IRQ;
|
||||||
cpu_ipi_call_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_CALL_IRQ;
|
cpu_ipi_call_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ;
|
||||||
|
|
||||||
setup_irq(cpu_ipi_resched_irq, &irq_resched);
|
setup_irq(cpu_ipi_resched_irq, &irq_resched);
|
||||||
setup_irq(cpu_ipi_call_irq, &irq_call);
|
setup_irq(cpu_ipi_call_irq, &irq_call);
|
||||||
|
|
|
@ -26,16 +26,6 @@
|
||||||
* This file should be built into the kernel only if CONFIG_MIPS_MT_SMTC is set.
|
* This file should be built into the kernel only if CONFIG_MIPS_MT_SMTC is set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* MIPSCPU_INT_BASE is identically defined in both
|
|
||||||
* asm-mips/mips-boards/maltaint.h and asm-mips/mips-boards/simint.h,
|
|
||||||
* but as yet there's no properly organized include structure that
|
|
||||||
* will ensure that the right *int.h file will be included for a
|
|
||||||
* given platform build.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MIPSCPU_INT_BASE 16
|
|
||||||
|
|
||||||
#define MIPS_CPU_IPI_IRQ 1
|
#define MIPS_CPU_IPI_IRQ 1
|
||||||
|
|
||||||
#define LOCK_MT_PRA() \
|
#define LOCK_MT_PRA() \
|
||||||
|
@ -77,15 +67,15 @@ unsigned int ipi_timer_latch[NR_CPUS];
|
||||||
|
|
||||||
#define IPIBUF_PER_CPU 4
|
#define IPIBUF_PER_CPU 4
|
||||||
|
|
||||||
struct smtc_ipi_q IPIQ[NR_CPUS];
|
static struct smtc_ipi_q IPIQ[NR_CPUS];
|
||||||
struct smtc_ipi_q freeIPIq;
|
static struct smtc_ipi_q freeIPIq;
|
||||||
|
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
|
|
||||||
void ipi_decode(struct smtc_ipi *);
|
void ipi_decode(struct smtc_ipi *);
|
||||||
void post_direct_ipi(int cpu, struct smtc_ipi *pipi);
|
static void post_direct_ipi(int cpu, struct smtc_ipi *pipi);
|
||||||
void setup_cross_vpe_interrupts(void);
|
static void setup_cross_vpe_interrupts(void);
|
||||||
void init_smtc_stats(void);
|
void init_smtc_stats(void);
|
||||||
|
|
||||||
/* Global SMTC Status */
|
/* Global SMTC Status */
|
||||||
|
@ -200,7 +190,7 @@ void __init sanitize_tlb_entries(void)
|
||||||
* Configure shared TLB - VPC configuration bit must be set by caller
|
* Configure shared TLB - VPC configuration bit must be set by caller
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void smtc_configure_tlb(void)
|
static void smtc_configure_tlb(void)
|
||||||
{
|
{
|
||||||
int i,tlbsiz,vpes;
|
int i,tlbsiz,vpes;
|
||||||
unsigned long mvpconf0;
|
unsigned long mvpconf0;
|
||||||
|
@ -648,7 +638,7 @@ int setup_irq_smtc(unsigned int irq, struct irqaction * new,
|
||||||
* the VPE.
|
* the VPE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void smtc_ipi_qdump(void)
|
static void smtc_ipi_qdump(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -686,28 +676,6 @@ static __inline__ int atomic_postincrement(unsigned int *pv)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No longer used in IPI dispatch, but retained for future recycling */
|
|
||||||
|
|
||||||
static __inline__ int atomic_postclear(unsigned int *pv)
|
|
||||||
{
|
|
||||||
unsigned long result;
|
|
||||||
|
|
||||||
unsigned long temp;
|
|
||||||
|
|
||||||
__asm__ __volatile__(
|
|
||||||
"1: ll %0, %2 \n"
|
|
||||||
" or %1, $0, $0 \n"
|
|
||||||
" sc %1, %2 \n"
|
|
||||||
" beqz %1, 1b \n"
|
|
||||||
" sync \n"
|
|
||||||
: "=&r" (result), "=&r" (temp), "=m" (*pv)
|
|
||||||
: "m" (*pv)
|
|
||||||
: "memory");
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void smtc_send_ipi(int cpu, int type, unsigned int action)
|
void smtc_send_ipi(int cpu, int type, unsigned int action)
|
||||||
{
|
{
|
||||||
int tcstatus;
|
int tcstatus;
|
||||||
|
@ -781,7 +749,7 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
|
||||||
/*
|
/*
|
||||||
* Send IPI message to Halted TC, TargTC/TargVPE already having been set
|
* Send IPI message to Halted TC, TargTC/TargVPE already having been set
|
||||||
*/
|
*/
|
||||||
void post_direct_ipi(int cpu, struct smtc_ipi *pipi)
|
static void post_direct_ipi(int cpu, struct smtc_ipi *pipi)
|
||||||
{
|
{
|
||||||
struct pt_regs *kstack;
|
struct pt_regs *kstack;
|
||||||
unsigned long tcstatus;
|
unsigned long tcstatus;
|
||||||
|
@ -921,7 +889,7 @@ void smtc_timer_broadcast(int vpe)
|
||||||
* interrupts.
|
* interrupts.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int cpu_ipi_irq = MIPSCPU_INT_BASE + MIPS_CPU_IPI_IRQ;
|
static int cpu_ipi_irq = MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_IRQ;
|
||||||
|
|
||||||
static irqreturn_t ipi_interrupt(int irq, void *dev_idm)
|
static irqreturn_t ipi_interrupt(int irq, void *dev_idm)
|
||||||
{
|
{
|
||||||
|
@ -1000,7 +968,7 @@ static void ipi_irq_dispatch(void)
|
||||||
|
|
||||||
static struct irqaction irq_ipi;
|
static struct irqaction irq_ipi;
|
||||||
|
|
||||||
void setup_cross_vpe_interrupts(void)
|
static void setup_cross_vpe_interrupts(void)
|
||||||
{
|
{
|
||||||
if (!cpu_has_vint)
|
if (!cpu_has_vint)
|
||||||
panic("SMTC Kernel requires Vectored Interupt support");
|
panic("SMTC Kernel requires Vectored Interupt support");
|
||||||
|
@ -1296,7 +1264,7 @@ void smtc_flush_tlb_asid(unsigned long asid)
|
||||||
* Support for single-threading cache flush operations.
|
* Support for single-threading cache flush operations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int halt_state_save[NR_CPUS];
|
static int halt_state_save[NR_CPUS];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To really, really be sure that nothing is being done
|
* To really, really be sure that nothing is being done
|
||||||
|
|
|
@ -695,7 +695,7 @@ static void dump_tclist(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We are prepared so configure and start the VPE... */
|
/* We are prepared so configure and start the VPE... */
|
||||||
int vpe_run(struct vpe * v)
|
static int vpe_run(struct vpe * v)
|
||||||
{
|
{
|
||||||
struct vpe_notifications *n;
|
struct vpe_notifications *n;
|
||||||
unsigned long val, dmt_flag;
|
unsigned long val, dmt_flag;
|
||||||
|
@ -832,7 +832,7 @@ static int find_vpe_symbols(struct vpe * v, Elf_Shdr * sechdrs,
|
||||||
* contents of the program (p)buffer performing relocatations/etc, free's it
|
* contents of the program (p)buffer performing relocatations/etc, free's it
|
||||||
* when finished.
|
* when finished.
|
||||||
*/
|
*/
|
||||||
int vpe_elfload(struct vpe * v)
|
static int vpe_elfload(struct vpe * v)
|
||||||
{
|
{
|
||||||
Elf_Ehdr *hdr;
|
Elf_Ehdr *hdr;
|
||||||
Elf_Shdr *sechdrs;
|
Elf_Shdr *sechdrs;
|
||||||
|
|
|
@ -45,7 +45,7 @@ void enable_lasat_irq(unsigned int irq_nr)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip lasat_irq_type = {
|
static struct irq_chip lasat_irq_type = {
|
||||||
.typename = "Lasat",
|
.name = "Lasat",
|
||||||
.ack = disable_lasat_irq,
|
.ack = disable_lasat_irq,
|
||||||
.mask = disable_lasat_irq,
|
.mask = disable_lasat_irq,
|
||||||
.mask_ack = disable_lasat_irq,
|
.mask_ack = disable_lasat_irq,
|
||||||
|
|
|
@ -132,9 +132,8 @@ void __init prom_init(void)
|
||||||
add_memory_region(0, lasat_board_info.li_memsize, BOOT_MEM_RAM);
|
add_memory_region(0, lasat_board_info.li_memsize, BOOT_MEM_RAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *get_system_type(void)
|
const char *get_system_type(void)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Makefile for MIPS-specific library files..
|
# Makefile for MIPS-specific library files..
|
||||||
#
|
#
|
||||||
|
|
||||||
lib-y += memset.o watch.o
|
lib-y += watch.o
|
||||||
|
|
||||||
obj-$(CONFIG_CPU_MIPS32) += dump_tlb.o
|
obj-$(CONFIG_CPU_MIPS32) += dump_tlb.o
|
||||||
obj-$(CONFIG_CPU_MIPS64) += dump_tlb.o
|
obj-$(CONFIG_CPU_MIPS64) += dump_tlb.o
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Makefile for MIPS-specific library files..
|
# Makefile for MIPS-specific library files..
|
||||||
#
|
#
|
||||||
|
|
||||||
lib-y += memset.o watch.o
|
lib-y += watch.o
|
||||||
|
|
||||||
obj-$(CONFIG_CPU_MIPS32) += dump_tlb.o
|
obj-$(CONFIG_CPU_MIPS32) += dump_tlb.o
|
||||||
obj-$(CONFIG_CPU_MIPS64) += dump_tlb.o
|
obj-$(CONFIG_CPU_MIPS64) += dump_tlb.o
|
||||||
|
|
|
@ -1,142 +0,0 @@
|
||||||
/*
|
|
||||||
* This file is subject to the terms and conditions of the GNU General Public
|
|
||||||
* License. See the file "COPYING" in the main directory of this archive
|
|
||||||
* for more details.
|
|
||||||
*
|
|
||||||
* Copyright (C) 1998, 1999, 2000 by Ralf Baechle
|
|
||||||
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
|
|
||||||
*/
|
|
||||||
#include <asm/asm.h>
|
|
||||||
#include <asm/asm-offsets.h>
|
|
||||||
#include <asm/regdef.h>
|
|
||||||
|
|
||||||
#define EX(insn,reg,addr,handler) \
|
|
||||||
9: insn reg, addr; \
|
|
||||||
.section __ex_table,"a"; \
|
|
||||||
PTR 9b, handler; \
|
|
||||||
.previous
|
|
||||||
|
|
||||||
.macro f_fill64 dst, offset, val, fixup
|
|
||||||
EX(LONG_S, \val, (\offset + 0 * LONGSIZE)(\dst), \fixup)
|
|
||||||
EX(LONG_S, \val, (\offset + 1 * LONGSIZE)(\dst), \fixup)
|
|
||||||
EX(LONG_S, \val, (\offset + 2 * LONGSIZE)(\dst), \fixup)
|
|
||||||
EX(LONG_S, \val, (\offset + 3 * LONGSIZE)(\dst), \fixup)
|
|
||||||
EX(LONG_S, \val, (\offset + 4 * LONGSIZE)(\dst), \fixup)
|
|
||||||
EX(LONG_S, \val, (\offset + 5 * LONGSIZE)(\dst), \fixup)
|
|
||||||
EX(LONG_S, \val, (\offset + 6 * LONGSIZE)(\dst), \fixup)
|
|
||||||
EX(LONG_S, \val, (\offset + 7 * LONGSIZE)(\dst), \fixup)
|
|
||||||
.endm
|
|
||||||
|
|
||||||
/*
|
|
||||||
* memset(void *s, int c, size_t n)
|
|
||||||
*
|
|
||||||
* a0: start of area to clear
|
|
||||||
* a1: char to fill with
|
|
||||||
* a2: size of area to clear
|
|
||||||
*/
|
|
||||||
.set noreorder
|
|
||||||
.align 5
|
|
||||||
LEAF(memset)
|
|
||||||
beqz a1, 1f
|
|
||||||
move v0, a0 /* result */
|
|
||||||
|
|
||||||
andi a1, 0xff /* spread fillword */
|
|
||||||
dsll t1, a1, 8
|
|
||||||
or a1, t1
|
|
||||||
dsll t1, a1, 16
|
|
||||||
or a1, t1
|
|
||||||
dsll t1, a1, 32
|
|
||||||
or a1, t1
|
|
||||||
1:
|
|
||||||
|
|
||||||
FEXPORT(__bzero)
|
|
||||||
sltiu t0, a2, LONGSIZE /* very small region? */
|
|
||||||
bnez t0, small_memset
|
|
||||||
andi t0, a0, LONGMASK /* aligned? */
|
|
||||||
|
|
||||||
beqz t0, 1f
|
|
||||||
PTR_SUBU t0, LONGSIZE /* alignment in bytes */
|
|
||||||
|
|
||||||
#ifdef __MIPSEB__
|
|
||||||
EX(sdl, a1, (a0), first_fixup) /* make dword aligned */
|
|
||||||
#endif
|
|
||||||
#ifdef __MIPSEL__
|
|
||||||
EX(sdr, a1, (a0), first_fixup) /* make dword aligned */
|
|
||||||
#endif
|
|
||||||
PTR_SUBU a0, t0 /* long align ptr */
|
|
||||||
PTR_ADDU a2, t0 /* correct size */
|
|
||||||
|
|
||||||
1: ori t1, a2, 0x3f /* # of full blocks */
|
|
||||||
xori t1, 0x3f
|
|
||||||
beqz t1, memset_partial /* no block to fill */
|
|
||||||
andi t0, a2, 0x38
|
|
||||||
|
|
||||||
PTR_ADDU t1, a0 /* end address */
|
|
||||||
.set reorder
|
|
||||||
1: PTR_ADDIU a0, 64
|
|
||||||
f_fill64 a0, -64, a1, fwd_fixup
|
|
||||||
bne t1, a0, 1b
|
|
||||||
.set noreorder
|
|
||||||
|
|
||||||
memset_partial:
|
|
||||||
PTR_LA t1, 2f /* where to start */
|
|
||||||
.set noat
|
|
||||||
dsrl AT, t0, 1
|
|
||||||
PTR_SUBU t1, AT
|
|
||||||
.set noat
|
|
||||||
jr t1
|
|
||||||
PTR_ADDU a0, t0 /* dest ptr */
|
|
||||||
|
|
||||||
.set push
|
|
||||||
.set noreorder
|
|
||||||
.set nomacro
|
|
||||||
f_fill64 a0, -64, a1, partial_fixup /* ... but first do longs ... */
|
|
||||||
2: .set pop
|
|
||||||
andi a2, LONGMASK /* At most one long to go */
|
|
||||||
|
|
||||||
beqz a2, 1f
|
|
||||||
PTR_ADDU a0, a2 /* What's left */
|
|
||||||
#ifdef __MIPSEB__
|
|
||||||
EX(sdr, a1, -1(a0), last_fixup)
|
|
||||||
#endif
|
|
||||||
#ifdef __MIPSEL__
|
|
||||||
EX(sdl, a1, -1(a0), last_fixup)
|
|
||||||
#endif
|
|
||||||
1: jr ra
|
|
||||||
move a2, zero
|
|
||||||
|
|
||||||
small_memset:
|
|
||||||
beqz a2, 2f
|
|
||||||
PTR_ADDU t1, a0, a2
|
|
||||||
|
|
||||||
1: PTR_ADDIU a0, 1 /* fill bytewise */
|
|
||||||
bne t1, a0, 1b
|
|
||||||
sb a1, -1(a0)
|
|
||||||
|
|
||||||
2: jr ra /* done */
|
|
||||||
move a2, zero
|
|
||||||
END(memset)
|
|
||||||
|
|
||||||
first_fixup:
|
|
||||||
jr ra
|
|
||||||
nop
|
|
||||||
|
|
||||||
fwd_fixup:
|
|
||||||
PTR_L t0, TI_TASK($28)
|
|
||||||
LONG_L t0, THREAD_BUADDR(t0)
|
|
||||||
andi a2, 0x3f
|
|
||||||
LONG_ADDU a2, t1
|
|
||||||
jr ra
|
|
||||||
LONG_SUBU a2, t0
|
|
||||||
|
|
||||||
partial_fixup:
|
|
||||||
PTR_L t0, TI_TASK($28)
|
|
||||||
LONG_L t0, THREAD_BUADDR(t0)
|
|
||||||
andi a2, LONGMASK
|
|
||||||
LONG_ADDU a2, t1
|
|
||||||
jr ra
|
|
||||||
LONG_SUBU a2, t0
|
|
||||||
|
|
||||||
last_fixup:
|
|
||||||
jr ra
|
|
||||||
andi v1, a2, LONGMASK
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Makefile for MIPS-specific library files..
|
# Makefile for MIPS-specific library files..
|
||||||
#
|
#
|
||||||
|
|
||||||
lib-y += csum_partial.o memcpy.o promlib.o \
|
lib-y += csum_partial.o memcpy.o memset.o promlib.o \
|
||||||
strlen_user.o strncpy_user.o strnlen_user.o uncached.o
|
strlen_user.o strncpy_user.o strnlen_user.o uncached.o
|
||||||
|
|
||||||
obj-y += iomap.o
|
obj-y += iomap.o
|
||||||
|
|
|
@ -10,6 +10,14 @@
|
||||||
#include <asm/asm-offsets.h>
|
#include <asm/asm-offsets.h>
|
||||||
#include <asm/regdef.h>
|
#include <asm/regdef.h>
|
||||||
|
|
||||||
|
#if LONGSIZE == 4
|
||||||
|
#define LONG_S_L swl
|
||||||
|
#define LONG_S_R swr
|
||||||
|
#else
|
||||||
|
#define LONG_S_L sdl
|
||||||
|
#define LONG_S_R sdr
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EX(insn,reg,addr,handler) \
|
#define EX(insn,reg,addr,handler) \
|
||||||
9: insn reg, addr; \
|
9: insn reg, addr; \
|
||||||
.section __ex_table,"a"; \
|
.section __ex_table,"a"; \
|
||||||
|
@ -25,6 +33,7 @@
|
||||||
EX(LONG_S, \val, (\offset + 5 * LONGSIZE)(\dst), \fixup)
|
EX(LONG_S, \val, (\offset + 5 * LONGSIZE)(\dst), \fixup)
|
||||||
EX(LONG_S, \val, (\offset + 6 * LONGSIZE)(\dst), \fixup)
|
EX(LONG_S, \val, (\offset + 6 * LONGSIZE)(\dst), \fixup)
|
||||||
EX(LONG_S, \val, (\offset + 7 * LONGSIZE)(\dst), \fixup)
|
EX(LONG_S, \val, (\offset + 7 * LONGSIZE)(\dst), \fixup)
|
||||||
|
#if LONGSIZE == 4
|
||||||
EX(LONG_S, \val, (\offset + 8 * LONGSIZE)(\dst), \fixup)
|
EX(LONG_S, \val, (\offset + 8 * LONGSIZE)(\dst), \fixup)
|
||||||
EX(LONG_S, \val, (\offset + 9 * LONGSIZE)(\dst), \fixup)
|
EX(LONG_S, \val, (\offset + 9 * LONGSIZE)(\dst), \fixup)
|
||||||
EX(LONG_S, \val, (\offset + 10 * LONGSIZE)(\dst), \fixup)
|
EX(LONG_S, \val, (\offset + 10 * LONGSIZE)(\dst), \fixup)
|
||||||
|
@ -33,6 +42,7 @@
|
||||||
EX(LONG_S, \val, (\offset + 13 * LONGSIZE)(\dst), \fixup)
|
EX(LONG_S, \val, (\offset + 13 * LONGSIZE)(\dst), \fixup)
|
||||||
EX(LONG_S, \val, (\offset + 14 * LONGSIZE)(\dst), \fixup)
|
EX(LONG_S, \val, (\offset + 14 * LONGSIZE)(\dst), \fixup)
|
||||||
EX(LONG_S, \val, (\offset + 15 * LONGSIZE)(\dst), \fixup)
|
EX(LONG_S, \val, (\offset + 15 * LONGSIZE)(\dst), \fixup)
|
||||||
|
#endif
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -49,9 +59,13 @@ LEAF(memset)
|
||||||
move v0, a0 /* result */
|
move v0, a0 /* result */
|
||||||
|
|
||||||
andi a1, 0xff /* spread fillword */
|
andi a1, 0xff /* spread fillword */
|
||||||
sll t1, a1, 8
|
LONG_SLL t1, a1, 8
|
||||||
or a1, t1
|
or a1, t1
|
||||||
sll t1, a1, 16
|
LONG_SLL t1, a1, 16
|
||||||
|
#if LONGSIZE == 8
|
||||||
|
or a1, t1
|
||||||
|
LONG_SLL t1, a1, 32
|
||||||
|
#endif
|
||||||
or a1, t1
|
or a1, t1
|
||||||
1:
|
1:
|
||||||
|
|
||||||
|
@ -64,10 +78,10 @@ FEXPORT(__bzero)
|
||||||
PTR_SUBU t0, LONGSIZE /* alignment in bytes */
|
PTR_SUBU t0, LONGSIZE /* alignment in bytes */
|
||||||
|
|
||||||
#ifdef __MIPSEB__
|
#ifdef __MIPSEB__
|
||||||
EX(swl, a1, (a0), first_fixup) /* make word aligned */
|
EX(LONG_S_L, a1, (a0), first_fixup) /* make word/dword aligned */
|
||||||
#endif
|
#endif
|
||||||
#ifdef __MIPSEL__
|
#ifdef __MIPSEL__
|
||||||
EX(swr, a1, (a0), first_fixup) /* make word aligned */
|
EX(LONG_S_R, a1, (a0), first_fixup) /* make word/dword aligned */
|
||||||
#endif
|
#endif
|
||||||
PTR_SUBU a0, t0 /* long align ptr */
|
PTR_SUBU a0, t0 /* long align ptr */
|
||||||
PTR_ADDU a2, t0 /* correct size */
|
PTR_ADDU a2, t0 /* correct size */
|
||||||
|
@ -75,7 +89,7 @@ FEXPORT(__bzero)
|
||||||
1: ori t1, a2, 0x3f /* # of full blocks */
|
1: ori t1, a2, 0x3f /* # of full blocks */
|
||||||
xori t1, 0x3f
|
xori t1, 0x3f
|
||||||
beqz t1, memset_partial /* no block to fill */
|
beqz t1, memset_partial /* no block to fill */
|
||||||
andi t0, a2, 0x3c
|
andi t0, a2, 0x40-LONGSIZE
|
||||||
|
|
||||||
PTR_ADDU t1, a0 /* end address */
|
PTR_ADDU t1, a0 /* end address */
|
||||||
.set reorder
|
.set reorder
|
||||||
|
@ -86,7 +100,14 @@ FEXPORT(__bzero)
|
||||||
|
|
||||||
memset_partial:
|
memset_partial:
|
||||||
PTR_LA t1, 2f /* where to start */
|
PTR_LA t1, 2f /* where to start */
|
||||||
|
#if LONGSIZE == 4
|
||||||
PTR_SUBU t1, t0
|
PTR_SUBU t1, t0
|
||||||
|
#else
|
||||||
|
.set noat
|
||||||
|
LONG_SRL AT, t0, 1
|
||||||
|
PTR_SUBU t1, AT
|
||||||
|
.set noat
|
||||||
|
#endif
|
||||||
jr t1
|
jr t1
|
||||||
PTR_ADDU a0, t0 /* dest ptr */
|
PTR_ADDU a0, t0 /* dest ptr */
|
||||||
|
|
||||||
|
@ -100,10 +121,10 @@ memset_partial:
|
||||||
beqz a2, 1f
|
beqz a2, 1f
|
||||||
PTR_ADDU a0, a2 /* What's left */
|
PTR_ADDU a0, a2 /* What's left */
|
||||||
#ifdef __MIPSEB__
|
#ifdef __MIPSEB__
|
||||||
EX(swr, a1, -1(a0), last_fixup)
|
EX(LONG_S_R, a1, -1(a0), last_fixup)
|
||||||
#endif
|
#endif
|
||||||
#ifdef __MIPSEL__
|
#ifdef __MIPSEL__
|
||||||
EX(swl, a1, -1(a0), last_fixup)
|
EX(LONG_S_L, a1, -1(a0), last_fixup)
|
||||||
#endif
|
#endif
|
||||||
1: jr ra
|
1: jr ra
|
||||||
move a2, zero
|
move a2, zero
|
|
@ -44,20 +44,24 @@ unsigned long __init run_uncached(void *func)
|
||||||
|
|
||||||
if (sp >= (long)CKSEG0 && sp < (long)CKSEG2)
|
if (sp >= (long)CKSEG0 && sp < (long)CKSEG2)
|
||||||
usp = CKSEG1ADDR(sp);
|
usp = CKSEG1ADDR(sp);
|
||||||
|
#ifdef CONFIG_64BIT
|
||||||
else if ((long long)sp >= (long long)PHYS_TO_XKPHYS(0LL, 0) &&
|
else if ((long long)sp >= (long long)PHYS_TO_XKPHYS(0LL, 0) &&
|
||||||
(long long)sp < (long long)PHYS_TO_XKPHYS(8LL, 0))
|
(long long)sp < (long long)PHYS_TO_XKPHYS(8LL, 0))
|
||||||
usp = PHYS_TO_XKPHYS((long long)K_CALG_UNCACHED,
|
usp = PHYS_TO_XKPHYS((long long)K_CALG_UNCACHED,
|
||||||
XKPHYS_TO_PHYS((long long)sp));
|
XKPHYS_TO_PHYS((long long)sp));
|
||||||
|
#endif
|
||||||
else {
|
else {
|
||||||
BUG();
|
BUG();
|
||||||
usp = sp;
|
usp = sp;
|
||||||
}
|
}
|
||||||
if (lfunc >= (long)CKSEG0 && lfunc < (long)CKSEG2)
|
if (lfunc >= (long)CKSEG0 && lfunc < (long)CKSEG2)
|
||||||
ufunc = CKSEG1ADDR(lfunc);
|
ufunc = CKSEG1ADDR(lfunc);
|
||||||
|
#ifdef CONFIG_64BIT
|
||||||
else if ((long long)lfunc >= (long long)PHYS_TO_XKPHYS(0LL, 0) &&
|
else if ((long long)lfunc >= (long long)PHYS_TO_XKPHYS(0LL, 0) &&
|
||||||
(long long)lfunc < (long long)PHYS_TO_XKPHYS(8LL, 0))
|
(long long)lfunc < (long long)PHYS_TO_XKPHYS(8LL, 0))
|
||||||
ufunc = PHYS_TO_XKPHYS((long long)K_CALG_UNCACHED,
|
ufunc = PHYS_TO_XKPHYS((long long)K_CALG_UNCACHED,
|
||||||
XKPHYS_TO_PHYS((long long)lfunc));
|
XKPHYS_TO_PHYS((long long)lfunc));
|
||||||
|
#endif
|
||||||
else {
|
else {
|
||||||
BUG();
|
BUG();
|
||||||
ufunc = lfunc;
|
ufunc = lfunc;
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/kernel_stat.h>
|
#include <linux/kernel_stat.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
|
||||||
#include <asm/gdb-stub.h>
|
#include <asm/gdb-stub.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
@ -69,7 +70,7 @@ static void end_atlas_irq(unsigned int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip atlas_irq_type = {
|
static struct irq_chip atlas_irq_type = {
|
||||||
.typename = "Atlas",
|
.name = "Atlas",
|
||||||
.ack = disable_atlas_irq,
|
.ack = disable_atlas_irq,
|
||||||
.mask = disable_atlas_irq,
|
.mask = disable_atlas_irq,
|
||||||
.mask_ack = disable_atlas_irq,
|
.mask_ack = disable_atlas_irq,
|
||||||
|
@ -220,7 +221,7 @@ msc_irqmap_t __initdata msc_irqmap[] = {
|
||||||
{MSC01C_INT_TMR, MSC01_IRQ_EDGE, 0},
|
{MSC01C_INT_TMR, MSC01_IRQ_EDGE, 0},
|
||||||
{MSC01C_INT_PCI, MSC01_IRQ_LEVEL, 0},
|
{MSC01C_INT_PCI, MSC01_IRQ_LEVEL, 0},
|
||||||
};
|
};
|
||||||
int __initdata msc_nr_irqs = sizeof(msc_irqmap) / sizeof(*msc_irqmap);
|
int __initdata msc_nr_irqs = ARRAY_SIZE(msc_irqmap);
|
||||||
|
|
||||||
msc_irqmap_t __initdata msc_eicirqmap[] = {
|
msc_irqmap_t __initdata msc_eicirqmap[] = {
|
||||||
{MSC01E_INT_SW0, MSC01_IRQ_LEVEL, 0},
|
{MSC01E_INT_SW0, MSC01_IRQ_LEVEL, 0},
|
||||||
|
@ -231,14 +232,14 @@ msc_irqmap_t __initdata msc_eicirqmap[] = {
|
||||||
{MSC01E_INT_PERFCTR, MSC01_IRQ_LEVEL, 0},
|
{MSC01E_INT_PERFCTR, MSC01_IRQ_LEVEL, 0},
|
||||||
{MSC01E_INT_CPUCTR, MSC01_IRQ_LEVEL, 0}
|
{MSC01E_INT_CPUCTR, MSC01_IRQ_LEVEL, 0}
|
||||||
};
|
};
|
||||||
int __initdata msc_nr_eicirqs = sizeof(msc_eicirqmap) / sizeof(*msc_eicirqmap);
|
int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap);
|
||||||
|
|
||||||
void __init arch_init_irq(void)
|
void __init arch_init_irq(void)
|
||||||
{
|
{
|
||||||
init_atlas_irqs(ATLAS_INT_BASE);
|
init_atlas_irqs(ATLAS_INT_BASE);
|
||||||
|
|
||||||
if (!cpu_has_veic)
|
if (!cpu_has_veic)
|
||||||
mips_cpu_irq_init(MIPSCPU_INT_BASE);
|
mips_cpu_irq_init();
|
||||||
|
|
||||||
switch(mips_revision_corid) {
|
switch(mips_revision_corid) {
|
||||||
case MIPS_REVISION_CORID_CORE_MSC:
|
case MIPS_REVISION_CORID_CORE_MSC:
|
||||||
|
|
|
@ -166,9 +166,8 @@ void __init prom_meminit(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
unsigned long freed = 0;
|
|
||||||
unsigned long addr;
|
unsigned long addr;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -176,17 +175,8 @@ unsigned long __init prom_free_prom_memory(void)
|
||||||
if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA)
|
if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
addr = PAGE_ALIGN(boot_mem_map.map[i].addr);
|
addr = boot_mem_map.map[i].addr;
|
||||||
while (addr < boot_mem_map.map[i].addr
|
free_init_pages("prom memory",
|
||||||
+ boot_mem_map.map[i].size) {
|
addr, addr + boot_mem_map.map[i].size);
|
||||||
ClearPageReserved(virt_to_page(__va(addr)));
|
|
||||||
init_page_count(virt_to_page(__va(addr)));
|
|
||||||
free_page((unsigned long)__va(addr));
|
|
||||||
addr += PAGE_SIZE;
|
|
||||||
freed += PAGE_SIZE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printk("Freeing prom memory: %ldkb freed\n", freed >> 10);
|
|
||||||
|
|
||||||
return freed;
|
|
||||||
}
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/kernel_stat.h>
|
#include <linux/kernel_stat.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
#include <linux/random.h>
|
#include <linux/random.h>
|
||||||
|
|
||||||
#include <asm/i8259.h>
|
#include <asm/i8259.h>
|
||||||
|
@ -289,7 +290,7 @@ msc_irqmap_t __initdata msc_irqmap[] = {
|
||||||
{MSC01C_INT_TMR, MSC01_IRQ_EDGE, 0},
|
{MSC01C_INT_TMR, MSC01_IRQ_EDGE, 0},
|
||||||
{MSC01C_INT_PCI, MSC01_IRQ_LEVEL, 0},
|
{MSC01C_INT_PCI, MSC01_IRQ_LEVEL, 0},
|
||||||
};
|
};
|
||||||
int __initdata msc_nr_irqs = sizeof(msc_irqmap)/sizeof(msc_irqmap_t);
|
int __initdata msc_nr_irqs = ARRAY_SIZE(msc_irqmap);
|
||||||
|
|
||||||
msc_irqmap_t __initdata msc_eicirqmap[] = {
|
msc_irqmap_t __initdata msc_eicirqmap[] = {
|
||||||
{MSC01E_INT_SW0, MSC01_IRQ_LEVEL, 0},
|
{MSC01E_INT_SW0, MSC01_IRQ_LEVEL, 0},
|
||||||
|
@ -303,14 +304,14 @@ msc_irqmap_t __initdata msc_eicirqmap[] = {
|
||||||
{MSC01E_INT_PERFCTR, MSC01_IRQ_LEVEL, 0},
|
{MSC01E_INT_PERFCTR, MSC01_IRQ_LEVEL, 0},
|
||||||
{MSC01E_INT_CPUCTR, MSC01_IRQ_LEVEL, 0}
|
{MSC01E_INT_CPUCTR, MSC01_IRQ_LEVEL, 0}
|
||||||
};
|
};
|
||||||
int __initdata msc_nr_eicirqs = sizeof(msc_eicirqmap)/sizeof(msc_irqmap_t);
|
int __initdata msc_nr_eicirqs = ARRAY_SIZE(msc_eicirqmap);
|
||||||
|
|
||||||
void __init arch_init_irq(void)
|
void __init arch_init_irq(void)
|
||||||
{
|
{
|
||||||
init_i8259_irqs();
|
init_i8259_irqs();
|
||||||
|
|
||||||
if (!cpu_has_veic)
|
if (!cpu_has_veic)
|
||||||
mips_cpu_irq_init (MIPSCPU_INT_BASE);
|
mips_cpu_irq_init();
|
||||||
|
|
||||||
switch(mips_revision_corid) {
|
switch(mips_revision_corid) {
|
||||||
case MIPS_REVISION_CORID_CORE_MSC:
|
case MIPS_REVISION_CORID_CORE_MSC:
|
||||||
|
|
|
@ -113,5 +113,5 @@ asmlinkage void plat_irq_dispatch(void)
|
||||||
|
|
||||||
void __init arch_init_irq(void)
|
void __init arch_init_irq(void)
|
||||||
{
|
{
|
||||||
mips_cpu_irq_init(MIPSCPU_INT_BASE);
|
mips_cpu_irq_init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,9 +21,7 @@
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/kernel_stat.h>
|
#include <linux/kernel_stat.h>
|
||||||
#include <asm/mips-boards/simint.h>
|
#include <asm/mips-boards/simint.h>
|
||||||
|
#include <asm/irq_cpu.h>
|
||||||
|
|
||||||
extern void mips_cpu_irq_init(int);
|
|
||||||
|
|
||||||
static inline int clz(unsigned long x)
|
static inline int clz(unsigned long x)
|
||||||
{
|
{
|
||||||
|
@ -86,5 +84,5 @@ asmlinkage void plat_irq_dispatch(void)
|
||||||
|
|
||||||
void __init arch_init_irq(void)
|
void __init arch_init_irq(void)
|
||||||
{
|
{
|
||||||
mips_cpu_irq_init(MIPSCPU_INT_BASE);
|
mips_cpu_irq_init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,10 +99,9 @@ void __init prom_meminit(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned long freed = 0;
|
|
||||||
unsigned long addr;
|
unsigned long addr;
|
||||||
|
|
||||||
for (i = 0; i < boot_mem_map.nr_map; i++) {
|
for (i = 0; i < boot_mem_map.nr_map; i++) {
|
||||||
|
@ -110,16 +109,7 @@ unsigned long __init prom_free_prom_memory(void)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
addr = boot_mem_map.map[i].addr;
|
addr = boot_mem_map.map[i].addr;
|
||||||
while (addr < boot_mem_map.map[i].addr
|
free_init_pages("prom memory",
|
||||||
+ boot_mem_map.map[i].size) {
|
addr, addr + boot_mem_map.map[i].size);
|
||||||
ClearPageReserved(virt_to_page(__va(addr)));
|
|
||||||
init_page_count(virt_to_page(__va(addr)));
|
|
||||||
free_page((unsigned long)__va(addr));
|
|
||||||
addr += PAGE_SIZE;
|
|
||||||
freed += PAGE_SIZE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printk("Freeing prom memory: %ldkb freed\n", freed >> 10);
|
|
||||||
|
|
||||||
return freed;
|
|
||||||
}
|
|
||||||
|
|
|
@ -341,7 +341,6 @@ static int __init page_is_ram(unsigned long pagenr)
|
||||||
void __init paging_init(void)
|
void __init paging_init(void)
|
||||||
{
|
{
|
||||||
unsigned long zones_size[MAX_NR_ZONES] = { 0, };
|
unsigned long zones_size[MAX_NR_ZONES] = { 0, };
|
||||||
unsigned long max_dma, low;
|
|
||||||
#ifndef CONFIG_FLATMEM
|
#ifndef CONFIG_FLATMEM
|
||||||
unsigned long zholes_size[MAX_NR_ZONES] = { 0, };
|
unsigned long zholes_size[MAX_NR_ZONES] = { 0, };
|
||||||
unsigned long i, j, pfn;
|
unsigned long i, j, pfn;
|
||||||
|
@ -354,19 +353,19 @@ void __init paging_init(void)
|
||||||
#endif
|
#endif
|
||||||
kmap_coherent_init();
|
kmap_coherent_init();
|
||||||
|
|
||||||
max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
|
|
||||||
low = max_low_pfn;
|
|
||||||
|
|
||||||
#ifdef CONFIG_ISA
|
#ifdef CONFIG_ISA
|
||||||
if (low < max_dma)
|
if (max_low_pfn >= MAX_DMA_PFN)
|
||||||
zones_size[ZONE_DMA] = low;
|
if (min_low_pfn >= MAX_DMA_PFN) {
|
||||||
else {
|
zones_size[ZONE_DMA] = 0;
|
||||||
zones_size[ZONE_DMA] = max_dma;
|
zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn;
|
||||||
zones_size[ZONE_NORMAL] = low - max_dma;
|
} else {
|
||||||
|
zones_size[ZONE_DMA] = MAX_DMA_PFN - min_low_pfn;
|
||||||
|
zones_size[ZONE_NORMAL] = max_low_pfn - MAX_DMA_PFN;
|
||||||
}
|
}
|
||||||
#else
|
else
|
||||||
zones_size[ZONE_DMA] = low;
|
|
||||||
#endif
|
#endif
|
||||||
|
zones_size[ZONE_DMA] = max_low_pfn - min_low_pfn;
|
||||||
|
|
||||||
#ifdef CONFIG_HIGHMEM
|
#ifdef CONFIG_HIGHMEM
|
||||||
zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn;
|
zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn;
|
||||||
|
|
||||||
|
@ -467,7 +466,7 @@ void __init mem_init(void)
|
||||||
}
|
}
|
||||||
#endif /* !CONFIG_NEED_MULTIPLE_NODES */
|
#endif /* !CONFIG_NEED_MULTIPLE_NODES */
|
||||||
|
|
||||||
static void free_init_pages(char *what, unsigned long begin, unsigned long end)
|
void free_init_pages(const char *what, unsigned long begin, unsigned long end)
|
||||||
{
|
{
|
||||||
unsigned long pfn;
|
unsigned long pfn;
|
||||||
|
|
||||||
|
@ -493,18 +492,25 @@ void free_initrd_mem(unsigned long start, unsigned long end)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern unsigned long prom_free_prom_memory(void);
|
|
||||||
|
|
||||||
void free_initmem(void)
|
void free_initmem(void)
|
||||||
{
|
{
|
||||||
unsigned long freed;
|
prom_free_prom_memory();
|
||||||
|
|
||||||
freed = prom_free_prom_memory();
|
|
||||||
if (freed)
|
|
||||||
printk(KERN_INFO "Freeing firmware memory: %ldkb freed\n",
|
|
||||||
freed >> 10);
|
|
||||||
|
|
||||||
free_init_pages("unused kernel memory",
|
free_init_pages("unused kernel memory",
|
||||||
__pa_symbol(&__init_begin),
|
__pa_symbol(&__init_begin),
|
||||||
__pa_symbol(&__init_end));
|
__pa_symbol(&__init_end));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long pgd_current[NR_CPUS];
|
||||||
|
/*
|
||||||
|
* On 64-bit we've got three-level pagetables with a slightly
|
||||||
|
* different layout ...
|
||||||
|
*/
|
||||||
|
#define __page_aligned(order) __attribute__((__aligned__(PAGE_SIZE<<order)))
|
||||||
|
pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER);
|
||||||
|
#ifdef CONFIG_64BIT
|
||||||
|
#ifdef MODULE_START
|
||||||
|
pgd_t module_pg_dir[PTRS_PER_PGD] __page_aligned(PGD_ORDER);
|
||||||
|
#endif
|
||||||
|
pmd_t invalid_pmd_table[PTRS_PER_PMD] __page_aligned(PMD_ORDER);
|
||||||
|
#endif
|
||||||
|
pte_t invalid_pte_table[PTRS_PER_PTE] __page_aligned(PTE_ORDER);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# unless it's something special (ie not a .c file).
|
# unless it's something special (ie not a .c file).
|
||||||
#
|
#
|
||||||
|
|
||||||
obj-y += irq.o prom.o reset.o setup.o
|
obj-y += irq.o platform.o prom.o reset.o setup.o
|
||||||
|
|
||||||
obj-$(CONFIG_SERIAL_8250_CONSOLE) += ja-console.o
|
obj-$(CONFIG_SERIAL_8250_CONSOLE) += ja-console.o
|
||||||
obj-$(CONFIG_REMOTE_DEBUG) += dbg_io.o
|
obj-$(CONFIG_REMOTE_DEBUG) += dbg_io.o
|
||||||
|
|
|
@ -82,8 +82,8 @@ void __init arch_init_irq(void)
|
||||||
*/
|
*/
|
||||||
clear_c0_status(ST0_IM);
|
clear_c0_status(ST0_IM);
|
||||||
|
|
||||||
mips_cpu_irq_init(0);
|
mips_cpu_irq_init();
|
||||||
rm7k_cpu_irq_init(8);
|
rm7k_cpu_irq_init();
|
||||||
|
|
||||||
/* set up the cascading interrupts */
|
/* set up the cascading interrupts */
|
||||||
setup_irq(8, &cascade_mv64340);
|
setup_irq(8, &cascade_mv64340);
|
||||||
|
|
|
@ -46,7 +46,9 @@
|
||||||
|
|
||||||
extern unsigned long ja_fpga_base;
|
extern unsigned long ja_fpga_base;
|
||||||
|
|
||||||
#define JAGUAR_FPGA_WRITE(x,y) writeb(x, ja_fpga_base + JAGUAR_ATX_REG_##y)
|
#define __FPGA_REG_TO_ADDR(reg) \
|
||||||
#define JAGUAR_FPGA_READ(x) readb(ja_fpga_base + JAGUAR_ATX_REG_##x)
|
((void *) ja_fpga_base + JAGUAR_ATX_REG_##reg)
|
||||||
|
#define JAGUAR_FPGA_WRITE(x, reg) writeb(x, __FPGA_REG_TO_ADDR(reg))
|
||||||
|
#define JAGUAR_FPGA_READ(reg) readb(__FPGA_REG_TO_ADDR(reg))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
235
arch/mips/momentum/jaguar_atx/platform.c
Normal file
235
arch/mips/momentum/jaguar_atx/platform.c
Normal file
|
@ -0,0 +1,235 @@
|
||||||
|
#include <linux/delay.h>
|
||||||
|
#include <linux/if_ether.h>
|
||||||
|
#include <linux/ioport.h>
|
||||||
|
#include <linux/mv643xx.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
|
||||||
|
#include "jaguar_atx_fpga.h"
|
||||||
|
|
||||||
|
#if defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE)
|
||||||
|
|
||||||
|
static struct resource mv643xx_eth_shared_resources[] = {
|
||||||
|
[0] = {
|
||||||
|
.name = "ethernet shared base",
|
||||||
|
.start = 0xf1000000 + MV643XX_ETH_SHARED_REGS,
|
||||||
|
.end = 0xf1000000 + MV643XX_ETH_SHARED_REGS +
|
||||||
|
MV643XX_ETH_SHARED_REGS_SIZE - 1,
|
||||||
|
.flags = IORESOURCE_MEM,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device mv643xx_eth_shared_device = {
|
||||||
|
.name = MV643XX_ETH_SHARED_NAME,
|
||||||
|
.id = 0,
|
||||||
|
.num_resources = ARRAY_SIZE(mv643xx_eth_shared_resources),
|
||||||
|
.resource = mv643xx_eth_shared_resources,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MV_SRAM_BASE 0xfe000000UL
|
||||||
|
#define MV_SRAM_SIZE (256 * 1024)
|
||||||
|
|
||||||
|
#define MV_SRAM_RXRING_SIZE (MV_SRAM_SIZE / 4)
|
||||||
|
#define MV_SRAM_TXRING_SIZE (MV_SRAM_SIZE / 4)
|
||||||
|
|
||||||
|
#define MV_SRAM_BASE_ETH0 MV_SRAM_BASE
|
||||||
|
#define MV_SRAM_BASE_ETH1 (MV_SRAM_BASE + (MV_SRAM_SIZE / 2))
|
||||||
|
|
||||||
|
#define MV64x60_IRQ_ETH_0 48
|
||||||
|
#define MV64x60_IRQ_ETH_1 49
|
||||||
|
#define MV64x60_IRQ_ETH_2 50
|
||||||
|
|
||||||
|
#ifdef CONFIG_MV643XX_ETH_0
|
||||||
|
|
||||||
|
static struct resource mv64x60_eth0_resources[] = {
|
||||||
|
[0] = {
|
||||||
|
.name = "eth0 irq",
|
||||||
|
.start = MV64x60_IRQ_ETH_0,
|
||||||
|
.end = MV64x60_IRQ_ETH_0,
|
||||||
|
.flags = IORESOURCE_IRQ,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static char eth0_mac_addr[ETH_ALEN];
|
||||||
|
|
||||||
|
static struct mv643xx_eth_platform_data eth0_pd = {
|
||||||
|
.mac_addr = eth0_mac_addr,
|
||||||
|
|
||||||
|
.tx_sram_addr = MV_SRAM_BASE_ETH0,
|
||||||
|
.tx_sram_size = MV_SRAM_TXRING_SIZE,
|
||||||
|
.tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
|
||||||
|
|
||||||
|
.rx_sram_addr = MV_SRAM_BASE_ETH0 + MV_SRAM_TXRING_SIZE,
|
||||||
|
.rx_sram_size = MV_SRAM_RXRING_SIZE,
|
||||||
|
.rx_queue_size = MV_SRAM_RXRING_SIZE / 16,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device eth0_device = {
|
||||||
|
.name = MV643XX_ETH_NAME,
|
||||||
|
.id = 0,
|
||||||
|
.num_resources = ARRAY_SIZE(mv64x60_eth0_resources),
|
||||||
|
.resource = mv64x60_eth0_resources,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = ð0_pd,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
#endif /* CONFIG_MV643XX_ETH_0 */
|
||||||
|
|
||||||
|
#ifdef CONFIG_MV643XX_ETH_1
|
||||||
|
|
||||||
|
static struct resource mv64x60_eth1_resources[] = {
|
||||||
|
[0] = {
|
||||||
|
.name = "eth1 irq",
|
||||||
|
.start = MV64x60_IRQ_ETH_1,
|
||||||
|
.end = MV64x60_IRQ_ETH_1,
|
||||||
|
.flags = IORESOURCE_IRQ,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static char eth1_mac_addr[ETH_ALEN];
|
||||||
|
|
||||||
|
static struct mv643xx_eth_platform_data eth1_pd = {
|
||||||
|
.mac_addr = eth1_mac_addr,
|
||||||
|
|
||||||
|
.tx_sram_addr = MV_SRAM_BASE_ETH1,
|
||||||
|
.tx_sram_size = MV_SRAM_TXRING_SIZE,
|
||||||
|
.tx_queue_size = MV_SRAM_TXRING_SIZE / 16,
|
||||||
|
|
||||||
|
.rx_sram_addr = MV_SRAM_BASE_ETH1 + MV_SRAM_TXRING_SIZE,
|
||||||
|
.rx_sram_size = MV_SRAM_RXRING_SIZE,
|
||||||
|
.rx_queue_size = MV_SRAM_RXRING_SIZE / 16,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device eth1_device = {
|
||||||
|
.name = MV643XX_ETH_NAME,
|
||||||
|
.id = 1,
|
||||||
|
.num_resources = ARRAY_SIZE(mv64x60_eth1_resources),
|
||||||
|
.resource = mv64x60_eth1_resources,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = ð1_pd,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
#endif /* CONFIG_MV643XX_ETH_1 */
|
||||||
|
|
||||||
|
#ifdef CONFIG_MV643XX_ETH_2
|
||||||
|
|
||||||
|
static struct resource mv64x60_eth2_resources[] = {
|
||||||
|
[0] = {
|
||||||
|
.name = "eth2 irq",
|
||||||
|
.start = MV64x60_IRQ_ETH_2,
|
||||||
|
.end = MV64x60_IRQ_ETH_2,
|
||||||
|
.flags = IORESOURCE_IRQ,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static char eth2_mac_addr[ETH_ALEN];
|
||||||
|
|
||||||
|
static struct mv643xx_eth_platform_data eth2_pd = {
|
||||||
|
.mac_addr = eth2_mac_addr,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device eth2_device = {
|
||||||
|
.name = MV643XX_ETH_NAME,
|
||||||
|
.id = 1,
|
||||||
|
.num_resources = ARRAY_SIZE(mv64x60_eth2_resources),
|
||||||
|
.resource = mv64x60_eth2_resources,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = ð2_pd,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
#endif /* CONFIG_MV643XX_ETH_2 */
|
||||||
|
|
||||||
|
static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
|
||||||
|
&mv643xx_eth_shared_device,
|
||||||
|
#ifdef CONFIG_MV643XX_ETH_0
|
||||||
|
ð0_device,
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_MV643XX_ETH_1
|
||||||
|
ð1_device,
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_MV643XX_ETH_2
|
||||||
|
ð2_device,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
static u8 __init exchange_bit(u8 val, u8 cs)
|
||||||
|
{
|
||||||
|
/* place the data */
|
||||||
|
JAGUAR_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);
|
||||||
|
udelay(1);
|
||||||
|
|
||||||
|
/* turn the clock on */
|
||||||
|
JAGUAR_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);
|
||||||
|
udelay(1);
|
||||||
|
|
||||||
|
/* turn the clock off and read-strobe */
|
||||||
|
JAGUAR_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
|
||||||
|
|
||||||
|
/* return the data */
|
||||||
|
return (JAGUAR_FPGA_READ(EEPROM_MODE) >> 3) & 0x1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __init get_mac(char dest[6])
|
||||||
|
{
|
||||||
|
u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||||
|
int i,j;
|
||||||
|
|
||||||
|
for (i = 0; i < 12; i++)
|
||||||
|
exchange_bit(read_opcode[i], 1);
|
||||||
|
|
||||||
|
for (j = 0; j < 6; j++) {
|
||||||
|
dest[j] = 0;
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
dest[j] <<= 1;
|
||||||
|
dest[j] |= exchange_bit(0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* turn off CS */
|
||||||
|
exchange_bit(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copy and increment ethernet MAC address by a small value.
|
||||||
|
*
|
||||||
|
* This is useful for systems where the only one MAC address is stored in
|
||||||
|
* non-volatile memory for multiple ports.
|
||||||
|
*/
|
||||||
|
static inline void eth_mac_add(unsigned char *dst, unsigned char *src,
|
||||||
|
unsigned int add)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
BUG_ON(add >= 256);
|
||||||
|
|
||||||
|
for (i = ETH_ALEN; i >= 0; i--) {
|
||||||
|
dst[i] = src[i] + add;
|
||||||
|
add = dst[i] < src[i]; /* compute carry */
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN_ON(add);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int __init mv643xx_eth_add_pds(void)
|
||||||
|
{
|
||||||
|
unsigned char mac[ETH_ALEN];
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
get_mac(mac);
|
||||||
|
#ifdef CONFIG_MV643XX_ETH_0
|
||||||
|
eth_mac_add(eth1_mac_addr, mac, 0);
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_MV643XX_ETH_1
|
||||||
|
eth_mac_add(eth1_mac_addr, mac, 1);
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_MV643XX_ETH_2
|
||||||
|
eth_mac_add(eth2_mac_addr, mac, 2);
|
||||||
|
#endif
|
||||||
|
ret = platform_add_devices(mv643xx_eth_pd_devs,
|
||||||
|
ARRAY_SIZE(mv643xx_eth_pd_devs));
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
device_initcall(mv643xx_eth_add_pds);
|
||||||
|
|
||||||
|
#endif /* defined(CONFIG_MV643XX_ETH) || defined(CONFIG_MV643XX_ETH_MODULE) */
|
|
@ -39,56 +39,6 @@ const char *get_system_type(void)
|
||||||
return "Momentum Jaguar-ATX";
|
return "Momentum Jaguar-ATX";
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_MV643XX_ETH
|
|
||||||
extern unsigned char prom_mac_addr_base[6];
|
|
||||||
|
|
||||||
static void burn_clocks(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/* this loop should burn at least 1us -- this should be plenty */
|
|
||||||
for (i = 0; i < 0x10000; i++)
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static u8 exchange_bit(u8 val, u8 cs)
|
|
||||||
{
|
|
||||||
/* place the data */
|
|
||||||
JAGUAR_FPGA_WRITE((val << 2) | cs, EEPROM_MODE);
|
|
||||||
burn_clocks();
|
|
||||||
|
|
||||||
/* turn the clock on */
|
|
||||||
JAGUAR_FPGA_WRITE((val << 2) | cs | 0x2, EEPROM_MODE);
|
|
||||||
burn_clocks();
|
|
||||||
|
|
||||||
/* turn the clock off and read-strobe */
|
|
||||||
JAGUAR_FPGA_WRITE((val << 2) | cs | 0x10, EEPROM_MODE);
|
|
||||||
|
|
||||||
/* return the data */
|
|
||||||
return ((JAGUAR_FPGA_READ(EEPROM_MODE) >> 3) & 0x1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void get_mac(char dest[6])
|
|
||||||
{
|
|
||||||
u8 read_opcode[12] = {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
|
||||||
int i,j;
|
|
||||||
|
|
||||||
for (i = 0; i < 12; i++)
|
|
||||||
exchange_bit(read_opcode[i], 1);
|
|
||||||
|
|
||||||
for (j = 0; j < 6; j++) {
|
|
||||||
dest[j] = 0;
|
|
||||||
for (i = 0; i < 8; i++) {
|
|
||||||
dest[j] <<= 1;
|
|
||||||
dest[j] |= exchange_bit(0, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* turn off CS */
|
|
||||||
exchange_bit(0,0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONFIG_64BIT
|
#ifdef CONFIG_64BIT
|
||||||
|
|
||||||
unsigned long signext(unsigned long addr)
|
unsigned long signext(unsigned long addr)
|
||||||
|
@ -228,16 +178,10 @@ void __init prom_init(void)
|
||||||
#endif /* CONFIG_64BIT */
|
#endif /* CONFIG_64BIT */
|
||||||
mips_machgroup = MACH_GROUP_MOMENCO;
|
mips_machgroup = MACH_GROUP_MOMENCO;
|
||||||
mips_machtype = MACH_MOMENCO_JAGUAR_ATX;
|
mips_machtype = MACH_MOMENCO_JAGUAR_ATX;
|
||||||
|
|
||||||
#ifdef CONFIG_MV643XX_ETH
|
|
||||||
/* get the base MAC address for on-board ethernet ports */
|
|
||||||
get_mac(prom_mac_addr_base);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
|
void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
|
||||||
|
|
|
@ -65,7 +65,7 @@ void __init arch_init_irq(void)
|
||||||
*/
|
*/
|
||||||
clear_c0_status(ST0_IM | ST0_BEV);
|
clear_c0_status(ST0_IM | ST0_BEV);
|
||||||
|
|
||||||
rm7k_cpu_irq_init(8);
|
rm7k_cpu_irq_init();
|
||||||
|
|
||||||
/* set up the cascading interrupts */
|
/* set up the cascading interrupts */
|
||||||
setup_irq(8, &cascade_mv64340); /* unmask intControl IM8, IRQ 9 */
|
setup_irq(8, &cascade_mv64340); /* unmask intControl IM8, IRQ 9 */
|
||||||
|
|
|
@ -180,9 +180,8 @@ void __init prom_init(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
|
void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
|
||||||
|
|
|
@ -84,7 +84,7 @@ void ll_cpci_irq(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct irq_chip cpci_irq_type = {
|
struct irq_chip cpci_irq_type = {
|
||||||
.typename = "CPCI/FPGA",
|
.name = "CPCI/FPGA",
|
||||||
.ack = mask_cpci_irq,
|
.ack = mask_cpci_irq,
|
||||||
.mask = mask_cpci_irq,
|
.mask = mask_cpci_irq,
|
||||||
.mask_ack = mask_cpci_irq,
|
.mask_ack = mask_cpci_irq,
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
|
|
||||||
#ifdef CONFIG_KGDB
|
|
||||||
|
|
||||||
#include <asm/serial.h> /* For the serial port location and base baud */
|
#include <asm/serial.h> /* For the serial port location and base baud */
|
||||||
|
|
||||||
/* --- CONFIG --- */
|
/* --- CONFIG --- */
|
||||||
|
@ -121,5 +119,3 @@ int putDebugChar(uint8 byte)
|
||||||
UART16550_WRITE(OFS_SEND_BUFFER, byte);
|
UART16550_WRITE(OFS_SEND_BUFFER, byte);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ void __init arch_init_irq(void)
|
||||||
*/
|
*/
|
||||||
clear_c0_status(ST0_IM);
|
clear_c0_status(ST0_IM);
|
||||||
|
|
||||||
mips_cpu_irq_init(0);
|
mips_cpu_irq_init();
|
||||||
|
|
||||||
/* set up the cascading interrupts */
|
/* set up the cascading interrupts */
|
||||||
setup_irq(3, &cascade_fpga);
|
setup_irq(3, &cascade_fpga);
|
||||||
|
|
|
@ -178,7 +178,6 @@ void __init prom_init(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ void ll_uart_irq(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct irq_chip uart_irq_type = {
|
struct irq_chip uart_irq_type = {
|
||||||
.typename = "UART/FPGA",
|
.name = "UART/FPGA",
|
||||||
.ack = mask_uart_irq,
|
.ack = mask_uart_irq,
|
||||||
.mask = mask_uart_irq,
|
.mask = mask_uart_irq,
|
||||||
.mask_ack = mask_uart_irq,
|
.mask_ack = mask_uart_irq,
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
|
|
||||||
#ifdef CONFIG_KGDB
|
|
||||||
|
|
||||||
#include <asm/serial.h> /* For the serial port location and base baud */
|
#include <asm/serial.h> /* For the serial port location and base baud */
|
||||||
|
|
||||||
/* --- CONFIG --- */
|
/* --- CONFIG --- */
|
||||||
|
@ -121,5 +119,3 @@ int putDebugChar(uint8 byte)
|
||||||
UART16550_WRITE(OFS_SEND_BUFFER, byte);
|
UART16550_WRITE(OFS_SEND_BUFFER, byte);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -94,8 +94,8 @@ void __init arch_init_irq(void)
|
||||||
clear_c0_status(ST0_IM);
|
clear_c0_status(ST0_IM);
|
||||||
local_irq_disable();
|
local_irq_disable();
|
||||||
|
|
||||||
mips_cpu_irq_init(0);
|
mips_cpu_irq_init();
|
||||||
rm7k_cpu_irq_init(8);
|
rm7k_cpu_irq_init();
|
||||||
|
|
||||||
gt64240_irq_init();
|
gt64240_irq_init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,6 @@ void __init prom_init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ config PROFILING
|
||||||
|
|
||||||
config OPROFILE
|
config OPROFILE
|
||||||
tristate "OProfile system profiling (EXPERIMENTAL)"
|
tristate "OProfile system profiling (EXPERIMENTAL)"
|
||||||
depends on PROFILING && EXPERIMENTAL
|
depends on PROFILING && !!MIPS_MT_SMTC && EXPERIMENTAL
|
||||||
help
|
help
|
||||||
OProfile is a profiling system capable of profiling the
|
OProfile is a profiling system capable of profiling the
|
||||||
whole system, include the kernel, kernel modules, libraries,
|
whole system, include the kernel, kernel modules, libraries,
|
||||||
|
|
|
@ -17,8 +17,10 @@
|
||||||
*/
|
*/
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/pci.h>
|
#include <linux/pci.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
#include <asm/i8259.h>
|
||||||
#include <asm/vr41xx/cmbvr4133.h>
|
#include <asm/vr41xx/cmbvr4133.h>
|
||||||
|
|
||||||
extern int vr4133_rockhopper;
|
extern int vr4133_rockhopper;
|
||||||
|
@ -142,7 +144,7 @@ int rockhopper_get_irq(struct pci_dev *dev, u8 pin, u8 slot)
|
||||||
if (bus == NULL)
|
if (bus == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for (i = 0; i < sizeof (int_map) / sizeof (int_map[0]); i++) {
|
for (i = 0; i < ARRAY_SIZE(int_map); i++) {
|
||||||
if (int_map[i].bus == bus->number && int_map[i].slot == slot) {
|
if (int_map[i].bus == bus->number && int_map[i].slot == slot) {
|
||||||
int line;
|
int line;
|
||||||
for (line = 0; line < 4; line++)
|
for (line = 0; line < 4; line++)
|
||||||
|
@ -160,17 +162,7 @@ int rockhopper_get_irq(struct pci_dev *dev, u8 pin, u8 slot)
|
||||||
#ifdef CONFIG_ROCKHOPPER
|
#ifdef CONFIG_ROCKHOPPER
|
||||||
void i8259_init(void)
|
void i8259_init(void)
|
||||||
{
|
{
|
||||||
outb(0x11, 0x20); /* Master ICW1 */
|
init_i8259_irqs();
|
||||||
outb(I8259_IRQ_BASE, 0x21); /* Master ICW2 */
|
|
||||||
outb(0x04, 0x21); /* Master ICW3 */
|
|
||||||
outb(0x01, 0x21); /* Master ICW4 */
|
|
||||||
outb(0xff, 0x21); /* Master IMW */
|
|
||||||
|
|
||||||
outb(0x11, 0xa0); /* Slave ICW1 */
|
|
||||||
outb(I8259_IRQ_BASE + 8, 0xa1); /* Slave ICW2 */
|
|
||||||
outb(0x02, 0xa1); /* Slave ICW3 */
|
|
||||||
outb(0x01, 0xa1); /* Slave ICW4 */
|
|
||||||
outb(0xff, 0xa1); /* Slave IMW */
|
|
||||||
|
|
||||||
outb(0x00, 0x4d0);
|
outb(0x00, 0x4d0);
|
||||||
outb(0x02, 0x4d1); /* USB IRQ9 is level */
|
outb(0x02, 0x4d1); /* USB IRQ9 is level */
|
||||||
|
|
|
@ -159,7 +159,7 @@ int pnx8550_set_gic_priority(int irq, int priority)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct irq_chip level_irq_type = {
|
static struct irq_chip level_irq_type = {
|
||||||
.typename = "PNX Level IRQ",
|
.name = "PNX Level IRQ",
|
||||||
.ack = mask_irq,
|
.ack = mask_irq,
|
||||||
.mask = mask_irq,
|
.mask = mask_irq,
|
||||||
.mask_ack = mask_irq,
|
.mask_ack = mask_irq,
|
||||||
|
|
|
@ -106,9 +106,8 @@ int get_ethernet_addr(char *ethernet_addr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int pnx8550_console_port;
|
extern int pnx8550_console_port;
|
||||||
|
|
|
@ -93,7 +93,7 @@
|
||||||
* Functions to READ and WRITE to serial port 1
|
* Functions to READ and WRITE to serial port 1
|
||||||
*/
|
*/
|
||||||
#define SERIAL_READ_1(ofs) (*((volatile unsigned char*) \
|
#define SERIAL_READ_1(ofs) (*((volatile unsigned char*) \
|
||||||
(TITAN_SERIAL_BASE_1 + ofs)
|
(TITAN_SERIAL_BASE_1 + ofs)))
|
||||||
|
|
||||||
#define SERIAL_WRITE_1(ofs, val) ((*((volatile unsigned char*) \
|
#define SERIAL_WRITE_1(ofs, val) ((*((volatile unsigned char*) \
|
||||||
(TITAN_SERIAL_BASE_1 + ofs))) = val)
|
(TITAN_SERIAL_BASE_1 + ofs))) = val)
|
||||||
|
|
|
@ -148,9 +148,9 @@ void __init arch_init_irq(void)
|
||||||
{
|
{
|
||||||
clear_c0_status(ST0_IM);
|
clear_c0_status(ST0_IM);
|
||||||
|
|
||||||
mips_cpu_irq_init(0);
|
mips_cpu_irq_init();
|
||||||
rm7k_cpu_irq_init(8);
|
rm7k_cpu_irq_init();
|
||||||
rm9k_cpu_irq_init(12);
|
rm9k_cpu_irq_init();
|
||||||
|
|
||||||
#ifdef CONFIG_KGDB
|
#ifdef CONFIG_KGDB
|
||||||
/* At this point, initialize the second serial port */
|
/* At this point, initialize the second serial port */
|
||||||
|
|
|
@ -132,9 +132,8 @@ void __init prom_init(void)
|
||||||
prom_grab_secondary();
|
prom_grab_secondary();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __init prom_free_prom_memory(void)
|
void __init prom_free_prom_memory(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
|
void __init prom_fixup_mem_map(unsigned long start, unsigned long end)
|
||||||
|
|
|
@ -171,6 +171,7 @@ static void __init py_map_ocd(void)
|
||||||
|
|
||||||
static void __init py_uart_setup(void)
|
static void __init py_uart_setup(void)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_SERIAL_8250
|
||||||
struct uart_port up;
|
struct uart_port up;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -188,6 +189,7 @@ static void __init py_uart_setup(void)
|
||||||
|
|
||||||
if (early_serial_setup(&up))
|
if (early_serial_setup(&up))
|
||||||
printk(KERN_ERR "Early serial init of port 0 failed\n");
|
printk(KERN_ERR "Early serial init of port 0 failed\n");
|
||||||
|
#endif /* CONFIG_SERIAL_8250 */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init py_rtc_setup(void)
|
static void __init py_rtc_setup(void)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue