aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf537
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 16:23:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 16:23:17 -0400
commit7f268a2ba7c884a239713696238dd4207a57dd9a (patch)
treefdc02fecda32f5df8de3ddc2c01c29ba68e6a42b /arch/blackfin/mach-bf537
parent689796a141cea79d745a4689c65dd01c39e5e100 (diff)
parent2d2009806dd843f3adc0cbbb5d2204980f28111a (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: (30 commits) Blackfin arch: If we double fault, rather than hang forever, reset Blackfin arch: When icache is off, make sure people know it Blackfin arch: Fix bug - skip single step in high priority interrupt handler instead of disabling all interrupts in single step debugging. Blackfin arch: cache the values of vco/sclk/cclk as the overhead of doing so (~24 bytes) is worth avoiding the software mult/div routines Blackfin arch: fix bug - IMDMA is not type struct dma_register Blackfin arch: check the EXTBANKS field of the DDRCTL1 register to see if we are using both memory banks Blackfin arch: Apply Bluetechnix CM-BF527 board support patch Blackfin arch: Add unwinding for stack info, and a little more detail on trace buffer Blackfin arch: Add ISP1760 board resources to BF548-EZKIT Blackfin arch: fix bug - detect 0.1 silicon revision BF527-EZKIT as 0.0 version Blackfin arch: add missing IORESOURCE_MEM flags to UART3 Blackfin arch: Add return value check in bfin_sir_probe(), remove SSYNC(). Blackfin arch: Extend sram malloc to handle L2 SRAM. Blackfin arch: Remove useless config option. Blackfin arch: change L1 malloc to base on slab cache and lists. Blackfin arch: use local labels and ENDPROC() markings Blackfin arch: Do not need this dualcore test module in kernel. Blackfin arch: Allow ptrace to peek and poke application data in L1 data SRAM. Blackfin arch: Add ANOMALY_05000368 workaround Blackfin arch: Functional power management support ...
Diffstat (limited to 'arch/blackfin/mach-bf537')
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c88
-rw-r--r--arch/blackfin/mach-bf537/head.S12
2 files changed, 90 insertions, 10 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index 671f9d67f23a..6dbc76fb080b 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -29,9 +29,12 @@
29 */ 29 */
30 30
31#include <linux/device.h> 31#include <linux/device.h>
32#include <linux/kernel.h>
32#include <linux/platform_device.h> 33#include <linux/platform_device.h>
33#include <linux/mtd/mtd.h> 34#include <linux/mtd/mtd.h>
35#include <linux/mtd/nand.h>
34#include <linux/mtd/partitions.h> 36#include <linux/mtd/partitions.h>
37#include <linux/mtd/plat-ram.h>
35#include <linux/mtd/physmap.h> 38#include <linux/mtd/physmap.h>
36#include <linux/spi/spi.h> 39#include <linux/spi/spi.h>
37#include <linux/spi/flash.h> 40#include <linux/spi/flash.h>
@@ -355,6 +358,84 @@ static struct platform_device net2272_bfin_device = {
355}; 358};
356#endif 359#endif
357 360
361#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
362#ifdef CONFIG_MTD_PARTITIONS
363const char *part_probes[] = { "cmdlinepart", "RedBoot", NULL };
364
365static struct mtd_partition bfin_plat_nand_partitions[] = {
366 {
367 .name = "linux kernel",
368 .size = 0x400000,
369 .offset = 0,
370 }, {
371 .name = "file system",
372 .size = MTDPART_SIZ_FULL,
373 .offset = MTDPART_OFS_APPEND,
374 },
375};
376#endif
377
378#define BFIN_NAND_PLAT_CLE 2
379#define BFIN_NAND_PLAT_ALE 1
380static void bfin_plat_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
381{
382 struct nand_chip *this = mtd->priv;
383
384 if (cmd == NAND_CMD_NONE)
385 return;
386
387 if (ctrl & NAND_CLE)
388 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_CLE));
389 else
390 writeb(cmd, this->IO_ADDR_W + (1 << BFIN_NAND_PLAT_ALE));
391}
392
393#define BFIN_NAND_PLAT_READY GPIO_PF3
394static int bfin_plat_nand_dev_ready(struct mtd_info *mtd)
395{
396 return gpio_get_value(BFIN_NAND_PLAT_READY);
397}
398
399static struct platform_nand_data bfin_plat_nand_data = {
400 .chip = {
401 .chip_delay = 30,
402#ifdef CONFIG_MTD_PARTITIONS
403 .part_probe_types = part_probes,
404 .partitions = bfin_plat_nand_partitions,
405 .nr_partitions = ARRAY_SIZE(bfin_plat_nand_partitions),
406#endif
407 },
408 .ctrl = {
409 .cmd_ctrl = bfin_plat_nand_cmd_ctrl,
410 .dev_ready = bfin_plat_nand_dev_ready,
411 },
412};
413
414#define MAX(x, y) (x > y ? x : y)
415static struct resource bfin_plat_nand_resources = {
416 .start = 0x20212000,
417 .end = 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE, BFIN_NAND_PLAT_ALE)),
418 .flags = IORESOURCE_IO,
419};
420
421static struct platform_device bfin_async_nand_device = {
422 .name = "gen_nand",
423 .id = -1,
424 .num_resources = 1,
425 .resource = &bfin_plat_nand_resources,
426 .dev = {
427 .platform_data = &bfin_plat_nand_data,
428 },
429};
430
431static void bfin_plat_nand_init(void)
432{
433 gpio_request(BFIN_NAND_PLAT_READY, "bfin_nand_plat");
434}
435#else
436static void bfin_plat_nand_init(void) {}
437#endif
438
358#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 439#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
359static struct mtd_partition stamp_partitions[] = { 440static struct mtd_partition stamp_partitions[] = {
360 { 441 {
@@ -780,7 +861,7 @@ static struct platform_device bfin_sport1_uart_device = {
780#endif 861#endif
781 862
782#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 863#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
783#define PATA_INT 55 864#define PATA_INT IRQ_PF5
784 865
785static struct pata_platform_info bfin_pata_platform_data = { 866static struct pata_platform_info bfin_pata_platform_data = {
786 .ioport_shift = 1, 867 .ioport_shift = 1,
@@ -922,6 +1003,10 @@ static struct platform_device *stamp_devices[] __initdata = {
922 1003
923 &bfin_gpios_device, 1004 &bfin_gpios_device,
924 1005
1006#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
1007 &bfin_async_nand_device,
1008#endif
1009
925#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 1010#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
926 &stamp_flash_device, 1011 &stamp_flash_device,
927#endif 1012#endif
@@ -936,6 +1021,7 @@ static int __init stamp_init(void)
936 ARRAY_SIZE(bfin_i2c_board_info)); 1021 ARRAY_SIZE(bfin_i2c_board_info));
937#endif 1022#endif
938 1023
1024 bfin_plat_nand_init();
939 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices)); 1025 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
940 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 1026 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
941 1027
diff --git a/arch/blackfin/mach-bf537/head.S b/arch/blackfin/mach-bf537/head.S
index 48cd58a410a0..6b019eaee0b6 100644
--- a/arch/blackfin/mach-bf537/head.S
+++ b/arch/blackfin/mach-bf537/head.S
@@ -32,7 +32,7 @@
32#include <asm/blackfin.h> 32#include <asm/blackfin.h>
33#include <asm/trace.h> 33#include <asm/trace.h>
34 34
35#if CONFIG_BFIN_KERNEL_CLOCK 35#ifdef CONFIG_BFIN_KERNEL_CLOCK
36#include <asm/mach-common/clocks.h> 36#include <asm/mach-common/clocks.h>
37#include <asm/mach/mem_init.h> 37#include <asm/mach/mem_init.h>
38#endif 38#endif
@@ -217,7 +217,7 @@ ENTRY(__start)
217 217
218 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 218 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
219 call _bf53x_relocate_l1_mem; 219 call _bf53x_relocate_l1_mem;
220#if CONFIG_BFIN_KERNEL_CLOCK 220#ifdef CONFIG_BFIN_KERNEL_CLOCK
221 call _start_dma_code; 221 call _start_dma_code;
222#endif 222#endif
223 223
@@ -350,7 +350,7 @@ ENDPROC(_real_start)
350__FINIT 350__FINIT
351 351
352.section .l1.text 352.section .l1.text
353#if CONFIG_BFIN_KERNEL_CLOCK 353#ifdef CONFIG_BFIN_KERNEL_CLOCK
354ENTRY(_start_dma_code) 354ENTRY(_start_dma_code)
355 355
356 /* Enable PHY CLK buffer output */ 356 /* Enable PHY CLK buffer output */
@@ -430,12 +430,6 @@ ENTRY(_start_dma_code)
430 w[p0] = r0.l; 430 w[p0] = r0.l;
431 ssync; 431 ssync;
432 432
433 p0.l = LO(EBIU_SDBCTL);
434 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
435 r0 = mem_SDBCTL;
436 w[p0] = r0.l;
437 ssync;
438
439 P2.H = hi(EBIU_SDGCTL); 433 P2.H = hi(EBIU_SDGCTL);
440 P2.L = lo(EBIU_SDGCTL); 434 P2.L = lo(EBIU_SDGCTL);
441 R0 = [P2]; 435 R0 = [P2];