aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-28 22:33:04 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-28 22:33:04 -0400
commit7b5573769f26a23518b33a64ec129d2833564877 (patch)
tree697674b1d2bf12541fc745baa8ef8d9e6faf8888 /arch
parent8e8ef2971b0fd6dcf1a66014fb74b41938eecb4e (diff)
parent27b92bdbd589cf3f59244bf5e848e7be254a2e4c (diff)
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: Input Serio: Blackfin doesnt support I8042 - make sure it doesnt get selected Blackfin arch: add BF54x I2C/TWI TWI0 driver support Blackfin On-Chip RTC driver update for supporting BF54x Blackfin Ethernet MAC driver: fix bug Report returned -ENOMEM upwards (in case L1/uncached memory alloc fails) Blackfin arch: add error message when IRQ no available Blackfin arch: Initialize the exception vectors early in the boot process Blackfin arch: fix a compiling warning about dma-mapping Blackfin arch: switch to using proper defines this time THREAD_SIZE and PAGE_SIZE instead of just PAGE_SIZE everywhere Blackfin arch: fix bug which unaligns the init thread's stack and causes the current macro to fail. Blackfin arch: Load P0 before storing through it Blackfin arch: fix KGDB bug, dont forget last parameter. Blackfin arch: add selections for BF544 and BF542 Blackfin arch: use bfin_read_SWRST() now that BF561 provides it Blackfin arch: setup aliases for some core Core A MMRs
Diffstat (limited to 'arch')
-rw-r--r--arch/blackfin/Makefile4
-rw-r--r--arch/blackfin/kernel/dma-mapping.c3
-rw-r--r--arch/blackfin/kernel/setup.c5
-rw-r--r--arch/blackfin/kernel/traps.c2
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S16
-rw-r--r--arch/blackfin/mach-bf561/head.S10
-rw-r--r--arch/blackfin/mach-common/cacheinit.S3
-rw-r--r--arch/blackfin/mach-common/ints-priority-dc.c39
-rw-r--r--arch/blackfin/mach-common/ints-priority-sc.c48
9 files changed, 76 insertions, 54 deletions
diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index 1b75672dfc8f..20841663270f 100644
--- a/arch/blackfin/Makefile
+++ b/arch/blackfin/Makefile
@@ -24,6 +24,8 @@ machine-$(CONFIG_BF533) := bf533
24machine-$(CONFIG_BF534) := bf537 24machine-$(CONFIG_BF534) := bf537
25machine-$(CONFIG_BF536) := bf537 25machine-$(CONFIG_BF536) := bf537
26machine-$(CONFIG_BF537) := bf537 26machine-$(CONFIG_BF537) := bf537
27machine-$(CONFIG_BF542) := bf548
28machine-$(CONFIG_BF544) := bf548
27machine-$(CONFIG_BF548) := bf548 29machine-$(CONFIG_BF548) := bf548
28machine-$(CONFIG_BF549) := bf548 30machine-$(CONFIG_BF549) := bf548
29machine-$(CONFIG_BF561) := bf561 31machine-$(CONFIG_BF561) := bf561
@@ -36,6 +38,8 @@ cpu-$(CONFIG_BF533) := bf533
36cpu-$(CONFIG_BF534) := bf534 38cpu-$(CONFIG_BF534) := bf534
37cpu-$(CONFIG_BF536) := bf536 39cpu-$(CONFIG_BF536) := bf536
38cpu-$(CONFIG_BF537) := bf537 40cpu-$(CONFIG_BF537) := bf537
41cpu-$(CONFIG_BF542) := bf542
42cpu-$(CONFIG_BF544) := bf544
39cpu-$(CONFIG_BF548) := bf548 43cpu-$(CONFIG_BF548) := bf548
40cpu-$(CONFIG_BF549) := bf549 44cpu-$(CONFIG_BF549) := bf549
41cpu-$(CONFIG_BF561) := bf561 45cpu-$(CONFIG_BF561) := bf561
diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c
index ea48d5b13f11..94d7b119b71e 100644
--- a/arch/blackfin/kernel/dma-mapping.c
+++ b/arch/blackfin/kernel/dma-mapping.c
@@ -160,7 +160,8 @@ dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
160 BUG_ON(direction == DMA_NONE); 160 BUG_ON(direction == DMA_NONE);
161 161
162 for (i = 0; i < nents; i++, sg++) { 162 for (i = 0; i < nents; i++, sg++) {
163 sg->dma_address = page_address(sg->page) + sg->offset; 163 sg->dma_address = (dma_addr_t)(page_address(sg->page) +
164 sg->offset);
164 165
165 invalidate_dcache_range(sg_dma_address(sg), 166 invalidate_dcache_range(sg_dma_address(sg),
166 sg_dma_address(sg) + 167 sg_dma_address(sg) +
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index f59dcee7bae3..88f221b89b33 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -402,11 +402,7 @@ void __init setup_arch(char **cmdline_p)
402 if (l1_length > L1_DATA_A_LENGTH) 402 if (l1_length > L1_DATA_A_LENGTH)
403 panic("L1 data memory overflow\n"); 403 panic("L1 data memory overflow\n");
404 404
405#ifdef BF561_FAMILY
406 _bfin_swrst = bfin_read_SICA_SWRST();
407#else
408 _bfin_swrst = bfin_read_SWRST(); 405 _bfin_swrst = bfin_read_SWRST();
409#endif
410 406
411 /* Copy atomic sequences to their fixed location, and sanity check that 407 /* Copy atomic sequences to their fixed location, and sanity check that
412 these locations are the ones that we advertise to userspace. */ 408 these locations are the ones that we advertise to userspace. */
@@ -429,6 +425,7 @@ void __init setup_arch(char **cmdline_p)
429 BUG_ON((char *)&atomic_xor32 - (char *)&fixed_code_start 425 BUG_ON((char *)&atomic_xor32 - (char *)&fixed_code_start
430 != ATOMIC_XOR32 - FIXED_CODE_START); 426 != ATOMIC_XOR32 - FIXED_CODE_START);
431 427
428 init_exception_vectors();
432 bf53x_cache_init(); 429 bf53x_cache_init();
433} 430}
434 431
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index 3909f5b35536..8766bd612b47 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -140,7 +140,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
140#ifdef CONFIG_KGDB 140#ifdef CONFIG_KGDB
141# define CHK_DEBUGGER_TRAP() \ 141# define CHK_DEBUGGER_TRAP() \
142 do { \ 142 do { \
143 CHK_DEBUGGER(trapnr, sig, info.si_code, fp); \ 143 CHK_DEBUGGER(trapnr, sig, info.si_code, fp, ); \
144 } while (0) 144 } while (0)
145# define CHK_DEBUGGER_TRAP_MAYBE() \ 145# define CHK_DEBUGGER_TRAP_MAYBE() \
146 do { \ 146 do { \
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index d06f860f4790..fb53780247bc 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -32,6 +32,7 @@
32#include <asm-generic/vmlinux.lds.h> 32#include <asm-generic/vmlinux.lds.h>
33#include <asm/mem_map.h> 33#include <asm/mem_map.h>
34#include <asm/page.h> 34#include <asm/page.h>
35#include <asm/thread_info.h>
35 36
36OUTPUT_FORMAT("elf32-bfin") 37OUTPUT_FORMAT("elf32-bfin")
37ENTRY(__start) 38ENTRY(__start)
@@ -64,8 +65,12 @@ SECTIONS
64 65
65 .data : 66 .data :
66 { 67 {
67 . = ALIGN(PAGE_SIZE); 68 /* make sure the init_task is aligned to the
69 * kernel thread size so we can locate the kernel
70 * stack properly and quickly.
71 */
68 __sdata = .; 72 __sdata = .;
73 . = ALIGN(THREAD_SIZE);
69 *(.data.init_task) 74 *(.data.init_task)
70 DATA_DATA 75 DATA_DATA
71 CONSTRUCTORS 76 CONSTRUCTORS
@@ -73,14 +78,14 @@ SECTIONS
73 . = ALIGN(32); 78 . = ALIGN(32);
74 *(.data.cacheline_aligned) 79 *(.data.cacheline_aligned)
75 80
76 . = ALIGN(PAGE_SIZE); 81 . = ALIGN(THREAD_SIZE);
77 __edata = .; 82 __edata = .;
78 } 83 }
79 84
80 . = ALIGN(PAGE_SIZE);
81 ___init_begin = .; 85 ___init_begin = .;
82 .init : 86 .init :
83 { 87 {
88 . = ALIGN(PAGE_SIZE);
84 __sinittext = .; 89 __sinittext = .;
85 *(.init.text) 90 *(.init.text)
86 __einittext = .; 91 __einittext = .;
@@ -153,10 +158,9 @@ SECTIONS
153 __ebss_b_l1 = .; 158 __ebss_b_l1 = .;
154 } 159 }
155 160
156 . = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); 161 ___init_end = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
157 ___init_end = ALIGN(PAGE_SIZE);
158 162
159 .bss ___init_end : 163 .bss LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1) :
160 { 164 {
161 . = ALIGN(4); 165 . = ALIGN(4);
162 ___bss_start = .; 166 ___bss_start = .;
diff --git a/arch/blackfin/mach-bf561/head.S b/arch/blackfin/mach-bf561/head.S
index 2f08bcb2dded..38650a628980 100644
--- a/arch/blackfin/mach-bf561/head.S
+++ b/arch/blackfin/mach-bf561/head.S
@@ -440,15 +440,15 @@ ENTRY(_bfin_reset)
440 SSYNC; 440 SSYNC;
441 441
442 /* make sure SYSCR is set to use BMODE */ 442 /* make sure SYSCR is set to use BMODE */
443 P0.h = hi(SICA_SYSCR); 443 P0.h = hi(SYSCR);
444 P0.l = lo(SICA_SYSCR); 444 P0.l = lo(SYSCR);
445 R0.l = 0x20; 445 R0.l = 0x20; /* on BF561, disable core b */
446 W[P0] = R0.l; 446 W[P0] = R0.l;
447 SSYNC; 447 SSYNC;
448 448
449 /* issue a system soft reset */ 449 /* issue a system soft reset */
450 P1.h = hi(SICA_SWRST); 450 P1.h = hi(SWRST);
451 P1.l = lo(SICA_SWRST); 451 P1.l = lo(SWRST);
452 R1.l = 0x0007; 452 R1.l = 0x0007;
453 W[P1] = R1; 453 W[P1] = R1;
454 SSYNC; 454 SSYNC;
diff --git a/arch/blackfin/mach-common/cacheinit.S b/arch/blackfin/mach-common/cacheinit.S
index 9d475623b724..5be6b975ae4a 100644
--- a/arch/blackfin/mach-common/cacheinit.S
+++ b/arch/blackfin/mach-common/cacheinit.S
@@ -60,6 +60,9 @@ ENDPROC(_bfin_write_IMEM_CONTROL)
60 60
61#if defined(CONFIG_BLKFIN_DCACHE) 61#if defined(CONFIG_BLKFIN_DCACHE)
62ENTRY(_bfin_write_DMEM_CONTROL) 62ENTRY(_bfin_write_DMEM_CONTROL)
63 P0.l = (DMEM_CONTROL & 0xFFFF);
64 P0.h = (DMEM_CONTROL >> 16);
65
63 CLI R1; 66 CLI R1;
64 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */ 67 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
65 .align 8; 68 .align 8;
diff --git a/arch/blackfin/mach-common/ints-priority-dc.c b/arch/blackfin/mach-common/ints-priority-dc.c
index 6b9fd03ce835..660f881b620a 100644
--- a/arch/blackfin/mach-common/ints-priority-dc.c
+++ b/arch/blackfin/mach-common/ints-priority-dc.c
@@ -358,26 +358,10 @@ static void bf561_demux_gpio_irq(unsigned int inta_irq,
358 358
359#endif /* CONFIG_IRQCHIP_DEMUX_GPIO */ 359#endif /* CONFIG_IRQCHIP_DEMUX_GPIO */
360 360
361/* 361void __init init_exception_vectors(void)
362 * This function should be called during kernel startup to initialize
363 * the BFin IRQ handling routines.
364 */
365int __init init_arch_irq(void)
366{ 362{
367 int irq;
368 unsigned long ilat = 0;
369 /* Disable all the peripheral intrs - page 4-29 HW Ref manual */
370 bfin_write_SICA_IMASK0(SIC_UNMASK_ALL);
371 bfin_write_SICA_IMASK1(SIC_UNMASK_ALL);
372 SSYNC(); 363 SSYNC();
373 364
374 bfin_write_SICA_IWR0(IWR_ENABLE_ALL);
375 bfin_write_SICA_IWR1(IWR_ENABLE_ALL);
376
377 local_irq_disable();
378
379 init_exception_buff();
380
381#ifndef CONFIG_KGDB 365#ifndef CONFIG_KGDB
382 bfin_write_EVT0(evt_emulation); 366 bfin_write_EVT0(evt_emulation);
383#endif 367#endif
@@ -395,6 +379,27 @@ int __init init_arch_irq(void)
395 bfin_write_EVT14(evt14_softirq); 379 bfin_write_EVT14(evt14_softirq);
396 bfin_write_EVT15(evt_system_call); 380 bfin_write_EVT15(evt_system_call);
397 CSYNC(); 381 CSYNC();
382}
383
384/*
385 * This function should be called during kernel startup to initialize
386 * the BFin IRQ handling routines.
387 */
388int __init init_arch_irq(void)
389{
390 int irq;
391 unsigned long ilat = 0;
392 /* Disable all the peripheral intrs - page 4-29 HW Ref manual */
393 bfin_write_SICA_IMASK0(SIC_UNMASK_ALL);
394 bfin_write_SICA_IMASK1(SIC_UNMASK_ALL);
395 SSYNC();
396
397 bfin_write_SICA_IWR0(IWR_ENABLE_ALL);
398 bfin_write_SICA_IWR1(IWR_ENABLE_ALL);
399
400 local_irq_disable();
401
402 init_exception_buff();
398 403
399 for (irq = 0; irq <= SYS_IRQS; irq++) { 404 for (irq = 0; irq <= SYS_IRQS; irq++) {
400 if (irq <= IRQ_CORETMR) 405 if (irq <= IRQ_CORETMR)
diff --git a/arch/blackfin/mach-common/ints-priority-sc.c b/arch/blackfin/mach-common/ints-priority-sc.c
index 28a878c3577a..4708023fe716 100644
--- a/arch/blackfin/mach-common/ints-priority-sc.c
+++ b/arch/blackfin/mach-common/ints-priority-sc.c
@@ -579,8 +579,12 @@ static unsigned int bfin_gpio_irq_startup(unsigned int irq)
579 u16 gpionr = irq - IRQ_PA0; 579 u16 gpionr = irq - IRQ_PA0;
580 u8 pint_val = irq2pint_lut[irq - SYS_IRQS]; 580 u8 pint_val = irq2pint_lut[irq - SYS_IRQS];
581 581
582 if (pint_val == IRQ_NOT_AVAIL) 582 if (pint_val == IRQ_NOT_AVAIL) {
583 printk(KERN_ERR
584 "GPIO IRQ %d :Not in PINT Assign table "
585 "Reconfigure Interrupt to Port Assignemt\n", irq);
583 return -ENODEV; 586 return -ENODEV;
587 }
584 588
585 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) { 589 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) {
586 ret = gpio_request(gpionr, NULL); 590 ret = gpio_request(gpionr, NULL);
@@ -713,6 +717,29 @@ static void bfin_demux_gpio_irq(unsigned int intb_irq,
713} 717}
714#endif /* CONFIG_IRQCHIP_DEMUX_GPIO */ 718#endif /* CONFIG_IRQCHIP_DEMUX_GPIO */
715 719
720void __init init_exception_vectors(void)
721{
722 SSYNC();
723
724#ifndef CONFIG_KGDB
725 bfin_write_EVT0(evt_emulation);
726#endif
727 bfin_write_EVT2(evt_evt2);
728 bfin_write_EVT3(trap);
729 bfin_write_EVT5(evt_ivhw);
730 bfin_write_EVT6(evt_timer);
731 bfin_write_EVT7(evt_evt7);
732 bfin_write_EVT8(evt_evt8);
733 bfin_write_EVT9(evt_evt9);
734 bfin_write_EVT10(evt_evt10);
735 bfin_write_EVT11(evt_evt11);
736 bfin_write_EVT12(evt_evt12);
737 bfin_write_EVT13(evt_evt13);
738 bfin_write_EVT14(evt14_softirq);
739 bfin_write_EVT15(evt_system_call);
740 CSYNC();
741}
742
716/* 743/*
717 * This function should be called during kernel startup to initialize 744 * This function should be called during kernel startup to initialize
718 * the BFin IRQ handling routines. 745 * the BFin IRQ handling routines.
@@ -733,29 +760,10 @@ int __init init_arch_irq(void)
733 bfin_write_SIC_IMASK(SIC_UNMASK_ALL); 760 bfin_write_SIC_IMASK(SIC_UNMASK_ALL);
734 bfin_write_SIC_IWR(IWR_ENABLE_ALL); 761 bfin_write_SIC_IWR(IWR_ENABLE_ALL);
735#endif 762#endif
736
737 SSYNC(); 763 SSYNC();
738 764
739 local_irq_disable(); 765 local_irq_disable();
740 766
741#ifndef CONFIG_KGDB
742 bfin_write_EVT0(evt_emulation);
743#endif
744 bfin_write_EVT2(evt_evt2);
745 bfin_write_EVT3(trap);
746 bfin_write_EVT5(evt_ivhw);
747 bfin_write_EVT6(evt_timer);
748 bfin_write_EVT7(evt_evt7);
749 bfin_write_EVT8(evt_evt8);
750 bfin_write_EVT9(evt_evt9);
751 bfin_write_EVT10(evt_evt10);
752 bfin_write_EVT11(evt_evt11);
753 bfin_write_EVT12(evt_evt12);
754 bfin_write_EVT13(evt_evt13);
755 bfin_write_EVT14(evt14_softirq);
756 bfin_write_EVT15(evt_system_call);
757 CSYNC();
758
759#if defined(CONFIG_IRQCHIP_DEMUX_GPIO) && defined(CONFIG_BF54x) 767#if defined(CONFIG_IRQCHIP_DEMUX_GPIO) && defined(CONFIG_BF54x)
760#ifdef CONFIG_PINTx_REASSIGN 768#ifdef CONFIG_PINTx_REASSIGN
761 pint[0]->assign = CONFIG_PINT0_ASSIGN; 769 pint[0]->assign = CONFIG_PINT0_ASSIGN;