aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/devices.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2010-04-21 10:11:33 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-05-06 18:02:07 -0400
commit7a9978a1e2225507025a8b90b4289d506a416bd9 (patch)
tree163a66035df8ed7a510ad692eaf7259c885a932e /arch/arm/mach-davinci/devices.c
parent280faffb4e059b3f453e297af7060d9c277c0ca9 (diff)
DaVinci: move IDE platform device to its proper place
The IDE platform device is registered in three different places (2 board files for DM644x and in dm646x.c for DM646x) while both the IDE base address and the IDE IRQ are the same for both SoCs -- therefore, the proper place for the IDE platform seems to be in devices.c. Merge the IDE platform data and registration code and create davinci_init_ide() in place of dm646x_init_ide()... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/devices.c')
-rw-r--r--arch/arm/mach-davinci/devices.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index ef28080b1fda..d9c82ee434e0 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -26,6 +26,7 @@
26#include "clock.h" 26#include "clock.h"
27 27
28#define DAVINCI_I2C_BASE 0x01C21000 28#define DAVINCI_I2C_BASE 0x01C21000
29#define DAVINCI_ATA_BASE 0x01C66000
29#define DAVINCI_MMCSD0_BASE 0x01E10000 30#define DAVINCI_MMCSD0_BASE 0x01E10000
30#define DM355_MMCSD0_BASE 0x01E11000 31#define DM355_MMCSD0_BASE 0x01E11000
31#define DM355_MMCSD1_BASE 0x01E00000 32#define DM355_MMCSD1_BASE 0x01E00000
@@ -60,6 +61,49 @@ void __init davinci_init_i2c(struct davinci_i2c_platform_data *pdata)
60 (void) platform_device_register(&davinci_i2c_device); 61 (void) platform_device_register(&davinci_i2c_device);
61} 62}
62 63
64static struct resource ide_resources[] = {
65 {
66 .start = DAVINCI_ATA_BASE,
67 .end = DAVINCI_ATA_BASE + 0x7ff,
68 .flags = IORESOURCE_MEM,
69 },
70 {
71 .start = IRQ_IDE,
72 .end = IRQ_IDE,
73 .flags = IORESOURCE_IRQ,
74 },
75};
76
77static u64 ide_dma_mask = DMA_BIT_MASK(32);
78
79static struct platform_device ide_device = {
80 .name = "palm_bk3710",
81 .id = -1,
82 .resource = ide_resources,
83 .num_resources = ARRAY_SIZE(ide_resources),
84 .dev = {
85 .dma_mask = &ide_dma_mask,
86 .coherent_dma_mask = DMA_BIT_MASK(32),
87 },
88};
89
90void __init davinci_init_ide(void)
91{
92 if (cpu_is_davinci_dm644x()) {
93 davinci_cfg_reg(DM644X_HPIEN_DISABLE);
94 davinci_cfg_reg(DM644X_ATAEN);
95 davinci_cfg_reg(DM644X_HDIREN);
96 } else if (cpu_is_davinci_dm646x()) {
97 /* IRQ_DM646X_IDE is the same as IRQ_IDE */
98 davinci_cfg_reg(DM646X_ATAEN);
99 } else {
100 WARN_ON(1);
101 return;
102 }
103
104 platform_device_register(&ide_device);
105}
106
63#if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE) 107#if defined(CONFIG_MMC_DAVINCI) || defined(CONFIG_MMC_DAVINCI_MODULE)
64 108
65static u64 mmcsd0_dma_mask = DMA_BIT_MASK(32); 109static u64 mmcsd0_dma_mask = DMA_BIT_MASK(32);