Clean up dependency in bit-banged MDIO
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
@@ -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
@@ -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