aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf537/boards
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/boards
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/boards')
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c88
1 files changed, 87 insertions, 1 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