Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220320
b: refs/heads/master
c: 6e2c2dc
h: refs/heads/master
v: v3
  • Loading branch information
Marek Belisko authored and Greg Kroah-Hartman committed Oct 14, 2010
1 parent 00a53d3 commit ad2416e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 78 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47873d331cb94d63780644b1e5e0d331c2f2e634
refs/heads/master: 6e2c2dcfa4c30532bf9e66a1d0f42a7342283f4c
79 changes: 2 additions & 77 deletions trunk/drivers/staging/ft1000/ft1000-usb/ft1000_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <linux/vmalloc.h>
#include "ft1000_usb.h"

#define FIFO_DNLD 1

#define DWNLD_HANDSHAKE_LOC 0x02
#define DWNLD_TYPE_LOC 0x04
Expand Down Expand Up @@ -140,9 +139,7 @@ static ULONG check_usb_db (struct ft1000_device *ft1000dev)
{
DEBUG("FT1000:Got checkusb doorbell\n");
status = ft1000_write_register (ft1000dev, 0x0080, FT1000_REG_DOORBELL);
#if FIFO_DNLD
status = ft1000_write_register (ft1000dev, 0x0100, FT1000_REG_DOORBELL);
#endif
status = ft1000_write_register (ft1000dev, 0x8000, FT1000_REG_DOORBELL);
break;
}
Expand Down Expand Up @@ -214,7 +211,6 @@ static USHORT get_handshake(struct ft1000_device *ft1000dev, USHORT expected_val
while (loopcnt < 100)
{

#if FIFO_DNLD
// Need to clear downloader doorbell if Hartley ASIC
status = ft1000_write_register (ft1000dev, FT1000_DB_DNLD_RX, FT1000_REG_DOORBELL);
//DEBUG("FT1000:get_handshake:doorbell = 0x%x\n", temp);
Expand All @@ -236,47 +232,6 @@ static USHORT get_handshake(struct ft1000_device *ft1000dev, USHORT expected_val
//DEBUG("get_handshake: handshake is %x\n", tempx);
handshake = ntohs(handshake);
//DEBUG("get_handshake: after swap, handshake is %x\n", handshake);
#else
// Need to clear downloader doorbell if Hartley ASIC
status = ft1000_read_register (ft1000dev, &temp, FT1000_REG_DOORBELL);
//DEBUG("FT1000:get_handshake:doorbell = 0x%x\n", temp);
if (temp)
{
if (temp & FT1000_DB_DNLD_RX)
{
//DEBUG("get_handshake: write FT1000_DB_DNLD_RX to doorbell register\n");
status = ft1000_write_register(ft1000dev, FT1000_DB_DNLD_RX, FT1000_REG_DOORBELL);
}

if (pft1000info->fcodeldr)
{
DEBUG(" get_handshake: fcodeldr is %d\n", pft1000info->fcodeldr);
pft1000info->fcodeldr = 0;
status = check_usb_db(ft1000dev);
if (status != STATUS_SUCCESS)
{
DEBUG("get_handshake: check_usb_db failed\n");
status = STATUS_FAILURE;
break;
}

status = ft1000_read_register (ft1000dev, &temp, FT1000_REG_DOORBELL);
//DEBUG("FT1000:get_handshake:doorbell = 0x%x\n", temp);
if (temp)
{
if (temp & FT1000_DB_DNLD_RX)
status = ft1000_write_register(ft1000dev,FT1000_DB_DNLD_RX, FT1000_REG_DOORBELL);
}
}

status = ft1000_read_dpram16 (ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, (PUCHAR)&handshake, 1);
//DEBUG("get_handshake: handshake is %x\n", tempx);
handshake = ntohs(handshake);
//DEBUG("get_handshake: after swap, handshake is %x\n", handshake);

} //end of if temp
#endif


if (status)
return HANDSHAKE_TIMEOUT_VALUE;
Expand Down Expand Up @@ -318,7 +273,6 @@ static void put_handshake(struct ft1000_device *ft1000dev,USHORT handshake_value
{
ULONG tempx;
USHORT tempword;
int i;
ULONG status;


Expand All @@ -331,23 +285,6 @@ static void put_handshake(struct ft1000_device *ft1000dev,USHORT handshake_value
tempword = (USHORT)(tempx >> 16);
status = ft1000_write_dpram16 (ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, tempword, 1);
status = ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX, FT1000_REG_DOORBELL);
#if FIFO_DNLD
for (i=0; i<1000; i++);
#else
for (i=0; i<10; i++)
{
status = ft1000_read_register (ft1000dev, &tempword, FT1000_REG_DOORBELL);
if ((tempword & FT1000_DB_DNLD_TX) == 0)
break;
}
if (i==10)
{
DEBUG("FT1000:put_handshake could not clear Tx doorbell\n");
status = ft1000_read_register (ft1000dev, &tempword, FT1000_REG_DOORBELL);
DEBUG("FT1000:put_handshake:doorbell = 0x%x\n",tempword);
}
#endif

}

static USHORT get_handshake_usb(struct ft1000_device *ft1000dev, USHORT expected_value)
Expand Down Expand Up @@ -424,12 +361,8 @@ static USHORT get_request_type(struct ft1000_device *ft1000dev)
}
else
{
#if FIFO_DNLD
tempx = 0;
#else
status = ft1000_read_dpram16 (ft1000dev, DWNLD_MAG1_TYPE_LOC, (PUCHAR)&tempword, 0);
tempx = tempword;
#endif

status = ft1000_read_dpram16 (ft1000dev, DWNLD_MAG1_TYPE_LOC, (PUCHAR)&tempword, 1);
tempx |= (tempword << 16);
tempx = ntohl(tempx);
Expand Down Expand Up @@ -533,10 +466,8 @@ static long get_request_value_usb(struct ft1000_device *ft1000dev)
value |= (tempword << 16);
value = ntohl(value);

#if FIFO_DNLD
if (pft1000info->usbboot == 1)
pft1000info->usbboot = 2;
#endif

//DEBUG("get_request_value_usb: value is %x\n", value);
return value;
Expand Down Expand Up @@ -1056,9 +987,7 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
}
break;
case REQUEST_DONE_CL:
#if FIFO_DNLD
pft1000info->usbboot = 3;
#endif
/* Reposition ptrs to beginning of provisioning section */
pUsFile = (USHORT *)(pFileStart + pFileHdr5->commands_offset);
pUcFile = (UCHAR *)(pFileStart + pFileHdr5->commands_offset);
Expand Down Expand Up @@ -1104,18 +1033,14 @@ u16 scram_dnldr(struct ft1000_device *ft1000dev, void *pFileStart, ULONG FileLe
word_length++;
word_length = word_length / 2;

#if FIFO_DNLD
write_blk_fifo (ft1000dev, &pUsFile, &pUcFile, word_length);
if (pft1000info->usbboot == 0)
pft1000info->usbboot++;
if (pft1000info->usbboot == 1) {
tempword = 0;
ft1000_write_dpram16 (ft1000dev, DWNLD_MAG1_PS_HDR_LOC, tempword, 0);
}
#else
write_blk (ft1000dev, &pUsFile, &pUcFile, word_length);
//ft1000_write_dpram32 (ft1000dev, dpram, (PUCHAR)pUcFile, word_length);
#endif

break;

case REQUEST_MAILBOX_DATA:
Expand Down

0 comments on commit ad2416e

Please sign in to comment.