From: "Teresa Gámez" <t.gamez@phytec.de>
To: barebox@lists.infradead.org
Subject: [PATCH] ARM: AM33xx: pcm051: Add network support
Date: Wed, 19 Jun 2013 09:11:22 +0200 [thread overview]
Message-ID: <1371625882-28767-1-git-send-email-t.gamez@phytec.de> (raw)
Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
arch/arm/boards/pcm051/board.c | 28 ++++++++++++++++++++++++++++
arch/arm/configs/pcm051_defconfig | 5 +++++
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/arch/arm/boards/pcm051/board.c b/arch/arm/boards/pcm051/board.c
index f0eaa01..0ad8cb4 100644
--- a/arch/arm/boards/pcm051/board.c
+++ b/arch/arm/boards/pcm051/board.c
@@ -19,13 +19,17 @@
#include <common.h>
#include <init.h>
+#include <io.h>
#include <sizes.h>
#include <ns16550.h>
#include <asm/armlinux.h>
#include <generated/mach-types.h>
+#include <linux/phy.h>
#include <mach/am33xx-devices.h>
+#include <mach/am33xx-generic.h>
#include <mach/am33xx-mux.h>
#include <mach/am33xx-silicon.h>
+#include <mach/cpsw.h>
#include <spi/spi.h>
#include <spi/flash.h>
@@ -73,6 +77,18 @@ static struct spi_board_info pcm051_spi_board_info[] = {
},
};
+static struct cpsw_slave_data cpsw_slaves[] = {
+ {
+ .phy_id = 0,
+ .phy_if = PHY_INTERFACE_MODE_RMII,
+ },
+};
+
+static struct cpsw_platform_data cpsw_data = {
+ .slave_data = cpsw_slaves,
+ .num_slaves = ARRAY_SIZE(cpsw_slaves),
+};
+
static void pcm051_spi_init(void)
{
int ret;
@@ -84,6 +100,17 @@ static void pcm051_spi_init(void)
am33xx_add_spi0();
}
+static void pcm051_eth_init(void)
+{
+ am33xx_register_ethaddr(0, 0);
+
+ writel(0x49, AM33XX_MAC_MII_SEL);
+
+ am33xx_enable_rmii1_pin_mux();
+
+ am33xx_add_cpsw(&cpsw_data);
+}
+
static int pcm051_devices_init(void)
{
pcm051_enable_mmc0_pin_mux();
@@ -91,6 +118,7 @@ static int pcm051_devices_init(void)
am33xx_add_mmc0(NULL);
pcm051_spi_init();
+ pcm051_eth_init();
devfs_add_partition("nor0", 0x00000, SZ_128K,
DEVFS_PARTITION_FIXED, "xload");
diff --git a/arch/arm/configs/pcm051_defconfig b/arch/arm/configs/pcm051_defconfig
index 90c2b50..804ca14 100644
--- a/arch/arm/configs/pcm051_defconfig
+++ b/arch/arm/configs/pcm051_defconfig
@@ -42,8 +42,13 @@ CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_UNCOMPRESS=y
+CONFIG_NET=y
+CONFIG_NET_DHCP=y
+CONFIG_NET_NFS=y
+CONFIG_NET_PING=y
CONFIG_DRIVER_SERIAL_NS16550=y
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
+CONFIG_DRIVER_NET_CPSW=y
CONFIG_DRIVER_SPI_OMAP3=y
CONFIG_MTD=y
CONFIG_MTD_M25P80=y
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2013-06-19 7:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 7:11 Teresa Gámez [this message]
2013-06-19 19:52 ` 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=1371625882-28767-1-git-send-email-t.gamez@phytec.de \
--to=t.gamez@phytec.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