summaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/usrp2
diff options
context:
space:
mode:
authorNick Foster <nick@nerdnetworks.org>2010-11-10 12:15:35 -0800
committerNick Foster <nick@nerdnetworks.org>2010-11-10 12:15:35 -0800
commitfb0cdbc553d288402ee7939dc72f4368eb9e8e1b (patch)
treee20003155af08428448a7834a82d259f3b68717d /firmware/microblaze/usrp2
parent8fe1e7b29aacce7f75ae36e81706bbde02749b97 (diff)
parent8c434f7d63aca25b55d6d13dffcc1d7037261d4f (diff)
downloaduhd-fb0cdbc553d288402ee7939dc72f4368eb9e8e1b.tar.gz
uhd-fb0cdbc553d288402ee7939dc72f4368eb9e8e1b.tar.bz2
uhd-fb0cdbc553d288402ee7939dc72f4368eb9e8e1b.zip
Merge branch 'master' of ettus.sourcerepo.com:ettus/uhdpriv into usrp2p-next
Conflicts: firmware/microblaze/lib/u2_init.c host/lib/usrp/usrp2/clock_ctrl.cpp host/lib/usrp/usrp2/fw_common.h host/lib/usrp/usrp2/mboard_impl.cpp host/lib/usrp/usrp2/usrp2_iface.cpp host/lib/usrp/usrp2/usrp2_iface.hpp
Diffstat (limited to 'firmware/microblaze/usrp2')
-rw-r--r--firmware/microblaze/usrp2/Makefile.am2
-rw-r--r--firmware/microblaze/usrp2/ethernet.c99
2 files changed, 2 insertions, 99 deletions
diff --git a/firmware/microblaze/usrp2/Makefile.am b/firmware/microblaze/usrp2/Makefile.am
index e3f57728a..7a58e7253 100644
--- a/firmware/microblaze/usrp2/Makefile.am
+++ b/firmware/microblaze/usrp2/Makefile.am
@@ -27,6 +27,8 @@ AM_LDFLAGS = \
LDADD = libusrp2.a
+LDADD = libusrp2.a
+
########################################################################
# USRP2 specific library and programs
########################################################################
diff --git a/firmware/microblaze/usrp2/ethernet.c b/firmware/microblaze/usrp2/ethernet.c
index d60d7dc4c..5d4654bda 100644
--- a/firmware/microblaze/usrp2/ethernet.c
+++ b/firmware/microblaze/usrp2/ethernet.c
@@ -16,16 +16,12 @@
*/
#include "ethernet.h"
-#include "memory_map.h"
#include "eth_phy.h"
#include "eth_mac.h"
#include "eth_mac_regs.h"
#include "pic.h"
#include "hal_io.h"
#include "nonstdio.h"
-#include <stdbool.h>
-#include "i2c.h"
-#include "usrp2/fw_common.h"
#define VERBOSE 1
@@ -269,101 +265,6 @@ ethernet_init(void)
eth_mac_miim_write(PHY_CTRL, t | MII_CR_RESTART_AUTO_NEG);
}
-static bool
-unprogrammed(const void *t, size_t len)
-{
- int i;
- uint8_t *p = (uint8_t *)t;
- bool all_zeros = true;
- bool all_ones = true;
- for (i = 0; i < len; i++){
- all_zeros &= p[i] == 0x00;
- all_ones &= p[i] == 0xff;
- }
- return all_ones | all_zeros;
-}
-
-//////////////////// MAC Addr Stuff ///////////////////////
-
-static int8_t src_mac_addr_initialized = false;
-static eth_mac_addr_t src_mac_addr = {{
- 0x00, 0x50, 0xC2, 0x85, 0x3f, 0xff
- }};
-
-const eth_mac_addr_t *
-ethernet_mac_addr(void)
-{
- if (!src_mac_addr_initialized){ // fetch from eeprom
- src_mac_addr_initialized = true;
-
- // if we're simulating, don't read the EEPROM model, it's REALLY slow
- if (hwconfig_simulation_p())
- return &src_mac_addr;
-
- eth_mac_addr_t tmp;
- bool ok = eeprom_read(USRP2_I2C_ADDR_MBOARD, USRP2_EE_MBOARD_MAC_ADDR, &tmp, sizeof(tmp));
- if (!ok || unprogrammed(&tmp, sizeof(tmp))){
- // use the default
- }
- else
- src_mac_addr = tmp;
- }
-
- return &src_mac_addr;
-}
-
-bool
-ethernet_set_mac_addr(const eth_mac_addr_t *t)
-{
- bool ok = eeprom_write(USRP2_I2C_ADDR_MBOARD, USRP2_EE_MBOARD_MAC_ADDR, t, sizeof(eth_mac_addr_t));
- if (ok){
- src_mac_addr = *t;
- src_mac_addr_initialized = true;
- //eth_mac_set_addr(t); //this breaks the link
- }
-
- return ok;
-}
-
-//////////////////// IP Addr Stuff ///////////////////////
-
-static int8_t src_ip_addr_initialized = false;
-static struct ip_addr src_ip_addr = {
- (192 << 24 | 168 << 16 | 10 << 8 | 2 << 0)
-};
-
-
-const struct ip_addr *get_ip_addr(void)
-{
- if (!src_ip_addr_initialized){ // fetch from eeprom
- src_ip_addr_initialized = true;
-
- // if we're simulating, don't read the EEPROM model, it's REALLY slow
- if (hwconfig_simulation_p())
- return &src_ip_addr;
-
- struct ip_addr tmp;
- bool ok = eeprom_read(USRP2_I2C_ADDR_MBOARD, USRP2_EE_MBOARD_IP_ADDR, &tmp, sizeof(tmp));
- if (!ok || unprogrammed(&tmp, sizeof(tmp))){
- // use the default
- }
- else
- src_ip_addr = tmp;
- }
-
- return &src_ip_addr;
-}
-
-bool set_ip_addr(const struct ip_addr *t){
- bool ok = eeprom_write(USRP2_I2C_ADDR_MBOARD, USRP2_EE_MBOARD_IP_ADDR, t, sizeof(struct ip_addr));
- if (ok){
- src_ip_addr = *t;
- src_ip_addr_initialized = true;
- }
-
- return ok;
-}
-
int
ethernet_check_errors(void)
{