summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/gpio-pl061.c6
-rw-r--r--drivers/mtd/nand/nand_mxs.c87
-rw-r--r--drivers/net/e1000/eeprom.c12
-rw-r--r--drivers/net/phy/phy.c2
-rw-r--r--drivers/of/base.c2
5 files changed, 48 insertions, 61 deletions
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index c17c265440..f34aba9da9 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -147,7 +147,11 @@ static struct amba_driver pl061_gpio_driver = {
.probe = pl061_probe,
};
-coredevice_platform_driver(pl061_gpio_driver);
+static int __init pl061_gpio_init(void)
+{
+ return amba_driver_register(&pl061_gpio_driver);
+}
+coredevice_initcall(pl061_gpio_init);
MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>");
MODULE_DESCRIPTION("PL061 GPIO driver");
diff --git a/drivers/mtd/nand/nand_mxs.c b/drivers/mtd/nand/nand_mxs.c
index 434da49d3e..96ae71364e 100644
--- a/drivers/mtd/nand/nand_mxs.c
+++ b/drivers/mtd/nand/nand_mxs.c
@@ -215,7 +215,6 @@ struct mxs_nand_info {
uint8_t *data_buf;
uint8_t *oob_buf;
- uint8_t marking_block_bad;
uint8_t raw_oob_mode;
/* Functions with altered behaviour */
@@ -223,8 +222,6 @@ struct mxs_nand_info {
loff_t from, struct mtd_oob_ops *ops);
int (*hooked_write_oob)(struct mtd_info *mtd,
loff_t to, struct mtd_oob_ops *ops);
- int (*hooked_block_markbad)(struct mtd_info *mtd,
- loff_t ofs);
/* DMA descriptors */
struct mxs_dma_desc **desc;
@@ -1074,27 +1071,6 @@ static int mxs_nand_hook_write_oob(struct mtd_info *mtd, loff_t to,
}
/*
- * Mark a block bad in NAND.
- *
- * This function is a veneer that replaces the function originally installed by
- * the NAND Flash MTD code.
- */
-static int mxs_nand_hook_block_markbad(struct mtd_info *mtd, loff_t ofs)
-{
- struct nand_chip *chip = mtd_to_nand(mtd);
- struct mxs_nand_info *nand_info = chip->priv;
- int ret;
-
- nand_info->marking_block_bad = 1;
-
- ret = nand_info->hooked_block_markbad(mtd, ofs);
-
- nand_info->marking_block_bad = 0;
-
- return ret;
-}
-
-/*
* There are several places in this driver where we have to handle the OOB and
* block marks. This is the function where things are the most complicated, so
* this is where we try to explain it all. All the other places refer back to
@@ -1177,36 +1153,14 @@ static int mxs_nand_ecc_read_oob(struct nand_chip *chip, int page)
*/
static int mxs_nand_ecc_write_oob(struct nand_chip *chip, int page)
{
- struct mtd_info *mtd = nand_to_mtd(chip);
- struct mxs_nand_info *nand_info = chip->priv;
- int column;
- uint8_t block_mark = 0;
-
/*
* There are fundamental incompatibilities between the i.MX GPMI NFC and
* the NAND Flash MTD model that make it essentially impossible to write
* the out-of-band bytes.
- *
- * We permit *ONE* exception. If the *intent* of writing the OOB is to
- * mark a block bad, we can do that.
*/
- if (!nand_info->marking_block_bad) {
- printf("NXS NAND: Writing OOB isn't supported\n");
- return -EIO;
- }
-
- column = nand_info->version == GPMI_VERSION_TYPE_MX23 ? 0 : mtd->writesize;
- /* Write the block mark. */
- chip->legacy.cmdfunc(chip, NAND_CMD_SEQIN, column, page);
- chip->legacy.write_buf(chip, &block_mark, 1);
- chip->legacy.cmdfunc(chip, NAND_CMD_PAGEPROG, -1, -1);
-
- /* Check if it worked. */
- if (chip->legacy.waitfunc(chip) & NAND_STATUS_FAIL)
- return -EIO;
-
- return 0;
+ printf("MXS NAND: Writing OOB isn't supported\n");
+ return -EIO;
}
/*
@@ -1228,6 +1182,37 @@ static int mxs_nand_block_bad(struct nand_chip *chip , loff_t ofs)
}
/*
+ * Mark a block as bad in NAND.
+ */
+static int mxs_nand_block_markbad(struct nand_chip *chip , loff_t ofs)
+{
+ struct mtd_info *mtd = nand_to_mtd(chip);
+ struct mxs_nand_info *nand_info = chip->priv;
+ int column, page, chipnr, status;
+ uint8_t block_mark = 0;
+
+ chipnr = (int)(ofs >> chip->chip_shift);
+ nand_select_target(chip, chipnr);
+
+ column = nand_info->version == GPMI_VERSION_TYPE_MX23 ? 0 : mtd->writesize;
+ page = (int)(ofs >> chip->page_shift);
+ /* Write the block mark. */
+ chip->legacy.cmdfunc(chip, NAND_CMD_SEQIN, column, page);
+ chip->legacy.write_buf(chip, &block_mark, 1);
+ chip->legacy.cmdfunc(chip, NAND_CMD_PAGEPROG, -1, -1);
+
+ /* Check if it worked. */
+ status = chip->legacy.waitfunc(chip);
+
+ nand_deselect_target(chip);
+
+ if (status & NAND_STATUS_FAIL)
+ return -EIO;
+
+ return 0;
+}
+
+/*
* Nominally, the purpose of this function is to look for or create the bad
* block table. In fact, since the we call this function at the very end of
* the initialization process started by nand_scan(), and we doesn't have a
@@ -1273,11 +1258,6 @@ static int mxs_nand_scan_bbt(struct nand_chip *chip)
mtd->_write_oob = mxs_nand_hook_write_oob;
}
- if (mtd->_block_markbad != mxs_nand_hook_block_markbad) {
- nand_info->hooked_block_markbad = mtd->_block_markbad;
- mtd->_block_markbad = mxs_nand_hook_block_markbad;
- }
-
/* We use the reference implementation for bad block management. */
return nand_create_bbt(chip);
}
@@ -2201,6 +2181,7 @@ static int mxs_nand_probe(struct device_d *dev)
chip->legacy.dev_ready = mxs_nand_device_ready;
chip->legacy.select_chip = mxs_nand_select_chip;
chip->legacy.block_bad = mxs_nand_block_bad;
+ chip->legacy.block_markbad = mxs_nand_block_markbad;
chip->legacy.read_byte = mxs_nand_read_byte;
diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
index 900be2f09b..5a7d8675ce 100644
--- a/drivers/net/e1000/eeprom.c
+++ b/drivers/net/e1000/eeprom.c
@@ -1614,12 +1614,12 @@ int e1000_register_eeprom(struct e1000_hw *hw)
}
if (eecd & E1000_EECD_I210_FLASH_DETECTED) {
- hw->mtd.parent = hw->dev;
- hw->mtd.read = e1000_mtd_read;
- hw->mtd.write = e1000_mtd_write;
- hw->mtd.erase = e1000_mtd_erase;
- hw->mtd.lock = e1000_mtd_lock;
- hw->mtd.unlock = e1000_mtd_unlock;
+ hw->mtd.dev.parent = hw->dev;
+ hw->mtd._read = e1000_mtd_read;
+ hw->mtd._write = e1000_mtd_write;
+ hw->mtd._erase = e1000_mtd_erase;
+ hw->mtd._lock = e1000_mtd_lock;
+ hw->mtd._unlock = e1000_mtd_unlock;
hw->mtd.size = eeprom->word_size * 2;
hw->mtd.writesize = 1;
hw->mtd.subpage_sft = 0;
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 622acbe40d..e8e8dad5bd 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -571,7 +571,7 @@ int phy_wait_aneg_done(struct phy_device *phydev)
}
do {
- genphy_update_link(phydev);
+ phy_update_status(phydev);
if (phydev->link == 1)
return 0;
} while (!is_timeout(start, PHY_AN_TIMEOUT * SECOND));
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 8759099d74..6fe02649ee 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2273,6 +2273,8 @@ const struct of_device_id of_default_bus_match_table[] = {
{
.compatible = "simple-bus",
}, {
+ .compatible = "simple-pm-bus",
+ }, {
.compatible = "simple-mfd",
}, {
/* sentinel */