Skip to content

Commit f3c8cfc

Browse files
Lei Wendedekind
authored andcommitted
mtd: pxa3xx_nand: enable multiple chip select support
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>
1 parent d456882 commit f3c8cfc

9 files changed

Lines changed: 164 additions & 68 deletions

File tree

‎arch/arm/mach-mmp/aspenite.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ static struct mtd_partition aspenite_nand_partitions[] = {
167167

168168
static struct pxa3xx_nand_platform_data aspenite_nand_info = {
169169
.enable_arbiter = 1,
170-
.parts = aspenite_nand_partitions,
171-
.nr_parts = ARRAY_SIZE(aspenite_nand_partitions),
170+
.num_cs = 1,
171+
.parts[0] = aspenite_nand_partitions,
172+
.nr_parts[0] = ARRAY_SIZE(aspenite_nand_partitions),
172173
};
173174

174175
static struct i2c_board_info aspenite_i2c_info[] __initdata = {

‎arch/arm/mach-pxa/cm-x300.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,9 @@ static struct mtd_partition cm_x300_nand_partitions[] = {
424424
static struct pxa3xx_nand_platform_data cm_x300_nand_info = {
425425
.enable_arbiter = 1,
426426
.keep_config = 1,
427-
.parts = cm_x300_nand_partitions,
428-
.nr_parts = ARRAY_SIZE(cm_x300_nand_partitions),
427+
.num_cs = 1,
428+
.parts[0] = cm_x300_nand_partitions,
429+
.nr_parts[0] = ARRAY_SIZE(cm_x300_nand_partitions),
429430
};
430431

431432
static void __init cm_x300_init_nand(void)

‎arch/arm/mach-pxa/colibri-pxa3xx.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ static struct mtd_partition colibri_nand_partitions[] = {
139139
static struct pxa3xx_nand_platform_data colibri_nand_info = {
140140
.enable_arbiter = 1,
141141
.keep_config = 1,
142-
.parts = colibri_nand_partitions,
143-
.nr_parts = ARRAY_SIZE(colibri_nand_partitions),
142+
.num_cs = 1,
143+
.parts[0] = colibri_nand_partitions,
144+
.nr_parts[0] = ARRAY_SIZE(colibri_nand_partitions),
144145
};
145146

146147
void __init colibri_pxa3xx_init_nand(void)

‎arch/arm/mach-pxa/littleton.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,9 @@ static struct mtd_partition littleton_nand_partitions[] = {
325325

326326
static struct pxa3xx_nand_platform_data littleton_nand_info = {
327327
.enable_arbiter = 1,
328-
.parts = littleton_nand_partitions,
329-
.nr_parts = ARRAY_SIZE(littleton_nand_partitions),
328+
.num_cs = 1,
329+
.parts[0] = littleton_nand_partitions,
330+
.nr_parts[0] = ARRAY_SIZE(littleton_nand_partitions),
330331
};
331332

332333
static void __init littleton_init_nand(void)

‎arch/arm/mach-pxa/mxm8x10.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,11 @@ static struct mtd_partition mxm_8x10_nand_partitions[] = {
389389
};
390390

391391
static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
392-
.enable_arbiter = 1,
393-
.keep_config = 1,
394-
.parts = mxm_8x10_nand_partitions,
395-
.nr_parts = ARRAY_SIZE(mxm_8x10_nand_partitions)
392+
.enable_arbiter = 1,
393+
.keep_config = 1,
394+
.num_cs = 1,
395+
.parts[0] = mxm_8x10_nand_partitions,
396+
.nr_parts[0] = ARRAY_SIZE(mxm_8x10_nand_partitions)
396397
};
397398

398399
static void __init mxm_8x10_nand_init(void)

‎arch/arm/mach-pxa/raumfeld.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,9 @@ static struct mtd_partition raumfeld_nand_partitions[] = {
346346
static struct pxa3xx_nand_platform_data raumfeld_nand_info = {
347347
.enable_arbiter = 1,
348348
.keep_config = 1,
349-
.parts = raumfeld_nand_partitions,
350-
.nr_parts = ARRAY_SIZE(raumfeld_nand_partitions),
349+
.num_cs = 1,
350+
.parts[0] = raumfeld_nand_partitions,
351+
.nr_parts[0] = ARRAY_SIZE(raumfeld_nand_partitions),
351352
};
352353

353354
/**

‎arch/arm/mach-pxa/zylonite.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,9 @@ static struct mtd_partition zylonite_nand_partitions[] = {
366366

367367
static struct pxa3xx_nand_platform_data zylonite_nand_info = {
368368
.enable_arbiter = 1,
369-
.parts = zylonite_nand_partitions,
370-
.nr_parts = ARRAY_SIZE(zylonite_nand_partitions),
369+
.num_cs = 1,
370+
.parts[0] = zylonite_nand_partitions,
371+
.nr_parts[0] = ARRAY_SIZE(zylonite_nand_partitions),
371372
};
372373

373374
static void __init zylonite_init_nand(void)

‎arch/arm/plat-pxa/include/plat/pxa3xx_nand.h‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ struct pxa3xx_nand_flash {
4141
struct pxa3xx_nand_timing *timing; /* NAND Flash timing */
4242
};
4343

44+
/*
45+
* Current pxa3xx_nand controller has two chip select which
46+
* both be workable.
47+
*
48+
* Notice should be taken that:
49+
* When you want to use this feature, you should not enable the
50+
* keep configuration feature, for two chip select could be
51+
* attached with different nand chip. The different page size
52+
* and timing requirement make the keep configuration impossible.
53+
*/
54+
55+
/* The max num of chip select current support */
56+
#define NUM_CHIP_SELECT (2)
4457
struct pxa3xx_nand_platform_data {
4558

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

55-
const struct mtd_partition *parts;
56-
unsigned int nr_parts;
68+
/* indicate how many chip selects will be used */
69+
int num_cs;
70+
71+
const struct mtd_partition *parts[NUM_CHIP_SELECT];
72+
unsigned int nr_parts[NUM_CHIP_SELECT];
5773

5874
const struct pxa3xx_nand_flash * flash;
5975
size_t num_flash;

0 commit comments

Comments
 (0)