Comments
Patch
@@ -728,6 +728,91 @@ void __init ep93xx_register_fb(struct ep93xxfb_mach_info *data)
platform_device_register(&ep93xx_fb_device);
}
+
+/*************************************************************************
+ * EP93xx ide peripheral handling
+ *************************************************************************/
+static struct resource ep93xx_ide_resources[] = {
+ {
+ .start = EP93XX_IDE_PHYS_BASE,
+ .end = EP93XX_IDE_PHYS_BASE + 0x38 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .start = IRQ_EP93XX_EXT3,
+ .end = IRQ_EP93XX_EXT3,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device ep93xx_ide_device = {
+ .name = "ep93xx-ide",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(ep93xx_ide_resources),
+ .resource = ep93xx_ide_resources,
+};
+
+void __init ep93xx_register_ide(void)
+{
+ platform_device_register(&ep93xx_ide_device);
+}
+
+int ep93xx_ide_aquire_gpio(struct platform_device *pdev)
+{
+ int i, err;
+
+ for (i = 0; i < 8; i++) {
+ err = gpio_request(EP93XX_GPIO_LINE_E(i),
+ dev_name(&pdev->dev));
+ if (err)
+ goto fail_gpio_e;
+ err = gpio_request(EP93XX_GPIO_LINE_F(i),
+ dev_name(&pdev->dev));
+ if (err)
+ goto fail_gpio_f;
+ err = gpio_request(EP93XX_GPIO_LINE_G(i),
+ dev_name(&pdev->dev));
+ if (err)
+ goto fail_gpio_g;
+ }
+
+ ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_EONIDE |
+ EP93XX_SYSCON_DEVCFG_GONIDE |
+ EP93XX_SYSCON_DEVCFG_HONIDE);
+
+ return 0;
+
+fail_gpio_g:
+ gpio_free(EP93XX_GPIO_LINE_F(i));
+fail_gpio_f:
+ gpio_free(EP93XX_GPIO_LINE_E(i));
+fail_gpio_e:
+ for ( ; i >= 0; --i) {
+ gpio_free(EP93XX_GPIO_LINE_E(i));
+ gpio_free(EP93XX_GPIO_LINE_F(i));
+ gpio_free(EP93XX_GPIO_LINE_G(i));
+ }
+ return err;
+}
+EXPORT_SYMBOL(ep93xx_ide_aquire_gpio);
+
+void ep93xx_ide_release_gpio(struct platform_device *pdev)
+{
+ int i;
+
+ for (i = 0; i < 8; i++) {
+ gpio_free(EP93XX_GPIO_LINE_E(i));
+ gpio_free(EP93XX_GPIO_LINE_F(i));
+ gpio_free(EP93XX_GPIO_LINE_G(i));
+ }
+
+ ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_EONIDE |
+ EP93XX_SYSCON_DEVCFG_GONIDE |
+ EP93XX_SYSCON_DEVCFG_HONIDE);
+}
+EXPORT_SYMBOL(ep93xx_ide_release_gpio);
+
+
extern void ep93xx_gpio_init(void);
void __init ep93xx_init_devices(void)
@@ -83,6 +83,7 @@
#define EP93XX_BOOT_ROM_BASE EP93XX_AHB_IOMEM(0x00090000)
+#define EP93XX_IDE_PHYS_BASE EP93XX_AHB_PHYS(0x000a0000)
#define EP93XX_IDE_BASE EP93XX_AHB_IOMEM(0x000a0000)
#define EP93XX_VIC1_BASE EP93XX_AHB_IOMEM(0x000b0000)
@@ -39,6 +39,9 @@ void ep93xx_register_fb(struct ep93xxfb_mach_info *data);
void ep93xx_register_pwm(int pwm0, int pwm1);
int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);
void ep93xx_pwm_release_gpio(struct platform_device *pdev);
+void ep93xx_register_ide(void);
+int ep93xx_ide_aquire_gpio(struct platform_device *pdev);
+void ep93xx_ide_release_gpio(struct platform_device *pdev);
void ep93xx_init_devices(void);
extern struct sys_timer ep93xx_timer;