From: Andrew Lunn <andrew@lunn.ch>
To: Stefan Peter <s.peter@mpl.ch>
Cc: andrew@lunn.ch, linux@arm.linux.org.uk, jason@lakedaemon.net,
arnd@arndb.de, gregkh@linuxfoundation.org, iwamatsu@nigauri.org,
devicetree-discuss@lists.ozlabs.org,
broonie@opensource.wolfsonmicro.com,
sebastian.hesselbarth@googlemail.com,
linux-kernel@vger.kernel.org, rob.herring@calxeda.com,
grant.likely@secretlab.ca, wfp5p@virginia.edu,
linux-mtd@lists.infradead.org, nico@linaro.org, rob@landley.net,
artem.bityutskiy@linux.intel.com, dwmw2@infradead.org,
jm@lentin.co.uk, linux-arm-kernel@lists.infradead.org,
mchehab@redhat.com
Subject: Re: [PATCH 3/4] Enable ecc-mode selection in the driver
Date: Tue, 15 Jan 2013 13:51:19 +0100 [thread overview]
Message-ID: <20130115125119.GH13482@lunn.ch> (raw)
In-Reply-To: <2d08c4c072fd4922a6056362adb96a455307d583.1358242644.git.s.peter@mpl.ch>
On Tue, Jan 15, 2013 at 01:13:12PM +0100, Stefan Peter wrote:
> In order to be able to use the ecc-mode, add the bch module to the default
> settings for the kirwood boards and enable the activation in orin-nand.c
>
> Signed-off-by: Stefan Peter <s.peter@mpl.ch>
> ---
> diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
> index 93f3794..4a9d3f7 100644
> --- a/arch/arm/configs/kirkwood_defconfig
> +++ b/arch/arm/configs/kirkwood_defconfig
> @@ -84,6 +84,7 @@ CONFIG_MTD_CFI_STAA=y
> CONFIG_MTD_PHYSMAP=y
> CONFIG_MTD_M25P80=y
> CONFIG_MTD_NAND=y
> +CONFIG_MTD_NAND_ECC_BCH=y
> CONFIG_MTD_NAND_ORION=y
> CONFIG_BLK_DEV_LOOP=y
> # CONFIG_SCSI_PROC_FS is not set
> diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> index cd72b92..1a35257 100644
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -14,6 +14,7 @@
> #include <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/of.h>
> +#include <linux/of_mtd.h>
> #include <linux/mtd/mtd.h>
> #include <linux/mtd/nand.h>
> #include <linux/mtd/partitions.h>
> @@ -130,6 +131,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> if (!of_property_read_u32(pdev->dev.of_node,
> "chip-delay", &val))
> board->chip_delay = (u8)val;
> + board->ecc_mode = of_get_nand_ecc_mode(pdev->dev.of_node);
> } else
> board = pdev->dev.platform_data;
>
> @@ -140,7 +142,8 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> nc->IO_ADDR_R = nc->IO_ADDR_W = io_base;
> nc->cmd_ctrl = orion_nand_cmd_ctrl;
> nc->read_buf = orion_nand_read_buf;
> - nc->ecc.mode = NAND_ECC_SOFT;
> + nc->ecc.mode = board->ecc_mode == NAND_ECC_SOFT_BCH ?
> + NAND_ECC_SOFT_BCH : NAND_ECC_SOFT;
Hi Stefan
What about a user that wants one of the other valid values?
NAND_ECC_OOB_FIRST, NAND_ECC_HW_SYNDROME, etc.
Would:
if (IS_ERR(board->ecc_mode)) {
nc->ecc.mode = NAND_ECC_SOFT;
dev_info(&pdev->dev, "Defaulting to NAND_ECC_SOFT");
} else
nc->ecc.mode = board->ecc_mode
be better?
Andrew
WARNING: multiple messages have this Message-ID (diff)
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] Enable ecc-mode selection in the driver
Date: Tue, 15 Jan 2013 13:51:19 +0100 [thread overview]
Message-ID: <20130115125119.GH13482@lunn.ch> (raw)
In-Reply-To: <2d08c4c072fd4922a6056362adb96a455307d583.1358242644.git.s.peter@mpl.ch>
On Tue, Jan 15, 2013 at 01:13:12PM +0100, Stefan Peter wrote:
> In order to be able to use the ecc-mode, add the bch module to the default
> settings for the kirwood boards and enable the activation in orin-nand.c
>
> Signed-off-by: Stefan Peter <s.peter@mpl.ch>
> ---
> diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
> index 93f3794..4a9d3f7 100644
> --- a/arch/arm/configs/kirkwood_defconfig
> +++ b/arch/arm/configs/kirkwood_defconfig
> @@ -84,6 +84,7 @@ CONFIG_MTD_CFI_STAA=y
> CONFIG_MTD_PHYSMAP=y
> CONFIG_MTD_M25P80=y
> CONFIG_MTD_NAND=y
> +CONFIG_MTD_NAND_ECC_BCH=y
> CONFIG_MTD_NAND_ORION=y
> CONFIG_BLK_DEV_LOOP=y
> # CONFIG_SCSI_PROC_FS is not set
> diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> index cd72b92..1a35257 100644
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -14,6 +14,7 @@
> #include <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/of.h>
> +#include <linux/of_mtd.h>
> #include <linux/mtd/mtd.h>
> #include <linux/mtd/nand.h>
> #include <linux/mtd/partitions.h>
> @@ -130,6 +131,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> if (!of_property_read_u32(pdev->dev.of_node,
> "chip-delay", &val))
> board->chip_delay = (u8)val;
> + board->ecc_mode = of_get_nand_ecc_mode(pdev->dev.of_node);
> } else
> board = pdev->dev.platform_data;
>
> @@ -140,7 +142,8 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> nc->IO_ADDR_R = nc->IO_ADDR_W = io_base;
> nc->cmd_ctrl = orion_nand_cmd_ctrl;
> nc->read_buf = orion_nand_read_buf;
> - nc->ecc.mode = NAND_ECC_SOFT;
> + nc->ecc.mode = board->ecc_mode == NAND_ECC_SOFT_BCH ?
> + NAND_ECC_SOFT_BCH : NAND_ECC_SOFT;
Hi Stefan
What about a user that wants one of the other valid values?
NAND_ECC_OOB_FIRST, NAND_ECC_HW_SYNDROME, etc.
Would:
if (IS_ERR(board->ecc_mode)) {
nc->ecc.mode = NAND_ECC_SOFT;
dev_info(&pdev->dev, "Defaulting to NAND_ECC_SOFT");
} else
nc->ecc.mode = board->ecc_mode
be better?
Andrew
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
To: Stefan Peter <s.peter-R0yVo0h44Ow@public.gmane.org>
Cc: andrew-g2DYL2Zd6BY@public.gmane.org,
linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org,
jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
iwamatsu-+mkmVskJBflAfugRpC6u6w@public.gmane.org,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org,
wfp5p-4Ng6DfrEGID2fBVCVOL8/A@public.gmane.org,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
nico-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
artem.bityutskiy-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
jm-Pj/HzkgeCk7QXOPxS62xeg@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
mchehab-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH 3/4] Enable ecc-mode selection in the driver
Date: Tue, 15 Jan 2013 13:51:19 +0100 [thread overview]
Message-ID: <20130115125119.GH13482@lunn.ch> (raw)
In-Reply-To: <2d08c4c072fd4922a6056362adb96a455307d583.1358242644.git.s.peter-R0yVo0h44Ow@public.gmane.org>
On Tue, Jan 15, 2013 at 01:13:12PM +0100, Stefan Peter wrote:
> In order to be able to use the ecc-mode, add the bch module to the default
> settings for the kirwood boards and enable the activation in orin-nand.c
>
> Signed-off-by: Stefan Peter <s.peter-R0yVo0h44Ow@public.gmane.org>
> ---
> diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
> index 93f3794..4a9d3f7 100644
> --- a/arch/arm/configs/kirkwood_defconfig
> +++ b/arch/arm/configs/kirkwood_defconfig
> @@ -84,6 +84,7 @@ CONFIG_MTD_CFI_STAA=y
> CONFIG_MTD_PHYSMAP=y
> CONFIG_MTD_M25P80=y
> CONFIG_MTD_NAND=y
> +CONFIG_MTD_NAND_ECC_BCH=y
> CONFIG_MTD_NAND_ORION=y
> CONFIG_BLK_DEV_LOOP=y
> # CONFIG_SCSI_PROC_FS is not set
> diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> index cd72b92..1a35257 100644
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -14,6 +14,7 @@
> #include <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/of.h>
> +#include <linux/of_mtd.h>
> #include <linux/mtd/mtd.h>
> #include <linux/mtd/nand.h>
> #include <linux/mtd/partitions.h>
> @@ -130,6 +131,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> if (!of_property_read_u32(pdev->dev.of_node,
> "chip-delay", &val))
> board->chip_delay = (u8)val;
> + board->ecc_mode = of_get_nand_ecc_mode(pdev->dev.of_node);
> } else
> board = pdev->dev.platform_data;
>
> @@ -140,7 +142,8 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> nc->IO_ADDR_R = nc->IO_ADDR_W = io_base;
> nc->cmd_ctrl = orion_nand_cmd_ctrl;
> nc->read_buf = orion_nand_read_buf;
> - nc->ecc.mode = NAND_ECC_SOFT;
> + nc->ecc.mode = board->ecc_mode == NAND_ECC_SOFT_BCH ?
> + NAND_ECC_SOFT_BCH : NAND_ECC_SOFT;
Hi Stefan
What about a user that wants one of the other valid values?
NAND_ECC_OOB_FIRST, NAND_ECC_HW_SYNDROME, etc.
Would:
if (IS_ERR(board->ecc_mode)) {
nc->ecc.mode = NAND_ECC_SOFT;
dev_info(&pdev->dev, "Defaulting to NAND_ECC_SOFT");
} else
nc->ecc.mode = board->ecc_mode
be better?
Andrew
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: Stefan Peter <s.peter@mpl.ch>
Cc: devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mtd@lists.infradead.org, grant.likely@secretlab.ca,
rob.herring@calxeda.com, rob@landley.net, linux@arm.linux.org.uk,
jason@lakedaemon.net, andrew@lunn.ch, dwmw2@infradead.org,
jm@lentin.co.uk, arnd@arndb.de,
sebastian.hesselbarth@googlemail.com, iwamatsu@nigauri.org,
artem.bityutskiy@linux.intel.com, wfp5p@virginia.edu,
gregkh@linuxfoundation.org, broonie@opensource.wolfsonmicro.com,
mchehab@redhat.com, nico@linaro.org
Subject: Re: [PATCH 3/4] Enable ecc-mode selection in the driver
Date: Tue, 15 Jan 2013 13:51:19 +0100 [thread overview]
Message-ID: <20130115125119.GH13482@lunn.ch> (raw)
In-Reply-To: <2d08c4c072fd4922a6056362adb96a455307d583.1358242644.git.s.peter@mpl.ch>
On Tue, Jan 15, 2013 at 01:13:12PM +0100, Stefan Peter wrote:
> In order to be able to use the ecc-mode, add the bch module to the default
> settings for the kirwood boards and enable the activation in orin-nand.c
>
> Signed-off-by: Stefan Peter <s.peter@mpl.ch>
> ---
> diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
> index 93f3794..4a9d3f7 100644
> --- a/arch/arm/configs/kirkwood_defconfig
> +++ b/arch/arm/configs/kirkwood_defconfig
> @@ -84,6 +84,7 @@ CONFIG_MTD_CFI_STAA=y
> CONFIG_MTD_PHYSMAP=y
> CONFIG_MTD_M25P80=y
> CONFIG_MTD_NAND=y
> +CONFIG_MTD_NAND_ECC_BCH=y
> CONFIG_MTD_NAND_ORION=y
> CONFIG_BLK_DEV_LOOP=y
> # CONFIG_SCSI_PROC_FS is not set
> diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
> index cd72b92..1a35257 100644
> --- a/drivers/mtd/nand/orion_nand.c
> +++ b/drivers/mtd/nand/orion_nand.c
> @@ -14,6 +14,7 @@
> #include <linux/module.h>
> #include <linux/platform_device.h>
> #include <linux/of.h>
> +#include <linux/of_mtd.h>
> #include <linux/mtd/mtd.h>
> #include <linux/mtd/nand.h>
> #include <linux/mtd/partitions.h>
> @@ -130,6 +131,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> if (!of_property_read_u32(pdev->dev.of_node,
> "chip-delay", &val))
> board->chip_delay = (u8)val;
> + board->ecc_mode = of_get_nand_ecc_mode(pdev->dev.of_node);
> } else
> board = pdev->dev.platform_data;
>
> @@ -140,7 +142,8 @@ static int __init orion_nand_probe(struct platform_device *pdev)
> nc->IO_ADDR_R = nc->IO_ADDR_W = io_base;
> nc->cmd_ctrl = orion_nand_cmd_ctrl;
> nc->read_buf = orion_nand_read_buf;
> - nc->ecc.mode = NAND_ECC_SOFT;
> + nc->ecc.mode = board->ecc_mode == NAND_ECC_SOFT_BCH ?
> + NAND_ECC_SOFT_BCH : NAND_ECC_SOFT;
Hi Stefan
What about a user that wants one of the other valid values?
NAND_ECC_OOB_FIRST, NAND_ECC_HW_SYNDROME, etc.
Would:
if (IS_ERR(board->ecc_mode)) {
nc->ecc.mode = NAND_ECC_SOFT;
dev_info(&pdev->dev, "Defaulting to NAND_ECC_SOFT");
} else
nc->ecc.mode = board->ecc_mode
be better?
Andrew
next prev parent reply other threads:[~2013-01-15 12:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1358242644.git.s.peter@mpl.ch>
[not found] ` <2d08c4c072fd4922a6056362adb96a455307d583.1358242644.git.s.peter@mpl.ch>
2013-01-15 12:33 ` [PATCH 3/4] Enable ecc-mode selection in the driver Jason Cooper
2013-01-15 12:33 ` Jason Cooper
2013-01-15 12:33 ` Jason Cooper
2013-01-15 12:33 ` Jason Cooper
2013-01-16 11:44 ` Stefan Peter
2013-01-16 11:44 ` Stefan Peter
2013-01-16 11:44 ` Stefan Peter
2013-01-16 11:44 ` Stefan Peter
2013-01-15 12:51 ` Andrew Lunn [this message]
2013-01-15 12:51 ` Andrew Lunn
2013-01-15 12:51 ` Andrew Lunn
2013-01-15 12:51 ` Andrew Lunn
2013-01-16 11:43 ` Stefan Peter
2013-01-16 11:43 ` Stefan Peter
2013-01-16 11:43 ` Stefan Peter
2013-01-16 13:24 ` Andrew Lunn
2013-01-16 13:24 ` Andrew Lunn
2013-01-16 13:24 ` Andrew Lunn
2013-01-18 7:27 ` Artem Bityutskiy
2013-01-18 7:27 ` Artem Bityutskiy
2013-01-18 7:27 ` Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130115125119.GH13482@lunn.ch \
--to=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=artem.bityutskiy@linux.intel.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dwmw2@infradead.org \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@linuxfoundation.org \
--cc=iwamatsu@nigauri.org \
--cc=jason@lakedaemon.net \
--cc=jm@lentin.co.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux@arm.linux.org.uk \
--cc=mchehab@redhat.com \
--cc=nico@linaro.org \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=s.peter@mpl.ch \
--cc=sebastian.hesselbarth@googlemail.com \
--cc=wfp5p@virginia.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.