powerpc: Create "rom" (MTD) device prpmc2800
Quoted 3 lines · Mark A. Greer
Find the "rom" device for the prpmc2800 and create a device for it. The device will be picked up by the code in
drivers/mtd/maps/physmap_of.cand will setup MTD on that FLASH device.
...
Review
Quoted 12 lines
/*
+ * Register a platform device for MTD.
+ */(quoted diff) +8
-0+static int __init prpmc2800_register_mtd(void) +{ + struct device_node *np; + + np = of_find_compatible_node(NULL, "rom", "direct-mapped"); + of_platform_device_create(np, np->name, NULL); +} +arch_initcall(prpmc2800_register_mtd);
I think "direct-mapped" as compatible is a bit too broad or vague.
The compatible is supposed to be useable to find and match a driver without regard to the name of the node. Perhaps direct-mapped-rom? (as opossed to a direct-mapped-ram, sram, or some width flash bank).
Actually, looking back at your device tree {1], your list several properties for flash, including bank-width and partition names. Perhaps first compatible should be direct-mapped-partitioned-flash, direct-mapped-partitioned-rom, direct-mapped-rom (to me a direct-mapped-rom driver would expose one section of address space read-only). I'm assuming that your driver for this "direct-mapped" device will look at these properties from the of device node and call the mtd layer somewhat directly with their contents.
[1] http://ozlabs.org/pipermail/linuxppc-dev/2007-May/035858.html
milton
PS: I know you've posted this a few times. I'm just behind in my reading and replying :-).
Quoted 9 lines · Milton Miller
Actually, looking back at your device tree {1], your list several properties for flash, including bank-width and partition names. Perhaps first compatible should be direct-mapped-partitioned-flash, direct-mapped-partitioned-rom, direct-mapped-rom (to me a direct-mapped-rom driver would expose one section of address space read-only). I'm assuming that your driver for this "direct-mapped" device will look at these properties from the of device node and call the mtd layer somewhat directly with their contents.
If it's a flash, compatible should be the chip type, and maybe as a second entry, what type of flash protocol (amd, intel, cfi, ...) it's compatible.
Ben.
Quoted 5 lines
I think "direct-mapped" as compatible is a bit too broad or vague.
The compatible is supposed to be useable to find and match a driver without regard to the name of the node. Perhaps direct-mapped-rom? (as opossed to a direct-mapped-ram, sram, or some width flash bank).
"actual-name-of-the-chip", "cfi-command-set-#", "cfi" seems like a good start.
Quoted 8 lines
Actually, looking back at your device tree {1], your list several properties for flash, including bank-width and partition names. Perhaps first compatible should be direct-mapped-partitioned-flash, direct-mapped-partitioned-rom, direct-mapped-rom (to me a direct-mapped-rom driver would expose one section of address space read-only). I'm assuming that your driver for this "direct-mapped" device will look at these properties from the of device node and call the mtd layer somewhat directly with their contents.
People here tried to create a generic "flash" device binding. It didn't work out (part of the problem is its scope was way too big; another problem is it was too Linux-mtd specific).
Now since the probing is done in platform-specific code here, you don't *need* an "official" binding -- just get your "compatible" prop right so you can correctly probe the device node, and then maybe add some node-specific properties if you need them.
Segher
Hello.
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 8 lines · Milton Miller
Actually, looking back at your device tree {1], your list several properties for flash, including bank-width and partition names. Perhaps first compatible should be direct-mapped-partitioned-flash, direct-mapped-partitioned-rom, direct-mapped-rom (to me a direct-mapped-rom driver would expose one section of address space read-only). I'm assuming that your driver for this "direct-mapped" device will look at these properties from the of device node and call the mtd layer somewhat directly with their contents.
Quoted 3 lines
If it's a flash, compatible should be the chip type, and maybe as a second entry, what type of flash protocol (amd, intel, cfi, ...) it's compatible.
As I've already (and repatedly) stated before, this gets you *nothing* WRT
selecting the proper driver in the current Linux MTD subsystem. What it actually *needs* to know is flash mapping information, the CFI/JEDEC interface then can be deduced by probing -- so, this property ("ptobe-type"), although specified in Documentation/powerpc/booting-without-of.txt, is optional.
Quoted 1 line
Ben.
WBR, Sergei
Hello.
Quoted 8 lines · Segher Boessenkool
Quoted 5 lines
I think "direct-mapped" as compatible is a bit too broad or vague.
The compatible is supposed to be useable to find and match a driver without regard to the name of the node. Perhaps direct-mapped-rom? (as opossed to a direct-mapped-ram, sram, or some width flash bank).
"actual-name-of-the-chip", "cfi-command-set-#", "cfi" seems like a good start.
No, it doesn't -- since that info is almost *absolutely* useless (the only
exception is "cfi") in the context of Linux MTD subsys.
Please, try to understand that knowing that chip is CFI compatible in
itself doesn't yet guarantee that you can access the chip -- it all depends on its mapping to the real physical address range, therefore this group IMO cannot even constitute a valid "compatible" property.
Quoted 9 lines
Quoted 8 lines
Actually, looking back at your device tree {1], your list several properties for flash, including bank-width and partition names. Perhaps first compatible should be direct-mapped-partitioned-flash, direct-mapped-partitioned-rom, direct-mapped-rom (to me a direct-mapped-rom driver would expose one section of address space read-only). I'm assuming that your driver for this "direct-mapped" device will look at these properties from the of device node and call the mtd layer somewhat directly with their contents.
Quoted 3 lines
People here tried to create a generic "flash" device binding. It didn't work out (part of the problem is its scope was way too big; another problem is it was too Linux-mtd specific).
And that's why its worked, and the abstaractly "correct" scheme wouldn't have.
Quoted 5 lines
Now since the probing is done in platform-specific code here, you don't *need* an "official" binding -- just get your "compatible" prop right so you can correctly probe the device node, and then maybe add some node-specific properties if you need them.
I wonder what are you trying to get us to do: directly call stuff fromdrivers/mtd/ or what (that's especially starnge because we now have an OF driver for simply mapped NOR flashes)?
Quoted 1 line
Segher
WBR, Sergei
Hello.
Quoted 6 lines · Milton Miller
Quoted 3 lines
Find the "rom" device for the prpmc2800 and create a device for it. The device will be picked up by the code in
drivers/mtd/maps/physmap_of.cand will setup MTD on that FLASH device....
Quoted 13 lines
Review
Quoted 11 lines
/*
+ * Register a platform device for MTD.
+ */(quoted diff) +8
-0+static int __init prpmc2800_register_mtd(void) +{ + struct device_node *np; + + np = of_find_compatible_node(NULL, "rom", "direct-mapped"); + of_platform_device_create(np, np->name, NULL); +} +arch_initcall(prpmc2800_register_mtd);I think "direct-mapped" as compatible is a bit too broad or vague.
It's actually not -- it means simple 1:1 address mapping (w/o explicit
byte-swapping and such).
Quoted 3 lines
The compatible is supposed to be useable to find and match a driver without regard to the name of the node. Perhaps direct-mapped-rom? (as opossed to a direct-mapped-ram, sram, or some width flash bank).
Note that we're matching by both "device_type" and "compatible".
Quoted 6 lines
Actually, looking back at your device tree {1], your list several properties for flash, including bank-width and partition names. Perhaps first compatible should be direct-mapped-partitioned-flash, direct-mapped-partitioned-rom, direct-mapped-rom (to me a direct-mapped-rom driver would expose one section of address space read-only).
This would serve no purpose, as the driver that would catches all these is
signle one, drivers/mtd/maps/physmap_of.c...
Quoted 3 lines
I'm assuming that your driver for this "direct-mapped" device will look at these properties from the of device node and call the mtd layer somewhat directly with their contents.
Yeah, it does.
Quoted 6 lines
[1] http://ozlabs.org/pipermail/linuxppc-dev/2007-May/035858.html
milton
PS: I know you've posted this a few times. I'm just behind in my reading and replying :-).
WBR, Sergei
Quoted 5 lines
Quoted 3 lines
If it's a flash, compatible should be the chip type, and maybe as a second entry, what type of flash protocol (amd, intel, cfi, ...) it's compatible.
As I've already (and repatedly) stated before,
And you repeatedly got answers too, yet you choose to rehash this whole discussion again.
Quoted 2 lines
this gets you *nothing* WRT
selecting the proper driver in the current Linux MTD subsystem.
Which Linux driver to use is not something that should be (directly) communicated in a device tree -- even if you take the position the device tree is a nice big configuration file for Linux, what if a new Linux flash subsystem shows up (or even simply a driver got renamed, etc.) -- the device tree on your board doesn't necessarily change when your kernel version does.
Quoted 2 lines
What it
actually *needs* to know is flash mapping information,
It needs to know what kind of flash it is, and how it is connected -- i.e., it needs to describe the hardware. How Linux then decides to use it is its own game, but at least the device tree puts all the information it could possibly need out there.
Quoted 2 lines
the CFI/JEDEC interface
then can be deduced by probing
Most of the time, sure. Not always.
Quoted 2 lines
-- so, this property ("ptobe-type"), although
specified inDocumentation/powerpc/booting-without-of.txt, is optional.
Who is talking about "probe-type"? We are talking about "compatible".
Segher
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
I think "direct-mapped" as compatible is a bit too broad or vague.
The compatible is supposed to be useable to find and match a driver without regard to the name of the node. Perhaps direct-mapped-rom? (as opossed to a direct-mapped-ram, sram, or some width flash bank).
Quoted 7 lines
Quoted 2 lines
"actual-name-of-the-chip", "cfi-command-set-#", "cfi" seems like a good start.
No, it doesn't -- since that info is almost *absolutely* useless
(the only exception is "cfi") in the context of Linux MTD subsys.
Please, try to understand that knowing that chip is CFI compatible
in itself doesn't yet guarantee that you can access the chip -- it all depends on its mapping to the real physical address range, therefore this group IMO cannot even constitute a valid "compatible" property.
You obviously completely misunderstand the semantics of the "compatible" property.
Quoted 6 lines
Quoted 3 lines
People here tried to create a generic "flash" device binding. It didn't work out (part of the problem is its scope was way too big; another problem is it was too Linux-mtd specific).
And that's why its worked, and the abstaractly "correct" scheme
wouldn't have.
Ha. Ha. Ha. Great joke :-)
Quoted 8 lines
Quoted 5 lines
Now since the probing is done in platform-specific code here, you don't *need* an "official" binding -- just get your "compatible" prop right so you can correctly probe the device node, and then maybe add some node-specific properties if you need them.
I wonder what are you trying to get us to do: directly call stuff
fromdrivers/mtd/or what (that's especially starnge because we now have an OF driver for simply mapped NOR flashes)?
I am pointing out how to do a flash node in a platform- specific way, in platform-specific code, since there is no working "generic" way yet (and very likely there will never be).
Segher
Quoted 5 lines
Quoted 1 line
I think "direct-mapped" as compatible is a bit too broad or vague.
It's actually not -- it means simple 1:1 address mapping (w/o
explicit
byte-swapping and such).
Which has nothing to do with "compatible"; instead, it is implied by the parent node have a "ranges" property. Or you can put some other property in the flash node for all I care, if that seems necessary for certain cases.
Quoted 5 lines
Quoted 3 lines
The compatible is supposed to be useable to find and match a driver without regard to the name of the node. Perhaps direct-mapped-rom? (as opossed to a direct-mapped-ram, sram, or some width flash bank).
Note that we're matching by both "
device_type" and "compatible".
Which is wrong.
Quoted 3 lines
This would serve no purpose, as the driver that would catches all
these is
signle one,drivers/mtd/maps/physmap_of.c...
With the current kernel version, perhaps. Did you check out 2.6.28? Does it work with that?
Segher
Hello.
Quoted 7 lines · Segher Boessenkool
Quoted 4 lines
Quoted 3 lines
If it's a flash, compatible should be the chip type, and maybe as a second entry, what type of flash protocol (amd, intel, cfi, ...) it's compatible.
As I've already (and repatedly) stated before,
And you repeatedly got answers too, yet you choose to rehash this whole discussion again.
Not I have started it. And I have my reasons, too. :-)
Quoted 5 lines
Quoted 2 lines
this gets you *nothing* WRT
selecting the proper driver in the current Linux MTD subsystem.Which Linux driver to use is not something that should be (directly) communicated in a device tree -- even if
Bah... what's "name" and "compatible" properties are for then. Nobody's
talking about the direct match but making the task of selecting a proper driver more complex by specifying the details that don't help (if not hinder) the correct selection is certainly not a way to go.
Quoted 4 lines
you take the position the device tree is a nice big configuration file for Linux, what if a new Linux flash subsystem shows up (or even simply a driver got renamed, etc.)
There is no direct match in *this* case (for an example of such, refer to
FSL "gianfar" nodes ;-).
Quoted 2 lines
-- the device tree on your board doesn't necessarily change when your kernel version does.
Well, I'm not anticipating any changes either in this case...
Quoted 9 lines
Quoted 2 lines
What it
actually *needs* to know is flash mapping information,It needs to know what kind of flash it is, and how it is connected -- i.e., it needs to describe the hardware. How Linux then decides to use it is its own game, but at least the device tree puts all the information it could possibly need out there.
Quoted 3 lines
Quoted 1 line
the CFI/JEDEC interface then can be deduced by probing
Most of the time, sure. Not always.
That's the way the cookie crumbles in Linux MTD for now. It's *always*
detecting this by probing -- you only can say what [not] to probe.
Quoted 4 lines
Quoted 2 lines
-- so, this property ("ptobe-type"), although specified in
Documentation/powerpc/booting-without-of.txt, is optional.Who is talking about "probe-type"? We are talking about "compatible".
See my other mail where I've told why I don't consider your example of
this prop valid...
Quoted 1 line
Segher
WBR, Sergei
Quoted 8 lines · Segher Boessenkool
Quoted 5 lines
Quoted 1 line
I think "direct-mapped" as compatible is a bit too broad or vague.
It's actually not -- it means simple 1:1 address mapping (w/o
explicit
byte-swapping and such).Which has nothing to do with "compatible"; instead, it is implied by the parent node have a "ranges"
No! It doesn't have anything to do with "ranges" of parent (don't even
know why it would). :-O
Quoted 3 lines
property. Or you can put some other property in the flash node for all I care, if that seems necessary for certain cases.
Erm... it's *certainly* necessary to mark this somewhere.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
The compatible is supposed to be useable to find and match a driver without regard to the name of the node. Perhaps direct-mapped-rom?
That really depends on whether we choose to follow the Generic Names spec.
Even if we do, it does *not* preclude OS from using both props for the driver selection.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
(as opossed to a direct-mapped-ram, sram, or some width flash bank).
Note that we're matching by both "
device_type" and "compatible".Which is wrong.
Why? And why then it's allowed to match by "device_type"? And why you
haven't complained at MPC5200 IDE driver which does the same (well, maybe you have :-) or at PowerMac IDE driver which matches wither by "name" or "device_type"? Well, quite a lot of drivers are doing this...
Quoted 5 lines
Quoted 2 lines
This would serve no purpose, as the driver that would catches all
these is signle one,drivers/mtd/maps/physmap_of.c...With the current kernel version, perhaps. Did you check out 2.6.28? Does it work with that?
For the simply mapped flashes, physmap_of will suffice, for more complex
cases, other driver will be needed. If you're hinting at the possibility that MTD subsys will be substantially reworked -- I don't find that likely. If it will -- well, bad luck. :-)
Anyway, reasonable suggestions on how to make MTD nodes more viable are
always welcome. I just haven't seen reasonable enough yet. ;-)
Quoted 1 line
Segher
WBR, Sergei
Quoted 4 lines
Quoted 2 lines
Which Linux driver to use is not something that should be (directly) communicated in a device tree -- even if
Bah... what's "name" and "compatible" properties are for then.
They communicate to the kernel what exactly a certain device is. Nothing more, nothing less. The kernel is supposed to use this information to select what device driver to use for it. Any extra information the kernel might need/want to drive the device is described in other properties (or, in some cases, in different device nodes, even).
Quoted 1 line
Nobody's talking about the direct match but making the task of selecting a proper driver more complex by specifying the details that don't help (if not hinder) the correct selection is certainly not a way to go.
Nonsense. If the kernel doesn't care about certain details, it can just ignore them.
Quoted 4 lines
Quoted 2 lines
-- the device tree on your board doesn't necessarily change when your kernel version does.
Well, I'm not anticipating any changes either in this case...
That's a problem then.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
the CFI/JEDEC interface then can be deduced by probing
Most of the time, sure. Not always.
That's the way the cookie crumbles in Linux MTD for now. It's
*always* detecting this by probing -- you only can say what [not] to probe.
So go fix that :-)
Quoted 4 lines
Quoted 1 line
Who is talking about "probe-type"? We are talking about "compatible".
See my other mail where I've told why I don't consider your example
of this prop valid...
I haven't read that yet, but I can tell you now that I'm already very sceptical about the arguments.
Segher
Quoted 9 lines · Segher Boessenkool
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
I think "direct-mapped" as compatible is a bit too broad or vague.
The compatible is supposed to be useable to find and match a driver without regard to the name of the node. Perhaps direct-mapped-rom? (as opossed to a direct-mapped-ram, sram, or some width flash bank).
"actual-name-of-the-chip", "cfi-command-set-#", "cfi" seems like a good start.
Quoted 7 lines
Quoted 4 lines
No, it doesn't -- since that info is almost *absolutely* useless
(the only exception is "cfi") in the context of Linux MTD subsys.
Please, try to understand that knowing that chip is CFI compatible
in itself doesn't yet guarantee that you can access the chip -- it all depends on its mapping to the real physical address range, therefore this group IMO cannot even constitute a valid "compatible" property.You obviously completely misunderstand the semantics of the "compatible" property.
Oh well, on the chip level, your "compatible" prop would be correct. But
that only means we need another level representating the flash mapping for which the chip node would be a child... That seems a viable representation but it would certainly complicate things Linux-wise.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
People here tried to create a generic "flash" device binding. It didn't work out (part of the problem is its scope was way too big; another problem is it was too Linux-mtd specific).
And that's why its worked, and the abstaractly "correct" scheme
wouldn't have.Ha. Ha. Ha. Great joke :-)
/me bows
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
Now since the probing is done in platform-specific code here, you don't *need* an "official" binding -- just get your "compatible" prop right so you can correctly probe the device node, and then maybe add some node-specific properties if you need them.
I wonder what are you trying to get us to do: directly call stuff
fromdrivers/mtd/or what (that's especially starnge because we now have an OF driver for simply mapped NOR flashes)?I am pointing out how to do a flash node in a platform- specific way, in platform-specific code, since there is
I don't thing that confining the "bloody" MTD details into platform code
would be an acceptable solution.
Quoted 2 lines
no working "generic" way yet (and very likely there will never be).
There is something working, at least Linux-generic.
However, the MTD device node was certainly misplaced my me, and probably
oversimplified too -- that's the cost one usually pays when he has to think something up and to fit it into existing scheme in a limited time. :-<
Quoted 1 line
Segher
WBR, Sergei
Quoted 11 lines · Segher Boessenkool
Quoted 4 lines
Quoted 2 lines
Which Linux driver to use is not something that should be (directly) communicated in a device tree -- even if
Bah... what's "name" and "compatible" properties are for then.
They communicate to the kernel what exactly a certain device is. Nothing more, nothing less. The kernel is supposed to use this information to select what device driver to use for it. Any extra information the kernel might need/want to drive the device is described in other properties (or, in some cases, in different device nodes, even).
Yeah, the different node sounds more like this case.
Quoted 4 lines
Quoted 1 line
Nobody's talking about the direct match but making the task of selecting a proper driver more complex by specifying the details that don't help (if not hinder) the correct selection is certainly not a way to go.
Nonsense. If the kernel doesn't care about certain details, it can just ignore them.
That's OK, as long as it has the details it needs. Your suggestions on the
"compatible" devoided it of such.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
-- the device tree on your board doesn't necessarily change when your kernel version does.
Well, I'm not anticipating any changes either in this case...
That's a problem then.
At least not in the direction that you wanted us to change the MTD device
node. :-)
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
the CFI/JEDEC interface then can be deduced by probing
Most of the time, sure. Not always.
That's the way the cookie crumbles in Linux MTD for now. It's
*always* detecting this by probing -- you only can say what [not] to probe.So go fix that :-)
Wanna pay me for that? ;-)
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
Who is talking about "probe-type"? We are talking about "compatible".
See my other mail where I've told why I don't consider your example
of this prop valid...I haven't read that yet, but I can tell you now that I'm already very sceptical about the arguments.
Segher
WBR, Sergei
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
I think "direct-mapped" as compatible is a bit too broad or vague.
It's actually not -- it means simple 1:1 address mapping (w/o
explicit
byte-swapping and such).Which has nothing to do with "compatible"; instead, it is implied by the parent node have a "ranges"
No! It doesn't have anything to do with "ranges" of parent (don't
even know why it would). :-O
So learn about it please? "ranges" means exactly that:
child nodes' address space is direct mapped.
Quoted 5 lines
Quoted 3 lines
property. Or you can put some other property in the flash node for all I care, if that seems necessary for certain cases.
Erm... it's *certainly* necessary to mark this somewhere.
Not if it's redundant information.
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
The compatible is supposed to be useable to find and match a driver without regard to the name of the node. Perhaps direct-mapped-rom?
That really depends on whether we choose to follow the Generic
Names spec.
No, it doesn't. OF before the generic names recommended practice was different only in that it had "name" be the most specific of the device descriptions.
Also, it has already been decided to follow this recommended practice. It would have been foolish not to, it being collected wisdom by real-life implementations and all.
Quoted 1 line
Even if we do, it does *not* preclude OS from using both props for the driver selection.
An OS is *required* (erm, "supposed", if you like) to use first "name", and then "compatible". An OS is not supposed to use "device_type" or any other properties for device matching.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Note that we're matching by both "
device_type" and "compatible".Which is wrong.
Why?
Because that is a) not what you are supposed to do according to the standard (so it might very well not work with a "third-party" device tree that equally conforms to the standard);
b) "device_type" describes some other information (namely, the OF programming model for the device node) that is completely unrelated to the process of driver matching; and c) it is wholly redundant to the information in "compatible" *ANYWAY*.
Quoted 1 line
And why then it's allowed to match by "
device_type"?
Anything is allowed, this is a free world. It is wrong though. Linux used to do this wrong, there are many remnants of that left. You also might *need* to do this for certain imperfect device trees. None of this is an argument to continue this "tradition".
Quoted 1 line
And why you haven't complained at MPC5200 IDE driver
Since no one paid me to review the code? Please don't try that argument ever again, thank you very much. I think I do quite enough work here already, I don't need people demanding stuff from me.
Quoted 1 line
which does the same (well, maybe you have :-) or at PowerMac IDE driver which matches wither by "name" or "
device_type"? Well, quite a lot of drivers are doing this...
See before why that may be. Short answer is "history".
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
This would serve no purpose, as the driver that would catches
all these is signle one,drivers/mtd/maps/physmap_of.c...With the current kernel version, perhaps. Did you check out 2.6.28? Does it work with that?
For the simply mapped flashes,
physmap_ofwill suffice, for more
complex cases, other driver will be needed.
Ah, so you can predict the future of the Linux kernel!
Quoted 2 lines
If you're hinting at the possibility that MTD subsys will be
substantially reworked -- I don't find that likely. If it will -- well, bad luck. :-)
Which is not an acceptable outcome.
Quoted 2 lines
Anyway, reasonable suggestions on how to make MTD nodes more viable
are always welcome. I just haven't seen reasonable enough yet. ;-)
I suggest you read, and try to understand, some of the base device tree specifications first.
Segher
Quoted 4 lines
Quoted 2 lines
You obviously completely misunderstand the semantics of the "compatible" property.
Oh well, on the chip level, your "compatible" prop would be correct.
This has nothing to do with a "chip level", it is plain and simply the most basic device tree stuff.
[rest snipped]
Segher
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Nobody's talking about the direct match but making the task of selecting a proper driver more complex by specifying the details that don't help (if not hinder) the correct selection is certainly not a way to go.
Nonsense. If the kernel doesn't care about certain details, it can just ignore them.
That's OK, as long as it has the details it needs. Your suggestions
on the "compatible" devoided it of such.
Sigh.
[snip]
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
That's the way the cookie crumbles in Linux MTD for now. It's
*always* detecting this by probing -- you only can say what [not] to probe.So go fix that :-)
Wanna pay me for that? ;-)
You're the one complaining, you go pay yourself.
[snip, plunk]
Segher
Quoted 6 lines · Segher Boessenkool
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
I think "direct-mapped" as compatible is a bit too broad or vague.
It's actually not -- it means simple 1:1 address mapping (w/o
explicit
byte-swapping and such).
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Which has nothing to do with "compatible"; instead, it is implied by the parent node have a "ranges"
No! It doesn't have anything to do with "ranges" of parent (don't
even know why it would). :-OSo learn about it please? "ranges" means exactly that:
child nodes' address space is direct mapped.
Well, now we certainly need a parent node -- which would be static bus
controller? But those have multiple chips selects, so we should know which range to use. Ugh...
Quoted 14 lines
Quoted 5 lines
Quoted 3 lines
property. Or you can put some other property in the flash node for all I care, if that seems necessary for certain cases.
Erm... it's *certainly* necessary to mark this somewhere.
Not if it's redundant information.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Note that we're matching by both "
device_type" and "compatible".Which is wrong.
Why?
Quoted 7 lines
Because that is a) not what you are supposed to do according to the standard (so it might very well not work with a "third-party" device tree that equally conforms to the standard);
b) "device_type" describes some other information (namely, the OF programming model for the device node) that is completely unrelated to the process of driver matching; and c) it is wholly redundant to the information in "compatible" *ANYWAY*.
Hm, well. Than changing "compatible" prop would make sense.
Quoted 11 lines
Quoted 1 line
And why then it's allowed to match by "
device_type"?Anything is allowed, this is a free world. It is wrong though. Linux used to do this wrong, there are many remnants of that left. You also might *need* to do this for certain imperfect device trees. None of this is an argument to continue this "tradition".
Quoted 1 line
And why you haven't complained at MPC5200 IDE driver
Since no one paid me to review the code? Please don't try
Sigh, nobody pays me for that too. :-)
Quoted 3 lines
that argument ever again, thank you very much. I think I do quite enough work here already, I don't need people demanding stuff from me.
I wasn't demanding anything. I just wanted to clear things out.
Quoted 3 lines
Quoted 1 line
which does the same (well, maybe you have :-) or at PowerMac IDE driver which matches wither by "name" or "
device_type"? Well, quite a lot of drivers are doing this...See before why that may be. Short answer is "history".
Well, at least that's cleared.
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
This would serve no purpose, as the driver that would catches
all these is signle one,drivers/mtd/maps/physmap_of.c...With the current kernel version, perhaps. Did you check out 2.6.28? Does it work with that?
For the simply mapped flashes,
physmap_ofwill suffice, for more
complex cases, other driver will be needed.Ah, so you can predict the future of the Linux kernel!
If I could, I'd have taken measures. :-)
Quoted 10 lines
Quoted 2 lines
If you're hinting at the possibility that MTD subsys will be
substantially reworked -- I don't find that likely. If it will -- well, bad luck. :-)Which is not an acceptable outcome.
Quoted 2 lines
Anyway, reasonable suggestions on how to make MTD nodes more viable
are always welcome. I just haven't seen reasonable enough yet. ;-)I suggest you read, and try to understand, some of the base device tree specifications first.
Read them some months ago -- do you think I would have plunged into that
not reading anything first? :-/
Quoted 1 line
Segher
WBR, Sergei
Quoted 7 lines · Segher Boessenkool
Quoted 4 lines
Quoted 2 lines
You obviously completely misunderstand the semantics of the "compatible" property.
Oh well, on the chip level, your "compatible" prop would be correct.
This has nothing to do with a "chip level", it is plain and simply the most basic device tree stuff.
If it was as "plain and simple" as you say, there would be nothing to
argue about. What we ended up with is 2 or 3 level hierarchy of nodes which doesn't at all seem to be such simple (considering the fact that what's covered by a the simple "bank-width" property could be represented by several combinations of interleaved flash chips). So, what you wanted us to do was either substantially redesign Linux MTD subsys to fit it into that model (either that or over-engineer the physmap_of driver to gather that kind of information from the multiple "chip" subnodes). Guess how well would that have been accepted even if we had time to do that...
Quoted 1 line
Segher
WBR, Sergei
Quoted 9 lines · Segher Boessenkool
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Nobody's talking about the direct match but making the task of selecting a proper driver more complex by specifying the details that don't help (if not hinder) the correct selection is certainly not a way to go.
Nonsense. If the kernel doesn't care about certain details, it can just ignore them.
That's OK, as long as it has the details it needs. Your suggestions
on the "compatible" devoided it of such.Sigh.
There had been no suggestions about other props or using "ranges" at that
point. That wouldn't have covered all issues anyway.
Quoted 10 lines
[snip]
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
That's the way the cookie crumbles in Linux MTD for now. It's
*always* detecting this by probing -- you only can say what [not] to probe.So go fix that :-)
Wanna pay me for that? ;-)
You're the one complaining, you go pay yourself.
I'm lost here. Complaining about what?
Quoted 3 lines
[snip, plunk]
Segher
WBR, Sergei
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
No! It doesn't have anything to do with "ranges" of parent (don't
even know why it would). :-OSo learn about it please? "ranges" means exactly that:
child nodes' address space is direct mapped.Well, now we certainly need a parent node -- which would be static
bus controller?
I have no clue what a "static bus controller" is. Your flash node obviously needs _some_ parent node though -- this is a tree after all.
Quoted 1 line
But those have multiple chips selects, so we should know which range to use. Ugh...
That is described in the "reg" property of the flash node, just like for any other node.
Quoted 9 lines
Quoted 7 lines
Because that is a) not what you are supposed to do according to the standard (so it might very well not work with a "third-party" device tree that equally conforms to the standard);
b) "device_type" describes some other information (namely, the OF programming model for the device node) that is completely unrelated to the process of driver matching; and c) it is wholly redundant to the information in "compatible" *ANYWAY*.Hm, well. Than changing "compatible" prop would make sense.
Yes.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
And why you haven't complained at MPC5200 IDE driver
Since no one paid me to review the code? Please don't try
Sigh, nobody pays me for that too. :-)
Yeah it's a shame isn't it?
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
which does the same (well, maybe you have :-) or at PowerMac IDE driver which matches wither by "name" or "
device_type"? Well, quite a lot of drivers are doing this...See before why that may be. Short answer is "history".
Well, at least that's cleared.
Okido, good to hear.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Anyway, reasonable suggestions on how to make MTD nodes more
viable are always welcome. I just haven't seen reasonable enough yet. ;-)I suggest you read, and try to understand, some of the base device tree specifications first.
Read them some months ago -- do you think I would have plunged into
that not reading anything first? :-/
It seems we really need more howto-style docs...
Segher
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
You obviously completely misunderstand the semantics of the "compatible" property.
Oh well, on the chip level, your "compatible" prop would be
correct.This has nothing to do with a "chip level", it is plain and simply the most basic device tree stuff.
If it was as "plain and simple" as you say, there would be nothing
to argue about.
There isn't as far as I am concerned; the purpose and meaning of the "compatible" property, as well as of any other standard OF properties, is clear.
Quoted 1 line
What we ended up with is 2 or 3 level hierarchy of nodes which doesn't at all seem to be such simple (considering the fact that what's covered by a the simple "bank-width" property could be represented by several combinations of interleaved flash chips).
Yes, the more complex (and sometimes insane) ways that flash chips are connected to systems can be really hard to describe properly. Which is why I don't even want to make a "binding" for it (yet). It seems easy enough to do this for single flash chips (possibly direct-mapped) though.
Quoted 1 line
So, what you wanted us to do was either substantially redesign Linux MTD subsys to fit it into that model
Nah. The current MTD model has some issues of course, but that is a separate problem.
Quoted 2 lines
(either that or over-engineer the
physmap_ofdriver to gather that
kind of information from the multiple "chip" subnodes).
I would say it is overengineered already. It shouldn't try to be a general solution for all possible cases since it has no hope of achieving that. Get the simple cases (that actually are used in real life) right, first.
Segher
Quoted 4 lines · Segher Boessenkool
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
No! It doesn't have anything to do with "ranges" of parent (don't
even know why it would). :-O
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
So learn about it please? "ranges" means exactly that:
child nodes' address space is direct mapped.Well, now we certainly need a parent node -- which would be static
bus controller?I have no clue what a "static bus controller" is. Your
As has been pointed out in the previous "fit" of this dispute, the NOR
flashes are usually behind a kind of bridge between the "host" and "peripheral" (static) busses.
Quoted 2 lines
flash node obviously needs _some_ parent node though -- this is a tree after all.
Yes, of course it always has a perent. The question is which parent it
should be. :-)
Quoted 4 lines
Quoted 1 line
But those have multiple chips selects, so we should know which range to use. Ugh...
That is described in the "reg" property of the flash node, just like for any other node.
Ah. So simple. :-)
What I failed to realize so far was that "ranges" imply 1:1 address
correspondence. But not all is so simple, I'm afraid. The flash chips themselves could be connected to their bus in some weird fashion, I'm afraid (not that it's likely to happen on mostly big-endian PPC though).
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
And why you haven't complained at MPC5200 IDE driver
Since no one paid me to review the code? Please don't try
Sigh, nobody pays me for that too. :-)
Yeah it's a shame isn't it?
Well, I'm doing it anyway. :-)
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Anyway, reasonable suggestions on how to make MTD nodes more
viable are always welcome. I just haven't seen reasonable enough yet. ;-)I suggest you read, and try to understand, some of the base device tree specifications first.
Read them some months ago -- do you think I would have plunged into
that not reading anything first? :-/It seems we really need more howto-style docs...
It may indeed be non-trivial task to find all the necessary specs besides
1285 itself -- I just happened to know where to grab them beforehand:
http://www.openbios.org/Bindings
Quoted 1 line
Segher
WBR, Sergei
Quoted 8 lines · Segher Boessenkool
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
You obviously completely misunderstand the semantics of the "compatible" property.
Oh well, on the chip level, your "compatible" prop would be correct.
This has nothing to do with a "chip level", it is plain and simply the most basic device tree stuff.
Quoted 6 lines
Quoted 2 lines
If it was as "plain and simple" as you say, there would be nothing
to argue about.There isn't as far as I am concerned; the purpose and meaning of the "compatible" property, as well as of any other standard OF properties, is clear.
Erm, concerning matching those with drivers it wasn't as clear that those
props aren't the same as driver names b/c of the follwing passage in Generic Names:
"It is possible that the operating system will find a driver matching the generic name, and that said driver will not be the correct one. However, this is not a new problem, because generic names have already been used in the past for built-in devices. Consequently, an operating system that does not already have a mechanism for resolving or avoiding such false matches is likely to have problems eventually, with or without the proliferation of generic names.
The following suggests some possible techniques for dealing with such false generic matches.
a) In collections of OS drivers, avoid the use of generic names for the drivers themselves. For example, it is generally unwise to name a driver ethernet, since there are many different ethernet adapters with different programming models. Using the generic name ethernet to identify only one such driver is presumptuous.
b) Separate the OS's name spaces for drivers for real hardware devices and pseudodrivers (collections of support routines that are used by real drivers). Some operating systems load such pseudo-drivers using a mechanism similar to the mechanism used for real drivers. Pseudo drivers often perform generic functions that apply equally well to, for example, all ethernet adapters, independent of their low-level programming models. Consequently, it is reasonable to use generic names (e.g. ethernet) for such pseudodrivers. Separating the name spaces of real drivers and pseudo-drivers avoids false matches from generic device names to generic psuedo-driver names.
c) Make the OS's driver search mechanism depend upon the device's parent. In other words, separate the OS's driver name spaces so that drivers for devices that attach to, for example, PCI bus can be distinguished from those that attach to, for example, ISA bus. This reduces the range over which false matches can occur.
d) For cases where false matches are unavoidable (for example, if there is an existing driver with a generic name that must be retained for backwards compatibility) allow the drivers that can be incorrectly matched the possibility of rejecting the match. One technique for doing so is to for the driver to inspect the compatible property to ensure that it is appropriate. Another common technique is to have the generic driver probe the hardware to see if it behaves as expected (although this technique can cause problems)."
Well, I've already pointed that out in the past...
Quoted 6 lines
Quoted 1 line
What we ended up with is 2 or 3 level hierarchy of nodes which doesn't at all seem to be such simple (considering the fact that what's covered by a the simple "bank-width" property could be represented by several combinations of interleaved flash chips).
Yes, the more complex (and sometimes insane) ways that flash chips are connected to systems can be really hard to describe properly. Which is why I don't even want to make a "binding" for it (yet). It seems easy enough
Neither do we. :-)
Quoted 2 lines
to do this for single flash chips (possibly direct-mapped) though.
Erm, FSL boards seem to generally have dual 16-bit NOR flash chips
interleaved -- and that's seems quite a common case, not only in PPC world.
Perhaps... those interleaved chips could really be merged (abstracted)
into a single one, with the bus width being a sum of two?
Quoted 6 lines
Quoted 2 lines
(either that or over-engineer the
physmap_ofdriver to gather that
kind of information from the multiple "chip" subnodes).I would say it is overengineered already. It shouldn't try to be a general solution for all possible cases since it has no hope of achieving that.
It's not trying to be such a general solution, it's just trying to handle
all the cases of simply-mapped NOR flashes, just like its non-OF counterpart does.
Quoted 2 lines
Get the simple cases
(that actually are used in real life) right, first.
We pursued this task exactly. Get it working, quick. :-)
Quoted 1 line
Segher
WBR, Sergei
Quoted 7 lines · Sergei Shtylyov
Quoted 3 lines
Quoted 1 line
the CFI/JEDEC interface then can be deduced by probing
Most of the time, sure. Not always.
That's the way the cookie crumbles in Linux MTD for now. It's
*always*
detecting this by probing -- you only can say what [not] to probe.
So you are saying that because the current linux MTD stuff can only probe (which doesn't always work), we should not put the proper chip interface type in the device-tree ?
Your argument makes no sense to me.
Put the proper interface informations in the device-tree, maybe some OS smarter than linux will make good use on it and maybe linux will be fixed at one point too (not by you, of course, you gave us that line often enough about not being paid to do the right thing).
Ben.
Quoted 11 lines · Sergei Shtylyov
No, it doesn't -- since that info is almost *absolutely* useless
(the only
exception is "cfi") in the context of Linux MTD subsys.
Please, try to understand that knowing that chip is CFI compatible
in
itself doesn't yet guarantee that you can access the chip -- it all depends on
its mapping to the real physical address range, therefore this group IMO
cannot even constitute a valid "compatible" property.
You make no sense to me. It's like saying that knowing that a 8250 chip on ISA cannot be accessed if you don't know it's IO ports so it shouldn't say "8250" in compatible property ?!?!?!?
Also, whatever shortcomings of the linux MTD drivers are totally irrelevant to what is correct to have in a device-tree. While we do tailor our device-tree specification around linux needs in most cases, there are cases like this one where common sense should be enough to understand that it's not because the linux MTD subsystem, as of today, cannot be told what programming interface to use, that we shouldn't provide that information in the tree.
Regarding physical address ranges for the flash mapping, I suppose the best is to define a property for flash chips for it.
Quoted 5 lines
Quoted 2 lines
flash node obviously needs _some_ parent node though -- this is a tree after all.
Yes, of course it always has a perent. The question is which parent
it should be. :-)
Almosts always the correct choice is the physical
bridge/controller for the bus the flash sits on.
Quoted 6 lines
Quoted 2 lines
That is described in the "reg" property of the flash node, just like for any other node.
Ah. So simple. :-)
What I failed to realize so far was that "ranges" imply 1:1 address
correspondence. But not all is so simple, I'm afraid. The flash chips themselves could be connected to their bus in some weird fashion, I'm afraid
In that case it is not direct-mapped, you have no "ranges" in the parent node, and the kernel driver for the parent node will know how to access its child bus.
Quoted 4 lines
Quoted 1 line
It seems we really need more howto-style docs...
It may indeed be non-trivial task to find all the necessary specs
besides 1285 itself -- I just happened to know where to grab them beforehand:
1275
Quoted 1 line
There is only a subset there. http://playground.sun.com/1275/
is the canonical location; there is a bunch of good docs in the Sun library thing too (search for "FCode" or "OpenBoot"). Much of that has to do with using real OF, but lots of it is valid/useful for a bare device tree as well.
Segher
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
This has nothing to do with a "chip level", it is plain and simply the most basic device tree stuff.
If it was as "plain and simple" as you say, there would be
nothing to argue about.
Quoted 6 lines
Quoted 3 lines
There isn't as far as I am concerned; the purpose and meaning of the "compatible" property, as well as of any other standard OF properties, is clear.
Erm, concerning matching those with drivers it wasn't as clear that
those props aren't the same as driver names b/c of the follwing passage in Generic Names:
[huge snip]
Please point out the exact passage you don't understand, and what you don't understand about it, if you want any help.
Quoted 5 lines
Quoted 4 lines
Yes, the more complex (and sometimes insane) ways that flash chips are connected to systems can be really hard to describe properly. Which is why I don't even want to make a "binding" for it (yet). It seems easy enough
Quoted 7 lines
Neither do we. :-)
Quoted 2 lines
to do this for single flash chips (possibly direct-mapped) though.
Erm, FSL boards seem to generally have dual 16-bit NOR flash chips
interleaved -- and that's seems quite a common case, not only in PPC world.
It's not all that common; I can see why it would be used on flash controllers that handle a 32-bit bus only.
Quoted 2 lines
Perhaps... those interleaved chips could really be merged
(abstracted) into a single one, with the bus width being a sum of two?
Perhaps. It is a nasty situation, it'll take long hard thinking to come up with a reasonably good solution.
Quoted 4 lines
Quoted 2 lines
Get the simple cases
(that actually are used in real life) right, first.We pursued this task exactly. Get it working, quick. :-)
That is something *TOTALLY DIFFERENT* and quite a bad plan IMNSHO.
Segher
Quoted 2 lines
Regarding physical address ranges for the flash mapping, I suppose the best is to define a property for flash chips for it.
There is, namely "reg". How to best describe flash chips interleaved on the bus is still an open problem. And things like combining two sequential in address space flash chips into a virtual one, or describing flash "partitions" doesn't belong in the device tree at all; it is a policy thing, not a hardware thing.
Segher
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
the CFI/JEDEC interface then can be deduced by probing
Most of the time, sure. Not always.
That's the way the cookie crumbles in Linux MTD for now. It's
*always* detecting this by probing -- you only can say what [not] to probe.So you are saying that because the current linux MTD stuff can only probe (which doesn't always work), we should not put the proper chip interface type in the device-tree ?
No. But if/when we put it, it'll only be able to influence interface
probing, but not "force" the interface.
Quoted 1 line
Your argument makes no sense to me.
As I said, that's the way the cookie crumbles.
Quoted 4 lines
Put the proper interface informations in the device-tree, maybe some OS smarter than linux will make good use on it and maybe linux will be fixed at one point too (not by you, of course, you gave us that line often enough about not being paid to do the right thing).
The money was not the only factor, you know, I was under the pressure of
schedules, and had a lot more things to do.
Quoted 1 line
Ben.
WBR, Sergei
Hello.
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 4 lines
No, it doesn't -- since that info is almost *absolutely* useless
(the only exception is "cfi") in the context of Linux MTD subsys.
Please, try to understand that knowing that chip is CFI compatible in
itself doesn't yet guarantee that you can access the chip -- it all depends on its mapping to the real physical address range, therefore this group IMO cannot even constitute a valid "compatible" property.You make no sense to me. It's like saying that knowing that a 8250 chip on ISA cannot be accessed if you don't know it's IO ports so it shouldn't say "8250" in compatible property ?!?!?!?
No, it's a completely different case. Base address and even flash size
are not the only things that matter. There's bus width and interleave factors that influence the access (and possibly, byte-swapping too, although this is unlikely to happen in PPC world).
Quoted 7 lines
Also, whatever shortcomings of the linux MTD drivers are totally irrelevant to what is correct to have in a device-tree. While we do tailor our device-tree specification around linux needs in most cases, there are cases like this one where common sense should be enough to understand that it's not because the linux MTD subsystem, as of today, cannot be told what programming interface to use, that we shouldn't provide that information in the tree.
We did provide it, in the form of probing hints ("probe-type" prop).
Quoted 2 lines
Regarding physical address ranges for the flash mapping, I suppose the best is to define a property for flash chips for it.
Flash chips in themselves have little to do with how they are mapped to
the physical address space (considers the interleave factor), so that doesn't seem a practical idea.
WBR, Sergei
Hello.
Quoted 9 lines · Segher Boessenkool
Quoted 2 lines
Regarding physical address ranges for the flash mapping, I suppose the best is to define a property for flash chips for it.
There is, namely "reg". How to best describe flash chips interleaved on the bus is still an open problem. And things like combining two sequential in address space flash chips into a virtual one, or describing flash "partitions" doesn't belong in the device tree at all; it is a policy thing, not a hardware thing.
Gah, it's becoming worse and worse...
While I would agree with that argument, not having flash partition table
in the device tree makes things even more ugly -- as we *already* can't use platform device to pass that info, we'll have to either force the user to supply that via the kernel option, or add more kludgery to Linux/MTD. :-/
Quoted 1 line
Segher
WBR, Sergei
Hello.
Quoted 10 lines · Segher Boessenkool
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
This has nothing to do with a "chip level", it is plain and simply the most basic device tree stuff.
If it was as "plain and simple" as you say, there would be
nothing to argue about.There isn't as far as I am concerned; the purpose and meaning of the "compatible" property, as well as of any other standard OF properties, is clear.
Quoted 7 lines
Quoted 2 lines
Erm, concerning matching those with drivers it wasn't as clear that
those props aren't the same as driver names b/c of the follwing passage in Generic Names:[huge snip]
Please point out the exact passage you don't understand, and what you don't understand about it, if you want any help.
Ah, nevermind... It was too late in the Sunday evening. :-)
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Yes, the more complex (and sometimes insane) ways that flash chips are connected to systems can be really hard to describe properly. Which is why I don't even want to make a "binding" for it (yet). It seems easy enough
Neither do we. :-)
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
to do this for single flash chips (possibly direct-mapped) though.
Erm, FSL boards seem to generally have dual 16-bit NOR flash chips
interleaved -- and that's seems quite a common case, not only in PPC world.It's not all that common; I can see why it would be used on flash controllers that handle a 32-bit bus only.
OK, maybe it's just we, embedded guys, that comes to see only such cheapo
boards. :-)
Quoted 5 lines
Quoted 2 lines
Perhaps... those interleaved chips could really be merged
(abstracted) into a single one, with the bus width being a sum of two?Perhaps. It is a nasty situation, it'll take long hard thinking to come up with a reasonably good solution.
I hoped to get some hints from the linux-mtd list as well...
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Get the simple cases
(that actually are used in real life) right, first.We pursued this task exactly. Get it working, quick. :-)
That is something *TOTALLY DIFFERENT* and quite a bad plan IMNSHO.
I haven't considered 2 inteleaved 16-bit CFI NOR flashes a complex case so
far, sorry. :-) And that's what I had on my board. Prior to my acquaintance with the device trees, this was indeed a no-brainer. :-)
Quoted 1 line
Segher
WBR, Sergei
Quoted 6 lines
Quoted 3 lines
So you are saying that because the current linux MTD stuff can only probe (which doesn't always work), we should not put the proper chip interface type in the device-tree ?
No. But if/when we put it, it'll only be able to influence
interface probing, but not "force" the interface.
Of course it can; that just means you have to fix MTD and/or the way your platform calls MTD.
Quoted 2 lines
The money was not the only factor, you know, I was under the
pressure of schedules, and had a lot more things to do.
The bigger Linux community does not (and should not) care about your corporate schedules. Your patches won't be merged upstream until they are deemed to be of acceptable quality. If that doesn't fit your employer's schedule, well tough luck, they can maintain their own kernel fork I'm sure?
Segher
Quoted 8 lines · Segher Boessenkool
Quoted 6 lines
Quoted 3 lines
So you are saying that because the current linux MTD stuff can only probe (which doesn't always work), we should not put the proper chip interface type in the device-tree ?
No. But if/when we put it, it'll only be able to influence
interface probing, but not "force" the interface.Of course it can; that just means you have to fix MTD
I wouldn't call this a fix, more like an additional feature. Probing has
worked well enough.
Quoted 1 line
and/or the way your platform calls MTD.
The platform code is not supposed to call MTD *at all*. The only expeption
so far are physmap_configure() and physmap_set_partitions() which are both considered obsolete (in favor of platform device). Maybe linux-mtd people will correct me though...
Quoted 9 lines
Quoted 2 lines
The money was not the only factor, you know, I was under the
pressure of schedules, and had a lot more things to do.The bigger Linux community does not (and should not) care about your corporate schedules. Your patches won't be merged upstream until they are deemed to be of acceptable quality. If that doesn't fit your employer's schedule, well tough luck, they can maintain their own kernel fork I'm sure?
But the driver have been nevertheless merged. Moreover, the it was one of
the MTD maintainers who expressed desire for partition info to be kept with device node in the first place.
Quoted 1 line
Segher
WBR, Sergei
Quoted 6 lines
Quoted 3 lines
You make no sense to me. It's like saying that knowing that a 8250 chip on ISA cannot be accessed if you don't know it's IO ports so it shouldn't say "8250" in compatible property ?!?!?!?
No, it's a completely different case. Base address and even flash
size are not the only things that matter. There's bus width
Bus width is an (inherent) property of the _parent_ node. Device width is normally equal to that, and if not, it is obvious from the device model.
Also, you need to know if the devices are byte-addressable or only per natural unit; and even more importantly, the same question for the flash bus.
Quoted 1 line
and interleave factors
Not a property of the flash chips really.
Quoted 1 line
that influence the access (and possibly, byte-swapping too, although this is unlikely to happen in PPC world).
Byte swapping? 1) This should _never_ be necessary, just swap the data on the device itself, duh; 2) more likely this would be determined by the flash bus, not per flash device.
And, 3) why would you want to include this in the flash binding while we don't yet have a reasonable overview of in what circumstances byte swap is needed/used?
Quoted 9 lines
Quoted 7 lines
Also, whatever shortcomings of the linux MTD drivers are totally irrelevant to what is correct to have in a device-tree. While we do tailor our device-tree specification around linux needs in most cases, there are cases like this one where common sense should be enough to understand that it's not because the linux MTD subsystem, as of today, cannot be told what programming interface to use, that we shouldn't provide that information in the tree.
We did provide it, in the form of probing hints ("probe-type" prop).
Which is 103% redundant. That same information (and more!) is required in the "compatible" property, already.
Segher
Quoted 10 lines · Segher Boessenkool
Quoted 6 lines
Quoted 3 lines
You make no sense to me. It's like saying that knowing that a 8250 chip on ISA cannot be accessed if you don't know it's IO ports so it shouldn't say "8250" in compatible property ?!?!?!?
No, it's a completely different case. Base address and even flash
size are not the only things that matter. There's bus widthBus width is an (inherent) property of the _parent_ node. Device width is normally equal to that, and if not, it is obvious from the device model.
Eh... obvious? From the bus controller node? Maybe and maybe not. Those
are seem to be generally multifuntional and so don't have their "chip selects" fixed to some kind of interface, i.e. it's selectable, as well as the bus width even... at least it's so in my case (and nevertheless, the board has interleaved flash, so it's not a matter of a bus width fixed to 32 bits as you can see).
Quoted 7 lines
Also, you need to know if the devices are byte-addressable or only per natural unit; and even more importantly, the same question for the flash bus.
Quoted 1 line
and interleave factors
Not a property of the flash chips really.
Who said it is?
Quoted 4 lines
Quoted 1 line
that influence the access (and possibly, byte-swapping too, although this is unlikely to happen in PPC world).
Byte swapping? 1) This should _never_ be necessary, just swap the data on the device itself, duh;
Oh, I'm afraid that's only wishful thinking after having some real life
experience in bi-endian world. Luckily, the PPC world seems to be (at least mostly) big-endian.
Quoted 2 lines
2) more likely this would be determined by the flash bus, not per flash device.
Indeed, by wiring the bus pins to flash pins. :-)
Quoted 3 lines
And, 3) why would you want to include this in the flash binding while we don't yet have a reasonable overview of in what circumstances byte swap is needed/used?
This was just a real world example. I do hope PPC would never have to deal
with it, though...
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Also, whatever shortcomings of the linux MTD drivers are totally irrelevant to what is correct to have in a device-tree. While we do tailor our device-tree specification around linux needs in most cases, there are cases like this one where common sense should be enough to understand that it's not because the linux MTD subsystem, as of today, cannot be told what programming interface to use, that we shouldn't provide that information in the tree.
Quoted 4 lines
Quoted 1 line
We did provide it, in the form of probing hints ("probe-type" prop).
Which is 103% redundant. That same information (and more!) is required in the "compatible" property, already.
Yeah, but then we would have needed more than one node -- which I avoided
back then... well, I have cheated and mistaken. :-)
Anyway, the "rom" device node as it appeared in booting-without-of.txt
was based upon suggestions from Linux/MTD maintainer.
Quoted 1 line
Segher
WBR, Sergei
Quoted 7 lines · Milton Miller
Quoted 4 lines · Mark A. Greer
Find the "rom" device for the prpmc2800 and create a device for it. The device will be picked up by the code in
drivers/mtd/maps/physmap_of.c
and will setup MTD on that FLASH device....
Quoted 14 lines
Review
Quoted 12 lines
/*
+ * Register a platform device for MTD.
+ */(quoted diff) +8
-0+static int __init prpmc2800_register_mtd(void) +{ + struct device_node *np; + + np = of_find_compatible_node(NULL, "rom", "direct-mapped"); + of_platform_device_create(np, np->name, NULL); +} +arch_initcall(prpmc2800_register_mtd);I think "direct-mapped" as compatible is a bit too broad or vague.
It is. Basically, all I was trying to do was fit with the code that was already in drivers/mtd/maps/physmap_of.c. I wasn't expecting to (re)trigger the debate that it did. Its a good thing, though. FLASH/MTD representation in the DT needs to get sorted out.
Quoted 4 lines
The compatible is supposed to be useable to find and match a driver without regard to the name of the node. Perhaps direct-mapped-rom? (as opossed to a direct-mapped-ram, sram, or some width flash bank).
Quoted 8 lines
Actually, looking back at your device tree {1], your list several properties for flash, including bank-width and partition names. Perhaps first compatible should be direct-mapped-partitioned-flash, direct-mapped-partitioned-rom, direct-mapped-rom (to me a direct-mapped-rom driver would expose one section of address space read-only). I'm assuming that your driver for this "direct-mapped" device will look at these properties from the of device node and call the mtd layer somewhat directly with their contents.
The "driver" is already there, drivers/mtd/maps/physmap_of.c. I conjured up the DT node so it would work with that existing driver.
Quoted 2 lines
PS: I know you've posted this a few times. I'm just behind in my reading and replying :-).
No problem. I just missed an entire thread the was directed at me :-P
Mark
Quoted 3 lines · Sergei Shtylyov
That's the way the cookie crumbles in Linux MTD for now. It's
*always* detecting this by probing -- you only can say what [not] to probe.
You could hook it up to the chip drivers directly if you want, and bypass the probe code. I'm not sure it's worth it.
Signature · 1 line
dwmw2
Quoted 10 lines · Benjamin Herrenschmidt
So you are saying that because the current linux MTD stuff can only probe (which doesn't always work), we should not put the proper chip interface type in the device-tree ?
Your argument makes no sense to me.
Put the proper interface informations in the device-tree, maybe some OS smarter than linux will make good use on it and maybe linux will be fixed at one point too (not by you, of course, you gave us that line often enough about not being paid to do the right thing).
In general, Linux is doing the right thing by probing.
There are two major command sets for NOR flash -- the Intel/Sharp command set, and the AMD/Fujitsu command set.
There are also two major ways to detect flash chips -- the JEDEC probe with magic numbers for mfr/chip ident, and the CFI ('Common Flash Interface') probe which gets you tables of information about the chip, including what optional command set extensions it has, etc.
You _can_ bypass the probe and pass straight through to the 'back-end' chip driver. But unless you provide the CFI information you won't get to use any of the optional chip features (or blacklist some of the known-broken features). It doesn't make a lot of sense to try using the back-end chip drivers directly. Just go through the normal probe process, really.
If you really want to bypass the probe, then I suspect you want the full CFI tables to be present in your OF properties.
Signature · 1 line
dwmw2
Quoted 2 lines · Sergei Shtylyov
Erm, FSL boards seem to generally have dual 16-bit NOR flash chips
interleaved -- and that's seems quite a common case, not only in PPC world.
Yes, it's something we've seen quite frequently. It's a common way of improving read/write/erase speed.
Quoted 2 lines
Perhaps... those interleaved chips could really be merged (abstracted)
into a single one, with the bus width being a sum of two?
That's how Linux deals with it, as I'm sure you're aware. Other operating systems do likewise. If two 'separate' flash chips hold alternate bytes of a given address range, you really don't gain much by representing them as two separate devices to the system.
Any representation of flash devices in the device-tree should ideally have 'bus width' and 'interleave' properties to contain this information.
The 'bus width' cannot necessarily be inferred, especially where a given bus can be configured to allow multiple sizes of access. It's purely a function of how the flash chips are wired up. That's why we actually call it 'bank width', not 'bus width' in the Linux code.
Signature · 1 line
dwmw2
Quoted 6 lines
Quoted 3 lines
That's the way the cookie crumbles in Linux MTD for now. It's
*always* detecting this by probing -- you only can say what [not] to probe.You could hook it up to the chip drivers directly if you want, and bypass the probe code. I'm not sure it's worth it.
In most cases it is probably not worth it. It is good to hear that the option to bypass the probe if needed is available though.
Segher
Quoted 6 lines
Quoted 4 lines
Put the proper interface informations in the device-tree, maybe some OS smarter than linux will make good use on it and maybe linux will be fixed at one point too (not by you, of course, you gave us that line often enough about not being paid to do the right thing).
In general, Linux is doing the right thing by probing.
Compare to PCI. After Linux has found out how to drive a PHB from the device tree, it can detect the whole PCI tree on its own. The device tree can still be used to find out special things about the devices (interrupt routing, ...) or to change some of the probing algorithm (in the case of hardware bugs, for example).
Now with NOR flash, the situation is analogue. The device tree tells Linux how to drive the flash bus controller, and certain things about that bus (width, for example). It also should tell Linux what kind of devices are on that bus (CFI, ...). Linux can do its own probes then, or it can use the device tree for special cases.
Quoted 5 lines
There are two major command sets for NOR flash -- the Intel/Sharp command set, and the AMD/Fujitsu command set.
There are also two major ways to detect flash chips -- the JEDEC probe with magic numbers for mfr/chip ident,
A heuristic, but it's been worked out well enough over the years that it is pretty reliable now.
Quoted 3 lines
and the CFI ('Common Flash
Interface') probe which gets you tables of information about the chip, including what optional command set extensions it has, etc.
But it only is 100% reliable _if_ you already know the chip is CFI compatible.
Quoted 6 lines
You _can_ bypass the probe and pass straight through to the 'back-end' chip driver. But unless you provide the CFI information you won't get to use any of the optional chip features (or blacklist some of the known-broken features). It doesn't make a lot of sense to try using the back-end chip drivers directly. Just go through the normal probe process, really.
Just don't do any heuristic probes ("just try if something's there", etc.) -- using the CFI probe algorithm on a flash device that the device tree tells you is a CFI device should be just fine, certainly.
Quoted 2 lines
If you really want to bypass the probe, then I suspect you want the full CFI tables to be present in your OF properties.
I never saw how that kind of info is useful for the OS to have in the device tree -- if the OS can use the device at all, it can get that info straight from the device easy enough.
Segher
Quoted 8 lines
Any representation of flash devices in the device-tree should ideally have 'bus width' and 'interleave' properties to contain this information.
The 'bus width' cannot necessarily be inferred, especially where a given bus can be configured to allow multiple sizes of access. It's purely a function of how the flash chips are wired up. That's why we actually call it 'bank width', not 'bus width' in the Linux code.
Ah, "bank width" as in "bus width" per chip select. I see.
So I think the best thing to have would be
compatible "cfi-flash" bank-width like you said device-width width of a single flash device reg complete address range of this thing
and then the Linux OF CFI flash code / MTD code just keeps on probing devices from that address range until it has it filled.
Sounds good / comments / anything I missed?
Segher
Quoted 19 lines · Segher Boessenkool
Quoted 9 lines
Any representation of flash devices in the device-tree should ideally have 'bus width' and 'interleave' properties to contain this information.
The 'bus width' cannot necessarily be inferred, especially where a given
bus can be configured to allow multiple sizes of access. It's purely a function of how the flash chips are wired up. That's why we actually call it 'bank width', not 'bus width' in the Linux code.Ah, "bank width" as in "bus width" per chip select. I see.
So I think the best thing to have would be
compatible "cfi-flash" bank-width like you said device-width width of a single flash device reg complete address range of this thing
Quoted 5 lines
and then the Linux OF CFI flash code / MTD code just keeps on probing devices from that address range until it has it filled.
Sounds good / comments / anything I missed?
That seems reasonable. I would personally have used 'interleave' to give the number of devices interleaved together into the specified bank-width, rather than specifying device-width. People might get confused by device-width because many devices can actually be _either_ x16 or x8. But I don't care much. Linux will only be using the bank-width anyway.
The other thing that might be seen in the 'compatible' property would be 'jedec-flash', and in that case perhaps we also want properties for the manufacturer and device ident? Linux wouldn't necessarily care about them, but other operating systems might.
And we also need partition information to get through somehow, in the cases where the firmware knows it.
Signature · 1 line
dwmw2
Quoted 11 lines
Quoted 11 lines
So I think the best thing to have would be
compatible "cfi-flash" bank-width like you said device-width width of a single flash device reg complete address range of this thingand then the Linux OF CFI flash code / MTD code just keeps on probing devices from that address range until it has it filled.
Quoted 5 lines
Quoted 1 line
Sounds good / comments / anything I missed?
That seems reasonable. I would personally have used 'interleave' to give the number of devices interleaved together into the specified bank-width, rather than specifying device-width.
I think "device-width" is much clearer -- from the name "interleave" you cannot tell that it actually means "number-of-interleaved-devices-in-this-bank".
Quoted 3 lines
People might get
confused by device-width because many devices can actually be _either_ x16 or x8.
Well after it has been soldered down to the board, it's pretty much fixed what the device's bus width is ;-)
Quoted 2 lines
But I don't care much. Linux will only be using the bank-width anyway.
So it can reliably detect interleaving itself?
I'd like "device-width" to be a required property still, for the benefit of non-Linux device tree users, or just in case.
Quoted 2 lines
The other thing that might be seen in the 'compatible' property would be 'jedec-flash',
I don't want to deal with that yet, one thing at a time, and CFI flash it is now. JEDEC is a bit hairier.
Quoted 2 lines
and in that case perhaps we also want properties for the manufacturer and device ident?
Certainly, since they cannot be reliably probed.
Quoted 5 lines
Linux wouldn't necessarily care about
them, but other operating systems might.And we also need partition information to get through somehow, in the cases where the firmware knows it.
A child node per partition I suppose, dunno.
Segher
Quoted 19 lines · Segher Boessenkool
Quoted 9 lines
Any representation of flash devices in the device-tree should ideally have 'bus width' and 'interleave' properties to contain this information.
The 'bus width' cannot necessarily be inferred, especially where a given
bus can be configured to allow multiple sizes of access. It's purely a function of how the flash chips are wired up. That's why we actually call it 'bank width', not 'bus width' in the Linux code.Ah, "bank width" as in "bus width" per chip select. I see.
So I think the best thing to have would be
compatible "cfi-flash" bank-width like you said device-width width of a single flash device reg complete address range of this thing
Quoted 5 lines
and then the Linux OF CFI flash code / MTD code just keeps on probing devices from that address range until it has it filled.
Sounds good / comments / anything I missed?
Looks pretty sensible to me. Presumably the compatible property could also have more specific entries for the particular chip type.
Of course, Ebony has flash which is JEDEC rather than CFI probed, so I have an interest in a binding for that, too.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 7 lines
Quoted 7 lines
So I think the best thing to have would be
compatible "cfi-flash" bank-width like you said device-width width of a single flash device reg complete address range of this thing
Quoted 7 lines
Quoted 5 lines
and then the Linux OF CFI flash code / MTD code just keeps on probing devices from that address range until it has it filled.
Sounds good / comments / anything I missed?
Looks pretty sensible to me.
Great!
Quoted 2 lines
Presumably the compatible property could
also have more specific entries for the particular chip type.
Yes, of course.
Quoted 2 lines
Of course, Ebony has flash which is JEDEC rather than CFI probed, so I have an interest in a binding for that, too.
For JEDEC flash, you probably want extra properties for manufacturing ID and chip ID. Also, you need to describe the block sizes in some way (on CFI, this can be probed; on JEDEC, not). Anything else?
Segher
Quoted 22 lines · Segher Boessenkool
Quoted 7 lines
Quoted 7 lines
So I think the best thing to have would be
compatible "cfi-flash" bank-width like you said device-width width of a single flash device reg complete address range of this thingQuoted 7 lines
Quoted 5 lines
and then the Linux OF CFI flash code / MTD code just keeps on probing devices from that address range until it has it filled.
Sounds good / comments / anything I missed?
Looks pretty sensible to me.
Great!
Quoted 2 lines
Presumably the compatible property could
also have more specific entries for the particular chip type.Yes, of course.
Quoted 7 lines
Quoted 2 lines
Of course, Ebony has flash which is JEDEC rather than CFI probed, so I have an interest in a binding for that, too.
For JEDEC flash, you probably want extra properties for manufacturing ID and chip ID. Also, you need to describe the block sizes in some way (on CFI, this can be probed; on JEDEC, not). Anything else?
Hrm. At the moment it appears to work without supplying this information for the Ebony flash... I wonder if there are defaults in the mtd layer or something.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 11 lines
Quoted 7 lines
Quoted 2 lines
Of course, Ebony has flash which is JEDEC rather than CFI probed, so I have an interest in a binding for that, too.
For JEDEC flash, you probably want extra properties for manufacturing ID and chip ID. Also, you need to describe the block sizes in some way (on CFI, this can be probed; on JEDEC, not). Anything else?
Hrm. At the moment it appears to work without supplying this information for the Ebony flash... I wonder if there are defaults in the mtd layer or something.
MTD does a lot of heuristic probing. It is pretty good, but it would be nice if you could skip that and hand it the exact values it needs. Also, this information should be in the device tree no matter what, even if Linux doesn't use it yet ;-)
Segher
Quoted 13 lines · Segher Boessenkool
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Of course, Ebony has flash which is JEDEC rather than CFI probed, so I
have an interest in a binding for that, too.Quoted 8 lines
Quoted 4 lines
For JEDEC flash, you probably want extra properties for manufacturing ID and chip ID. Also, you need to describe the block sizes in some way (on CFI, this can be probed; on JEDEC, not). Anything else?
Hrm. At the moment it appears to work without supplying this information for the Ebony flash... I wonder if there are defaults in the mtd layer or something.
Quoted 5 lines
MTD does a lot of heuristic probing. It is pretty good, but it would be nice if you could skip that and hand it the exact values it needs. Also, this information should be in the device tree no matter what, even if Linux doesn't use it yet ;-)
I agree. Of course, this means figuring out what the values actually are for Ebony. I presently have no idea, since the heuristic probing appears to work without problem.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 9 lines
Quoted 5 lines
MTD does a lot of heuristic probing. It is pretty good, but it would be nice if you could skip that and hand it the exact values it needs. Also, this information should be in the device tree no matter what, even if Linux doesn't use it yet ;-)
I agree. Of course, this means figuring out what the values actually are for Ebony. I presently have no idea, since the heuristic probing appears to work without problem.
Doesn't it show it in sysfs, or in the dmesg at least? Maybe some other important stuff is there, too.
Segher
Quoted 6 lines · Segher Boessenkool
Quoted 6 lines
Quoted 5 lines
MTD does a lot of heuristic probing. It is pretty good, but it would be nice if you could skip that and hand it the exact values it needs. Also, this information should be in the device tree no matter what, even if Linux doesn't use it yet ;-)
Quoted 6 lines
Quoted 3 lines
I agree. Of course, this means figuring out what the values actually are for Ebony. I presently have no idea, since the heuristic probing appears to work without problem.
Doesn't it show it in sysfs, or in the dmesg at least? Maybe some other important stuff is there, too.
Not as far as I can tell. Only dmesg information I can see is:
1ff800000.large-fla: Found 1 x8 devices at 0x0 in 8-bit bank 1ff800000.large-fla: Found 1 x8 devices at 0x200000 in 8-bit bank number of JEDEC chips: 2cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 19 lines · Segher Boessenkool
Quoted 9 lines
Any representation of flash devices in the device-tree should ideally have 'bus width' and 'interleave' properties to contain this information.
The 'bus width' cannot necessarily be inferred, especially where a given
bus can be configured to allow multiple sizes of access. It's purely a function of how the flash chips are wired up. That's why we actually call it 'bank width', not 'bus width' in the Linux code.Ah, "bank width" as in "bus width" per chip select. I see.
So I think the best thing to have would be
compatible "cfi-flash" bank-width like you said device-width width of a single flash device reg complete address range of this thing
Quoted 5 lines
and then the Linux OF CFI flash code / MTD code just keeps on probing devices from that address range until it has it filled.
Sounds good / comments / anything I missed?
Slight revision suggestion. Can we make 'device-width' optional, with the default value being equal to the bank-width?
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Quoted 7 lines
Quoted 7 lines
So I think the best thing to have would be
compatible "cfi-flash" bank-width like you said device-width width of a single flash device reg complete address range of this thing
Quoted 8 lines
Quoted 5 lines
and then the Linux OF CFI flash code / MTD code just keeps on probing devices from that address range until it has it filled.
Sounds good / comments / anything I missed?
Slight revision suggestion. Can we make 'device-width' optional, with the default value being equal to the bank-width?
Yes, certainly. Or, the other way around I like better ("bank-width" optional).
I didn't say all these properties were required anyway, this is still a very rough draft.
Segher
Quoted 2 lines · Segher Boessenkool
Yes, certainly. Or, the other way around I like better ("bank-width" optional).
No, we need bank-width. It's device-width which can be optional.
Signature · 1 line
dwmw2
Quoted 4 lines
Quoted 2 lines
Yes, certainly. Or, the other way around I like better ("bank-width" optional).
No, we need bank-width. It's device-width which can be optional.
One is defaulted to the other so it doesn't really matter _which_ you make optional, the OS device driver can always get both values. For the device tree, it seems more natural to have "device-width" a required property. Feel free to disagree but I'd like to hear arguments if so :-)
Segher
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
I agree. Of course, this means figuring out what the values actually are for Ebony. I presently have no idea, since the heuristic probing appears to work without problem.
Doesn't it show it in sysfs, or in the dmesg at least? Maybe some other important stuff is there, too.
Quoted 7 lines
Not as far as I can tell. Only dmesg information I can see is:
1ff800000.large-fla: Found 1 x8 devices at
0x0in 8-bit bank 1ff800000.large-fla: Found 1 x8 devices at0x200000in 8-bit bank number of JEDEC chips: 2cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
Hrm, nothing in sysfs either?
Anyway, from jedec_probe.c:
cfi->mfr = jedec_read_mfr(map, base, cfi);
cfi->id = jedec_read_id(map, base, cfi);
DEBUG(MTD_DEBUG_LEVEL3,
"Search for id:(%02x %02x) interleave(%d)
type(%d)\n",
cfi->mfr, cfi->id, cfi_interleave(cfi), cfi->device_type);
so you'll could enable some more debugging output.
Or, open the case, look at the chips, and look it up in the big table at the start of that file (or the relevant datasheet).
Segher