summaryrefslogtreecommitdiff
path: root/usrp2
diff options
context:
space:
mode:
authoreb2009-01-22 18:29:24 +0000
committereb2009-01-22 18:29:24 +0000
commit1545a741acca4ee45e8cfd889d9152f5db57bd1b (patch)
tree524c57064819185bad56ad33e1c5ed0adc74368f /usrp2
parentf5fdfe3342750df3092bd0a8d39cb42b4d599012 (diff)
downloadgnuradio-1545a741acca4ee45e8cfd889d9152f5db57bd1b.tar.gz
gnuradio-1545a741acca4ee45e8cfd889d9152f5db57bd1b.tar.bz2
gnuradio-1545a741acca4ee45e8cfd889d9152f5db57bd1b.zip
bumped stack to 3k (not sure we needed to), cleaned up old serdes test
code: eth_serdes.c and serdes_txrx.c, can tx over serdes at interp 4 (underruns quite frequently), same behavior as regular txrx.c git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10291 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp2')
-rw-r--r--usrp2/firmware/Makefile.common5
-rw-r--r--usrp2/firmware/apps/app_common_v2.c4
-rw-r--r--usrp2/firmware/apps/app_passthru_v2.c8
-rw-r--r--usrp2/firmware/apps/eth_serdes.c3
-rw-r--r--usrp2/firmware/apps/serdes_txrx.c28
-rw-r--r--usrp2/firmware/config/grc_usrp2_firmware.m41
-rwxr-xr-xusrp2/firmware/configure.gnu5
-rw-r--r--usrp2/firmware/lib/Makefile.am2
-rw-r--r--usrp2/firmware/lib/memory_map.h10
9 files changed, 55 insertions, 11 deletions
diff --git a/usrp2/firmware/Makefile.common b/usrp2/firmware/Makefile.common
index c51c595c0..b90696fea 100644
--- a/usrp2/firmware/Makefile.common
+++ b/usrp2/firmware/Makefile.common
@@ -33,8 +33,9 @@ AM_CFLAGS = $(STD_CFLAGS) -mxl-soft-mul -mxl-barrel-shift
#AM_LDFLAGS = -Wl,-T,$(LINKER_SCRIPT) -Wl,-defsym -Wl,_STACK_SIZE=1024
#AM_LDFLAGS = -Wl,-T,$(LINKER_SCRIPT) -Wl,-Map -Wl,$@.map
#AM_LDFLAGS = -Wl,-T,$(LINKER_SCRIPT)
-#AM_LDFLAGS = -Wl,-Map -Wl,$@.map -Wl,-defsym -Wl,_STACK_SIZE=2048
-AM_LDFLAGS = -Wl,-defsym -Wl,_STACK_SIZE=2048
+AM_LDFLAGS = -Wl,-Map -Wl,$@.map -Wl,-defsym -Wl,_STACK_SIZE=3072
+#AM_LDFLAGS = -Wl,-defsym -Wl,_STACK_SIZE=2048
+
%.bin : %
mb-objcopy -O binary $< $@
diff --git a/usrp2/firmware/apps/app_common_v2.c b/usrp2/firmware/apps/app_common_v2.c
index c498d3008..9f5fd94f1 100644
--- a/usrp2/firmware/apps/app_common_v2.c
+++ b/usrp2/firmware/apps/app_common_v2.c
@@ -422,6 +422,8 @@ handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len)
const op_generic_t *gp = (const op_generic_t *) payload;
subpktlen = 0;
+ // printf("\nopcode = %d\n", gp->opcode);
+
switch(gp->opcode){
case OP_EOP: // end of subpackets
goto end_of_subpackets;
@@ -568,7 +570,7 @@ void
link_changed_callback(int speed)
{
link_is_up = speed != 0;
- hal_set_leds(link_is_up ? 0x20 : 0x0, 0x20);
+ hal_set_leds(link_is_up ? LED_RJ45 : 0x0, LED_RJ45);
printf("\neth link changed: speed = %d\n", speed);
}
diff --git a/usrp2/firmware/apps/app_passthru_v2.c b/usrp2/firmware/apps/app_passthru_v2.c
index 1689e8b77..660bcd774 100644
--- a/usrp2/firmware/apps/app_passthru_v2.c
+++ b/usrp2/firmware/apps/app_passthru_v2.c
@@ -153,6 +153,12 @@ handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len)
subpktlen = op_id_cmd(gp, reply_payload, reply_payload_space);
handled_it = true;
break;
+
+ default:
+ if (0){
+ printf("\npassing on %d\n", gp->opcode);
+ }
+ break;
}
int t = (gp->len + 3) & ~3; // bump to a multiple of 4
@@ -239,6 +245,6 @@ void
link_changed_callback(int speed)
{
link_is_up = speed != 0;
- hal_set_leds(link_is_up ? 0x10 : 0x0, 0x10);
+ hal_set_leds(link_is_up ? LED_RJ45 : 0x0, LED_RJ45);
printf("\neth link changed: speed = %d\n", speed);
}
diff --git a/usrp2/firmware/apps/eth_serdes.c b/usrp2/firmware/apps/eth_serdes.c
index c47b8ebd0..0286f0c1f 100644
--- a/usrp2/firmware/apps/eth_serdes.c
+++ b/usrp2/firmware/apps/eth_serdes.c
@@ -168,6 +168,9 @@ main(void)
{
u2_init();
+ output_regs->led_src = 0x3; // h/w controls bottom two bits
+ clocks_enable_test_clk(true, 1);
+
putstr("\neth <-> serdes\n");
ethernet_register_link_changed_callback(link_changed_callback);
diff --git a/usrp2/firmware/apps/serdes_txrx.c b/usrp2/firmware/apps/serdes_txrx.c
index 3112829ab..1becc205e 100644
--- a/usrp2/firmware/apps/serdes_txrx.c
+++ b/usrp2/firmware/apps/serdes_txrx.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2009 Free Software Foundation, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -246,8 +246,15 @@ fw_sets_seqno_inspector(dbsm_t *sm, int buf_this) // returns false
inline static void
buffer_irq_handler(unsigned irq)
{
+ // hal_toggle_leds(LED_A);
+
uint32_t status = buffer_pool_status->status;
+ if (0 && (status & ~BPS_IDLE_ALL)){
+ putstr("status = ");
+ puthex32_nl(status);
+ }
+
dbsm_process_status(&dsp_tx_sm, status);
dbsm_process_status(&dsp_rx_sm, status);
}
@@ -257,22 +264,27 @@ main(void)
{
u2_init();
+ output_regs->led_src = 0x3; // h/w controls bottom two bits
+ clocks_enable_test_clk(true, 1);
+
putstr("\nSERDES TxRx\n");
cpu_tx_buf_dest_port = PORT_SERDES;
- ethernet_register_link_changed_callback(link_changed_callback);
- ethernet_init();
+ // ethernet_register_link_changed_callback(link_changed_callback);
+ // ethernet_init();
clocks_mimo_config(MC_WE_LOCK_TO_MIMO);
+ // puts("post clocks_mimo_config");
+
#if 0
// make bit 15 of Tx gpio's be a s/w output
hal_gpio_set_sel(GPIO_TX_BANK, 15, 's');
hal_gpio_set_ddr(GPIO_TX_BANK, 0x8000, 0x8000);
#endif
-#if 1
+#if 0
output_regs->debug_mux_ctrl = 1;
hal_gpio_set_sels(GPIO_TX_BANK, "0000000000000000");
hal_gpio_set_sels(GPIO_RX_BANK, "0000000000000000");
@@ -288,6 +300,8 @@ main(void)
eth_pkt_inspector);
+ //output_regs->flush_icache = 1;
+
// initialize double buffering state machine for DSP RX -> Ethernet
if (FW_SETS_SEQNO){
@@ -301,6 +315,8 @@ main(void)
dbsm_nop_inspector);
}
+ // puts("post dbsm_init's");
+
// tell app_common that this dbsm could be sending to the ethernet
ac_could_be_sending_to_eth = &dsp_rx_sm;
@@ -308,9 +324,13 @@ main(void)
// program tx registers
setup_tx();
+ // puts("post setup_tx");
+
// kick off the state machine
dbsm_start(&dsp_tx_sm);
+ // puts("post dbsm_start");
+
//int which = 0;
while(1){
diff --git a/usrp2/firmware/config/grc_usrp2_firmware.m4 b/usrp2/firmware/config/grc_usrp2_firmware.m4
index 6832c42f4..7f1f9a796 100644
--- a/usrp2/firmware/config/grc_usrp2_firmware.m4
+++ b/usrp2/firmware/config/grc_usrp2_firmware.m4
@@ -25,6 +25,7 @@ AC_DEFUN([GRC_USRP2_FIRMWARE],[
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_CPP])
+ AC_REQUIRE([AM_PROG_AS])
AC_REQUIRE([AC_PROG_RANLIB])
diff --git a/usrp2/firmware/configure.gnu b/usrp2/firmware/configure.gnu
index d220e18cc..8a0471995 100755
--- a/usrp2/firmware/configure.gnu
+++ b/usrp2/firmware/configure.gnu
@@ -3,7 +3,7 @@
# wrapper to setup cross-compilation of firmware
#
-for v in CC CPP CXX AR NM RANLIB STRIP F77 CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+for v in CC CPP CXX AS AR NM RANLIB STRIP F77 CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
do
unset $v
done
@@ -13,9 +13,10 @@ for t in "$@"
do
case "$t" in
(CC=*) ;;
- (CPP=*) ;;
+ (CPP=*) ;;
(CXX=*) ;;
(AR=*) ;;
+ (AS=*) ;;
(NM=*) ;;
(RANLIB=*) ;;
(STRIP=*) ;;
diff --git a/usrp2/firmware/lib/Makefile.am b/usrp2/firmware/lib/Makefile.am
index fdfa2b712..854539c99 100644
--- a/usrp2/firmware/lib/Makefile.am
+++ b/usrp2/firmware/lib/Makefile.am
@@ -90,6 +90,6 @@ noinst_HEADERS = \
u2_init.h \
usrp2_bytesex.h \
wb16550.h
-
+
EXTRA_DIST = \
microblaze.ld
diff --git a/usrp2/firmware/lib/memory_map.h b/usrp2/firmware/lib/memory_map.h
index 756513b91..0519282bb 100644
--- a/usrp2/firmware/lib/memory_map.h
+++ b/usrp2/firmware/lib/memory_map.h
@@ -366,6 +366,16 @@ typedef struct {
#define ADC_CTRL_ON 0x0F
#define ADC_CTRL_OFF 0x00
+// crazy order that matches the labels on the case
+
+#define LED_A (1 << 4)
+#define LED_B (1 << 1)
+#define LED_C (1 << 3)
+#define LED_D (1 << 0)
+#define LED_E (1 << 2)
+// LED_F // controlled by CPLD
+#define LED_RJ45 (1 << 5)
+
#define output_regs ((output_regs_t *) MISC_OUTPUT_BASE)
// --- dsp tx regs ---