mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/4] ARM beaglebone: Add network support
Date: Wed,  9 Jan 2013 12:02:45 +0100	[thread overview]
Message-ID: <1357729366-2686-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1357729366-2686-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/beaglebone/board.c |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/arch/arm/boards/beaglebone/board.c b/arch/arm/boards/beaglebone/board.c
index f9ac7a4..fddfd03 100644
--- a/arch/arm/boards/beaglebone/board.c
+++ b/arch/arm/boards/beaglebone/board.c
@@ -31,6 +31,7 @@
 #include <sizes.h>
 #include <io.h>
 #include <ns16550.h>
+#include <net.h>
 #include <asm/armlinux.h>
 #include <generated/mach-types.h>
 #include <mach/am33xx-silicon.h>
@@ -42,11 +43,14 @@
 #include <mach/ehci.h>
 #include <i2c/i2c.h>
 #include <linux/err.h>
+#include <linux/phy.h>
 #include <usb/ehci.h>
 #include <mach/xload.h>
 #include <mach/am33xx-devices.h>
 #include <mach/am33xx-mux.h>
 #include <mach/wdt.h>
+#include <mach/am33xx-generic.h>
+#include <mach/cpsw.h>
 
 /* UART Defines */
 #define UART_SYSCFG_OFFSET  (0x54)
@@ -313,11 +317,35 @@ static int beaglebone_mem_init(void)
 }
 mem_initcall(beaglebone_mem_init);
 
+static struct cpsw_slave_data cpsw_slaves[] = {
+	{
+		.phy_id		= 0,
+		.phy_if		= PHY_INTERFACE_MODE_MII,
+	},
+};
+
+static struct cpsw_platform_data cpsw_data = {
+	.slave_data		= cpsw_slaves,
+	.num_slaves		= ARRAY_SIZE(cpsw_slaves),
+};
+
+static void beaglebone_eth_init(void)
+{
+	am33xx_register_ethaddr(0, 0);
+
+	writel(0, AM33XX_MAC_MII_SEL);
+
+	enable_mii1_pin_mux();
+
+	am33xx_add_cpsw(&cpsw_data);
+}
+
 static int beaglebone_devices_init(void)
 {
 	am33xx_add_mmc0(NULL);
 
 	enable_i2c0_pin_mux();
+	beaglebone_eth_init();
 
 	armlinux_set_bootparams((void *)0x80000100);
 	armlinux_set_architecture(MACH_TYPE_BEAGLEBONE);
-- 
1.7.10.4


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

  parent reply	other threads:[~2013-01-09 11:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-09 11:02 [PATCH] Add am33xx/beaglebone " Sascha Hauer
2013-01-09 11:02 ` [PATCH 1/4] drivers: net: add driver for TI CPSW Sascha Hauer
2013-01-09 11:02 ` [PATCH 2/4] ARM am33xx: Add cpws convenience functions Sascha Hauer
2013-01-09 11:02 ` Sascha Hauer [this message]
2013-01-09 11:02 ` [PATCH 4/4] ARM beaglebone: update defconfig for networking 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=1357729366-2686-4-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --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