Merge branches 'wbx_usrp2' and 'wbx_usrp1' of git://gnuradio.org/jabele
authorJohnathan Corgan <jcorgan@corganenterprises.com>
Sun, 21 Feb 2010 18:32:22 +0000 (10:32 -0800)
committerJohnathan Corgan <jcorgan@corganenterprises.com>
Sun, 21 Feb 2010 18:41:11 +0000 (10:41 -0800)
12 files changed:
gr-pager/swig/Makefile.am
usrp/firmware/src/common/build_eeprom.py
usrp/firmware/src/usrp2/Makefile.am
usrp/host/lib/db_wbxng_adf4350_regs.cc
usrp/host/lib/db_wbxng_adf4350_regs.h
usrp2/firmware/apps/app_common_v2.c
usrp2/firmware/lib/adf4350.c
usrp2/firmware/lib/adf4350.h
usrp2/firmware/lib/adf4350_regs.c
usrp2/firmware/lib/db.h
usrp2/firmware/lib/db_wbxng.c
usrp2/firmware/lib/db_wbxng.h

index 890459cb62a1af70531164409371be1ba5bdb7b7..9e1a4521935ab1b6fb22e5355bd6cc6ef32a132f 100644 (file)
@@ -41,7 +41,7 @@ pager_swig_pythondir_category = \
 
 # additional libraries for linking with the SWIG-generated library
 pager_swig_la_swig_libadd = \
-       $(builddir)/../lib/libgnuradio-pager.la
+       $(abs_top_builddir)/gr-pager/lib/libgnuradio-pager.la
 
 # additional SWIG files to be installed
 pager_swig_swiginclude_headers = \
index 023c4b3f5797ba79b9144684f856f53f82144f71..ed9bb56a4816174b3d0d02f04ed64559a1022b16 100755 (executable)
@@ -140,12 +140,12 @@ def build_eeprom_image (filename, rev):
     assert (len (image) <= 256)
     return image
 
-def build_shell_script (out, ihx_filename, rev):
+def build_shell_script (out, ihx_filename, rev, prefix):
 
     image = build_eeprom_image (ihx_filename, rev)
 
     out.write ('#!/bin/sh\n')
-    out.write ('usrper -x load_firmware /usr/local/share/usrp/rev%d/std.ihx\n' % rev)
+    out.write ('usrper -x load_firmware ' + prefix + '/share/usrp/rev%d/std.ihx\n' % rev)
     out.write ('sleep 1\n')
     
     # print "len(image) =", len(image)
@@ -164,8 +164,10 @@ def build_shell_script (out, ihx_filename, rev):
         out.write ('sleep 1\n')
 
 if __name__ == '__main__':
-    usage = "usage: %prog -r REV [options] bootfile.ihx"
+    usage = "usage: %prog -p PREFIX -r REV [options] bootfile.ihx"
     parser = OptionParser (usage=usage)
+    parser.add_option ("-p", "--prefix", type="string", default="",
+                       help="Specify install prefix from configure")
     parser.add_option ("-r", "--rev", type="int", default=-1,
                        help="Specify USRP revision number REV (2 or 4)")
     (options, args) = parser.parse_args ()
@@ -176,7 +178,15 @@ if __name__ == '__main__':
         sys.stderr.write (
             "You must specify the USRP revision number (2 or 4) with -r REV\n")
         sys.exit (1)
+    if options.prefix == "":
+        sys.stderr.write (
+            "You must specify the install prefix with -p PREFIX\n")
+        sys.exit (1)
+    if not os.path.isdir(options.prefix):
+        sys.stderr.write (
+            "PREFIX dir (" + options.prefix + "), does not exist\n")
+        sys.exit (1)
 
     ihx_filename = args[0]
 
-    build_shell_script (sys.stdout, ihx_filename, options.rev)
+    build_shell_script (sys.stdout, ihx_filename, options.rev, options.prefix)
index e380b19074b41782ba211fd9f0fb62aff43b52c0..4402cd6365901e4cba936a26f7d3d41448e63b42 100644 (file)
@@ -108,11 +108,11 @@ eeprom_boot.ihx: $(EEPROM_BOOT_OBJS) $(LIBDEP)
        $(XCC) $(LINKOPTS) -o $@ $(EEPROM_BOOT_OBJS)
 
 burn-usrp2-eeprom: eeprom_boot.ihx
-       $(PYTHON) $(srcdir)/../common/build_eeprom.py -r2 eeprom_boot.ihx > $@
+       $(PYTHON) $(srcdir)/../common/build_eeprom.py -p$(prefix) -r2 eeprom_boot.ihx > $@
        chmod +x $@
 
 burn-usrp4-eeprom: eeprom_boot.ihx
-       $(PYTHON) $(srcdir)/../common/build_eeprom.py -r4 eeprom_boot.ihx > $@
+       $(PYTHON) $(srcdir)/../common/build_eeprom.py -p$(prefix) -r4 eeprom_boot.ihx > $@
        chmod +x $@
 
 
index bc859158e71906b262878dd57c67f0114590c2a2..21d77dcce6d37764919a1e2b902501d21cfb2a76 100644 (file)
@@ -1,6 +1,22 @@
-/*
- * Copyright 2009 Ettus Research LLC
- */
+//
+// Copyright 2009 Free Software Foundation, Inc.
+//
+// This file is part of GNU Radio
+//
+// GNU Radio 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 asversion 3, or (at your option)
+// any later version.
+//
+// GNU Radio 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 GNU Radio; see the file COPYING.  If not, write to
+// the Free Software Foundation, Inc., 51 Franklin Street,
+// Boston, MA 02110-1301, USA.
 
 #include "db_wbxng_adf4350_regs.h"
 #include "db_wbxng_adf4350.h"
index 3973b4d6baac9dee44418f67652145577f6420a9..0018aa07f5a6b1440932ac86ee0b5404fd4db812 100644 (file)
@@ -1,6 +1,22 @@
-/*
- * Copyright 2009 Ettus Research LLC
- */
+//
+// Copyright 2009 Free Software Foundation, Inc.
+//
+// This file is part of GNU Radio
+//
+// GNU Radio 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 asversion 3, or (at your option)
+// any later version.
+//
+// GNU Radio 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 GNU Radio; see the file COPYING.  If not, write to
+// the Free Software Foundation, Inc., 51 Franklin Street,
+// Boston, MA 02110-1301, USA.
 
 #ifndef ADF4350_REGS_H
 #define ADF4350_REGS_H
index 2d131bda73847de3ae92e8c76ccfbd64856fafe4..036d0bace7e1a381f97c790913684b46ed172274 100644 (file)
@@ -31,6 +31,7 @@
 #include "clocks.h"
 #include "u2_init.h"
 #include <string.h>
+#include "usrp2_i2c_addr.h"
 
 volatile bool link_is_up = false;      // eth handler sets this
 int cpu_tx_buf_dest_port = PORT_ETH;
@@ -308,7 +309,7 @@ read_time_cmd(const op_generic_t *p,
 static void
 fill_db_info(u2_db_info_t *p, const struct db_base *db)
 {
-  p->dbid = db->dbid;
+  //p->dbid = db->dbid;
   p->freq_min_hi = u2_fxpt_freq_hi(db->freq_min);
   p->freq_min_lo = u2_fxpt_freq_lo(db->freq_min);
   p->freq_max_hi = u2_fxpt_freq_hi(db->freq_max);
@@ -334,6 +335,9 @@ dboard_info_cmd(const op_generic_t *p,
   fill_db_info(&r->tx_db_info, tx_dboard);
   fill_db_info(&r->rx_db_info, rx_dboard);
 
+  r->tx_db_info.dbid = read_dboard_eeprom(I2C_ADDR_TX_A);
+  r->rx_db_info.dbid = read_dboard_eeprom(I2C_ADDR_RX_A);
+
   return r->len;
 }
 
index b2e8db8e231f0098062aecb7564fe2cc9ed5140e..0725c93379533e123f0439196fe015b42b8d0b2f 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * Copyright 2010 Free Software Foundation, Inc.
  *
- * Copyright 2010 Ettus Research LLC
- *
  * 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
index 5ee13ddbb9e61e946a7c2e11b9a0244c897f2126..3c66ec3448cc80a9a8dca8a332f99bbf8870038e 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * Copyright 2010 Free Software Foundation, Inc.
  *
- * Copyright 2010 Ettus Research LLC
- *
  * 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
index 196a97c5b98b565215989da518cf50f9c30edc97..e2740d3ab8970698411a72f0e788320bdd3a236d 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * Copyright 2010 Free Software Foundation, Inc.
  *
- * Copyright 2010 Ettus Research LLC
- *
  * 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
index cec960267d2f072354199fc113249c27a3efd029..7feb1c88925d129b113ff904a72e28396c6e1308 100644 (file)
@@ -100,5 +100,10 @@ db_set_duc_freq(u2_fxpt_freq_t dxc_freq, u2_fxpt_freq_t *actual_dxc_freq);
 bool
 db_set_gain(struct db_base *db, u2_fxpt_gain_t gain);
  
+/*!
+ * \brief Read the eeprom value from the db, without defaulting to BasicRX/TX
+ */
+int
+read_dboard_eeprom(int i2c_addr);
 
 #endif /* INCLUDED_DB_H */
index 1620c6629eb3c3ca66f0d5b01bb5b761e14ccf26..c02a5bdaa95ac2af3e431872d595584d425fe3bf 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * Copyright 2010 Free Software Foundation, Inc.
  *
- * Copyright 2010 Ettus Research LLC
- *
  * 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
index b2437cbccd09f218227aaa1666b3e0c2de7efa4b..3756e6c241d43e46137cb1301242e134a4bee1bc 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * Copyright 2010 Free Software Foundation, Inc.
  *
- * Copyright 2010 Ettus Research LLC
- *
  * 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