Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101000
b: refs/heads/master
c: d12b219
h: refs/heads/master
v: v3
  • Loading branch information
Jaswinder Singh authored and David Woodhouse committed Jul 14, 2008
1 parent 4016620 commit 76945ba
Show file tree
Hide file tree
Showing 6 changed files with 880 additions and 874 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: 5b9ea9322605da09d6f7119f03f71cc52b044911
refs/heads/master: d12b219a228efe92f0778ed3af21305e65fbb052
847 changes: 0 additions & 847 deletions trunk/drivers/usb/serial/io_fw_down3.h

This file was deleted.

73 changes: 47 additions & 26 deletions trunk/drivers/usb/serial/io_ti.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <linux/mutex.h>
#include <linux/serial.h>
#include <linux/ioctl.h>
#include <linux/firmware.h>
#include <asm/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
Expand All @@ -52,13 +53,6 @@
#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com> and David Iacovelli"
#define DRIVER_DESC "Edgeport USB Serial Driver"


/* firmware image code */
#define IMAGE_VERSION_NAME PagableOperationalCodeImageVersion
#define IMAGE_ARRAY_NAME PagableOperationalCodeImage
#define IMAGE_SIZE PagableOperationalCodeSize
#include "io_fw_down3.h" /* Define array OperationalCodeImage[] */

#define EPROM_PAGE_SIZE 64


Expand Down Expand Up @@ -231,7 +225,9 @@ static struct usb_driver io_driver = {
};


static struct EDGE_FIRMWARE_VERSION_INFO OperationalCodeImageVersion;
static unsigned char OperationalMajorVersion;
static unsigned char OperationalMinorVersion;
static unsigned short OperationalBuildNumber;

static int debug;

Expand Down Expand Up @@ -885,10 +881,13 @@ static int BuildI2CFirmwareHeader (__u8 *header, struct device *dev)
__u8 *buffer;
int buffer_size;
int i;
int err;
__u8 cs = 0;
struct ti_i2c_desc *i2c_header;
struct ti_i2c_image_header *img_header;
struct ti_i2c_firmware_rec *firmware_rec;
const struct firmware *fw;
const char *fw_name = "edgeport/down3.bin";

// In order to update the I2C firmware we must change the type 2 record to type 0xF2.
// This will force the UMP to come up in Boot Mode. Then while in boot mode, the driver
Expand All @@ -909,19 +908,34 @@ static int BuildI2CFirmwareHeader (__u8 *header, struct device *dev)
// Set entire image of 0xffs
memset (buffer, 0xff, buffer_size);

err = request_firmware(&fw, fw_name, dev);
if (err) {
printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
fw_name, err);
kfree(buffer);
return err;
}

/* Save Download Version Number */
OperationalMajorVersion = fw->data[0];
OperationalMinorVersion = fw->data[1];
OperationalBuildNumber = fw->data[2] | (fw->data[3] << 8);

// Copy version number into firmware record
firmware_rec = (struct ti_i2c_firmware_rec *)buffer;

firmware_rec->Ver_Major = OperationalCodeImageVersion.MajorVersion;
firmware_rec->Ver_Minor = OperationalCodeImageVersion.MinorVersion;
firmware_rec->Ver_Major = OperationalMajorVersion;
firmware_rec->Ver_Minor = OperationalMinorVersion;

// Pointer to fw_down memory image
img_header = (struct ti_i2c_image_header *)&PagableOperationalCodeImage[0];
img_header = (struct ti_i2c_image_header *)&fw->data[4];

memcpy (buffer + sizeof(struct ti_i2c_firmware_rec),
&PagableOperationalCodeImage[sizeof(struct ti_i2c_image_header)],
&fw->data[4 + sizeof(struct ti_i2c_image_header)],
le16_to_cpu(img_header->Length));

release_firmware(fw);

for (i=0; i < buffer_size; i++) {
cs = (__u8)(cs + buffer[i]);
}
Expand All @@ -935,8 +949,8 @@ static int BuildI2CFirmwareHeader (__u8 *header, struct device *dev)
i2c_header->Type = I2C_DESC_TYPE_FIRMWARE_BLANK;
i2c_header->Size = (__u16)buffer_size;
i2c_header->CheckSum = cs;
firmware_rec->Ver_Major = OperationalCodeImageVersion.MajorVersion;
firmware_rec->Ver_Minor = OperationalCodeImageVersion.MinorVersion;
firmware_rec->Ver_Major = OperationalMajorVersion;
firmware_rec->Ver_Minor = OperationalMinorVersion;

return 0;
}
Expand Down Expand Up @@ -1075,11 +1089,6 @@ static int TIDownloadFirmware (struct edgeport_serial *serial)
// Otherwise we will remain in configuring mode
serial->product_info.TiMode = TI_MODE_CONFIGURING;

// Save Download Version Number
OperationalCodeImageVersion.MajorVersion = PagableOperationalCodeImageVersion.MajorVersion;
OperationalCodeImageVersion.MinorVersion = PagableOperationalCodeImageVersion.MinorVersion;
OperationalCodeImageVersion.BuildNumber = PagableOperationalCodeImageVersion.BuildNumber;

/********************************************************************/
/* Download Mode */
/********************************************************************/
Expand Down Expand Up @@ -1154,24 +1163,24 @@ static int TIDownloadFirmware (struct edgeport_serial *serial)
// Check version number of download with current version in I2c
download_cur_ver = (firmware_version->Ver_Major << 8) +
(firmware_version->Ver_Minor);
download_new_ver = (OperationalCodeImageVersion.MajorVersion << 8) +
(OperationalCodeImageVersion.MinorVersion);
download_new_ver = (OperationalMajorVersion << 8) +
(OperationalMinorVersion);

dbg ("%s - >>>Firmware Versions Device %d.%d Driver %d.%d",
__func__,
firmware_version->Ver_Major,
firmware_version->Ver_Minor,
OperationalCodeImageVersion.MajorVersion,
OperationalCodeImageVersion.MinorVersion);
OperationalMajorVersion,
OperationalMinorVersion);

// Check if we have an old version in the I2C and update if necessary
if (download_cur_ver != download_new_ver) {
dbg ("%s - Update I2C Download from %d.%d to %d.%d",
__func__,
firmware_version->Ver_Major,
firmware_version->Ver_Minor,
OperationalCodeImageVersion.MajorVersion,
OperationalCodeImageVersion.MinorVersion);
OperationalMajorVersion,
OperationalMinorVersion);

// In order to update the I2C firmware we must change the type 2 record to type 0xF2.
// This will force the UMP to come up in Boot Mode. Then while in boot mode, the driver
Expand Down Expand Up @@ -1377,6 +1386,9 @@ static int TIDownloadFirmware (struct edgeport_serial *serial)
__u8 cs = 0;
__u8 *buffer;
int buffer_size;
int err;
const struct firmware *fw;
const char *fw_name = "edgeport/down3.bin";

/* Validate Hardware version number
* Read Manufacturing Descriptor from TI Based Edgeport
Expand Down Expand Up @@ -1425,7 +1437,15 @@ static int TIDownloadFirmware (struct edgeport_serial *serial)
// Initialize the buffer to 0xff (pad the buffer)
memset (buffer, 0xff, buffer_size);

memcpy (buffer, &PagableOperationalCodeImage[0], PagableOperationalCodeSize);
err = request_firmware(&fw, fw_name, dev);
if (err) {
printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
fw_name, err);
kfree(buffer);
return err;
}
memcpy(buffer, &fw->data[4], fw->size - 4);
release_firmware(fw);

for(i = sizeof(struct ti_i2c_image_header); i < buffer_size; i++) {
cs = (__u8)(cs + buffer[i]);
Expand Down Expand Up @@ -3119,6 +3139,7 @@ module_exit(edgeport_exit);
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
MODULE_FIRMWARE("edgeport/down3.bin");

module_param(debug, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(debug, "Debug enabled or not");
Expand Down
1 change: 1 addition & 0 deletions trunk/firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ endif
fw-shipped-$(CONFIG_USB_SERIAL_TI) += ti_3410.fw ti_5052.fw
fw-shipped-$(CONFIG_USB_SERIAL_EDGEPORT) += edgeport/boot.fw edgeport/boot2.fw \
edgeport/down.fw edgeport/down2.fw
fw-shipped-$(CONFIG_USB_SERIAL_EDGEPORT_TI) += edgeport/down3.bin
fw-shipped-$(CONFIG_USB_SERIAL_WHITEHEAT) += whiteheat_loader.fw whiteheat.fw \
# whiteheat_loader_debug.fw
fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_PDA) += keyspan_pda/keyspan_pda.fw
Expand Down
16 changes: 16 additions & 0 deletions trunk/firmware/WHENCE
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,19 @@ Licence: Allegedly GPLv2+, but no source visible. Marked:
Found in hex form in kernel source.

--------------------------------------------------------------------------

Driver: USB_SERIAL_EDGEPORT_TI - USB Inside Out Edgeport Serial Driver
(TI Devices)

File: edgeport/down3.bin

Licence:
//**************************************************************
//* Edgeport Binary Image (for TI based products)
//* Generated by TIBin2C v2.00 (watchport)
//* Copyright (C) 2001 Inside Out Networks, All rights reserved.
//**************************************************************

Found in hex form in kernel source.

--------------------------------------------------------------------------
Loading

0 comments on commit 76945ba

Please sign in to comment.