software/libnet: remove use of ethmac_mem.h
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 12 Apr 2019 15:08:29 +0000 (17:08 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Fri, 12 Apr 2019 15:08:29 +0000 (17:08 +0200)
litex/soc/software/include/hw/ethmac_mem.h [deleted file]
litex/soc/software/libnet/microudp.c

diff --git a/litex/soc/software/include/hw/ethmac_mem.h b/litex/soc/software/include/hw/ethmac_mem.h
deleted file mode 100644 (file)
index 03c7b96..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __HW_ETHMAC_MEM_H
-#define __HW_ETHMAC_MEM_H
-
-#include <generated/mem.h>
-
-#define ETHMAC_RX0_BASE        ETHMAC_BASE
-#define ETHMAC_RX1_BASE        (ETHMAC_BASE+0x0800)
-#define ETHMAC_TX0_BASE        (ETHMAC_BASE+0x1000)
-#define ETHMAC_TX1_BASE        (ETHMAC_BASE+0x1800)
-
-#endif
index 1850a274ac9dca576a29d315c8ec567beea47a9a..90b73a7e11e537db1c65246120668f18b6b2dcbe 100644 (file)
@@ -1,4 +1,6 @@
 #include <generated/csr.h>
+#include <generated/mem.h>
+
 #ifdef CSR_ETHMAC_BASE
 
 #include <stdio.h>
@@ -6,7 +8,6 @@
 #include <system.h>
 #include <crc.h>
 #include <hw/flags.h>
-#include <hw/ethmac_mem.h>
 
 #include <net/microudp.h>
 
@@ -415,10 +416,10 @@ void microudp_start(const unsigned char *macaddr, unsigned int ip)
        ethmac_sram_reader_ev_pending_write(ETHMAC_EV_SRAM_READER);
        ethmac_sram_writer_ev_pending_write(ETHMAC_EV_SRAM_WRITER);
 
-       rxbuffer0 = (ethernet_buffer *)ETHMAC_RX0_BASE;
-       rxbuffer1 = (ethernet_buffer *)ETHMAC_RX1_BASE;
-       txbuffer0 = (ethernet_buffer *)ETHMAC_TX0_BASE;
-       txbuffer1 = (ethernet_buffer *)ETHMAC_TX1_BASE;
+       rxbuffer0 = (ethernet_buffer *)(ETHMAC_BASE + 0*ETHMAC_SLOT_SIZE);
+       rxbuffer1 = (ethernet_buffer *)(ETHMAC_BASE + 1*ETHMAC_SLOT_SIZE);
+       txbuffer0 = (ethernet_buffer *)(ETHMAC_BASE + 2*ETHMAC_SLOT_SIZE);
+       txbuffer1 = (ethernet_buffer *)(ETHMAC_BASE + 3*ETHMAC_SLOT_SIZE);
 
        rxslot = 0;
        txslot = 0;