From 3bf8683bc444763f0bc7162ee10a3238fc759703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Thu, 2 Jan 2014 13:16:50 +0000 Subject: [PATCH] removed unused code --- pci/pci.c | 52 ++++++---------------------------------------------- 1 file changed, 6 insertions(+), 46 deletions(-) diff --git a/pci/pci.c b/pci/pci.c index 97a250a..fc93095 100644 --- a/pci/pci.c +++ b/pci/pci.c @@ -40,11 +40,7 @@ #define dbg(format, arg...) do { ; } while (0) #endif /* DEBUG_PCI */ -//#if MACHINE_FIREBEE -//#define pci_config_wait() wait(40000); /* FireBee USB not properly detected otherwise !?? */ -//#elif MACHINE_M5484LITE #define pci_config_wait() do { __asm__ __volatile("tpf" ::: "memory"); } while (0) -//#endif /* * PCI device class descriptions displayed during PCI bus scan @@ -636,11 +632,6 @@ static void pci_device_config(uint16_t bus, uint16_t device, uint16_t function) descriptors = resource_descriptors[index]; for (i = 0; i < 6 * 4; i += 4) /* for all bars */ { - /* - * read BAR[i] value (FIXME: no need to do this, actually, this will contain no meaningful value anyway) - */ - value = swpl(pci_read_config_longword(handle, PCIBAR0 + i)); - /* * write all bits of BAR[i] */ @@ -924,7 +915,6 @@ void init_pci(void) init_xlbus_arbiter(); MCF_PCI_PCIGSCR = 1; /* reset PCI */ - wait(400000); /* give devices a chance to come up */ /* * setup the PCI arbiter @@ -1002,7 +992,6 @@ void init_pci(void) MCF_PCI_PCIGSCR &= ~MCF_PCI_PCIGSCR_PR; do {;} while (MCF_PCI_PCIGSCR & MCF_PCI_PCIGSCR_PR); /* wait until reset finished */ xprintf("finished\r\n"); - wait(400000); /* give devices a chance to come up */ /* initialize/clear resource descriptor table */ memset(&resource_descriptors, 0, NUM_CARDS * NUM_RESOURCES * sizeof(struct pci_rd)); @@ -1011,45 +1000,16 @@ void init_pci(void) /* initialize/clear interrupts array */ memset(interrupts, 0, MAX_INTERRUPTS * sizeof(struct pci_interrupt)); + /* + * give devices a chance to come up befor attempting to configure them, + * necessary to properly detect the FireBee USB chip + */ + wait(400000); + /* * do normal initialization */ pci_scan(); - - -#ifdef _NOT_USED_ - - int index = 0; - int handle; - handle = pci_find_device(0x0, 0xFFFF, ++index); - while (handle > 0) - { - uint32_t value; - uint32_t addr; - - value = pci_read_config_longword(handle, PCIIDR); - xprintf(" %02x | %02x | %02x |%04x|%04x|%04x| %s (0x%02x)\r\n", - PCI_BUS_FROM_HANDLE(handle), - PCI_DEVICE_FROM_HANDLE(handle), - PCI_FUNCTION_FROM_HANDLE(handle), - PCI_VENDOR_ID(value), PCI_DEVICE_ID(value), - handle, - device_class(pci_read_config_byte(handle, PCICCR)), - pci_read_config_byte(handle, PCICCR)); - - pci_print_device_abilities(handle); - pci_print_device_config(handle); - - /* read some value from PCIBAR0 */ - addr = swpl(pci_read_config_longword(handle, PCIBAR0)) & ~0x1f; - xprintf("%p = %08x\r\n", addr, * (uint32_t *) addr); - - pci_print_device_abilities(handle); - pci_print_device_config(handle); - - handle = pci_find_device(0x0, 0xFFFF, ++index); - } -#endif /* _NOT_USED_ */ }