Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=48021bd93ca339fcafe9b043d05f5d3a58be7c0a
Commit:     48021bd93ca339fcafe9b043d05f5d3a58be7c0a
Parent:     55b70a0300b873c0ec7ea6e33752af56f41250ce
Author:     Kristoffer Nyborg Gregertsen <[EMAIL PROTECTED]>
AuthorDate: Thu Aug 16 13:45:00 2007 +0200
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Tue Oct 23 11:19:05 2007 +0200

    [AVR32] Platform code for pata_at32
    
    This patch adds platform code for PATA devices on the AP7000.
    
    [EMAIL PROTECTED]: board code left out for now since stk1000
        doesn't support IDE out of the box]
    Signed-off-by: Kristoffer Nyborg Gregertsen <[EMAIL PROTECTED]>
    Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/mach-at32ap/at32ap7000.c   |   65 +++++++++++++++++++++++++++++++++
 include/asm-avr32/arch-at32ap/board.h |    7 ++++
 2 files changed, 72 insertions(+), 0 deletions(-)

diff --git a/arch/avr32/mach-at32ap/at32ap7000.c 
b/arch/avr32/mach-at32ap/at32ap7000.c
index f6d154c..30aedc9 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -1228,6 +1228,71 @@ out_free_pdev:
 }
 
 /* --------------------------------------------------------------------
+ * IDE
+ * -------------------------------------------------------------------- */
+static struct ide_platform_data at32_ide0_data;
+static struct resource at32_ide0_resource[] = {
+       {
+               .start  = 0x04000000,
+               .end    = 0x07ffffff,
+               .flags  = IORESOURCE_MEM,
+       },
+       IRQ(~0UL), /* Magic IRQ will be overridden */
+};
+DEFINE_DEV_DATA(at32_ide, 0);
+
+struct platform_device *__init
+at32_add_device_ide(unsigned int id, unsigned int extint,
+                   struct ide_platform_data *data)
+{
+       struct platform_device *pdev;
+       unsigned int extint_pin;
+
+       switch (extint) {
+       case 0:
+               extint_pin = GPIO_PIN_PB(25);
+               break;
+       case 1:
+               extint_pin = GPIO_PIN_PB(26);
+               break;
+       case 2:
+               extint_pin = GPIO_PIN_PB(27);
+               break;
+       case 3:
+               extint_pin = GPIO_PIN_PB(28);
+               break;
+       default:
+               return NULL;
+       }
+
+       switch (id) {
+       case 0:
+               pdev = &at32_ide0_device;
+               select_peripheral(PE(19), PERIPH_A, 0); /* CFCE1  -> CS0_N */
+               select_peripheral(PE(20), PERIPH_A, 0); /* CFCE2  -> CS1_N */
+               select_peripheral(PE(21), PERIPH_A, 0); /* NCS4   -> OE_N  */
+               select_peripheral(PE(23), PERIPH_A, 0); /* CFRNW  -> DIR   */
+               select_peripheral(PE(24), PERIPH_A, 0); /* NWAIT  <- IORDY */
+               set_ebi_sfr_bits(HMATRIX_BIT(CS4A));
+               data->cs = 4;
+               break;
+       default:
+               return NULL;
+       }
+
+       at32_select_periph(extint_pin, GPIO_PERIPH_A, AT32_GPIOF_DEGLITCH);
+
+       pdev->resource[1].start = EIM_IRQ_BASE + extint;
+       pdev->resource[1].end = pdev->resource[1].start;
+
+       memcpy(pdev->dev.platform_data, data, sizeof(struct ide_platform_data));
+
+       platform_device_register(pdev);
+
+       return pdev;
+}
+
+/* --------------------------------------------------------------------
  *  GCLK
  * -------------------------------------------------------------------- */
 static struct clk gclk0 = {
diff --git a/include/asm-avr32/arch-at32ap/board.h 
b/include/asm-avr32/arch-at32ap/board.h
index 7dbd603..c18160f 100644
--- a/include/asm-avr32/arch-at32ap/board.h
+++ b/include/asm-avr32/arch-at32ap/board.h
@@ -44,6 +44,13 @@ struct usba_platform_data {
 struct platform_device *
 at32_add_device_usba(unsigned int id, struct usba_platform_data *data);
 
+struct ide_platform_data {
+       u8      cs;
+};
+struct platform_device *
+at32_add_device_ide(unsigned int id, unsigned int extint,
+                   struct ide_platform_data *data);
+
 /* depending on what's hooked up, not all SSC pins will be used */
 #define        ATMEL_SSC_TK            0x01
 #define        ATMEL_SSC_TF            0x02
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to