mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Beniamino Galvani <b.galvani@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] openrisc: enable OpenCores ethernet driver
Date: Sun, 15 Dec 2013 18:17:26 +0100	[thread overview]
Message-ID: <1387127846-27477-2-git-send-email-b.galvani@gmail.com> (raw)
In-Reply-To: <1387127846-27477-1-git-send-email-b.galvani@gmail.com>

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.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
---
 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(+)

diff --git a/arch/openrisc/boards/generic/config.h b/arch/openrisc/boards/generic/config.h
index 95260cd..6ebab42 100644
--- a/arch/openrisc/boards/generic/config.h
+++ b/arch/openrisc/boards/generic/config.h
@@ -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
 
diff --git a/arch/openrisc/boards/generic/generic.c b/arch/openrisc/boards/generic/generic.c
index e366d85..290e05c 100644
--- a/arch/openrisc/boards/generic/generic.c
+++ b/arch/openrisc/boards/generic/generic.c
@@ -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;
 }
 
diff --git a/arch/openrisc/configs/generic_defconfig b/arch/openrisc/configs/generic_defconfig
index 7ae85b0..53ff671 100644
--- a/arch/openrisc/configs/generic_defconfig
+++ b/arch/openrisc/configs/generic_defconfig
@@ -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
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-12-15 17:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-15 17:17 [PATCH 1/2] net: add driver for OpenCores 10/100 Mbps ethernet MAC Beniamino Galvani
2013-12-15 17:17 ` Beniamino Galvani [this message]
2013-12-17  7:24 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1387127846-27477-2-git-send-email-b.galvani@gmail.com \
    --to=b.galvani@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox