commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10560 - in gnuradio/trunk: gr-usrp/src usrp/host/apps


From: eb
Subject: [Commit-gnuradio] r10560 - in gnuradio/trunk: gr-usrp/src usrp/host/apps usrp/host/lib/inband usrp/host/lib/legacy usrp2/firmware/apps usrp2/firmware/lib
Date: Wed, 4 Mar 2009 18:21:44 -0700 (MST)

Author: eb
Date: 2009-03-04 18:21:44 -0700 (Wed, 04 Mar 2009)
New Revision: 10560

Added:
   gnuradio/trunk/usrp2/firmware/apps/burn_dbsrx_eeprom.c
Modified:
   gnuradio/trunk/gr-usrp/src/usrp_source_base.cc
   gnuradio/trunk/usrp/host/apps/burn-db-eeprom
   gnuradio/trunk/usrp/host/lib/inband/usrp_usb_interface.cc
   gnuradio/trunk/usrp/host/lib/legacy/usrp_dbid.dat
   gnuradio/trunk/usrp2/firmware/apps/
   gnuradio/trunk/usrp2/firmware/apps/Makefile.am
   gnuradio/trunk/usrp2/firmware/lib/db_init.c
   gnuradio/trunk/usrp2/firmware/lib/hal_io.h
Log:
New standalone firmware, burn_dbsrx_eeprom, that burns new dbid into
modified DBS Rx daughterboard.



Modified: gnuradio/trunk/gr-usrp/src/usrp_source_base.cc
===================================================================
--- gnuradio/trunk/gr-usrp/src/usrp_source_base.cc      2009-03-05 01:19:50 UTC 
(rev 10559)
+++ gnuradio/trunk/gr-usrp/src/usrp_source_base.cc      2009-03-05 01:21:44 UTC 
(rev 10560)
@@ -292,7 +292,6 @@
     USRP_DBID_TV_RX,
     USRP_DBID_TV_RX_REV_2,
     USRP_DBID_DBS_RX,
-    USRP_DBID_DBS_RX_REV_2_1,
     USRP_DBID_BASIC_RX
   };
 

Modified: gnuradio/trunk/usrp/host/apps/burn-db-eeprom
===================================================================
--- gnuradio/trunk/usrp/host/apps/burn-db-eeprom        2009-03-05 01:19:50 UTC 
(rev 10559)
+++ gnuradio/trunk/usrp/host/apps/burn-db-eeprom        2009-03-05 01:21:44 UTC 
(rev 10560)
@@ -32,7 +32,7 @@
     'basictx'         : ((BASIC_TX, 0x0000),        None),
     'basicrx'         : (None,                      (BASIC_RX, 0x0000)),
     'dbsrx'           : (None,                      (DBS_RX, 0x0000)),
-    'dbsrx2'          : (None,                      (DBS_RX_REV_2_1, 0x0000)),
+    'dbsrx_clkmod'    : (None,                      (DBS_RX_CLKMOD, 0x0000)),
     'tvrx'            : (None,                      (TV_RX, 0x0000)),
     'tvrx2'           : (None,                      (TV_RX_REV_2, 0x0000)),
     'tvrx3'           : (None,                      (TV_RX_REV_3, 0x0000)),

Modified: gnuradio/trunk/usrp/host/lib/inband/usrp_usb_interface.cc
===================================================================
--- gnuradio/trunk/usrp/host/lib/inband/usrp_usb_interface.cc   2009-03-05 
01:19:50 UTC (rev 10559)
+++ gnuradio/trunk/usrp/host/lib/inband/usrp_usb_interface.cc   2009-03-05 
01:21:44 UTC (rev 10560)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2009 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -553,7 +553,6 @@
     USRP_DBID_TV_RX,
     USRP_DBID_TV_RX_REV_2,
     USRP_DBID_DBS_RX,
-    USRP_DBID_DBS_RX_REV_2_1,
     USRP_DBID_BASIC_RX
   };
 

Modified: gnuradio/trunk/usrp/host/lib/legacy/usrp_dbid.dat
===================================================================
--- gnuradio/trunk/usrp/host/lib/legacy/usrp_dbid.dat   2009-03-05 01:19:50 UTC 
(rev 10559)
+++ gnuradio/trunk/usrp/host/lib/legacy/usrp_dbid.dat   2009-03-05 01:21:44 UTC 
(rev 10560)
@@ -1,5 +1,5 @@
 #
-# Copyright 2005 Free Software Foundation, Inc.
+# Copyright 2005,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -36,7 +36,7 @@
 "Flex 2400 Tx"         0x000b
 
 "TV Rx Rev 2"          0x000c
-"DBS Rx Rev 2_1"       0x000d
+"DBS Rx ClkMod"                0x000d
 
 "LF Tx"                        0x000e
 "LF Rx"                        0x000f


Property changes on: gnuradio/trunk/usrp2/firmware/apps
___________________________________________________________________
Modified: svn:ignore
   - *-stamp
*.a
*.bin
*.dump
*.log
*.rom
*.map
.deps
Makefile
Makefile.in
aclocal.m4
autom4te.cache
blink_leds
blink_leds2
build
compile
config.h
config.h.in
config.log
config.status
configure
depcomp
echo
eth_test
gen_eth_packets
ibs_rx_test
ibs_tx_test
install-sh
libtool
ltmain.sh
missing
py-compile
rcv_eth_packets
run_tests.sh
stamp-h1
test1
test_phy_comm
timer_test
buf_ram_test
buf_ram_zero
hello
test_printf
test_spi
test_i2c
gen_pause_frames
test_serdes
rx_only
tx_only
tx_standalone
tx_drop
tx_drop2
tx_drop_rate_limited
test_lsdac
test_lsadc
read_dbids
test_db_spi
ramp_lsdac
eth_to_serdes
serdes_to_dsp
sd_gentest
sd_bounce
can_i_sub
tx_only_v2
rx_only_v2
txrx
eth_serdes
serdes_txrx
set_hw_rev
test_sd
factory_test
test_ram
mimo_tx
mimo_tx_slave

   + *-stamp
*.a
*.bin
*.dump
*.log
*.rom
*.map
.deps
Makefile
Makefile.in
aclocal.m4
autom4te.cache
blink_leds
blink_leds2
build
compile
config.h
config.h.in
config.log
config.status
configure
depcomp
echo
eth_test
gen_eth_packets
ibs_rx_test
ibs_tx_test
install-sh
libtool
ltmain.sh
missing
py-compile
rcv_eth_packets
run_tests.sh
stamp-h1
test1
test_phy_comm
timer_test
buf_ram_test
buf_ram_zero
hello
test_printf
test_spi
test_i2c
gen_pause_frames
test_serdes
rx_only
tx_only
tx_standalone
tx_drop
tx_drop2
tx_drop_rate_limited
test_lsdac
test_lsadc
read_dbids
test_db_spi
ramp_lsdac
eth_to_serdes
serdes_to_dsp
sd_gentest
sd_bounce
can_i_sub
tx_only_v2
rx_only_v2
txrx
eth_serdes
serdes_txrx
set_hw_rev
test_sd
factory_test
test_ram
mimo_tx
mimo_tx_slave
burn_dbsrx_eeprom


Modified: gnuradio/trunk/usrp2/firmware/apps/Makefile.am
===================================================================
--- gnuradio/trunk/usrp2/firmware/apps/Makefile.am      2009-03-05 01:19:50 UTC 
(rev 10559)
+++ gnuradio/trunk/usrp2/firmware/apps/Makefile.am      2009-03-05 01:21:44 UTC 
(rev 10560)
@@ -23,6 +23,7 @@
        blink_leds \
        blink_leds2 \
        buf_ram_test \
+       burn_dbsrx_eeprom \
        can_i_sub \
        echo \
        eth_serdes \

Added: gnuradio/trunk/usrp2/firmware/apps/burn_dbsrx_eeprom.c
===================================================================
--- gnuradio/trunk/usrp2/firmware/apps/burn_dbsrx_eeprom.c                      
        (rev 0)
+++ gnuradio/trunk/usrp2/firmware/apps/burn_dbsrx_eeprom.c      2009-03-05 
01:21:44 UTC (rev 10560)
@@ -0,0 +1,106 @@
+/* -*- c++ -*- */
+/*
+ * Copyright 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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "u2_init.h"
+#include "i2c.h"
+#include "usrp2_i2c_addr.h"
+#include "mdelay.h"
+#include "hal_io.h"
+#include "nonstdio.h"
+#include "bool.h"
+
+
+
+int read_dboard_eeprom(int i2c_addr);
+
+
+#define USRP_DBID_DBS_RX                0x0002
+#define USRP_DBID_DBS_RX_WITH_CLOCK_MOD  0x000d
+
+const char dbs_rx_rev2_eeprom[] = {
+  0xdb, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18
+};
+
+#define        LED_VALS   (LED_A | LED_B | LED_C | LED_D)
+#define        LED_MASK   (LED_A | LED_B | LED_C | LED_D)
+
+int
+main(void)
+{
+  u2_init();
+
+  puts("\nburn_dbsrx_eeprom\n");
+
+  hal_set_leds(0, ~0); // all off
+
+  int i2c_addr = I2C_ADDR_RX_A;
+  int dbid = read_dboard_eeprom(i2c_addr);
+  bool ok;
+  const char *msg = 0;
+
+  switch (dbid){
+  case -1:
+    msg = "No RX daughterboard found";
+    goto bad;
+
+  case -2:
+    msg = "Invalid RX EEPROM contents";
+    goto bad;
+
+  case USRP_DBID_DBS_RX_WITH_CLOCK_MOD:
+    msg = "RX Daughterboard already reports being a DBS RX w/ CLOCK_MOD";
+    goto good;
+
+  case USRP_DBID_DBS_RX:
+    // Says it's a DBS_RX, attempt to burn the EEPROM
+    ok = eeprom_write(i2c_addr, 0,
+                     dbs_rx_rev2_eeprom, sizeof(dbs_rx_rev2_eeprom));
+    if (ok){
+      msg = "Successfully programmed db as DBS RX Rev 2.1";
+      goto good;
+    }
+    else {
+      msg = "Failed to write daugherboard eeprom";
+      goto bad;
+    }
+
+  default:
+    msg = "Daughterboard is not a DBS RX; ignored";
+    goto bad;
+  }
+  
+ good:
+  puts(msg);
+  hal_set_leds(LED_VALS, LED_MASK);
+  while (1)
+    ;
+
+ bad:
+  puts(msg);
+  while(1){
+    hal_toggle_leds(LED_VALS);
+    mdelay(50);
+  }
+}


Property changes on: gnuradio/trunk/usrp2/firmware/apps/burn_dbsrx_eeprom.c
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: gnuradio/trunk/usrp2/firmware/lib/db_init.c
===================================================================
--- gnuradio/trunk/usrp2/firmware/lib/db_init.c 2009-03-05 01:19:50 UTC (rev 
10559)
+++ gnuradio/trunk/usrp2/firmware/lib/db_init.c 2009-03-05 01:21:44 UTC (rev 
10560)
@@ -104,7 +104,7 @@
 /*
  * Return DBID, -1 <none> or -2 <invalid eeprom contents>
  */
-static int
+int
 read_dboard_eeprom(int i2c_addr)
 {
   unsigned char buf[DB_EEPROM_CLEN];

Modified: gnuradio/trunk/usrp2/firmware/lib/hal_io.h
===================================================================
--- gnuradio/trunk/usrp2/firmware/lib/hal_io.h  2009-03-05 01:19:50 UTC (rev 
10559)
+++ gnuradio/trunk/usrp2/firmware/lib/hal_io.h  2009-03-05 01:21:44 UTC (rev 
10560)
@@ -91,12 +91,6 @@
  * ------------------------------------------------------------------------
  */
 
-#define        LED_0           0x0001
-#define        LED_1           0x0002
-#define        LED_3           0x0004
-#define        LED_4           0x0008
-#define        LED_ETH_CONN    0x0010
-
 void hal_set_leds(int value, int mask);
 void hal_toggle_leds(int mask);
 





reply via email to

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