* Re: [PATCH] mtd: gpmi: make blockmark swapping optional
[not found] <1395235406-13449-1-git-send-email-y>
@ 2014-03-20 8:33 ` Juergen Beisert
2014-03-20 9:20 ` Lothar Waßmann
2014-03-20 9:15 ` Huang Shijie
` (2 subsequent siblings)
3 siblings, 1 reply; 39+ messages in thread
From: Juergen Beisert @ 2014-03-20 8:33 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Fabio Estevam, Mark Rutland, Russell King, Pawel Moll,
Arnd Bergmann, Ian Campbell, Artem Bityutskiy, y, linux-doc,
linux-kernel, Huang Shijie, devicetree, Rob Herring, linux-mtd,
Rob Landley, Kumar Gala, Brian Norris, David Woodhouse,
Sascha Hauer, Shawn Guo, Lothar Waßmann
Hi Lothar,
On Wednesday 19 March 2014 14:23:26 y@karo-electronics.de wrote:
> With a flash-based BBT there is no reason to move the Factory Bad
> Block Marker from the data area buffer (to where it is mapped by the
> GPMI NAND controller) to the OOB buffer. Thus, make this feature
> configurable via DT. This is required for the Ka-Ro electronics
> platforms.
> [...]
How do you create the BBT the very first time with valuable data when the NAND
already contains factory bad blocks?
jbe
--
Pengutronix e.K. | Juergen Beisert |
Linux Solutions for Science and Industry | http://www.pengutronix.de/ |
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH] mtd: gpmi: make blockmark swapping optional
2014-03-20 8:33 ` [PATCH] mtd: gpmi: make blockmark swapping optional Juergen Beisert
@ 2014-03-20 9:20 ` Lothar Waßmann
0 siblings, 0 replies; 39+ messages in thread
From: Lothar Waßmann @ 2014-03-20 9:20 UTC (permalink / raw)
To: Juergen Beisert
Cc: Fabio Estevam, Mark Rutland, Russell King, Pawel Moll,
Arnd Bergmann, Ian Campbell, Artem Bityutskiy, y, linux-doc,
linux-kernel, Huang Shijie, devicetree, Rob Herring, linux-mtd,
Shawn Guo, Rob Landley, Kumar Gala, Brian Norris, David Woodhouse,
Sascha Hauer, linux-arm-kernel
Hi,
Juergen Beisert wrote:
> Hi Lothar,
>
> On Wednesday 19 March 2014 14:23:26 y@karo-electronics.de wrote:
> > With a flash-based BBT there is no reason to move the Factory Bad
> > Block Marker from the data area buffer (to where it is mapped by the
> > GPMI NAND controller) to the OOB buffer. Thus, make this feature
> > configurable via DT. This is required for the Ka-Ro electronics
> > platforms.
> > [...]
>
> How do you create the BBT the very first time with valuable data when the NAND
> already contains factory bad blocks?
>
With the flashtool that does the initial flash programming.
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH] mtd: gpmi: make blockmark swapping optional
[not found] <1395235406-13449-1-git-send-email-y>
2014-03-20 8:33 ` [PATCH] mtd: gpmi: make blockmark swapping optional Juergen Beisert
@ 2014-03-20 9:15 ` Huang Shijie
2014-03-20 9:21 ` Lothar Waßmann
2014-03-21 5:36 ` Huang Shijie
2014-03-28 10:35 ` [PATCHv3 0/2] " Lothar Waßmann
3 siblings, 1 reply; 39+ messages in thread
From: Huang Shijie @ 2014-03-20 9:15 UTC (permalink / raw)
To: y
Cc: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Ian Campbell, Kumar Gala, Lothar Waßmann,
Mark Rutland, Pawel Moll, Rob Herring, Rob Landley, Russell King,
Sascha Hauer, Shawn Guo, devicetree, linux-arm-kernel, linux-doc,
linux-kernel, linux-mtd
于 2014年03月19日 21:23, y@karo-electronics.de 写道:
> configurable via DT. This is required for the Ka-Ro electronics
> platforms.
>
If you disable the swapping, you will disable the NAND boot in actually.
do you need the nand boot?
could you please tell me more detail background?
thanks
Huang Shijie
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH] mtd: gpmi: make blockmark swapping optional
2014-03-20 9:15 ` Huang Shijie
@ 2014-03-20 9:21 ` Lothar Waßmann
2014-03-20 9:47 ` Huang Shijie
0 siblings, 1 reply; 39+ messages in thread
From: Lothar Waßmann @ 2014-03-20 9:21 UTC (permalink / raw)
To: Huang Shijie
Cc: y, Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Ian Campbell, Kumar Gala, Mark Rutland, Pawel Moll,
Rob Herring, Rob Landley, Russell King, Sascha Hauer, Shawn Guo,
devicetree, linux-arm-kernel, linux-doc, linux-kernel, linux-mtd
Hi,
Huang Shijie wrote:
> 于 2014年03月19日 21:23, y@karo-electronics.de 写道:
> > configurable via DT. This is required for the Ka-Ro electronics
> > platforms.
> >
> If you disable the swapping, you will disable the NAND boot in actually.
>
No. All our modules do boot from NAND and none of them does the
swapping.
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH] mtd: gpmi: make blockmark swapping optional
2014-03-20 9:21 ` Lothar Waßmann
@ 2014-03-20 9:47 ` Huang Shijie
2014-03-20 10:09 ` Lothar Waßmann
0 siblings, 1 reply; 39+ messages in thread
From: Huang Shijie @ 2014-03-20 9:47 UTC (permalink / raw)
To: Lothar Waßmann
Cc: y, Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Ian Campbell, Kumar Gala, Mark Rutland, Pawel Moll,
Rob Herring, Rob Landley, Russell King, Sascha Hauer, Shawn Guo,
devicetree, linux-arm-kernel, linux-doc, linux-kernel, linux-mtd,
b47714
于 2014年03月20日 17:21, Lothar Waßmann 写道:
> Hi,
>
> Huang Shijie wrote:
>> 于 2014年03月19日 21:23, y@karo-electronics.de 写道:
>>> configurable via DT. This is required for the Ka-Ro electronics
>>> platforms.
>>>
>> If you disable the swapping, you will disable the NAND boot in actually.
>>
> No. All our modules do boot from NAND and none of them does the
> swapping.
>
>
It seems the NAND boot runs well by luck.
The ROM will do the swapping when it reads the BBT table written by the
kobs-ng (or something else?).
If the BBT table is small, not bigger then a page, the NAND boot may
runs well when you disable the swapping;
But it the BBT table is bigger, the ROM will get a corrupted BBT table.
thanks
Huang Shijie
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH] mtd: gpmi: make blockmark swapping optional
2014-03-20 9:47 ` Huang Shijie
@ 2014-03-20 10:09 ` Lothar Waßmann
2014-03-20 10:56 ` Huang Shijie
0 siblings, 1 reply; 39+ messages in thread
From: Lothar Waßmann @ 2014-03-20 10:09 UTC (permalink / raw)
To: Huang Shijie
Cc: y, Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Ian Campbell, Kumar Gala, Mark Rutland, Pawel Moll,
Rob Herring, Rob Landley, Russell King, Sascha Hauer, Shawn Guo,
devicetree, linux-arm-kernel, linux-doc, linux-kernel, linux-mtd,
b47714
Hi,
Huang Shijie wrote:
> 于 2014年03月20日 17:21, Lothar Waßmann 写道:
> > Hi,
> >
> > Huang Shijie wrote:
> >> 于 2014年03月19日 21:23, y@karo-electronics.de 写道:
> >>> configurable via DT. This is required for the Ka-Ro electronics
> >>> platforms.
> >>>
> >> If you disable the swapping, you will disable the NAND boot in actually.
> >>
> > No. All our modules do boot from NAND and none of them does the
> > swapping.
> >
> >
> It seems the NAND boot runs well by luck.
>
> The ROM will do the swapping when it reads the BBT table written by the
> kobs-ng (or something else?).
>
This can be disabled by parameter in the FCB (at least according to
the i.MX6 reference Manual):
|DISBBM 172 4 If 0 ROM will swap BadBlockMarkerByte with
| metadata[0] after reading a page using BCH40.
| If the value set is 1 then ROM will not do
| swapping
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH] mtd: gpmi: make blockmark swapping optional
2014-03-20 10:09 ` Lothar Waßmann
@ 2014-03-20 10:56 ` Huang Shijie
0 siblings, 0 replies; 39+ messages in thread
From: Huang Shijie @ 2014-03-20 10:56 UTC (permalink / raw)
To: Lothar Waßmann
Cc: y, Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Ian Campbell, Kumar Gala, Mark Rutland, Pawel Moll,
Rob Herring, Rob Landley, Russell King, Sascha Hauer, Shawn Guo,
devicetree, linux-arm-kernel, linux-doc, linux-kernel, linux-mtd,
b47714
于 2014年03月20日 18:09, Lothar Waßmann 写道:
> This can be disabled by parameter in the FCB (at least according to
> the i.MX6 reference Manual):
from imx28's reference manual, there is not such bit in the FCB to
disable the
swapping. But you are disabling the swapping in the imx28's DTS file,
isn't it?
I think it is dangerous.
> |DISBBM 172 4 If 0 ROM will swap BadBlockMarkerByte with
> | metadata[0] after reading a page using BCH40.
> | If the value set is 1 then ROM will not do
> | swapping
>
>
I will consult with our ROM colleague about this DISBBM bit.
I am not sure if the ROM still do the swapping for the uboot when we set
DISBBM bit.
thanks
Huang Shijie
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH] mtd: gpmi: make blockmark swapping optional
[not found] <1395235406-13449-1-git-send-email-y>
2014-03-20 8:33 ` [PATCH] mtd: gpmi: make blockmark swapping optional Juergen Beisert
2014-03-20 9:15 ` Huang Shijie
@ 2014-03-21 5:36 ` Huang Shijie
[not found] ` <532BCFCC.4080205-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-03-28 10:35 ` [PATCHv3 0/2] " Lothar Waßmann
3 siblings, 1 reply; 39+ messages in thread
From: Huang Shijie @ 2014-03-21 5:36 UTC (permalink / raw)
To: y
Cc: Fabio Estevam, Mark Rutland, Russell King, Pawel Moll,
Arnd Bergmann, Ian Campbell, Artem Bityutskiy, linux-doc,
linux-kernel, devicetree, Rob Herring, linux-mtd,
linux-arm-kernel, Rob Landley, Kumar Gala, Brian Norris,
David Woodhouse, Sascha Hauer, Shawn Guo, Lothar Waßmann
于 2014年03月19日 21:23, y@karo-electronics.de 写道:
> + /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
> + if (!of_property_read_bool(this->dev->of_node, "fsl,no-blockmark-swap"))
> + this->swap_block_mark = !GPMI_IS_MX23(this);
Our ROM guy had confirmed that the Rom will disable the swapping if we
set the DISBBM bit.
But please do not change any logic for imx23/imx28.
I really do not know what's the benefit we can get from this patch.
Please send the new version about this patch if you want this feature.
thanks
Huang Shijie
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCHv3 0/2] mtd: gpmi: make blockmark swapping optional
[not found] <1395235406-13449-1-git-send-email-y>
` (2 preceding siblings ...)
2014-03-21 5:36 ` Huang Shijie
@ 2014-03-28 10:35 ` Lothar Waßmann
2014-03-28 10:35 ` [PATCHv3 1/2] " Lothar Waßmann
2014-03-28 10:35 ` [PATCHv3 2/2] of/mtd/nand: add generic binding and helper for NAND_BBT_NO_OOB_BBM Lothar Waßmann
3 siblings, 2 replies; 39+ messages in thread
From: Lothar Waßmann @ 2014-03-28 10:35 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo, devicetree,
linux-arm-kernel, linux-doc, linux-kernel, linux-mtd, Shawn Guo,
Boris BREZILLON
patch added:
- add an additional option to turn of BB mark writing
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCHv3 1/2] mtd: gpmi: make blockmark swapping optional
2014-03-28 10:35 ` [PATCHv3 0/2] " Lothar Waßmann
@ 2014-03-28 10:35 ` Lothar Waßmann
2014-03-31 2:06 ` Huang Shijie
2014-03-28 10:35 ` [PATCHv3 2/2] of/mtd/nand: add generic binding and helper for NAND_BBT_NO_OOB_BBM Lothar Waßmann
1 sibling, 1 reply; 39+ messages in thread
From: Lothar Waßmann @ 2014-03-28 10:35 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo, devicetree,
linux-arm-kernel, linux-doc, linux-kernel, linux-mtd, Shawn Guo,
Boris BREZILLON
With a flash-based BBT there is no reason to move the Factory Bad
Block Marker from the data area buffer (to where it is mapped by the
GPMI NAND controller) to the OOB buffer. Thus, make this feature
configurable via DT. This is required for the Ka-Ro electronics
platforms.
In the original code 'this->swap_block_mark' was synonymous with
'!GPMI_IS_MX23()', so use the latter at the relevant places.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
.../devicetree/bindings/mtd/gpmi-nand.txt | 10 ++++
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 51 ++++++++++++--------
2 files changed, 42 insertions(+), 19 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 458d596..a011fdf 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -25,6 +25,16 @@ Optional properties:
discoverable or this property is not enabled,
the software may chooses an implementation-defined
ECC scheme.
+ - fsl,no-blockmark-swap: Don't swap the bad block marker from the OOB
+ area with the byte in the data area but rely on the
+ flash based BBT for identifying bad blocks.
+ NOTE: this is only valid in conjunction with
+ 'nand-on-flash-bbt'.
+ WARNING: on i.MX28 blockmark swapping cannot be
+ disabled for the BootROM in the FCB. Thus,
+ partitions written from Linux with this feature
+ turned on may not be accessible by the BootROM
+ code.
The device tree may optionally contain sub-nodes describing partitions of the
address space. See partition.txt for more detail.
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index bb77f75..2a489b3 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1065,6 +1065,7 @@ static int gpmi_ecc_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
int first, last, marker_pos;
int ecc_parity_size;
int col = 0;
+ int old_swap_block_mark = this->swap_block_mark;
/* The size of ECC parity */
ecc_parity_size = geo->gf_len * geo->ecc_strength / 8;
@@ -1073,17 +1074,21 @@ static int gpmi_ecc_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
first = offs / size;
last = (offs + len - 1) / size;
- /*
- * Find the chunk which contains the Block Marker. If this chunk is
- * in the range of [first, last], we have to read out the whole page.
- * Why? since we had swapped the data at the position of Block Marker
- * to the metadata which is bound with the chunk 0.
- */
- marker_pos = geo->block_mark_byte_offset / size;
- if (last >= marker_pos && first <= marker_pos) {
- dev_dbg(this->dev, "page:%d, first:%d, last:%d, marker at:%d\n",
+ if (this->swap_block_mark) {
+ /*
+ * Find the chunk which contains the Block Marker.
+ * If this chunk is in the range of [first, last],
+ * we have to read out the whole page.
+ * Why? since we had swapped the data at the position of Block
+ * Marker to the metadata which is bound with the chunk 0.
+ */
+ marker_pos = geo->block_mark_byte_offset / size;
+ if (last >= marker_pos && first <= marker_pos) {
+ dev_dbg(this->dev,
+ "page:%d, first:%d, last:%d, marker at:%d\n",
page, first, last, marker_pos);
- return gpmi_ecc_read_page(mtd, chip, buf, 0, page);
+ return gpmi_ecc_read_page(mtd, chip, buf, 0, page);
+ }
}
meta = geo->metadata_size;
@@ -1129,7 +1134,7 @@ static int gpmi_ecc_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
writel(r1_old, bch_regs + HW_BCH_FLASH0LAYOUT0);
writel(r2_old, bch_regs + HW_BCH_FLASH0LAYOUT1);
this->bch_geometry = old_geo;
- this->swap_block_mark = true;
+ this->swap_block_mark = old_swap_block_mark;
return max_bitflips;
}
@@ -1293,10 +1298,10 @@ static int gpmi_ecc_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
/*
* Now, we want to make sure the block mark is correct. In the
- * Swapping/Raw case, we already have it. Otherwise, we need to
- * explicitly read it.
+ * non-transcribing case (!GPMI_IS_MX23()), we already have it.
+ * Otherwise, we need to explicitly read it.
*/
- if (!this->swap_block_mark) {
+ if (GPMI_IS_MX23(this)) {
/* Read the block mark into the first byte of the OOB buffer. */
chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
chip->oob_poi[0] = chip->read_byte(mtd);
@@ -1337,7 +1342,7 @@ static int gpmi_block_markbad(struct mtd_info *mtd, loff_t ofs)
chipnr = (int)(ofs >> chip->chip_shift);
chip->select_chip(mtd, chipnr);
- column = this->swap_block_mark ? mtd->writesize : 0;
+ column = !GPMI_IS_MX23(this) ? mtd->writesize : 0;
/* Write the block mark. */
block_mark = this->data_buffer_dma;
@@ -1632,9 +1637,6 @@ static int gpmi_init_last(struct gpmi_nand_data *this)
struct bch_geometry *bch_geo = &this->bch_geometry;
int ret;
- /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
- this->swap_block_mark = !GPMI_IS_MX23(this);
-
/* Set up the medium geometry */
ret = gpmi_set_geometry(this);
if (ret)
@@ -1698,9 +1700,20 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
chip->badblock_pattern = &gpmi_bbt_descr;
chip->block_markbad = gpmi_block_markbad;
chip->options |= NAND_NO_SUBPAGE_WRITE;
- if (of_get_nand_on_flash_bbt(this->dev->of_node))
+
+ /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
+ this->swap_block_mark = !GPMI_IS_MX23(this);
+
+ if (of_get_nand_on_flash_bbt(this->dev->of_node)) {
chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+ if (of_property_read_bool(this->dev->of_node,
+ "fsl,no-blockmark-swap"))
+ this->swap_block_mark = false;
+ }
+ dev_dbg(this->dev, "Blockmark swapping %sabled\n",
+ this->swap_block_mark ? "en" : "dis");
+
/*
* Allocate a temporary DMA buffer for reading ID in the
* nand_scan_ident().
--
1.7.10.4
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCHv3 1/2] mtd: gpmi: make blockmark swapping optional
2014-03-28 10:35 ` [PATCHv3 1/2] " Lothar Waßmann
@ 2014-03-31 2:06 ` Huang Shijie
0 siblings, 0 replies; 39+ messages in thread
From: Huang Shijie @ 2014-03-31 2:06 UTC (permalink / raw)
To: Lothar Waßmann
Cc: Mark Rutland, Boris BREZILLON, linux-doc, Artem Bityutskiy,
Wei Yongjun, linux-mtd, Michael Grzeschik, Russell King,
Arnd Bergmann, Jingoo Han, Shawn Guo, Ezequiel Garcia,
Michael Opdenacker, Grant Likely, devicetree, Sascha Hauer,
Pawel Moll, Ian Campbell, Rob Herring, linux-arm-kernel,
Fabio Estevam, Brian Norris
On Fri, Mar 28, 2014 at 11:35:06AM +0100, Lothar Waßmann wrote:
> + - fsl,no-blockmark-swap: Don't swap the bad block marker from the OOB
> + area with the byte in the data area but rely on the
> + flash based BBT for identifying bad blocks.
> + NOTE: this is only valid in conjunction with
> + 'nand-on-flash-bbt'.
> + WARNING: on i.MX28 blockmark swapping cannot be
> + disabled for the BootROM in the FCB. Thus,
> + partitions written from Linux with this feature
> + turned on may not be accessible by the BootROM
> + code.
Thanks for adding this warning.
Acked-by: Huang Shijie <b32955@freescale.com>
thanks
Huang Shijie
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCHv3 2/2] of/mtd/nand: add generic binding and helper for NAND_BBT_NO_OOB_BBM
2014-03-28 10:35 ` [PATCHv3 0/2] " Lothar Waßmann
2014-03-28 10:35 ` [PATCHv3 1/2] " Lothar Waßmann
@ 2014-03-28 10:35 ` Lothar Waßmann
1 sibling, 0 replies; 39+ messages in thread
From: Lothar Waßmann @ 2014-03-28 10:35 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo, devicetree,
linux-arm-kernel, linux-doc, linux-kernel, linux-mtd, Shawn Guo,
Boris BREZILLON
add a boolean property 'nand-no-oob-bbm' and helper function to be
able to set the NAND_BBT_NO_OOB_BBM flag in DT capable NAND drivers
and use it for i.MX and MXS nand drivers.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
Documentation/devicetree/bindings/mtd/nand.txt | 1 +
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 +++
drivers/mtd/nand/mxc_nand.c | 2 ++
drivers/of/of_mtd.c | 12 ++++++++++++
include/linux/of_mtd.h | 6 ++++++
5 files changed, 24 insertions(+)
diff --git a/Documentation/devicetree/bindings/mtd/nand.txt b/Documentation/devicetree/bindings/mtd/nand.txt
index b53f92e..e46bfbe 100644
--- a/Documentation/devicetree/bindings/mtd/nand.txt
+++ b/Documentation/devicetree/bindings/mtd/nand.txt
@@ -5,6 +5,7 @@
"soft_bch".
- nand-bus-width : 8 or 16 bus width if not present 8
- nand-on-flash-bbt: boolean to enable on flash bbt option if not present false
+- nand-no-oob-bbm: boolean to disable writing bad block markers to flash
- nand-ecc-strength: integer representing the number of bits to correct
per ECC step.
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 2a489b3..c23f27b 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1707,6 +1707,9 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
if (of_get_nand_on_flash_bbt(this->dev->of_node)) {
chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+ if (of_get_nand_no_oob_bbm(this->dev->of_node))
+ chip->bbt_options |= NAND_BBT_NO_OOB_BBM;
+
if (of_property_read_bool(this->dev->of_node,
"fsl,no-blockmark-swap"))
this->swap_block_mark = false;
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index dba262b..bb54a2a 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1496,6 +1496,8 @@ static int mxcnd_probe(struct platform_device *pdev)
this->bbt_md = &bbt_mirror_descr;
/* update flash based bbt */
this->bbt_options |= NAND_BBT_USE_FLASH;
+ if (of_get_nand_no_oob_bbm(pdev->dev.of_node))
+ this->bbt_options |= NAND_BBT_NO_OOB_BBM;
}
init_completion(&host->op_completion);
diff --git a/drivers/of/of_mtd.c b/drivers/of/of_mtd.c
index b7361ed..d947acc 100644
--- a/drivers/of/of_mtd.c
+++ b/drivers/of/of_mtd.c
@@ -117,3 +117,15 @@ bool of_get_nand_on_flash_bbt(struct device_node *np)
return of_property_read_bool(np, "nand-on-flash-bbt");
}
EXPORT_SYMBOL_GPL(of_get_nand_on_flash_bbt);
+
+/**
+ * of_get_nand_no_oob_bbm - Get nand no oob bbm for given device_node
+ * @np: Pointer to the given device_node
+ *
+ * return true if present, false otherwise
+ */
+bool of_get_nand_no_oob_bbm(struct device_node *np)
+{
+ return of_property_read_bool(np, "nand-no-oob-bbm");
+}
+EXPORT_SYMBOL_GPL(of_get_nand_no_oob_bbm);
diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h
index e266caa..6ece1a9 100644
--- a/include/linux/of_mtd.h
+++ b/include/linux/of_mtd.h
@@ -17,6 +17,7 @@ int of_get_nand_ecc_step_size(struct device_node *np);
int of_get_nand_ecc_strength(struct device_node *np);
int of_get_nand_bus_width(struct device_node *np);
bool of_get_nand_on_flash_bbt(struct device_node *np);
+bool of_get_nand_no_oob_bbm(struct device_node *np);
#else /* CONFIG_OF_MTD */
@@ -45,6 +46,11 @@ static inline bool of_get_nand_on_flash_bbt(struct device_node *np)
return false;
}
+static inline bool of_get_nand_no_oob_bbm(struct device_node *np)
+{
+ return false;
+}
+
#endif /* CONFIG_OF_MTD */
#endif /* __LINUX_OF_MTD_H */
--
1.7.10.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH] mtd: gpmi: make blockmark swapping optional
@ 2014-03-19 13:23 y
0 siblings, 0 replies; 39+ messages in thread
From: y @ 2014-03-19 13:23 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo, devicetree,
linux-arm-kernel, linux-doc, linux-kernel, linux-mtd
From: Lothar Waßmann <LW@KARO-electronics.de>
With a flash-based BBT there is no reason to move the Factory Bad
Block Marker from the data area buffer (to where it is mapped by the
GPMI NAND controller) to the OOB buffer. Thus, make this feature
configurable via DT. This is required for the Ka-Ro electronics
platforms.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
Documentation/devicetree/bindings/mtd/gpmi-nand.txt | 3 +++
arch/arm/boot/dts/imx28-tx28.dts | 1 +
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 +++++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 458d596..f28949a 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -25,6 +25,9 @@ Optional properties:
discoverable or this property is not enabled,
the software may chooses an implementation-defined
ECC scheme.
+ - fsl,no-blockmark-swap: Don't swap the bad block marker from the OOB
+ area with the byte in the data area but rely on the
+ BBT for identifying bad blocks.
The device tree may optionally contain sub-nodes describing partitions of the
address space. See partition.txt for more detail.
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index e14bd86..7d2bea8 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -247,6 +247,7 @@
&gpmi {
pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
nand-on-flash-bbt;
+ fsl,no-blockmark-swap;
status = "okay";
};
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index bb77f75..98562eb 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1632,9 +1632,6 @@ static int gpmi_init_last(struct gpmi_nand_data *this)
struct bch_geometry *bch_geo = &this->bch_geometry;
int ret;
- /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
- this->swap_block_mark = !GPMI_IS_MX23(this);
-
/* Set up the medium geometry */
ret = gpmi_set_geometry(this);
if (ret)
@@ -1701,6 +1698,13 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
if (of_get_nand_on_flash_bbt(this->dev->of_node))
chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+ /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
+ if (!of_property_read_bool(this->dev->of_node, "fsl,no-blockmark-swap"))
+ this->swap_block_mark = !GPMI_IS_MX23(this);
+
+ dev_dbg(this->dev, "Blockmark swapping %sabled\n",
+ this->swap_block_mark ? "en" : "dis");
+
/*
* Allocate a temporary DMA buffer for reading ID in the
* nand_scan_ident().
--
1.7.10.4
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH] mtd: gpmi: make blockmark swapping optional
@ 2014-03-19 13:23 y
0 siblings, 0 replies; 39+ messages in thread
From: y @ 2014-03-19 13:23 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo, devicetree,
linux-arm-kernel, linux-doc, linux-kernel, linux-mtd
From: Lothar Waßmann <LW@KARO-electronics.de>
With a flash-based BBT there is no reason to move the Factory Bad
Block Marker from the data area buffer (to where it is mapped by the
GPMI NAND controller) to the OOB buffer. Thus, make this feature
configurable via DT. This is required for the Ka-Ro electronics
platforms.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
Documentation/devicetree/bindings/mtd/gpmi-nand.txt | 3 +++
arch/arm/boot/dts/imx28-tx28.dts | 1 +
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 +++++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 458d596..f28949a 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -25,6 +25,9 @@ Optional properties:
discoverable or this property is not enabled,
the software may chooses an implementation-defined
ECC scheme.
+ - fsl,no-blockmark-swap: Don't swap the bad block marker from the OOB
+ area with the byte in the data area but rely on the
+ BBT for identifying bad blocks.
The device tree may optionally contain sub-nodes describing partitions of the
address space. See partition.txt for more detail.
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index e14bd86..7d2bea8 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -247,6 +247,7 @@
&gpmi {
pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
nand-on-flash-bbt;
+ fsl,no-blockmark-swap;
status = "okay";
};
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index bb77f75..98562eb 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1632,9 +1632,6 @@ static int gpmi_init_last(struct gpmi_nand_data *this)
struct bch_geometry *bch_geo = &this->bch_geometry;
int ret;
- /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
- this->swap_block_mark = !GPMI_IS_MX23(this);
-
/* Set up the medium geometry */
ret = gpmi_set_geometry(this);
if (ret)
@@ -1701,6 +1698,13 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
if (of_get_nand_on_flash_bbt(this->dev->of_node))
chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+ /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
+ if (!of_property_read_bool(this->dev->of_node, "fsl,no-blockmark-swap"))
+ this->swap_block_mark = !GPMI_IS_MX23(this);
+
+ dev_dbg(this->dev, "Blockmark swapping %sabled\n",
+ this->swap_block_mark ? "en" : "dis");
+
/*
* Allocate a temporary DMA buffer for reading ID in the
* nand_scan_ident().
--
1.7.10.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH] mtd: gpmi: make blockmark swapping optional
@ 2014-03-19 13:23 y
0 siblings, 0 replies; 39+ messages in thread
From: y @ 2014-03-19 13:23 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo, devicetree,
linux-arm-kernel, linux-doc, linux-kernel, linux-mtd
From: Lothar Waßmann <LW@KARO-electronics.de>
With a flash-based BBT there is no reason to move the Factory Bad
Block Marker from the data area buffer (to where it is mapped by the
GPMI NAND controller) to the OOB buffer. Thus, make this feature
configurable via DT. This is required for the Ka-Ro electronics
platforms.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
Documentation/devicetree/bindings/mtd/gpmi-nand.txt | 3 +++
arch/arm/boot/dts/imx28-tx28.dts | 1 +
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 +++++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 458d596..f28949a 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -25,6 +25,9 @@ Optional properties:
discoverable or this property is not enabled,
the software may chooses an implementation-defined
ECC scheme.
+ - fsl,no-blockmark-swap: Don't swap the bad block marker from the OOB
+ area with the byte in the data area but rely on the
+ BBT for identifying bad blocks.
The device tree may optionally contain sub-nodes describing partitions of the
address space. See partition.txt for more detail.
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index e14bd86..7d2bea8 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -247,6 +247,7 @@
&gpmi {
pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
nand-on-flash-bbt;
+ fsl,no-blockmark-swap;
status = "okay";
};
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index bb77f75..98562eb 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1632,9 +1632,6 @@ static int gpmi_init_last(struct gpmi_nand_data *this)
struct bch_geometry *bch_geo = &this->bch_geometry;
int ret;
- /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
- this->swap_block_mark = !GPMI_IS_MX23(this);
-
/* Set up the medium geometry */
ret = gpmi_set_geometry(this);
if (ret)
@@ -1701,6 +1698,13 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
if (of_get_nand_on_flash_bbt(this->dev->of_node))
chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+ /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
+ if (!of_property_read_bool(this->dev->of_node, "fsl,no-blockmark-swap"))
+ this->swap_block_mark = !GPMI_IS_MX23(this);
+
+ dev_dbg(this->dev, "Blockmark swapping %sabled\n",
+ this->swap_block_mark ? "en" : "dis");
+
/*
* Allocate a temporary DMA buffer for reading ID in the
* nand_scan_ident().
--
1.7.10.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH] mtd: gpmi: make blockmark swapping optional
@ 2014-03-19 13:23 y
0 siblings, 0 replies; 39+ messages in thread
From: y @ 2014-03-19 13:23 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo, devicetree,
linux-arm-kernel, linux-doc, linux-kernel, linux-mtd
From: Lothar Waßmann <LW@KARO-electronics.de>
With a flash-based BBT there is no reason to move the Factory Bad
Block Marker from the data area buffer (to where it is mapped by the
GPMI NAND controller) to the OOB buffer. Thus, make this feature
configurable via DT. This is required for the Ka-Ro electronics
platforms.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
Documentation/devicetree/bindings/mtd/gpmi-nand.txt | 3 +++
arch/arm/boot/dts/imx28-tx28.dts | 1 +
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 +++++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 458d596..f28949a 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -25,6 +25,9 @@ Optional properties:
discoverable or this property is not enabled,
the software may chooses an implementation-defined
ECC scheme.
+ - fsl,no-blockmark-swap: Don't swap the bad block marker from the OOB
+ area with the byte in the data area but rely on the
+ BBT for identifying bad blocks.
The device tree may optionally contain sub-nodes describing partitions of the
address space. See partition.txt for more detail.
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index e14bd86..7d2bea8 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -247,6 +247,7 @@
&gpmi {
pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
nand-on-flash-bbt;
+ fsl,no-blockmark-swap;
status = "okay";
};
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index bb77f75..98562eb 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1632,9 +1632,6 @@ static int gpmi_init_last(struct gpmi_nand_data *this)
struct bch_geometry *bch_geo = &this->bch_geometry;
int ret;
- /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
- this->swap_block_mark = !GPMI_IS_MX23(this);
-
/* Set up the medium geometry */
ret = gpmi_set_geometry(this);
if (ret)
@@ -1701,6 +1698,13 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
if (of_get_nand_on_flash_bbt(this->dev->of_node))
chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+ /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
+ if (!of_property_read_bool(this->dev->of_node, "fsl,no-blockmark-swap"))
+ this->swap_block_mark = !GPMI_IS_MX23(this);
+
+ dev_dbg(this->dev, "Blockmark swapping %sabled\n",
+ this->swap_block_mark ? "en" : "dis");
+
/*
* Allocate a temporary DMA buffer for reading ID in the
* nand_scan_ident().
--
1.7.10.4
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH] mtd: gpmi: make blockmark swapping optional
@ 2014-03-19 13:23 y
0 siblings, 0 replies; 39+ messages in thread
From: y @ 2014-03-19 13:23 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo, devicetree,
linux-arm-kernel, linux-doc, linux-kernel, linux-mtd
From: Lothar Waßmann <LW@KARO-electronics.de>
With a flash-based BBT there is no reason to move the Factory Bad
Block Marker from the data area buffer (to where it is mapped by the
GPMI NAND controller) to the OOB buffer. Thus, make this feature
configurable via DT. This is required for the Ka-Ro electronics
platforms.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
Documentation/devicetree/bindings/mtd/gpmi-nand.txt | 3 +++
arch/arm/boot/dts/imx28-tx28.dts | 1 +
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 +++++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 458d596..f28949a 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -25,6 +25,9 @@ Optional properties:
discoverable or this property is not enabled,
the software may chooses an implementation-defined
ECC scheme.
+ - fsl,no-blockmark-swap: Don't swap the bad block marker from the OOB
+ area with the byte in the data area but rely on the
+ BBT for identifying bad blocks.
The device tree may optionally contain sub-nodes describing partitions of the
address space. See partition.txt for more detail.
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index e14bd86..7d2bea8 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -247,6 +247,7 @@
&gpmi {
pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
nand-on-flash-bbt;
+ fsl,no-blockmark-swap;
status = "okay";
};
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index bb77f75..98562eb 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1632,9 +1632,6 @@ static int gpmi_init_last(struct gpmi_nand_data *this)
struct bch_geometry *bch_geo = &this->bch_geometry;
int ret;
- /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
- this->swap_block_mark = !GPMI_IS_MX23(this);
-
/* Set up the medium geometry */
ret = gpmi_set_geometry(this);
if (ret)
@@ -1701,6 +1698,13 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
if (of_get_nand_on_flash_bbt(this->dev->of_node))
chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+ /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
+ if (!of_property_read_bool(this->dev->of_node, "fsl,no-blockmark-swap"))
+ this->swap_block_mark = !GPMI_IS_MX23(this);
+
+ dev_dbg(this->dev, "Blockmark swapping %sabled\n",
+ this->swap_block_mark ? "en" : "dis");
+
/*
* Allocate a temporary DMA buffer for reading ID in the
* nand_scan_ident().
--
1.7.10.4
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH] mtd: gpmi: make blockmark swapping optional
@ 2014-03-19 13:23 y
0 siblings, 0 replies; 39+ messages in thread
From: y @ 2014-03-19 13:23 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo, devicetree,
linux-arm-kernel, linux-doc, linux-kernel, linux-mtd
From: Lothar Waßmann <LW@KARO-electronics.de>
With a flash-based BBT there is no reason to move the Factory Bad
Block Marker from the data area buffer (to where it is mapped by the
GPMI NAND controller) to the OOB buffer. Thus, make this feature
configurable via DT. This is required for the Ka-Ro electronics
platforms.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
Documentation/devicetree/bindings/mtd/gpmi-nand.txt | 3 +++
arch/arm/boot/dts/imx28-tx28.dts | 1 +
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 +++++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 458d596..f28949a 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -25,6 +25,9 @@ Optional properties:
discoverable or this property is not enabled,
the software may chooses an implementation-defined
ECC scheme.
+ - fsl,no-blockmark-swap: Don't swap the bad block marker from the OOB
+ area with the byte in the data area but rely on the
+ BBT for identifying bad blocks.
The device tree may optionally contain sub-nodes describing partitions of the
address space. See partition.txt for more detail.
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index e14bd86..7d2bea8 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -247,6 +247,7 @@
&gpmi {
pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
nand-on-flash-bbt;
+ fsl,no-blockmark-swap;
status = "okay";
};
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index bb77f75..98562eb 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1632,9 +1632,6 @@ static int gpmi_init_last(struct gpmi_nand_data *this)
struct bch_geometry *bch_geo = &this->bch_geometry;
int ret;
- /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
- this->swap_block_mark = !GPMI_IS_MX23(this);
-
/* Set up the medium geometry */
ret = gpmi_set_geometry(this);
if (ret)
@@ -1701,6 +1698,13 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
if (of_get_nand_on_flash_bbt(this->dev->of_node))
chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+ /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
+ if (!of_property_read_bool(this->dev->of_node, "fsl,no-blockmark-swap"))
+ this->swap_block_mark = !GPMI_IS_MX23(this);
+
+ dev_dbg(this->dev, "Blockmark swapping %sabled\n",
+ this->swap_block_mark ? "en" : "dis");
+
/*
* Allocate a temporary DMA buffer for reading ID in the
* nand_scan_ident().
--
1.7.10.4
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH] mtd: gpmi: make blockmark swapping optional
@ 2014-03-19 13:23 y
0 siblings, 0 replies; 39+ messages in thread
From: y @ 2014-03-19 13:23 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo, devicetree,
linux-arm-kernel, linux-doc, linux-kernel, linux-mtd
From: Lothar Waßmann <LW@KARO-electronics.de>
With a flash-based BBT there is no reason to move the Factory Bad
Block Marker from the data area buffer (to where it is mapped by the
GPMI NAND controller) to the OOB buffer. Thus, make this feature
configurable via DT. This is required for the Ka-Ro electronics
platforms.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
Documentation/devicetree/bindings/mtd/gpmi-nand.txt | 3 +++
arch/arm/boot/dts/imx28-tx28.dts | 1 +
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 +++++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 458d596..f28949a 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -25,6 +25,9 @@ Optional properties:
discoverable or this property is not enabled,
the software may chooses an implementation-defined
ECC scheme.
+ - fsl,no-blockmark-swap: Don't swap the bad block marker from the OOB
+ area with the byte in the data area but rely on the
+ BBT for identifying bad blocks.
The device tree may optionally contain sub-nodes describing partitions of the
address space. See partition.txt for more detail.
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index e14bd86..7d2bea8 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -247,6 +247,7 @@
&gpmi {
pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
nand-on-flash-bbt;
+ fsl,no-blockmark-swap;
status = "okay";
};
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index bb77f75..98562eb 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1632,9 +1632,6 @@ static int gpmi_init_last(struct gpmi_nand_data *this)
struct bch_geometry *bch_geo = &this->bch_geometry;
int ret;
- /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
- this->swap_block_mark = !GPMI_IS_MX23(this);
-
/* Set up the medium geometry */
ret = gpmi_set_geometry(this);
if (ret)
@@ -1701,6 +1698,13 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
if (of_get_nand_on_flash_bbt(this->dev->of_node))
chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+ /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
+ if (!of_property_read_bool(this->dev->of_node, "fsl,no-blockmark-swap"))
+ this->swap_block_mark = !GPMI_IS_MX23(this);
+
+ dev_dbg(this->dev, "Blockmark swapping %sabled\n",
+ this->swap_block_mark ? "en" : "dis");
+
/*
* Allocate a temporary DMA buffer for reading ID in the
* nand_scan_ident().
--
1.7.10.4
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH] mtd: gpmi: make blockmark swapping optional
@ 2014-03-19 13:23 y
0 siblings, 0 replies; 39+ messages in thread
From: y @ 2014-03-19 13:23 UTC (permalink / raw)
To: Arnd Bergmann, Artem Bityutskiy, Brian Norris, David Woodhouse,
Fabio Estevam, Huang Shijie, Ian Campbell, Kumar Gala,
Lothar Waßmann, Mark Rutland, Pawel Moll, Rob Herring,
Rob Landley, Russell King, Sascha Hauer, Shawn Guo,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
From: Lothar Waßmann <LW-bxm8fMRDkQLDiMYJYoSAnRvVK+yQ3ZXh@public.gmane.org>
With a flash-based BBT there is no reason to move the Factory Bad
Block Marker from the data area buffer (to where it is mapped by the
GPMI NAND controller) to the OOB buffer. Thus, make this feature
configurable via DT. This is required for the Ka-Ro electronics
platforms.
Signed-off-by: Lothar Waßmann <LW-bxm8fMRDkQLDiMYJYoSAnRvVK+yQ3ZXh@public.gmane.org>
---
Documentation/devicetree/bindings/mtd/gpmi-nand.txt | 3 +++
arch/arm/boot/dts/imx28-tx28.dts | 1 +
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 10 +++++++---
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index 458d596..f28949a 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -25,6 +25,9 @@ Optional properties:
discoverable or this property is not enabled,
the software may chooses an implementation-defined
ECC scheme.
+ - fsl,no-blockmark-swap: Don't swap the bad block marker from the OOB
+ area with the byte in the data area but rely on the
+ BBT for identifying bad blocks.
The device tree may optionally contain sub-nodes describing partitions of the
address space. See partition.txt for more detail.
diff --git a/arch/arm/boot/dts/imx28-tx28.dts b/arch/arm/boot/dts/imx28-tx28.dts
index e14bd86..7d2bea8 100644
--- a/arch/arm/boot/dts/imx28-tx28.dts
+++ b/arch/arm/boot/dts/imx28-tx28.dts
@@ -247,6 +247,7 @@
&gpmi {
pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
nand-on-flash-bbt;
+ fsl,no-blockmark-swap;
status = "okay";
};
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index bb77f75..98562eb 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1632,9 +1632,6 @@ static int gpmi_init_last(struct gpmi_nand_data *this)
struct bch_geometry *bch_geo = &this->bch_geometry;
int ret;
- /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
- this->swap_block_mark = !GPMI_IS_MX23(this);
-
/* Set up the medium geometry */
ret = gpmi_set_geometry(this);
if (ret)
@@ -1701,6 +1698,13 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
if (of_get_nand_on_flash_bbt(this->dev->of_node))
chip->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB;
+ /* Set up swap_block_mark, must be set before the gpmi_set_geometry() */
+ if (!of_property_read_bool(this->dev->of_node, "fsl,no-blockmark-swap"))
+ this->swap_block_mark = !GPMI_IS_MX23(this);
+
+ dev_dbg(this->dev, "Blockmark swapping %sabled\n",
+ this->swap_block_mark ? "en" : "dis");
+
/*
* Allocate a temporary DMA buffer for reading ID in the
* nand_scan_ident().
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 39+ messages in thread
end of thread, other threads:[~2014-03-31 2:06 UTC | newest]
Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1395235406-13449-1-git-send-email-y>
2014-03-20 8:33 ` [PATCH] mtd: gpmi: make blockmark swapping optional Juergen Beisert
2014-03-20 9:20 ` Lothar Waßmann
2014-03-20 9:15 ` Huang Shijie
2014-03-20 9:21 ` Lothar Waßmann
2014-03-20 9:47 ` Huang Shijie
2014-03-20 10:09 ` Lothar Waßmann
2014-03-20 10:56 ` Huang Shijie
2014-03-21 5:36 ` Huang Shijie
[not found] ` <532BCFCC.4080205-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-03-21 10:50 ` [PATCHv2 1/1] " Lothar Waßmann
2014-03-24 9:59 ` Huang Shijie
2014-03-26 8:51 ` Lothar Waßmann
2014-03-26 10:41 ` Huang Shijie
2014-03-26 11:55 ` Lothar Waßmann
2014-03-27 9:59 ` Huang Shijie
2014-03-27 12:21 ` Lothar Waßmann
2014-03-28 2:09 ` Huang Shijie
2014-03-28 8:16 ` Lothar Waßmann
2014-03-28 8:39 ` Huang Shijie
2014-03-28 9:00 ` Sascha Hauer
2014-03-28 9:26 ` Huang Shijie
2014-03-28 9:31 ` Lothar Waßmann
2014-03-28 10:09 ` Huang Shijie
2014-03-28 10:18 ` Lothar Waßmann
2014-03-28 9:01 ` Lothar Waßmann
2014-03-28 9:33 ` Huang Shijie
2014-03-28 9:38 ` Huang Shijie
2014-03-28 10:13 ` Lothar Waßmann
2014-03-28 10:35 ` [PATCHv3 0/2] " Lothar Waßmann
2014-03-28 10:35 ` [PATCHv3 1/2] " Lothar Waßmann
2014-03-31 2:06 ` Huang Shijie
2014-03-28 10:35 ` [PATCHv3 2/2] of/mtd/nand: add generic binding and helper for NAND_BBT_NO_OOB_BBM Lothar Waßmann
2014-03-19 13:23 [PATCH] mtd: gpmi: make blockmark swapping optional y
-- strict thread matches above, loose matches on Subject: below --
2014-03-19 13:23 y
2014-03-19 13:23 y
2014-03-19 13:23 y
2014-03-19 13:23 y
2014-03-19 13:23 y
2014-03-19 13:23 y
2014-03-19 13:23 y
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).