diff options
author | Luka Perkov <luka@openwrt.org> | 2014-02-11 02:07:44 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2014-02-11 02:07:44 +0000 |
commit | c9ae111a20be4c9555128cced8edded660d133df (patch) | |
tree | fd4809b562d454394cbb9ec517bf3f1ef2d5b6f2 /target/linux/mvebu/patches-3.10/0135-mtd-nand-pxa3xx-Early-variant-detection.patch | |
parent | 3af779eb172b0438f77e8a01a97dd0eb9a146076 (diff) | |
download | mtk-20170518-c9ae111a20be4c9555128cced8edded660d133df.zip mtk-20170518-c9ae111a20be4c9555128cced8edded660d133df.tar.gz mtk-20170518-c9ae111a20be4c9555128cced8edded660d133df.tar.bz2 |
mvebu: backport mainline patches from kernel 3.13
This is a backport of the patches accepted to the Linux mainline related to
mvebu SoC (Armada XP and Armada 370) between Linux v3.12, and Linux v3.13.
This work mainly covers:
* Finishes work for sharing the pxa nand driver(drivers/mtd/nand/pxa3xx_nand.c)
between the PXA family, and the Armada family.
* timer initialization update, and access function for the Armada family.
* Generic IRQ handling backporting.
* Some bug fixes.
Signed-off-by: Seif Mazareeb <seif.mazareeb@gmail.com>
CC: Luka Perkov <luka@openwrt.org>
SVN-Revision: 39566
Diffstat (limited to 'target/linux/mvebu/patches-3.10/0135-mtd-nand-pxa3xx-Early-variant-detection.patch')
-rw-r--r-- | target/linux/mvebu/patches-3.10/0135-mtd-nand-pxa3xx-Early-variant-detection.patch | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-3.10/0135-mtd-nand-pxa3xx-Early-variant-detection.patch b/target/linux/mvebu/patches-3.10/0135-mtd-nand-pxa3xx-Early-variant-detection.patch new file mode 100644 index 0000000..328a2ab --- /dev/null +++ b/target/linux/mvebu/patches-3.10/0135-mtd-nand-pxa3xx-Early-variant-detection.patch @@ -0,0 +1,97 @@ +From dc333ddda677d416a6726509e144c6dfb93e7e89 Mon Sep 17 00:00:00 2001 +From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> +Date: Thu, 7 Nov 2013 12:17:14 -0300 +Subject: [PATCH 135/203] mtd: nand: pxa3xx: Early variant detection + +In order to customize early settings depending on the detected SoC variant, +move the detection to be before the nand_chip struct filling. + +In a follow-up patch, this change is needed to detect the variant *before* +the call to alloc_nand_resource(), which allows to set a different cmdfunc() +for each variant. + +Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> +Tested-by: Daniel Mack <zonque@gmail.com> +Signed-off-by: Brian Norris <computersforpeace@gmail.com> +--- + drivers/mtd/nand/pxa3xx_nand.c | 48 +++++++++++++++++++++--------------------- + 1 file changed, 24 insertions(+), 24 deletions(-) + +--- a/drivers/mtd/nand/pxa3xx_nand.c ++++ b/drivers/mtd/nand/pxa3xx_nand.c +@@ -258,6 +258,29 @@ static struct pxa3xx_nand_flash builtin_ + /* convert nano-seconds to nand flash controller clock cycles */ + #define ns2cycle(ns, clk) (int)((ns) * (clk / 1000000) / 1000) + ++static struct of_device_id pxa3xx_nand_dt_ids[] = { ++ { ++ .compatible = "marvell,pxa3xx-nand", ++ .data = (void *)PXA3XX_NAND_VARIANT_PXA, ++ }, ++ { ++ .compatible = "marvell,armada370-nand", ++ .data = (void *)PXA3XX_NAND_VARIANT_ARMADA370, ++ }, ++ {} ++}; ++MODULE_DEVICE_TABLE(of, pxa3xx_nand_dt_ids); ++ ++static enum pxa3xx_nand_variant ++pxa3xx_nand_get_variant(struct platform_device *pdev) ++{ ++ const struct of_device_id *of_id = ++ of_match_device(pxa3xx_nand_dt_ids, &pdev->dev); ++ if (!of_id) ++ return PXA3XX_NAND_VARIANT_PXA; ++ return (enum pxa3xx_nand_variant)of_id->data; ++} ++ + static void pxa3xx_nand_set_timing(struct pxa3xx_nand_host *host, + const struct pxa3xx_nand_timing *t) + { +@@ -1125,6 +1148,7 @@ static int alloc_nand_resource(struct pl + return -ENOMEM; + + info->pdev = pdev; ++ info->variant = pxa3xx_nand_get_variant(pdev); + for (cs = 0; cs < pdata->num_cs; cs++) { + mtd = (struct mtd_info *)((unsigned int)&info[1] + + (sizeof(*mtd) + sizeof(*host)) * cs); +@@ -1259,29 +1283,6 @@ static int pxa3xx_nand_remove(struct pla + return 0; + } + +-static struct of_device_id pxa3xx_nand_dt_ids[] = { +- { +- .compatible = "marvell,pxa3xx-nand", +- .data = (void *)PXA3XX_NAND_VARIANT_PXA, +- }, +- { +- .compatible = "marvell,armada370-nand", +- .data = (void *)PXA3XX_NAND_VARIANT_ARMADA370, +- }, +- {} +-}; +-MODULE_DEVICE_TABLE(of, pxa3xx_nand_dt_ids); +- +-static enum pxa3xx_nand_variant +-pxa3xx_nand_get_variant(struct platform_device *pdev) +-{ +- const struct of_device_id *of_id = +- of_match_device(pxa3xx_nand_dt_ids, &pdev->dev); +- if (!of_id) +- return PXA3XX_NAND_VARIANT_PXA; +- return (enum pxa3xx_nand_variant)of_id->data; +-} +- + static int pxa3xx_nand_probe_dt(struct platform_device *pdev) + { + struct pxa3xx_nand_platform_data *pdata; +@@ -1338,7 +1339,6 @@ static int pxa3xx_nand_probe(struct plat + } + + info = platform_get_drvdata(pdev); +- info->variant = pxa3xx_nand_get_variant(pdev); + probe_success = 0; + for (cs = 0; cs < pdata->num_cs; cs++) { + struct mtd_info *mtd = info->host[cs]->mtd; |