summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rwxr-xr-xdrivers/Makefile29
-rw-r--r--drivers/ds1722.c4
-rw-r--r--drivers/fsl_pci_init.c8
-rw-r--r--drivers/mw_eeprom.c4
-rw-r--r--drivers/ne2000.c38
-rw-r--r--drivers/ne2000.h2
6 files changed, 38 insertions, 47 deletions
diff --git a/drivers/Makefile b/drivers/Makefile
index 1889698bca..d19588f3af 100755
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -1,5 +1,5 @@
#
-# (C) Copyright 2000-2006
+# (C) Copyright 2000-2007
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
@@ -27,34 +27,33 @@ include $(TOPDIR)/config.mk
LIB = $(obj)libdrivers.a
-COBJS = 3c589.o 5701rls.o ali512x.o at45.o ata_piix.o atmel_usart.o \
+COBJS = 3c589.o 5701rls.o ali512x.o at45.o ata_piix.o \
+ ati_radeon_fb.o atmel_usart.o \
bcm570x.o bcm570x_autoneg.o cfb_console.o cfi_flash.o \
cs8900.o ct69000.o dataflash.o dc2114x.o dm9000x.o \
- e1000.o eepro100.o enc28j60.o \
- i8042.o inca-ip_sw.o isp116x-hcd.o keyboard.o \
- lan91c96.o macb.o \
+ ds1722.o e1000.o eepro100.o enc28j60.o \
+ fsl_i2c.o fsl_pci_init.o \
+ i8042.o inca-ip_sw.o isp116x-hcd.o \
+ keyboard.o ks8695eth.o \
+ lan91c96.o macb.o mpc8xx_pcmcia.o mw_eeprom.o \
natsemi.o ne2000.o netarm_eth.o netconsole.o \
ns16550.o ns8382x.o ns87308.o ns7520_eth.o omap1510_i2c.o \
- omap24xx_i2c.o pci.o pci_auto.o pci_indirect.o \
- pcnet.o plb2800_eth.o \
- ps2ser.o ps2mult.o pc_keyb.o \
- rtl8019.o rtl8139.o rtl8169.o \
+ omap24xx_i2c.o pc_keyb.o \
+ pci.o pci_auto.o pci_indirect.o \
+ pcnet.o plb2800_eth.o ps2ser.o ps2mult.o pxa_pcmcia.o \
+ rpx_pcmcia.o rtl8019.o rtl8139.o rtl8169.o \
s3c4510b_eth.o s3c4510b_uart.o \
sed13806.o sed156x.o \
serial.o serial_max3100.o \
serial_xuartlite.o \
sil680.o sl811_usb.o sm501.o smc91111.o smiLynxEM.o \
status_led.o sym53c8xx.o systemace.o ahci.o \
- ti_pci1410a.o tigon3.o tsec.o \
+ ti_pci1410a.o tigon3.o tqm8xx_pcmcia.o tsec.o \
tsi108_eth.o tsi108_i2c.o tsi108_pci.o \
usb_ohci.o \
usbdcore.o usbdcore_ep0.o usbdcore_mpc8xx.o usbdcore_omap1510.o \
usbtty.o \
- videomodes.o w83c553f.o \
- ks8695eth.o \
- pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o \
- rpx_pcmcia.o \
- fsl_i2c.o fsl_pci_init.o ati_radeon_fb.o
+ videomodes.o w83c553f.o
SRCS := $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS))
diff --git a/drivers/ds1722.c b/drivers/ds1722.c
index 227d8169a5..c19ee01393 100644
--- a/drivers/ds1722.c
+++ b/drivers/ds1722.c
@@ -1,10 +1,10 @@
#include <common.h>
-#include <ssi.h>
-
#ifdef CONFIG_DS1722
+#include <ssi.h>
+
static void ds1722_select(int dev)
{
ssi_set_interface(4096, 0, 0, 0);
diff --git a/drivers/fsl_pci_init.c b/drivers/fsl_pci_init.c
index 3a13eea1f2..1e778844a5 100644
--- a/drivers/fsl_pci_init.c
+++ b/drivers/fsl_pci_init.c
@@ -54,6 +54,7 @@ fsl_pci_init(struct pci_controller *hose)
u8 temp8;
int r;
int bridge;
+ int inbound = 0;
volatile ccsr_fsl_pci_t *pci = (ccsr_fsl_pci_t *) hose->cfg_addr;
pci_dev_t dev = PCI_BDF(busno,0,0);
@@ -74,6 +75,7 @@ fsl_pci_init(struct pci_controller *hose)
PIWAR_READ_SNOOP | PIWAR_WRITE_SNOOP |
(__ilog2(hose->regions[r].size) - 1);
pi++;
+ inbound = hose->regions[r].size > 0;
} else { /* Outbound */
po->powbar = (hose->regions[r].phys_start >> 12) & 0x000fffff;
po->potar = (hose->regions[r].bus_start >> 12) & 0x000fffff;
@@ -138,6 +140,12 @@ fsl_pci_init(struct pci_controller *hose)
pciauto_setup_device(hose, dev, 0, hose->pci_mem,
hose->pci_prefetch, hose->pci_io);
+ if (inbound) {
+ pci_hose_read_config_word(hose, dev, PCI_COMMAND, &temp16);
+ pci_hose_write_config_word(hose, dev, PCI_COMMAND,
+ temp16 | PCI_COMMAND_MEMORY);
+ }
+
#ifndef CONFIG_PCI_NOSCAN
printf (" Scanning PCI bus %02x\n", hose->current_busno);
hose->last_busno = pci_hose_scan_bus(hose,hose->current_busno);
diff --git a/drivers/mw_eeprom.c b/drivers/mw_eeprom.c
index 2a1f489842..2b3348810d 100644
--- a/drivers/mw_eeprom.c
+++ b/drivers/mw_eeprom.c
@@ -1,11 +1,11 @@
/* Three-wire (MicroWire) serial eeprom driver (for 93C46 and compatibles) */
#include <common.h>
-#include <ssi.h>
-
#ifdef CONFIG_MW_EEPROM
+#include <ssi.h>
+
/*
* Serial EEPROM opcodes, including start bit
*/
diff --git a/drivers/ne2000.c b/drivers/ne2000.c
index b7ed876165..695a1dc6c9 100644
--- a/drivers/ne2000.c
+++ b/drivers/ne2000.c
@@ -745,17 +745,15 @@ static void pcnet_reset_8390(void)
PRINTK("nic base is %lx\n", nic_base);
-#if 1
n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
PRINTK("cmd (at %lx) is %x\n", nic_base+ E8390_CMD, n2k_inb(E8390_CMD));
n2k_outb(E8390_NODMA+E8390_PAGE1+E8390_STOP, E8390_CMD);
PRINTK("cmd (at %lx) is %x\n", nic_base+ E8390_CMD, n2k_inb(E8390_CMD));
n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
PRINTK("cmd (at %lx) is %x\n", nic_base+ E8390_CMD, n2k_inb(E8390_CMD));
-#endif
n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
- n2k_outb(n2k_inb(nic_base + PCNET_RESET), PCNET_RESET);
+ n2k_outb(n2k_inb(PCNET_RESET), PCNET_RESET);
for (i = 0; i < 100; i++) {
if ((r = (n2k_inb(EN0_ISR) & ENISR_RESET)) != 0)
@@ -833,6 +831,7 @@ static int plen[NB];
static int nrx = 0;
static int pkey = -1;
+static int initialized=0;
void uboot_push_packet_len(int len) {
PRINTK("pushed len = %d, nrx = %d\n", len, nrx);
@@ -846,7 +845,9 @@ void uboot_push_packet_len(int len) {
}
plen[nrx] = len;
dp83902a_recv(&pbuf[nrx*2000], len);
- nrx++;
+
+ /*Just pass it to the upper layer*/
+ NetReceive(&pbuf[nrx*2000], plen[nrx]);
}
void uboot_push_tx_done(int key, int val) {
@@ -903,37 +904,21 @@ int eth_init(bd_t *bd) {
if (dp83902a_init() == false)
return -1;
dp83902a_start(dev_addr);
+ initialized=1;
return 0;
}
void eth_halt() {
PRINTK("### eth_halt\n");
-
- dp83902a_stop();
+ if(initialized)
+ dp83902a_stop();
+ initialized=0;
}
int eth_rx() {
- int j, tmo;
-
- PRINTK("### eth_rx\n");
-
- tmo = get_timer (0) + TOUT * CFG_HZ;
- while(1) {
- dp83902a_poll();
- if (nrx > 0) {
- for(j=0; j<nrx; j++) {
- NetReceive(&pbuf[j*2000], plen[j]);
- }
- nrx = 0;
- return 1;
- }
- if (get_timer (0) >= tmo) {
- printf("timeout during rx\n");
- return 0;
- }
- }
- return 0;
+dp83902a_poll();
+return 1;
}
int eth_send(volatile void *packet, int length) {
@@ -959,5 +944,4 @@ int eth_send(volatile void *packet, int length) {
}
return 0;
}
-
#endif
diff --git a/drivers/ne2000.h b/drivers/ne2000.h
index 2955533d7a..c13d9f0bbb 100644
--- a/drivers/ne2000.h
+++ b/drivers/ne2000.h
@@ -42,7 +42,7 @@ are GPL, so this is, of course, GPL.
this file might be covered by the GNU General Public License.
Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
- at http://sources.redhat.com/ecos/ecos-license/ */
+ at http://sources.redhat.com/ecos/ecos-license/
-------------------------------------------
####ECOSGPLCOPYRIGHTEND####
####BSDCOPYRIGHTBEGIN####
OpenPOWER on IntegriCloud