CONFIG_GENERIC_PPC32
Quoted 8 lines
Quoted 2 lines · Paul Mackerras
A laudable goal. I like the idea of having each platform selected with a bool rather than just having a single choice of platform.
So how about pushing it into 2_4_devel?
Let's do it first in 2.5, we can backport it once we are satisfied
Quoted 5 lines
Quoted 2 lines
I also agree about the
CONFIG_ALL_PPCname but no-one has ever been able to come up with a better name for the PReP/PMac/CHRP combination.Rather than rename it, eliminate it altogether and replace it with my solution!
Wich is +/- what I'm doing in 2.5 though with some tweaks.
Quoted 4 lines
Quoted 2 lines
However, there are some aspects of the way you have done your
CONFIG_GENERIC_PPC32that I don't like.So can you promise that if I change those to the way you said you'll
accept my
Quoted 1 line
patch into 2_4_devel? Without that there is no incentive for me to do
any more
Quoted 1 line
work.
Don't be in so much hurry ;) And things can be discussed, even with paulus who is far from beeing a dictator :)
Leave me some time, I hope next week-end, I'll have everything done in bk 2.5 for pmac/chrp/prep. Then we can see what to do, keep, change, merge, whatever.
Quoted 11 lines
Quoted 8 lines
In particular I don't like
the list of ifdefs insetup.c. Whenever that sort of thing appears it is a sign that we need to rethink how we do things. The olddrivers/net/Space.cwas a classic example, and it was a mistake and it basically became unmaintainable. Fortunately we have better ways to handle that sort of thing these days. In particular we can use ELF sections in creative ways to make lists of things without having to have strings of ifdefs.I guess I could try to do that with ELF sections, but see above about incentive.
I'll do ELF sections in 2.5
Quoted 14 lines
Quoted 8 lines
The other thing I don't like is the
bi_recchanges. While I like the idea of passing in device information inbi_recs, I really don't like the use of binary tags for the various specific pieces of information that we want to specify for the different devices. This is ultimately once again a maintainability concern. Using an enumeration like that basically forces us into having a central repository for assigning the numbers and that is going to get us into problems down the track.Quoted 5 lines
Instead I think that both the names of the pieces of information, and the values of things like the device type, should be represented as strings. Using strings just gives us orders of magnitude more flexibility and extensibility, and is much more suitable for the sort of decentralized and distributed development that we do.
Quoted 3 lines
But this is not how
bi_recswork. Do you want to break compatibility with the existingbi_recs, to add a whole new boot info mechanism independent ofbi_recs, or what? And if I am to implement it, I need to be given some
kind of
Quoted 1 line
spec as to what to implement.
I'll keep bi_rec tags as longs, but I'll add "new" more friendly definitions using 4 byte ASCII, keeping backward compatibility with older ones is easy. We can still change that if we really want.
Quoted 9 lines
Quoted 6 lines
About the
early_serial_initchanges - usingearly_serial_initis nice when the serial driver is built in, but the problem is that when the serial driver is a module, we don't get given the opportunity to do theearly_serial_initcalls between when the module is loaded and when it runsrs_init. Otherwise I would have decreed the use ofearly_serial_initsome time ago. :)On all machines I've supported so far one of the system serial ports that are supported in this manner is the system console and the serial driver
therefore
Quoted 3 lines
has to be compiled in anyway. I don't see a problem with making a requirement that the serial driver be compiled in for
CONFIG_GENERIC_PPC32. After all, we are not dealing with a PeeCee where the serial ports are an auxiliary
feature,
Quoted 2 lines
we are dealing with real computers where the system serial ports are central system resources like on a VAX.
Well.. you forget pmac here ;)
The problem is that pmac has it's own serial HW with a different driver, but still may need serial.o for PCI serial cards or pcmcia modems.
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 2 lines · Paul Mackerras
A laudable goal. I like the idea of having each platform selected with a bool rather than just having a single choice of platform.
So how about pushing it into 2_4_devel?
Quoted 2 lines
I also agree about the
CONFIG_ALL_PPCname but no-one has ever been able to come up with a better name for the PReP/PMac/CHRP combination.
Rather than rename it, eliminate it altogether and replace it with my solution!
Quoted 2 lines
However, there are some aspects of the way you have done your
CONFIG_GENERIC_PPC32that I don't like.
So can you promise that if I change those to the way you said you'll accept my patch into 2_4_devel? Without that there is no incentive for me to do any more work.
Quoted 8 lines
In particular I don't like
the list of ifdefs insetup.c. Whenever that sort of thing appears it is a sign that we need to rethink how we do things. The olddrivers/net/Space.cwas a classic example, and it was a mistake and it basically became unmaintainable. Fortunately we have better ways to handle that sort of thing these days. In particular we can use ELF sections in creative ways to make lists of things without having to have strings of ifdefs.
I guess I could try to do that with ELF sections, but see above about incentive.
Quoted 8 lines
The other thing I don't like is the
bi_recchanges. While I like the idea of passing in device information inbi_recs, I really don't like the use of binary tags for the various specific pieces of information that we want to specify for the different devices. This is ultimately once again a maintainability concern. Using an enumeration like that basically forces us into having a central repository for assigning the numbers and that is going to get us into problems down the track.
Quoted 5 lines
Instead I think that both the names of the pieces of information, and the values of things like the device type, should be represented as strings. Using strings just gives us orders of magnitude more flexibility and extensibility, and is much more suitable for the sort of decentralized and distributed development that we do.
But this is not how bi_recs work. Do you want to break compatibility with the existing bi_recs, to add a whole new boot info mechanism independent of bi_recs, or what? And if I am to implement it, I need to be given some kind of spec as to what to implement.
Quoted 6 lines
About the
early_serial_initchanges - usingearly_serial_initis nice when the serial driver is built in, but the problem is that when the serial driver is a module, we don't get given the opportunity to do theearly_serial_initcalls between when the module is loaded and when it runsrs_init. Otherwise I would have decreed the use ofearly_serial_initsome time ago. :)
On all machines I've supported so far one of the system serial ports that are supported in this manner is the system console and the serial driver therefore has to be compiled in anyway. I don't see a problem with making a requirement that the serial driver be compiled in for CONFIG_GENERIC_PPC32. After all, we are not dealing with a PeeCee where the serial ports are an auxiliary feature, we are dealing with real computers where the system serial ports are central system resources like on a VAX.
For other hardware with similar problems but where it's unreasonable to require compiling the driver in there are other solutions. Look for example what I did for GT-64260 Ethernet in 2_4_alt. It's much like serial in that there is a generic driver, the device is fairly peripheral and should be supported as a module (even though it currently isn't, but never mind), but the driver needs certain info that has to be provided by the board ports. There I have a table like rs_table called gt64260_eth_config which itself lives not in the gt64260_eth driver, but in arch/ppc/kernel/gt64260_data.c. This table is therefore always present whether the gt64260_eth driver is present or not, and it is always filled in by <board>_setup_arch. Then when/if the gt64260_eth driver initializes, whether compiled-in or as a module, it uses the info in that table that must be in the kernel.
MS
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 6 lines · Michael Sokolov
Quoted 2 lines · Paul Mackerras
A laudable goal. I like the idea of having each platform selected with a bool rather than just having a single choice of platform.
So how about pushing it into 2_4_devel?
When you say push "it" are you referring to all of your changes or just the CONFIG_GENERIC_PPC32 stuff?
If you are including the changes you made to arch/ppc/kernel/gt64269* and arch/ppc/platforms/ev64260*, then I have some issues. From what I can tell, it looks like you moved much of the init functionality that was in gt64260_common and put it into ev64260_pci.c, et. al., and got rid of the "library" routines in gt64260_common.
IMO, this is a large step backwards. The purpose of all the arch/ppc/*_common files is to provide a "library" for each bridge. They aren't perfect and one of my TODO item over the next few months is to improve all of them but they provide common code that initializes and supports that particular bridge. Having these files have played a large part in making ports to systems with MPC106/107/824x chips, for example, much simpler and much faster. That is the purpose of gt64260_common.c but you just deleted it and put that code in a non-reusable, board-specific file.
Again, this is a separate issue from the common kernel issue and bi_recs.
As far as bi_rec's are concerned, I'm waiting to see what benh produces and then apply it to the gt/ev code (assuming Ben's patch is accepted).
Mark
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 13 lines
I think there are two tenable positions: the first is to have very simple
bi_recs, i.e. basically what we have at the moment, that convey a small number of global pieces of information about the system. If we really need to convey information about individual devices then I think we want something approaching the OF device tree, which is a flexible and extensible structure that conveys arbitrary information about the devices and their relationships very well. So the second position is to encode information about devices as a set of properties, each of which has a string name and a value which is an array of bytes. In this case we would probably have onebi_recper device. Ideally we would also have parent/child/sibling pointers for each device as well.
I started with something like that, then went back to something a lot more simple in my experiments here. The fact is that, at least on embedded, most devices are already self-describing. In a lot of cases, you don't need any additional informations about a device but what the PCI bus probe already provides.
Which is why I did my "BI_DEVICE" thing the other way around: Keep the flat bi_recs, add an arbitrary number of "BI_DEVICE" records, that contain a set of optional informations for a given device along with whatever is needed to actually locate this device. The location part has to be more or less normalized though, at least for known bus types like PCI. This is the role of the BI_DEV_TYPE and BI_DEV_ID sub-records.
Now, either using names or 4-char-codes for identifying those sub-records is mostly a matter of taste. I tend to like 4-char-codes as they are more efficient to process, more compact, more easy to store in flattened out structures without dealing with pointers, while still very readable, but if you want to go the string way, then let's do this.
The only case I see for which an actual tree of devices makes sense is the interrupt routing (and here again, not in all cases, a hell lot of board can very well cope with a flat interrupt number stored either as a bi_rec for non-PCI devices or in the PCI interrult line register).
In this case, I beleive nothing prevent us to still use bi_recs. Just define the proper BI_DEVICE record for a bridge containing the interrupt map. If the bus type is proprietary enough to make difficult the link betweeen a device and it's parent bridge, then those devices will need a record with a tag (a BI_DEV_PARENT_TYPE/DEV_PARENT_ID for example) indicating where the parent is.
What I find interesting with that bi_rec scheme is that most of it is optional and any info that is not needed can just be ommited. For example, the generic PCI code can well read interrupts from PCI_INTERRUPT_LINE and only override it with bi_rec provided infos if those exist.
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 4 lines · Michael Sokolov
Quoted 2 lines
A laudable goal. I like the idea of having each platform selected with a bool rather than just having a single choice of platform.
So how about pushing it into 2_4_devel?
When I'm happy with the implementation, sure.
Quoted 6 lines
Quoted 2 lines
However, there are some aspects of the way you have done your
CONFIG_GENERIC_PPC32that I don't like.So can you promise that if I change those to the way you said you'll accept my patch into 2_4_devel? Without that there is no incentive for me to do any more work.
How can I promise to accept code that I haven't yet seen? I can (and do) promise to take a good look at it and seriously consider it, though.
Quoted 10 lines
Quoted 5 lines
Instead I think that both the names of the pieces of information, and the values of things like the device type, should be represented as strings. Using strings just gives us orders of magnitude more flexibility and extensibility, and is much more suitable for the sort of decentralized and distributed development that we do.
But this is not how
bi_recswork. Do you want to break compatibility with the existingbi_recs, to add a whole new boot info mechanism independent ofbi_recs, or what? And if I am to implement it, I need to be given some kind of spec as to what to implement.
I think there are two tenable positions: the first is to have very simple bi_recs, i.e. basically what we have at the moment, that convey a small number of global pieces of information about the system. If we really need to convey information about individual devices then I think we want something approaching the OF device tree, which is a flexible and extensible structure that conveys arbitrary information about the devices and their relationships very well. So the second position is to encode information about devices as a set of properties, each of which has a string name and a value which is an array of bytes. In this case we would probably have one bi_rec per device. Ideally we would also have parent/child/sibling pointers for each device as well.
Quoted 7 lines
On all machines I've supported so far one of the system serial ports that are supported in this manner is the system console and the serial driver therefore has to be compiled in anyway. I don't see a problem with making a requirement that the serial driver be compiled in for
CONFIG_GENERIC_PPC32. After all, we are not dealing with a PeeCee where the serial ports are an auxiliary feature, we are dealing with real computers where the system serial ports are central system resources like on a VAX.
Except on a powermac, as Ben has pointed out in another message.
One solution to the problem of the serial driver as a module is to have the serial.o module have an empty rs_table (so it assumes no ports when it loads), and then have a ppc_serial module which does whatever magic is needed to find out about the serial ports on the system and calls register_serial for each one.
Paul.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 3 lines · Paul Mackerras
Quoted 1 line
So how about pushing it into 2_4_devel?
When I'm happy with the implementation, sure.
OK, so let's review that's left to be done in order to get there: eliminate the per-machine lines from setup.c and replace them with ELF section magic, settle the bi_recs issue, and serial stuff. Did I miss anything else?
Now the extra bi_recs I've added in 2_4_alt are currently only used by my GT-64260 stuff, which I see will take its own mortal battle, and just the CONFIG_GENERIC_PPC32 framework without the GT-64260 stuff can do without them. So perhaps we could get CONFIG_GENERIC_PPC32 into 2_4_devel just like this, I'll do the ELF section magic and address the serial concerns below, but without touching bi_recs at all for now?
Quoted 3 lines
I think there are two tenable positions: the first is to have very simple
bi_recs, i.e. basically what we have at the moment, that convey a small number of global pieces of information about the system.
This is what I prefer.
Quoted 5 lines
If
we really need to convey information about individual devices then I think we want something approaching the OF device tree, which is a flexible and extensible structure that conveys arbitrary information about the devices and their relationships very well.
Well, since you like OF and you are the Linux/PPC dictator, I think the path of least resistance to getting HEC machines supported by Linux/PPC would be for me to construct a real OF device tree and pass it to Linux. Now it would be a lot easier for me to just pass you a static tree rather than pass you a "PROM" pointer in R5 for you to call to construct it. Would you accept a patch that allows the entire OF device tree to be passed to the kernel in a single bi_rec? I'm not going to rip out the prom_init code, I'll just make it skip over that if the device tree has been passed in a bi_rec, effectively giving the user two ways to get the OF device tree. Would that be acceptable for 2_4_devel?
And where can I find a spec for the OF device tree and a few examples?
Quoted 3 lines
One solution to the problem of the serial driver as a module is to have the serial.o module have an empty
rs_table(so it assumes no ports when it loads),
This is exactly what will happen in 2_4_alt if you build the serial driver as a module for CONFIG_GENERIC_PPC32.
Quoted 3 lines
and then have a
ppc_serialmodule which does
whatever magic is needed to find out about the serial ports on the system and callsregister_serialfor each one.
How about making it prepchrp_serial instead? I would say that only a few systems would want that and it shouldn't be imposed on the rest of the PPC world. PMacs wouldn't need anything in rs_table at all, as they have no built-in NS16550 serial ports, the ISA serial port definitions currently given by <asm/serial.h> for CONFIG_ALL_PPC are for PReP and CHRP. And for all the systems I'm working with the point is moot as the serial driver must be compiled in for the console. So I think having the serial driver as a module and having it access hard-wired serial ports would be a very rare need, perhaps only for PRePs and CHRPs with video consoles. Therefore I would suggest having such a special module only for those rare cases where it's needed, and letting the rest not worry about supporting it.
MS
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 3 lines · Michael Sokolov
So perhaps we could get
CONFIG_GENERIC_PPC32into 2_4_devel just like this, I'll do the ELF section magic and address the serial concerns below, but without touchingbi_recsat all for now?
Since pmac/chrp/prep haven't been ported over to CONFIG_GENERIC_PPC32
what are you planning on moving exactly? You said the GT-64260 work
would be its own 'moral battle' and you don't 'own' K2 and Adirondack anymore either remember...
Quoted 4 lines
Quoted 3 lines
One solution to the problem of the serial driver as a module is to have the serial.o module have an empty
rs_table(so it assumes no ports when it loads),
Quoted 8 lines
This is exactly what will happen in 2_4_alt if you build the serial driver as a module for
CONFIG_GENERIC_PPC32.Quoted 3 lines
and then have a
ppc_serialmodule which does
whatever magic is needed to find out about the serial ports on the system and callsregister_serialfor each one.How about making it
prepchrp_serialinstead?
If I'm reading this thread right, we would always need to do this since we would always give the serial driver an empty table (and have a very terse <asm/serial.h>.
Quoted 5 lines
I would say that only a few
systems would want that and it shouldn't be imposed on the rest of the PPC world. PMacs wouldn't need anything inrs_tableat all, as they have no built-in NS16550 serial ports, the ISA serial port definitions currently given by <asm/serial.h> forCONFIG_ALL_PPCare for PReP and CHRP.
Again, if I'm following Paul correctly, <asm/serial.h> will just setup the space for things and not have any definitions at all for the ports.
Quoted 7 lines
And for all the
systems I'm working with the point is moot as the serial driver must be compiled in for the console. So I think having the serial driver as a module and having it access hard-wired serial ports would be a very rare need, perhaps only for PRePs and CHRPs with video consoles. Therefore I would suggest having such a special module only for those rare cases where it's needed, and letting the rest not worry about supporting it.
I think what we can do is have the code which sets up the serial driver work both when it's in a module and when it's compiled in.
--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 2 lines · Tom Rini
Since pmac/chrp/prep haven't been ported over to
CONFIG_GENERIC_PPC32what are you planning on moving exactly?
I was planning to convert CHRP, PMac, and PReP to CONFIG_GENERIC_PPC32 in 2_4_alt (blindly as I have no hardware to test on, just make it compile), then find some volunteers with the hardware to test the new 2_4_alt, and if it works make a patch for Paulus.
Quoted 2 lines
You said the GT-64260 work
would be its own 'moral battle'
Mortal, not moral.
Quoted 2 lines
and you don't 'own' K2 and Adirondack
anymore either remember...
I'm not going to touch K2 outside of 2_4_alt. I would say Adirondack can be moved to CONFIG_GENERIC_PPC32 as owned or not, the port currently in 2_4_devel does not support any ROM other than StarMON anyway. But I really don't care, I've got it in 2_4_alt to prove my generic config framework, and I couldn't care less what happens to the SBS ports in the public tree as I have no loyalty to them any more.
Quoted 3 lines
If I'm reading this thread right, we would always need to do this since we would always give the serial driver an empty table (and have a very terse <
asm/serial.h>.
We would only need a special ppc_serial module when the serial driver is a module and the machine has hard-wired serial ports. This would be a rare case, on most machines with hard-wired serial ports one of them is the console and the serial driver must be compiled in. Those board ports will simply call early_serial_setup() from <board>_arch_setup as I currently do in 2_4_alt.
Quoted 2 lines
Again, if I'm following Paul correctly, <
asm/serial.h> will just setup the space for things and not have any definitions at all for the ports.
Which is exactly what I have in 2_4_alt right now.
Quoted 2 lines
I think what we can do is have the code which sets up the serial driver work both when it's in a module and when it's compiled in.
Yes, sort of. When you see the implementation you'll see what I mean.
MS
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 10 lines · Michael Sokolov
Quoted 2 lines · Tom Rini
Since pmac/chrp/prep haven't been ported over to
CONFIG_GENERIC_PPC32what are you planning on moving exactly?I was planning to convert CHRP, PMac, and PReP to
CONFIG_GENERIC_PPC32in 2_4_alt (blindly as I have no hardware to test on, just make it compile), then find some volunteers with the hardware to test the new 2_4_alt, and if it works make a patch for Paulus.
Why not let Ben do it in 2.5 like he said?
Quoted 4 lines
Quoted 2 lines
You said the GT-64260 work
would be its own 'moral battle'Mortal, not moral.
Sorry, not yet awake enough I guess.
Yes, and serial as a module doesn't quite work on GENERIC32 either. :)
Quoted 4 lines
Quoted 2 lines
I think what we can do is have the code which sets up the serial driver work both when it's in a module and when it's compiled in.
Yes, sort of. When you see the implementation you'll see what I mean.
No 'sort-of' about it. x_init() calls x_serial_init and sets ppc_md.serial_fixups to x_serial_init. x_serial_init takes care of early_serial_setup() and early_init or so calls ppc_md.serial_fixups (if existant). 'ppc_serial' (built if SERIAL=m) just calls ppc_md.serial_fixups (or setup, or whatever).
Or we do it even more generic than that so that we can add in a hook for all ports to use for using serial as a module & early_serial_setup. (arch_serial_init or somrething?)
--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/