aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/zpu/usrp2p
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-03-05 19:15:22 -0800
committerJosh Blum <josh@joshknows.com>2012-03-23 14:36:56 -0700
commit08e2432cdeeabd7010252b4a747a385e1b189614 (patch)
tree835fffb297188cfa6b20282e356e96df0377e5b1 /firmware/zpu/usrp2p
parentee04c245f142ae6637091076445d955108d4da62 (diff)
downloaduhd-08e2432cdeeabd7010252b4a747a385e1b189614.tar.gz
uhd-08e2432cdeeabd7010252b4a747a385e1b189614.tar.bz2
uhd-08e2432cdeeabd7010252b4a747a385e1b189614.zip
spi: work on fw support for simple spi core
Diffstat (limited to 'firmware/zpu/usrp2p')
-rw-r--r--firmware/zpu/usrp2p/spi_flash.c4
-rw-r--r--firmware/zpu/usrp2p/spi_flash.h10
-rw-r--r--firmware/zpu/usrp2p/spif.c1
-rw-r--r--firmware/zpu/usrp2p/udp_fw_update.c4
4 files changed, 14 insertions, 5 deletions
diff --git a/firmware/zpu/usrp2p/spi_flash.c b/firmware/zpu/usrp2p/spi_flash.c
index 9406f8042..09f908edb 100644
--- a/firmware/zpu/usrp2p/spi_flash.c
+++ b/firmware/zpu/usrp2p/spi_flash.c
@@ -1,7 +1,6 @@
-/* -*- c++ -*- */
/*
* Copyright 2009 Free Software Foundation, Inc.
- * Copyright 2009-2011 Ettus Research LLC
+ * Copyright 2009-2012 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
@@ -17,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "spi_flash.h"
#include "spi_flash_private.h"
//#include <stdlib.h>
#include <nonstdio.h>
diff --git a/firmware/zpu/usrp2p/spi_flash.h b/firmware/zpu/usrp2p/spi_flash.h
index a10533e08..8a8facdca 100644
--- a/firmware/zpu/usrp2p/spi_flash.h
+++ b/firmware/zpu/usrp2p/spi_flash.h
@@ -23,10 +23,18 @@
#include <stdint.h>
#include <stdbool.h>
-
#define SPI_FLASH_PAGE_SIZE 256
#define SPI_SS_FLASH 1
+#define SPIF_PUSH_RISE 0 // push tx data on rising edge of SCLK
+#define SPIF_PUSH_FALL SPI_CTRL_TXNEG // push tx data on falling edge of SCLK
+#define SPIF_LATCH_RISE 0 // latch rx data on rising edge of SCLK
+#define SPIF_LATCH_FALL SPI_CTRL_RXNEG // latch rx data on falling edge of SCLK
+
+void spif_init(void);
+void spif_wait(void);
+
+uint32_t spif_transact(bool readback, int slave, uint32_t data, int length, uint32_t flags);
uint32_t spi_flash_rdid(void); /* Read ID */
uint32_t spi_flash_rdsr(void); /* Read Status Register */
diff --git a/firmware/zpu/usrp2p/spif.c b/firmware/zpu/usrp2p/spif.c
index 91da73155..60807ca4a 100644
--- a/firmware/zpu/usrp2p/spif.c
+++ b/firmware/zpu/usrp2p/spif.c
@@ -21,6 +21,7 @@
*/
#include "spi.h"
+#include "spi_flash.h"
#include "memory_map.h"
void
diff --git a/firmware/zpu/usrp2p/udp_fw_update.c b/firmware/zpu/usrp2p/udp_fw_update.c
index 5689388a8..cd9e7d902 100644
--- a/firmware/zpu/usrp2p/udp_fw_update.c
+++ b/firmware/zpu/usrp2p/udp_fw_update.c
@@ -1,6 +1,5 @@
-/* -*- c++ -*- */
/*
- * Copyright 2010 Ettus Research LLC
+ * Copyright 2010-2012 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
@@ -19,6 +18,7 @@
//Routines to handle updating the SPI Flash firmware via UDP
#include <net_common.h>
+#include "memory_map.h"
#include "usrp2/fw_common.h"
#include "spi.h"
#include "spi_flash.h"