@@ -125,7 +125,8 @@ static struct mtd_partition aspenite_nand_partitions[] = {
};
static struct pxa3xx_nand_platform_data aspenite_nand_info = {
- .enable_arbiter = 1,
+ .controller_attrs = PXA3XX_ARBI_EN | PXA3XX_NAKED_CMD_EN | PXA3XX_DMA_EN
+ | PXA3XX_ADV_TIME_TUNING | PXA3XX_TWO_CHIP_EN,
.parts[0] = aspenite_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(aspenite_nand_partitions),
};
b/arch/arm/mach-mmp/avengers_lite.c
@@ -77,7 +77,8 @@ static void __init avengers_init_flash(void)
avengers_nand_info.nr_parts[0] = ARRAY_SIZE(avengers_nand_partitions_0);
avengers_nand_info.parts[1] = avengers_nand_partitions_1;
avengers_nand_info.nr_parts[1] = ARRAY_SIZE(avengers_nand_partitions_1);
- avengers_nand_info.enable_arbiter = 1;
+ avengers_nand_info.controller_attrs = PXA3XX_ARBI_EN | PXA3XX_NAKED_CMD_EN
+ | PXA3XX_DMA_EN | PXA3XX_ADV_TIME_TUNING | PXA3XX_TWO_CHIP_EN;
pxa168_add_nand(&avengers_nand_info);
}
@@ -417,8 +417,7 @@ static struct mtd_partition cm_x300_nand_partitions[] = {
};
static struct pxa3xx_nand_platform_data cm_x300_nand_info = {
- .enable_arbiter = 1,
- .keep_config = 1,
+ .controller_attrs = PXA3XX_ARBI_EN | PXA3XX_DMA_EN | PXA3XX_KEEP_CONFIG,
.parts[0] = cm_x300_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(cm_x300_nand_partitions),
};
b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -186,8 +186,7 @@ static struct mtd_partition colibri_nand_partitions[] = {
};
static struct pxa3xx_nand_platform_data colibri_nand_info = {
- .enable_arbiter = 1,
- .keep_config = 1,
+ .controller_attrs = PXA3XX_ARBI_EN | PXA3XX_DMA_EN | PXA3XX_KEEP_CONFIG,
.parts[0] = colibri_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(colibri_nand_partitions),
};
@@ -324,7 +324,7 @@ static struct mtd_partition littleton_nand_partitions[] = {
};
static struct pxa3xx_nand_platform_data littleton_nand_info = {
- .enable_arbiter = 1,
+ .controller_attrs = PXA3XX_ARBI_EN | PXA3XX_DMA_EN,
.parts[0] = littleton_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(littleton_nand_partitions),
};
@@ -389,8 +389,7 @@ static struct mtd_partition mxm_8x10_nand_partitions[] = {
};
static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
- .enable_arbiter = 1,
- .keep_config = 1,
+ .controller_attrs = PXA3XX_ARBI_EN | PXA3XX_DMA_EN | PXA3XX_KEEP_CONFIG,
.parts[0] = mxm_8x10_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(mxm_8x10_nand_partitions)
};
@@ -348,8 +348,7 @@ static struct mtd_partition raumfeld_nand_partitions[] = {
};
static struct pxa3xx_nand_platform_data raumfeld_nand_info = {
- .enable_arbiter = 1,
- .keep_config = 1,
+ .controller_attrs = PXA3XX_ARBI_EN | PXA3XX_DMA_EN | PXA3XX_KEEP_CONFIG,
.parts[0] = raumfeld_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(raumfeld_nand_partitions),
};
@@ -355,7 +355,7 @@ static struct mtd_partition zylonite_nand_partitions[] = {
};
static struct pxa3xx_nand_platform_data zylonite_nand_info = {
- .enable_arbiter = 1,
+ .controller_attrs = PXA3XX_ARBI_EN | PXA3XX_DMA_EN,
.parts[0] = zylonite_nand_partitions,
.nr_parts[0] = ARRAY_SIZE(zylonite_nand_partitions),
};
b/arch/arm/plat-pxa/include/plat/pxa3xx_nand.h
@@ -5,17 +5,20 @@
#include <linux/mtd/partitions.h>
#define NUM_CHIP_SELECT (2)
+/* the data flash bus is shared between the Static Memory
+ * Controller and the Data Flash Controller, the arbiter
+ * controls the ownership of the bus
+ */
+#define PXA3XX_ARBI_EN (1)
+#define PXA3XX_NAKED_CMD_EN (1 << 1)
+#define PXA3XX_TWO_CHIP_EN (1 << 2)
+#define PXA3XX_DMA_EN (1 << 3)
+/* for newer controller support more precise timing tuning, only
+ * enable such tuning for those platform which support it */
+#define PXA3XX_ADV_TIME_TUNING (1 << 4)
+#define PXA3XX_KEEP_CONFIG (1 << 5)
struct pxa3xx_nand_platform_data {
-
- /* the data flash bus is shared between the Static Memory
- * Controller and the Data Flash Controller, the arbiter
- * controls the ownership of the bus
- */
- int enable_arbiter;
-
- /* allow platform code to keep OBM/bootloader defined NFC config */
- int keep_config;
-
+ unsigned int controller_attrs;
const struct mtd_partition *parts[NUM_CHIP_SELECT];
unsigned int nr_parts[NUM_CHIP_SELECT];
@@ -849,7 +849,7 @@ static int pxa3xx_nand_config_flash(struct
pxa3xx_nand_info *info,
else
info->row_addr_cycles = 2;
- ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0;
+ ndcr |= (pdata->controller_attrs & PXA3XX_ARBI_EN) ? NDCR_ND_ARB_EN : 0;
ndcr |= (info->col_addr_cycles == 2) ? NDCR_RA_START : 0;
ndcr |= (f->page_per_block == 64) ? NDCR_PG_PER_BLK : 0;