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 | 5b5ad5ba01cebe6a749bcf5c9fc9637876fe0b1f (patch) | |
tree | 8b031a68c4ff6c7457830843adc41d49f0ab2d5f /target/linux/mvebu/patches-3.10/0145-mtd-nand-pxa3xx-Add-helper-function-to-set-page-addr.patch | |
parent | 608ad4b6932f72995144bc72a31b1e0843a5bb28 (diff) | |
download | master-187ad058-5b5ad5ba01cebe6a749bcf5c9fc9637876fe0b1f.tar.gz master-187ad058-5b5ad5ba01cebe6a749bcf5c9fc9637876fe0b1f.tar.bz2 master-187ad058-5b5ad5ba01cebe6a749bcf5c9fc9637876fe0b1f.zip |
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>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39566 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mvebu/patches-3.10/0145-mtd-nand-pxa3xx-Add-helper-function-to-set-page-addr.patch')
-rw-r--r-- | target/linux/mvebu/patches-3.10/0145-mtd-nand-pxa3xx-Add-helper-function-to-set-page-addr.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-3.10/0145-mtd-nand-pxa3xx-Add-helper-function-to-set-page-addr.patch b/target/linux/mvebu/patches-3.10/0145-mtd-nand-pxa3xx-Add-helper-function-to-set-page-addr.patch new file mode 100644 index 0000000000..a0a909e09d --- /dev/null +++ b/target/linux/mvebu/patches-3.10/0145-mtd-nand-pxa3xx-Add-helper-function-to-set-page-addr.patch @@ -0,0 +1,70 @@ +From 09a84f8e89c3715160423701b0606ef99e2a05bf Mon Sep 17 00:00:00 2001 +From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> +Date: Thu, 14 Nov 2013 18:25:31 -0300 +Subject: [PATCH 145/203] mtd: nand: pxa3xx: Add helper function to set page + address + +Let's simplify the code by first introducing a helper function +to set the page address, as done by the READ0, READOOB and SEQIN +commands. + +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 | 36 +++++++++++++++++++++--------------- + 1 file changed, 21 insertions(+), 15 deletions(-) + +--- a/drivers/mtd/nand/pxa3xx_nand.c ++++ b/drivers/mtd/nand/pxa3xx_nand.c +@@ -587,6 +587,26 @@ static inline int is_buf_blank(uint8_t * + return 1; + } + ++static void set_command_address(struct pxa3xx_nand_info *info, ++ unsigned int page_size, uint16_t column, int page_addr) ++{ ++ /* small page addr setting */ ++ if (page_size < PAGE_CHUNK_SIZE) { ++ info->ndcb1 = ((page_addr & 0xFFFFFF) << 8) ++ | (column & 0xFF); ++ ++ info->ndcb2 = 0; ++ } else { ++ info->ndcb1 = ((page_addr & 0xFFFF) << 16) ++ | (column & 0xFFFF); ++ ++ if (page_addr & 0xFF0000) ++ info->ndcb2 = (page_addr & 0xFF0000) >> 16; ++ else ++ info->ndcb2 = 0; ++ } ++} ++ + static int prepare_command_pool(struct pxa3xx_nand_info *info, int command, + uint16_t column, int page_addr) + { +@@ -650,22 +670,8 @@ static int prepare_command_pool(struct p + info->ndcb0 |= NDCB0_DBC | (NAND_CMD_READSTART << 8); + + case NAND_CMD_SEQIN: +- /* small page addr setting */ +- if (unlikely(mtd->writesize < PAGE_CHUNK_SIZE)) { +- info->ndcb1 = ((page_addr & 0xFFFFFF) << 8) +- | (column & 0xFF); +- +- info->ndcb2 = 0; +- } else { +- info->ndcb1 = ((page_addr & 0xFFFF) << 16) +- | (column & 0xFFFF); +- +- if (page_addr & 0xFF0000) +- info->ndcb2 = (page_addr & 0xFF0000) >> 16; +- else +- info->ndcb2 = 0; +- } + ++ set_command_address(info, mtd->writesize, column, page_addr); + info->buf_count = mtd->writesize + mtd->oobsize; + memset(info->data_buff, 0xFF, info->buf_count); + |