* [patch 2.6.27-rc3-omap1] omap3 beagle: nand (mostly) cleanups
@ 2008-08-29 17:12 David Brownell
2008-08-29 23:56 ` Woodruff, Richard
0 siblings, 1 reply; 7+ messages in thread
From: David Brownell @ 2008-08-29 17:12 UTC (permalink / raw)
To: linux-omap
From: David Brownell <dbrownell@users.sourceforge.net>
Clean up the Beagle NAND config a bit: use SZ_128K instead of
an arithmetic expression for the NAND block size. Set the
NAND_BUSWIDTH_16 flag. Make its init routine static.
(Unrelated: make omap3_beagle_i2c_init be part of beagle_init.
It shouldn't be called on non-beagle hardware; and beagle_init
already runs with other arch_initcall code.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
arch/arm/mach-omap2/board-omap3beagle.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--- beagle.orig/arch/arm/mach-omap2/board-omap3beagle.c 2008-08-27 21:19:12.000000000 -0700
+++ beagle/arch/arm/mach-omap2/board-omap3beagle.c 2008-08-27 21:21:18.000000000 -0700
@@ -50,24 +50,24 @@ static struct mtd_partition omap3beagle_
{
.name = "X-Loader",
.offset = 0,
- .size = 4*(64 * 2048),
+ .size = 4 * SZ_128K,
.mask_flags = MTD_WRITEABLE, /* force read-only */
},
{
.name = "U-Boot",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
- .size = 15*(64 * 2048),
+ .size = 15 * SZ_128K,
.mask_flags = MTD_WRITEABLE, /* force read-only */
},
{
.name = "U-Boot Env",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */
- .size = 1*(64 * 2048),
+ .size = 1 * SZ_128K,
},
{
.name = "Kernel",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
- .size = 32*(64 * 2048),
+ .size = 32 * SZ_128K,
},
{
.name = "File System",
@@ -77,6 +77,7 @@ static struct mtd_partition omap3beagle_
};
static struct omap_nand_platform_data omap3beagle_nand_data = {
+ .options = NAND_BUSWIDTH_16,
.parts = omap3beagle_nand_partitions,
.nr_parts = ARRAY_SIZE(omap3beagle_nand_partitions),
.dma_channel = -1, /* disable DMA in OMAP NAND driver */
@@ -205,7 +206,7 @@ static struct platform_device *omap3_bea
&keys_gpio,
};
-void __init omap3beagle_flash_init(void)
+static void __init omap3beagle_flash_init(void)
{
u8 cs = 0;
u8 nandcs = GPMC_CS_NUM + 1;
@@ -245,6 +246,7 @@ void __init omap3beagle_flash_init(void)
static void __init omap3_beagle_init(void)
{
+ omap3_beagle_i2c_init();
platform_add_devices(omap3_beagle_devices, ARRAY_SIZE(omap3_beagle_devices));
omap_board_config = omap3_beagle_config;
omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
@@ -255,8 +257,6 @@ static void __init omap3_beagle_init(voi
omap3beagle_flash_init();
}
-arch_initcall(omap3_beagle_i2c_init);
-
static void __init omap3_beagle_map_io(void)
{
omap2_set_globals_343x();
^ permalink raw reply [flat|nested] 7+ messages in thread* RE: [patch 2.6.27-rc3-omap1] omap3 beagle: nand (mostly) cleanups
2008-08-29 17:12 [patch 2.6.27-rc3-omap1] omap3 beagle: nand (mostly) cleanups David Brownell
@ 2008-08-29 23:56 ` Woodruff, Richard
2008-08-30 4:23 ` David Brownell
2008-09-02 17:23 ` David Brownell
0 siblings, 2 replies; 7+ messages in thread
From: Woodruff, Richard @ 2008-08-29 23:56 UTC (permalink / raw)
To: David Brownell, linux-omap@vger.kernel.org
> From: David Brownell <dbrownell@users.sourceforge.net>
>
> Clean up the Beagle NAND config a bit: use SZ_128K instead of
> an arithmetic expression for the NAND block size. Set the
> NAND_BUSWIDTH_16 flag. Make its init routine static.
Actually, this was talked about before a bit and the SZ_xyz flags were left out.
The point of telling the geometry in the addition was to be explicit about the number of sectors being used.
For x-loader you should use 4. The size doesn't matter so much. The ROM code will search for the 1 non-bad block sector in the first four sectors.
A porter of some of these things might try and use size thinking that was the requirement when that is not the whole story. The geometry does matter here.
Regards,
Richard W.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch 2.6.27-rc3-omap1] omap3 beagle: nand (mostly) cleanups
2008-08-29 23:56 ` Woodruff, Richard
@ 2008-08-30 4:23 ` David Brownell
2008-09-02 17:23 ` David Brownell
1 sibling, 0 replies; 7+ messages in thread
From: David Brownell @ 2008-08-30 4:23 UTC (permalink / raw)
To: Woodruff, Richard; +Cc: linux-omap@vger.kernel.org
On Friday 29 August 2008, Woodruff, Richard wrote:
> > Clean up the Beagle NAND config a bit: use SZ_128K instead of
> > an arithmetic expression for the NAND block size. Set the
> > NAND_BUSWIDTH_16 flag. Make its init routine static.
>
>
> Actually, this was talked about before a bit and the SZ_xyz flags were left out.
>
> The point of telling the geometry in the addition was to be explicit
> about the number of sectors being used.
So #define NAND_BLOCK_SIZE SZ_128K and use that symbol instead?
Frankly N*(64 * 2048) isn't very meaningful. The comment at the
top already says everything is in units of blocks, but one is left
to guess that "block" is "(64 * 2048)"...
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch 2.6.27-rc3-omap1] omap3 beagle: nand (mostly) cleanups
2008-08-29 23:56 ` Woodruff, Richard
2008-08-30 4:23 ` David Brownell
@ 2008-09-02 17:23 ` David Brownell
2008-09-02 17:31 ` Woodruff, Richard
2008-09-02 18:46 ` Steve Sakoman
1 sibling, 2 replies; 7+ messages in thread
From: David Brownell @ 2008-09-02 17:23 UTC (permalink / raw)
To: Woodruff, Richard; +Cc: linux-omap@vger.kernel.org
On Friday 29 August 2008, Woodruff, Richard wrote:
> Actually, this was talked about before a bit and the
> SZ_xyz flags were left out.
>
> The point of telling the geometry in the addition was
> to be explicit about the number of sectors being used.
So ... this instead?
=== CUT HERE
From: David Brownell <dbrownell@users.sourceforge.net>
Clean up the Beagle NAND config a bit: use SZ_128K instead of
an arithmetic expression for the NAND block size. Set the
NAND_BUSWIDTH_16 flag. Make its init routine static.
(Unrelated: make omap3_beagle_i2c_init be part of beagle_init.
It shouldn't be called on non-beagle hardware; and beagle_init
already runs with other arch_initcall code.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
arch/arm/mach-omap2/board-omap3beagle.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -42,32 +42,35 @@
#include <mach/gpmc.h>
#include <mach/nand.h>
+
#define GPMC_CS0_BASE 0x60
#define GPMC_CS_SIZE 0x30
+#define NAND_BLOCK_SIZE SZ_128K
+
static struct mtd_partition omap3beagle_nand_partitions[] = {
/* All the partition sizes are listed in terms of NAND block size */
{
.name = "X-Loader",
.offset = 0,
- .size = 4*(64 * 2048),
+ .size = 4 * NAND_BLOCK_SIZE,
.mask_flags = MTD_WRITEABLE, /* force read-only */
},
{
.name = "U-Boot",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
- .size = 15*(64 * 2048),
+ .size = 15 * NAND_BLOCK_SIZE,
.mask_flags = MTD_WRITEABLE, /* force read-only */
},
{
.name = "U-Boot Env",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */
- .size = 1*(64 * 2048),
+ .size = 1 * NAND_BLOCK_SIZE,
},
{
.name = "Kernel",
.offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
- .size = 32*(64 * 2048),
+ .size = 32 * NAND_BLOCK_SIZE,
},
{
.name = "File System",
@@ -77,6 +80,7 @@ static struct mtd_partition omap3beagle_
};
static struct omap_nand_platform_data omap3beagle_nand_data = {
+ .options = NAND_BUSWIDTH_16,
.parts = omap3beagle_nand_partitions,
.nr_parts = ARRAY_SIZE(omap3beagle_nand_partitions),
.dma_channel = -1, /* disable DMA in OMAP NAND driver */
@@ -205,7 +209,7 @@ static struct platform_device *omap3_bea
&keys_gpio,
};
-void __init omap3beagle_flash_init(void)
+static void __init omap3beagle_flash_init(void)
{
u8 cs = 0;
u8 nandcs = GPMC_CS_NUM + 1;
@@ -245,6 +249,7 @@ void __init omap3beagle_flash_init(void)
static void __init omap3_beagle_init(void)
{
+ omap3_beagle_i2c_init();
platform_add_devices(omap3_beagle_devices, ARRAY_SIZE(omap3_beagle_devices));
omap_board_config = omap3_beagle_config;
omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
@@ -255,8 +260,6 @@ static void __init omap3_beagle_init(voi
omap3beagle_flash_init();
}
-arch_initcall(omap3_beagle_i2c_init);
-
static void __init omap3_beagle_map_io(void)
{
omap2_set_globals_343x();
^ permalink raw reply [flat|nested] 7+ messages in thread* RE: [patch 2.6.27-rc3-omap1] omap3 beagle: nand (mostly) cleanups
2008-09-02 17:23 ` David Brownell
@ 2008-09-02 17:31 ` Woodruff, Richard
2008-09-05 16:43 ` Tony Lindgren
2008-09-02 18:46 ` Steve Sakoman
1 sibling, 1 reply; 7+ messages in thread
From: Woodruff, Richard @ 2008-09-02 17:31 UTC (permalink / raw)
To: David Brownell; +Cc: linux-omap@vger.kernel.org
Hi,
> From: David Brownell [mailto:david-b@pacbell.net]
> > Actually, this was talked about before a bit and the
> > SZ_xyz flags were left out.
> >
> > The point of telling the geometry in the addition was
> > to be explicit about the number of sectors being used.
>
> So ... this instead?
Yes that looks good thanks.
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Richard Woodruff <r-woodruff2@ti.com>
> ---
> arch/arm/mach-omap2/board-omap3beagle.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -42,32 +42,35 @@
> #include <mach/gpmc.h>
> #include <mach/nand.h>
>
> +
> #define GPMC_CS0_BASE 0x60
> #define GPMC_CS_SIZE 0x30
>
> +#define NAND_BLOCK_SIZE SZ_128K
> +
> static struct mtd_partition omap3beagle_nand_partitions[] = {
> /* All the partition sizes are listed in terms of NAND block size
> */
> {
> .name = "X-Loader",
> .offset = 0,
> - .size = 4*(64 * 2048),
> + .size = 4 * NAND_BLOCK_SIZE,
> .mask_flags = MTD_WRITEABLE, /* force read-only */
> },
> {
> .name = "U-Boot",
> .offset = MTDPART_OFS_APPEND, /* Offset =
> 0x80000 */
> - .size = 15*(64 * 2048),
> + .size = 15 * NAND_BLOCK_SIZE,
> .mask_flags = MTD_WRITEABLE, /* force read-only */
> },
> {
> .name = "U-Boot Env",
> .offset = MTDPART_OFS_APPEND, /* Offset =
> 0x260000 */
> - .size = 1*(64 * 2048),
> + .size = 1 * NAND_BLOCK_SIZE,
> },
> {
> .name = "Kernel",
> .offset = MTDPART_OFS_APPEND, /* Offset =
> 0x280000 */
> - .size = 32*(64 * 2048),
> + .size = 32 * NAND_BLOCK_SIZE,
> },
> {
> .name = "File System",
> @@ -77,6 +80,7 @@ static struct mtd_partition omap3beagle_
> };
>
> static struct omap_nand_platform_data omap3beagle_nand_data = {
> + .options = NAND_BUSWIDTH_16,
> .parts = omap3beagle_nand_partitions,
> .nr_parts = ARRAY_SIZE(omap3beagle_nand_partitions),
> .dma_channel = -1, /* disable DMA in OMAP NAND driver
> */
> @@ -205,7 +209,7 @@ static struct platform_device *omap3_bea
> &keys_gpio,
> };
>
> -void __init omap3beagle_flash_init(void)
> +static void __init omap3beagle_flash_init(void)
> {
> u8 cs = 0;
> u8 nandcs = GPMC_CS_NUM + 1;
> @@ -245,6 +249,7 @@ void __init omap3beagle_flash_init(void)
>
> static void __init omap3_beagle_init(void)
> {
> + omap3_beagle_i2c_init();
> platform_add_devices(omap3_beagle_devices,
> ARRAY_SIZE(omap3_beagle_devices));
> omap_board_config = omap3_beagle_config;
> omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
> @@ -255,8 +260,6 @@ static void __init omap3_beagle_init(voi
> omap3beagle_flash_init();
> }
>
> -arch_initcall(omap3_beagle_i2c_init);
> -
> static void __init omap3_beagle_map_io(void)
> {
> omap2_set_globals_343x();
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [patch 2.6.27-rc3-omap1] omap3 beagle: nand (mostly) cleanups
2008-09-02 17:31 ` Woodruff, Richard
@ 2008-09-05 16:43 ` Tony Lindgren
0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2008-09-05 16:43 UTC (permalink / raw)
To: Woodruff, Richard; +Cc: David Brownell, linux-omap@vger.kernel.org
* Woodruff, Richard <r-woodruff2@ti.com> [080902 10:33]:
> Hi,
>
> > From: David Brownell [mailto:david-b@pacbell.net]
> > > Actually, this was talked about before a bit and the
> > > SZ_xyz flags were left out.
> > >
> > > The point of telling the geometry in the addition was
> > > to be explicit about the number of sectors being used.
> >
> > So ... this instead?
>
> Yes that looks good thanks.
Pushing these three beagle patches today.
Tony
>
> > Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
>
> Acked-by: Richard Woodruff <r-woodruff2@ti.com>
>
> > ---
> > arch/arm/mach-omap2/board-omap3beagle.c | 17 ++++++++++-------
> > 1 file changed, 10 insertions(+), 7 deletions(-)
> >
> > --- a/arch/arm/mach-omap2/board-omap3beagle.c
> > +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> > @@ -42,32 +42,35 @@
> > #include <mach/gpmc.h>
> > #include <mach/nand.h>
> >
> > +
> > #define GPMC_CS0_BASE 0x60
> > #define GPMC_CS_SIZE 0x30
> >
> > +#define NAND_BLOCK_SIZE SZ_128K
> > +
> > static struct mtd_partition omap3beagle_nand_partitions[] = {
> > /* All the partition sizes are listed in terms of NAND block size
> > */
> > {
> > .name = "X-Loader",
> > .offset = 0,
> > - .size = 4*(64 * 2048),
> > + .size = 4 * NAND_BLOCK_SIZE,
> > .mask_flags = MTD_WRITEABLE, /* force read-only */
> > },
> > {
> > .name = "U-Boot",
> > .offset = MTDPART_OFS_APPEND, /* Offset =
> > 0x80000 */
> > - .size = 15*(64 * 2048),
> > + .size = 15 * NAND_BLOCK_SIZE,
> > .mask_flags = MTD_WRITEABLE, /* force read-only */
> > },
> > {
> > .name = "U-Boot Env",
> > .offset = MTDPART_OFS_APPEND, /* Offset =
> > 0x260000 */
> > - .size = 1*(64 * 2048),
> > + .size = 1 * NAND_BLOCK_SIZE,
> > },
> > {
> > .name = "Kernel",
> > .offset = MTDPART_OFS_APPEND, /* Offset =
> > 0x280000 */
> > - .size = 32*(64 * 2048),
> > + .size = 32 * NAND_BLOCK_SIZE,
> > },
> > {
> > .name = "File System",
> > @@ -77,6 +80,7 @@ static struct mtd_partition omap3beagle_
> > };
> >
> > static struct omap_nand_platform_data omap3beagle_nand_data = {
> > + .options = NAND_BUSWIDTH_16,
> > .parts = omap3beagle_nand_partitions,
> > .nr_parts = ARRAY_SIZE(omap3beagle_nand_partitions),
> > .dma_channel = -1, /* disable DMA in OMAP NAND driver
> > */
> > @@ -205,7 +209,7 @@ static struct platform_device *omap3_bea
> > &keys_gpio,
> > };
> >
> > -void __init omap3beagle_flash_init(void)
> > +static void __init omap3beagle_flash_init(void)
> > {
> > u8 cs = 0;
> > u8 nandcs = GPMC_CS_NUM + 1;
> > @@ -245,6 +249,7 @@ void __init omap3beagle_flash_init(void)
> >
> > static void __init omap3_beagle_init(void)
> > {
> > + omap3_beagle_i2c_init();
> > platform_add_devices(omap3_beagle_devices,
> > ARRAY_SIZE(omap3_beagle_devices));
> > omap_board_config = omap3_beagle_config;
> > omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
> > @@ -255,8 +260,6 @@ static void __init omap3_beagle_init(voi
> > omap3beagle_flash_init();
> > }
> >
> > -arch_initcall(omap3_beagle_i2c_init);
> > -
> > static void __init omap3_beagle_map_io(void)
> > {
> > omap2_set_globals_343x();
> >
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch 2.6.27-rc3-omap1] omap3 beagle: nand (mostly) cleanups
2008-09-02 17:23 ` David Brownell
2008-09-02 17:31 ` Woodruff, Richard
@ 2008-09-02 18:46 ` Steve Sakoman
1 sibling, 0 replies; 7+ messages in thread
From: Steve Sakoman @ 2008-09-02 18:46 UTC (permalink / raw)
To: David Brownell, Woodruff, Richard, linux-omap@vger.kernel.org
On Tue, Sep 2, 2008 at 10:23 AM, David Brownell <david-b@pacbell.net> wrote:
> (Unrelated: make omap3_beagle_i2c_init be part of beagle_init.
> It shouldn't be called on non-beagle hardware; and beagle_init
> already runs with other arch_initcall code.)
Good catch, I will do the same on the Overo board file.
Steve
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-09-05 16:43 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-29 17:12 [patch 2.6.27-rc3-omap1] omap3 beagle: nand (mostly) cleanups David Brownell
2008-08-29 23:56 ` Woodruff, Richard
2008-08-30 4:23 ` David Brownell
2008-09-02 17:23 ` David Brownell
2008-09-02 17:31 ` Woodruff, Richard
2008-09-05 16:43 ` Tony Lindgren
2008-09-02 18:46 ` Steve Sakoman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox