get rid of even more 2.6.28 stuff

SVN-Revision: 18953
This commit is contained in:
Imre Kaloz
2009-12-27 21:35:42 +00:00
parent 1fe38ff73b
commit 06d8dc9329
54 changed files with 1 additions and 76337 deletions

View File

@@ -1,63 +0,0 @@
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -112,6 +112,50 @@ config MTD_SUN_UFLASH
Sun Microsystems boardsets. This driver will require CFI support
in the kernel, so if you did not enable CFI previously, do that now.
+config MTD_RDC3210
+ tristate "CFI Flash device mapped on RDC3210"
+ depends on X86 && MTD_CFI && MTD_PARTITIONS
+ help
+ RDC-3210 is the flash device we find on Ralink reference board.
+
+config MTD_RDC3210_STATIC_MAP
+ bool "Partitions on RDC3210 mapped statically" if MTD_RDC3210
+ select MTD_RDC3210_FACTORY_PRESENT
+ help
+ The mapping driver will use the static partition map for the
+ RDC-3210 flash device.
+
+config MTD_RDC3210_FACTORY_PRESENT
+ bool "Reserve a partition on RDC3210 for factory presets"
+ depends on MTD_RDC3210
+ default y
+ help
+ The mapping driver will reserve a partition on the RDC-3210 flash
+ device for resetting flash contents to factory defaults.
+
+config MTD_RDC3210_ALLOW_JFFS2
+ bool "JFFS2 filesystem usable in a partition on RDC3210"
+ depends on MTD_RDC3210 && !MTD_RDC3210_STATIC_MAP
+ help
+ The mapping driver will align a partition on the RDC-3210 flash
+ device to an erase-block boundary so that a JFFS2 filesystem may
+ reside on it.
+
+config MTD_RDC3210_SIZE
+ hex "Amount of flash memory on RDC3210"
+ depends on MTD_RDC3210
+ default "0x400000"
+ help
+ Total size in bytes of the RDC-3210 flash device
+
+config MTD_RDC3210_BUSWIDTH
+ int "Width of CFI Flash device mapped on RDC3210"
+ depends on MTD_RDC3210
+ default "2"
+ help
+ Number of bytes addressed on the RDC-3210 flash device before
+ addressing the same chip again
+
config MTD_SC520CDP
tristate "CFI Flash device mapped on AMD SC520 CDP"
depends on X86 && MTD_CFI && MTD_CONCAT
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -27,6 +27,7 @@ obj-$(CONFIG_MTD_PHYSMAP_OF) += physmap_
obj-$(CONFIG_MTD_PMC_MSP_EVM) += pmcmsp-flash.o
obj-$(CONFIG_MTD_PMC_MSP_RAMROOT)+= pmcmsp-ramroot.o
obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o
+obj-$(CONFIG_MTD_RDC3210) += rdc3210.o
obj-$(CONFIG_MTD_RPXLITE) += rpxlite.o
obj-$(CONFIG_MTD_TQM8XXL) += tqm8xxl.o
obj-$(CONFIG_MTD_SA1100) += sa1100-flash.o

View File

@@ -1,334 +0,0 @@
Index: linux-2.6.28.10/arch/x86/mach-rdc321x/gpio.c
===================================================================
--- linux-2.6.28.10.orig/arch/x86/mach-rdc321x/gpio.c 2009-11-03 21:01:29.800401126 -0800
+++ linux-2.6.28.10/arch/x86/mach-rdc321x/gpio.c 2009-11-03 21:01:32.164401226 -0800
@@ -26,7 +26,7 @@
#include <linux/types.h>
#include <linux/module.h>
-#include <asm/gpio.h>
+#include <asm/mach-rdc321x/gpio.h>
#include <asm/mach-rdc321x/rdc321x_defs.h>
@@ -74,8 +74,8 @@
}
/* initially setup the 2 copies of the gpio data registers.
- This function must be called by the platform setup code. */
-void __init rdc321x_gpio_setup()
+ This function is called before the platform setup code. */
+static int __init rdc321x_gpio_setup(void)
{
/* this might not be, what others (BIOS, bootloader, etc.)
wrote to these registers before, but it's a good guess. Still
@@ -83,6 +83,8 @@
gpio_data_reg1 = rdc321x_conf_read(RDC321X_GPIO_DATA_REG1);
gpio_data_reg2 = rdc321x_conf_read(RDC321X_GPIO_DATA_REG2);
+
+ return 0;
}
/* determine, if gpio number is valid */
@@ -192,3 +194,5 @@
return 0;
}
EXPORT_SYMBOL(rdc_gpio_direction_output);
+
+arch_initcall(rdc321x_gpio_setup);
Index: linux-2.6.28.10/arch/x86/mach-rdc321x/platform.c
===================================================================
--- linux-2.6.28.10.orig/arch/x86/mach-rdc321x/platform.c 2009-11-03 21:01:29.836402559 -0800
+++ linux-2.6.28.10/arch/x86/mach-rdc321x/platform.c 2009-11-03 21:13:27.212398945 -0800
@@ -1,7 +1,9 @@
/*
* Generic RDC321x platform devices
*
+ * Copyright (C) 2007-2008 OpenWrt.org
* Copyright (C) 2007 Florian Fainelli <florian@openwrt.org>
+ * Copyright (C) 2008 Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -25,13 +27,59 @@
#include <linux/list.h>
#include <linux/device.h>
#include <linux/platform_device.h>
+#include <linux/version.h>
#include <linux/leds.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/physmap.h>
+#include <linux/root_dev.h>
-#include <asm/gpio.h>
+#include <asm/mach-rdc321x/gpio.h>
+
+/* Flash */
+#ifdef CONFIG_MTD_R8610
+#define CONFIG_MTD_RDC3210 1
+#elif defined CONFIG_MTD_RDC3210
+static struct resource rdc_flash_resource[] = {
+ [0] = {
+ .start = (u32)-CONFIG_MTD_RDC3210_SIZE,
+ .end = (u32)-1,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct platform_device rdc_flash_device = {
+ .name = "rdc321x-flash",
+ .id = -1,
+ .num_resources = ARRAY_SIZE(rdc_flash_resource),
+ .resource = rdc_flash_resource,
+};
+#else
+static struct mtd_partition rdc_flash_parts[15];
+
+static struct resource rdc_flash_resource = {
+ .end = (u32)-1,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct physmap_flash_data rdc_flash_data = {
+ .parts = rdc_flash_parts,
+};
+
+static struct platform_device rdc_flash_device = {
+ .name = "physmap-flash",
+ .id = -1,
+ .resource = &rdc_flash_resource,
+ .num_resources = 1,
+ .dev.platform_data = &rdc_flash_data,
+};
+#endif
/* LEDS */
static struct gpio_led default_leds[] = {
- { .name = "rdc:dmz", .gpio = 1, },
+ { .name = "rdc321x:dmz", .gpio = 1, },
};
static struct gpio_led_platform_data rdc321x_led_data = {
@@ -54,16 +102,189 @@
.num_resources = 0,
};
+/* Button */
+static struct gpio_keys_button rdc321x_gpio_btn[] = {
+ {
+ .gpio = 0,
+ .code = BTN_0,
+ .desc = "Reset",
+ .active_low = 1,
+ }
+};
+
+static struct gpio_keys_platform_data rdc321x_gpio_btn_data = {
+ .buttons = rdc321x_gpio_btn,
+ .nbuttons = ARRAY_SIZE(rdc321x_gpio_btn),
+};
+
+static struct platform_device rdc321x_button = {
+ .name = "gpio-keys",
+ .id = -1,
+ .dev = {
+ .platform_data = &rdc321x_gpio_btn_data,
+ }
+};
+
static struct platform_device *rdc321x_devs[] = {
+ &rdc_flash_device,
&rdc321x_leds,
- &rdc321x_wdt
+ &rdc321x_wdt,
+ &rdc321x_button,
};
+static int probe_flash_start(struct map_info *the_map)
+{
+ struct mtd_info *res;
+
+ the_map->virt = ioremap(the_map->phys, the_map->size);
+ if (the_map->virt == NULL)
+ return 1;
+ for (the_map->bankwidth = 32; the_map->bankwidth; the_map->bankwidth
+ >>= 1) {
+ res = do_map_probe("cfi_probe", the_map);
+ if (res == NULL)
+ res = do_map_probe("jedec_probe", the_map);
+ if (res != NULL)
+ break;
+ }
+ iounmap(the_map->virt);
+ if (res != NULL)
+ the_map->phys = (u32)-(s32)(the_map->size = res->size);
+ return res == NULL;
+}
+
static int __init rdc_board_setup(void)
{
- rdc321x_gpio_setup();
+#ifndef CONFIG_MTD_RDC3210
+ struct map_info rdc_map_info;
+ u32 the_header[8];
+ ROOT_DEV = 0;
+ rdc_map_info.name = rdc_flash_device.name;
+ rdc_map_info.phys = 0xff000000;
+ rdc_map_info.size = 0x1000000;
+ rdc_map_info.bankwidth = 2;
+ rdc_map_info.set_vpp = NULL;
+ simple_map_init(&rdc_map_info);
+ while (probe_flash_start(&rdc_map_info)) {
+ rdc_map_info.phys++;
+ if (--rdc_map_info.size)
+ panic("Could not find start of flash!");
+ }
+ rdc_flash_resource.start = rdc_map_info.phys;
+ rdc_flash_data.width = rdc_map_info.bankwidth;
+ rdc_map_info.virt = ioremap_nocache(rdc_map_info.phys, 0x10);
+ if (rdc_map_info.virt == NULL)
+ panic("Could not ioremap to read device magic!");
+ the_header[0] = ((u32 *)rdc_map_info.virt)[0];
+ the_header[1] = ((u32 *)rdc_map_info.virt)[1];
+ the_header[2] = ((u32 *)rdc_map_info.virt)[2];
+ the_header[3] = ((u32 *)rdc_map_info.virt)[3];
+ iounmap(rdc_map_info.virt);
+ rdc_map_info.virt = ioremap_nocache(rdc_map_info.phys + 0x8000, 0x10);
+ if (rdc_map_info.virt == NULL)
+ panic("Could not ioremap to read device magic!");
+ the_header[4] = ((u32 *)rdc_map_info.virt)[0];
+ the_header[5] = ((u32 *)rdc_map_info.virt)[1];
+ the_header[6] = ((u32 *)rdc_map_info.virt)[2];
+ the_header[7] = ((u32 *)rdc_map_info.virt)[3];
+ iounmap(rdc_map_info.virt);
+ if (!memcmp(the_header, "GMTK", 4)) { /* Gemtek */
+ /* TODO */
+ } else if (!memcmp(the_header + 4, "CSYS", 4)) { /* Sitecom */
+ rdc_flash_parts[0].name = "system";
+ rdc_flash_parts[0].offset = 0;
+ rdc_flash_parts[0].size = rdc_map_info.size - 0x10000;
+ rdc_flash_parts[1].name = "config";
+ rdc_flash_parts[1].offset = 0;
+ rdc_flash_parts[1].size = 0x8000;
+ rdc_flash_parts[2].name = "magic";
+ rdc_flash_parts[2].offset = 0x8000;
+ rdc_flash_parts[2].size = 0x14;
+ rdc_flash_parts[3].name = "kernel";
+ rdc_flash_parts[3].offset = 0x8014;
+ rdc_flash_parts[3].size = the_header[5];
+ rdc_flash_parts[4].name = "rootfs";
+ rdc_flash_parts[4].offset = 0x8014 + the_header[5];
+ rdc_flash_parts[4].size = rdc_flash_parts[0].size - rdc_flash_parts[4].offset;
+ rdc_flash_parts[5].name = "bootloader";
+ rdc_flash_parts[5].offset = rdc_flash_parts[0].size;
+ rdc_flash_parts[5].size = 0x10000;
+ rdc_flash_data.nr_parts = 6;
+ } else if (!memcmp(((u8 *)the_header) + 14, "Li", 2)) { /* AMIT */
+ rdc_flash_parts[0].name = "kernel_parthdr";
+ rdc_flash_parts[0].offset = 0;
+ rdc_flash_parts[0].size = 0x10;
+ rdc_flash_parts[1].name = "kernel";
+ rdc_flash_parts[1].offset = 0x10;
+ rdc_flash_parts[1].size = 0xffff0;
+ rdc_flash_parts[2].name = "rootfs_parthdr";
+ rdc_flash_parts[2].offset = 0x100000;
+ rdc_flash_parts[2].size = 0x10;
+ rdc_flash_parts[3].name = "rootfs";
+ rdc_flash_parts[3].offset = 0x100010;
+ rdc_flash_parts[3].size = rdc_map_info.size - 0x160010;
+ rdc_flash_parts[4].name = "config_parthdr";
+ rdc_flash_parts[4].offset = rdc_map_info.size - 0x60000;
+ rdc_flash_parts[4].size = 0x10;
+ rdc_flash_parts[5].name = "config";
+ rdc_flash_parts[5].offset = rdc_map_info.size - 0x5fff0;
+ rdc_flash_parts[5].size = 0xfff0;
+ rdc_flash_parts[6].name = "recoveryfs_parthdr";
+ rdc_flash_parts[6].offset = rdc_map_info.size - 0x50000;
+ rdc_flash_parts[6].size = 0x10;
+ rdc_flash_parts[7].name = "recoveryfs";
+ rdc_flash_parts[7].offset = rdc_map_info.size - 0x4fff0;
+ rdc_flash_parts[7].size = 0x3fff0;
+ rdc_flash_parts[8].name = "recovery_parthdr";
+ rdc_flash_parts[8].offset = rdc_map_info.size - 0x10000;
+ rdc_flash_parts[8].size = 0x10;
+ rdc_flash_parts[9].name = "recovery";
+ rdc_flash_parts[9].offset = rdc_map_info.size - 0xfff0;
+ rdc_flash_parts[9].size = 0x7ff0;
+ rdc_flash_parts[10].name = "productinfo_parthdr";
+ rdc_flash_parts[10].offset = rdc_map_info.size - 0x8000;
+ rdc_flash_parts[10].size = 0x10;
+ rdc_flash_parts[11].name = "productinfo";
+ rdc_flash_parts[11].offset = rdc_map_info.size - 0x7ff0;
+ rdc_flash_parts[11].size = 0x1ff0;
+ rdc_flash_parts[12].name = "bootloader_parthdr";
+ rdc_flash_parts[12].offset = rdc_map_info.size - 0x6000;
+ rdc_flash_parts[12].size = 0x10;
+ rdc_flash_parts[13].name = "bootloader";
+ rdc_flash_parts[13].offset = rdc_map_info.size - 0x5ff0;
+ rdc_flash_parts[13].size = 0x5ff0;
+ rdc_flash_parts[14].name = "everything";
+ rdc_flash_parts[14].offset = 0;
+ rdc_flash_parts[14].size = rdc_map_info.size;
+ rdc_flash_data.nr_parts = 15;
+ } else { /* ZyXEL */
+ rdc_flash_parts[0].name = "kernel";
+ rdc_flash_parts[0].offset = 0;
+ rdc_flash_parts[0].size = 0x100000;
+ rdc_flash_parts[1].name = "rootfs";
+ rdc_flash_parts[1].offset = 0x100000;
+ rdc_flash_parts[1].size = rdc_map_info.size - 0x140000;
+ rdc_flash_parts[2].name = "linux";
+ rdc_flash_parts[2].offset = 0;
+ rdc_flash_parts[2].size = rdc_map_info.size - 0x40000;
+ rdc_flash_parts[3].name = "config";
+ rdc_flash_parts[3].offset = rdc_map_info.size - 0x40000;
+ rdc_flash_parts[3].size = 0x10000;
+ rdc_flash_parts[4].name = "productinfo";
+ rdc_flash_parts[4].offset = rdc_map_info.size - 0x30000;
+ rdc_flash_parts[4].size = 0x10000;
+ rdc_flash_parts[5].name = "bootloader";
+ rdc_flash_parts[5].offset = rdc_map_info.size - 0x20000;
+ rdc_flash_parts[5].size = 0x20000;
+ rdc_flash_data.nr_parts = 6;
+ }
+#endif
return platform_add_devices(rdc321x_devs, ARRAY_SIZE(rdc321x_devs));
}
+#ifdef CONFIG_MTD_RDC3210
arch_initcall(rdc_board_setup);
+#else
+late_initcall(rdc_board_setup);
+#endif
Index: linux-2.6.28.10/arch/x86/Makefile
===================================================================
--- linux-2.6.28.10.orig/arch/x86/Makefile 2009-11-03 21:01:29.756400281 -0800
+++ linux-2.6.28.10/arch/x86/Makefile 2009-11-03 21:01:32.164401226 -0800
@@ -113,6 +113,10 @@
mflags-$(CONFIG_X86_VOYAGER) := -Iarch/x86/include/asm/mach-voyager
mcore-$(CONFIG_X86_VOYAGER) := arch/x86/mach-voyager/
+# RDC subarch support
+mflags-$(CONFIG_X86_RDC321X) := -Iarch/x86/include/asm/mach-rdc321x
+mcore-$(CONFIG_X86_RDC321X) += arch/x86/mach-rdc321x/
+
# generic subarchitecture
mflags-$(CONFIG_X86_GENERICARCH):= -Iarch/x86/include/asm/mach-generic
fcore-$(CONFIG_X86_GENERICARCH) += arch/x86/mach-generic/
Index: linux-2.6.28.10/arch/x86/include/asm/mach-rdc321x/gpio.h
===================================================================
--- linux-2.6.28.10.orig/arch/x86/include/asm/mach-rdc321x/gpio.h 2009-11-03 21:01:29.784401606 -0800
+++ linux-2.6.28.10/arch/x86/include/asm/mach-rdc321x/gpio.h 2009-11-03 21:01:32.164401226 -0800
@@ -9,7 +9,6 @@
extern int rdc_gpio_direction_output(unsigned gpio, int value);
extern int rdc_gpio_request(unsigned gpio, const char *label);
extern void rdc_gpio_free(unsigned gpio);
-extern void __init rdc321x_gpio_setup(void);
/* Wrappers for the arch-neutral GPIO API */

View File

@@ -1,20 +0,0 @@
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1174,6 +1174,17 @@ static int __devinit yenta_probe (struct
/* We must finish initialization here */
+#ifdef CONFIG_X86_RDC
+/* #define YO_TI1510_DATASHEET_GUY_EXPLAIN_THIS_JUNK 0x0044f044 */
+#define YO_TI1510_DATASHEET_GUY_EXPLAIN_THIS_JUNK 0x0844b060
+/* #define YO_TI1510_DATASHEET_GUY_EXPLAIN_THIS_JUNK 0x0044d044 */
+
+ config_writel(socket, 32*4, YO_TI1510_DATASHEET_GUY_EXPLAIN_THIS_JUNK);
+ config_writel(socket, 35*4, 0x00000022);
+ config_writel(socket, 36*4, 0x60200000);
+ config_writel(socket, 40*4, 0x7e020000);
+#endif
+
if (!socket->cb_irq || request_irq(socket->cb_irq, yenta_interrupt, IRQF_SHARED, "yenta", socket)) {
/* No IRQ or request_irq failed. Poll */
socket->cb_irq = 0; /* But zero is a valid IRQ number. */

View File

@@ -1,40 +0,0 @@
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -62,7 +62,7 @@ static inline void outl(u32 v, u16 port)
{
asm volatile("outl %0,%1" : : "a" (v), "dN" (port));
}
-static inline u32 inl(u32 port)
+static inline u32 inl(u16 port)
{
u32 v;
asm volatile("inl %1,%0" : "=a" (v) : "dN" (port));
--- a/arch/x86/boot/pm.c
+++ b/arch/x86/boot/pm.c
@@ -14,6 +14,9 @@
#include "boot.h"
#include <asm/segment.h>
+#ifdef CONFIG_X86_RDC
+#include <asm/mach-rdc/rdc321x_defs.h>
+#endif
/*
* Invoke the realmode switch hook if present; otherwise
@@ -156,6 +159,16 @@ void go_to_protected_mode(void)
die();
}
+#ifdef CONFIG_X86_RDC
+ {
+ u32 bootctl;
+
+ outl(0x80003840, RDC3210_CFGREG_ADDR);
+ bootctl = inl(RDC3210_CFGREG_DATA) | 0x07ff0000;
+ outl(bootctl, RDC3210_CFGREG_DATA);
+ }
+#endif
+
/* Reset coprocessor (IGNNE#) */
reset_coprocessor();

File diff suppressed because it is too large Load Diff

View File

@@ -1,241 +0,0 @@
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -49,12 +49,12 @@
#include <asm/processor.h>
#define DRV_NAME "r6040"
-#define DRV_VERSION "0.19"
-#define DRV_RELDATE "18Dec2008"
+#define DRV_VERSION "0.22"
+#define DRV_RELDATE "25Mar2009"
/* PHY CHIP Address */
#define PHY1_ADDR 1 /* For MAC1 */
-#define PHY2_ADDR 2 /* For MAC2 */
+#define PHY2_ADDR 3 /* For MAC2 */
#define PHY_MODE 0x3100 /* PHY CHIP Register 0 */
#define PHY_CAP 0x01E1 /* PHY CHIP Register 4 */
@@ -160,6 +160,7 @@ MODULE_AUTHOR("Sten Wang <sten.wang@rdc.
"Florian Fainelli <florian@openwrt.org>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("RDC R6040 NAPI PCI FastEthernet driver");
+MODULE_VERSION(DRV_VERSION " " DRV_RELDATE);
/* RX and TX interrupts that we handle */
#define RX_INTS (RX_FIFO_FULL | RX_NO_DESC | RX_FINISH)
@@ -200,7 +201,7 @@ struct r6040_private {
static char version[] __devinitdata = KERN_INFO DRV_NAME
": RDC R6040 NAPI net driver,"
- "version "DRV_VERSION " (" DRV_RELDATE ")\n";
+ "version "DRV_VERSION " (" DRV_RELDATE ")";
static int phy_table[] = { PHY1_ADDR, PHY2_ADDR };
@@ -330,7 +331,7 @@ static int r6040_alloc_rxbufs(struct net
do {
skb = netdev_alloc_skb(dev, MAX_BUF_SIZE);
if (!skb) {
- printk(KERN_ERR "%s: failed to alloc skb for rx\n", dev->name);
+ printk(KERN_ERR DRV_NAME "%s: failed to alloc skb for rx\n", dev->name);
rc = -ENOMEM;
goto err_exit;
}
@@ -438,7 +439,6 @@ static void r6040_down(struct net_device
{
struct r6040_private *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base;
- struct pci_dev *pdev = lp->pdev;
int limit = 2048;
u16 *adrp;
u16 cmd;
@@ -457,22 +457,12 @@ static void r6040_down(struct net_device
iowrite16(adrp[0], ioaddr + MID_0L);
iowrite16(adrp[1], ioaddr + MID_0M);
iowrite16(adrp[2], ioaddr + MID_0H);
- free_irq(dev->irq, dev);
-
- /* Free RX buffer */
- r6040_free_rxbufs(dev);
-
- /* Free TX buffer */
- r6040_free_txbufs(dev);
-
- /* Free Descriptor memory */
- pci_free_consistent(pdev, RX_DESC_SIZE, lp->rx_ring, lp->rx_ring_dma);
- pci_free_consistent(pdev, TX_DESC_SIZE, lp->tx_ring, lp->tx_ring_dma);
}
static int r6040_close(struct net_device *dev)
{
struct r6040_private *lp = netdev_priv(dev);
+ struct pci_dev *pdev = lp->pdev;
/* deleted timer */
del_timer_sync(&lp->timer);
@@ -481,8 +471,28 @@ static int r6040_close(struct net_device
napi_disable(&lp->napi);
netif_stop_queue(dev);
r6040_down(dev);
+
+ free_irq(dev->irq, dev);
+
+ /* Free RX buffer */
+ r6040_free_rxbufs(dev);
+
+ /* Free TX buffer */
+ r6040_free_txbufs(dev);
+
spin_unlock_irq(&lp->lock);
+ /* Free Descriptor memory */
+ if (lp->rx_ring) {
+ pci_free_consistent(pdev, RX_DESC_SIZE, lp->rx_ring, lp->rx_ring_dma);
+ lp->rx_ring = NULL;
+ }
+
+ if (lp->tx_ring) {
+ pci_free_consistent(pdev, TX_DESC_SIZE, lp->tx_ring, lp->tx_ring_dma);
+ lp->tx_ring = NULL;
+ }
+
return 0;
}
@@ -598,7 +608,6 @@ static int r6040_rx(struct net_device *d
/* Send to upper layer */
netif_receive_skb(skb_ptr);
- dev->last_rx = jiffies;
dev->stats.rx_packets++;
dev->stats.rx_bytes += descptr->len - 4;
@@ -668,7 +677,7 @@ static int r6040_poll(struct napi_struct
work_done = r6040_rx(dev, budget);
if (work_done < budget) {
- netif_rx_complete(dev, napi);
+ napi_complete(napi);
/* Enable RX interrupt */
iowrite16(ioread16(ioaddr + MIER) | RX_INTS, ioaddr + MIER);
}
@@ -705,7 +714,7 @@ static irqreturn_t r6040_interrupt(int i
/* Mask off RX interrupt */
misr &= ~RX_INTS;
- netif_rx_schedule(dev, &lp->napi);
+ napi_schedule(&lp->napi);
}
/* TX interrupt request */
@@ -1063,20 +1072,20 @@ static int __devinit r6040_init_one(stru
/* this should always be supported */
err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (err) {
- printk(KERN_ERR DRV_NAME "32-bit PCI DMA addresses"
+ printk(KERN_ERR DRV_NAME ": 32-bit PCI DMA addresses"
"not supported by the card\n");
goto err_out;
}
err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (err) {
- printk(KERN_ERR DRV_NAME "32-bit PCI DMA addresses"
+ printk(KERN_ERR DRV_NAME ": 32-bit PCI DMA addresses"
"not supported by the card\n");
goto err_out;
}
/* IO Size check */
if (pci_resource_len(pdev, 0) < io_size) {
- printk(KERN_ERR DRV_NAME "Insufficient PCI resources, aborting\n");
+ printk(KERN_ERR DRV_NAME ": Insufficient PCI resources, aborting\n");
err = -EIO;
goto err_out;
}
@@ -1086,7 +1095,7 @@ static int __devinit r6040_init_one(stru
dev = alloc_etherdev(sizeof(struct r6040_private));
if (!dev) {
- printk(KERN_ERR DRV_NAME "Failed to allocate etherdev\n");
+ printk(KERN_ERR DRV_NAME ": Failed to allocate etherdev\n");
err = -ENOMEM;
goto err_out;
}
@@ -1102,11 +1111,15 @@ static int __devinit r6040_init_one(stru
ioaddr = pci_iomap(pdev, bar, io_size);
if (!ioaddr) {
- printk(KERN_ERR "ioremap failed for device %s\n",
+ printk(KERN_ERR DRV_NAME ": ioremap failed for device %s\n",
pci_name(pdev));
err = -EIO;
goto err_out_free_res;
}
+ /* If PHY status change register is still set to zero it means the
+ * bootloader didn't initialize it */
+ if (ioread16(ioaddr + PHY_CC) == 0)
+ iowrite16(0x9f07, ioaddr + PHY_CC);
/* Init system & device */
lp->base = ioaddr;
@@ -1123,6 +1136,13 @@ static int __devinit r6040_init_one(stru
adrp[1] = ioread16(ioaddr + MID_0M);
adrp[2] = ioread16(ioaddr + MID_0H);
+ /* Some bootloader/BIOSes do not initialize
+ * MAC address, warn about that */
+ if (!(adrp[0] || adrp[1] || adrp[2])) {
+ printk(KERN_WARNING DRV_NAME ": MAC address not initialized, generating random\n");
+ random_ether_addr(dev->dev_addr);
+ }
+
/* Link new device into r6040_root_dev */
lp->pdev = pdev;
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,25 +0,0 @@
--- a/drivers/mtd/maps/Kconfig
+++ b/drivers/mtd/maps/Kconfig
@@ -156,6 +156,12 @@ config MTD_RDC3210_BUSWIDTH
Number of bytes addressed on the RDC-3210 flash device before
addressing the same chip again
+config MTD_R8610
+ tristate "CFI flash device mapped on R8610"
+ depends on X86 && MTD_CFI && MTD_PARTITIONS
+ help
+ Flash support for the RDC R8610 evaluation board.
+
config MTD_SC520CDP
tristate "CFI Flash device mapped on AMD SC520 CDP"
depends on X86 && MTD_CFI && MTD_CONCAT
--- a/drivers/mtd/maps/Makefile
+++ b/drivers/mtd/maps/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_MTD_PMC_MSP_EVM) += pmcms
obj-$(CONFIG_MTD_PMC_MSP_RAMROOT)+= pmcmsp-ramroot.o
obj-$(CONFIG_MTD_PCMCIA) += pcmciamtd.o
obj-$(CONFIG_MTD_RDC3210) += rdc3210.o
+obj-$(CONFIG_MTD_R8610) += r8610.o
obj-$(CONFIG_MTD_RPXLITE) += rpxlite.o
obj-$(CONFIG_MTD_TQM8XXL) += tqm8xxl.o
obj-$(CONFIG_MTD_SA1100) += sa1100-flash.o