backport some mainline fixes, refresh mtd driver

SVN-Revision: 16485
owl
Florian Fainelli 2009-06-16 22:01:24 +00:00
parent 3f64510d74
commit eb68c90f82
2 changed files with 52 additions and 6 deletions

View File

@ -193,3 +193,49 @@
/* Link new device into r6040_root_dev */ /* Link new device into r6040_root_dev */
lp->pdev = pdev; lp->pdev = pdev;
lp->dev = dev; lp->dev = dev;
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -742,6 +742,14 @@ static int r6040_up(struct net_device *d
struct r6040_private *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base;
int ret;
+ u16 val;
+
+ /* Check presence of a second PHY */
+ val = r6040_phy_read(ioaddr, lp->phy_addr, 2);
+ if (val == 0xFFFF) {
+ printk(KERN_ERR DRV_NAME " no second PHY attached\n");
+ return -EIO;
+ }
/* Initialise and alloc RX/TX buffers */
r6040_init_txbufs(dev);
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -401,6 +401,9 @@ static void r6040_init_mac_regs(struct n
* we may got called by r6040_tx_timeout which has left
* some unsent tx buffers */
iowrite16(0x01, ioaddr + MTPR);
+
+ /* Check media */
+ mii_check_media(&lp->mii_if, 1, 1);
}
static void r6040_tx_timeout(struct net_device *dev)
@@ -528,6 +531,8 @@ static int r6040_phy_mode_chk(struct net
phy_dat = 0x0000;
}
+ mii_check_media(&lp->mii_if, 0, 1);
+
return phy_dat;
};
@@ -810,7 +815,6 @@ static void r6040_timer(unsigned long da
lp->phy_mode = phy_mode;
lp->mcr0 = (lp->mcr0 & 0x7fff) | phy_mode;
iowrite16(lp->mcr0, ioaddr);
- printk(KERN_INFO "Link Change %x \n", ioread16(ioaddr));
}
/* Timer active again */

View File

@ -1,6 +1,6 @@
--- a/drivers/mtd/maps/Kconfig 2009-05-07 00:51:33.000000000 +0200 --- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig 2009-05-07 01:08:25.000000000 +0200 +++ b/drivers/mtd/maps/Kconfig
@@ -156,6 +156,12 @@ @@ -156,6 +156,12 @@ config MTD_RDC3210_BUSWIDTH
Number of bytes addressed on the RDC-3210 flash device before Number of bytes addressed on the RDC-3210 flash device before
addressing the same chip again addressing the same chip again
@ -13,9 +13,9 @@
config MTD_SC520CDP config MTD_SC520CDP
tristate "CFI Flash device mapped on AMD SC520 CDP" tristate "CFI Flash device mapped on AMD SC520 CDP"
depends on X86 && MTD_CFI && MTD_CONCAT depends on X86 && MTD_CFI && MTD_CONCAT
--- a/drivers/mtd/maps/Makefile 2009-05-07 00:51:33.000000000 +0200 --- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile 2009-05-07 01:07:28.000000000 +0200 +++ b/drivers/mtd/maps/Makefile
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@ obj-$(CONFIG_MTD_PMC_MSP_EVM) += pmcms
obj-$(CONFIG_MTD_PMC_MSP_RAMROOT)+= pmcmsp-ramroot.o obj-$(CONFIG_MTD_PMC_MSP_RAMROOT)+= pmcmsp-ramroot.o
obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o
obj-$(CONFIG_MTD_RDC3210) += rdc3210.o obj-$(CONFIG_MTD_RDC3210) += rdc3210.o