Skip to contentSkip to conversation

net: add driver for OpenCores 10/100 Mbps ethernet MAC

PATCH In review Beniamino Galvani 2 participants 3 messages Dec 15, 2013 – Dec 17, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 net: add driver for OpenCores 10/100 Mbps ethernet MAC

This patch introduces a driver for the OpenCores 10/100 Mbps ethernet MAC core, ported from Linux kernel with small changes.

---
 drivers/net/Kconfig  |    6 +
 drivers/net/Makefile |    1 +
 drivers/net/ethoc.c  |  515 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 522 insertions(+)
 create mode 100644 drivers/net/ethoc.c
drivers/net/Kconfig +6 -0
index c626416..bc341c1 100644
@@ -139,6 +139,12 @@ config DRIVER_NET_GIANFAR
 	depends on ARCH_MPC85XX
 	select PHYLIB
 
+config DRIVER_NET_ETHOC
+	bool "OpenCores ethernet MAC driver"
+	help
+	  This option enables support for the OpenCores 10/100 Mbps
+	  Ethernet MAC core.
+
 source "drivers/net/usb/Kconfig"
 
 config DRIVER_NET_MICREL
drivers/net/Makefile +1 -0
index 73403fe..ffb40ae 100644
@@ -20,3 +20,4 @@ obj-$(CONFIG_DRIVER_NET_KS8851_MLL)	+= ks8851_mll.o
 obj-$(CONFIG_DRIVER_NET_DESIGNWARE)	+= designware.o
 obj-$(CONFIG_DRIVER_NET_GIANFAR)	+= gianfar.o
 obj-$(CONFIG_DRIVER_NET_MICREL)		+= ksz8864rmn.o
+obj-$(CONFIG_DRIVER_NET_ETHOC)		+= ethoc.o
drivers/net/ethoc.c new file +515 -0

515 lines not on this page · raw message

Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 2/2 openrisc: enable OpenCores ethernet driver

The OpenCores 10/100 Mbps ethernet MAC is often available on OpenRISC-based SoCs and is supported by the OpenRISC architectural simulator (or1ksim) as well.

The patch enables the driver on the 'generic' openrisc board.

---
 arch/openrisc/boards/generic/config.h   |    2 ++
 arch/openrisc/boards/generic/generic.c  |    7 +++++++
 arch/openrisc/configs/generic_defconfig |    6 ++++++
 3 files changed, 15 insertions(+)
arch/openrisc/boards/generic/config.h +2 -0
index 95260cd..6ebab42 100644
@@ -11,6 +11,8 @@
 #define OPENRISC_SOPC_UART_FREQ		CONFIG_SYS_CLK_FREQ
 #define OPENRISC_SOPC_UART_BASE		0x90000000
 
+#define OPENRISC_SOPC_ETHOC_BASE	0x92000000
+
 /* We reserve 256K for barebox */
 #define BAREBOX_RESERVED_SIZE		0x40000
 
arch/openrisc/boards/generic/generic.c +7 -0
index e366d85..290e05c 100644
@@ -16,6 +16,13 @@ static int openrisc_console_init(void)
 
 	/* Register the serial port */
 	add_ns16550_device(DEVICE_ID_DYNAMIC, OPENRISC_SOPC_UART_BASE, 1024, IORESOURCE_MEM_8BIT, &serial_plat);
+
+#ifdef CONFIG_DRIVER_NET_ETHOC
+	add_generic_device("ethoc", DEVICE_ID_DYNAMIC, NULL,
+			   OPENRISC_SOPC_ETHOC_BASE, 0x1000,
+			   IORESOURCE_MEM, NULL);
+#endif
+
 	return 0;
 }
 
arch/openrisc/configs/generic_defconfig +6 -0
index 7ae85b0..53ff671 100644
@@ -18,3 +18,9 @@ CONFIG_CMD_GO=y
 CONFIG_CMD_TIMEOUT=y
 CONFIG_CMD_PARTITION=y
 CONFIG_DRIVER_SERIAL_NS16550=y
+CONFIG_NET=y
+CONFIG_NET_DHCP=y
+CONFIG_NET_PING=y
+CONFIG_CMD_TFTP=y
+CONFIG_FS_TFTP=y
+CONFIG_DRIVER_NET_ETHOC=y
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw
In reply to Beniamino Galvani

Hi Beniamino,

Quoted 4 lines · Beniamino Galvani

This patch introduces a driver for the OpenCores 10/100 Mbps ethernet MAC core, ported from Linux kernel with small changes.

Both patches look good, so: Applied.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox