diff mbox

[3/4] ARM: pxa/spitz: Remove hardcoded partitioning, use sharpslpart parser

Message ID 1511300631-1343-3-git-send-email-andrea.adami@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrea Adami Nov. 21, 2017, 9:43 p.m. UTC
With the introduction of sharpslpart partition parser we can now read the
offsets from NAND: we specify the list of the parsers as platform data, with
cmdlinepart and ofpart parsers first allowing to override the part. table
written in NAND. This is done here in the board file.

Emulators like qemu will need to pass the mtdparts in the cmdline.

Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
---
 arch/arm/mach-pxa/spitz.c | 34 +++++++++-------------------------
 1 file changed, 9 insertions(+), 25 deletions(-)

Comments

Pavel Machek Nov. 22, 2017, 11:06 p.m. UTC | #1
On Tue 2017-11-21 22:43:50, Andrea Adami wrote:
> With the introduction of sharpslpart partition parser we can now read the
> offsets from NAND: we specify the list of the parsers as platform data, with
> cmdlinepart and ofpart parsers first allowing to override the part. table
> written in NAND. This is done here in the board file.
> 
> Emulators like qemu will need to pass the mtdparts in the cmdline.

IOW this will be regression for people emulating zaurus in qemu.

...

Is it good idea? Its not like this platform data is particulary big or
changes very often...

> Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Andrea Adami Nov. 24, 2017, 12:52 p.m. UTC | #2
On Thu, Nov 23, 2017 at 12:06 AM, Pavel Machek <pavel@ucw.cz> wrote:
> On Tue 2017-11-21 22:43:50, Andrea Adami wrote:
>> With the introduction of sharpslpart partition parser we can now read the
>> offsets from NAND: we specify the list of the parsers as platform data, with
>> cmdlinepart and ofpart parsers first allowing to override the part. table
>> written in NAND. This is done here in the board file.
>>
>> Emulators like qemu will need to pass the mtdparts in the cmdline.
>
> IOW this will be regression for people emulating zaurus in qemu.
>
> ...
>
> Is it good idea? Its not like this platform data is particulary big or
> changes very often...

Hello Pavel,

afais defining the partitions in the board file is today deprecated,
more than this the definitions are not totally correct,
e.g. ignoring the differences between 3100 and 3200 models.

The original Zaurus kernels did specify mtdparts= in the cmdline so I
don't see this being a big limitation for QEMU.

We are trying to clean out the board files and hopefully move the pxa
Zaurus to devicetree one day...
I think that removing the parttioning differences will ease the task.
Please correct me if I am wrong.

Cheers
Andrea


>
>> Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Robert Jarzmik Nov. 28, 2017, 9:52 p.m. UTC | #3
Andrea Adami <andrea.adami@gmail.com> writes:

> On Thu, Nov 23, 2017 at 12:06 AM, Pavel Machek <pavel@ucw.cz> wrote:
>> On Tue 2017-11-21 22:43:50, Andrea Adami wrote:

Pavel, given that you didn't challenge Andrea's statement, I assume QEMU users
will switch to mtdparts again.

I'll apply the serie to pxa/for-next.

Cheers.

--
Robert
Pavel Machek Dec. 15, 2017, 10:56 a.m. UTC | #4
On Tue 2017-11-28 22:52:43, Robert Jarzmik wrote:
> Andrea Adami <andrea.adami@gmail.com> writes:
> 
> > On Thu, Nov 23, 2017 at 12:06 AM, Pavel Machek <pavel@ucw.cz> wrote:
> >> On Tue 2017-11-21 22:43:50, Andrea Adami wrote:
> 
> Pavel, given that you didn't challenge Andrea's statement, I assume QEMU users
> will switch to mtdparts again.
> 
> I'll apply the serie to pxa/for-next.

Well, I believe it is bad idea, but whatever. I still have zaurus, but
don't use it any more.

									Pavel
diff mbox

Patch

diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 67d66c7..defefa3 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -739,21 +739,6 @@  static inline void spitz_lcd_init(void) {}
  * NAND Flash
  ******************************************************************************/
 #if defined(CONFIG_MTD_NAND_SHARPSL) || defined(CONFIG_MTD_NAND_SHARPSL_MODULE)
-static struct mtd_partition spitz_nand_partitions[] = {
-	{
-		.name = "System Area",
-		.offset = 0,
-		.size = 7 * 1024 * 1024,
-	}, {
-		.name = "Root Filesystem",
-		.offset = 7 * 1024 * 1024,
-	}, {
-		.name = "Home Filesystem",
-		.offset = MTDPART_OFS_APPEND,
-		.size = MTDPART_SIZ_FULL,
-	},
-};
-
 static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
 
 static struct nand_bbt_descr spitz_nand_bbt = {
@@ -808,10 +793,16 @@  static const struct mtd_ooblayout_ops akita_ooblayout_ops = {
 	.free = akita_ooblayout_free,
 };
 
+static const char * const probes[] = {
+	"cmdlinepart",
+	"ofpart",
+	"sharpslpart",
+	NULL,
+};
+
 static struct sharpsl_nand_platform_data spitz_nand_pdata = {
 	.badblock_pattern	= &spitz_nand_bbt,
-	.partitions		= spitz_nand_partitions,
-	.nr_partitions		= ARRAY_SIZE(spitz_nand_partitions),
+	.part_parsers		= probes,
 };
 
 static struct resource spitz_nand_resources[] = {
@@ -834,14 +825,7 @@  static struct platform_device spitz_nand_device = {
 
 static void __init spitz_nand_init(void)
 {
-	if (machine_is_spitz()) {
-		spitz_nand_partitions[1].size = 5 * 1024 * 1024;
-	} else if (machine_is_akita()) {
-		spitz_nand_partitions[1].size = 58 * 1024 * 1024;
-		spitz_nand_bbt.len = 1;
-		spitz_nand_pdata.ecc_layout = &akita_ooblayout_ops;
-	} else if (machine_is_borzoi()) {
-		spitz_nand_partitions[1].size = 32 * 1024 * 1024;
+	if (machine_is_akita() || machine_is_borzoi()) {
 		spitz_nand_bbt.len = 1;
 		spitz_nand_pdata.ecc_layout = &akita_ooblayout_ops;
 	}