Commit f3c8cfc2 authored by Lei Wen's avatar Lei Wen Committed by Artem Bityutskiy

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: default avatarLei Wen <leiwen@marvell.com>
parent d456882b
...@@ -167,8 +167,9 @@ static struct mtd_partition aspenite_nand_partitions[] = { ...@@ -167,8 +167,9 @@ static struct mtd_partition aspenite_nand_partitions[] = {
static struct pxa3xx_nand_platform_data aspenite_nand_info = { static struct pxa3xx_nand_platform_data aspenite_nand_info = {
.enable_arbiter = 1, .enable_arbiter = 1,
.parts = aspenite_nand_partitions, .num_cs = 1,
.nr_parts = ARRAY_SIZE(aspenite_nand_partitions), .parts[0] = aspenite_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(aspenite_nand_partitions),
}; };
static struct i2c_board_info aspenite_i2c_info[] __initdata = { static struct i2c_board_info aspenite_i2c_info[] __initdata = {
......
...@@ -424,8 +424,9 @@ static struct mtd_partition cm_x300_nand_partitions[] = { ...@@ -424,8 +424,9 @@ static struct mtd_partition cm_x300_nand_partitions[] = {
static struct pxa3xx_nand_platform_data cm_x300_nand_info = { static struct pxa3xx_nand_platform_data cm_x300_nand_info = {
.enable_arbiter = 1, .enable_arbiter = 1,
.keep_config = 1, .keep_config = 1,
.parts = cm_x300_nand_partitions, .num_cs = 1,
.nr_parts = ARRAY_SIZE(cm_x300_nand_partitions), .parts[0] = cm_x300_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(cm_x300_nand_partitions),
}; };
static void __init cm_x300_init_nand(void) static void __init cm_x300_init_nand(void)
......
...@@ -139,8 +139,9 @@ static struct mtd_partition colibri_nand_partitions[] = { ...@@ -139,8 +139,9 @@ static struct mtd_partition colibri_nand_partitions[] = {
static struct pxa3xx_nand_platform_data colibri_nand_info = { static struct pxa3xx_nand_platform_data colibri_nand_info = {
.enable_arbiter = 1, .enable_arbiter = 1,
.keep_config = 1, .keep_config = 1,
.parts = colibri_nand_partitions, .num_cs = 1,
.nr_parts = ARRAY_SIZE(colibri_nand_partitions), .parts[0] = colibri_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(colibri_nand_partitions),
}; };
void __init colibri_pxa3xx_init_nand(void) void __init colibri_pxa3xx_init_nand(void)
......
...@@ -325,8 +325,9 @@ static struct mtd_partition littleton_nand_partitions[] = { ...@@ -325,8 +325,9 @@ static struct mtd_partition littleton_nand_partitions[] = {
static struct pxa3xx_nand_platform_data littleton_nand_info = { static struct pxa3xx_nand_platform_data littleton_nand_info = {
.enable_arbiter = 1, .enable_arbiter = 1,
.parts = littleton_nand_partitions, .num_cs = 1,
.nr_parts = ARRAY_SIZE(littleton_nand_partitions), .parts[0] = littleton_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(littleton_nand_partitions),
}; };
static void __init littleton_init_nand(void) static void __init littleton_init_nand(void)
......
...@@ -389,10 +389,11 @@ static struct mtd_partition mxm_8x10_nand_partitions[] = { ...@@ -389,10 +389,11 @@ static struct mtd_partition mxm_8x10_nand_partitions[] = {
}; };
static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = { static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
.enable_arbiter = 1, .enable_arbiter = 1,
.keep_config = 1, .keep_config = 1,
.parts = mxm_8x10_nand_partitions, .num_cs = 1,
.nr_parts = ARRAY_SIZE(mxm_8x10_nand_partitions) .parts[0] = mxm_8x10_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(mxm_8x10_nand_partitions)
}; };
static void __init mxm_8x10_nand_init(void) static void __init mxm_8x10_nand_init(void)
......
...@@ -346,8 +346,9 @@ static struct mtd_partition raumfeld_nand_partitions[] = { ...@@ -346,8 +346,9 @@ static struct mtd_partition raumfeld_nand_partitions[] = {
static struct pxa3xx_nand_platform_data raumfeld_nand_info = { static struct pxa3xx_nand_platform_data raumfeld_nand_info = {
.enable_arbiter = 1, .enable_arbiter = 1,
.keep_config = 1, .keep_config = 1,
.parts = raumfeld_nand_partitions, .num_cs = 1,
.nr_parts = ARRAY_SIZE(raumfeld_nand_partitions), .parts[0] = raumfeld_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(raumfeld_nand_partitions),
}; };
/** /**
......
...@@ -366,8 +366,9 @@ static struct mtd_partition zylonite_nand_partitions[] = { ...@@ -366,8 +366,9 @@ static struct mtd_partition zylonite_nand_partitions[] = {
static struct pxa3xx_nand_platform_data zylonite_nand_info = { static struct pxa3xx_nand_platform_data zylonite_nand_info = {
.enable_arbiter = 1, .enable_arbiter = 1,
.parts = zylonite_nand_partitions, .num_cs = 1,
.nr_parts = ARRAY_SIZE(zylonite_nand_partitions), .parts[0] = zylonite_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(zylonite_nand_partitions),
}; };
static void __init zylonite_init_nand(void) static void __init zylonite_init_nand(void)
......
...@@ -41,6 +41,19 @@ struct pxa3xx_nand_flash { ...@@ -41,6 +41,19 @@ struct pxa3xx_nand_flash {
struct pxa3xx_nand_timing *timing; /* NAND Flash timing */ 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 { struct pxa3xx_nand_platform_data {
/* the data flash bus is shared between the Static Memory /* the data flash bus is shared between the Static Memory
...@@ -52,8 +65,11 @@ struct pxa3xx_nand_platform_data { ...@@ -52,8 +65,11 @@ struct pxa3xx_nand_platform_data {
/* allow platform code to keep OBM/bootloader defined NFC config */ /* allow platform code to keep OBM/bootloader defined NFC config */
int keep_config; int keep_config;
const struct mtd_partition *parts; /* indicate how many chip selects will be used */
unsigned int nr_parts; int num_cs;
const struct mtd_partition *parts[NUM_CHIP_SELECT];
unsigned int nr_parts[NUM_CHIP_SELECT];
const struct pxa3xx_nand_flash * flash; const struct pxa3xx_nand_flash * flash;
size_t num_flash; size_t num_flash;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment