From 039eceb4b208b2ca5a3465d2f16c8d5a7c7276c7 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 23 Apr 2010 19:21:47 -0700 Subject: Moved reading the eeprom (dboard ids) onto the host. Created a eeprom parser for the format in the dboard. Removed the support from the microblaze code. --- firmware/microblaze/apps/txrx.c | 16 -------- firmware/microblaze/lib/Makefile.am | 2 - firmware/microblaze/lib/db.h | 31 --------------- firmware/microblaze/lib/db_init.c | 77 ------------------------------------- firmware/microblaze/lib/u2_init.c | 1 - 5 files changed, 127 deletions(-) delete mode 100644 firmware/microblaze/lib/db.h delete mode 100644 firmware/microblaze/lib/db_init.c (limited to 'firmware/microblaze') diff --git a/firmware/microblaze/apps/txrx.c b/firmware/microblaze/apps/txrx.c index 7a6fbd993..8ff3b8c58 100644 --- a/firmware/microblaze/apps/txrx.c +++ b/firmware/microblaze/apps/txrx.c @@ -45,7 +45,6 @@ #include "clocks.h" #include #include "usrp2/fw_common.h" -#include #include #include #include @@ -257,12 +256,6 @@ void handle_udp_ctrl_packet( memcpy(&ctrl_data_out.data.mac_addr, ethernet_mac_addr(), sizeof(eth_mac_addr_t)); break; - case USRP2_CTRL_ID_GIVE_ME_YOUR_DBOARD_IDS_BRO: - ctrl_data_out.id = USRP2_CTRL_ID_THESE_ARE_MY_DBOARD_IDS_DUDE; - ctrl_data_out.data.dboard_ids.tx_id = read_dboard_eeprom(I2C_ADDR_TX_A); - ctrl_data_out.data.dboard_ids.rx_id = read_dboard_eeprom(I2C_ADDR_RX_A); - break; - /******************************************************************* * SPI ******************************************************************/ @@ -418,15 +411,6 @@ void handle_udp_ctrl_packet( ctrl_data_out.id = USRP2_CTRL_ID_WOAH_I_DEFINITELY_PEEKED_IT_DUDE; break; - /******************************************************************* - * Hardware Rev Numbers - ******************************************************************/ - case USRP2_CTRL_ID_WHATS_THE_HARDWARE_REV_NOS_BRO: - ctrl_data_out.data.hw_rev.major = u2_hw_rev_major; - ctrl_data_out.data.hw_rev.minor = u2_hw_rev_minor; - ctrl_data_out.id = USRP2_CTRL_ID_TAKE_THE_HARDWARE_REV_NOS_DUDE; - break; - default: ctrl_data_out.id = USRP2_CTRL_ID_HUH_WHAT; diff --git a/firmware/microblaze/lib/Makefile.am b/firmware/microblaze/lib/Makefile.am index bd8972f5c..783895850 100644 --- a/firmware/microblaze/lib/Makefile.am +++ b/firmware/microblaze/lib/Makefile.am @@ -28,7 +28,6 @@ libu2fw_a_SOURCES = \ bsm12.c \ buffer_pool.c \ clocks.c \ - db_init.c \ dbsm.c \ eeprom.c \ ethernet.c \ @@ -60,7 +59,6 @@ noinst_HEADERS = \ bsm12.h \ buffer_pool.h \ clocks.h \ - db.h \ dbsm.h \ eth_mac.h \ eth_mac_regs.h \ diff --git a/firmware/microblaze/lib/db.h b/firmware/microblaze/lib/db.h deleted file mode 100644 index 358cb222b..000000000 --- a/firmware/microblaze/lib/db.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 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 - * 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 . - */ - -/* - * Interface to daughterboard code - */ - -#ifndef INCLUDED_DB_H -#define INCLUDED_DB_H - -#include -#include - -int read_dboard_eeprom(int i2c_addr); - -#endif /* INCLUDED_DB_H */ diff --git a/firmware/microblaze/lib/db_init.c b/firmware/microblaze/lib/db_init.c deleted file mode 100644 index 23805d9cd..000000000 --- a/firmware/microblaze/lib/db_init.c +++ /dev/null @@ -1,77 +0,0 @@ -// -// Copyright 2010 Ettus Research LLC -// -/* - * Copyright 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 - * 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 . - */ - - -#include -#include -#include -#include -#include -#include -#include - - -typedef enum { UDBE_OK, UDBE_NO_EEPROM, UDBE_INVALID_EEPROM } usrp_dbeeprom_status_t; - -static usrp_dbeeprom_status_t -read_raw_dboard_eeprom (unsigned char *buf, int i2c_addr) -{ - if (!eeprom_read (i2c_addr, 0, buf, DB_EEPROM_CLEN)) - return UDBE_NO_EEPROM; - - if (buf[DB_EEPROM_MAGIC] != DB_EEPROM_MAGIC_VALUE) - return UDBE_INVALID_EEPROM; - - int sum = 0; - unsigned int i; - for (i = 0; i < DB_EEPROM_CLEN; i++) - sum += buf[i]; - - if ((sum & 0xff) != 0) - return UDBE_INVALID_EEPROM; - - return UDBE_OK; -} - - -/* - * Return DBID, -1 or -2 - */ -int -read_dboard_eeprom(int i2c_addr) -{ - unsigned char buf[DB_EEPROM_CLEN]; - - usrp_dbeeprom_status_t s = read_raw_dboard_eeprom (buf, i2c_addr); - - //printf("\nread_raw_dboard_eeprom: %d\n", s); - - switch (s){ - case UDBE_OK: - return (buf[DB_EEPROM_ID_MSB] << 8) | buf[DB_EEPROM_ID_LSB]; - - case UDBE_NO_EEPROM: - default: - return -1; - - case UDBE_INVALID_EEPROM: - return -2; - } -} diff --git a/firmware/microblaze/lib/u2_init.c b/firmware/microblaze/lib/u2_init.c index 76e83c660..399d834cb 100644 --- a/firmware/microblaze/lib/u2_init.c +++ b/firmware/microblaze/lib/u2_init.c @@ -25,7 +25,6 @@ #include "i2c.h" #include "mdelay.h" #include "clocks.h" -#include "db.h" #include "usrp2_i2c_addr.h" //#include "nonstdio.h" -- cgit v1.2.3