From b04fc679055f76cfd17c6870716a8286ccfa3b8e Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 15 Oct 2005 02:41:36 +0100 Subject: [SCSI] dec_esp: Fix mapping of ESP. From: Maciej W. Rozycki Date: Mon Jun 13 19:55:42 2005 +0000 These should really be addresses obtained with ioremap() or some bus-specific backend, but for now... Signed-off-by: Ralf Baechle Signed-off-by: James Bottomley --- drivers/scsi/dec_esp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/scsi/dec_esp.c') diff --git a/drivers/scsi/dec_esp.c b/drivers/scsi/dec_esp.c index 315f95a0d6c00..4f39890b44ac5 100644 --- a/drivers/scsi/dec_esp.c +++ b/drivers/scsi/dec_esp.c @@ -228,7 +228,7 @@ static int dec_esp_detect(Scsi_Host_Template * tpnt) mem_start = get_tc_base_addr(slot); /* Store base addr into esp struct */ - esp->slot = PHYSADDR(mem_start); + esp->slot = CPHYSADDR(mem_start); esp->dregs = 0; esp->eregs = (struct ESP_regs *) (mem_start + DEC_SCSI_SREG); -- cgit 1.2.3-korg From 73711b352f1f1e1e9eedd772e232b7c1bd12a305 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 15 Oct 2005 02:26:31 +0100 Subject: [SCSI] dec_esp: Use physical addresses Use physical addresses at the interface level, letting drivers remap them as appropriate. Signed-off-by: Ralf Baechle Signed-off-by: James Bottomley --- drivers/scsi/dec_esp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/scsi/dec_esp.c') diff --git a/drivers/scsi/dec_esp.c b/drivers/scsi/dec_esp.c index 4f39890b44ac5..90e2faf94a093 100644 --- a/drivers/scsi/dec_esp.c +++ b/drivers/scsi/dec_esp.c @@ -18,7 +18,7 @@ * 20001005 - Initialization fixes for 2.4.0-test9 * Florian Lohoff * - * Copyright (C) 2002, 2003 Maciej W. Rozycki + * Copyright (C) 2002, 2003, 2005 Maciej W. Rozycki */ #include @@ -41,6 +41,7 @@ #include #include #include +#include #include #define DEC_SCSI_SREG 0 @@ -183,7 +184,8 @@ static int dec_esp_detect(Scsi_Host_Template * tpnt) esp->dregs = 0; /* ESP register base */ - esp->eregs = (struct ESP_regs *) (system_base + IOASIC_SCSI); + esp->eregs = (void *)CKSEG1ADDR(dec_kn_slot_base + + IOASIC_SCSI); /* Set the command buffer */ esp->esp_command = (volatile unsigned char *) cmd_buffer; @@ -228,10 +230,11 @@ static int dec_esp_detect(Scsi_Host_Template * tpnt) mem_start = get_tc_base_addr(slot); /* Store base addr into esp struct */ - esp->slot = CPHYSADDR(mem_start); + esp->slot = mem_start; esp->dregs = 0; - esp->eregs = (struct ESP_regs *) (mem_start + DEC_SCSI_SREG); + esp->eregs = (void *)CKSEG1ADDR(mem_start + + DEC_SCSI_SREG); esp->do_pio_cmds = 1; /* Set the command buffer */ -- cgit 1.2.3-korg From af13cbebb27aaa9cae0bd18cf2608a3d4dd5fa94 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Sat, 15 Oct 2005 02:44:26 +0100 Subject: [SCSI] dec_esp: Use the right address space macro Signed-off-by: James Bottomley --- drivers/scsi/dec_esp.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/scsi/dec_esp.c') diff --git a/drivers/scsi/dec_esp.c b/drivers/scsi/dec_esp.c index 90e2faf94a093..2d7bde693d961 100644 --- a/drivers/scsi/dec_esp.c +++ b/drivers/scsi/dec_esp.c @@ -516,14 +516,15 @@ static void dma_advance_sg(struct scsi_cmnd * sp) static void pmaz_dma_drain(struct NCR_ESP *esp) { memcpy(phys_to_virt(esp_virt_buffer), - (void *)KSEG1ADDR(esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE), - scsi_current_length); + (void *)CKSEG1ADDR(esp->slot + DEC_SCSI_SRAM + + ESP_TGT_DMA_SIZE), + scsi_current_length); } static void pmaz_dma_init_read(struct NCR_ESP *esp, u32 vaddress, int length) { volatile u32 *dmareg = - (volatile u32 *)KSEG1ADDR(esp->slot + DEC_SCSI_DMAREG); + (volatile u32 *)CKSEG1ADDR(esp->slot + DEC_SCSI_DMAREG); if (length > ESP_TGT_DMA_SIZE) length = ESP_TGT_DMA_SIZE; @@ -539,9 +540,10 @@ static void pmaz_dma_init_read(struct NCR_ESP *esp, u32 vaddress, int length) static void pmaz_dma_init_write(struct NCR_ESP *esp, u32 vaddress, int length) { volatile u32 *dmareg = - (volatile u32 *)KSEG1ADDR(esp->slot + DEC_SCSI_DMAREG); + (volatile u32 *)CKSEG1ADDR(esp->slot + DEC_SCSI_DMAREG); - memcpy((void *)KSEG1ADDR(esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE), + memcpy((void *)CKSEG1ADDR(esp->slot + DEC_SCSI_SRAM + + ESP_TGT_DMA_SIZE), phys_to_virt(vaddress), length); wmb(); -- cgit 1.2.3-korg