ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
Subsystems (3)
PATCH RESEND 1/2 ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
board_onenand_init() and board_nand_init() initialization functions are used to initialize OneNAND and NAND memories respectively. But only board_nand_init() was visible to be used from board code. This patch makes possible to initialize a OneNAND flash memory within platform code.
--- arch/arm/mach-omap2/board-flash.c | 4 ++-- arch/arm/mach-omap2/board-flash.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/board-flash.c +2 -2
@@ -87,7 +87,7 @@ static struct omap_onenand_platform_data board_onenand_data = { .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ }; -static void +void __init board_onenand_init (struct mtd_partition *onenand_parts,u8 nr_parts,u8 cs) {
@@ -98,7 +98,7 @@ __init board_onenand_init(struct mtd_partition *onenand_parts, gpmc_onenand_init(&board_onenand_data); }#else -static void +void __init board_onenand_init (struct mtd_partition *nor_parts,u8 nr_parts,u8 cs) { }
arch/arm/mach-omap2/board-flash.h +11 -0
@@ -47,3 +47,14 @@ static inline void board_nand_init(struct mtd_partition *nand_parts, { }#endif + +#if defined(CONFIG_MTD_ONENAND_OMAP2 ) || \ + defined(CONFIG_MTD_ONENAND_OMAP2_MODULE ) +extern void board_onenand_init (struct mtd_partition *nand_parts, +u8 nr_parts,u8 cs); +#else +static inline void board_onenand_init (struct mtd_partition *nand_parts, +u8 nr_parts,u8 cs) +{ +} +#endif
Signature · 1 line
1.7.7.6
PATCH RESEND 2/2 OMAP3: igep0020: Add support for Micron NAND Flash storage memory
IGEP-based boards can have two different flash memories, a OneNAND or a NAND device. The boot configuration pins (sys_boot) are used to specify which memory is available.
Also, this patch removes unnecesary code for registering the OneNAND.
--- arch/arm/mach-omap2/board-igep0020.c | 75 ++++++++++++++-------------------- 1 files changed, 31 insertions(+), 44 deletions(-)
arch/arm/mach-omap2/board-igep0020.c +31 -44
@@ -24,6 +24,8 @@#include <linux/i2c/twl.h> #include <linux/mmc/host.h> +#include <linux/mtd/nand.h> +#include <asm/mach-types.h> #include <asm/mach/arch.h>
@@ -39,6 +41,8 @@#include "hsmmc.h" #include "sdram-numonyx-m65kxxxxam.h" #include "common-board-devices.h" +#include "board-flash.h" +#include "control.h" #define IGEP2_SMSC911X_CS 5#define IGEP2_SMSC911X_GPIO 176
@@ -60,6 +64,10 @@#define IGEP3_GPIO_LED1_RED 16#define IGEP3_GPIO_USBH_NRESET 183 +#define IGEP_SYSBOOT_MASK 0x1f +#define IGEP_SYSBOOT_NAND 0x0f +#define IGEP_SYSBOOT_ONENAND 0x10 +/* * IGEP2 Hardware Revision Table *
@@ -110,8 +118,10 @@ static void __init igep2_get_revision(void)gpio_free (IGEP2_GPIO_LED1_RED ); } -#if defined(CONFIG_MTD_ONENAND_OMAP2 ) || \ - defined(CONFIG_MTD_ONENAND_OMAP2_MODULE ) +#if defined(CONFIG_MTD_ONENAND_OMAP2 ) || \ + defined(CONFIG_MTD_ONENAND_OMAP2_MODULE ) || \ + defined(CONFIG_MTD_NAND_OMAP2 ) || \ + defined(CONFIG_MTD_NAND_OMAP2_MODULE )#define ONENAND_MAP 0x20000000
@@ -123,7 +133,7 @@ static void __init igep2_get_revision(void)* So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048) */ -static struct mtd_partition igep_onenand_partitions[] = { +static struct mtd_partition igep_flash_partitions[] = { { .name ="X-Loader" , .offset =0 ,
@@ -151,50 +161,27 @@ static struct mtd_partition igep_onenand_partitions[] = { }, }; -static struct omap_onenand_platform_data igep_onenand_data = { - .parts = igep_onenand_partitions, - .nr_parts =ARRAY_SIZE (igep_onenand_partitions), - .dma_channel =-1 ,/* disable DMA in OMAP OneNAND driver */ -}; - -static struct platform_device igep_onenand_device = { - .name ="omap2-onenand" , - .id =-1 , - .dev = { - .platform_data = &igep_onenand_data, - }, -}; +static inline u32 igep_get_sysboot_value (void ) +{ +return omap_ctrl_readl (OMAP343X_CONTROL_STATUS ) &IGEP_SYSBOOT_MASK ; +}static void __init igep_flash_init (void ) { -u8 cs =0 ; -u8 onenandcs =GPMC_CS_NUM +1 ; - -for (cs =0 ; cs <GPMC_CS_NUM ; cs++) { -u32 ret; - ret =gpmc_cs_read_reg (cs,GPMC_CS_CONFIG1 ); - -/* Check if NAND/oneNAND is configured */ -if ((ret &0xC00 ) ==0x800 ) -/* NAND found */ -pr_err ("IGEP: Unsupported NAND found\n" ); -else { - ret =gpmc_cs_read_reg (cs,GPMC_CS_CONFIG7 ); -if ((ret &0x3F ) == (ONENAND_MAP >>24 )) -/* ONENAND found */ - onenandcs = cs; - } - } - -if (onenandcs >GPMC_CS_NUM ) { -pr_err ("IGEP: Unable to find configuration in GPMC\n" ); -return ; - } - - igep_onenand_data.cs = onenandcs; - -if (platform_device_register (&igep_onenand_device) <0 ) -pr_err ("IGEP: Unable to register OneNAND device\n" ); +u32 mux; + mux =igep_get_sysboot_value (); + +if (mux ==IGEP_SYSBOOT_NAND ) { +pr_info ("IGEP: initializing NAND memory device\n" ); +board_nand_init (igep_flash_partitions, +ARRAY_SIZE (igep_flash_partitions), +0 ,NAND_BUSWIDTH_16 ); + }else if (mux ==IGEP_SYSBOOT_ONENAND ) { +pr_info ("IGEP: initializing OneNAND memory device\n" ); +board_onenand_init (igep_flash_partitions, +ARRAY_SIZE (igep_flash_partitions),0 ); + }else +pr_err ("IGEP: Flash: unsupported sysboot sequence found\n" ); }#else
Signature · 1 line
1.7.7.6
PATCH RESEND 2/2 OMAP3: igep0020: Add support for Micron NAND Flash storage memory
2012/4/4 Javier Martinez Canillas <[email protected]>:
Quoted 134 lines
IGEP-based boards can have two different flash memories, a OneNAND or a NAND device. The boot configuration pins (
sys_boot) are used to specify which memory is available.Also, this patch removes unnecesary code for registering the OneNAND.
Signed-off-by Javier Martinez Canillas <[email protected]>---
?arch/arm/mach-omap2/board-igep0020.c | ? 75 ++++++++++++++-------------------- ?1 files changed, 31 insertions(+), 44 deletions(-)arch/arm/mach-omap2/board-igep0020.c +0
-0@@ -24,6 +24,8 @@?#include <
linux/i2c/twl.h>
?#include <linux/mmc/host.h>arch/arm/mach-omap2/board-igep0020.c +2
-0+#include <linux/mtd/nand.h> +?#include <
asm/mach-types.h>
?#include <asm/mach/arch.h>arch/arm/mach-omap2/board-igep0020.c +0
-0@@ -39,6 +41,8 @@?#include "
hsmmc.h"
?#include "sdram-numonyx-m65kxxxxam.h"
?#include "common-board-devices.h"arch/arm/mach-omap2/board-igep0020.c +2
-0+#include "board-flash.h" +#include "control.h" ?#define
IGEP2_SMSC911X_CS? ? ? 5
?#defineIGEP2_SMSC911X_GPIO? ? 176arch/arm/mach-omap2/board-igep0020.c +0
-0@@ -60,6 +64,10 @@?#define
IGEP3_GPIO_LED1_RED? ?16
?#defineIGEP3_GPIO_USBH_NRESET?183arch/arm/mach-omap2/board-igep0020.c +4
-0+#define IGEP_SYSBOOT_MASK ? ? ? ? ? 0x1f +#define IGEP_SYSBOOT_NAND ? ? ? ? ? 0x0f +#define IGEP_SYSBOOT_ONENAND ? ? ? ?0x10 +?/*
?* IGEP2 Hardware Revision Table
?*arch/arm/mach-omap2/board-igep0020.c +4
-2@@ -110,8 +118,10 @@ static void __init igep2_get_revision(void) ? ? ? ?gpio_free(IGEP2_GPIO_LED1_RED); ?} -#if defined(CONFIG_MTD_ONENAND_OMAP2 ) || \ - ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) +#if defined(CONFIG_MTD_ONENAND_OMAP2) || ? ? ? ? ? ? ? \ + ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) || ? ? \ + ? ? ? defined(CONFIG_MTD_NAND_OMAP2) || ? ? ? ? ? ? ? \ + ? ? ? defined(CONFIG_MTD_NAND_OMAP2_MODULE)?#define
ONENAND_MAP? ? ? ? ? ?0x20000000arch/arm/mach-omap2/board-igep0020.c +0
-0@@ -123,7 +133,7 @@ static void __init igep2_get_revision(void) ?* So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)?*/
arch/arm/mach-omap2/board-igep0020.c +1
-1-static struct mtd_partition igep_onenand_partitions[] = { +static struct mtd_partition igep_flash_partitions[] = {? ? ? ?{
? ? ? ? ? ? ? ?.name ? ? ? ? ? = "X-Loader",
? ? ? ? ? ? ? ?.offset ? ? ? ? = 0,arch/arm/mach-omap2/board-igep0020.c +18
-41@@ -151,50 +161,27 @@ static struct mtd_partition igep_onenand_partitions[] = { ? ? ? ?}, ?}; -static struct omap_onenand_platform_data igep_onenand_data = { - ? ? ? .parts = igep_onenand_partitions, - ? ? ? .nr_parts = ARRAY_SIZE(igep_onenand_partitions), - ? ? ? .dma_channel ? ?= -1, ? /* disable DMA in OMAP OneNAND driver */ -}; - -static struct platform_device igep_onenand_device = { - ? ? ? .name ? ? ? ? ? = "omap2-onenand", - ? ? ? .id ? ? ? ? ? ? = -1, - ? ? ? .dev = { - ? ? ? ? ? ? ? .platform_data = &igep_onenand_data, - ? ? ? }, -}; +static inline u32 igep_get_sysboot_value (void ) +{ + ? ? ? return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK; +} ?static void __init igep_flash_init(void) ?{ - ? ? ? u8 cs = 0; - ? ? ? u8 onenandcs = GPMC_CS_NUM + 1; - - ? ? ? for (cs = 0; cs < GPMC_CS_NUM; cs++) { - ? ? ? ? ? ? ? u32 ret; - ? ? ? ? ? ? ? ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); - - ? ? ? ? ? ? ? /* Check if NAND/oneNAND is configured */ - ? ? ? ? ? ? ? if ((ret & 0xC00) == 0x800) - ? ? ? ? ? ? ? ? ? ? ? /* NAND found */ - ? ? ? ? ? ? ? ? ? ? ? pr_err("IGEP: Unsupported NAND found\n"); - ? ? ? ? ? ? ? else { - ? ? ? ? ? ? ? ? ? ? ? ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); - ? ? ? ? ? ? ? ? ? ? ? if ((ret & 0x3F) == (ONENAND_MAP >> 24)) - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* ONENAND found */ - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? onenandcs = cs; - ? ? ? ? ? ? ? } - ? ? ? } - - ? ? ? if (onenandcs > GPMC_CS_NUM) { - ? ? ? ? ? ? ? pr_err("IGEP: Unable to find configuration in GPMC\n"); - ? ? ? ? ? ? ? return; - ? ? ? } - - ? ? ? igep_onenand_data.cs = onenandcs; - - ? ? ? if (platform_device_register(&igep_onenand_device) < 0) - ? ? ? ? ? ? ? pr_err("IGEP: Unable to register OneNAND device\n"); + ? ? ? u32 mux; + ? ? ? mux = igep_get_sysboot_value(); + + ? ? ? if (mux == IGEP_SYSBOOT_NAND) { + ? ? ? ? ? ? ? pr_info("IGEP: initializing NAND memory device\n"); + ? ? ? ? ? ? ? board_nand_init(igep_flash_partitions, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ARRAY_SIZE(igep_flash_partitions), + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0, NAND_BUSWIDTH_16); + ? ? ? } else if (mux == IGEP_SYSBOOT_ONENAND) { + ? ? ? ? ? ? ? pr_info("IGEP: initializing OneNAND memory device\n"); + ? ? ? ? ? ? ? board_onenand_init(igep_flash_partitions, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(igep_flash_partitions), 0); + ? ? ? } else + ? ? ? ? ? ? ? pr_err("IGEP: Flash: unsupported sysboot sequence found\n"); ?}
Quoted 4 lines
?#else
--
1.7.7.6
Seems good to me.
Tony, as this is a fix ,may be included ?
Cheers,
Enric
PATCH RESEND 2/2 OMAP3: igep0020: Add support for Micron NAND Flash storage memory
Quoted 142 lines · Enric Balletb? i Serra
2012/4/4 Javier Martinez Canillas <[email protected]>:
Quoted 134 lines
IGEP-based boards can have two different flash memories, a OneNAND or a NAND device. The boot configuration pins (
sys_boot) are used to specify which memory is available.Also, this patch removes unnecesary code for registering the OneNAND.
Signed-off-by Javier Martinez Canillas <[email protected]>---
?arch/arm/mach-omap2/board-igep0020.c | ? 75 ++++++++++++++-------------------- ?1 files changed, 31 insertions(+), 44 deletions(-)arch/arm/mach-omap2/board-igep0020.c +0
-0@@ -24,6 +24,8 @@?#include <
linux/i2c/twl.h>
?#include <linux/mmc/host.h>arch/arm/mach-omap2/board-igep0020.c +2
-0+#include <linux/mtd/nand.h> +?#include <
asm/mach-types.h>
?#include <asm/mach/arch.h>arch/arm/mach-omap2/board-igep0020.c +0
-0@@ -39,6 +41,8 @@?#include "
hsmmc.h"
?#include "sdram-numonyx-m65kxxxxam.h"
?#include "common-board-devices.h"arch/arm/mach-omap2/board-igep0020.c +2
-0+#include "board-flash.h" +#include "control.h" ?#define
IGEP2_SMSC911X_CS? ? ? 5
?#defineIGEP2_SMSC911X_GPIO? ? 176arch/arm/mach-omap2/board-igep0020.c +0
-0@@ -60,6 +64,10 @@?#define
IGEP3_GPIO_LED1_RED? ?16
?#defineIGEP3_GPIO_USBH_NRESET?183arch/arm/mach-omap2/board-igep0020.c +4
-0+#define IGEP_SYSBOOT_MASK ? ? ? ? ? 0x1f +#define IGEP_SYSBOOT_NAND ? ? ? ? ? 0x0f +#define IGEP_SYSBOOT_ONENAND ? ? ? ?0x10 +?/*
?* IGEP2 Hardware Revision Table
?*arch/arm/mach-omap2/board-igep0020.c +4
-2@@ -110,8 +118,10 @@ static void __init igep2_get_revision(void) ? ? ? ?gpio_free(IGEP2_GPIO_LED1_RED); ?} -#if defined(CONFIG_MTD_ONENAND_OMAP2 ) || \ - ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) +#if defined(CONFIG_MTD_ONENAND_OMAP2) || ? ? ? ? ? ? ? \ + ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) || ? ? \ + ? ? ? defined(CONFIG_MTD_NAND_OMAP2) || ? ? ? ? ? ? ? \ + ? ? ? defined(CONFIG_MTD_NAND_OMAP2_MODULE)?#define
ONENAND_MAP? ? ? ? ? ?0x20000000arch/arm/mach-omap2/board-igep0020.c +0
-0@@ -123,7 +133,7 @@ static void __init igep2_get_revision(void) ?* So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)?*/
arch/arm/mach-omap2/board-igep0020.c +1
-1-static struct mtd_partition igep_onenand_partitions[] = { +static struct mtd_partition igep_flash_partitions[] = {? ? ? ?{
? ? ? ? ? ? ? ?.name ? ? ? ? ? = "X-Loader",
? ? ? ? ? ? ? ?.offset ? ? ? ? = 0,arch/arm/mach-omap2/board-igep0020.c +18
-41@@ -151,50 +161,27 @@ static struct mtd_partition igep_onenand_partitions[] = { ? ? ? ?}, ?}; -static struct omap_onenand_platform_data igep_onenand_data = { - ? ? ? .parts = igep_onenand_partitions, - ? ? ? .nr_parts = ARRAY_SIZE(igep_onenand_partitions), - ? ? ? .dma_channel ? ?= -1, ? /* disable DMA in OMAP OneNAND driver */ -}; - -static struct platform_device igep_onenand_device = { - ? ? ? .name ? ? ? ? ? = "omap2-onenand", - ? ? ? .id ? ? ? ? ? ? = -1, - ? ? ? .dev = { - ? ? ? ? ? ? ? .platform_data = &igep_onenand_data, - ? ? ? }, -}; +static inline u32 igep_get_sysboot_value (void ) +{ + ? ? ? return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK; +} ?static void __init igep_flash_init(void) ?{ - ? ? ? u8 cs = 0; - ? ? ? u8 onenandcs = GPMC_CS_NUM + 1; - - ? ? ? for (cs = 0; cs < GPMC_CS_NUM; cs++) { - ? ? ? ? ? ? ? u32 ret; - ? ? ? ? ? ? ? ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); - - ? ? ? ? ? ? ? /* Check if NAND/oneNAND is configured */ - ? ? ? ? ? ? ? if ((ret & 0xC00) == 0x800) - ? ? ? ? ? ? ? ? ? ? ? /* NAND found */ - ? ? ? ? ? ? ? ? ? ? ? pr_err("IGEP: Unsupported NAND found\n"); - ? ? ? ? ? ? ? else { - ? ? ? ? ? ? ? ? ? ? ? ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); - ? ? ? ? ? ? ? ? ? ? ? if ((ret & 0x3F) == (ONENAND_MAP >> 24)) - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /* ONENAND found */ - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? onenandcs = cs; - ? ? ? ? ? ? ? } - ? ? ? } - - ? ? ? if (onenandcs > GPMC_CS_NUM) { - ? ? ? ? ? ? ? pr_err("IGEP: Unable to find configuration in GPMC\n"); - ? ? ? ? ? ? ? return; - ? ? ? } - - ? ? ? igep_onenand_data.cs = onenandcs; - - ? ? ? if (platform_device_register(&igep_onenand_device) < 0) - ? ? ? ? ? ? ? pr_err("IGEP: Unable to register OneNAND device\n"); + ? ? ? u32 mux; + ? ? ? mux = igep_get_sysboot_value(); + + ? ? ? if (mux == IGEP_SYSBOOT_NAND) { + ? ? ? ? ? ? ? pr_info("IGEP: initializing NAND memory device\n"); + ? ? ? ? ? ? ? board_nand_init(igep_flash_partitions, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ARRAY_SIZE(igep_flash_partitions), + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0, NAND_BUSWIDTH_16); + ? ? ? } else if (mux == IGEP_SYSBOOT_ONENAND) { + ? ? ? ? ? ? ? pr_info("IGEP: initializing OneNAND memory device\n"); + ? ? ? ? ? ? ? board_onenand_init(igep_flash_partitions, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(igep_flash_partitions), 0); + ? ? ? } else + ? ? ? ? ? ? ? pr_err("IGEP: Flash: unsupported sysboot sequence found\n"); ?}Quoted 4 lines
?#else
--
1.7.7.6Seems good to me.
Quoted 8 lines
Tony, as this is a fix ,may be included ?
Cheers,
? ?Enric
--
Tony,
Can you please merge this patch and:
[RESEND PATCH 1/2] ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
I've sent this two patches several times and no one is against them. I also had positive feedback such as Enric's acked-by
These two patches are a fix and needed to boot newer versions of the IGEPv2 board. Without the patches the board doesn't even boot.
Please tell me if you need me to resend the patches.
Best regards,
Signature · 3 lines
Javier Mart?nez Canillas (+34) 682 39 81 69 Barcelona, Spain
PATCH RESEND 1/2 ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
In reply to Javier Martinez Canillas2012/4/4 Javier Martinez Canillas <[email protected]>:
Quoted 53 lines
board_onenand_init()andboard_nand_init()initialization functions are used to initialize OneNAND and NAND memories respectively. But onlyboard_nand_init()was visible to be used from board code. This patch makes possible to initialize a OneNAND flash memory within platform code.Signed-off-by Javier Martinez Canillas <[email protected]>---
?arch/arm/mach-omap2/board-flash.c | ? ?4 ++-- ?arch/arm/mach-omap2/board-flash.h | ? 11 +++++++++++ ?2 files changed, 13 insertions(+), 2 deletions(-)arch/arm/mach-omap2/board-flash.c +0
-0@@ -87,7 +87,7 @@ static struct omap_onenand_platform_data board_onenand_data = {? ? ? ?.dma_channel ? ?= -1, ? /* disable DMA in OMAP OneNAND driver */ ?};
arch/arm/mach-omap2/board-flash.c +1
-1-static void +void ?__init
board_onenand_init(struct mtd_partition *onenand_parts, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?u8 nr_parts, u8 cs)
?{arch/arm/mach-omap2/board-flash.c +0
-0@@ -98,7 +98,7 @@ __init board_onenand_init(struct mtd_partition *onenand_parts, ? ? ? ?gpmc_onenand_init(&board_onenand_data); ?}?#else
arch/arm/mach-omap2/board-flash.c +1
-1-static void +void ?__init
board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)?{
?}arch/arm/mach-omap2/board-flash.h +0
-0@@ -47,3 +47,14 @@ static inline void board_nand_init(struct mtd_partition *nand_parts, ?{ ?}?#endif
arch/arm/mach-omap2/board-flash.h +11
-1+ +#if defined(CONFIG_MTD_ONENAND_OMAP2 ) || \ + ? ? ? ? ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) +extern void board_onenand_init (struct mtd_partition *nand_parts, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u8 nr_parts, u8 cs); +#else +static inline void board_onenand_init (struct mtd_partition *nand_parts, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u8 nr_parts, u8 cs) +{ +} +#endif --
Quoted 2 lines
1.7.7.6
Seems good to me.
Tony, as this is a fix ,may be included ?
Cheers,
Enric
PATCH RESEND 1/2 ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
Quoted 59 lines · Enric Balletb? i Serra
2012/4/4 Javier Martinez Canillas <[email protected]>:
Quoted 53 lines
board_onenand_init()andboard_nand_init()initialization functions are used to initialize OneNAND and NAND memories respectively. But onlyboard_nand_init()was visible to be used from board code. This patch makes possible to initialize a OneNAND flash memory within platform code.Signed-off-by Javier Martinez Canillas <[email protected]>---
?arch/arm/mach-omap2/board-flash.c | ? ?4 ++-- ?arch/arm/mach-omap2/board-flash.h | ? 11 +++++++++++ ?2 files changed, 13 insertions(+), 2 deletions(-)arch/arm/mach-omap2/board-flash.c +0
-0@@ -87,7 +87,7 @@ static struct omap_onenand_platform_data board_onenand_data = {? ? ? ?.dma_channel ? ?= -1, ? /* disable DMA in OMAP OneNAND driver */ ?};
arch/arm/mach-omap2/board-flash.c +1
-1-static void +void ?__init
board_onenand_init(struct mtd_partition *onenand_parts, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?u8 nr_parts, u8 cs)
?{arch/arm/mach-omap2/board-flash.c +0
-0@@ -98,7 +98,7 @@ __init board_onenand_init(struct mtd_partition *onenand_parts, ? ? ? ?gpmc_onenand_init(&board_onenand_data); ?}?#else
arch/arm/mach-omap2/board-flash.c +1
-1-static void +void ?__init
board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)?{
?}arch/arm/mach-omap2/board-flash.h +0
-0@@ -47,3 +47,14 @@ static inline void board_nand_init(struct mtd_partition *nand_parts, ?{ ?}?#endif
arch/arm/mach-omap2/board-flash.h +11
-1+ +#if defined(CONFIG_MTD_ONENAND_OMAP2 ) || \ + ? ? ? ? ? ? ? defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) +extern void board_onenand_init (struct mtd_partition *nand_parts, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u8 nr_parts, u8 cs); +#else +static inline void board_onenand_init (struct mtd_partition *nand_parts, + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u8 nr_parts, u8 cs) +{ +} +#endif --Quoted 2 lines
1.7.7.6
Seems good to me.
Quoted 7 lines
Tony, as this is a fix ,may be included ?
Cheers,
? ?Enric
Hi Tony, Russel:
This patch is a requirement for patch:
[RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
which is really important since newer IGEPv2 boards have changed their flash memory from OneNAND to NAND.
This patch-set is necessary to make the board work, otherwise it doesn't even boot.
Could we please include these patches?
Thanks a lot and best regards,
Javier
Tony Lindgren
maintainerPATCH RESEND 1/2 ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
Quoted 18 lines · Javier Martinez Canillas
Quoted 8 lines · Enric Balletb? i Serra
Tony, as this is a fix ,may be included ?
Cheers,
? ?EnricHi Tony, Russel:
This patch is a requirement for patch:
[RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
Quoted 7 lines
which is really important since newer IGEPv2 boards have changed their flash memory from OneNAND to NAND.
This patch-set is necessary to make the board work, otherwise it doesn't even boot.
Could we please include these patches?
Thanks for the patience, applying now into board branch finally.
Regards,
Tony
PATCH RESEND 1/2 ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
Quoted 25 lines · Tony Lindgren
Quoted 24 lines · Javier Martinez Canillas
Quoted 8 lines · Enric Balletb? i Serra
Tony, as this is a fix ,may be included ?
Cheers,
? ?EnricHi Tony, Russel:
This patch is a requirement for patch:
[RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
which is really important since newer IGEPv2 boards have changed their flash memory from OneNAND to NAND.
This patch-set is necessary to make the board work, otherwise it doesn't even boot.
Quoted 8 lines
Quoted 1 line
Could we please include these patches?
Thanks for the patience, applying now into board branch finally.
Regards,
Tony
--
Hi Tony,
Thanks a lot for applying these patches.
Best regards,
Javier
PATCH RESEND 1/2 ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
In reply to Tony LindgrenQuoted 22 lines · Tony Lindgren
Quoted 21 lines · Javier Martinez Canillas
Quoted 8 lines · Enric Balletb? i Serra
Tony, as this is a fix ,may be included ?
Cheers,
? ?EnricHi Tony, Russel:
This patch is a requirement for patch:
[RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
which is really important since newer IGEPv2 boards have changed their flash memory from OneNAND to NAND.
Quoted 6 lines
Quoted 4 lines
This patch-set is necessary to make the board work, otherwise it doesn't even boot.
Could we please include these patches?
Thanks for the patience, applying now into board branch finally.
This patch breaks the build for platforms that don't use ONENAND. Using omap2plus_defconfig, set CONFIG_MTD_ONENAND_OMAP2=n and you'll get the build error below[1]
By removing the static, there is now duplicate definitions in the .c and .h files.
The solution is to remove the dummy definition from the .c file.
Tony, feel free to fold the diff below[2] into the original patch to fix this compile problem.
Kevin
[1]
/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.c:102:111: error: redefinition of 'board_onenand_init' /work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.h:56:51: note: previous definition of 'board_onenand_init' was here make[2]: *** [arch/arm/mach-omap2/board-flash.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [arch/arm/mach-omap2] Error 2
make: *** [sub-make] Error 2
[2]
arch/arm/mach-omap2/board-flash.c +0 -5
@@ -97,11 +97,6 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,gpmc_onenand_init (&board_onenand_data); } -#else -void -__init board_onenand_init (struct mtd_partition *nor_parts,u8 nr_parts,u8 cs) -{ -}#endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */ #if defined(CONFIG_MTD_NAND_OMAP2) || \
Tony Lindgren
maintainerPATCH RESEND 1/2 ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
Quoted 27 lines · Kevin Hilman
Quoted 25 lines · Tony Lindgren
Quoted 24 lines · Javier Martinez Canillas
Quoted 8 lines · Enric Balletb? i Serra
Tony, as this is a fix ,may be included ?
Cheers,
? ?EnricHi Tony, Russel:
This patch is a requirement for patch:
[RESEND PATCH 2/2] OMAP3: igep0020: Add support for Micron NAND Flash storage memory
which is really important since newer IGEPv2 boards have changed their flash memory from OneNAND to NAND.
This patch-set is necessary to make the board work, otherwise it doesn't even boot.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Could we please include these patches?
Thanks for the patience, applying now into board branch finally.
This patch breaks the build for platforms that don't use ONENAND. Using
omap2plus_defconfig, setCONFIG_MTD_ONENAND_OMAP2=nand you'll get the build error below[1]
Thanks for catching that.
Quoted 7 lines
By removing the static, there is now duplicate definitions in the .c and .h files.
The solution is to remove the dummy definition from the .c file.
Tony, feel free to fold the diff below[2] into the original patch to fix this compile problem.
That's already merged as 8259573b (ARM: OMAP2+: nand: Make board_onenand_init() visible to board code) so we need to apply it as a fix.
Can you do a fix with your Signed-off-by or at least reply with that so I can apply it?
Thanks,
Tony
Quoted 25 lines
[1]
/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.c:102:111: error: redefinition of 'board_onenand_init' /work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.h:56:51: note: previous definition of 'board_onenand_init' was here make[2]: *** [arch/arm/mach-omap2/board-flash.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [arch/arm/mach-omap2] Error 2
make: *** [sub-make] Error 2[2]
arch/arm/mach-omap2/board-flash.c +0
-5@@ -97,11 +97,6 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,gpmc_onenand_init (&board_onenand_data); } -#else -void -__init board_onenand_init (struct mtd_partition *nor_parts,u8 nr_parts,u8 cs) -{ -}#endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */ #if defined(CONFIG_MTD_NAND_OMAP2) || \
PATCH RESEND 1/2 ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
Tony Lindgren <[email protected]> writes:
[...]
Quoted 5 lines
That's already merged as
8259573b(ARM: OMAP2+: nand: Makeboard_onenand_init()visible to board code) so we need to apply it as a fix.Can you do a fix with your Signed-off-by or at least reply with that so I can apply it?
Here you go. Applies to your 'board' branch.
Kevin
Quoted 1 line
From
f4f2c35de0e67e3b8185059ffd78be67f7096d8aMon Sep 17 00:00:00 2001
From: Kevin Hilman <[email protected]>
Date: Tue, 15 May 2012 13:07:20 -0700
Subject: [PATCH] ARM: OMAP2+: nand: fix build error when
CONFIG_MTD_ONENAND_OMAP2=n
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
commit 8259573b (ARM: OMAP2+: nand: Make board_onenand_init() visible to board code) broke the build for configs with OneNAND disabled. By removing the static in the header file, it created a duplicate definition in the .c and the .h files, resuling in a build error:
/work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.c:102:111: error: redefinition of 'board_onenand_init' /work/kernel/omap/dev/arch/arm/mach-omap2/board-flash.h:56:51: note: previous definition of 'board_onenand_init' was here make[2]: *** [arch/arm/mach-omap2/board-flash.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [arch/arm/mach-omap2] Error 2
make: *** [sub-make] Error 2
Fix this by removing the duplicate dummy entry from the C file.
--- arch/arm/mach-omap2/board-flash.c | 5 ----- 1 file changed, 5 deletions(-)
arch/arm/mach-omap2/board-flash.c +0 -5
@@ -97,11 +97,6 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,gpmc_onenand_init (&board_onenand_data); } -#else -void -__init board_onenand_init (struct mtd_partition *nor_parts,u8 nr_parts,u8 cs) -{ -}#endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */ #if defined(CONFIG_MTD_NAND_OMAP2) || \
Signature · 1 line
1.7.9.2
Tony Lindgren
maintainerPATCH RESEND 1/2 ARM: OMAP2+: nand: Make board_onenand_init() visible to board code
Quoted 11 lines · Kevin Hilman
Tony Lindgren <[email protected]> writes:
[...]
Quoted 5 lines
That's already merged as
8259573b(ARM: OMAP2+: nand: Makeboard_onenand_init()visible to board code) so we need to apply it as a fix.Can you do a fix with your Signed-off-by or at least reply with that so I can apply it?
Here you go. Applies to your 'board' branch.
Thanks applying into fixes-board branch.
Tony