aboutsummaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-02-12 19:46:09 -0800
committerJosh Blum <josh@joshknows.com>2010-02-12 19:46:09 -0800
commit51e5396079d8af7cf8287b586ff2351a19ae8381 (patch)
tree166c580e317aff50cb00eb840cc05124aad04161 /firmware
parent259f5babf1e1bc1595ad54c6588c1ff5117dc2e3 (diff)
downloaduhd-51e5396079d8af7cf8287b586ff2351a19ae8381.tar.gz
uhd-51e5396079d8af7cf8287b586ff2351a19ae8381.tar.bz2
uhd-51e5396079d8af7cf8287b586ff2351a19ae8381.zip
Reading the dboard ids from the usrp2.
Diffstat (limited to 'firmware')
-rw-r--r--firmware/microblaze/apps/txrx.c7
-rw-r--r--firmware/microblaze/lib/db.h2
-rw-r--r--firmware/microblaze/lib/db_init.c1
3 files changed, 9 insertions, 1 deletions
diff --git a/firmware/microblaze/apps/txrx.c b/firmware/microblaze/apps/txrx.c
index 2cc414f02..8e71f2d8e 100644
--- a/firmware/microblaze/apps/txrx.c
+++ b/firmware/microblaze/apps/txrx.c
@@ -43,6 +43,7 @@
#include "clocks.h"
#include <vrt/bits.h>
#include "usrp2_fw_common.h"
+#include <db.h>
#define FW_SETS_SEQNO 1 // define to 0 or 1 (FIXME must be 1 for now)
@@ -187,6 +188,12 @@ void handle_udp_ctrl_packet(
memcpy(&ctrl_data_out.data.mac_addr, &mac_addr, sizeof(mac_addr));
break;
+ case USRP2_CTRL_ID_GIVE_ME_YOUR_DBOARD_IDS_BRO:
+ ctrl_data_out.id = USRP2_CTRL_ID_THESE_ARE_MY_DBOARD_IDS_DUDE;
+ ctrl_data_out.data.dboard_ids.tx_id = read_dboard_eeprom(I2C_ADDR_TX_A);
+ ctrl_data_out.data.dboard_ids.rx_id = read_dboard_eeprom(I2C_ADDR_RX_A);
+ break;
+
default:
ctrl_data_out.id = USRP2_CTRL_ID_HUH_WHAT;
diff --git a/firmware/microblaze/lib/db.h b/firmware/microblaze/lib/db.h
index cec960267..9cd0b379a 100644
--- a/firmware/microblaze/lib/db.h
+++ b/firmware/microblaze/lib/db.h
@@ -24,7 +24,9 @@
#define INCLUDED_DB_H
#include <usrp2_types.h>
+#include <usrp2_i2c_addr.h>
+int read_dboard_eeprom(int i2c_addr);
struct db_base;
diff --git a/firmware/microblaze/lib/db_init.c b/firmware/microblaze/lib/db_init.c
index 537078fb6..4d6081cbc 100644
--- a/firmware/microblaze/lib/db_init.c
+++ b/firmware/microblaze/lib/db_init.c
@@ -21,7 +21,6 @@
#include <memory_map.h>
#include <i2c.h>
-#include <usrp2_i2c_addr.h>
#include <string.h>
#include <stdio.h>
#include <db.h>