aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/microblaze/lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-12-14 13:13:29 -0800
committerJosh Blum <josh@joshknows.com>2010-12-14 13:13:29 -0800
commit01d5209e103a590dbcdaa51b7fecd2a9e161f558 (patch)
tree3c26cac1aaeaecf49cb5b7c35cfcb9fd25ad744f /firmware/microblaze/lib
parent546e877ea461404550f01a1066242c2f2610ad9d (diff)
parent42c8c0873c00e692eb88c54e7da4fcbabbd9a4b6 (diff)
downloaduhd-01d5209e103a590dbcdaa51b7fecd2a9e161f558.tar.gz
uhd-01d5209e103a590dbcdaa51b7fecd2a9e161f558.tar.bz2
uhd-01d5209e103a590dbcdaa51b7fecd2a9e161f558.zip
Merge branch 'zpu' into next
Diffstat (limited to 'firmware/microblaze/lib')
-rw-r--r--firmware/microblaze/lib/CMakeLists.txt47
-rw-r--r--firmware/microblaze/lib/hal_io.h28
-rw-r--r--firmware/microblaze/lib/hal_uart.c2
-rw-r--r--firmware/microblaze/lib/mdelay.c3
-rw-r--r--firmware/microblaze/lib/pic.h1
5 files changed, 65 insertions, 16 deletions
diff --git a/firmware/microblaze/lib/CMakeLists.txt b/firmware/microblaze/lib/CMakeLists.txt
new file mode 100644
index 000000000..193d63cfa
--- /dev/null
+++ b/firmware/microblaze/lib/CMakeLists.txt
@@ -0,0 +1,47 @@
+#
+# 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
+# (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/>.
+#
+
+########################################################################
+SET(COMMON_SRCS
+ ${CMAKE_SOURCE_DIR}/lib/u2_init.c
+ ${CMAKE_SOURCE_DIR}/lib/abort.c
+ ${CMAKE_SOURCE_DIR}/lib/ad9510.c
+ ${CMAKE_SOURCE_DIR}/lib/clocks.c
+ ${CMAKE_SOURCE_DIR}/lib/eeprom.c
+ ${CMAKE_SOURCE_DIR}/lib/eth_addrs.c
+ ${CMAKE_SOURCE_DIR}/lib/eth_mac.c
+ ${CMAKE_SOURCE_DIR}/lib/_exit.c
+ ${CMAKE_SOURCE_DIR}/lib/exit.c
+ ${CMAKE_SOURCE_DIR}/lib/hal_io.c
+ ${CMAKE_SOURCE_DIR}/lib/hal_uart.c
+ ${CMAKE_SOURCE_DIR}/lib/i2c.c
+ ${CMAKE_SOURCE_DIR}/lib/mdelay.c
+ ${CMAKE_SOURCE_DIR}/lib/memcpy_wa.c
+ ${CMAKE_SOURCE_DIR}/lib/memset_wa.c
+ ${CMAKE_SOURCE_DIR}/lib/nonstdio.c
+ ${CMAKE_SOURCE_DIR}/lib/pic.c
+ ${CMAKE_SOURCE_DIR}/lib/pkt_ctrl.c
+ ${CMAKE_SOURCE_DIR}/lib/print_addrs.c
+ ${CMAKE_SOURCE_DIR}/lib/print_rmon_regs.c
+ ${CMAKE_SOURCE_DIR}/lib/print_buffer.c
+ ${CMAKE_SOURCE_DIR}/lib/printf.c
+ ${CMAKE_SOURCE_DIR}/lib/ihex.c
+ ${CMAKE_SOURCE_DIR}/lib/spi.c
+ ${CMAKE_SOURCE_DIR}/lib/net_common.c
+ ${CMAKE_SOURCE_DIR}/lib/arp_cache.c
+ ${CMAKE_SOURCE_DIR}/lib/banal.c
+)
diff --git a/firmware/microblaze/lib/hal_io.h b/firmware/microblaze/lib/hal_io.h
index 950f8d591..ff87a3494 100644
--- a/firmware/microblaze/lib/hal_io.h
+++ b/firmware/microblaze/lib/hal_io.h
@@ -72,10 +72,10 @@ hal_disable_ints(void)
{
int result, t0;
- asm volatile("mfs %0, rmsr \n\
- andni %1, %0, 0x2 \n\
- mts rmsr, %1"
- : "=r" (result), "=r" (t0));
+ //asm volatile("mfs %0, rmsr \n\
+// andni %1, %0, 0x2 \n\
+// mts rmsr, %1"
+// : "=r" (result), "=r" (t0));
return result;
}
@@ -88,10 +88,10 @@ hal_enable_ints(void)
{
int result, t0;
- asm volatile("mfs %0, rmsr \n\
- ori %1, %0, 0x2 \n\
- mts rmsr, %1"
- : "=r" (result), "=r" (t0));
+// asm volatile("mfs %0, rmsr \n\
+// ori %1, %0, 0x2 \n\
+// mts rmsr, %1"
+// : "=r" (result), "=r" (t0));
return result;
}
@@ -103,12 +103,12 @@ static inline void
hal_restore_ints(int prev_state)
{
int t0, t1;
- asm volatile("andi %0, %2, 0x2 \n\
- mfs %1, rmsr \n\
- andni %1, %1, 0x2 \n\
- or %1, %1, %0 \n\
- mts rmsr, %1"
- : "=r" (t0), "=r"(t1) : "r" (prev_state));
+// asm volatile("andi %0, %2, 0x2 \n\
+// mfs %1, rmsr \n\
+// andni %1, %1, 0x2 \n\
+// or %1, %1, %0 \n\
+// mts rmsr, %1"
+// : "=r" (t0), "=r"(t1) : "r" (prev_state));
}
#endif /* INCLUDED_HAL_IO_H */
diff --git a/firmware/microblaze/lib/hal_uart.c b/firmware/microblaze/lib/hal_uart.c
index 7836240fe..f0921f4f0 100644
--- a/firmware/microblaze/lib/hal_uart.c
+++ b/firmware/microblaze/lib/hal_uart.c
@@ -113,7 +113,7 @@ hal_uart_getc_timeout(hal_uart_name_t u)
int hal_uart_rx_flush(hal_uart_name_t u)
{
- char x;
+ char x = 0;
while(uart_regs[u].rxlevel) x = uart_regs[u].rxchar;
return x;
}
diff --git a/firmware/microblaze/lib/mdelay.c b/firmware/microblaze/lib/mdelay.c
index c8c119b1a..958acf3f5 100644
--- a/firmware/microblaze/lib/mdelay.c
+++ b/firmware/microblaze/lib/mdelay.c
@@ -30,7 +30,7 @@
inline static void
delay_1ms(int loop_count)
{
- int i;
+/* int i;
for (i = 0; i < loop_count; i++){
asm volatile ("or r0, r0, r0\n\
or r0, r0, r0\n\
@@ -40,6 +40,7 @@ delay_1ms(int loop_count)
or r0, r0, r0\n\
or r0, r0, r0\n");
}
+*/
}
// delay about ms milliseconds
diff --git a/firmware/microblaze/lib/pic.h b/firmware/microblaze/lib/pic.h
index 68918f9ad..6cbffb441 100644
--- a/firmware/microblaze/lib/pic.h
+++ b/firmware/microblaze/lib/pic.h
@@ -31,5 +31,6 @@ int pic_disable_interrupts();
int pic_enable_interrupts();
void pic_restore_interrupts(int prev_status);
+void pic_interrupt_handler();
#endif /* INCLUDED_PIC_H */