
On Tue, 10 Mar 2009, Jerry Van Baren wrote:
ksi@koi8.net wrote:
Hi, everyone.
I wonder if I'm dreaming or the U-Boot is fundamentally broken...
Well... broken can be a relative term. I like to think of it as an opportunity to stand on the shoulders of giants. ;-)
:)
It looks like there is no support for multiple devices of a same kind at all.
I'm porting U-Boot to my new MPC8548-based board and it pops up everywhere...
The first case was I2C subsystem that does not provide for several I2C adapters except rudimentary hacks for fsl_i2c.
Now it is USB. I have 2 OHCI USB controllers on the board, OHCI module in NXP ISP1563 and OHCI controller in Silicon Motion SM502 MFD. The former is supported in drivers/usb/usb_ohci.c, the latter is kinda trivial to add, BUT...
It looks like nobody even considered the case when a board can have several controllers... Looking at usb_lowlevel_init() I can see it only works for the first device found, there is absolutely no provision for several devices. And things are getting even nastier if there are devices of the same type with different interfaces (e.g. on-SoC USB controller and a PCI one.)
And this seems to be the case for each and every device type. Am I missing something or U-Boot is actually flawed in FUNDAMENTAL way and it is time to start a new one from scratch?
U-Boot started life as a boot loader. You know, simple. It has gotten more complex over time, but the modus operandi of u-boot is and shall remain that. Simple. (quoting our benevolent dictator, WD)
The counter-question for your application is to challenge what you are trying to use u-boot for: do you actually need to use both USB controllers (simultaneously or even sequentially) to boot linux? Do you really need to use multiple I2C controllers to boot linux? Can you simplify your system to get linux running without supporting multiple USB or I2C adapters?
Yes, I _DO_ need both controllers. There are numerous scenarios for that -- e.g. I can have a keyboard on a slow controller and a storage device or network adapter on another one. I can have multiple storage devices and want to choose which to boot from and so on.
If you really need multiple adapter support, you are going to have to blaze new ground (or build out some hacks into more acceptable levels of support). That is the cost of being the leader. :-/
Thanks, I already tried this for I2C... Now it is a hack (separate driver and core) in my $(BOARD) directory. USB is next, then I have additional serial ports...
The fundamental concept of u-boot isn't to handle all your devices, it is to boot linux (or other OS) and use the OS to handle the multiple devices.
The same is true for a PC BIOS, but it DOES handle all of my devices. And it allows me to choose which device to boot from. And it is extendable so I can add a PCI card with e.g. RAID controller and boot off of that RAID. And it is not handling of all devices, it is _BASIC_ functionality...
I don't mind reconfiguring and rebuilding the thing for my parcticular configuration instead of just changing some settings in interactive setup utility, but the current implementation won't allow even that...
--- ****************************************************************** * KSI@home KOI8 Net < > The impossible we do immediately. * * Las Vegas NV, USA < > Miracles require 24-hour notice. * ******************************************************************