Skip to main content.

OLS U-Boot BOF

Configuration

Release Cycle

Follow Linux style?

Code Cleanup

Patch & Bug Tracking

Project Funding

Sponsoring, Donations?

Project List

Device Tree Run Time Configuration

* drivers/can/i82527.c

DEVICE_ENTRY("CAN", "i82527",
             i82527_init,
             i82527_reg)


+-------
I includes entry in the device array d in binary:
I
I d[n] = {
I   .class = "CAN",
I   .type = "i82527",
I   .dev_init = i82527_init,
I   .dev_reg  = i82527_reg,
I }
+-------

i82527_init(fdt_node *p)
{
  ...
  i82527_setup(p);
  ...
}

__weak i82527_setup(fdt_node *p)
{
  return 1;
}

* board.c:

i82527_setup(fdt_node *p)
{
  ...
  program UPM
  ...
}


* common/probe.c (?):

hw_probe(type)
{
  for (i=0; i<sizeof(d); i++) {
    if (d[i].type != type)
      continue;
    if (p = find_compatible_device(d)) {
      d->dev_init(p);
      d->dev_reg(p);
    }
  }
}


* lib_ppc/board.c (?):
  ...
  hw_probe("CAN");
  hw_probe("IDE");
  ....

-- WolfgangDenk - 29 Jun 2007