dde_ipxe: use recent iPXE upstream version

Currently, we support the following NIC families:

- Intel gigabit ethernet (e1000, e1000e, igb)
- Intel eepro100
- Realtek 8139/8169

Fixes #423.
This commit is contained in:
Christian Helmuth 2012-10-22 15:15:40 +02:00
parent d54304ddfc
commit d0a68f055f
6 changed files with 45 additions and 46 deletions

View File

@ -8,7 +8,7 @@
VERBOSE ?= @
ECHO = @echo
GIT_URL = git://git.ipxe.org/ipxe.git
GIT_REV = 174df77359f22f3be2169e9bb04e8018015b5e94
GIT_REV = 34a81da0c8dd47628a7408cd3f8d8a926d1ecbee
CONTRIB_DIR = contrib
PATCH_FILE = patches/dde_ipxe.patch
@ -37,7 +37,10 @@ help:
$(CONTRIB_DIR)/.git:
$(VERBOSE)git clone $(GIT_URL) $(CONTRIB_DIR)
prepare: $(CONTRIB_DIR)/.git clean
fetch: $(CONTRIB_DIR)/.git
$(VERBOSE)cd $(CONTRIB_DIR); git fetch origin
prepare: fetch clean
$(ECHO) "apply patch to '$(CONTRIB_DIR)/'"
$(VERBOSE)patch -p1 -d $(CONTRIB_DIR) -i $(realpath $(PATCH_FILE))
$(ECHO)
@ -60,3 +63,5 @@ clean:
cleanall:
$(VERBOSE)rm -rf $(CONTRIB_DIR)
.PHONY: cleanall clean update-patch prepare fetch help

View File

@ -5,20 +5,14 @@ LIBS = dde_kit dde_ipxe_support
SRC_C = nic.c dde.c dummies.c
SRC_C += $(addprefix core/, iobuf.c string.c)
SRC_C += $(addprefix core/, iobuf.c string.c bitops.c)
SRC_C += $(addprefix arch/x86/core/, x86_string.c)
SRC_C += $(addprefix arch/i386/core/, rdtsc_timer.c)
SRC_C += $(addprefix net/, ethernet.c netdevice.c nullnet.c eth_slow.c)
SRC_C += $(addprefix net/, ethernet.c netdevice.c nullnet.c eth_slow.c iobpad.c)
SRC_C += $(addprefix drivers/bus/, pciextra.c)
SRC_C += $(addprefix drivers/net/, pcnet32.c) # TODO rtl8139.c eepro100.c virtio-net.c ns8390.c
SRC_C += $(addprefix drivers/net/e1000/, \
e1000.c e1000_82540.c e1000_82541.c e1000_82542.c e1000_82543.c \
e1000_api.c e1000_mac.c e1000_main.c e1000_manage.c e1000_nvm.c \
e1000_phy.c)
SRC_C += $(addprefix drivers/net/e1000e/, \
e1000e.c e1000e_80003es2lan.c e1000e_82571.c e1000e_ich8lan.c \
e1000e_mac.c e1000e_main.c e1000e_manage.c e1000e_nvm.c \
e1000e_phy.c)
SRC_C += $(addprefix drivers/bitbash/, bitbash.c spi_bit.c)
SRC_C += $(addprefix drivers/nvs/, nvs.c threewire.c)
SRC_C += $(addprefix drivers/net/, pcnet32.c intel.c eepro100.c realtek.c mii.c)
INC_DIR += $(LIB_DIR)/include \
$(CONTRIB_DIR)/include $(CONTRIB_DIR) \
@ -35,10 +29,7 @@ CC_OPT += -DARCH=i386 -DPLATFORM=pcbios -include compiler.h -DOBJECT=$(notdir $(
# 'level' may be one of 1, 3, 7.
#
CC_OPT += -Ddebug_lib=7
#CC_OPT += -Ddebug_e1000_main=7 -Ddebug_e1000_82540=7 -Ddebug_netdevice=7
#CC_OPT += -Ddebug_e1000=7 -Ddebug_e1000_82540=7 -Ddebug_e1000_api=7
#CC_OPT += -Ddebug_e1000_main=7 -Ddebug_e1000_manage=7
#CC_OPT += -Ddebug_e1000_phy=7
#CC_OPT += -Ddebug_intel=7
#CC_OPT += -Ddebug_netdevice=7

View File

@ -15,10 +15,10 @@ index 472e140..d5095a7 100644
: "=a" ( ticks ) : "i" ( TSC_SHIFT ) : "edx" );
return ticks;
diff --git a/src/include/assert.h b/src/include/assert.h
index 40a00a2..8bae55c 100644
index 655cbdc..a8016c8 100644
--- a/src/include/assert.h
+++ b/src/include/assert.h
@@ -29,7 +29,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
@@ -31,7 +31,7 @@ extern unsigned int assertion_failures;
* to the printf symbol.
*/
extern int __attribute__ (( format ( printf, 1, 2 ) ))
@ -28,15 +28,15 @@ index 40a00a2..8bae55c 100644
/**
* Assert a condition at run-time.
diff --git a/src/include/compiler.h b/src/include/compiler.h
index feea516..d5163b6 100644
index ed9af23..e8c62d7 100644
--- a/src/include/compiler.h
+++ b/src/include/compiler.h
@@ -271,7 +271,7 @@ REQUEST_EXPANDED ( CONFIG_SYMBOL );
* to the printf symbol.
*/
extern int __attribute__ (( format ( printf, 1, 2 ) ))
-dbg_printf ( const char *fmt, ... ) asm ( "printf" );
+dbg_printf ( const char *fmt, ... ) asm ( "ipxe_printf" );
@@ -262,7 +262,7 @@ REQUEST_EXPANDED ( CONFIG_SYMBOL );
/** printf() for debugging */
extern void __attribute__ (( format ( printf, 1, 2 ) ))
-dbg_printf ( const char *fmt, ... );
+dbg_printf ( const char *fmt, ... ) asm ( "ipxe_printf" );
extern void dbg_autocolourise ( unsigned long id );
extern void dbg_decolourise ( void );
extern void dbg_hex_dump_da ( unsigned long dispaddr,

View File

@ -15,15 +15,10 @@
int snprintf(char *buf, __SIZE_TYPE__ size, const char *fmt, ...) { TRACE; return 0; }
void clear_settings() { TRACE; }
void clear_settings() { TRACE; }
void netdev_settings_operations() { TRACE; }
void dbg_autocolourise(unsigned long id) { }
void dbg_decolourise() { }
void strerror() { TRACE; }
/* for eepro100.c */
void init_spi_bit_basher() { TRACE; }
void nvs_read() { TRACE; }
void threewire_detect_address_len() { TRACE; }
void threewire_read() { TRACE; }
void threewire_write() { TRACE; }
/* for drivers/net/realtek.c */
void nvo_init() { TRACE; }
void register_nvo() { TRACE; }
void unregister_nvo() { TRACE; }

View File

@ -36,6 +36,12 @@ static inline void outl(uint32_t data, volatile uint32_t *io_addr)
}
static inline uint8_t readb(volatile uint8_t *io_addr)
{
return *io_addr;
}
static inline uint16_t readw(volatile uint16_t *io_addr)
{
return *io_addr;
@ -48,6 +54,12 @@ static inline uint32_t readl(volatile uint32_t *io_addr)
}
static inline void writeb(uint8_t data, volatile uint8_t *io_addr)
{
*io_addr = data;
}
static inline void writew(uint16_t data, volatile uint16_t *io_addr)
{
*io_addr = data;

View File

@ -55,22 +55,18 @@ static dde_ipxe_nic_rx_cb rx_callback;
* Known iPXE driver structures (located in the driver binaries)
*/
extern struct pci_driver
e1000_82540_driver, e1000_82541_driver, e1000_82542_driver, e1000_82543_driver,
e1000e_80003es2lan_driver, e1000e_82571_driver, e1000e_ich8lan_driver,
// ifec_driver,
// rtl8139_driver,
// nepci_driver,
realtek_driver,
ifec_driver,
intel_driver,
pcnet32_driver;
/**
* Driver database (used for probing)
*/
static struct pci_driver *pci_drivers[] = {
&e1000_82540_driver, &e1000_82541_driver, &e1000_82542_driver, &e1000_82543_driver,
&e1000e_80003es2lan_driver, &e1000e_82571_driver, &e1000e_ich8lan_driver,
// &ifec_driver,
// &rtl8139_driver,
// &nepci_driver,
&realtek_driver,
&ifec_driver,
&intel_driver,
&pcnet32_driver
};