Commit 196719ec authored by Sascha Hauer's avatar Sascha Hauer Committed by David S. Miller
Browse files

fec: Add support for Freescale MX27

parent ccdc4f19
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -1828,11 +1828,11 @@ config 68360_ENET
	  the Motorola 68360 processor.
	  the Motorola 68360 processor.


config FEC
config FEC
	bool "FEC ethernet controller (of ColdFire CPUs)"
	bool "FEC ethernet controller (of ColdFire and some i.MX CPUs)"
	depends on M523x || M527x || M5272 || M528x || M520x
	depends on M523x || M527x || M5272 || M528x || M520x || MACH_MX27
	help
	help
	  Say Y here if you want to use the built-in 10/100 Fast ethernet
	  Say Y here if you want to use the built-in 10/100 Fast ethernet
	  controller on some Motorola ColdFire processors.
	  controller on some Motorola ColdFire and Freescale i.MX processors.


config FEC2
config FEC2
	bool "Second FEC ethernet controller (on some ColdFire CPUs)"
	bool "Second FEC ethernet controller (on some ColdFire CPUs)"
+13 −2
Original line number Original line Diff line number Diff line
@@ -38,10 +38,14 @@
#include <linux/bitops.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/irq.h>
#include <linux/clk.h>


#include <asm/cacheflush.h>
#include <asm/cacheflush.h>

#ifndef CONFIG_ARCH_MXC
#include <asm/coldfire.h>
#include <asm/coldfire.h>
#include <asm/mcfsim.h>
#include <asm/mcfsim.h>
#endif


#include "fec.h"
#include "fec.h"


@@ -51,6 +55,13 @@
#define	FEC_MAX_PORTS	1
#define	FEC_MAX_PORTS	1
#endif
#endif


#ifdef CONFIG_ARCH_MXC
#include <mach/hardware.h>
#define FEC_ALIGNMENT	0xf
#else
#define FEC_ALIGNMENT	0x3
#endif

#if defined(CONFIG_M5272)
#if defined(CONFIG_M5272)
#define HAVE_mii_link_interrupt
#define HAVE_mii_link_interrupt
#endif
#endif
@@ -158,7 +169,7 @@ typedef struct {
 * account when setting it.
 * account when setting it.
 */
 */
#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
    defined(CONFIG_M520x) || defined(CONFIG_M532x)
    defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC)
#define	OPT_FRAME_SIZE	(PKT_MAXBUF_SIZE << 16)
#define	OPT_FRAME_SIZE	(PKT_MAXBUF_SIZE << 16)
#else
#else
#define	OPT_FRAME_SIZE	0
#define	OPT_FRAME_SIZE	0
@@ -339,7 +350,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
	 *	4-byte boundaries. Use bounce buffers to copy data
	 *	4-byte boundaries. Use bounce buffers to copy data
	 *	and get it aligned. Ugh.
	 *	and get it aligned. Ugh.
	 */
	 */
	if (bdp->cbd_bufaddr & 0x3) {
	if (bdp->cbd_bufaddr & FEC_ALIGNMENT) {
		unsigned int index;
		unsigned int index;
		index = bdp - fep->tx_bd_base;
		index = bdp - fep->tx_bd_base;
		memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len);
		memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len);
+9 −2
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
/****************************************************************************/
/****************************************************************************/


#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
    defined(CONFIG_M520x) || defined(CONFIG_M532x)
    defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC)
/*
/*
 *	Just figures, Motorola would have to change the offsets for
 *	Just figures, Motorola would have to change the offsets for
 *	registers in the same peripheral device on different models
 *	registers in the same peripheral device on different models
@@ -103,12 +103,19 @@ typedef struct fec {
/*
/*
 *	Define the buffer descriptor structure.
 *	Define the buffer descriptor structure.
 */
 */
#ifdef CONFIG_ARCH_MXC
typedef struct bufdesc {
	unsigned short cbd_datlen;	/* Data length */
	unsigned short cbd_sc;	/* Control and status info */
	unsigned long cbd_bufaddr;	/* Buffer address */
} cbd_t;
#else
typedef struct bufdesc {
typedef struct bufdesc {
	unsigned short	cbd_sc;			/* Control and status info */
	unsigned short	cbd_sc;			/* Control and status info */
	unsigned short	cbd_datlen;		/* Data length */
	unsigned short	cbd_datlen;		/* Data length */
	unsigned long	cbd_bufaddr;		/* Buffer address */
	unsigned long	cbd_bufaddr;		/* Buffer address */
} cbd_t;
} cbd_t;

#endif


/*
/*
 *	The following definitions courtesy of commproc.h, which where
 *	The following definitions courtesy of commproc.h, which where