IXP4xx support
Hi,
I'm thinking about adding Barebox support for a certain platform using IXP425 (ARM, usually big-endian) CPU. This means the startup code (trivial, already got it working in little-endian mode), drivers for hardware Queue Manager, Network Processing Engines and built-in Ethernet interfaces (all of them easy to port from Linux).
This also means supporting the NOR flash: the CPU has 16-bit, always big-endian, "value-preserving" EXP bus for connecting such devices. In LE mode the address has to be XORed with 2, and if it's byte-oriented data (i.e. not a command/response), it has to be byte-swapped. Only 16-bit writes can be made.
Doing the above in the flash driver would complicate things a lot. The drivers currently use plain pointers to access the flash. I'm thinking about moving the low-level access (R/W) routines to arch code (with a generic defaults), and calling them via the NOR flash platform struct (which doesn't do anything useful ATM).
The above would also permit supporting flashes which can't be mapped in normal CPU address space. It would be a bit slower, though.
Opinions?
Signature · 6 lines
Krzysztof Halasa _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 12 lines · Krzysztof Halasa
I'm thinking about adding Barebox support for a certain platform using IXP425 (ARM, usually big-endian) CPU. This means the startup code (trivial, already got it working in little-endian mode), drivers for hardware Queue Manager, Network Processing Engines and built-in Ethernet interfaces (all of them easy to port from Linux).
This also means supporting the NOR flash: the CPU has 16-bit, always big-endian, "value-preserving" EXP bus for connecting such devices. In LE mode the address has to be XORed with 2, and if it's byte-oriented data (i.e. not a command/response), it has to be byte-swapped. Only 16-bit writes can be made.
Quoted 5 lines
Doing the above in the flash driver would complicate things a lot. The drivers currently use plain pointers to access the flash. I'm thinking about moving the low-level access (R/W) routines to arch code (with a generic defaults), and calling them via the NOR flash platform struct (which doesn't do anything useful ATM).
have a look at the current uboot cfi flash driver. They have read/write functions to access the flash. By default they are macros to IIRC __raw_read,write.
From the first look, the driver looks much cleaner than the "old" one used in barebox (modulo my bugfix from last week).
Maybe the current uboot driver should be ported to barebox before starting improving the old one.
Quoted 2 lines
The above would also permit supporting flashes which can't be mapped in normal CPU address space. It would be a bit slower, though.
Sure, the access macros can be mapped to something complete different.
Cheers, Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Re: Flash drivers, was: IXP4xx support
I also wonder, why are there two NOR flash drivers, old and new?
Another thing, the drivers seem to support various configurations like 4*16 bit (4 physical flash chips in parallel). Does any currently supported platform use anything like that? Or maybe all platforms use 1*8 or 16-bit config and the extra code is unneeded complexity?
Signature · 6 lines
Krzysztof Halasa _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: Flash drivers, was: IXP4xx support
Quoted 1 line · Krzysztof Halasa
I also wonder, why are there two NOR flash drivers, old and new?
I started working on the U-Boot flash driver and started making the different Flash chips (AMD, Intel) and bus widths optional in order to get the driver smaller. I didn't really get ready with it and checked it in as a second driver. Sorry for the confusion, I should have made a seperate branch from it.
Quoted 5 lines
Another thing, the drivers seem to support various configurations like 4*16 bit (4 physical flash chips in parallel). Does any currently supported platform use anything like that? Or maybe all platforms use 1*8 or 16-bit config and the extra code is unneeded complexity?
I have seen all bus widths from 8bit to 64bit on my boards. Not all of them are supported in barebox, but it's not a good idea to remove support for it.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: Flash drivers, was: IXP4xx support
Quoted 3 lines · Sascha Hauer
I have seen all bus widths from 8bit to 64bit on my boards. Not all of them are supported in barebox, but it's not a good idea to remove support for it.
Given the above, definitely :-)
I will try to make some progress with the NOR flash driver(s). Thanks.
Signature · 6 lines
Krzysztof Halasa _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 19 lines · Marc Kleine-Budde
Quoted 12 lines · Krzysztof Halasa
I'm thinking about adding Barebox support for a certain platform using IXP425 (ARM, usually big-endian) CPU. This means the startup code (trivial, already got it working in little-endian mode), drivers for hardware Queue Manager, Network Processing Engines and built-in Ethernet interfaces (all of them easy to port from Linux).
This also means supporting the NOR flash: the CPU has 16-bit, always big-endian, "value-preserving" EXP bus for connecting such devices. In LE mode the address has to be XORed with 2, and if it's byte-oriented data (i.e. not a command/response), it has to be byte-swapped. Only 16-bit writes can be made.
Quoted 5 lines
Doing the above in the flash driver would complicate things a lot. The drivers currently use plain pointers to access the flash. I'm thinking about moving the low-level access (R/W) routines to arch code (with a generic defaults), and calling them via the NOR flash platform struct (which doesn't do anything useful ATM).
Quoted 6 lines
have a look at the current uboot cfi flash driver. They have read/write functions to access the flash. By default they are macros to IIRC __raw_read,write.
From the first look, the driver looks much cleaner than the "old" one used in barebox (modulo my bugfix from last week).
It seems it still has the same driver under the hood.
I suggest to remove the "old" driver in favor for the cfi_flash_new driver so that this ongoing confusion ends and Krzysztof has some base to work on. I think the flash accesses can be ported from U-Boot if necessary.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox