aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-07 16:31:03 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-07 16:31:03 -0500
commite4c6d3c6b14bd20fb8087acd51b29ee54a66ef77 (patch)
treec12d82ac4bb18d68e284e782919b6a925298f44f /arch
parent89a30a8388c9592579f237bc06988808f2c454d4 (diff)
parentba820c5c51296343be202c9afb072b7b943099cb (diff)
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: [MIPS] Fix CONFIG_BOOT_RAW. [MIPS] Assume R4000/R4400 newer than 3.0 don't have the mfc0 count bug [MIPS] Fix IP32 breakage [MIPS] Alchemy: Fix use of __init code bug exposed by modpost warning [MIPS] Move inclusing of kernel/time/Kconfig menu to appropriate place
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/Kconfig4
-rw-r--r--arch/mips/au1000/common/pci.c8
-rw-r--r--arch/mips/kernel/head.S3
-rw-r--r--arch/mips/kernel/time.c4
-rw-r--r--arch/mips/pci/ops-au1000.c53
-rw-r--r--arch/mips/pci/ops-mace.c7
-rw-r--r--arch/mips/pci/pci-ip32.c4
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c1
-rw-r--r--arch/mips/sgi-ip32/ip32-platform.c20
9 files changed, 57 insertions, 47 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index c6fc405a6c8e..291d368ffd28 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -992,8 +992,6 @@ config BOOT_ELF64
992 992
993menu "CPU selection" 993menu "CPU selection"
994 994
995source "kernel/time/Kconfig"
996
997choice 995choice
998 prompt "CPU type" 996 prompt "CPU type"
999 default CPU_R4X00 997 default CPU_R4X00
@@ -1768,6 +1766,8 @@ config NR_CPUS
1768 performance should round up your number of processors to the next 1766 performance should round up your number of processors to the next
1769 power of two. 1767 power of two.
1770 1768
1769source "kernel/time/Kconfig"
1770
1771# 1771#
1772# Timer Interrupt Frequency Configuration 1772# Timer Interrupt Frequency Configuration
1773# 1773#
diff --git a/arch/mips/au1000/common/pci.c b/arch/mips/au1000/common/pci.c
index 6fa70a36a250..ce771487567d 100644
--- a/arch/mips/au1000/common/pci.c
+++ b/arch/mips/au1000/common/pci.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * BRIEF MODULE DESCRIPTION 2 * BRIEF MODULE DESCRIPTION
3 * Alchemy/AMD Au1x00 pci support. 3 * Alchemy/AMD Au1x00 PCI support.
4 * 4 *
5 * Copyright 2001,2002,2003 MontaVista Software Inc. 5 * Copyright 2001-2003, 2007 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc. 6 * Author: MontaVista Software, Inc.
7 * ppopov@mvista.com or source@mvista.com 7 * ppopov@mvista.com or source@mvista.com
8 * 8 *
@@ -66,6 +66,8 @@ static unsigned long virt_io_addr;
66 66
67static int __init au1x_pci_setup(void) 67static int __init au1x_pci_setup(void)
68{ 68{
69 extern void au1x_pci_cfg_init(void);
70
69#if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550) 71#if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
70 virt_io_addr = (unsigned long)ioremap(Au1500_PCI_IO_START, 72 virt_io_addr = (unsigned long)ioremap(Au1500_PCI_IO_START,
71 Au1500_PCI_IO_END - Au1500_PCI_IO_START + 1); 73 Au1500_PCI_IO_END - Au1500_PCI_IO_START + 1);
@@ -94,6 +96,8 @@ static int __init au1x_pci_setup(void)
94 set_io_port_base(virt_io_addr); 96 set_io_port_base(virt_io_addr);
95#endif 97#endif
96 98
99 au1x_pci_cfg_init();
100
97 register_pci_controller(&au1x_controller); 101 register_pci_controller(&au1x_controller);
98 return 0; 102 return 0;
99} 103}
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 236768731063..50be56c9e9ef 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -136,7 +136,8 @@ EXPORT(_stext)
136 * kernel load address. This is needed because this platform does 136 * kernel load address. This is needed because this platform does
137 * not have a ELF loader yet. 137 * not have a ELF loader yet.
138 */ 138 */
139 __INIT 139FEXPORT(__kernel_entry)
140 j kernel_entry
140#endif 141#endif
141 142
142 __INIT_REFOK 143 __INIT_REFOK
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 1ecfbb7eba6c..2995be1ab3ca 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -147,9 +147,9 @@ static __init int cpu_has_mfc0_count_bug(void)
147 return 1; 147 return 1;
148 148
149 /* 149 /*
150 * I don't have erratas for newer R4400 so be paranoid. 150 * we assume newer revisions are ok
151 */ 151 */
152 return 1; 152 return 0;
153 } 153 }
154 154
155 return 0; 155 return 0;
diff --git a/arch/mips/pci/ops-au1000.c b/arch/mips/pci/ops-au1000.c
index 6b29904acf45..1314bd58f036 100644
--- a/arch/mips/pci/ops-au1000.c
+++ b/arch/mips/pci/ops-au1000.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * BRIEF MODULE DESCRIPTION 2 * BRIEF MODULE DESCRIPTION
3 * Alchemy/AMD Au1x00 pci support. 3 * Alchemy/AMD Au1x00 PCI support.
4 * 4 *
5 * Copyright 2001,2002,2003 MontaVista Software Inc. 5 * Copyright 2001-2003, 2007 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc. 6 * Author: MontaVista Software, Inc.
7 * ppopov@mvista.com or source@mvista.com 7 * ppopov@mvista.com or source@mvista.com
8 * 8 *
@@ -69,10 +69,27 @@ void mod_wired_entry(int entry, unsigned long entrylo0,
69 write_c0_pagemask(old_pagemask); 69 write_c0_pagemask(old_pagemask);
70} 70}
71 71
72struct vm_struct *pci_cfg_vm; 72static struct vm_struct *pci_cfg_vm;
73static int pci_cfg_wired_entry; 73static int pci_cfg_wired_entry;
74static int first_cfg = 1; 74static unsigned long last_entryLo0, last_entryLo1;
75unsigned long last_entryLo0, last_entryLo1; 75
76/*
77 * We can't ioremap the entire pci config space because it's too large.
78 * Nor can we call ioremap dynamically because some device drivers use
79 * the PCI config routines from within interrupt handlers and that
80 * becomes a problem in get_vm_area(). We use one wired TLB to handle
81 * all config accesses for all busses.
82 */
83void __init au1x_pci_cfg_init(void)
84{
85 /* Reserve a wired entry for PCI config accesses */
86 pci_cfg_vm = get_vm_area(0x2000, VM_IOREMAP);
87 if (!pci_cfg_vm)
88 panic(KERN_ERR "PCI unable to get vm area\n");
89 pci_cfg_wired_entry = read_c0_wired();
90 add_wired_entry(0, 0, (unsigned long)pci_cfg_vm->addr, PM_4K);
91 last_entryLo0 = last_entryLo1 = 0xffffffff;
92}
76 93
77static int config_access(unsigned char access_type, struct pci_bus *bus, 94static int config_access(unsigned char access_type, struct pci_bus *bus,
78 unsigned int dev_fn, unsigned char where, 95 unsigned int dev_fn, unsigned char where,
@@ -97,27 +114,6 @@ static int config_access(unsigned char access_type, struct pci_bus *bus,
97 Au1500_PCI_STATCMD); 114 Au1500_PCI_STATCMD);
98 au_sync_udelay(1); 115 au_sync_udelay(1);
99 116
100 /*
101 * We can't ioremap the entire pci config space because it's
102 * too large. Nor can we call ioremap dynamically because some
103 * device drivers use the pci config routines from within
104 * interrupt handlers and that becomes a problem in get_vm_area().
105 * We use one wired tlb to handle all config accesses for all
106 * busses. To improve performance, if the current device
107 * is the same as the last device accessed, we don't touch the
108 * tlb.
109 */
110 if (first_cfg) {
111 /* reserve a wired entry for pci config accesses */
112 first_cfg = 0;
113 pci_cfg_vm = get_vm_area(0x2000, VM_IOREMAP);
114 if (!pci_cfg_vm)
115 panic(KERN_ERR "PCI unable to get vm area\n");
116 pci_cfg_wired_entry = read_c0_wired();
117 add_wired_entry(0, 0, (unsigned long)pci_cfg_vm->addr, PM_4K);
118 last_entryLo0 = last_entryLo1 = 0xffffffff;
119 }
120
121 /* Allow board vendors to implement their own off-chip idsel. 117 /* Allow board vendors to implement their own off-chip idsel.
122 * If it doesn't succeed, may as well bail out at this point. 118 * If it doesn't succeed, may as well bail out at this point.
123 */ 119 */
@@ -144,9 +140,12 @@ static int config_access(unsigned char access_type, struct pci_bus *bus,
144 /* page boundary */ 140 /* page boundary */
145 cfg_base = cfg_base & PAGE_MASK; 141 cfg_base = cfg_base & PAGE_MASK;
146 142
143 /*
144 * To improve performance, if the current device is the same as
145 * the last device accessed, we don't touch the TLB.
146 */
147 entryLo0 = (6 << 26) | (cfg_base >> 6) | (2 << 3) | 7; 147 entryLo0 = (6 << 26) | (cfg_base >> 6) | (2 << 3) | 7;
148 entryLo1 = (6 << 26) | (cfg_base >> 6) | (0x1000 >> 6) | (2 << 3) | 7; 148 entryLo1 = (6 << 26) | (cfg_base >> 6) | (0x1000 >> 6) | (2 << 3) | 7;
149
150 if ((entryLo0 != last_entryLo0) || (entryLo1 != last_entryLo1)) { 149 if ((entryLo0 != last_entryLo0) || (entryLo1 != last_entryLo1)) {
151 mod_wired_entry(pci_cfg_wired_entry, entryLo0, entryLo1, 150 mod_wired_entry(pci_cfg_wired_entry, entryLo0, entryLo1,
152 (unsigned long)pci_cfg_vm->addr, PM_4K); 151 (unsigned long)pci_cfg_vm->addr, PM_4K);
diff --git a/arch/mips/pci/ops-mace.c b/arch/mips/pci/ops-mace.c
index fe5451449304..e95881897ec9 100644
--- a/arch/mips/pci/ops-mace.c
+++ b/arch/mips/pci/ops-mace.c
@@ -42,6 +42,10 @@ static int
42mace_pci_read_config(struct pci_bus *bus, unsigned int devfn, 42mace_pci_read_config(struct pci_bus *bus, unsigned int devfn,
43 int reg, int size, u32 *val) 43 int reg, int size, u32 *val)
44{ 44{
45 u32 control = mace->pci.control;
46
47 /* disable master aborts interrupts during config read */
48 mace->pci.control = control & ~MACEPCI_CONTROL_MAR_INT;
45 mace->pci.config_addr = mkaddr(bus, devfn, reg); 49 mace->pci.config_addr = mkaddr(bus, devfn, reg);
46 switch (size) { 50 switch (size) {
47 case 1: 51 case 1:
@@ -54,6 +58,9 @@ mace_pci_read_config(struct pci_bus *bus, unsigned int devfn,
54 *val = mace->pci.config_data.l; 58 *val = mace->pci.config_data.l;
55 break; 59 break;
56 } 60 }
61 /* ack possible master abort */
62 mace->pci.error &= ~MACEPCI_ERROR_MASTER_ABORT;
63 mace->pci.control = control;
57 64
58 DPRINTK("read%d: reg=%08x,val=%02x\n", size * 8, reg, *val); 65 DPRINTK("read%d: reg=%08x,val=%02x\n", size * 8, reg, *val);
59 66
diff --git a/arch/mips/pci/pci-ip32.c b/arch/mips/pci/pci-ip32.c
index 618ea7dbc474..532b561b4442 100644
--- a/arch/mips/pci/pci-ip32.c
+++ b/arch/mips/pci/pci-ip32.c
@@ -119,6 +119,7 @@ static struct pci_controller mace_pci_controller = {
119 .iommu = 0, 119 .iommu = 0,
120 .mem_offset = MACE_PCI_MEM_OFFSET, 120 .mem_offset = MACE_PCI_MEM_OFFSET,
121 .io_offset = 0, 121 .io_offset = 0,
122 .io_map_base = CKSEG1ADDR(MACEPCI_LOW_IO),
122}; 123};
123 124
124static int __init mace_init(void) 125static int __init mace_init(void)
@@ -135,7 +136,8 @@ static int __init mace_init(void)
135 BUG_ON(request_irq(MACE_PCI_BRIDGE_IRQ, macepci_error, 0, 136 BUG_ON(request_irq(MACE_PCI_BRIDGE_IRQ, macepci_error, 0,
136 "MACE PCI error", NULL)); 137 "MACE PCI error", NULL));
137 138
138 iomem_resource = mace_pci_mem_resource; 139 /* extend memory resources */
140 iomem_resource.end = mace_pci_mem_resource.end;
139 ioport_resource = mace_pci_io_resource; 141 ioport_resource = mace_pci_io_resource;
140 142
141 register_pci_controller(&mace_pci_controller); 143 register_pci_controller(&mace_pci_controller);
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index cab7cc22ab67..b0ea0e43ba48 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -426,7 +426,6 @@ static void ip32_irq0(void)
426 426
427 crime_int = crime->istat & crime_mask; 427 crime_int = crime->istat & crime_mask;
428 irq = MACE_VID_IN1_IRQ + __ffs(crime_int); 428 irq = MACE_VID_IN1_IRQ + __ffs(crime_int);
429 crime_int = 1 << irq;
430 429
431 if (crime_int & CRIME_MACEISA_INT_MASK) { 430 if (crime_int & CRIME_MACEISA_INT_MASK) {
432 unsigned long mace_int = mace->perif.ctrl.istat; 431 unsigned long mace_int = mace->perif.ctrl.istat;
diff --git a/arch/mips/sgi-ip32/ip32-platform.c b/arch/mips/sgi-ip32/ip32-platform.c
index 77febd68fcd4..89a71f49b692 100644
--- a/arch/mips/sgi-ip32/ip32-platform.c
+++ b/arch/mips/sgi-ip32/ip32-platform.c
@@ -13,21 +13,22 @@
13#include <asm/ip32/mace.h> 13#include <asm/ip32/mace.h>
14#include <asm/ip32/ip32_ints.h> 14#include <asm/ip32/ip32_ints.h>
15 15
16/* 16#define MACEISA_SERIAL1_OFFS offsetof(struct sgi_mace, isa.serial1)
17 * .iobase isn't a constant (in the sense of C) so we fill it in at runtime. 17#define MACEISA_SERIAL2_OFFS offsetof(struct sgi_mace, isa.serial2)
18 */ 18
19#define MACE_PORT(int) \ 19#define MACE_PORT(offset,_irq) \
20{ \ 20{ \
21 .irq = int, \ 21 .mapbase = MACE_BASE + offset, \
22 .irq = _irq, \
22 .uartclk = 1843200, \ 23 .uartclk = 1843200, \
23 .iotype = UPIO_MEM, \ 24 .iotype = UPIO_MEM, \
24 .flags = UPF_SKIP_TEST, \ 25 .flags = UPF_SKIP_TEST|UPF_IOREMAP, \
25 .regshift = 8, \ 26 .regshift = 8, \
26} 27}
27 28
28static struct plat_serial8250_port uart8250_data[] = { 29static struct plat_serial8250_port uart8250_data[] = {
29 MACE_PORT(MACEISA_SERIAL1_IRQ), 30 MACE_PORT(MACEISA_SERIAL1_OFFS, MACEISA_SERIAL1_IRQ),
30 MACE_PORT(MACEISA_SERIAL2_IRQ), 31 MACE_PORT(MACEISA_SERIAL2_OFFS, MACEISA_SERIAL2_IRQ),
31 { }, 32 { },
32}; 33};
33 34
@@ -41,9 +42,6 @@ static struct platform_device uart8250_device = {
41 42
42static int __init uart8250_init(void) 43static int __init uart8250_init(void)
43{ 44{
44 uart8250_data[0].membase = (void __iomem *) &mace->isa.serial1;
45 uart8250_data[1].membase = (void __iomem *) &mace->isa.serial2;
46
47 return platform_device_register(&uart8250_device); 45 return platform_device_register(&uart8250_device);
48} 46}
49 47