aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 23:30:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 23:30:56 -0400
commit9ee08c2df47c10ba624ff05a6c0f2500748bcb69 (patch)
tree0a2788abb3b5547b83965e0b3132eec8b196bd81 /arch/avr32
parenteaf0ba5ef69538b6913525294a3a0fcb0e0992e0 (diff)
parent3d45955962496879dead8d4dd70bb9a23b07154b (diff)
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (57 commits) [MTD] [NAND] subpage read feature as a way to increase performance. CPUFREQ: S3C24XX NAND driver frequency scaling support. [MTD][NAND] au1550nd: remove unused variable [MTD] jedec_probe: Fix SST 16-bit chip detection [MTD][MTDPART] Fix a division by zero bug [MTD][MTDPART] Cleanup and document the erase region handling [MTD][MTDPART] Handle most checkpatch findings [MTD][MTDPART] Seperate main loop from per-partition code in add_mtd_partition [MTD] physmap: resume already suspended chips on failure to suspend [MTD] physmap: Fix suspend/resume/shutdown bugs. [MTD] [NOR] Fix -ETIMEO errors in CFI driver [MTD] [NAND] fsl_elbc_nand: fix section mismatch with CONFIG_MTD_OF_PARTS=y [JFFS2] Use .unlocked_ioctl [MTD] Fix const assignment in the MTD command line partitioning driver [MTD] [NOR] gen_probe: No debug message when debugging is disabled [MTD] [NAND] remove __PPC__ hardcoded address from DiskOnChip drivers [MTD] [MAPS] Remove the bast-flash driver. [MTD] [NAND] fsl_elbc_nand: ecclayout cleanups [MTD] [NAND] fsl_elbc_nand: implement support for flash-based BBT [MTD] [NAND] fsl_elbc_nand: fix OOB workability for large page NAND chips ...
Diffstat (limited to 'arch/avr32')
-rw-r--r--arch/avr32/boards/atstk1000/Kconfig4
-rw-r--r--arch/avr32/boards/atstk1000/Makefile1
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c78
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c52
-rw-r--r--arch/avr32/mach-at32ap/hsmc.c2
5 files changed, 134 insertions, 3 deletions
diff --git a/arch/avr32/boards/atstk1000/Kconfig b/arch/avr32/boards/atstk1000/Kconfig
index af90b00100f..8dc48214f0b 100644
--- a/arch/avr32/boards/atstk1000/Kconfig
+++ b/arch/avr32/boards/atstk1000/Kconfig
@@ -18,6 +18,10 @@ config BOARD_ATSTK1004
18 bool "ATSTK1004" 18 bool "ATSTK1004"
19 select CPU_AT32AP7002 19 select CPU_AT32AP7002
20 20
21config BOARD_ATSTK1006
22 bool "ATSTK1006"
23 select CPU_AT32AP7000
24
21endchoice 25endchoice
22 26
23 27
diff --git a/arch/avr32/boards/atstk1000/Makefile b/arch/avr32/boards/atstk1000/Makefile
index beead86462e..edecee03742 100644
--- a/arch/avr32/boards/atstk1000/Makefile
+++ b/arch/avr32/boards/atstk1000/Makefile
@@ -2,3 +2,4 @@ obj-y += setup.o flash.o
2obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o 2obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o
3obj-$(CONFIG_BOARD_ATSTK1003) += atstk1003.o 3obj-$(CONFIG_BOARD_ATSTK1003) += atstk1003.o
4obj-$(CONFIG_BOARD_ATSTK1004) += atstk1004.o 4obj-$(CONFIG_BOARD_ATSTK1004) += atstk1004.o
5obj-$(CONFIG_BOARD_ATSTK1006) += atstk1002.o
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c
index e11659b732f..14dc5a14369 100644
--- a/arch/avr32/boards/atstk1000/atstk1002.c
+++ b/arch/avr32/boards/atstk1000/atstk1002.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * ATSTK1002 daughterboard-specific init code 2 * ATSTK1002/ATSTK1006 daughterboard-specific init code
3 * 3 *
4 * Copyright (C) 2005-2006 Atmel Corporation 4 * Copyright (C) 2005-2007 Atmel Corporation
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
@@ -35,6 +35,74 @@ unsigned long at32_board_osc_rates[3] = {
35 [2] = 12000000, /* 12 MHz on osc1 */ 35 [2] = 12000000, /* 12 MHz on osc1 */
36}; 36};
37 37
38/*
39 * The ATSTK1006 daughterboard is very similar to the ATSTK1002. Both
40 * have the AT32AP7000 chip on board; the difference is that the
41 * STK1006 has 128 MB SDRAM (the STK1002 uses the 8 MB SDRAM chip on
42 * the STK1000 motherboard) and 256 MB NAND flash (the STK1002 has
43 * none.)
44 *
45 * The RAM difference is handled by the boot loader, so the only
46 * difference we end up handling here is the NAND flash.
47 */
48#ifdef CONFIG_BOARD_ATSTK1006
49#include <linux/mtd/partitions.h>
50#include <asm/arch/smc.h>
51
52static struct smc_timing nand_timing __initdata = {
53 .ncs_read_setup = 0,
54 .nrd_setup = 10,
55 .ncs_write_setup = 0,
56 .nwe_setup = 10,
57
58 .ncs_read_pulse = 30,
59 .nrd_pulse = 15,
60 .ncs_write_pulse = 30,
61 .nwe_pulse = 15,
62
63 .read_cycle = 30,
64 .write_cycle = 30,
65
66 .ncs_read_recover = 0,
67 .nrd_recover = 15,
68 .ncs_write_recover = 0,
69 /* WE# high -> RE# low min 60 ns */
70 .nwe_recover = 50,
71};
72
73static struct smc_config nand_config __initdata = {
74 .bus_width = 1,
75 .nrd_controlled = 1,
76 .nwe_controlled = 1,
77 .nwait_mode = 0,
78 .byte_write = 0,
79 .tdf_cycles = 2,
80 .tdf_mode = 0,
81};
82
83static struct mtd_partition nand_partitions[] = {
84 {
85 .name = "main",
86 .offset = 0x00000000,
87 .size = MTDPART_SIZ_FULL,
88 },
89};
90
91static struct mtd_partition *nand_part_info(int size, int *num_partitions)
92{
93 *num_partitions = ARRAY_SIZE(nand_partitions);
94 return nand_partitions;
95}
96
97struct atmel_nand_data atstk1006_nand_data __initdata = {
98 .cle = 21,
99 .ale = 22,
100 .rdy_pin = GPIO_PIN_PB(30),
101 .enable_pin = GPIO_PIN_PB(29),
102 .partition_info = nand_part_info,
103};
104#endif
105
38struct eth_addr { 106struct eth_addr {
39 u8 addr[6]; 107 u8 addr[6];
40}; 108};
@@ -218,6 +286,12 @@ static int __init atstk1002_init(void)
218 286
219 at32_add_system_devices(); 287 at32_add_system_devices();
220 288
289#ifdef CONFIG_BOARD_ATSTK1006
290 smc_set_timing(&nand_config, &nand_timing);
291 smc_set_configuration(3, &nand_config);
292 at32_add_device_nand(0, &atstk1006_nand_data);
293#endif
294
221#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM 295#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
222 at32_add_device_usart(1); 296 at32_add_device_usart(1);
223#else 297#else
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 604f44f5dd1..351e1b42f93 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -1871,6 +1871,58 @@ fail:
1871#endif 1871#endif
1872 1872
1873/* -------------------------------------------------------------------- 1873/* --------------------------------------------------------------------
1874 * NAND Flash / SmartMedia
1875 * -------------------------------------------------------------------- */
1876static struct resource smc_cs3_resource[] __initdata = {
1877 {
1878 .start = 0x0c000000,
1879 .end = 0x0fffffff,
1880 .flags = IORESOURCE_MEM,
1881 }, {
1882 .start = 0xfff03c00,
1883 .end = 0xfff03fff,
1884 .flags = IORESOURCE_MEM,
1885 },
1886};
1887
1888struct platform_device *__init
1889at32_add_device_nand(unsigned int id, struct atmel_nand_data *data)
1890{
1891 struct platform_device *pdev;
1892
1893 if (id != 0 || !data)
1894 return NULL;
1895
1896 pdev = platform_device_alloc("atmel_nand", id);
1897 if (!pdev)
1898 goto fail;
1899
1900 if (platform_device_add_resources(pdev, smc_cs3_resource,
1901 ARRAY_SIZE(smc_cs3_resource)))
1902 goto fail;
1903
1904 if (platform_device_add_data(pdev, data,
1905 sizeof(struct atmel_nand_data)))
1906 goto fail;
1907
1908 set_ebi_sfr_bits(HMATRIX_BIT(CS3A));
1909 if (data->enable_pin)
1910 at32_select_gpio(data->enable_pin,
1911 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
1912 if (data->rdy_pin)
1913 at32_select_gpio(data->rdy_pin, 0);
1914 if (data->det_pin)
1915 at32_select_gpio(data->det_pin, 0);
1916
1917 platform_device_add(pdev);
1918 return pdev;
1919
1920fail:
1921 platform_device_put(pdev);
1922 return NULL;
1923}
1924
1925/* --------------------------------------------------------------------
1874 * AC97C 1926 * AC97C
1875 * -------------------------------------------------------------------- */ 1927 * -------------------------------------------------------------------- */
1876static struct resource atmel_ac97c0_resource[] __initdata = { 1928static struct resource atmel_ac97c0_resource[] __initdata = {
diff --git a/arch/avr32/mach-at32ap/hsmc.c b/arch/avr32/mach-at32ap/hsmc.c
index fa427ed4278..b2d9bc61a35 100644
--- a/arch/avr32/mach-at32ap/hsmc.c
+++ b/arch/avr32/mach-at32ap/hsmc.c
@@ -278,4 +278,4 @@ static int __init hsmc_init(void)
278{ 278{
279 return platform_driver_register(&hsmc_driver); 279 return platform_driver_register(&hsmc_driver);
280} 280}
281arch_initcall(hsmc_init); 281core_initcall(hsmc_init);