Skip to contentSkip to conversation

Clean up dependency in bit-banged MDIO

PATCH New Ben Warren 1 participant 1 message Sep 26, 2006

lore
Share & tools
lore

Ben Warren

author
#0 lore raw

PATCH 1/1 Clean up dependency in bit-banged MDIO

Hello,

Attached is a patch that allows use of memory-mapped devices other than CPU GPIO on boards when bit-banging MDIO. The config option MDIO_PORT is now the differentiator as to whether the memory mapped device is on a CPU port or not.

CHANGELOG:

* Changed conditional inclusion of ioport variable to boards that define the MDIO_PORT macro.

regards,
Ben

include/configs/ep8248.h +1 -1
index 04147a5..f6515b3 100644
@@ -102,7 +102,7 @@
 /*
  * GPIO pins used for bit-banged MII communications
  */
-#define MDIO_PORT		0	/* Not used - implemented in BCSR */
+#undef MDIO_PORT			/* Not used - implemented in BCSR */
 #define MDIO_ACTIVE		(*(vu_char *)(CFG_BCSR + 8) &= 0xFB)
 #define MDIO_TRISTATE		(*(vu_char *)(CFG_BCSR + 8) |= 0x04)
 #define MDIO_READ		(*(vu_char *)(CFG_BCSR + 8) & 1)
common/miiphybb.c +0 -0
index adb697c..9ea5636 100644
@@ -41,7 +41,7 @@
 static void miiphy_pre (char read, unsigned char addr, unsigned char

reg)
{
int j; /* counter */
-#ifndef CONFIG_EP8248
+#if defined(MDIO_PORT)
volatile ioport_t *iop = ioport_addr ((immap_t *) CFG_IMMR,
MDIO_PORT);
#endif

@@ -126,7 +126,7 @@ int bb_miiphy_read (char *devname, unsig
{
short rdreg; /* register working value */
int j; /* counter */
-#ifndef CONFIG_EP8248
+#if defined(MDIO_PORT)
volatile ioport_t *iop = ioport_addr ((immap_t *) CFG_IMMR,
MDIO_PORT);
#endif

@@ -193,7 +193,7 @@ int bb_miiphy_write (char *devname, unsi
unsigned char reg, unsigned short value)
{
int j; /* counter */
-#ifndef CONFIG_EP8248
+#if defined(MDIO_PORT)
volatile ioport_t *iop = ioport_addr ((immap_t *) CFG_IMMR,
MDIO_PORT);
#endif