[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9111 - in usrp2/branches/features/host-ng/firmware: a
From: |
eb |
Subject: |
[Commit-gnuradio] r9111 - in usrp2/branches/features/host-ng/firmware: apps lib |
Date: |
Thu, 31 Jul 2008 22:18:10 -0600 (MDT) |
Author: eb
Date: 2008-07-31 22:18:10 -0600 (Thu, 31 Jul 2008)
New Revision: 9111
Modified:
usrp2/branches/features/host-ng/firmware/apps/app_common_v2.c
usrp2/branches/features/host-ng/firmware/apps/txrx.c
usrp2/branches/features/host-ng/firmware/lib/dbsm.c
usrp2/branches/features/host-ng/firmware/lib/hal_io.c
usrp2/branches/features/host-ng/firmware/lib/memory_map.h
usrp2/branches/features/host-ng/firmware/lib/u2_init.c
Log:
Ported firmware changes in trunk to host-ng/firmware. Merged
trunk/firmware -r8997:9106 to host-ng/firmware.
Modified: usrp2/branches/features/host-ng/firmware/apps/app_common_v2.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/apps/app_common_v2.c
2008-08-01 04:02:13 UTC (rev 9110)
+++ usrp2/branches/features/host-ng/firmware/apps/app_common_v2.c
2008-08-01 04:18:10 UTC (rev 9111)
@@ -405,8 +405,10 @@
u2_eth_packet_t *pkt = (u2_eth_packet_t *) buffer_ram(bufno);
size_t byte_len = (buffer_pool_status->last_line[bufno] - 3) * 4;
- hal_toggle_leds(0x1);
+ //static size_t last_len = 0;
+ // hal_toggle_leds(0x1);
+
// inspect rcvd frame and figure out what do do.
if (pkt->ehdr.ethertype != U2_ETHERTYPE)
@@ -423,6 +425,13 @@
case 0:
default:
#if 0
+ if (last_len != 0){
+ if (byte_len != last_len){
+ printf("Len: %d last: %d\n", byte_len, last_len);
+ }
+ }
+ last_len = byte_len;
+
if((pkt->thdr.seqno) == exp_seqno){
exp_seqno++;
//putchar('.');
Modified: usrp2/branches/features/host-ng/firmware/apps/txrx.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/apps/txrx.c 2008-08-01
04:02:13 UTC (rev 9110)
+++ usrp2/branches/features/host-ng/firmware/apps/txrx.c 2008-08-01
04:18:10 UTC (rev 9111)
@@ -260,6 +260,22 @@
ethernet_register_link_changed_callback(link_changed_callback);
ethernet_init();
+
+#if 0
+ // make bit 15 of Tx gpio's be a s/w output
+ hal_gpio_set_sel(GPIO_TX_BANK, 15, 's');
+ hal_gpio_set_ddr(GPIO_TX_BANK, 0x8000, 0x8000);
+#endif
+
+ output_regs->debug_mux_ctrl = 1;
+#if 0
+ hal_gpio_set_sels(GPIO_TX_BANK, "1111111111111111");
+ hal_gpio_set_sels(GPIO_RX_BANK, "1111111111111111");
+ hal_gpio_set_ddr(GPIO_TX_BANK, 0xffff, 0xffff);
+ hal_gpio_set_ddr(GPIO_RX_BANK, 0xffff, 0xffff);
+#endif
+
+
// initialize double buffering state machine for ethernet -> DSP Tx
dbsm_init(&dsp_tx_sm, DSP_TX_BUF_0,
@@ -290,7 +306,12 @@
// kick off the state machine
dbsm_start(&dsp_tx_sm);
+ int which = 0;
+
while(1){
+ // hal_gpio_write(GPIO_TX_BANK, which, 0x8000);
+ // which ^= 0x8000;
+
buffer_irq_handler(0);
int pending = pic_regs->pending; // poll for under or overrun
Modified: usrp2/branches/features/host-ng/firmware/lib/dbsm.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/lib/dbsm.c 2008-08-01 04:02:13 UTC
(rev 9110)
+++ usrp2/branches/features/host-ng/firmware/lib/dbsm.c 2008-08-01 04:18:10 UTC
(rev 9111)
@@ -246,16 +246,19 @@
// clear the DSP Tx state machine
dsp_tx_regs->clear_state = 1;
- // If there's a buffer that's empyting (unlikely), clear it & restart xfer
+ // If there's a buffer that's empyting, clear it & flush xfer
if (buffer_state[sm->buf0] == BS_EMPTYING){
bp_clear_buf(sm->buf0);
- dbsm_send_from_buf(sm, sm->buf0);
+ dsp_tx_regs->clear_state = 1; // flush partial packet
+ // drop frame in progress on ground. Pretend it finished
+ dbsm_process_helper(sm, sm->buf0);
}
-
- if (buffer_state[sm->buf0 ^ 1] == BS_EMPTYING){
+ else if (buffer_state[sm->buf0 ^ 1] == BS_EMPTYING){
bp_clear_buf(sm->buf0 ^ 1);
- dbsm_send_from_buf(sm, sm->buf0 ^ 1);
+ dsp_tx_regs->clear_state = 1; // flush partial packet
+ // drop frame in progress on ground. Pretend it finished
+ dbsm_process_helper(sm, sm->buf0 ^ 1);
}
}
Modified: usrp2/branches/features/host-ng/firmware/lib/hal_io.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/lib/hal_io.c 2008-08-01
04:02:13 UTC (rev 9110)
+++ usrp2/branches/features/host-ng/firmware/lib/hal_io.c 2008-08-01
04:18:10 UTC (rev 9111)
@@ -132,10 +132,10 @@
mask &= 0xffff;
}
- int ei = hal_disable_ints();
+ //int ei = hal_disable_ints();
_gpio_io_shadow = (_gpio_io_shadow & ~mask) | (value & mask);
gpio_base->io = _gpio_io_shadow;
- hal_restore_ints(ei);
+ //hal_restore_ints(ei);
}
Modified: usrp2/branches/features/host-ng/firmware/lib/memory_map.h
===================================================================
--- usrp2/branches/features/host-ng/firmware/lib/memory_map.h 2008-08-01
04:02:13 UTC (rev 9110)
+++ usrp2/branches/features/host-ng/firmware/lib/memory_map.h 2008-08-01
04:18:10 UTC (rev 9111)
@@ -352,6 +352,7 @@
volatile uint32_t adc_ctrl;
volatile uint32_t leds;
volatile uint32_t phy_ctrl; // LSB is reset line to eth phy
+ volatile uint32_t debug_mux_ctrl;
} output_regs_t;
#define SERDES_ENABLE 8
Modified: usrp2/branches/features/host-ng/firmware/lib/u2_init.c
===================================================================
--- usrp2/branches/features/host-ng/firmware/lib/u2_init.c 2008-08-01
04:02:13 UTC (rev 9110)
+++ usrp2/branches/features/host-ng/firmware/lib/u2_init.c 2008-08-01
04:18:10 UTC (rev 9111)
@@ -55,6 +55,8 @@
// set up the default clocks
clocks_init();
+ // clocks_enable_test_clk(true);
+
// Enable ADCs
output_regs->adc_ctrl = ADC_CTRL_ON;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9111 - in usrp2/branches/features/host-ng/firmware: apps lib,
eb <=