summaryrefslogtreecommitdiff
path: root/arch/ppc/kernel
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2003-05-01 06:57:01 +1000
committerPaul Mackerras <paulus@samba.org>2003-05-01 06:57:01 +1000
commitf80da3c43cd40e649b6267d34b8598122df347e9 (patch)
tree4a09a79fe95c59d4d4fb681de33bbb7f71cb5886 /arch/ppc/kernel
parentd1f880abc403575e9166ec673a855877352d3af3 (diff)
parentbdd556835f981b5e25191c9253a756fcb8fa82ad (diff)
Merge samba.org:/home/paulus/kernel/linux-2.5
into samba.org:/home/paulus/kernel/for-linus-ppc
Diffstat (limited to 'arch/ppc/kernel')
-rw-r--r--arch/ppc/kernel/cpu_setup_6xx.S20
-rw-r--r--arch/ppc/kernel/cputable.c34
-rw-r--r--arch/ppc/kernel/head.S24
-rw-r--r--arch/ppc/kernel/irq.c22
4 files changed, 66 insertions, 34 deletions
diff --git a/arch/ppc/kernel/cpu_setup_6xx.S b/arch/ppc/kernel/cpu_setup_6xx.S
index cb0701cb24d0..be11b8010276 100644
--- a/arch/ppc/kernel/cpu_setup_6xx.S
+++ b/arch/ppc/kernel/cpu_setup_6xx.S
@@ -16,6 +16,7 @@
#include <asm/cputable.h>
#include <asm/ppc_asm.h>
#include <asm/offsets.h>
+#include <asm/cache.h>
_GLOBAL(__setup_cpu_601)
blr
@@ -63,13 +64,7 @@ _GLOBAL(__setup_cpu_7410)
mtspr SPRN_L2CR2,r3
mtlr r4
blr
-_GLOBAL(__setup_cpu_7450)
- mflr r4
- bl setup_common_caches
- bl setup_745x_specifics
- mtlr r4
- blr
-_GLOBAL(__setup_cpu_7455)
+_GLOBAL(__setup_cpu_745x)
mflr r4
bl setup_common_caches
bl setup_745x_specifics
@@ -265,9 +260,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_NO_DPM)
#define CS_SIZE 28
.data
- .balign 4
+ .balign L1_CACHE_LINE_SIZE
cpu_state_storage:
.space CS_SIZE
+ .balign L1_CACHE_LINE_SIZE,0
.text
/* Called in normal context to backup CPU 0 state. This
@@ -277,6 +273,9 @@ cpu_state_storage:
* like HID0, HID1, MSSCR0, etc...
*/
_GLOBAL(__save_cpu_setup)
+ /* Some CR fields are volatile, we back it up all */
+ mfcr r7
+
/* Get storage ptr */
lis r5,cpu_state_storage@h
ori r5,r5,cpu_state_storage@l
@@ -322,6 +321,7 @@ _GLOBAL(__save_cpu_setup)
mfspr r4,SPRN_HID1
stw r4,CS_HID1(r5)
1:
+ mtcr r7
blr
/* Called with no MMU context (typically MSR:IR/DR off) to
@@ -329,6 +329,9 @@ _GLOBAL(__save_cpu_setup)
* function. This does not include cache setting
*/
_GLOBAL(__restore_cpu_setup)
+ /* Some CR fields are volatile, we back it up all */
+ mfcr r7
+
/* Get storage ptr */
lis r5,(cpu_state_storage-KERNELBASE)@h
ori r5,r5,cpu_state_storage@l
@@ -411,5 +414,6 @@ _GLOBAL(__restore_cpu_setup)
/* Setup final PLL */
mtspr SPRN_HID1,r4
1:
+ mtcr r7
blr
diff --git a/arch/ppc/kernel/cputable.c b/arch/ppc/kernel/cputable.c
index 3bc08629ccf1..c2f5e7e8dee7 100644
--- a/arch/ppc/kernel/cputable.c
+++ b/arch/ppc/kernel/cputable.c
@@ -26,8 +26,7 @@ extern void __setup_cpu_750cx(unsigned long offset, int cpu_nr, struct cpu_spec*
extern void __setup_cpu_750fx(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_7400(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_7410(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
-extern void __setup_cpu_7450(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
-extern void __setup_cpu_7455(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
+extern void __setup_cpu_745x(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_power3(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_8xx(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
extern void __setup_cpu_generic(unsigned long offset, int cpu_nr, struct cpu_spec* spec);
@@ -168,7 +167,7 @@ struct cpu_spec cpu_specs[] = {
0xffff0000, 0x70000000, "750FX",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_CAN_DOZE | CPU_FTR_USE_TB |
CPU_FTR_L2CR | CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_CAN_NAP |
- CPU_FTR_DUAL_PLL_750FX,
+ CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC,
32, 32,
__setup_cpu_750fx
@@ -216,7 +215,7 @@ struct cpu_spec cpu_specs[] = {
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7450
+ __setup_cpu_745x
},
{ /* 7450 2.1 */
0xffffffff, 0x80000201, "7450",
@@ -226,7 +225,7 @@ struct cpu_spec cpu_specs[] = {
CPU_FTR_L3_DISABLE_NAP,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7450
+ __setup_cpu_745x
},
{ /* 7450 2.3 and newer */
0xffff0000, 0x80000000, "7450",
@@ -235,35 +234,46 @@ struct cpu_spec cpu_specs[] = {
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7450
+ __setup_cpu_745x
},
{ /* 7455 rev 1.x */
0xffffff00, 0x80010100, "7455",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450,
+ CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7455
+ __setup_cpu_745x
},
{ /* 7455 rev 2.0 */
0xffffffff, 0x80010200, "7455",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
- CPU_FTR_L3_DISABLE_NAP,
+ CPU_FTR_L3_DISABLE_NAP | CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7455
+ __setup_cpu_745x
},
{ /* 7455 others */
0xffff0000, 0x80010000, "7455",
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
- CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR,
+ CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+ CPU_FTR_HAS_HIGH_BATS,
+ COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
+ 32, 32,
+ __setup_cpu_745x
+ },
+ { /* 7457 */
+ 0xffff0000, 0x80020000, "7457",
+ CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_CAN_NAP |
+ CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
+ CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
+ CPU_FTR_HAS_HIGH_BATS,
COMMON_PPC | PPC_FEATURE_HAS_ALTIVEC,
32, 32,
- __setup_cpu_7455
+ __setup_cpu_745x
},
{ /* 82xx (8240, 8245, 8260 are all 603e cores) */
0x7fff0000, 0x00810000, "82xx",
diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
index 68b4f262db4d..ca2584c93e26 100644
--- a/arch/ppc/kernel/head.S
+++ b/arch/ppc/kernel/head.S
@@ -1451,6 +1451,30 @@ clear_bats:
mtspr IBAT2L,r10
mtspr IBAT3U,r10
mtspr IBAT3L,r10
+BEGIN_FTR_SECTION
+ /* Here's a tweak: at this point, CPU setup have
+ * not been called yet, so HIGH_BAT_EN may not be
+ * set in HID0 for the 745x processors. However, it
+ * seems that doesn't affect our ability to actually
+ * write to these SPRs.
+ */
+ mtspr SPRN_DBAT4U,r20
+ mtspr SPRN_DBAT4L,r20
+ mtspr SPRN_DBAT5U,r20
+ mtspr SPRN_DBAT5L,r20
+ mtspr SPRN_DBAT6U,r20
+ mtspr SPRN_DBAT6L,r20
+ mtspr SPRN_DBAT7U,r20
+ mtspr SPRN_DBAT7L,r20
+ mtspr SPRN_IBAT4U,r20
+ mtspr SPRN_IBAT4L,r20
+ mtspr SPRN_IBAT5U,r20
+ mtspr SPRN_IBAT5L,r20
+ mtspr SPRN_IBAT6U,r20
+ mtspr SPRN_IBAT6L,r20
+ mtspr SPRN_IBAT7U,r20
+ mtspr SPRN_IBAT7L,r20
+END_FTR_SECTION_IFSET(CPU_FTR_HAS_HIGH_BATS)
blr
flush_tlbs:
diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c
index 24965586025c..37e3e054b787 100644
--- a/arch/ppc/kernel/irq.c
+++ b/arch/ppc/kernel/irq.c
@@ -210,7 +210,8 @@ void free_irq(unsigned int irq, void* dev_id)
return;
}
-int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
+int request_irq(unsigned int irq,
+ irqreturn_t (*handler)(int, void *, struct pt_regs *),
unsigned long irqflags, const char * devname, void *dev_id)
{
struct irqaction *action;
@@ -218,16 +219,9 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *)
if (irq >= NR_IRQS)
return -EINVAL;
- if (!handler)
- {
- /*
- * free_irq() used to be implemented as a call to
- * request_irq() with handler being NULL. Now we have
- * a real free_irq() but need to allow the old behavior
- * for old code that hasn't caught up yet.
- * -- Cort <cort@fsmlabs.com>
- */
- free_irq(irq, dev_id);
+ if (!handler) {
+ printk(KERN_ERR "request_irq called with NULL handler!\n");
+ dump_stack();
return 0;
}
@@ -246,8 +240,7 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *)
action->next = NULL;
retval = setup_irq(irq, action);
- if (retval)
- {
+ if (retval) {
kfree(action);
return retval;
}
@@ -732,6 +725,7 @@ void init_irq_proc (void)
}
}
-void no_action(int irq, void *dev, struct pt_regs *regs)
+irqreturn_t no_action(int irq, void *dev, struct pt_regs *regs)
{
+ return IRQ_NONE;
}