mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] devicetree probe support
@ 2012-09-12 20:06 Sascha Hauer
  2012-09-12 20:06 ` [PATCH 01/15] driver: add dev_get_drvdata function Sascha Hauer
                   ` (15 more replies)
  0 siblings, 16 replies; 21+ messages in thread
From: Sascha Hauer @ 2012-09-12 20:06 UTC (permalink / raw)
  To: barebox

Hi All,

The following patch series adds support for probing barebox from
devicetree.

Most of the of helper code is taken directly from the Linux Kernel,
only little glue code is needed to populate the barebox devicetree
from a dtb.

Currently the dtb can be probed with 'oftree -p <dtb>'. After calling
this command the devices found in the dtb are probed. Devices which
were present before are not probed again, instead the corresponding
device nodes are attached to the barebox devices.

Further directions could be that barebox takes the dtb directly from
a first stage loader, so a second stage barebox could be started just
like a Linux Kernel. I have some experimental code for that. Another
possibility would be to compile a dtb into barebox, but this is not
done yet.

This series contains support for the basic probing, GPIO, SPI and
several i.MX devices. The devicetree probe support nearly compiles
away if disabled and takes about 6k in an uncompressed image when
enabled.

Here is an example session:

barebox@Phytec phyCORE-i.MX27:/ oftree -p mnt/tftp/sha-oftree-pcm038
barebox@Phytec phyCORE-i.MX27:/ devinfo 1000c000.serial
resources:
num   : 0
start : 0x1000c000
size  : 0x00001000
driver: imx_serial

no info available for 1000c000.serial
no parameters available

device node: /soc/aipi@10000000/serial@1000c000
serial@1000c000 {
        compatible: "fsl,imx27-uart", "fsl,imx21-uart"
        reg: <0x1000c000 0x1000>
        interrupts: <0x12>
        status: "okay"
        fsl,uart-has-rtscts:
};

Sascha


The following changes since commit c9556d4a54db100a1786506ce199c86d3b231a3b:

  drivers/net/ksz8864rmn: add driver for Micrel KSZ8864RMN Ethernet Switch (2012-09-11 16:10:23 +0200)

are available in the git repository at:

  git://git.pengutronix.de/git/barebox.git work/dt

for you to fetch changes up to c931520ecb121b299bf362b4c2481fc5f7e232cc:

  ARM i.MX: Add devicetree support for clocksource driver (2012-09-12 21:32:29 +0200)

----------------------------------------------------------------
Sascha Hauer (15):
      driver: add dev_get_drvdata function
      of: add devicetree probing support
      oftree command: Add devicetree probe support
      of: Add devicetree partition parsing
      spi: add oftree support
      ARM i.MX: Use platform_device_id for gpio driver
      ARM i.MX: implement clocksource as driver
      serial i.MX: oftree support
      net fec_imx: oftree support
      spi imx: dt support
      mfd mc13xxx: Add devicetree support
      cfi-flash: Add devicetree probe support
      mci i.MX esdhc: Add oftree support
      ARM i.MX: add devicetree support for gpio driver
      ARM i.MX: Add devicetree support for clocksource driver

 arch/arm/mach-imx/clocksource.c             |   85 ++-
 arch/arm/mach-imx/gpio.c                    |  111 +++-
 arch/arm/mach-imx/imx1.c                    |    9 +-
 arch/arm/mach-imx/imx21.c                   |   13 +-
 arch/arm/mach-imx/imx25.c                   |   10 +-
 arch/arm/mach-imx/imx27.c                   |   15 +-
 arch/arm/mach-imx/imx31.c                   |    7 +-
 arch/arm/mach-imx/imx35.c                   |    7 +-
 arch/arm/mach-imx/imx51.c                   |    9 +-
 arch/arm/mach-imx/imx53.c                   |   16 +-
 arch/arm/mach-imx/imx6.c                    |   15 +-
 arch/arm/mach-imx/include/mach/imx1-regs.h  |   23 -
 arch/arm/mach-imx/include/mach/imx21-regs.h |   24 -
 arch/arm/mach-imx/include/mach/imx25-regs.h |   27 -
 arch/arm/mach-imx/include/mach/imx27-regs.h |   23 -
 arch/arm/mach-imx/include/mach/imx31-regs.h |   27 -
 arch/arm/mach-imx/include/mach/imx35-regs.h |   28 -
 arch/arm/mach-imx/include/mach/imx51-regs.h |   19 -
 arch/arm/mach-imx/include/mach/imx53-regs.h |   19 -
 arch/arm/mach-imx/include/mach/imx6-regs.h  |   19 -
 commands/Kconfig                            |   12 +-
 commands/oftree.c                           |   28 +-
 common/oftree.c                             |    4 +-
 drivers/Kconfig                             |    1 +
 drivers/Makefile                            |    1 +
 drivers/base/driver.c                       |   35 +-
 drivers/base/platform.c                     |    5 +
 drivers/mci/imx-esdhc.c                     |   25 +-
 drivers/mfd/mc13xxx.c                       |   12 +
 drivers/net/fec_imx.c                       |   34 +-
 drivers/nor/cfi_flash.c                     |   29 +-
 drivers/of/Kconfig                          |    2 +
 drivers/of/Makefile                         |    3 +
 drivers/of/base.c                           |  802 +++++++++++++++++++++++++++
 drivers/of/gpio.c                           |   28 +
 drivers/of/partition.c                      |   64 +++
 drivers/serial/serial_imx.c                 |   17 +-
 drivers/spi/imx_spi.c                       |   49 +-
 drivers/spi/spi.c                           |   34 +-
 include/driver.h                            |   10 +
 include/of.h                                |  113 ++++
 include/spi/spi.h                           |    6 +
 42 files changed, 1493 insertions(+), 327 deletions(-)
 create mode 100644 drivers/of/Kconfig
 create mode 100644 drivers/of/Makefile
 create mode 100644 drivers/of/base.c
 create mode 100644 drivers/of/gpio.c
 create mode 100644 drivers/of/partition.c

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2012-09-20 21:17 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-12 20:06 [PATCH] devicetree probe support Sascha Hauer
2012-09-12 20:06 ` [PATCH 01/15] driver: add dev_get_drvdata function Sascha Hauer
2012-09-12 20:06 ` [PATCH 02/15] of: add devicetree probing support Sascha Hauer
2012-09-18 15:48   ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-12 20:06 ` [PATCH 03/15] oftree command: Add devicetree probe support Sascha Hauer
2012-09-12 20:06 ` [PATCH 04/15] of: Add devicetree partition parsing Sascha Hauer
2012-09-12 20:06 ` [PATCH 05/15] spi: add oftree support Sascha Hauer
2012-09-12 20:06 ` [PATCH 06/15] ARM i.MX: Use platform_device_id for gpio driver Sascha Hauer
2012-09-12 20:06 ` [PATCH 07/15] ARM i.MX: implement clocksource as driver Sascha Hauer
2012-09-17 16:17   ` Sascha Hauer
2012-09-12 20:06 ` [PATCH 08/15] serial i.MX: oftree support Sascha Hauer
2012-09-12 20:06 ` [PATCH 09/15] net fec_imx: " Sascha Hauer
2012-09-12 20:06 ` [PATCH 10/15] spi imx: dt support Sascha Hauer
2012-09-12 20:06 ` [PATCH 11/15] mfd mc13xxx: Add devicetree support Sascha Hauer
2012-09-12 20:06 ` [PATCH 12/15] cfi-flash: Add devicetree probe support Sascha Hauer
2012-09-12 20:06 ` [PATCH 13/15] mci i.MX esdhc: Add oftree support Sascha Hauer
2012-09-12 20:06 ` [PATCH 14/15] ARM i.MX: add devicetree support for gpio driver Sascha Hauer
2012-09-12 20:06 ` [PATCH 15/15] ARM i.MX: Add devicetree support for clocksource driver Sascha Hauer
2012-09-20 18:45 ` [PATCH] devicetree probe support Jean-Christophe PLAGNIOL-VILLARD
2012-09-20 18:51   ` [PATCH 1/1] fb: add it's own bus for fb devices Jean-Christophe PLAGNIOL-VILLARD
2012-09-20 21:17     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox