Skip to content

Commit

Permalink
mtd: pxa3xx_nand: enable multiple chip select support
Browse files Browse the repository at this point in the history
Current pxa3xx_nand controller has two chip select which
both be workable. This patch enable this feature.

Update platform driver to support this feature.

Another notice should be taken that:
When you want to use this feature, you should not enable the
keep configuration feature, for two chip select could be
attached with different nand chip. The different page size
and timing requirement make the keep configuration impossible.

Signed-off-by: Lei Wen <leiwen@marvell.com>
  • Loading branch information
Lei Wen authored and Artem Bityutskiy committed Sep 11, 2011
1 parent d456882 commit f3c8cfc
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 68 deletions.
5 changes: 3 additions & 2 deletions arch/arm/mach-mmp/aspenite.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ static struct mtd_partition aspenite_nand_partitions[] = {

static struct pxa3xx_nand_platform_data aspenite_nand_info = {
.enable_arbiter = 1,
.parts = aspenite_nand_partitions,
.nr_parts = ARRAY_SIZE(aspenite_nand_partitions),
.num_cs = 1,
.parts[0] = aspenite_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(aspenite_nand_partitions),
};

static struct i2c_board_info aspenite_i2c_info[] __initdata = {
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-pxa/cm-x300.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,9 @@ static struct mtd_partition cm_x300_nand_partitions[] = {
static struct pxa3xx_nand_platform_data cm_x300_nand_info = {
.enable_arbiter = 1,
.keep_config = 1,
.parts = cm_x300_nand_partitions,
.nr_parts = ARRAY_SIZE(cm_x300_nand_partitions),
.num_cs = 1,
.parts[0] = cm_x300_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(cm_x300_nand_partitions),
};

static void __init cm_x300_init_nand(void)
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-pxa/colibri-pxa3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ static struct mtd_partition colibri_nand_partitions[] = {
static struct pxa3xx_nand_platform_data colibri_nand_info = {
.enable_arbiter = 1,
.keep_config = 1,
.parts = colibri_nand_partitions,
.nr_parts = ARRAY_SIZE(colibri_nand_partitions),
.num_cs = 1,
.parts[0] = colibri_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(colibri_nand_partitions),
};

void __init colibri_pxa3xx_init_nand(void)
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-pxa/littleton.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,9 @@ static struct mtd_partition littleton_nand_partitions[] = {

static struct pxa3xx_nand_platform_data littleton_nand_info = {
.enable_arbiter = 1,
.parts = littleton_nand_partitions,
.nr_parts = ARRAY_SIZE(littleton_nand_partitions),
.num_cs = 1,
.parts[0] = littleton_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(littleton_nand_partitions),
};

static void __init littleton_init_nand(void)
Expand Down
9 changes: 5 additions & 4 deletions arch/arm/mach-pxa/mxm8x10.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,11 @@ static struct mtd_partition mxm_8x10_nand_partitions[] = {
};

static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
.enable_arbiter = 1,
.keep_config = 1,
.parts = mxm_8x10_nand_partitions,
.nr_parts = ARRAY_SIZE(mxm_8x10_nand_partitions)
.enable_arbiter = 1,
.keep_config = 1,
.num_cs = 1,
.parts[0] = mxm_8x10_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(mxm_8x10_nand_partitions)
};

static void __init mxm_8x10_nand_init(void)
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-pxa/raumfeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,9 @@ static struct mtd_partition raumfeld_nand_partitions[] = {
static struct pxa3xx_nand_platform_data raumfeld_nand_info = {
.enable_arbiter = 1,
.keep_config = 1,
.parts = raumfeld_nand_partitions,
.nr_parts = ARRAY_SIZE(raumfeld_nand_partitions),
.num_cs = 1,
.parts[0] = raumfeld_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(raumfeld_nand_partitions),
};

/**
Expand Down
5 changes: 3 additions & 2 deletions arch/arm/mach-pxa/zylonite.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,9 @@ static struct mtd_partition zylonite_nand_partitions[] = {

static struct pxa3xx_nand_platform_data zylonite_nand_info = {
.enable_arbiter = 1,
.parts = zylonite_nand_partitions,
.nr_parts = ARRAY_SIZE(zylonite_nand_partitions),
.num_cs = 1,
.parts[0] = zylonite_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(zylonite_nand_partitions),
};

static void __init zylonite_init_nand(void)
Expand Down
20 changes: 18 additions & 2 deletions arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ struct pxa3xx_nand_flash {
struct pxa3xx_nand_timing *timing; /* NAND Flash timing */
};

/*
* Current pxa3xx_nand controller has two chip select which
* both be workable.
*
* Notice should be taken that:
* When you want to use this feature, you should not enable the
* keep configuration feature, for two chip select could be
* attached with different nand chip. The different page size
* and timing requirement make the keep configuration impossible.
*/

/* The max num of chip select current support */
#define NUM_CHIP_SELECT (2)
struct pxa3xx_nand_platform_data {

/* the data flash bus is shared between the Static Memory
Expand All @@ -52,8 +65,11 @@ struct pxa3xx_nand_platform_data {
/* allow platform code to keep OBM/bootloader defined NFC config */
int keep_config;

const struct mtd_partition *parts;
unsigned int nr_parts;
/* indicate how many chip selects will be used */
int num_cs;

const struct mtd_partition *parts[NUM_CHIP_SELECT];
unsigned int nr_parts[NUM_CHIP_SELECT];

const struct pxa3xx_nand_flash * flash;
size_t num_flash;
Expand Down
Loading

0 comments on commit f3c8cfc

Please sign in to comment.