bumped stack to 3k (not sure we needed to), cleaned up old serdes test
authoreb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 22 Jan 2009 18:29:24 +0000 (18:29 +0000)
committereb <eb@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 22 Jan 2009 18:29:24 +0000 (18:29 +0000)
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

usrp2/firmware/Makefile.common
usrp2/firmware/apps/app_common_v2.c
usrp2/firmware/apps/app_passthru_v2.c
usrp2/firmware/apps/eth_serdes.c
usrp2/firmware/apps/serdes_txrx.c
usrp2/firmware/config/grc_usrp2_firmware.m4
usrp2/firmware/configure.gnu
usrp2/firmware/lib/Makefile.am
usrp2/firmware/lib/memory_map.h

index c51c595c0565414f65fcc029da04667b287ae928..b90696feab2a49dd4d1e432a2edd9477a8e07fa6 100644 (file)
@@ -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 $< $@
index c498d30089c67ea426de12f334a468f6fc4767ab..9f5fd94f1764b3688efd260c6d21a5e2388f30a7 100644 (file)
@@ -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);
 }
 
index 1689e8b77e97651a2627e70a88702d8641e020c2..660bcd774fafeb4a6992386c21f12b047cb6a607 100644 (file)
@@ -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);
 }
index c47b8ebd050018fbdb9170617d3c54c2b459f982..0286f0c1f784a12601b46b13a16e28f41dc6fdbc 100644 (file)
@@ -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);
index 3112829ab7cd73dc1dc2cb2026509b2dd96486f8..1becc205ec52809ad604fa9502c73230936b69af 100644 (file)
@@ -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){
index 6832c42f4bb4175a8858b6663a1a8d25ca549ee4..7f1f9a796dc0669be1c520cc0664c6fd117dd2db 100644 (file)
@@ -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])
 
 
index d220e18cc9fc187119775549787cb29856e8b49d..8a047199556f826f9a03c83799168f538aa6436d 100755 (executable)
@@ -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=*)    ;;
index fdfa2b712a6e3a27dd90969fd273d4d1dc667b39..854539c99289b70ad334081c1653b97e95185dcc 100644 (file)
@@ -90,6 +90,6 @@ noinst_HEADERS = \
        u2_init.h \
        usrp2_bytesex.h \
         wb16550.h
-        
+
 EXTRA_DIST = \
         microblaze.ld
index 756513b915f0944aaccd3f85c1847b72d201efa5..0519282bb2629f833f6f5a7970b7689aaf2e0a05 100644 (file)
@@ -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 ---