Commit 96a878c0 authored by Martin Dalecki's avatar Martin Dalecki Committed by Linus Torvalds

[PATCH] IDE 58

 - m68k fixes by Roman Zippel.

 - CDROM PIO mode fix by Osamu Tamita.
   (You are true "Hawk-eye" hovering over my head! Respect - and many Thanks.)

 - Virtualize the udma_enable method as well to help ARM and PPC people.  Please
   please if you would like to have some other methods virtualized in a similar
   way - just tell me or even better do it yourself at the end of ide-dma.c.
   I *don't mind* patches.

 - Fix the pmac code to adhere to the new API. It's supposed to work again.
   However this is blind coding... I give myself 80% chances for it to work ;-).
parent 682a9c41
...@@ -103,7 +103,7 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then ...@@ -103,7 +103,7 @@ if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then
dep_mbool ' Amiga IDE Doubler support (EXPERIMENTAL)' CONFIG_BLK_DEV_IDEDOUBLER $CONFIG_BLK_DEV_GAYLE $CONFIG_EXPERIMENTAL dep_mbool ' Amiga IDE Doubler support (EXPERIMENTAL)' CONFIG_BLK_DEV_IDEDOUBLER $CONFIG_BLK_DEV_GAYLE $CONFIG_EXPERIMENTAL
fi fi
if [ "$CONFIG_ZORRO" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then if [ "$CONFIG_ZORRO" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then
dep_mbool ' Buddha/Catweasel IDE interface support (EXPERIMENTAL)' CONFIG_BLK_DEV_BUDDHA $CONFIG_ZORRO $CONFIG_EXPERIMENTAL dep_mbool ' Buddha/Catweasel/X-Surf IDE interface support (EXPERIMENTAL)' CONFIG_BLK_DEV_BUDDHA $CONFIG_ZORRO $CONFIG_EXPERIMENTAL
fi fi
if [ "$CONFIG_ATARI" = "y" ]; then if [ "$CONFIG_ATARI" = "y" ]; then
dep_bool ' Falcon IDE interface support' CONFIG_BLK_DEV_FALCON_IDE $CONFIG_ATARI dep_bool ' Falcon IDE interface support' CONFIG_BLK_DEV_FALCON_IDE $CONFIG_ATARI
......
/* /*
* linux/drivers/ide/buddha.c -- Amiga Buddha, Catweasel and X-Surf IDE Driver * linux/drivers/ide/buddha.c -- Amiga Buddha, Catweasel and X-Surf IDE Driver
* *
* Copyright (C) 1997 by Geert Uytterhoeven * Copyright (C) 1997, 2001 by Geert Uytterhoeven and others
* *
* This driver was written by based on the specifications in README.buddha and * This driver was written based on the specifications in README.buddha and
* the X-Surf info from Inside_XSurf.txt available at * the X-Surf info from Inside_XSurf.txt available at
* http://www.jschoenfeld.com * http://www.jschoenfeld.com
* *
* This file is subject to the terms and conditions of the GNU General Public * This file is subject to the terms and conditions of the GNU General Public
...@@ -52,7 +52,7 @@ static u_int buddha_bases[CATWEASEL_NUM_HWIFS] __initdata = { ...@@ -52,7 +52,7 @@ static u_int buddha_bases[CATWEASEL_NUM_HWIFS] __initdata = {
BUDDHA_BASE1, BUDDHA_BASE2, BUDDHA_BASE3 BUDDHA_BASE1, BUDDHA_BASE2, BUDDHA_BASE3
}; };
static const u_int xsurf_bases[XSURF_NUM_HWIFS] __initdata = { static u_int xsurf_bases[XSURF_NUM_HWIFS] __initdata = {
XSURF_BASE1, XSURF_BASE2 XSURF_BASE1, XSURF_BASE2
}; };
...@@ -97,7 +97,7 @@ static int buddha_irqports[CATWEASEL_NUM_HWIFS] __initdata = { ...@@ -97,7 +97,7 @@ static int buddha_irqports[CATWEASEL_NUM_HWIFS] __initdata = {
BUDDHA_IRQ1, BUDDHA_IRQ2, BUDDHA_IRQ3 BUDDHA_IRQ1, BUDDHA_IRQ2, BUDDHA_IRQ3
}; };
static const int xsurf_irqports[XSURF_NUM_HWIFS] __initdata = { static int xsurf_irqports[XSURF_NUM_HWIFS] __initdata = {
XSURF_IRQ1, XSURF_IRQ2 XSURF_IRQ1, XSURF_IRQ2
}; };
...@@ -108,8 +108,9 @@ static const int xsurf_irqports[XSURF_NUM_HWIFS] __initdata = { ...@@ -108,8 +108,9 @@ static const int xsurf_irqports[XSURF_NUM_HWIFS] __initdata = {
* Board information * Board information
*/ */
enum BuddhaType_Enum {BOARD_BUDDHA, BOARD_CATWEASEL, BOARD_XSURF}; typedef enum BuddhaType_Enum {
typedef enum BuddhaType_Enum BuddhaType; BOARD_BUDDHA, BOARD_CATWEASEL, BOARD_XSURF
} BuddhaType;
/* /*
...@@ -175,15 +176,20 @@ void __init buddha_init(void) ...@@ -175,15 +176,20 @@ void __init buddha_init(void)
if (!request_mem_region(board+XSURF_BASE1, 0x1000, "IDE")) if (!request_mem_region(board+XSURF_BASE1, 0x1000, "IDE"))
continue; continue;
if (!request_mem_region(board+XSURF_BASE2, 0x1000, "IDE")) if (!request_mem_region(board+XSURF_BASE2, 0x1000, "IDE"))
goto fail_base2;
if (!request_mem_region(board+XSURF_IRQ1, 0x8, "IDE")) {
release_mem_region(board+XSURF_BASE2, 0x1000);
fail_base2:
release_mem_region(board+XSURF_BASE1, 0x1000);
continue; continue;
if (!request_mem_region(board+XSURF_IRQ1, 0x8, "IDE")) }
continue;
} }
buddha_board = ZTWO_VADDR(board); buddha_board = ZTWO_VADDR(board);
/* write to BUDDHA_IRQ_MR to enable the board IRQ */ /* write to BUDDHA_IRQ_MR to enable the board IRQ */
/* X-Surf doesn't have this. IRQs are always on */ /* X-Surf doesn't have this. IRQs are always on */
if(type != BOARD_XSURF) *(char *)(buddha_board+BUDDHA_IRQ_MR) = 0; if (type != BOARD_XSURF)
z_writeb(0, buddha_board+BUDDHA_IRQ_MR);
for(i=0;i<buddha_num_hwifs;i++) { for(i=0;i<buddha_num_hwifs;i++) {
if(type != BOARD_XSURF) { if(type != BOARD_XSURF) {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* License. See the file COPYING in the main directory of this archive for * License. See the file COPYING in the main directory of this archive for
* more details. * more details.
*/ */
#include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
......
...@@ -962,7 +962,7 @@ static ide_startstop_t cdrom_read_intr(struct ata_device *drive, struct request ...@@ -962,7 +962,7 @@ static ide_startstop_t cdrom_read_intr(struct ata_device *drive, struct request
/* First, figure out if we need to bit-bucket /* First, figure out if we need to bit-bucket
any of the leading sectors. */ any of the leading sectors. */
nskip = MIN(rq->current_nr_sectors - bio_sectors(rq->bio), sectors_to_transfer); nskip = MIN((int)(rq->current_nr_sectors - bio_sectors(rq->bio)), sectors_to_transfer);
while (nskip > 0) { while (nskip > 0) {
/* We need to throw away a sector. */ /* We need to throw away a sector. */
......
...@@ -533,8 +533,20 @@ void udma_enable(struct ata_device *drive, int on, int verbose) ...@@ -533,8 +533,20 @@ void udma_enable(struct ata_device *drive, int on, int verbose)
{ {
struct ata_channel *ch = drive->channel; struct ata_channel *ch = drive->channel;
int set_high = 1; int set_high = 1;
u8 unit = (drive->select.b.unit & 0x01); u8 unit;
u64 addr = BLK_BOUNCE_HIGH; u64 addr;
/* Method overloaded by host chip specific code. */
if (ch->udma_enable) {
ch->udma_enable(drive, on, verbose);
return;
}
/* Fall back to the default implementation. */
unit = (drive->select.b.unit & 0x01);
addr = BLK_BOUNCE_HIGH;
if (!on) { if (!on) {
if (verbose) if (verbose)
......
This diff is collapsed.
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
#define DTF(x...) #define DTF(x...)
#endif #endif
#define SUPPORT_VLB_SYNC 1
/* /*
* for now, taskfile requests are special :/ * for now, taskfile requests are special :/
*/ */
......
...@@ -2097,6 +2097,7 @@ void ide_unregister(struct ata_channel *ch) ...@@ -2097,6 +2097,7 @@ void ide_unregister(struct ata_channel *ch)
ch->atapi_read = old.atapi_read; ch->atapi_read = old.atapi_read;
ch->atapi_write = old.atapi_write; ch->atapi_write = old.atapi_write;
ch->XXX_udma = old.XXX_udma; ch->XXX_udma = old.XXX_udma;
ch->udma_enable = old.udma_enable;
ch->udma_start = old.udma_start; ch->udma_start = old.udma_start;
ch->udma_stop = old.udma_stop; ch->udma_stop = old.udma_stop;
ch->udma_read = old.udma_read; ch->udma_read = old.udma_read;
......
...@@ -121,6 +121,7 @@ static __inline__ void ide_init_default_hwifs(void) ...@@ -121,6 +121,7 @@ static __inline__ void ide_init_default_hwifs(void)
#define inb(p) in_8(ADDR_TRANS_B(p)) #define inb(p) in_8(ADDR_TRANS_B(p))
#define inb_p(p) in_8(ADDR_TRANS_B(p)) #define inb_p(p) in_8(ADDR_TRANS_B(p))
#define inw(p) in_be16(ADDR_TRANS_W(p)) #define inw(p) in_be16(ADDR_TRANS_W(p))
#define inw_p(p) in_be16(ADDR_TRANS_W(p))
#define outb(v,p) out_8(ADDR_TRANS_B(p),v) #define outb(v,p) out_8(ADDR_TRANS_B(p),v)
#define outb_p(v,p) out_8(ADDR_TRANS_B(p),v) #define outb_p(v,p) out_8(ADDR_TRANS_B(p),v)
#define outw(v,p) out_be16(ADDR_TRANS_W(p),v) #define outw(v,p) out_be16(ADDR_TRANS_W(p),v)
......
...@@ -459,6 +459,8 @@ struct ata_channel { ...@@ -459,6 +459,8 @@ struct ata_channel {
int (*XXX_udma)(struct ata_device *); int (*XXX_udma)(struct ata_device *);
void (*udma_enable)(struct ata_device *, int, int);
int (*udma_start) (struct ata_device *, struct request *rq); int (*udma_start) (struct ata_device *, struct request *rq);
int (*udma_stop) (struct ata_device *); int (*udma_stop) (struct ata_device *);
......
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