This is additional patch for mac80211 package. Due we have flash, that
not physically mapped, we must get EEPROM data from specific MTD partition.
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -40,6 +40,11 @@
#include <linux/platform_device.h>
#include <linux/eeprom_93cx6.h>
+#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
+#include <linux/mtd/mtd.h>
+#undef DEBUG
+#endif
+
#include "rt2x00.h"
#include "rt2x00pci.h"
#include "rt2x00soc.h"
@@ -87,11 +92,31 @@ static void rt2800pci_mcu_status(struct
#if defined(CONFIG_RALINK_RT288X) || defined(CONFIG_RALINK_RT305X)
static void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
{
- void __iomem *base_addr = ioremap(0x1F040000, EEPROM_SIZE);
-
- memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE);
+ struct mtd_info *mtd;
+ int i, retlen = 0;
- iounmap(base_addr);
+ /* try to locate partition with eeprom data */
+ mtd = get_mtd_device_nm("Factory");
+ if (IS_ERR(mtd))
+ mtd = get_mtd_device_nm("factory");
+ if (IS_ERR(mtd))
+ mtd = get_mtd_device_nm("factory_default");
+ if (IS_ERR(mtd))
+ mtd = get_mtd_device_nm("devconf");
+
+ if (IS_ERR(mtd)) {
+ ERROR(rt2x00dev, "can't find device eeprom area, trying physmap device\n");
+ void __iomem *base_addr = ioremap(0x1F040000, EEPROM_SIZE);
+ memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE);
+ iounmap(base_addr);
+ } else {
+ if (mtd->read(mtd, 0x00, EEPROM_SIZE, &retlen, rt2x00dev->eeprom) < 0) {
+ ERROR(rt2x00dev, "eeprom area read error\n");
+ put_mtd_device(mtd);
+ return;
+ }
+ put_mtd_device(mtd);
+ }
}
#else
static inline void rt2800pci_read_eeprom_soc(struct rt2x00_dev *rt2x00dev)
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel