aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap/at32ap700x.c
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-07-27 07:54:08 -0400
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-07-27 07:54:08 -0400
commiteda3d8f5604860aae1bb9996bb5efc4213778369 (patch)
tree9d3887d2665bcc5f5abf200758794545c7b2c69b /arch/avr32/mach-at32ap/at32ap700x.c
parent87a9f704658a40940e740b1d73d861667e9164d3 (diff)
parent8be1a6d6c77ab4532e4476fdb8177030ef48b52c (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'arch/avr32/mach-at32ap/at32ap700x.c')
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c79
1 files changed, 66 insertions, 13 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 30c7cdab28d0..5f30b353a27f 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -7,6 +7,7 @@
7 */ 7 */
8#include <linux/clk.h> 8#include <linux/clk.h>
9#include <linux/delay.h> 9#include <linux/delay.h>
10#include <linux/dw_dmac.h>
10#include <linux/fb.h> 11#include <linux/fb.h>
11#include <linux/init.h> 12#include <linux/init.h>
12#include <linux/platform_device.h> 13#include <linux/platform_device.h>
@@ -594,6 +595,17 @@ static void __init genclk_init_parent(struct clk *clk)
594 clk->parent = parent; 595 clk->parent = parent;
595} 596}
596 597
598static struct dw_dma_platform_data dw_dmac0_data = {
599 .nr_channels = 3,
600};
601
602static struct resource dw_dmac0_resource[] = {
603 PBMEM(0xff200000),
604 IRQ(2),
605};
606DEFINE_DEV_DATA(dw_dmac, 0);
607DEV_CLK(hclk, dw_dmac0, hsb, 10);
608
597/* -------------------------------------------------------------------- 609/* --------------------------------------------------------------------
598 * System peripherals 610 * System peripherals
599 * -------------------------------------------------------------------- */ 611 * -------------------------------------------------------------------- */
@@ -708,17 +720,6 @@ static struct clk pico_clk = {
708 .users = 1, 720 .users = 1,
709}; 721};
710 722
711static struct resource dmaca0_resource[] = {
712 {
713 .start = 0xff200000,
714 .end = 0xff20ffff,
715 .flags = IORESOURCE_MEM,
716 },
717 IRQ(2),
718};
719DEFINE_DEV(dmaca, 0);
720DEV_CLK(hclk, dmaca0, hsb, 10);
721
722/* -------------------------------------------------------------------- 723/* --------------------------------------------------------------------
723 * HMATRIX 724 * HMATRIX
724 * -------------------------------------------------------------------- */ 725 * -------------------------------------------------------------------- */
@@ -831,7 +832,7 @@ void __init at32_add_system_devices(void)
831 platform_device_register(&at32_eic0_device); 832 platform_device_register(&at32_eic0_device);
832 platform_device_register(&smc0_device); 833 platform_device_register(&smc0_device);
833 platform_device_register(&pdc_device); 834 platform_device_register(&pdc_device);
834 platform_device_register(&dmaca0_device); 835 platform_device_register(&dw_dmac0_device);
835 836
836 platform_device_register(&at32_tcb0_device); 837 platform_device_register(&at32_tcb0_device);
837 platform_device_register(&at32_tcb1_device); 838 platform_device_register(&at32_tcb1_device);
@@ -1869,6 +1870,58 @@ fail:
1869#endif 1870#endif
1870 1871
1871/* -------------------------------------------------------------------- 1872/* --------------------------------------------------------------------
1873 * NAND Flash / SmartMedia
1874 * -------------------------------------------------------------------- */
1875static struct resource smc_cs3_resource[] __initdata = {
1876 {
1877 .start = 0x0c000000,
1878 .end = 0x0fffffff,
1879 .flags = IORESOURCE_MEM,
1880 }, {
1881 .start = 0xfff03c00,
1882 .end = 0xfff03fff,
1883 .flags = IORESOURCE_MEM,
1884 },
1885};
1886
1887struct platform_device *__init
1888at32_add_device_nand(unsigned int id, struct atmel_nand_data *data)
1889{
1890 struct platform_device *pdev;
1891
1892 if (id != 0 || !data)
1893 return NULL;
1894
1895 pdev = platform_device_alloc("atmel_nand", id);
1896 if (!pdev)
1897 goto fail;
1898
1899 if (platform_device_add_resources(pdev, smc_cs3_resource,
1900 ARRAY_SIZE(smc_cs3_resource)))
1901 goto fail;
1902
1903 if (platform_device_add_data(pdev, data,
1904 sizeof(struct atmel_nand_data)))
1905 goto fail;
1906
1907 set_ebi_sfr_bits(HMATRIX_BIT(CS3A));
1908 if (data->enable_pin)
1909 at32_select_gpio(data->enable_pin,
1910 AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
1911 if (data->rdy_pin)
1912 at32_select_gpio(data->rdy_pin, 0);
1913 if (data->det_pin)
1914 at32_select_gpio(data->det_pin, 0);
1915
1916 platform_device_add(pdev);
1917 return pdev;
1918
1919fail:
1920 platform_device_put(pdev);
1921 return NULL;
1922}
1923
1924/* --------------------------------------------------------------------
1872 * AC97C 1925 * AC97C
1873 * -------------------------------------------------------------------- */ 1926 * -------------------------------------------------------------------- */
1874static struct resource atmel_ac97c0_resource[] __initdata = { 1927static struct resource atmel_ac97c0_resource[] __initdata = {
@@ -2051,7 +2104,7 @@ struct clk *at32_clock_list[] = {
2051 &smc0_mck, 2104 &smc0_mck,
2052 &pdc_hclk, 2105 &pdc_hclk,
2053 &pdc_pclk, 2106 &pdc_pclk,
2054 &dmaca0_hclk, 2107 &dw_dmac0_hclk,
2055 &pico_clk, 2108 &pico_clk,
2056 &pio0_mck, 2109 &pio0_mck,
2057 &pio1_mck, 2110 &pio1_mck,