Skip to contentSkip to conversation

Flat device tree definitions for FLASH and MTD partitioning

DISCUSSION Wolfgang Grandegger 2 participants 12 messages Apr 8, 2007 – Apr 26, 2007

lore
Share & tools
lore
#0 lore raw

Hello,

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

Thanks.

Wolfgang.

#1 lore raw

Hello.

Quoted 1 line · Wolfgang Grandegger

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

Quoted 3 lines

Thanks.

Wolfgang.

WBR, Sergei

#2 lore raw
Quoted 4 lines · Hello, I wrote:
Quoted 1 line

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

I meant drivers/mtd/maps/physmap_of.c

Quoted 3 lines
Quoted 3 lines

Thanks.

Wolfgang.

WBR, Sergei

#3 lore raw
Quoted 8 lines · Sergei Shtylyov
Quoted 4 lines · Hello, I wrote:
Quoted 1 line

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

I meant drivers/mtd/maps/physmap_of.c

Ah, I missed that, thanks a lot.

Wolfgang.

#4 lore raw
In reply to Sergei Shtylyov
Quoted 8 lines · Sergei Shtylyov
Quoted 4 lines · Hello, I wrote:
Quoted 1 line

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

I meant drivers/mtd/maps/physmap_of.c

I had a closer look to this driver. Unfortunately, it can not handle yet
multiple FLASH banks. This could be achieved with an additional
property "bank_count". What do you think?

Wolfgang.

#5 lore raw

Hello.

Quoted 10 lines · Wolfgang Grandegger
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

I meant drivers/mtd/maps/physmap_of.c

I had a closer look to this driver. Unfortunately, it can not handle yet
multiple FLASH banks. This could be achieved with an additional
property "bank_count". What do you think?

I'm not sure what banks you're talking about -- note that this driver is equivalen in functionality to the plain 'physmap' driver and there's inherited "bank-width" property that handles flash banking.

Quoted 1 line

Wolfgang.

MBR, Sergei

#6 lore raw
Quoted 9 lines · Sergei Shtylyov

Hello.

Quoted 4 lines · Wolfgang Grandegger
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I meant drivers/mtd/maps/physmap_of.c

I had a closer look to this driver. Unfortunately, it can not handle yet multiple FLASH banks. This could be achieved with an additional property "bank_count". What do you think?

I'm not sure what banks you're talking about -- note that this driver
is equivalen in functionality to the plain 'physmap' driver and there's inherited "bank-width" property that handles flash banking.

Yes, I know. Nevertheless the driver cannot handle flash regions composed of more than on FLASH bank because we need to probe every bank. Search for "BANK" in drivers/mtd/maps" to understand what I mean.

Wolfgang.

#7 lore raw

Hello.

Quoted 8 lines · Wolfgang Grandegger
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

I meant drivers/mtd/maps/physmap_of.c

I had a closer look to this driver. Unfortunately, it can not handle yet multiple FLASH banks. This could be achieved with an additional property "bank_count". What do you think?

Please use hyphen, not underscore in property names ("device_type" seems an only exception from this rule).

Quoted 4 lines
Quoted 2 lines

I'm not sure what banks you're talking about -- note that this driver
is equivalen in functionality to the plain 'physmap' driver and there's inherited "bank-width" property that handles flash banking.

Yes, I know. Nevertheless the driver cannot handle flash regions composed of more than on FLASH bank because we need to probe every bank. Search for "BANK" in drivers/mtd/maps" to understand what I mean.

Hm, from what I could see, those banks are separate maps registered to MTD subsys separately.
What's the point of adding a count property when we simply can define multiple "rom" devices?

Quoted 1 line

Wolfgang.

MBR, Sergei

#8 lore raw
Quoted 16 lines · Sergei Shtylyov

Hello.

Quoted 8 lines · Wolfgang Grandegger
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

I meant drivers/mtd/maps/physmap_of.c

I had a closer look to this driver. Unfortunately, it can not handle yet multiple FLASH banks. This could be achieved with an additional property "bank_count". What do you think?

Please use hyphen, not underscore in property names ("device_type"
seems an only exception from this rule).

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

I'm not sure what banks you're talking about -- note that this
driver is equivalen in functionality to the plain 'physmap' driver and there's inherited "bank-width" property that handles flash banking.

Yes, I know. Nevertheless the driver cannot handle flash regions composed of more than on FLASH bank because we need to probe every bank. Search for "BANK" in drivers/mtd/maps" to understand what I mean.

Hm, from what I could see, those banks are separate maps registered to
MTD subsys separately.
What's the point of adding a count property when we simply can define multiple "rom" devices?

Well, I was wrong. In the meantime I realized that physmap can handle flash region compiosed of multiple banks. Sorry for the noise.

Wolfgang.

#9 lore raw
In reply to Sergei Shtylyov
Quoted 9 lines · Sergei Shtylyov

Hello.

Quoted 4 lines · Wolfgang Grandegger
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

I meant drivers/mtd/maps/physmap_of.c

I had a closer look to this driver. Unfortunately, it can not handle yet multiple FLASH banks. This could be achieved with an additional property "bank_count". What do you think?

Please use hyphen, not underscore in property names ("device_type"
seems an only exception from this rule).

Yes, I know and I also wondered why an "_" is used for the device type.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

I'm not sure what banks you're talking about -- note that this
driver is equivalen in functionality to the plain 'physmap' driver and there's inherited "bank-width" property that handles flash banking.

Yes, I know. Nevertheless the driver cannot handle flash regions composed of more than on FLASH bank because we need to probe every bank. Search for "BANK" in drivers/mtd/maps" to understand what I mean.

Hm, from what I could see, those banks are separate maps registered to
MTD subsys separately.
What's the point of adding a count property when we simply can define multiple "rom" devices?

To complete this thread, physmap_of can map _one_ FLASH region composed of one or more FLASH banks. But it currently cannot map more than _one_ FLASH region. It would be nice to extend it for multiple FLASH definitions (could code it when time permits).

Wolfgang.

#10 lore raw

Hello.

Quoted 5 lines · Wolfgang Grandegger
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

I meant drivers/mtd/maps/physmap_of.c

I had a closer look to this driver. Unfortunately, it can not handle yet multiple FLASH banks. This could be achieved with an additional property "bank_count". What do you think?

Please use hyphen, not underscore in property names ("device_type"
seems an only exception from this rule).

Yes, I know and I also wondered why an "_" is used for the device type.

Ask the OF spec. developers. :-)

Quoted 10 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

I'm not sure what banks you're talking about -- note that this
driver is equivalen in functionality to the plain 'physmap' driver and there's inherited "bank-width" property that handles flash banking.

Yes, I know. Nevertheless the driver cannot handle flash regions composed of more than on FLASH bank because we need to probe every bank. Search for "BANK" in drivers/mtd/maps" to understand what I mean.

Hm, from what I could see, those banks are separate maps registered
to MTD subsys separately.
What's the point of adding a count property when we simply can define multiple "rom" devices?

To complete this thread, physmap_of can map _one_ FLASH region composed of one or more FLASH banks. But it currently cannot map more than _one_ FLASH region.

I wodner why?! :-O

Quoted 1 line

It would be nice to extend it for multiple FLASH definitions (could code it when time permits).

I'm seeing nothing that prevents it from working now -- it should register as much "rom" devices as you supply via the device tree.

Quoted 1 line

Wolfgang.

MBR, Sergei

#11 lore raw
Quoted 25 lines · Sergei Shtylyov

Hello.

Quoted 5 lines · Wolfgang Grandegger
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

are there already some thought or even example code on how to define Flash memory and MTD partitions in the DTS. This would avoid the ackward MTD partitioning via static structure or boot line argument and could be done in a generic way.

See Documentation/powerpc/booting-without-of.txt and
drivers/mtd/physmap_of.c for what's been already done.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

I meant drivers/mtd/maps/physmap_of.c

I had a closer look to this driver. Unfortunately, it can not handle yet multiple FLASH banks. This could be achieved with an additional property "bank_count". What do you think?

Please use hyphen, not underscore in property names ("device_type"
seems an only exception from this rule).

Yes, I know and I also wondered why an "_" is used for the device type.

Ask the OF spec. developers. :-)

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

I'm not sure what banks you're talking about -- note that this
driver is equivalen in functionality to the plain 'physmap' driver and there's inherited "bank-width" property that handles flash banking.

Yes, I know. Nevertheless the driver cannot handle flash regions composed of more than on FLASH bank because we need to probe every bank. Search for "BANK" in drivers/mtd/maps" to understand what I mean.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Hm, from what I could see, those banks are separate maps registered
to MTD subsys separately.
What's the point of adding a count property when we simply can define multiple "rom" devices?

To complete this thread, physmap_of can map _one_ FLASH region composed of one or more FLASH banks. But it currently cannot map more than _one_ FLASH region.

I wodner why?! :-O

I know as well ;-).

Quoted 4 lines
Quoted 1 line

It would be nice to extend it for multiple FLASH definitions (could code it when time permits).

I'm seeing nothing that prevents it from working now -- it should
register as much "rom" devices as you supply via the device tree.

OK, I see, for each registered direct-mapped flash resource, of_physmap_probe() will be called.

Thanks.

Wolfgang.