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.

+85 -51
+3 -4
arch/mips/kernel/setup.c
··· 269 270 static void __init bootmem_init(void) 271 { 272 - unsigned long init_begin, reserved_end; 273 unsigned long mapstart = ~0UL; 274 unsigned long bootmap_size; 275 int i; ··· 344 min_low_pfn, max_low_pfn); 345 346 347 - init_begin = PFN_UP(__pa_symbol(&__init_begin)); 348 for (i = 0; i < boot_mem_map.nr_map; i++) { 349 unsigned long start, end; 350 ··· 351 end = PFN_DOWN(boot_mem_map.map[i].addr 352 + boot_mem_map.map[i].size); 353 354 - if (start <= init_begin) 355 - start = init_begin; 356 if (start >= end) 357 continue; 358
··· 269 270 static void __init bootmem_init(void) 271 { 272 + unsigned long reserved_end; 273 unsigned long mapstart = ~0UL; 274 unsigned long bootmap_size; 275 int i; ··· 344 min_low_pfn, max_low_pfn); 345 346 347 for (i = 0; i < boot_mem_map.nr_map; i++) { 348 unsigned long start, end; 349 ··· 352 end = PFN_DOWN(boot_mem_map.map[i].addr 353 + boot_mem_map.map[i].size); 354 355 + if (start <= min_low_pfn) 356 + start = min_low_pfn; 357 if (start >= end) 358 continue; 359
+3 -3
arch/mips/lasat/image/Makefile
··· 12 13 MKLASATIMG = mklasatimg 14 MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200 15 - KERNEL_IMAGE = $(TOPDIR)/vmlinux 16 KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ ) 17 KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ ) 18 19 - LDSCRIPT= -L$(obj) -Tromscript.normal 20 21 HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ 22 -D_kernel_entry=0x$(KERNEL_ENTRY) \ ··· 24 -D TIMESTAMP=$(shell date +%s) 25 26 $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE) 27 - $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $< 28 29 OBJECTS = head.o kImage.o 30
··· 12 13 MKLASATIMG = mklasatimg 14 MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200 15 + KERNEL_IMAGE = vmlinux 16 KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ ) 17 KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ ) 18 19 + LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal 20 21 HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ 22 -D_kernel_entry=0x$(KERNEL_ENTRY) \ ··· 24 -D TIMESTAMP=$(shell date +%s) 25 26 $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE) 27 + $(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $< 28 29 OBJECTS = head.o kImage.o 30
-2
arch/mips/mips-boards/generic/memory.c
··· 169 170 void __init prom_free_prom_memory(void) 171 { 172 - #if 0 /* for now ... */ 173 unsigned long addr; 174 int i; 175 ··· 180 free_init_pages("prom memory", 181 addr, addr + boot_mem_map.map[i].size); 182 } 183 - #endif 184 }
··· 169 170 void __init prom_free_prom_memory(void) 171 { 172 unsigned long addr; 173 int i; 174 ··· 181 free_init_pages("prom memory", 182 addr, addr + boot_mem_map.map[i].size); 183 } 184 }
+6 -4
arch/mips/mips-boards/generic/reset.c
··· 39 40 static void mips_machine_restart(char *command) 41 { 42 - unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int)); 43 44 - writew(GORESET, softres_reg); 45 } 46 47 static void mips_machine_halt(void) 48 { 49 - unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int)); 50 51 - writew(GORESET, softres_reg); 52 } 53 54 #if defined(CONFIG_MIPS_ATLAS)
··· 39 40 static void mips_machine_restart(char *command) 41 { 42 + unsigned int __iomem *softres_reg = 43 + ioremap(SOFTRES_REG, sizeof(unsigned int)); 44 45 + __raw_writel(GORESET, softres_reg); 46 } 47 48 static void mips_machine_halt(void) 49 { 50 + unsigned int __iomem *softres_reg = 51 + ioremap(SOFTRES_REG, sizeof(unsigned int)); 52 53 + __raw_writel(GORESET, softres_reg); 54 } 55 56 #if defined(CONFIG_MIPS_ATLAS)
+1 -1
arch/mips/mm/dma-default.c
··· 45 /* ignore region specifiers */ 46 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); 47 48 - #ifdef CONFIG_ZONE_DMA32 49 if (dev == NULL) 50 gfp |= __GFP_DMA; 51 else if (dev->coherent_dma_mask < DMA_BIT_MASK(24))
··· 45 /* ignore region specifiers */ 46 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); 47 48 + #ifdef CONFIG_ZONE_DMA 49 if (dev == NULL) 50 gfp |= __GFP_DMA; 51 else if (dev->coherent_dma_mask < DMA_BIT_MASK(24))
+72 -37
arch/mips/philips/pnx8550/common/time.c
··· 22 #include <linux/kernel_stat.h> 23 #include <linux/spinlock.h> 24 #include <linux/interrupt.h> 25 - #include <linux/module.h> 26 27 #include <asm/bootinfo.h> 28 #include <asm/cpu.h> ··· 40 return read_c0_count2(); 41 } 42 43 static void timer_ack(void) 44 { 45 write_c0_compare(cpj); 46 } 47 48 /* 49 * plat_time_init() - it does the following things: ··· 106 107 __init void plat_time_init(void) 108 { 109 unsigned int n; 110 unsigned int m; 111 unsigned int p; 112 unsigned int pow2p; 113 114 /* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */ 115 /* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1: FIXME) */ ··· 158 write_c0_count2(0); 159 write_c0_compare2(0xffffffff); 160 161 - clocksource_mips.read = hpt_read; 162 - mips_timer_ack = timer_ack; 163 } 164 165 - static irqreturn_t monotonic_interrupt(int irq, void *dev_id) 166 - { 167 - /* Timer 2 clear interrupt */ 168 - write_c0_compare2(-1); 169 - return IRQ_HANDLED; 170 - } 171 172 - static struct irqaction monotonic_irqaction = { 173 - .handler = monotonic_interrupt, 174 - .flags = IRQF_DISABLED, 175 - .name = "Monotonic timer", 176 - }; 177 - 178 - void __init plat_timer_setup(struct irqaction *irq) 179 - { 180 - int configPR; 181 - 182 - setup_irq(PNX8550_INT_TIMER1, irq); 183 - setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction); 184 - 185 - /* Timer 1 start */ 186 - configPR = read_c0_config7(); 187 - configPR &= ~0x00000008; 188 - write_c0_config7(configPR); 189 - 190 - /* Timer 2 start */ 191 - configPR = read_c0_config7(); 192 - configPR &= ~0x00000010; 193 - write_c0_config7(configPR); 194 - 195 - /* Timer 3 stop */ 196 - configPR = read_c0_config7(); 197 - configPR |= 0x00000020; 198 - write_c0_config7(configPR); 199 - }
··· 22 #include <linux/kernel_stat.h> 23 #include <linux/spinlock.h> 24 #include <linux/interrupt.h> 25 26 #include <asm/bootinfo.h> 27 #include <asm/cpu.h> ··· 41 return read_c0_count2(); 42 } 43 44 + static struct clocksource pnx_clocksource = { 45 + .name = "pnx8xxx", 46 + .rating = 200, 47 + .read = hpt_read, 48 + .flags = CLOCK_SOURCE_IS_CONTINUOUS, 49 + }; 50 + 51 static void timer_ack(void) 52 { 53 write_c0_compare(cpj); 54 } 55 + 56 + static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id) 57 + { 58 + struct clock_event_device *c = dev_id; 59 + 60 + /* clear MATCH, signal the event */ 61 + c->event_handler(c); 62 + 63 + return IRQ_HANDLED; 64 + } 65 + 66 + static struct irqaction pnx8xxx_timer_irq = { 67 + .handler = pnx8xxx_timer_interrupt, 68 + .flags = IRQF_DISABLED | IRQF_PERCPU, 69 + .name = "pnx8xxx_timer", 70 + }; 71 + 72 + static irqreturn_t monotonic_interrupt(int irq, void *dev_id) 73 + { 74 + /* Timer 2 clear interrupt */ 75 + write_c0_compare2(-1); 76 + return IRQ_HANDLED; 77 + } 78 + 79 + static struct irqaction monotonic_irqaction = { 80 + .handler = monotonic_interrupt, 81 + .flags = IRQF_DISABLED, 82 + .name = "Monotonic timer", 83 + }; 84 + 85 + static int pnx8xxx_set_next_event(unsigned long delta, 86 + struct clock_event_device *evt) 87 + { 88 + write_c0_compare(delta); 89 + return 0; 90 + } 91 + 92 + static struct clock_event_device pnx8xxx_clockevent = { 93 + .name = "pnx8xxx_clockevent", 94 + .features = CLOCK_EVT_FEAT_ONESHOT, 95 + .set_next_event = pnx8xxx_set_next_event, 96 + }; 97 98 /* 99 * plat_time_init() - it does the following things: ··· 58 59 __init void plat_time_init(void) 60 { 61 + unsigned int configPR; 62 unsigned int n; 63 unsigned int m; 64 unsigned int p; 65 unsigned int pow2p; 66 + 67 + clockevents_register_device(&pnx8xxx_clockevent); 68 + clocksource_register(&pnx_clocksource); 69 + 70 + setup_irq(PNX8550_INT_TIMER1, &pnx8xxx_timer_irq); 71 + setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction); 72 + 73 + /* Timer 1 start */ 74 + configPR = read_c0_config7(); 75 + configPR &= ~0x00000008; 76 + write_c0_config7(configPR); 77 + 78 + /* Timer 2 start */ 79 + configPR = read_c0_config7(); 80 + configPR &= ~0x00000010; 81 + write_c0_config7(configPR); 82 + 83 + /* Timer 3 stop */ 84 + configPR = read_c0_config7(); 85 + configPR |= 0x00000020; 86 + write_c0_config7(configPR); 87 + 88 89 /* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */ 90 /* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1: FIXME) */ ··· 87 write_c0_count2(0); 88 write_c0_compare2(0xffffffff); 89 90 } 91 92