Commit 1754aab9 authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov Committed by Artem Bityutskiy
Browse files

mtd: ATMEL, AVR32: inline nand partition table access



Currently atmel_nand driver used by AT91 and AVR32 calls a special callback
which return nand partition table and number of partitions. However in all
boards this callback returns just static data. So drop this callback and
make atmel_nand use partition table provided statically via platform_data.

Nicolas Ferre: I am in favor for a mainline inclusion through linux-mtd tree.
Hans-Christian Egtvedt: I'm fine by sending the changes for AVR32 through linux-mtd

Signed-off-by: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Acked-by: default avatarHans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 9eeff824
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -130,19 +130,14 @@ static struct mtd_partition __initdata afeb9260_nand_partition[] = {
	},
};

static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
{
	*num_partitions = ARRAY_SIZE(afeb9260_nand_partition);
	return afeb9260_nand_partition;
}

static struct atmel_nand_data __initdata afeb9260_nand_data = {
	.ale		= 21,
	.cle		= 22,
	.rdy_pin	= AT91_PIN_PC13,
	.enable_pin	= AT91_PIN_PC14,
	.partition_info	= nand_partitions,
	.bus_width_16	= 0,
	.parts		= afeb9260_nand_partition,
	.num_parts	= ARRAY_SIZE(afeb9260_nand_partition),
};


+2 −7
Original line number Diff line number Diff line
@@ -132,19 +132,14 @@ static struct mtd_partition __initdata cam60_nand_partition[] = {
	},
};

static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
{
	*num_partitions = ARRAY_SIZE(cam60_nand_partition);
	return cam60_nand_partition;
}

static struct atmel_nand_data __initdata cam60_nand_data = {
	.ale		= 21,
	.cle		= 22,
	// .det_pin	= ... not there
	.rdy_pin	= AT91_PIN_PA9,
	.enable_pin	= AT91_PIN_PA7,
	.partition_info	= nand_partitions,
	.parts		= cam60_nand_partition,
	.num_parts	= ARRAY_SIZE(cam60_nand_partition),
};

static struct sam9_smc_config __initdata cam60_nand_smc_config = {
+2 −7
Original line number Diff line number Diff line
@@ -169,19 +169,14 @@ static struct mtd_partition __initdata cap9adk_nand_partitions[] = {
	},
};

static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
{
	*num_partitions = ARRAY_SIZE(cap9adk_nand_partitions);
	return cap9adk_nand_partitions;
}

static struct atmel_nand_data __initdata cap9adk_nand_data = {
	.ale		= 21,
	.cle		= 22,
//	.det_pin	= ... not connected
//	.rdy_pin	= ... not connected
	.enable_pin	= AT91_PIN_PD15,
	.partition_info	= nand_partitions,
	.parts		= cap9adk_nand_partitions,
	.num_parts	= ARRAY_SIZE(cap9adk_nand_partitions),
};

static struct sam9_smc_config __initdata cap9adk_nand_smc_config = {
+2 −7
Original line number Diff line number Diff line
@@ -97,19 +97,14 @@ static struct mtd_partition __initdata kb9202_nand_partition[] = {
	},
};

static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
{
	*num_partitions = ARRAY_SIZE(kb9202_nand_partition);
	return kb9202_nand_partition;
}

static struct atmel_nand_data __initdata kb9202_nand_data = {
	.ale		= 22,
	.cle		= 21,
	// .det_pin	= ... not there
	.rdy_pin	= AT91_PIN_PC29,
	.enable_pin	= AT91_PIN_PC28,
	.partition_info	= nand_partitions,
	.parts		= kb9202_nand_partition,
	.num_parts	= ARRAY_SIZE(kb9202_nand_partition),
};

static void __init kb9202_board_init(void)
+2 −7
Original line number Diff line number Diff line
@@ -182,19 +182,14 @@ static struct mtd_partition __initdata neocore926_nand_partition[] = {
	},
};

static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
{
	*num_partitions = ARRAY_SIZE(neocore926_nand_partition);
	return neocore926_nand_partition;
}

static struct atmel_nand_data __initdata neocore926_nand_data = {
	.ale			= 21,
	.cle			= 22,
	.rdy_pin		= AT91_PIN_PB19,
	.rdy_pin_active_low	= 1,
	.enable_pin		= AT91_PIN_PD15,
	.partition_info		= nand_partitions,
	.parts			= neocore926_nand_partition,
	.num_parts		= ARRAY_SIZE(neocore926_nand_partition),
};

static struct sam9_smc_config __initdata neocore926_nand_smc_config = {
Loading