All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Schwebel <r.schwebel@pengutronix.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Multiple device support -- sorry state :(
Date: Wed, 8 Apr 2009 22:02:12 +0200	[thread overview]
Message-ID: <20090408200212.GY5367@pengutronix.de> (raw)
In-Reply-To: <49DCF8B7.8020904@ge.com>

Hi Jerry,

On Wed, Apr 08, 2009 at 03:19:19PM -0400, Jerry Van Baren wrote:
> ksi at koi8.net wrote:
> > OK, this is _NOT_ just multiple I2C adapters... The entire thing is
> > fundamentally broken.
> >
> > One supposed to have _THE_ device and only this device is somehow supported.
> >
> > Now it is USB. Each and every USB driver exports the same set of functions,
> > submit_XXX_msg(...) That means there can be one and only one USB device in
> > the system.
>
> [snip the badly scorched spot ;-)]
>
> > USB keyboard is another grand kludge deserving its own chapter... As of now
> > one can only switch to it from command line because USB is not even
> > initialized until do_usb() from cmd_usb.c is called... What if we do NOT
> > have a serial console at all?
>
> Dumb question because I have not looked seriously at the v2 fork of
> u-boot: how does the v2 fork handle this? Better? Since the v2 fork
> uses (or is close to) the linux driver model, I would expect it to be
> better.

Right, we use something close to the driver model, so no problem with
that in v2 land. Other than linux, we have per-device parameters.

Example, with a freshly checked out tree:

  rsc at thebe:u-boot-v2$ make sandbox_defconfig
  rsc at thebe:u-boot-v2$ make
  rsc at thebe:u-boot-v2$ ./scripts/ubootenv -s -p 0x10000 examples/environment/ env.bin

That gets you an u-boot-v2 (user mode u-boot) plus the example
environment.

Let's start it:

  rsc at thebe:u-boot-v2-denx$ ./uboot -e env.bin
  add file env.bin()


  U-Boot 2.0.0-rc8-00084-g97568fd (Apr  8 2009 - 21:54:30)

  Board: sandbox
  Malloc space: 0xb761f008 -> 0xb7e1f008 (size  8 MB)
  Open /dev/env0 Function not implemented
  running /env/bin/init...
  not found
  uboot:/

Let's check which devices we have:

  uboot:/ devinfo
  devices:
  |----env0
  |----console0
  |----mem
  |----eth0
  |----filesystem: /
  |----filesystem: /dev

  drivers:
     console
   cfi_flash
         mem
         ram
         rom
      cramfs
       ramfs
       devfs
    hostfile

Let's check what parameters are there:

  uboot:/ devinfo /dev/console0
  base  : 0x00000000
  size  : 0x00000000
  driver: console

  no info available for console0
  Parameters:
            active = ioe

So you can have as many devices as you want, plus each device has parameters
attached to it, so it's completely object oriented, without any global variable
crap.

rsc
-- 
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 |

      parent reply	other threads:[~2009-04-08 20:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08 19:00 [U-Boot] Multiple device support -- sorry state :( ksi at koi8.net
2009-04-08 19:19 ` Jerry Van Baren
2009-04-08 19:25   ` ksi at koi8.net
2009-04-08 20:03     ` Robert Schwebel
2009-04-08 20:18       ` ksi at koi8.net
2009-04-08 20:43         ` Robert Schwebel
2009-04-08 21:08           ` ksi at koi8.net
2009-04-08 21:25             ` ksi at koi8.net
2009-04-08 21:34               ` Robert Schwebel
2009-04-08 21:58                 ` ksi at koi8.net
2009-04-08 20:02   ` Robert Schwebel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090408200212.GY5367@pengutronix.de \
    --to=r.schwebel@pengutronix.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.