This commit is contained in:
Markus Fröschle
2013-12-15 14:22:15 +00:00
parent ebbe822b6f
commit 5cf87ceb30
6 changed files with 23 additions and 60 deletions

View File

@@ -44,7 +44,7 @@ sleep 10
# use system sdram as flashlib scratch area. # use system sdram as flashlib scratch area.
# TODO: plugin flashing seems to work o.k. now for smaller binaries, while it doesn't for larger ones (EmuTOS) yet. # TODO: plugin flashing seems to work o.k. now for smaller binaries, while it doesn't for larger ones (EmuTOS) yet.
# This seems to be related to large flash buffers and PC-relative adressing of the plugin # This seems to be related to large flash buffers and PC-relative adressing of the plugin
flash-plugin 0x1000 0xf000 flash29.plugin #flash-plugin 0x1000 0xf000 flash29.plugin
# notify flashlib that we have flash at address 0xE0000000, length 0x7FFFFF, plugin is flash29 # notify flashlib that we have flash at address 0xE0000000, length 0x7FFFFF, plugin is flash29
flash 0xE0000000 flash 0xE0000000
@@ -57,53 +57,7 @@ flash 0xE0000000
erase 0xE0000000 0x000000 erase 0xE0000000 0x000000
erase-wait 0xE0000000 erase-wait 0xE0000000
erase 0xE0000000 0x001000 erase 0xE0000000 0x100000
erase-wait 0xE0000000
erase 0xE0000000 0x002000
erase-wait 0xE0000000
erase 0xE0000000 0x003000
erase-wait 0xE0000000
erase 0xE0000000 0x004000
erase-wait 0xE0000000
erase 0xE0000000 0x005000
erase-wait 0xE0000000
erase 0xE0000000 0x006000
erase-wait 0xE0000000
erase 0xE0000000 0x007000
erase-wait 0xE0000000
erase 0xE0000000 0x008000
erase-wait 0xE0000000
erase 0xE0000000 0x010000
erase-wait 0xE0000000
erase 0xE0000000 0x018000
erase-wait 0xE0000000
erase 0xE0000000 0x020000
erase-wait 0xE0000000
erase 0xE0000000 0x028000
erase-wait 0xE0000000
erase 0xE0000000 0x014000
erase-wait 0xE0000000
erase 0xE0000000 0x015000
erase-wait 0xE0000000
erase 0xE0000000 0x016000
erase-wait 0xE0000000
erase 0xE0000000 0x017000
erase-wait 0xE0000000
erase 0xE0000000 0x018000
erase-wait 0xE0000000
erase 0xE0000000 0x019000
erase-wait 0xE0000000
erase 0xE0000000 0x01a000
erase-wait 0xE0000000
erase 0xE0000000 0x01b000
erase-wait 0xE0000000
erase 0xE0000000 0x01c000
erase-wait 0xE0000000
erase 0xE0000000 0x01d000
erase-wait 0xE0000000
erase 0xE0000000 0x01e000
erase-wait 0xE0000000
erase 0xE0000000 0x01f000
erase-wait 0xE0000000 erase-wait 0xE0000000
load -v ../firebee/bas.elf load -v ../firebee/bas.elf
wait wait

View File

@@ -105,8 +105,6 @@ void *dma_memcpy(void *dst, void *src, size_t n)
int dma_init(void) int dma_init(void)
{ {
int res; int res;
int version;
char *long_version;
xprintf("MCD DMA API initialization: "); xprintf("MCD DMA API initialization: ");
res = MCD_initDma((dmaRegs *) &_MBAR[0x8000], SYS_SRAM, MCD_RELOC_TASKS | MCD_COMM_PREFETCH_EN); res = MCD_initDma((dmaRegs *) &_MBAR[0x8000], SYS_SRAM, MCD_RELOC_TASKS | MCD_COMM_PREFETCH_EN);
@@ -115,8 +113,6 @@ int dma_init(void)
xprintf("DMA API initialization failed (0x%x)\r\n", res); xprintf("DMA API initialization failed (0x%x)\r\n", res);
return 0; return 0;
} }
version = MCD_getVersion(&long_version);
xprintf("DMA API version %d.%d initialized. Tasks are at %p\r\n", version / 0xff, version % 0xff, SYS_SRAM);
// test // test
dma_memcpy((void *) 0x10000, (void *) 0x03e00000, 0x00100000); /* copy one megabyte of flash to RAM */ dma_memcpy((void *) 0x10000, (void *) 0x03e00000, 0x00100000); /* copy one megabyte of flash to RAM */

View File

@@ -28,6 +28,7 @@
#include "bas_printf.h" #include "bas_printf.h"
#include "exceptions.h" #include "exceptions.h"
#include "interrupts.h" #include "interrupts.h"
#include "bas_printf.h"
extern void (*rt_vbr[])(void); extern void (*rt_vbr[])(void);
#define VBR rt_vbr #define VBR rt_vbr

View File

@@ -41,9 +41,9 @@
#endif /* DEBUG_PCI */ #endif /* DEBUG_PCI */
#if MACHINE_FIREBEE #if MACHINE_FIREBEE
#define pci_config_wait() wait(20000); /* FireBee USB not properly detected otherwise */ #define pci_config_wait() wait(40000); /* FireBee USB not properly detected otherwise !?? */
#elif MACHINE_M5484LITE #elif MACHINE_M5484LITE
#define pci_config_wait() do { ; } while (0) #define pci_config_wait() do { __asm__ __volatile("tpf" :::); } while (0)
#endif #endif
/* /*
@@ -443,6 +443,7 @@ static void pci_device_config(uint16_t bus, uint16_t device, uint16_t function)
uint32_t address; uint32_t address;
int32_t handle; int32_t handle;
int16_t index = - 1; int16_t index = - 1;
uint8_t il;
struct pci_rd *descriptors; struct pci_rd *descriptors;
int i; int i;
uint32_t value; uint32_t value;
@@ -556,6 +557,12 @@ static void pci_device_config(uint16_t bus, uint16_t device, uint16_t function)
barnum++; barnum++;
} }
/* check if device requests an interrupt */
il = pci_read_config_byte(handle, PCIIPR);
xprintf("device requests interrupts on interrupt pin %d\r\n", il);
/* if so, register interrupts */
} }
} }
/* mark end of resource chain */ /* mark end of resource chain */

View File

@@ -45,6 +45,7 @@
#include "m5484l.h" #include "m5484l.h"
#endif /* MACHINE_M5484LITE */ #endif /* MACHINE_M5484LITE */
#include "dma.h"
#include "mod_devicetable.h" #include "mod_devicetable.h"
#include "pci_ids.h" #include "pci_ids.h"
#include "usb.h" #include "usb.h"

View File

@@ -326,7 +326,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
* Let's wait a while for the timeout to elapse. * Let's wait a while for the timeout to elapse.
* It has no real use, but it keeps the interface happy. * It has no real use, but it keeps the interface happy.
*/ */
wait(timeout * 1000); wait(timeout);
return -1; return -1;
} }
return dev->act_len; return dev->act_len;
@@ -1075,6 +1075,7 @@ void usb_scan_devices(void *priv)
usb_dev[(bus_index * USB_MAX_DEVICE) + i].devnum = -1; usb_dev[(bus_index * USB_MAX_DEVICE) + i].devnum = -1;
} }
dev_index[bus_index] = 0; dev_index[bus_index] = 0;
/* device 0 is always present (root hub, so let it analyze) */ /* device 0 is always present (root hub, so let it analyze) */
dev = usb_alloc_new_device(bus_index, priv); dev = usb_alloc_new_device(bus_index, priv);
if (usb_new_device(dev)) if (usb_new_device(dev))
@@ -1108,7 +1109,7 @@ void usb_scan_devices(void *priv)
* Probes device for being a hub and configurate it * Probes device for being a hub and configurate it
*/ */
//#define USB_HUB_DEBUG #define USB_HUB_DEBUG
#ifdef USB_HUB_DEBUG #ifdef USB_HUB_DEBUG
#define dbg_hub(fmt, args...) xprintf(fmt , ##args) #define dbg_hub(fmt, args...) xprintf(fmt , ##args)
@@ -1159,6 +1160,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
{ {
int i; int i;
struct usb_device *dev; struct usb_device *dev;
dev = hub->pusb_dev; dev = hub->pusb_dev;
/* Enable power to the ports */ /* Enable power to the ports */
dbg_hub("enabling power on all ports\r\n"); dbg_hub("enabling power on all ports\r\n");
@@ -1200,6 +1202,7 @@ static int hub_port_reset(struct usb_device *dev, int port, unsigned short *port
int tries; int tries;
struct usb_port_status portsts; struct usb_port_status portsts;
unsigned short portstatus, portchange; unsigned short portstatus, portchange;
dbg_hub("hub_port_reset: resetting port %d...\r\n", port + 1); dbg_hub("hub_port_reset: resetting port %d...\r\n", port + 1);
for (tries = 0; tries < MAX_TRIES; tries++) for (tries = 0; tries < MAX_TRIES; tries++)
{ {
@@ -1209,7 +1212,7 @@ static int hub_port_reset(struct usb_device *dev, int port, unsigned short *port
vTaskDelay((200*configTICK_RATE_HZ)/1000); vTaskDelay((200*configTICK_RATE_HZ)/1000);
else else
#endif #endif
wait(200 * 1000); wait(400);
if (usb_get_port_status(dev, port + 1, &portsts) < 0) if (usb_get_port_status(dev, port + 1, &portsts) < 0)
{ {
dbg_hub("get_port_status failed status %lX\r\n", dev->status); dbg_hub("get_port_status failed status %lX\r\n", dev->status);
@@ -1229,7 +1232,7 @@ static int hub_port_reset(struct usb_device *dev, int port, unsigned short *port
vTaskDelay((200*configTICK_RATE_HZ)/1000); vTaskDelay((200*configTICK_RATE_HZ)/1000);
else else
#endif #endif
wait(200 * 1000); wait(200);
} }
if (tries == MAX_TRIES) if (tries == MAX_TRIES)
{ {
@@ -1284,7 +1287,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port)
vTaskDelay((200*configTICK_RATE_HZ)/1000); vTaskDelay((200*configTICK_RATE_HZ)/1000);
else else
#endif #endif
wait(200 * 1000); wait(200);
/* Reset the port */ /* Reset the port */
if (hub_port_reset(dev, port, &portstatus) < 0) if (hub_port_reset(dev, port, &portstatus) < 0)
{ {
@@ -1296,7 +1299,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port)
vTaskDelay((200*configTICK_RATE_HZ)/1000); vTaskDelay((200*configTICK_RATE_HZ)/1000);
else else
#endif #endif
wait(200 * 1000); wait(200);
/* Allocate a new device struct for it */ /* Allocate a new device struct for it */
usb = usb_alloc_new_device(dev->usbnum, dev->priv_hcd); usb = usb_alloc_new_device(dev->usbnum, dev->priv_hcd);
if (portstatus & USB_PORT_STAT_HIGH_SPEED) if (portstatus & USB_PORT_STAT_HIGH_SPEED)
@@ -1340,6 +1343,7 @@ static void usb_hub_events(struct usb_device *dev)
{ {
struct usb_port_status portsts; struct usb_port_status portsts;
unsigned short portstatus, portchange; unsigned short portstatus, portchange;
if (usb_get_port_status(dev, i + 1, &portsts) < 0) if (usb_get_port_status(dev, i + 1, &portsts) < 0)
{ {
dbg_hub("get_port_status failed\r\n"); dbg_hub("get_port_status failed\r\n");