11 #include <linux/kernel.h>
13 #include <linux/slab.h>
14 #include <linux/module.h>
27 .max_internal_adress = 0x1B3F,
32 .max_internal_adress = 0x3FFF,
36 #define WRITE_INT_RAM 0xA0
37 #define WRITE_EXT_RAM 0xA3
49 if (!transfer_buffer) {
50 dev_err(&dev->dev,
"%s - kmalloc(%d) failed.\n",
56 address, 0, transfer_buffer, length, 3000);
58 kfree(transfer_buffer);
64 unsigned char reset_bit)
68 dev_err(&dev->dev,
"%s-%d failed: %d\n",
69 __func__, reset_bit, response);
85 static int ezusb_ihex_firmware_download(
struct usb_device *
dev,
87 const char *firmware_path)
93 if (request_ihex_firmware(&firmware, firmware_path,
96 "%s - request \"%s\" failed\n",
97 __func__, firmware_path);
106 for (;
record; record = ihex_next_binrec(record)) {
109 (
unsigned char *)record->
data,
112 dev_err(&dev->dev,
"%s - ezusb_writememory "
113 "failed writing internal memory "
114 "(%d %04X %p %d)\n", __func__, ret,
126 for (;
record; record = ihex_next_binrec(record)) {
129 (
unsigned char *)record->
data,
132 dev_err(&dev->dev,
"%s - ezusb_writememory "
133 "failed writing external memory "
134 "(%d %04X %p %d)\n", __func__, ret,
148 const char *firmware_path)
150 return ezusb_ihex_firmware_download(dev, ezusb_fx1, firmware_path);
155 const char *firmware_path)
157 return ezusb_ihex_firmware_download(dev, ezusb_fx2, firmware_path);