ARM: OMAP2+: Remove legacy omap3 board-*.c files and make mach-omap2 DT only for...
authorTony Lindgren <tony@atomide.com>
Fri, 6 Dec 2013 18:52:58 +0000 (10:52 -0800)
committerTony Lindgren <tony@atomide.com>
Sun, 8 Dec 2013 22:15:46 +0000 (14:15 -0800)
We can now boot all mach-omap2 related boards using appended device
tree by creating a related .dts file with pretty much the same
functionality as booted in the legacy platform data mode.

So let's remove the legacy board files so we can finally make mach-omap2
boot using device tree only. The main reason for doing this is to leave
out massive amounts of legacy platform data that is no longer needed
when booted with device tree.

There are some devices that still need platform data, but that we
can deal with using the auxdata support in mach-omap2/pdata-quirks.c
based on the board specific device tree compatible flag.

The only board-*.c files remaining will be board-generic.c that's used
for device tree based booting, and board-n8x0.c that's needed temporarily
until basic omap2 legacy devices work with device tree. Note that we're
also removing board-ti8168evm.c that's not omap3, but that seems broken
anyways as it's missing handle_irq. And there's really nothing stopping
us from booting ti81xx with device tree either except adding support to
board-generic.c like other omaps have.

If you're new to booting things with device tree, here are some quick
instructions for bringing up new boards with device tree:

1. Look at the existing files in arch/arm/boot/dts

There's a fair chance somebody has already created a suitable
file for your board.

2. Create omap3-yourboard.dts file in arch/arm/boot/dts

If you don't see a suitable omap3-*.dts file, chances are your
board is very similar to one of them. For older 34xx/35xx based
boards take a look at the omap3-beagle.dts and omap3-ldp.dts, and
for newer 36xx/37xx based boards take a look at omap3-beagle-xm.dts
and omap3-evm-37xx.dts.

3. Add omap3-yourboard.dtb to the arch/arm/boot/dts/Makefile

4. Check that you have the necessary .config options enabled

CONFIG_ARM_APPENDED_DTB=y
CONFIG_ARM_ATAG_DTB_COMPAT=y
CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND=y
CONFIG_PINCTRL_SINGLE=y
CONFIG_REGULATOR_TWL4030=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y

These are enabled in omap2plus_defconfig by default.

5. Build the kernel

$ ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- make omap3-myboard.dtb
$ ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- make zImage

6. Append the .dtb file to zImage

$ cat arch/arm/boot/zImage arch/arm/boot/dts/omap3-evm-37xx.dtb > /tmp/zImage

7. Optionally run mkimage to create uImage file

$ mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 \
  -n Linux -d /tmp/zImage-omap2plus /tmp/uImage-omap2plus

8. Add support for further devices to the .dts files

Please try to add support for further devices as device tree drivers.
If you need some legacy devices to keep things working, you can also
use the pdata-quirk.c to initialize those.

Signed-off-by: Tony Lindgren <tony@atomide.com>

No differences found