fixed to run from flash and ram identically. Also fixed to run EmuTOS with BaS on the m5484lite

This commit is contained in:
Markus Fröschle
2013-12-07 21:16:36 +00:00
parent b61ed9608c
commit 8c39320c54
6 changed files with 19 additions and 14 deletions

View File

@@ -69,7 +69,7 @@ SECTIONS
/* /*
* if we compile to RAM anyway, there is no need to copy anything * if we compile to RAM anyway, there is no need to copy anything
*/ */
#if COMPILE_RAM #ifdef COMPILE_RAM
. = ALIGN(16); . = ALIGN(16);
__BAS_DATA_START = .; __BAS_DATA_START = .;
*(.data) *(.data)
@@ -82,7 +82,7 @@ SECTIONS
*(.rodata) *(.rodata)
*(.rodata.*) *(.rodata.*)
#endif #endif
#if COMPILE_RAM #ifdef COMPILE_RAM
. = ALIGN(16); . = ALIGN(16);
_usb_buffer = .; _usb_buffer = .;
#endif /* COMPILE_RAM */ #endif /* COMPILE_RAM */
@@ -98,7 +98,6 @@ SECTIONS
*/ */
AT (ALIGN(ADDR(.text) + SIZEOF(.text), 4)) AT (ALIGN(ADDR(.text) + SIZEOF(.text), 4))
{ {
. = ALIGN(16);
__BAS_DATA_START = .; __BAS_DATA_START = .;
*(.data) *(.data)
__BAS_DATA_END = .; __BAS_DATA_END = .;

View File

@@ -242,8 +242,8 @@ extern int32_t pci_unhook_interrupt(int32_t handle);
((device << 8) | \ ((device << 8) | \
(function)) (function))
#define PCI_HANDLE(bus, slot, function) (0 | ((bus & 0xff) << 8 | (slot & 0x1f) << 3 | (function & 7))) #define PCI_HANDLE(bus, slot, function) (0 | ((bus & 0xff) << 10 | (slot & 0x1f) << 3 | (function & 7)))
#define PCI_BUS_FROM_HANDLE(h) (((h) & 0xff00) >> 8) #define PCI_BUS_FROM_HANDLE(h) (((h) & 0xff00) >> 10)
#define PCI_DEVICE_FROM_HANDLE(h) (((h) & 0xf8) >> 3) #define PCI_DEVICE_FROM_HANDLE(h) (((h) & 0xf8) >> 3)
#define PCI_FUNCTION_FROM_HANDLE(h) (((h) & 0x7)) #define PCI_FUNCTION_FROM_HANDLE(h) (((h) & 0x7))

View File

@@ -258,8 +258,6 @@ void BaS(void)
NOP(); /* force pipeline sync */ NOP(); /* force pipeline sync */
xprintf("finished\r\n"); xprintf("finished\r\n");
init_usb();
#ifdef MACHINE_FIREBEE #ifdef MACHINE_FIREBEE
xprintf("IDE reset: "); xprintf("IDE reset: ");
/* IDE reset */ /* IDE reset */

View File

@@ -907,7 +907,7 @@ int ehci_usb_lowlevel_init(long handle, const struct pci_device_id *ent, void **
unsigned short flags; unsigned short flags;
do do
{ {
debug("PCI USB descriptors: flags 0x%04x start 0x%08lx \r\n offset 0x%08lx dmaoffset 0x%08lx length 0x%08lx\r\n", debug("PCI USB descriptors (at %p): flags 0x%04x start 0x%08lx \r\n offset 0x%08lx dmaoffset 0x%08lx length 0x%08lx\r\n", pci_rsc_desc,
pci_rsc_desc->flags, pci_rsc_desc->start, pci_rsc_desc->offset, pci_rsc_desc->dmaoffset, pci_rsc_desc->length); pci_rsc_desc->flags, pci_rsc_desc->start, pci_rsc_desc->offset, pci_rsc_desc->dmaoffset, pci_rsc_desc->length);
if (!(pci_rsc_desc->flags & FLG_IO)) if (!(pci_rsc_desc->flags & FLG_IO))
{ {

View File

@@ -2016,7 +2016,7 @@ int ohci_usb_lowlevel_init(int32_t handle, const struct pci_device_id *ent, void
unsigned short flags; unsigned short flags;
do do
{ {
xprintf("\r\nPCI USB descriptors: flags 0x%04x start 0x%08lx \r\n offset 0x%08lx dmaoffset 0x%08lx length 0x%08lx\r\n", xprintf("\r\nPCI USB descriptors (at %p): flags 0x%04x start 0x%08lx \r\n offset 0x%08lx dmaoffset 0x%08lx length 0x%08lx\r\n", pci_rsc_desc,
pci_rsc_desc->flags, pci_rsc_desc->start, pci_rsc_desc->offset, pci_rsc_desc->dmaoffset, pci_rsc_desc->length); pci_rsc_desc->flags, pci_rsc_desc->start, pci_rsc_desc->offset, pci_rsc_desc->dmaoffset, pci_rsc_desc->length);
if (!(pci_rsc_desc->flags & FLG_IO)) if (!(pci_rsc_desc->flags & FLG_IO))
{ {

View File

@@ -130,8 +130,10 @@ static int handle2index(int32_t handle)
{ {
int i; int i;
debug_printf("handle2int: handles[] is at %p\r\n", &handles[0]);
for (i = 0; i < NUM_CARDS; i++) for (i = 0; i < NUM_CARDS; i++)
{ {
debug_printf("handle2index: handles[%d] = %x (%x)\r\n", i, handles[i], handle);
if (handles[i] == handle) if (handles[i] == handle)
{ {
return i; return i;
@@ -361,11 +363,17 @@ void pci_print_device_config(int32_t handle)
struct pci_rd *pci_get_resource(int32_t handle) struct pci_rd *pci_get_resource(int32_t handle)
{ {
int index = -1; int index = -1;
struct pci_rd *ret;
index = handle2index(handle); index = handle2index(handle);
if (index == -1) if (index == -1)
return NULL; ret = NULL;
return resource_descriptors[index]; else
ret = &resource_descriptors[index][0];
debug_printf("pci_get_resource: resource struct for handle %lx (index %d) is at %p\r\n", handle, index, ret);
return ret;
} }
/* /*
@@ -465,7 +473,7 @@ int32_t pci_unhook_interrupt(int32_t handle)
static void pci_device_config(uint16_t bus, uint16_t device, uint16_t function) static void pci_device_config(uint16_t bus, uint16_t device, uint16_t function)
{ {
uint32_t address; uint32_t address;
uint16_t handle; int32_t handle;
int16_t index = - 1; int16_t index = - 1;
struct pci_rd *descriptors; struct pci_rd *descriptors;
int i; int i;