/*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,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
static int streaming_frame_count = 0;
#define FRAMES_PER_CMD 1000
+bool is_streaming(void){ return streaming_p; }
// ----------------------------------------------------------------
-static void
+void
restart_streaming(void)
{
// setup RX DSP regs
dsp_rx_regs->rx_command =
MK_RX_CMD(FRAMES_PER_CMD * streaming_items_per_frame,
streaming_items_per_frame,
- 1, 1);
+ 1, 1);
dsp_rx_regs->rx_time = 0; // enqueue second command
}
u2_eth_packet_t pkt;
memset(&pkt, 0, sizeof(pkt));
pkt.ehdr.dst = *host;
+ pkt.ehdr.src = *ethernet_mac_addr();
pkt.ehdr.ethertype = U2_ETHERTYPE;
u2p_set_word0(&pkt.fixed, 0, 0);
// DSP RX will fill in timestamp
restart_streaming();
}
+void start_rx_streaming_at_cmd(const u2_mac_addr_t *host, op_start_rx_streaming_t *p, uint32_t time)
+{}
+void restart_streaming_at(uint32_t time)
+{}
void
stop_rx_cmd(void)
* that we didn't handle the packet. A bit of a kludge
* but it should work.
*/
-bool
+bool
fw_sets_seqno_inspector(dbsm_t *sm, int buf_this) // returns false
{
uint32_t *p = buffer_ram(buf_this);
inline static void
buffer_irq_handler(unsigned irq)
{
+ // hal_toggle_leds(LED_A);
+
uint32_t status = buffer_pool_status->status;
+ if (0 && (status & ~BPS_IDLE_ALL)){
+ putstr("status = ");
+ puthex32_nl(status);
+ }
+
dbsm_process_status(&dsp_tx_sm, status);
dbsm_process_status(&dsp_rx_sm, status);
}
{
u2_init();
+ output_regs->led_src = 0x3; // h/w controls bottom two bits
+ clocks_enable_test_clk(true, 1);
+
putstr("\nSERDES TxRx\n");
cpu_tx_buf_dest_port = PORT_SERDES;
- ethernet_register_link_changed_callback(link_changed_callback);
- ethernet_init();
+ // ethernet_register_link_changed_callback(link_changed_callback);
+ // ethernet_init();
clocks_mimo_config(MC_WE_LOCK_TO_MIMO);
+ // puts("post clocks_mimo_config");
+
#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
-#if 1
+#if 0
output_regs->debug_mux_ctrl = 1;
hal_gpio_set_sels(GPIO_TX_BANK, "0000000000000000");
hal_gpio_set_sels(GPIO_RX_BANK, "0000000000000000");
eth_pkt_inspector);
+ //output_regs->flush_icache = 1;
+
// initialize double buffering state machine for DSP RX -> Ethernet
if (FW_SETS_SEQNO){
dbsm_nop_inspector);
}
+ // puts("post dbsm_init's");
+
// tell app_common that this dbsm could be sending to the ethernet
ac_could_be_sending_to_eth = &dsp_rx_sm;
// program tx registers
setup_tx();
+ // puts("post setup_tx");
+
// kick off the state machine
dbsm_start(&dsp_tx_sm);
+ // puts("post dbsm_start");
+
//int which = 0;
while(1){