commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10291 - in gnuradio/trunk/usrp2/firmware: . apps conf


From: eb
Subject: [Commit-gnuradio] r10291 - in gnuradio/trunk/usrp2/firmware: . apps config lib
Date: Thu, 22 Jan 2009 11:29:26 -0700 (MST)

Author: eb
Date: 2009-01-22 11:29:24 -0700 (Thu, 22 Jan 2009)
New Revision: 10291

Modified:
   gnuradio/trunk/usrp2/firmware/Makefile.common
   gnuradio/trunk/usrp2/firmware/apps/app_common_v2.c
   gnuradio/trunk/usrp2/firmware/apps/app_passthru_v2.c
   gnuradio/trunk/usrp2/firmware/apps/eth_serdes.c
   gnuradio/trunk/usrp2/firmware/apps/serdes_txrx.c
   gnuradio/trunk/usrp2/firmware/config/grc_usrp2_firmware.m4
   gnuradio/trunk/usrp2/firmware/configure.gnu
   gnuradio/trunk/usrp2/firmware/lib/Makefile.am
   gnuradio/trunk/usrp2/firmware/lib/memory_map.h
Log:
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


Modified: gnuradio/trunk/usrp2/firmware/Makefile.common
===================================================================
--- gnuradio/trunk/usrp2/firmware/Makefile.common       2009-01-22 18:23:45 UTC 
(rev 10290)
+++ gnuradio/trunk/usrp2/firmware/Makefile.common       2009-01-22 18:29:24 UTC 
(rev 10291)
@@ -33,9 +33,10 @@
 #AM_LDFLAGS = -Wl,-T,$(LINKER_SCRIPT) -Wl,-defsym -Wl,_STACK_SIZE=1024
 #AM_LDFLAGS = -Wl,-T,$(LINKER_SCRIPT) -Wl,-Map -Wl,address@hidden
 #AM_LDFLAGS = -Wl,-T,$(LINKER_SCRIPT)
-#AM_LDFLAGS = -Wl,-Map -Wl,address@hidden -Wl,-defsym -Wl,_STACK_SIZE=2048
-AM_LDFLAGS = -Wl,-defsym -Wl,_STACK_SIZE=2048
+AM_LDFLAGS = -Wl,-Map -Wl,address@hidden -Wl,-defsym -Wl,_STACK_SIZE=3072
+#AM_LDFLAGS = -Wl,-defsym -Wl,_STACK_SIZE=2048
 
+
 %.bin : %
        mb-objcopy -O binary $< $@
 

Modified: gnuradio/trunk/usrp2/firmware/apps/app_common_v2.c
===================================================================
--- gnuradio/trunk/usrp2/firmware/apps/app_common_v2.c  2009-01-22 18:23:45 UTC 
(rev 10290)
+++ gnuradio/trunk/usrp2/firmware/apps/app_common_v2.c  2009-01-22 18:29:24 UTC 
(rev 10291)
@@ -422,6 +422,8 @@
     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 @@
 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);
 }
 

Modified: gnuradio/trunk/usrp2/firmware/apps/app_passthru_v2.c
===================================================================
--- gnuradio/trunk/usrp2/firmware/apps/app_passthru_v2.c        2009-01-22 
18:23:45 UTC (rev 10290)
+++ gnuradio/trunk/usrp2/firmware/apps/app_passthru_v2.c        2009-01-22 
18:29:24 UTC (rev 10291)
@@ -153,6 +153,12 @@
       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 @@
 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);
 }

Modified: gnuradio/trunk/usrp2/firmware/apps/eth_serdes.c
===================================================================
--- gnuradio/trunk/usrp2/firmware/apps/eth_serdes.c     2009-01-22 18:23:45 UTC 
(rev 10290)
+++ gnuradio/trunk/usrp2/firmware/apps/eth_serdes.c     2009-01-22 18:29:24 UTC 
(rev 10291)
@@ -168,6 +168,9 @@
 {
   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);

Modified: gnuradio/trunk/usrp2/firmware/apps/serdes_txrx.c
===================================================================
--- gnuradio/trunk/usrp2/firmware/apps/serdes_txrx.c    2009-01-22 18:23:45 UTC 
(rev 10290)
+++ gnuradio/trunk/usrp2/firmware/apps/serdes_txrx.c    2009-01-22 18:29:24 UTC 
(rev 10291)
@@ -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 @@
 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 @@
 {
   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 @@
            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 @@
              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 @@
   // 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){

Modified: gnuradio/trunk/usrp2/firmware/config/grc_usrp2_firmware.m4
===================================================================
--- gnuradio/trunk/usrp2/firmware/config/grc_usrp2_firmware.m4  2009-01-22 
18:23:45 UTC (rev 10290)
+++ gnuradio/trunk/usrp2/firmware/config/grc_usrp2_firmware.m4  2009-01-22 
18:29:24 UTC (rev 10291)
@@ -25,6 +25,7 @@
 
     AC_REQUIRE([AC_PROG_CC])
     AC_REQUIRE([AC_PROG_CPP])
+    AC_REQUIRE([AM_PROG_AS])
     AC_REQUIRE([AC_PROG_RANLIB])
 
 

Modified: gnuradio/trunk/usrp2/firmware/configure.gnu
===================================================================
--- gnuradio/trunk/usrp2/firmware/configure.gnu 2009-01-22 18:23:45 UTC (rev 
10290)
+++ gnuradio/trunk/usrp2/firmware/configure.gnu 2009-01-22 18:29:24 UTC (rev 
10291)
@@ -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 @@
 do
   case "$t" in
       (CC=*)       ;;
-      (CPP=*)       ;;
+      (CPP=*)      ;;
       (CXX=*)      ;;
       (AR=*)       ;;
+      (AS=*)       ;;
       (NM=*)       ;;
       (RANLIB=*)   ;;
       (STRIP=*)    ;;

Modified: gnuradio/trunk/usrp2/firmware/lib/Makefile.am
===================================================================
--- gnuradio/trunk/usrp2/firmware/lib/Makefile.am       2009-01-22 18:23:45 UTC 
(rev 10290)
+++ gnuradio/trunk/usrp2/firmware/lib/Makefile.am       2009-01-22 18:29:24 UTC 
(rev 10291)
@@ -90,6 +90,6 @@
        u2_init.h \
        usrp2_bytesex.h \
         wb16550.h
-        
+
 EXTRA_DIST = \
         microblaze.ld

Modified: gnuradio/trunk/usrp2/firmware/lib/memory_map.h
===================================================================
--- gnuradio/trunk/usrp2/firmware/lib/memory_map.h      2009-01-22 18:23:45 UTC 
(rev 10290)
+++ gnuradio/trunk/usrp2/firmware/lib/memory_map.h      2009-01-22 18:29:24 UTC 
(rev 10291)
@@ -366,6 +366,16 @@
 #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 ---





reply via email to

[Prev in Thread] Current Thread [Next in Thread]