mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jan Luebbe <jlu@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 19/19] drivers: net: add driver for TI CPSW
Date: Wed, 19 Dec 2012 22:11:56 +0100	[thread overview]
Message-ID: <20121219211156.GJ26326@pengutronix.de> (raw)
In-Reply-To: <1355840561-11552-20-git-send-email-jlu@pengutronix.de>

On Tue, Dec 18, 2012 at 03:22:41PM +0100, Jan Luebbe wrote:
> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/boards/beaglebone/board.c     |   80 +++
>  arch/arm/mach-omap/include/mach/cpsw.h |   49 ++
>  drivers/net/Kconfig                    |    4 +
>  drivers/net/Makefile                   |    1 +
>  drivers/net/cpsw.c                     | 1021 ++++++++++++++++++++++++++++++++
>  5 files changed, 1155 insertions(+)
>  create mode 100644 arch/arm/mach-omap/include/mach/cpsw.h
>  create mode 100644 drivers/net/cpsw.c
> 
> diff --git a/arch/arm/boards/beaglebone/board.c b/arch/arm/boards/beaglebone/board.c
> index d139e94..20b4bdd 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,6 +43,7 @@
>  #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>
> @@ -306,6 +308,84 @@ static int beaglebone_console_init(void)
>  console_initcall(beaglebone_console_init);
>  #endif /* CONFIG_DRIVER_SERIAL_NS16550 */
>  
> +#ifdef CONFIG_DRIVER_NET_CPSW
> +static void cpsw_control(int enabled)
> +{
> +	return;
> +}
> +
> +static struct cpsw_slave_data cpsw_slaves[] = {
> +	{
> +		.slave_reg_ofs	= 0x208,
> +		.sliver_reg_ofs	= 0xd80,
> +		.phy_id		= 0,
> +		.phy_if		= PHY_INTERFACE_MODE_MII,
> +	},
> +	{
> +		.slave_reg_ofs	= 0x308,
> +		.sliver_reg_ofs	= 0xdc0,
> +		.phy_id		= 1,
> +		.phy_if		= PHY_INTERFACE_MODE_MII,
> +	},
> +};
> +
> +static struct cpsw_platform_data cpsw_data = {
> +	.mdio_base		= AM335X_CPSW_MDIO_BASE,
> +	.cpsw_base		= AM335X_CPSW_BASE,
> +	.mdio_div		= 0xff,
> +	.channels		= 8,
> +	.cpdma_reg_ofs		= 0x800,
> +	.slaves			= 2,
> +	.slave_data		= cpsw_slaves,
> +	.ale_reg_ofs		= 0xd00,
> +	.ale_entries		= 1024,
> +	.host_port_reg_ofs	= 0x108,
> +	.hw_stats_reg_ofs	= 0x900,
> +	.mac_control		= (1 << 5) /* MIIEN */,
> +	.control		= cpsw_control,
> +	.host_port_num		= 0,
> +	.version		= CPSW_CTRL_VERSION_2,
> +};

Most of this looks SoC specific, not board specific. You should use the
platform_device_id mechanism for this.

Sascha

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2012-12-19 21:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 14:22 AM33xx and BeagleBone support Jan Luebbe
2012-12-18 14:22 ` [PATCH 01/19] ARM omap: remove unused function Jan Luebbe
2012-12-18 14:22 ` [PATCH 02/19] ARM omap4: remove unused struct Jan Luebbe
2012-12-18 14:22 ` [PATCH 03/19] ARM omap4: Add missing assembly protection in header file Jan Luebbe
2012-12-18 14:22 ` [PATCH 04/19] ARM omap4: Add missing double include protection Jan Luebbe
2012-12-18 14:22 ` [PATCH 05/19] ARM omap: Make gpmc base runtime configurable Jan Luebbe
2012-12-18 14:22 ` [PATCH 06/19] ARM omap: Make timer " Jan Luebbe
2012-12-18 14:22 ` [PATCH 07/19] ARM omap4: make PRM defines SoC specific Jan Luebbe
2012-12-18 14:22 ` [PATCH 08/19] ARM omap3: " Jan Luebbe
2012-12-18 14:22 ` [PATCH 09/19] ARM omap: Use SoC specific defines for gpmc and timer base Jan Luebbe
2012-12-18 14:22 ` [PATCH 10/19] ARM omap: include individual SoC files Jan Luebbe
2012-12-18 14:22 ` [PATCH 11/19] ARM omap: Add device register convenience functions Jan Luebbe
2012-12-18 14:22 ` [PATCH 12/19] ARM omap3: Use device register functions in boards Jan Luebbe
2012-12-18 14:22 ` [PATCH 13/19] ARM omap4: " Jan Luebbe
2012-12-18 14:22 ` [PATCH 14/19] ARM omap hsmmc: Fix register offset Jan Luebbe
2012-12-18 14:22 ` [PATCH 15/19] ARM omap3: Add change OMAP_ prefix to OMAP3_ for registers Jan Luebbe
2012-12-18 14:22 ` [PATCH 16/19] ARM OMAP AM33XX: create new ARCH for AM33xx Jan Luebbe
2012-12-18 14:22 ` [PATCH 17/19] arm: omap: am33xx: add support for low level debug Jan Luebbe
2012-12-18 14:22 ` [PATCH 18/19] arm: beaglebone: add first-stage support for AM335x and board Jan Luebbe
2012-12-19 12:07   ` Teresa Gámez
2012-12-18 14:22 ` [PATCH 19/19] drivers: net: add driver for TI CPSW Jan Luebbe
2012-12-19 21:11   ` Sascha Hauer [this message]

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=20121219211156.GJ26326@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jlu@pengutronix.de \
    /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