aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-11 14:48:00 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-11 14:48:00 -0500
commit22fb53c943b0ad4f86639bccb7ad8753be8ce435 (patch)
tree6051a0be08c1af5b1047014dbaffdb0fd8e65e8a
parent8dab63761219d7bc6a7d7d3b5f0fca76af5533a5 (diff)
parente452e94e21e8f4a3c2ff045b301ca21c1f6d03bf (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] Replace 40c7869b693b18412491fdcff64682215b739f9e kludge [MIPS] Lasat: Fix built in separate object directory. [MIPS] Malta: Fix software reset on big endian [MIPS] pnx8xxx: move to clocksource [MIPS] Wrong CONFIG option prevents setup of DMA zone.
-rw-r--r--arch/mips/kernel/setup.c7
-rw-r--r--arch/mips/lasat/image/Makefile6
-rw-r--r--arch/mips/mips-boards/generic/memory.c2
-rw-r--r--arch/mips/mips-boards/generic/reset.c10
-rw-r--r--arch/mips/mm/dma-default.c2
-rw-r--r--arch/mips/philips/pnx8550/common/time.c109
6 files changed, 85 insertions, 51 deletions
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 7f6ddcb5d485..f8a535afce39 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -269,7 +269,7 @@ static void __init bootmem_init(void)
269 269
270static void __init bootmem_init(void) 270static void __init bootmem_init(void)
271{ 271{
272 unsigned long init_begin, reserved_end; 272 unsigned long reserved_end;
273 unsigned long mapstart = ~0UL; 273 unsigned long mapstart = ~0UL;
274 unsigned long bootmap_size; 274 unsigned long bootmap_size;
275 int i; 275 int i;
@@ -344,7 +344,6 @@ static void __init bootmem_init(void)
344 min_low_pfn, max_low_pfn); 344 min_low_pfn, max_low_pfn);
345 345
346 346
347 init_begin = PFN_UP(__pa_symbol(&__init_begin));
348 for (i = 0; i < boot_mem_map.nr_map; i++) { 347 for (i = 0; i < boot_mem_map.nr_map; i++) {
349 unsigned long start, end; 348 unsigned long start, end;
350 349
@@ -352,8 +351,8 @@ static void __init bootmem_init(void)
352 end = PFN_DOWN(boot_mem_map.map[i].addr 351 end = PFN_DOWN(boot_mem_map.map[i].addr
353 + boot_mem_map.map[i].size); 352 + boot_mem_map.map[i].size);
354 353
355 if (start <= init_begin) 354 if (start <= min_low_pfn)
356 start = init_begin; 355 start = min_low_pfn;
357 if (start >= end) 356 if (start >= end)
358 continue; 357 continue;
359 358
diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
index 5332449ec040..460626b6d62f 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -12,11 +12,11 @@ endif
12 12
13MKLASATIMG = mklasatimg 13MKLASATIMG = mklasatimg
14MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200 14MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
15KERNEL_IMAGE = $(TOPDIR)/vmlinux 15KERNEL_IMAGE = vmlinux
16KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ ) 16KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
17KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ ) 17KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
18 18
19LDSCRIPT= -L$(obj) -Tromscript.normal 19LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal
20 20
21HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ 21HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
22 -D_kernel_entry=0x$(KERNEL_ENTRY) \ 22 -D_kernel_entry=0x$(KERNEL_ENTRY) \
@@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
24 -D TIMESTAMP=$(shell date +%s) 24 -D TIMESTAMP=$(shell date +%s)
25 25
26$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE) 26$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
27 $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $< 27 $(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $<
28 28
29OBJECTS = head.o kImage.o 29OBJECTS = head.o kImage.o
30 30
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index 2c5c27c8e86d..dc272c188233 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -169,7 +169,6 @@ void __init prom_meminit(void)
169 169
170void __init prom_free_prom_memory(void) 170void __init prom_free_prom_memory(void)
171{ 171{
172#if 0 /* for now ... */
173 unsigned long addr; 172 unsigned long addr;
174 int i; 173 int i;
175 174
@@ -181,5 +180,4 @@ void __init prom_free_prom_memory(void)
181 free_init_pages("prom memory", 180 free_init_pages("prom memory",
182 addr, addr + boot_mem_map.map[i].size); 181 addr, addr + boot_mem_map.map[i].size);
183 } 182 }
184#endif
185} 183}
diff --git a/arch/mips/mips-boards/generic/reset.c b/arch/mips/mips-boards/generic/reset.c
index 7a1bb51f81ee..583d468d98a9 100644
--- a/arch/mips/mips-boards/generic/reset.c
+++ b/arch/mips/mips-boards/generic/reset.c
@@ -39,16 +39,18 @@ static void atlas_machine_power_off(void);
39 39
40static void mips_machine_restart(char *command) 40static void mips_machine_restart(char *command)
41{ 41{
42 unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int)); 42 unsigned int __iomem *softres_reg =
43 ioremap(SOFTRES_REG, sizeof(unsigned int));
43 44
44 writew(GORESET, softres_reg); 45 __raw_writel(GORESET, softres_reg);
45} 46}
46 47
47static void mips_machine_halt(void) 48static void mips_machine_halt(void)
48{ 49{
49 unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int)); 50 unsigned int __iomem *softres_reg =
51 ioremap(SOFTRES_REG, sizeof(unsigned int));
50 52
51 writew(GORESET, softres_reg); 53 __raw_writel(GORESET, softres_reg);
52} 54}
53 55
54#if defined(CONFIG_MIPS_ATLAS) 56#if defined(CONFIG_MIPS_ATLAS)
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index ae76795685cc..810535dd091b 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -45,7 +45,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
45 /* ignore region specifiers */ 45 /* ignore region specifiers */
46 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); 46 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
47 47
48#ifdef CONFIG_ZONE_DMA32 48#ifdef CONFIG_ZONE_DMA
49 if (dev == NULL) 49 if (dev == NULL)
50 gfp |= __GFP_DMA; 50 gfp |= __GFP_DMA;
51 else if (dev->coherent_dma_mask < DMA_BIT_MASK(24)) 51 else if (dev->coherent_dma_mask < DMA_BIT_MASK(24))
diff --git a/arch/mips/philips/pnx8550/common/time.c b/arch/mips/philips/pnx8550/common/time.c
index e818fd0f1584..6d494e0de3d9 100644
--- a/arch/mips/philips/pnx8550/common/time.c
+++ b/arch/mips/philips/pnx8550/common/time.c
@@ -22,7 +22,6 @@
22#include <linux/kernel_stat.h> 22#include <linux/kernel_stat.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/module.h>
26 25
27#include <asm/bootinfo.h> 26#include <asm/bootinfo.h>
28#include <asm/cpu.h> 27#include <asm/cpu.h>
@@ -41,11 +40,60 @@ static cycle_t hpt_read(void)
41 return read_c0_count2(); 40 return read_c0_count2();
42} 41}
43 42
43static struct clocksource pnx_clocksource = {
44 .name = "pnx8xxx",
45 .rating = 200,
46 .read = hpt_read,
47 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
48};
49
44static void timer_ack(void) 50static void timer_ack(void)
45{ 51{
46 write_c0_compare(cpj); 52 write_c0_compare(cpj);
47} 53}
48 54
55static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id)
56{
57 struct clock_event_device *c = dev_id;
58
59 /* clear MATCH, signal the event */
60 c->event_handler(c);
61
62 return IRQ_HANDLED;
63}
64
65static struct irqaction pnx8xxx_timer_irq = {
66 .handler = pnx8xxx_timer_interrupt,
67 .flags = IRQF_DISABLED | IRQF_PERCPU,
68 .name = "pnx8xxx_timer",
69};
70
71static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
72{
73 /* Timer 2 clear interrupt */
74 write_c0_compare2(-1);
75 return IRQ_HANDLED;
76}
77
78static struct irqaction monotonic_irqaction = {
79 .handler = monotonic_interrupt,
80 .flags = IRQF_DISABLED,
81 .name = "Monotonic timer",
82};
83
84static int pnx8xxx_set_next_event(unsigned long delta,
85 struct clock_event_device *evt)
86{
87 write_c0_compare(delta);
88 return 0;
89}
90
91static struct clock_event_device pnx8xxx_clockevent = {
92 .name = "pnx8xxx_clockevent",
93 .features = CLOCK_EVT_FEAT_ONESHOT,
94 .set_next_event = pnx8xxx_set_next_event,
95};
96
49/* 97/*
50 * plat_time_init() - it does the following things: 98 * plat_time_init() - it does the following things:
51 * 99 *
@@ -58,11 +106,34 @@ static void timer_ack(void)
58 106
59__init void plat_time_init(void) 107__init void plat_time_init(void)
60{ 108{
109 unsigned int configPR;
61 unsigned int n; 110 unsigned int n;
62 unsigned int m; 111 unsigned int m;
63 unsigned int p; 112 unsigned int p;
64 unsigned int pow2p; 113 unsigned int pow2p;
65 114
115 clockevents_register_device(&pnx8xxx_clockevent);
116 clocksource_register(&pnx_clocksource);
117
118 setup_irq(PNX8550_INT_TIMER1, &pnx8xxx_timer_irq);
119 setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
120
121 /* Timer 1 start */
122 configPR = read_c0_config7();
123 configPR &= ~0x00000008;
124 write_c0_config7(configPR);
125
126 /* Timer 2 start */
127 configPR = read_c0_config7();
128 configPR &= ~0x00000010;
129 write_c0_config7(configPR);
130
131 /* Timer 3 stop */
132 configPR = read_c0_config7();
133 configPR |= 0x00000020;
134 write_c0_config7(configPR);
135
136
66 /* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */ 137 /* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */
67 /* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1: FIXME) */ 138 /* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1: FIXME) */
68 139
@@ -87,42 +158,6 @@ __init void plat_time_init(void)
87 write_c0_count2(0); 158 write_c0_count2(0);
88 write_c0_compare2(0xffffffff); 159 write_c0_compare2(0xffffffff);
89 160
90 clocksource_mips.read = hpt_read;
91 mips_timer_ack = timer_ack;
92}
93
94static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
95{
96 /* Timer 2 clear interrupt */
97 write_c0_compare2(-1);
98 return IRQ_HANDLED;
99} 161}
100 162
101static struct irqaction monotonic_irqaction = {
102 .handler = monotonic_interrupt,
103 .flags = IRQF_DISABLED,
104 .name = "Monotonic timer",
105};
106 163
107void __init plat_timer_setup(struct irqaction *irq)
108{
109 int configPR;
110
111 setup_irq(PNX8550_INT_TIMER1, irq);
112 setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
113
114 /* Timer 1 start */
115 configPR = read_c0_config7();
116 configPR &= ~0x00000008;
117 write_c0_config7(configPR);
118
119 /* Timer 2 start */
120 configPR = read_c0_config7();
121 configPR &= ~0x00000010;
122 write_c0_config7(configPR);
123
124 /* Timer 3 stop */
125 configPR = read_c0_config7();
126 configPR |= 0x00000020;
127 write_c0_config7(configPR);
128}