Commit ccf944bd authored by Jens Axboe's avatar Jens Axboe

ppc low level ide driver updates

parent 8afb2f5f
...@@ -44,13 +44,13 @@ ...@@ -44,13 +44,13 @@
#include <asm/irq.h> #include <asm/irq.h>
#include "ide_modes.h" #include "ide_modes.h"
static int identify (volatile unsigned char *p); static int identify (volatile u8 *p);
static void print_fixed (volatile unsigned char *p); static void print_fixed (volatile u8 *p);
static void print_funcid (int func); static void print_funcid (int func);
static int check_ide_device (unsigned long base); static int check_ide_device (unsigned long base);
static void ide_interrupt_ack (void *dev); static void ide_interrupt_ack (void *dev);
static void m8xx_ide_tuneproc(ide_drive_t *drive, byte pio); static void m8xx_ide_tuneproc(ide_drive_t *drive, u8 pio);
typedef struct ide_ioport_desc { typedef struct ide_ioport_desc {
unsigned long base_off; /* Offset to PCMCIA memory */ unsigned long base_off; /* Offset to PCMCIA memory */
...@@ -433,7 +433,7 @@ void m8xx_ide_init_hwif_ports (hw_regs_t *hw, ...@@ -433,7 +433,7 @@ void m8xx_ide_init_hwif_ports (hw_regs_t *hw,
/* Calculate PIO timings */ /* Calculate PIO timings */
static void static void
m8xx_ide_tuneproc(ide_drive_t *drive, byte pio) m8xx_ide_tuneproc(ide_drive_t *drive, u8 pio)
{ {
ide_pio_data_t d; ide_pio_data_t d;
#if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) #if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT)
...@@ -617,12 +617,12 @@ ide_interrupt_ack (void *dev) ...@@ -617,12 +617,12 @@ ide_interrupt_ack (void *dev)
static int check_ide_device (unsigned long base) static int check_ide_device (unsigned long base)
{ {
volatile unsigned char *ident = NULL; volatile u8 *ident = NULL;
volatile unsigned char *feature_p[MAX_FEATURES]; volatile u8 *feature_p[MAX_FEATURES];
volatile unsigned char *p, *start; volatile u8 *p, *start;
int n_features = 0; int n_features = 0;
unsigned char func_id = ~0; u8 func_id = ~0;
unsigned char code, len; u8 code, len;
unsigned short config_base = 0; unsigned short config_base = 0;
int found = 0; int found = 0;
int i; int i;
...@@ -630,7 +630,7 @@ static int check_ide_device (unsigned long base) ...@@ -630,7 +630,7 @@ static int check_ide_device (unsigned long base)
#ifdef DEBUG #ifdef DEBUG
printk ("PCMCIA MEM: %08lX\n", base); printk ("PCMCIA MEM: %08lX\n", base);
#endif #endif
start = p = (volatile unsigned char *) base; start = p = (volatile u8 *) base;
while ((p - start) < MAX_TUPEL_SZ) { while ((p - start) < MAX_TUPEL_SZ) {
...@@ -642,7 +642,7 @@ static int check_ide_device (unsigned long base) ...@@ -642,7 +642,7 @@ static int check_ide_device (unsigned long base)
len = *p; p += 2; len = *p; p += 2;
#ifdef DEBUG_PCMCIA #ifdef DEBUG_PCMCIA
{ volatile unsigned char *q = p; { volatile u8 *q = p;
printk ("\nTuple code %02x length %d\n\tData:", printk ("\nTuple code %02x length %d\n\tData:",
code, len); code, len);
...@@ -673,7 +673,7 @@ static int check_ide_device (unsigned long base) ...@@ -673,7 +673,7 @@ static int check_ide_device (unsigned long base)
found = identify (ident); found = identify (ident);
if (func_id != ((unsigned char)~0)) { if (func_id != ((u8)~0)) {
print_funcid (func_id); print_funcid (func_id);
if (func_id == CISTPL_FUNCID_FIXED) if (func_id == CISTPL_FUNCID_FIXED)
...@@ -692,7 +692,7 @@ static int check_ide_device (unsigned long base) ...@@ -692,7 +692,7 @@ static int check_ide_device (unsigned long base)
} }
/* set level mode irq and I/O mapped device in config reg*/ /* set level mode irq and I/O mapped device in config reg*/
*((unsigned char *)(base + config_base)) = 0x41; *((u8 *)(base + config_base)) = 0x41;
return (0); return (0);
} }
...@@ -738,14 +738,14 @@ static void print_funcid (int func) ...@@ -738,14 +738,14 @@ static void print_funcid (int func)
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
static void print_fixed (volatile unsigned char *p) static void print_fixed (volatile u8 *p)
{ {
if (p == NULL) if (p == NULL)
return; return;
switch (*p) { switch (*p) {
case CISTPL_FUNCE_IDE_IFACE: case CISTPL_FUNCE_IDE_IFACE:
{ unsigned char iface = *(p+2); { u8 iface = *(p+2);
printk ((iface == CISTPL_IDE_INTERFACE) ? " IDE" : " unknown"); printk ((iface == CISTPL_IDE_INTERFACE) ? " IDE" : " unknown");
printk (" interface "); printk (" interface ");
...@@ -753,8 +753,8 @@ static void print_fixed (volatile unsigned char *p) ...@@ -753,8 +753,8 @@ static void print_fixed (volatile unsigned char *p)
} }
case CISTPL_FUNCE_IDE_MASTER: case CISTPL_FUNCE_IDE_MASTER:
case CISTPL_FUNCE_IDE_SLAVE: case CISTPL_FUNCE_IDE_SLAVE:
{ unsigned char f1 = *(p+2); { u8 f1 = *(p+2);
unsigned char f2 = *(p+4); u8 f2 = *(p+4);
printk ((f1 & CISTPL_IDE_SILICON) ? " [silicon]" : " [rotating]"); printk ((f1 & CISTPL_IDE_SILICON) ? " [silicon]" : " [rotating]");
...@@ -796,17 +796,17 @@ static void print_fixed (volatile unsigned char *p) ...@@ -796,17 +796,17 @@ static void print_fixed (volatile unsigned char *p)
#define MAX_IDENT_CHARS 64 #define MAX_IDENT_CHARS 64
#define MAX_IDENT_FIELDS 4 #define MAX_IDENT_FIELDS 4
static unsigned char *known_cards[] = { static u8 *known_cards[] = {
"ARGOSY PnPIDE D5", "ARGOSY PnPIDE D5",
NULL NULL
}; };
static int identify (volatile unsigned char *p) static int identify (volatile u8 *p)
{ {
unsigned char id_str[MAX_IDENT_CHARS]; u8 id_str[MAX_IDENT_CHARS];
unsigned char data; u8 data;
unsigned char *t; u8 *t;
unsigned char **card; u8 **card;
int i, done; int i, done;
if (p == NULL) if (p == NULL)
......
This diff is collapsed.
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/sibyte/sb1250_int.h> #include <asm/sibyte/sb1250_int.h>
#define __IDE_SWARM_C
#include <asm/sibyte/swarm_ide.h> #include <asm/sibyte/swarm_ide.h>
void __init swarm_ide_probe(void) void __init swarm_ide_probe(void)
...@@ -62,12 +65,37 @@ void __init swarm_ide_probe(void) ...@@ -62,12 +65,37 @@ void __init swarm_ide_probe(void)
hwif->hw.io_ports[IDE_STATUS_OFFSET] = SWARM_IDE_REG(0x1f7); hwif->hw.io_ports[IDE_STATUS_OFFSET] = SWARM_IDE_REG(0x1f7);
hwif->hw.io_ports[IDE_CONTROL_OFFSET] = SWARM_IDE_REG(0x3f6); hwif->hw.io_ports[IDE_CONTROL_OFFSET] = SWARM_IDE_REG(0x3f6);
hwif->hw.io_ports[IDE_IRQ_OFFSET] = SWARM_IDE_REG(0x3f7); hwif->hw.io_ports[IDE_IRQ_OFFSET] = SWARM_IDE_REG(0x3f7);
// hwif->hw->ack_intr = swarm_ide_ack_intr; // hwif->hw->ack_intr = swarm_ide_ack_intr;
hwif->hw.irq = SWARM_IDE_INT; hwif->hw.irq = SWARM_IDE_INT;
hwif->ideproc = swarm_ideproc; #if 0
hwif->iops = swarm_iops;
#else
hwif->OUTB = hwif->OUTBP = swarm_outb;
hwif->OUTW = hwif->OUTWP = swarm_outw;
hwif->OUTL = hwif->OUTLP = swarm_outl;
hwif->OUTSW = hwif->OUTSWP = swarm_outsw;
hwif->OUTSL = hwif->OUTSLP = swarm_outsl;
hwif->INB = hwif->INBP = swarm_inb;
hwif->INW = hwif->INWP = swarm_inw;
hwif->INL = hwif->INLP = swarm_inl;
hwif->INSW = hwif->INSWP = swarm_insw;
hwif->INSL = hwif->INSLP = swarm_insl;
#endif
#if 0
hwif->pioops = swarm_pio_ops;
#else
hwif->ata_input_data = swarm_ata_input_data;
hwif->ata_output_data = swarm_ata_output_data;
hwif->atapi_input_bytes = swarm_atapi_input_bytes;
hwif->atapi_output_bytes = swarm_atapi_output_bytes;
#endif
memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
hwif->irq = hwif->hw.irq; hwif->irq = hwif->hw.irq;
printk("SWARM onboard IDE configured as device %i\n", i); printk("SWARM onboard IDE configured as device %i\n", i);
#ifndef HWIF_PROBE_CLASSIC_METHOD
probe_hwif_init(hwif->index);
#endif /* HWIF_PROBE_CLASSIC_METHOD */
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment