Hi, Michael Walle has been working on a port of uMon (http://umonfw.com/) to Milkymist lately: http://git.serverraum.org/?p=mw/micromonitor-lm32.git;a=summary
It's working on the board, including Ethernet and we can ping it, do TFTP transfers, etc. See the attached photo. I am sending a patch that fixes problems in the Ethernet driver and disables the features that cause problems on the board. Please merge it (and also add the stdlib.h and math.h headers?) Thanks, Sébastien
<<attachment: umon_mm.jpg>>
diff --git a/umon_ports/milkymist/config.h b/umon_ports/milkymist/config.h
index c8560f1..73ebf41 100644
--- a/umon_ports/milkymist/config.h
+++ b/umon_ports/milkymist/config.h
@@ -155,26 +155,26 @@
#define INCLUDE_MEMCMDS 1
#define INCLUDE_SHELLVARS 1
#define INCLUDE_XMODEM 1
-#define INCLUDE_EDIT 1
+#define INCLUDE_EDIT 0
#define INCLUDE_DISASSEMBLER 0
#define INCLUDE_UNZIP 1
#define INCLUDE_ETHERNET 1
#define INCLUDE_ICMP 1
#define INCLUDE_TFTP 1
-#define INCLUDE_TFS 1
-#define INCLUDE_FLASH 1
+#define INCLUDE_TFS 0
+#define INCLUDE_FLASH 0
#define INCLUDE_LINEEDIT 1
#define INCLUDE_DHCPBOOT 1
-#define INCLUDE_TFSAPI 1
-#define INCLUDE_TFSSYMTBL 1
-#define INCLUDE_TFSSCRIPT 1
-#define INCLUDE_TFSCLI 1
+#define INCLUDE_TFSAPI 0
+#define INCLUDE_TFSSYMTBL 0
+#define INCLUDE_TFSSCRIPT 0
+#define INCLUDE_TFSCLI 0
#define INCLUDE_EE 1
#define INCLUDE_GDB 1
#define INCLUDE_STRACE 0
#define INCLUDE_CAST 0
#define INCLUDE_STRUCT 0
-#define INCLUDE_REDIRECT 1
+#define INCLUDE_REDIRECT 0
#define INCLUDE_QUICKMEMCPY 0
#define INCLUDE_PROFILER 0
#define INCLUDE_BBC 0
@@ -185,7 +185,7 @@
#define INCLUDE_PORTCMD 0
#define INCLUDE_USRLVL 0
#define INCLUDE_FBI 1
-#define INCLUDE_PS2KBD 1
+#define INCLUDE_PS2KBD 0
/* Some fine tuning (if needed)...
* If these #defines are not in config.h, they default to '1' in
diff --git a/umon_ports/milkymist/cpuio.h b/umon_ports/milkymist/cpuio.h
index 9f1c926..19cd9e7 100644
--- a/umon_ports/milkymist/cpuio.h
+++ b/umon_ports/milkymist/cpuio.h
@@ -1,6 +1,6 @@
#define MONARGV0 "umon"
#define DEFAULT_BAUD_RATE 115200
-#define CPU_FREQUENCY 83333333
+#define CPU_FREQUENCY 100000000
#define MMPTR(x) (*((volatile unsigned int *)(x)))
diff --git a/umon_ports/milkymist/etherdev.c b/umon_ports/milkymist/etherdev.c
index 13115e7..7a9e7d7 100644
--- a/umon_ports/milkymist/etherdev.c
+++ b/umon_ports/milkymist/etherdev.c
@@ -24,7 +24,7 @@ static uchar *tx_buf;
static uchar *rx_buf;
static uchar *rx_buf_back;
-static uchar _buffers[3*PKT_BUF_LEN];
+static uchar _buffers[3*PKT_BUF_LEN] __attribute__((aligned(4)));
static struct {
ulong tx_pkt;
@@ -75,7 +75,7 @@ eninit(void)
rx_buf_back = _buffers + 2*PKT_BUF_LEN;
/* Set preamble and SFD for the TX buffer */
- memset(tx_buf, preamble_sfd, sizeof(preamble_sfd));
+ memcpy(tx_buf, preamble_sfd, sizeof(preamble_sfd));
/* Initialize the MAC */
MINIMAC_ADDR0 = (unsigned int)rx_buf_back;
@@ -181,15 +181,10 @@ sendBuffer(int length)
uchar *tx_pkt = tx_buf + sizeof(preamble_sfd);
-#if INCLUDE_ETHERVERBOSE
- if (EtherVerbose & SHOW_OUTGOING)
- printPkt((struct ether_header *)tx_pkt, length, ETHER_OUTGOING);
-#endif
-
- /* Bump up the packet length to a minimum of 64 bytes.
+ /* Bump up the packet length to a minimum of 60 bytes.
*/
- if (length < 64)
- length = 64;
+ if (length < 60)
+ length = 60;
/* Add the code that will tickle the device into sending out the
* buffer that was previously returned by getXmitBuffer() above...
@@ -199,12 +194,17 @@ sendBuffer(int length)
tx_pkt[length + 1] = (crc & 0xff00) >> 8;
tx_pkt[length + 2] = (crc & 0xff0000) >> 16;
tx_pkt[length + 3] = (crc & 0xff000000) >> 24;
+
+ length += 4;
- length += 12;
+ #if INCLUDE_ETHERVERBOSE
+ if (EtherVerbose & SHOW_OUTGOING)
+ printPkt((struct ether_header *)tx_pkt, length, ETHER_OUTGOING);
+ #endif
MINIMAC_TXADDR = (unsigned int) tx_buf;
- MINIMAC_TXREMAINING = length;
-
+ MINIMAC_TXREMAINING = length + 8; /* including preamble */
+
EtherXFRAMECnt++;
return(0);
}
_______________________________________________ http://lists.milkymist.org/listinfo.cgi/devel-milkymist.org IRC: #milkym...@freenode Webchat: www.milkymist.org/irc.html Wiki: www.milkymist.org/wiki
