summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2011-03-15 12:33:20 (GMT)
committerOliver Schinagl <oliver@schinagl.nl>2011-03-15 12:33:20 (GMT)
commitd66024a03c43952bc230fa9d0133f545d9caab00 (patch)
treef9994677e8f7ab051d014ce97c695a163cb6af45
parent6dcf0627548ed55ae7819bf1bab446ee87ffc8bc (diff)
downloadopenipcam-d66024a03c43952bc230fa9d0133f545d9caab00.zip
openipcam-d66024a03c43952bc230fa9d0133f545d9caab00.tar.gz
openipcam-d66024a03c43952bc230fa9d0133f545d9caab00.tar.bz2
W90N745 scsi changes
-rw-r--r--uClinux-2.4.20-uc1/drivers/scsi/BusLogic.c14
-rw-r--r--uClinux-2.4.20-uc1/drivers/scsi/hosts.c6
-rw-r--r--uClinux-2.4.20-uc1/drivers/scsi/scsi.c26
-rw-r--r--uClinux-2.4.20-uc1/drivers/scsi/scsi_dma.c13
-rw-r--r--uClinux-2.4.20-uc1/drivers/scsi/scsi_error.c46
-rw-r--r--uClinux-2.4.20-uc1/drivers/scsi/scsi_ioctl.c3
-rw-r--r--uClinux-2.4.20-uc1/drivers/scsi/scsi_merge.c18
-rw-r--r--uClinux-2.4.20-uc1/drivers/scsi/scsi_obsolete.c14
-rw-r--r--uClinux-2.4.20-uc1/drivers/scsi/scsi_scan.c11
-rw-r--r--uClinux-2.4.20-uc1/drivers/scsi/sd.c32
10 files changed, 183 insertions, 0 deletions
diff --git a/uClinux-2.4.20-uc1/drivers/scsi/BusLogic.c b/uClinux-2.4.20-uc1/drivers/scsi/BusLogic.c
index 85d61ad..0793a32 100644
--- a/uClinux-2.4.20-uc1/drivers/scsi/BusLogic.c
+++ b/uClinux-2.4.20-uc1/drivers/scsi/BusLogic.c
@@ -257,10 +257,17 @@ static boolean BusLogic_CreateInitialCCBs(BusLogic_HostAdapter_T *HostAdapter)
int BlockSize = BusLogic_CCB_AllocationGroupSize * sizeof(BusLogic_CCB_T);
while (HostAdapter->AllocatedCCBs < HostAdapter->InitialCCBs)
{
+#ifndef CONFIG_BOARD_W90N745
void *BlockPointer = kmalloc(BlockSize,
(HostAdapter->BounceBuffersRequired
? GFP_ATOMIC | GFP_DMA
: GFP_ATOMIC));
+#else
+ void *BlockPointer = kmalloc(BlockSize,
+ (HostAdapter->BounceBuffersRequired
+ ? GFP_ATOMIC
+ : GFP_ATOMIC));
+#endif
if (BlockPointer == NULL)
{
BusLogic_Error("UNABLE TO ALLOCATE CCB GROUP - DETACHING\n",
@@ -307,10 +314,17 @@ static void BusLogic_CreateAdditionalCCBs(BusLogic_HostAdapter_T *HostAdapter,
if (AdditionalCCBs <= 0) return;
while (HostAdapter->AllocatedCCBs - PreviouslyAllocated < AdditionalCCBs)
{
+#ifndef CONFIG_BOARD_W90N745
void *BlockPointer = kmalloc(BlockSize,
(HostAdapter->BounceBuffersRequired
? GFP_ATOMIC | GFP_DMA
: GFP_ATOMIC));
+#else
+ void *BlockPointer = kmalloc(BlockSize,
+ (HostAdapter->BounceBuffersRequired
+ ? GFP_ATOMIC
+ : GFP_ATOMIC));
+#endif
if (BlockPointer == NULL) break;
BusLogic_InitializeCCBs(HostAdapter, BlockPointer, BlockSize);
}
diff --git a/uClinux-2.4.20-uc1/drivers/scsi/hosts.c b/uClinux-2.4.20-uc1/drivers/scsi/hosts.c
index 72e87c6..dda47ae 100644
--- a/uClinux-2.4.20-uc1/drivers/scsi/hosts.c
+++ b/uClinux-2.4.20-uc1/drivers/scsi/hosts.c
@@ -136,9 +136,15 @@ struct Scsi_Host * scsi_register(Scsi_Host_Template * tpnt, int j){
int flag_new = 1;
const char * hname;
size_t hname_len;
+#ifndef CONFIG_BOARD_W90N745
retval = (struct Scsi_Host *)kmalloc(sizeof(struct Scsi_Host) + j,
(tpnt->unchecked_isa_dma && j ?
GFP_DMA : 0) | GFP_ATOMIC);
+#else
+ retval = (struct Scsi_Host *)kmalloc(sizeof(struct Scsi_Host) + j,
+ (tpnt->unchecked_isa_dma && j ?
+ 0 : 0)| GFP_ATOMIC);
+#endif
if(retval == NULL)
{
printk("scsi: out of memory in scsi_register.\n");
diff --git a/uClinux-2.4.20-uc1/drivers/scsi/scsi.c b/uClinux-2.4.20-uc1/drivers/scsi/scsi.c
index 434cb04..f0e6272 100644
--- a/uClinux-2.4.20-uc1/drivers/scsi/scsi.c
+++ b/uClinux-2.4.20-uc1/drivers/scsi/scsi.c
@@ -960,6 +960,11 @@ void scsi_init_cmd_from_req(Scsi_Cmnd * SCpnt, Scsi_Request * SRpnt)
memcpy((void *) SCpnt->cmnd, (const void *) SRpnt->sr_cmnd,
sizeof(SCpnt->cmnd));
+#ifdef CONFIG_BOARD_W90N745
+ memcpy((void *)((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000)),
+ (const void *) SRpnt->sr_cmnd,
+ sizeof(unsigned char)*MAX_COMMAND_SIZE);
+#endif
/* Zero the sense buffer. Some host adapters automatically request
* sense on error. 0 is not a valid sense code.
*/
@@ -1068,6 +1073,11 @@ void scsi_do_cmd(Scsi_Cmnd * SCpnt, const void *cmnd,
memcpy((void *) SCpnt->cmnd, (const void *) cmnd,
sizeof(SCpnt->cmnd));
+#ifdef CONFIG_BOARD_W90N745
+ memcpy((void *)((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000)),
+ (const void *) cmnd,
+ sizeof(unsigned char) * MAX_COMMAND_SIZE);
+#endif
/* Zero the sense buffer. Some host adapters automatically request
* sense on error. 0 is not a valid sense code.
*/
@@ -1335,6 +1345,11 @@ int scsi_retry_command(Scsi_Cmnd * SCpnt)
{
memcpy((void *) SCpnt->cmnd, (void *) SCpnt->data_cmnd,
sizeof(SCpnt->data_cmnd));
+#ifndef CONFIG_BOARD_W90N745
+ memcpy((void *)((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000)),
+ (void *) SCpnt->data_cmnd,
+ sizeof(SCpnt->data_cmnd));
+#endif
SCpnt->request_buffer = SCpnt->buffer;
SCpnt->request_bufflen = SCpnt->bufflen;
SCpnt->use_sg = SCpnt->old_use_sg;
@@ -1486,10 +1501,17 @@ void scsi_build_commandblocks(Scsi_Device * SDpnt)
SDpnt->device_queue = NULL;
for (j = 0; j < SDpnt->queue_depth; j++) {
+#ifndef CONFIG_BOARD_W90N745
SCpnt = (Scsi_Cmnd *)
kmalloc(sizeof(Scsi_Cmnd),
GFP_ATOMIC |
(host->unchecked_isa_dma ? GFP_DMA : 0));
+#else
+ SCpnt = (Scsi_Cmnd *)
+ kmalloc(sizeof(Scsi_Cmnd),
+ GFP_ATOMIC |
+ (host->unchecked_isa_dma ? 0 : 0));
+#endif
if (NULL == SCpnt)
break; /* If not, the next line will oops ... */
memset(SCpnt, 0, sizeof(Scsi_Cmnd));
@@ -2790,6 +2812,10 @@ scsi_reset_provider(Scsi_Device *dev, int flag)
SCpnt->owner = SCSI_OWNER_MIDLEVEL;
memset(&SCpnt->cmnd, '\0', sizeof(SCpnt->cmnd));
+#ifdef CONFIG_BOARD_W90N745
+ memset(((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000)),
+ '\0', sizeof(unsigned char)*MAX_COMMAND_SIZE);
+#endif
SCpnt->scsi_done = scsi_reset_provider_done_command;
SCpnt->done = NULL;
diff --git a/uClinux-2.4.20-uc1/drivers/scsi/scsi_dma.c b/uClinux-2.4.20-uc1/drivers/scsi/scsi_dma.c
index 92c5d4f..201a7c4 100644
--- a/uClinux-2.4.20-uc1/drivers/scsi/scsi_dma.c
+++ b/uClinux-2.4.20-uc1/drivers/scsi/scsi_dma.c
@@ -146,6 +146,9 @@ int scsi_free(void *obj, unsigned int len)
SCSI_LOG_MLQUEUE(3, printk("SFree: %p %d\n", obj, len));
#endif
+#ifdef CONFIG_BOARD_W90N745
+ obj = (void *)((unsigned long)obj & 0x7fffffff);
+#endif
spin_lock_irqsave(&allocator_request_lock, flags);
for (page = 0; page < dma_sectors / SECTORS_PER_PAGE; page++) {
@@ -430,8 +433,13 @@ void scsi_resize_dma_pool(void)
if ((!out_of_space) && (new_dma_sectors > dma_sectors)) {
for (i = dma_sectors / SECTORS_PER_PAGE;
i < new_dma_sectors / SECTORS_PER_PAGE; i++) {
+#ifndef CONFIG_BOARD_W90N745
new_dma_malloc_pages[i] = (unsigned char *)
__get_free_pages(GFP_ATOMIC | GFP_DMA, 0);
+#else
+ new_dma_malloc_pages[i] = (unsigned char *)
+ __get_free_pages(GFP_ATOMIC, 0);
+#endif
if (!new_dma_malloc_pages[i])
break;
}
@@ -530,8 +538,13 @@ int scsi_init_minimal_dma_pool(void)
GFP_ATOMIC);
if (dma_malloc_pages) {
memset(dma_malloc_pages, 0, size);
+#ifndef CONFIG_BOARD_W90N745
dma_malloc_pages[0] = (unsigned char *)
__get_free_pages(GFP_ATOMIC | GFP_DMA, 0);
+#else
+ dma_malloc_pages[0] = (unsigned char *)
+ __get_free_pages(GFP_ATOMIC, 0);
+#endif
if (dma_malloc_pages[0])
has_space = 1;
}
diff --git a/uClinux-2.4.20-uc1/drivers/scsi/scsi_error.c b/uClinux-2.4.20-uc1/drivers/scsi/scsi_error.c
index ace08b8..59b4352 100644
--- a/uClinux-2.4.20-uc1/drivers/scsi/scsi_error.c
+++ b/uClinux-2.4.20-uc1/drivers/scsi/scsi_error.c
@@ -387,6 +387,11 @@ STATIC int scsi_eh_retry_command(Scsi_Cmnd * SCpnt)
{
memcpy((void *) SCpnt->cmnd, (void *) SCpnt->data_cmnd,
sizeof(SCpnt->data_cmnd));
+#ifdef CONFIG_BOARD_W90N745
+ memcpy((void *) ((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000)),
+ (void *) SCpnt->data_cmnd,
+ sizeof(SCpnt->data_cmnd));
+#endif
SCpnt->request_buffer = SCpnt->buffer;
SCpnt->request_bufflen = SCpnt->bufflen;
SCpnt->use_sg = SCpnt->old_use_sg;
@@ -428,16 +433,33 @@ STATIC int scsi_request_sense(Scsi_Cmnd * SCpnt)
memcpy((void *) SCpnt->cmnd, (void *) generic_sense,
sizeof(generic_sense));
+#ifdef CONFIG_BOARD_W90N745
+ memcpy((void *)((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000)),
+ (void *) generic_sense,
+ sizeof(generic_sense));
+#endif
+
if (SCpnt->device->scsi_level <= SCSI_2)
SCpnt->cmnd[1] = SCpnt->lun << 5;
+#ifdef CONFIG_BOARD_W90N745
+ ((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000))[1] = SCpnt->lun << 5;
+#endif
+#ifndef CONFIG_BOARD_W90N745
scsi_result = (!SCpnt->host->hostt->unchecked_isa_dma)
? &scsi_result0[0] : kmalloc(512, GFP_ATOMIC | GFP_DMA);
+#else
+ scsi_result = (unsigned char *)kmalloc(sizeof(unsigned char) * 256, GFP_ATOMIC);
+#endif
if (scsi_result == NULL) {
printk("cannot allocate scsi_result in scsi_request_sense.\n");
return FAILED;
}
+#ifdef CONFIG_BOARD_W90N745
+ scsi_result = (unsigned char *)((unsigned long)scsi_result | 0x80000000);
+#endif
+
/*
* Zero the sense buffer. Some host adapters automatically always request
* sense, so it is not a good idea that SCpnt->request_buffer and
@@ -463,8 +485,13 @@ STATIC int scsi_request_sense(Scsi_Cmnd * SCpnt)
SCpnt->request_buffer,
sizeof(SCpnt->sense_buffer));
+#ifndef CONFIG_BOARD_W90N745
if (scsi_result != &scsi_result0[0] && scsi_result != NULL)
kfree(scsi_result);
+#else
+ if(scsi_result != NULL)
+ kfree(scsi_result);
+#endif
/*
* When we eventually call scsi_finish, we really wish to complete
@@ -472,6 +499,11 @@ STATIC int scsi_request_sense(Scsi_Cmnd * SCpnt)
*/
memcpy((void *) SCpnt->cmnd, (void *) SCpnt->data_cmnd,
sizeof(SCpnt->data_cmnd));
+#ifdef CONFIG_BOARD_W90N745
+ memcpy((void *)((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000)),
+ (void *) SCpnt->data_cmnd,
+ sizeof(SCpnt->data_cmnd));
+#endif
SCpnt->result = saved_result;
SCpnt->request_buffer = SCpnt->buffer;
SCpnt->request_bufflen = SCpnt->bufflen;
@@ -500,8 +532,17 @@ STATIC int scsi_test_unit_ready(Scsi_Cmnd * SCpnt)
memcpy((void *) SCpnt->cmnd, (void *) tur_command,
sizeof(tur_command));
+#ifdef CONFIG_BOARD_W90N745
+ memcpy((void *)((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000)),
+ (void *) tur_command,
+ sizeof(tur_command));
+#endif
+
if (SCpnt->device->scsi_level <= SCSI_2)
SCpnt->cmnd[1] = SCpnt->lun << 5;
+#ifdef CONFIG_BOARD_W90N745
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[1] = SCpnt->lun << 5;
+#endif
/*
* Zero the sense buffer. The SCSI spec mandates that any
@@ -524,6 +565,11 @@ STATIC int scsi_test_unit_ready(Scsi_Cmnd * SCpnt)
*/
memcpy((void *) SCpnt->cmnd, (void *) SCpnt->data_cmnd,
sizeof(SCpnt->data_cmnd));
+#ifdef CONFIG_BOARD_W90N745
+ memcpy((void *)((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000)),
+ (void *) SCpnt->data_cmnd,
+ sizeof(SCpnt->data_cmnd));
+#endif
SCpnt->request_buffer = SCpnt->buffer;
SCpnt->request_bufflen = SCpnt->bufflen;
SCpnt->use_sg = SCpnt->old_use_sg;
diff --git a/uClinux-2.4.20-uc1/drivers/scsi/scsi_ioctl.c b/uClinux-2.4.20-uc1/drivers/scsi/scsi_ioctl.c
index 6f891de..2d4fec9 100644
--- a/uClinux-2.4.20-uc1/drivers/scsi/scsi_ioctl.c
+++ b/uClinux-2.4.20-uc1/drivers/scsi/scsi_ioctl.c
@@ -235,6 +235,9 @@ int scsi_ioctl_send_command(Scsi_Device * dev, Scsi_Ioctl_Command * sic)
buf = (char *) scsi_malloc(buf_needed);
if (!buf)
return -ENOMEM;
+#ifdef CONFIG_BOARD_W90N745
+ buf = (char *)((unsigned long)buf | 0x80000000);
+#endif
memset(buf, 0, buf_needed);
if( inlen == 0 ) {
data_direction = SCSI_DATA_READ;
diff --git a/uClinux-2.4.20-uc1/drivers/scsi/scsi_merge.c b/uClinux-2.4.20-uc1/drivers/scsi/scsi_merge.c
index f22f93b..7f20095 100644
--- a/uClinux-2.4.20-uc1/drivers/scsi/scsi_merge.c
+++ b/uClinux-2.4.20-uc1/drivers/scsi/scsi_merge.c
@@ -880,6 +880,9 @@ __inline static int __init_io(Scsi_Cmnd * SCpnt,
#endif
}
+#ifdef CONFIG_BOARD_W90N745
+ sgpnt = (struct scatterlist *)((unsigned long)sgpnt | 0x80000000);
+#endif
/*
* Next, walk the list, and fill in the addresses and sizes of
* each segment.
@@ -931,15 +934,22 @@ __inline static int __init_io(Scsi_Cmnd * SCpnt,
}
if (SCpnt->host->highmem_io) {
+#ifndef CONFIG_BOARD_W90N745
sgpnt[count].page = bh->b_page;
sgpnt[count].offset = bh_offset(bh);
+#endif
sgpnt[count].address = NULL;
} else {
if (PageHighMem(bh->b_page))
BUG();
+#ifndef CONFIG_BOARD_W90N745
sgpnt[count].page = NULL;
sgpnt[count].address = bh->b_data;
+#else
+ *((volatile unsigned long*) 0xfff02004) = 0x4;
+ sgpnt[count].address = bh->b_data = (char *)((unsigned long)bh->b_data | 0x80000000);
+#endif
}
sgpnt[count].length = bh->b_size;
@@ -1089,7 +1099,12 @@ single_segment:
* chunk of the entire request.
*/
bh = req->bh;
+#ifndef CONFIG_BOARD_W90N745
buff = req->buffer = bh->b_data;
+#else
+ *((volatile unsigned long*) 0xfff02004) = 0x4;
+ buff = req->buffer = bh->b_data = (char *)((unsigned long)bh->b_data | 0x80000000);
+#endif
if (PageHighMem(bh->b_page))
BUG();
@@ -1110,6 +1125,9 @@ single_segment:
dma_exhausted(SCpnt, 0);
}
}
+#ifdef CONFIG_BOARD_W90N745
+ buff = (char *)((unsigned long)buff | 0x80000000);
+#endif
if (req->cmd == WRITE)
memcpy(buff, (char *) req->buffer, this_count << 9);
}
diff --git a/uClinux-2.4.20-uc1/drivers/scsi/scsi_obsolete.c b/uClinux-2.4.20-uc1/drivers/scsi/scsi_obsolete.c
index 488bb26..9c4361e 100644
--- a/uClinux-2.4.20-uc1/drivers/scsi/scsi_obsolete.c
+++ b/uClinux-2.4.20-uc1/drivers/scsi/scsi_obsolete.c
@@ -220,12 +220,21 @@ static void scsi_request_sense(Scsi_Cmnd * SCpnt)
memcpy((void *) SCpnt->cmnd, (void *) generic_sense,
sizeof(generic_sense));
+#ifndef CONFIG_BOARD_W90N745
+ memcpy((void *)((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000)),
+ (void *) generic_sense,
+ sizeof(generic_sense));
+#endif
memset((void *) SCpnt->sense_buffer, 0,
sizeof(SCpnt->sense_buffer));
if (SCpnt->device->scsi_level <= SCSI_2)
SCpnt->cmnd[1] = SCpnt->lun << 5;
SCpnt->cmnd[4] = sizeof(SCpnt->sense_buffer);
+#ifdef CONFIG_BOARD_W90N745
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[1] = SCpnt->lun << 5;
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[4] = sizeof(SCpnt->sense_buffer);
+#endif
SCpnt->request_buffer = &SCpnt->sense_buffer;
SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer);
@@ -647,6 +656,11 @@ void scsi_old_done(Scsi_Cmnd * SCpnt)
memcpy((void *) SCpnt->cmnd,
(void *) SCpnt->data_cmnd,
sizeof(SCpnt->data_cmnd));
+#ifdef CONFIG_BOARD_W90N745
+ memcpy((void *)((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000)),
+ (void *) SCpnt->data_cmnd,
+ sizeof(SCpnt->data_cmnd));
+#endif
memset((void *) SCpnt->sense_buffer, 0,
sizeof(SCpnt->sense_buffer));
SCpnt->request_buffer = SCpnt->buffer;
diff --git a/uClinux-2.4.20-uc1/drivers/scsi/scsi_scan.c b/uClinux-2.4.20-uc1/drivers/scsi/scsi_scan.c
index a76f2de..ad23aee 100644
--- a/uClinux-2.4.20-uc1/drivers/scsi/scsi_scan.c
+++ b/uClinux-2.4.20-uc1/drivers/scsi/scsi_scan.c
@@ -327,14 +327,21 @@ void scan_scsis(struct Scsi_Host *shpnt,
scsi_initialize_queue(SDpnt, shpnt);
SDpnt->request_queue.queuedata = (void *) SDpnt;
/* Make sure we have something that is valid for DMA purposes */
+#ifndef CONFIG_BOARD_W90N745
scsi_result = ((!shpnt->unchecked_isa_dma)
? &scsi_result0[0] : kmalloc(512, GFP_DMA));
+#else
+ scsi_result = (unsigned char *)kmalloc(sizeof(unsigned char) * 256, GFP_ATOMIC);
+#endif
}
if (scsi_result == NULL) {
printk("Unable to obtain scsi_result buffer\n");
goto leave;
}
+#ifdef CONFIG_BOARD_W90N745
+ scsi_result = (unsigned char *)((unsigned long)scsi_result | 0x80000000);
+#endif
/*
* We must chain ourself in the host_queue, so commands can time out
*/
@@ -492,7 +499,11 @@ void scan_scsis(struct Scsi_Host *shpnt,
}
/* If we allocated a buffer so we could do DMA, free it now */
+#ifndef CONFIG_BOARD_W90N745
if (scsi_result != &scsi_result0[0] && scsi_result != NULL) {
+#else
+ if(scsi_result != NULL) {
+#endif
kfree(scsi_result);
} {
Scsi_Device *sdev;
diff --git a/uClinux-2.4.20-uc1/drivers/scsi/sd.c b/uClinux-2.4.20-uc1/drivers/scsi/sd.c
index 1e0749b..faf38a2 100644
--- a/uClinux-2.4.20-uc1/drivers/scsi/sd.c
+++ b/uClinux-2.4.20-uc1/drivers/scsi/sd.c
@@ -376,10 +376,16 @@ static int sd_init_command(Scsi_Cmnd * SCpnt)
return 0;
}
SCpnt->cmnd[0] = WRITE_6;
+#ifdef CONFIG_BOARD_W90N745
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[0] = WRITE_6;
+#endif
SCpnt->sc_data_direction = SCSI_DATA_WRITE;
break;
case READ:
SCpnt->cmnd[0] = READ_6;
+#ifdef CONFIG_BOARD_W90N745
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[0] = READ_6;
+#endif
SCpnt->sc_data_direction = SCSI_DATA_READ;
break;
default:
@@ -394,6 +400,11 @@ static int sd_init_command(Scsi_Cmnd * SCpnt)
SCpnt->cmnd[1] = (SCpnt->device->scsi_level <= SCSI_2) ?
((SCpnt->lun << 5) & 0xe0) : 0;
+#ifdef CONFIG_BOARD_W90N745
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[1] = (SCpnt->device->scsi_level <= SCSI_2) ?
+ ((SCpnt->lun << 5) & 0xe0) : 0;
+#endif
+
if (((this_count > 0xff) || (block > 0x1fffff)) || SCpnt->device->ten) {
if (this_count > 0xffff)
this_count = 0xffff;
@@ -406,6 +417,16 @@ static int sd_init_command(Scsi_Cmnd * SCpnt)
SCpnt->cmnd[6] = SCpnt->cmnd[9] = 0;
SCpnt->cmnd[7] = (unsigned char) (this_count >> 8) & 0xff;
SCpnt->cmnd[8] = (unsigned char) this_count & 0xff;
+#ifdef CONFIG_BOARD_W90N745
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[0] = SCpnt->cmnd[0];
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[2] = (unsigned char) (block >> 24) & 0xff;
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[3] = (unsigned char) (block >> 16) & 0xff;
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[4] = (unsigned char) (block >> 8) & 0xff;
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[5] = (unsigned char) block & 0xff;
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[6] = SCpnt->cmnd[9] = 0;
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[7] = (unsigned char) (this_count >> 8) & 0xff;
+ ((unsigned char *)((unsigned long)SCpnt->cmnd | 0x80000000))[8] = (unsigned char) this_count & 0xff;
+#endif
} else {
if (this_count > 0xff)
this_count = 0xff;
@@ -415,6 +436,14 @@ static int sd_init_command(Scsi_Cmnd * SCpnt)
SCpnt->cmnd[3] = (unsigned char) block & 0xff;
SCpnt->cmnd[4] = (unsigned char) this_count;
SCpnt->cmnd[5] = 0;
+
+#ifdef CONFIG_BOARD_W90N745
+ ((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000))[1] |= (unsigned char) ((block >> 16) & 0x1f);
+ ((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000))[2] = (unsigned char) ((block >> 8) & 0xff);
+ ((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000))[3] = (unsigned char) block & 0xff;
+ ((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000))[4] = (unsigned char) this_count;
+ ((unsigned char *)((unsigned long)SCpnt->cmnd|0x80000000))[5] = 0;
+#endif
}
/*
@@ -805,6 +834,9 @@ static int sd_init_onedisk(int i)
return i;
}
+#ifdef CONFIG_BOARD_W90N745
+ buffer = (unsigned char *)((unsigned long)buffer | 0x80000000);
+#endif
spintime = 0;
/* Spin up drives, as required. Only do this at boot time */