diff options
Diffstat (limited to 'arch/avr32')
-rw-r--r-- | arch/avr32/boards/atstk1000/Kconfig | 4 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/Makefile | 1 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 78 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/at32ap700x.c | 52 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/hsmc.c | 2 |
5 files changed, 134 insertions, 3 deletions
diff --git a/arch/avr32/boards/atstk1000/Kconfig b/arch/avr32/boards/atstk1000/Kconfig index af90b00100fd..8dc48214f0b7 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 | ||
21 | config BOARD_ATSTK1006 | ||
22 | bool "ATSTK1006" | ||
23 | select CPU_AT32AP7000 | ||
24 | |||
21 | endchoice | 25 | endchoice |
22 | 26 | ||
23 | 27 | ||
diff --git a/arch/avr32/boards/atstk1000/Makefile b/arch/avr32/boards/atstk1000/Makefile index beead86462e8..edecee03742d 100644 --- a/arch/avr32/boards/atstk1000/Makefile +++ b/arch/avr32/boards/atstk1000/Makefile | |||
@@ -2,3 +2,4 @@ obj-y += setup.o flash.o | |||
2 | obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o | 2 | obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o |
3 | obj-$(CONFIG_BOARD_ATSTK1003) += atstk1003.o | 3 | obj-$(CONFIG_BOARD_ATSTK1003) += atstk1003.o |
4 | obj-$(CONFIG_BOARD_ATSTK1004) += atstk1004.o | 4 | obj-$(CONFIG_BOARD_ATSTK1004) += atstk1004.o |
5 | obj-$(CONFIG_BOARD_ATSTK1006) += atstk1002.o | ||
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 000eb4220a12..5bfaf4d87b3f 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 |
@@ -29,6 +29,74 @@ | |||
29 | #include "atstk1000.h" | 29 | #include "atstk1000.h" |
30 | 30 | ||
31 | 31 | ||
32 | /* | ||
33 | * The ATSTK1006 daughterboard is very similar to the ATSTK1002. Both | ||
34 | * have the AT32AP7000 chip on board; the difference is that the | ||
35 | * STK1006 has 128 MB SDRAM (the STK1002 uses the 8 MB SDRAM chip on | ||
36 | * the STK1000 motherboard) and 256 MB NAND flash (the STK1002 has | ||
37 | * none.) | ||
38 | * | ||
39 | * The RAM difference is handled by the boot loader, so the only | ||
40 | * difference we end up handling here is the NAND flash. | ||
41 | */ | ||
42 | #ifdef CONFIG_BOARD_ATSTK1006 | ||
43 | #include <linux/mtd/partitions.h> | ||
44 | #include <asm/arch/smc.h> | ||
45 | |||
46 | static struct smc_timing nand_timing __initdata = { | ||
47 | .ncs_read_setup = 0, | ||
48 | .nrd_setup = 10, | ||
49 | .ncs_write_setup = 0, | ||
50 | .nwe_setup = 10, | ||
51 | |||
52 | .ncs_read_pulse = 30, | ||
53 | .nrd_pulse = 15, | ||
54 | .ncs_write_pulse = 30, | ||
55 | .nwe_pulse = 15, | ||
56 | |||
57 | .read_cycle = 30, | ||
58 | .write_cycle = 30, | ||
59 | |||
60 | .ncs_read_recover = 0, | ||
61 | .nrd_recover = 15, | ||
62 | .ncs_write_recover = 0, | ||
63 | /* WE# high -> RE# low min 60 ns */ | ||
64 | .nwe_recover = 50, | ||
65 | }; | ||
66 | |||
67 | static struct smc_config nand_config __initdata = { | ||
68 | .bus_width = 1, | ||
69 | .nrd_controlled = 1, | ||
70 | .nwe_controlled = 1, | ||
71 | .nwait_mode = 0, | ||
72 | .byte_write = 0, | ||
73 | .tdf_cycles = 2, | ||
74 | .tdf_mode = 0, | ||
75 | }; | ||
76 | |||
77 | static struct mtd_partition nand_partitions[] = { | ||
78 | { | ||
79 | .name = "main", | ||
80 | .offset = 0x00000000, | ||
81 | .size = MTDPART_SIZ_FULL, | ||
82 | }, | ||
83 | }; | ||
84 | |||
85 | static struct mtd_partition *nand_part_info(int size, int *num_partitions) | ||
86 | { | ||
87 | *num_partitions = ARRAY_SIZE(nand_partitions); | ||
88 | return nand_partitions; | ||
89 | } | ||
90 | |||
91 | struct atmel_nand_data atstk1006_nand_data __initdata = { | ||
92 | .cle = 21, | ||
93 | .ale = 22, | ||
94 | .rdy_pin = GPIO_PIN_PB(30), | ||
95 | .enable_pin = GPIO_PIN_PB(29), | ||
96 | .partition_info = nand_part_info, | ||
97 | }; | ||
98 | #endif | ||
99 | |||
32 | struct eth_addr { | 100 | struct eth_addr { |
33 | u8 addr[6]; | 101 | u8 addr[6]; |
34 | }; | 102 | }; |
@@ -212,6 +280,12 @@ static int __init atstk1002_init(void) | |||
212 | 280 | ||
213 | at32_add_system_devices(); | 281 | at32_add_system_devices(); |
214 | 282 | ||
283 | #ifdef CONFIG_BOARD_ATSTK1006 | ||
284 | smc_set_timing(&nand_config, &nand_timing); | ||
285 | smc_set_configuration(3, &nand_config); | ||
286 | at32_add_device_nand(0, &atstk1006_nand_data); | ||
287 | #endif | ||
288 | |||
215 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM | 289 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM |
216 | at32_add_device_usart(1); | 290 | at32_add_device_usart(1); |
217 | #else | 291 | #else |
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index 0f24b4f85c17..b65d3e0667a8 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c | |||
@@ -1730,6 +1730,58 @@ fail: | |||
1730 | #endif | 1730 | #endif |
1731 | 1731 | ||
1732 | /* -------------------------------------------------------------------- | 1732 | /* -------------------------------------------------------------------- |
1733 | * NAND Flash / SmartMedia | ||
1734 | * -------------------------------------------------------------------- */ | ||
1735 | static struct resource smc_cs3_resource[] __initdata = { | ||
1736 | { | ||
1737 | .start = 0x0c000000, | ||
1738 | .end = 0x0fffffff, | ||
1739 | .flags = IORESOURCE_MEM, | ||
1740 | }, { | ||
1741 | .start = 0xfff03c00, | ||
1742 | .end = 0xfff03fff, | ||
1743 | .flags = IORESOURCE_MEM, | ||
1744 | }, | ||
1745 | }; | ||
1746 | |||
1747 | struct platform_device *__init | ||
1748 | at32_add_device_nand(unsigned int id, struct atmel_nand_data *data) | ||
1749 | { | ||
1750 | struct platform_device *pdev; | ||
1751 | |||
1752 | if (id != 0 || !data) | ||
1753 | return NULL; | ||
1754 | |||
1755 | pdev = platform_device_alloc("atmel_nand", id); | ||
1756 | if (!pdev) | ||
1757 | goto fail; | ||
1758 | |||
1759 | if (platform_device_add_resources(pdev, smc_cs3_resource, | ||
1760 | ARRAY_SIZE(smc_cs3_resource))) | ||
1761 | goto fail; | ||
1762 | |||
1763 | if (platform_device_add_data(pdev, data, | ||
1764 | sizeof(struct atmel_nand_data))) | ||
1765 | goto fail; | ||
1766 | |||
1767 | set_ebi_sfr_bits(HMATRIX_BIT(CS3A)); | ||
1768 | if (data->enable_pin) | ||
1769 | at32_select_gpio(data->enable_pin, | ||
1770 | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); | ||
1771 | if (data->rdy_pin) | ||
1772 | at32_select_gpio(data->rdy_pin, 0); | ||
1773 | if (data->det_pin) | ||
1774 | at32_select_gpio(data->det_pin, 0); | ||
1775 | |||
1776 | platform_device_add(pdev); | ||
1777 | return pdev; | ||
1778 | |||
1779 | fail: | ||
1780 | platform_device_put(pdev); | ||
1781 | return NULL; | ||
1782 | } | ||
1783 | |||
1784 | /* -------------------------------------------------------------------- | ||
1733 | * AC97C | 1785 | * AC97C |
1734 | * -------------------------------------------------------------------- */ | 1786 | * -------------------------------------------------------------------- */ |
1735 | static struct resource atmel_ac97c0_resource[] __initdata = { | 1787 | static struct resource atmel_ac97c0_resource[] __initdata = { |
diff --git a/arch/avr32/mach-at32ap/hsmc.c b/arch/avr32/mach-at32ap/hsmc.c index fa427ed42787..b2d9bc61a35c 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 | } |
281 | arch_initcall(hsmc_init); | 281 | core_initcall(hsmc_init); |