diff options
Diffstat (limited to 'arch/blackfin/mach-bf561')
-rw-r--r-- | arch/blackfin/mach-bf561/boards/Makefile | 3 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/boards/ezkit.c | 64 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/boards/tepla.c | 61 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/head.S | 79 |
4 files changed, 140 insertions, 67 deletions
diff --git a/arch/blackfin/mach-bf561/boards/Makefile b/arch/blackfin/mach-bf561/boards/Makefile index 886edc739ab4..495a1cf9d452 100644 --- a/arch/blackfin/mach-bf561/boards/Makefile +++ b/arch/blackfin/mach-bf561/boards/Makefile | |||
@@ -3,5 +3,6 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_GENERIC_BOARD) += generic_board.o | 5 | obj-$(CONFIG_GENERIC_BOARD) += generic_board.o |
6 | obj-$(CONFIG_BFIN561_EZKIT) += ezkit.o | ||
7 | obj-$(CONFIG_BFIN561_BLUETECHNIX_CM) += cm_bf561.o | 6 | obj-$(CONFIG_BFIN561_BLUETECHNIX_CM) += cm_bf561.o |
7 | obj-$(CONFIG_BFIN561_EZKIT) += ezkit.o | ||
8 | obj-$(CONFIG_BFIN561_TEPLA) += tepla.o | ||
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c index 14eb4f9a68ea..9720b5c307ab 100644 --- a/arch/blackfin/mach-bf561/boards/ezkit.c +++ b/arch/blackfin/mach-bf561/boards/ezkit.c | |||
@@ -32,12 +32,61 @@ | |||
32 | #include <linux/spi/spi.h> | 32 | #include <linux/spi/spi.h> |
33 | #include <asm/irq.h> | 33 | #include <asm/irq.h> |
34 | #include <asm/bfin5xx_spi.h> | 34 | #include <asm/bfin5xx_spi.h> |
35 | #include <linux/interrupt.h> | ||
36 | #include <linux/irq.h> | ||
35 | 37 | ||
36 | /* | 38 | /* |
37 | * Name the Board for the /proc/cpuinfo | 39 | * Name the Board for the /proc/cpuinfo |
38 | */ | 40 | */ |
39 | char *bfin_board_name = "ADDS-BF561-EZKIT"; | 41 | char *bfin_board_name = "ADDS-BF561-EZKIT"; |
40 | 42 | ||
43 | #define ISP1761_BASE 0x2C0F0000 | ||
44 | #define ISP1761_IRQ IRQ_PF10 | ||
45 | |||
46 | #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) | ||
47 | static struct resource bfin_isp1761_resources[] = { | ||
48 | [0] = { | ||
49 | .name = "isp1761-regs", | ||
50 | .start = ISP1761_BASE + 0x00000000, | ||
51 | .end = ISP1761_BASE + 0x000fffff, | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | }, | ||
54 | [1] = { | ||
55 | .start = ISP1761_IRQ, | ||
56 | .end = ISP1761_IRQ, | ||
57 | .flags = IORESOURCE_IRQ, | ||
58 | }, | ||
59 | }; | ||
60 | |||
61 | static struct platform_device bfin_isp1761_device = { | ||
62 | .name = "isp1761", | ||
63 | .id = 0, | ||
64 | .num_resources = ARRAY_SIZE(bfin_isp1761_resources), | ||
65 | .resource = bfin_isp1761_resources, | ||
66 | }; | ||
67 | |||
68 | static struct platform_device *bfin_isp1761_devices[] = { | ||
69 | &bfin_isp1761_device, | ||
70 | }; | ||
71 | |||
72 | int __init bfin_isp1761_init(void) | ||
73 | { | ||
74 | unsigned int num_devices=ARRAY_SIZE(bfin_isp1761_devices); | ||
75 | |||
76 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | ||
77 | set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING); | ||
78 | |||
79 | return platform_add_devices(bfin_isp1761_devices, num_devices); | ||
80 | } | ||
81 | |||
82 | void __exit bfin_isp1761_exit(void) | ||
83 | { | ||
84 | platform_device_unregister(&bfin_isp1761_device); | ||
85 | } | ||
86 | |||
87 | arch_initcall(bfin_isp1761_init); | ||
88 | #endif | ||
89 | |||
41 | /* | 90 | /* |
42 | * USB-LAN EzExtender board | 91 | * USB-LAN EzExtender board |
43 | * Driver needs to know address, irq and flag pin. | 92 | * Driver needs to know address, irq and flag pin. |
@@ -135,13 +184,18 @@ static int __init ezkit_init(void) | |||
135 | { | 184 | { |
136 | int ret; | 185 | int ret; |
137 | 186 | ||
138 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | 187 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
139 | ret = platform_add_devices(ezkit_devices, | 188 | |
140 | ARRAY_SIZE(ezkit_devices)); | 189 | ret = platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); |
141 | if (ret < 0) | 190 | if (ret < 0) |
142 | return ret; | 191 | return ret; |
143 | return spi_register_board_info(bfin_spi_board_info, | 192 | |
144 | ARRAY_SIZE(bfin_spi_board_info)); | 193 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
194 | bfin_write_FIO0_DIR(bfin_read_FIO0_DIR() | (1 << 12)); | ||
195 | SSYNC(); | ||
196 | #endif | ||
197 | |||
198 | return spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | ||
145 | } | 199 | } |
146 | 200 | ||
147 | arch_initcall(ezkit_init); | 201 | arch_initcall(ezkit_init); |
diff --git a/arch/blackfin/mach-bf561/boards/tepla.c b/arch/blackfin/mach-bf561/boards/tepla.c new file mode 100644 index 000000000000..db308c7ccabb --- /dev/null +++ b/arch/blackfin/mach-bf561/boards/tepla.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * File: arch/blackfin/mach-bf561/tepla.c | ||
3 | * | ||
4 | * Copyright 2004-2007 Analog Devices Inc. | ||
5 | * Only SMSC91C1111 was registered, may do more later. | ||
6 | * | ||
7 | * Copyright 2005 National ICT Australia (NICTA), Aidan Williams <aidan@nicta.com.au> | ||
8 | * Thanks to Jamey Hicks. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <linux/device.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <asm/irq.h> | ||
18 | |||
19 | char *bfin_board_name = "Tepla-BF561"; | ||
20 | |||
21 | /* | ||
22 | * Driver needs to know address, irq and flag pin. | ||
23 | */ | ||
24 | static struct resource smc91x_resources[] = { | ||
25 | { | ||
26 | .start = 0x2C000300, | ||
27 | .end = 0x2C000320, | ||
28 | .flags = IORESOURCE_MEM, | ||
29 | },{ | ||
30 | .start = IRQ_PROG_INTB, | ||
31 | .end = IRQ_PROG_INTB, | ||
32 | .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL, | ||
33 | },{ | ||
34 | /* | ||
35 | * denotes the flag pin and is used directly if | ||
36 | * CONFIG_IRQCHIP_DEMUX_GPIO is defined. | ||
37 | */ | ||
38 | .start = IRQ_PF7, | ||
39 | .end = IRQ_PF7, | ||
40 | .flags = IORESOURCE_IRQ|IORESOURCE_IRQ_HIGHLEVEL, | ||
41 | }, | ||
42 | }; | ||
43 | |||
44 | static struct platform_device smc91x_device = { | ||
45 | .name = "smc91x", | ||
46 | .id = 0, | ||
47 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
48 | .resource = smc91x_resources, | ||
49 | }; | ||
50 | |||
51 | static struct platform_device *tepla_devices[] __initdata = { | ||
52 | &smc91x_device, | ||
53 | }; | ||
54 | |||
55 | static int __init tepla_init(void) | ||
56 | { | ||
57 | printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__); | ||
58 | return platform_add_devices(tepla_devices, ARRAY_SIZE(tepla_devices)); | ||
59 | } | ||
60 | |||
61 | arch_initcall(tepla_init); | ||
diff --git a/arch/blackfin/mach-bf561/head.S b/arch/blackfin/mach-bf561/head.S index 7bca478526b9..ad9187a866a5 100644 --- a/arch/blackfin/mach-bf561/head.S +++ b/arch/blackfin/mach-bf561/head.S | |||
@@ -127,7 +127,8 @@ ENTRY(__stext) | |||
127 | STI R2; | 127 | STI R2; |
128 | #endif | 128 | #endif |
129 | 129 | ||
130 | /* Initialise UART*/ | 130 | /* Initialise UART - when booting from u-boot, the UART is not disabled |
131 | * so if we dont initalize here, our serial console gets hosed */ | ||
131 | p0.h = hi(UART_LCR); | 132 | p0.h = hi(UART_LCR); |
132 | p0.l = lo(UART_LCR); | 133 | p0.l = lo(UART_LCR); |
133 | r0 = 0x0(Z); | 134 | r0 = 0x0(Z); |
@@ -414,12 +415,6 @@ ENTRY(_bfin_reset) | |||
414 | w[p0] = r0.l; | 415 | w[p0] = r0.l; |
415 | #endif | 416 | #endif |
416 | 417 | ||
417 | /* Clear the bits 13-15 in SWRST if they werent cleared */ | ||
418 | p0.h = hi(SICA_SWRST); | ||
419 | p0.l = lo(SICA_SWRST); | ||
420 | csync; | ||
421 | r0.l = w[p0]; | ||
422 | |||
423 | /* Clear the IMASK register */ | 418 | /* Clear the IMASK register */ |
424 | p0.h = hi(IMASK); | 419 | p0.h = hi(IMASK); |
425 | p0.l = lo(IMASK); | 420 | p0.l = lo(IMASK); |
@@ -433,68 +428,30 @@ ENTRY(_bfin_reset) | |||
433 | [p0] = r0; | 428 | [p0] = r0; |
434 | SSYNC; | 429 | SSYNC; |
435 | 430 | ||
436 | /* Disable the WDOG TIMER */ | 431 | /* make sure SYSCR is set to use BMODE */ |
437 | p0.h = hi(WDOGA_CTL); | 432 | P0.h = hi(SICA_SYSCR); |
438 | p0.l = lo(WDOGA_CTL); | 433 | P0.l = lo(SICA_SYSCR); |
439 | r0.l = 0xAD6; | 434 | R0.l = 0x20; |
440 | w[p0] = r0.l; | 435 | W[P0] = R0.l; |
441 | SSYNC; | ||
442 | |||
443 | /* Clear the sticky bit incase it is already set */ | ||
444 | p0.h = hi(WDOGA_CTL); | ||
445 | p0.l = lo(WDOGA_CTL); | ||
446 | r0.l = 0x8AD6; | ||
447 | w[p0] = r0.l; | ||
448 | SSYNC; | 436 | SSYNC; |
449 | 437 | ||
450 | /* Program the count value */ | 438 | /* issue a system soft reset */ |
451 | R0.l = 0x100; | 439 | P1.h = hi(SICA_SWRST); |
452 | R0.h = 0x0; | 440 | P1.l = lo(SICA_SWRST); |
453 | P0.h = hi(WDOGA_CNT); | 441 | R1.l = 0x0007; |
454 | P0.l = lo(WDOGA_CNT); | 442 | W[P1] = R1; |
455 | [P0] = R0; | ||
456 | SSYNC; | 443 | SSYNC; |
457 | 444 | ||
458 | /* Program WDOG_STAT if necessary */ | 445 | /* clear system soft reset */ |
459 | P0.h = hi(WDOGA_CTL); | 446 | R0.l = 0x0000; |
460 | P0.l = lo(WDOGA_CTL); | 447 | W[P0] = R0; |
461 | R0 = W[P0](Z); | ||
462 | CC = BITTST(R0,1); | ||
463 | if !CC JUMP .LWRITESTAT; | ||
464 | CC = BITTST(R0,2); | ||
465 | if !CC JUMP .LWRITESTAT; | ||
466 | JUMP .LSKIP_WRITE; | ||
467 | |||
468 | .LWRITESTAT: | ||
469 | /* When watch dog timer is enabled, | ||
470 | * a write to STAT will load the contents of CNT to STAT | ||
471 | */ | ||
472 | R0 = 0x0000(z); | ||
473 | P0.h = hi(WDOGA_STAT); | ||
474 | P0.l = lo(WDOGA_STAT) | ||
475 | [P0] = R0; | ||
476 | SSYNC; | ||
477 | |||
478 | .LSKIP_WRITE: | ||
479 | /* Enable the reset event */ | ||
480 | P0.h = hi(WDOGA_CTL); | ||
481 | P0.l = lo(WDOGA_CTL); | ||
482 | R0 = W[P0](Z); | ||
483 | BITCLR(R0,1); | ||
484 | BITCLR(R0,2); | ||
485 | W[P0] = R0.L; | ||
486 | SSYNC; | ||
487 | NOP; | ||
488 | |||
489 | /* Enable the wdog counter */ | ||
490 | R0 = W[P0](Z); | ||
491 | BITCLR(R0,4); | ||
492 | W[P0] = R0.L; | ||
493 | SSYNC; | 448 | SSYNC; |
494 | 449 | ||
495 | IDLE; | 450 | /* issue core reset */ |
451 | raise 1; | ||
496 | 452 | ||
497 | RTS; | 453 | RTS; |
454 | ENDPROC(_bfin_reset) | ||
498 | 455 | ||
499 | .data | 456 | .data |
500 | 457 | ||