Skip to contentSkip to conversation

Drop omap3 board files and make mach-omap2 boot in DT only mode

PATCH New Tony Lindgren 7 participants 27 messages Nov 26, 2013 – Nov 30, 2013

Subsystems (8)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

cover Drop omap3 board files and make mach-omap2 boot in DT only mode

Hi all,

We can finally make mach-omap2 to boot in device tree only mode for v3.14.

By doing that, we can get rid of about 20000 lines of legacy code for v3.14 that's no longer needed with device tree :) And that's not counting the additional removal of the code that comes with the pending patches to move clocks to drivers/clk.

Looks like we still have some legacy boards that don't have a .dts file, so if you're using one, please post the .dts file. I've posted some quick instructions in the first patch of this series for bringing up omaps with device tree.

For most omap2+ boards that are not yet supported with device tree just the .dts file is needed. Some boards also may need additional entries to pdata-quirks.c. If there are more complicated issues, please let me know so we can sort out those issues ASAP.

I don't have all omap boards so I have not been able to do a .dts file for those. Some help would be appreciated there if you are using a board with no .dts file posted yet. I can naturally help too where possible so we get the devices working with device tree as needed :)

These patches need v3.13-rc1 and some of the following patches depending on your board:

[PATCH 0/8] Various omap device tree usability fixes for v3.13 merge window [PATCH 00/11] Make omap24xx booting device tree based for v3.14 merge window [PATCH 0/3] Yet more fixes for booting omaps with device tree [PATCH 0/5] Prepare making omap3 device tree only and convert LDP

I've also pushed all the patches into a temporary testing branch:

omap-for-v3.14/tmp-testing-unstable-not-immutable

Regards,

Tony

Tony Lindgren (12):
ARM: OMAP2+: Remove legacy omap3 board-*.c files and make mach-omap2
DT only for booting
ARM: OMAP2+: Remove legacy serial.c
ARM: OMAP2+: Remove legacy hsmmc.c
ARM: OMAP2+: Remove legacy i2c.c platform init code
ARM: OMAP2+: Remove legacy PM init
ARM: OMAP2+: Remove legacy twl4030 platform init code
ARM: OMAP2+: Remove legacy usb-host.c platform init code
ARM: OMAP2+: Remove legacy muxing for usb-tusb6010.c
ARM: OMAP2+: Remove legacy usb-musb.c platform init code
ARM: OMAP2+: Remove legacy hwmod mux code
ARM: OMAP2+: Remove legacy mux code
ARM: OMAP2+: Remove legacy data from hwmod for omap3

 arch/arm/mach-omap1/i2c.c                          |   83 +
 arch/arm/mach-omap2/Kconfig                        |  112 --
 arch/arm/mach-omap2/Makefile                       |   35 +-
 arch/arm/mach-omap2/board-3430sdp.c                |  633 ------
 arch/arm/mach-omap2/board-am3517crane.c            |  150 --
 arch/arm/mach-omap2/board-am3517evm.c              |  379 ----
 arch/arm/mach-omap2/board-cm-t35.c                 |  771 --------
 arch/arm/mach-omap2/board-cm-t3517.c               |  337 ----
 arch/arm/mach-omap2/board-devkit8000.c             |  655 -------
 arch/arm/mach-omap2/board-ldp.c                    |  425 ----
 arch/arm/mach-omap2/board-omap3beagle.c            |  596 ------
 arch/arm/mach-omap2/board-omap3logic.c             |  251 ---
 arch/arm/mach-omap2/board-omap3pandora.c           |  630 ------
 arch/arm/mach-omap2/board-omap3stalker.c           |  438 -----
 arch/arm/mach-omap2/board-omap3touchbook.c         |  396 ----
 arch/arm/mach-omap2/board-overo.c                  |  572 ------
 arch/arm/mach-omap2/board-rx51-peripherals.c       | 1323 -------------
 arch/arm/mach-omap2/board-rx51-video.c             |   67 -
 arch/arm/mach-omap2/board-rx51.c                   |  142 --
 arch/arm/mach-omap2/board-ti8168evm.c              |   62 -
 arch/arm/mach-omap2/common-board-devices.h         |    2 -
 arch/arm/mach-omap2/common.h                       |    9 -
 arch/arm/mach-omap2/devices.c                      |    2 -
 arch/arm/mach-omap2/dss-common.c                   |    1 -
 arch/arm/mach-omap2/hsmmc.c                        |  518 -----
 arch/arm/mach-omap2/i2c.c                          |   97 -
 arch/arm/mach-omap2/io.c                           |    1 -
 arch/arm/mach-omap2/msdi.c                         |    1 -
 arch/arm/mach-omap2/mux.c                          | 1161 -----------
 arch/arm/mach-omap2/mux.h                          |  355 ----
 arch/arm/mach-omap2/mux34xx.c                      | 2061 --------------------
 arch/arm/mach-omap2/mux34xx.h                      |  402 ----
 arch/arm/mach-omap2/omap_hwmod.c                   |  160 +-
 .../omap_hwmod_2xxx_3xxx_interconnect_data.c       |  134 +-
 .../mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c |  201 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c         |  833 +-------
 arch/arm/mach-omap2/omap_twl.c                     |  314 ---
 arch/arm/mach-omap2/pm.c                           |  161 +-
 arch/arm/mach-omap2/serial.c                       |  335 ----
 arch/arm/mach-omap2/twl-common.c                   |  570 ------
 arch/arm/mach-omap2/twl-common.h                   |   66 -
 arch/arm/mach-omap2/usb-host.c                     |  496 -----
 arch/arm/mach-omap2/usb-musb.c                     |  114 --
 arch/arm/mach-omap2/usb-tusb6010.c                 |   21 -
 arch/arm/plat-omap/Makefile                        |    3 -
 arch/arm/plat-omap/i2c.c                           |  116 --
 46 files changed, 136 insertions(+), 16055 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/board-3430sdp.c
 delete mode 100644 arch/arm/mach-omap2/board-am3517crane.c
 delete mode 100644 arch/arm/mach-omap2/board-am3517evm.c
 delete mode 100644 arch/arm/mach-omap2/board-cm-t35.c
 delete mode 100644 arch/arm/mach-omap2/board-cm-t3517.c
 delete mode 100644 arch/arm/mach-omap2/board-devkit8000.c
 delete mode 100644 arch/arm/mach-omap2/board-ldp.c
 delete mode 100644 arch/arm/mach-omap2/board-omap3beagle.c
 delete mode 100644 arch/arm/mach-omap2/board-omap3logic.c
 delete mode 100644 arch/arm/mach-omap2/board-omap3pandora.c
 delete mode 100644 arch/arm/mach-omap2/board-omap3stalker.c
 delete mode 100644 arch/arm/mach-omap2/board-omap3touchbook.c
 delete mode 100644 arch/arm/mach-omap2/board-overo.c
 delete mode 100644 arch/arm/mach-omap2/board-rx51-peripherals.c
 delete mode 100644 arch/arm/mach-omap2/board-rx51-video.c
 delete mode 100644 arch/arm/mach-omap2/board-rx51.c
 delete mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 delete mode 100644 arch/arm/mach-omap2/hsmmc.c
 delete mode 100644 arch/arm/mach-omap2/mux.c
 delete mode 100644 arch/arm/mach-omap2/mux.h
 delete mode 100644 arch/arm/mach-omap2/mux34xx.c
 delete mode 100644 arch/arm/mach-omap2/mux34xx.h
 delete mode 100644 arch/arm/mach-omap2/omap_twl.c
 delete mode 100644 arch/arm/mach-omap2/serial.c
 delete mode 100644 arch/arm/mach-omap2/twl-common.c
 delete mode 100644 arch/arm/mach-omap2/twl-common.h
 delete mode 100644 arch/arm/mach-omap2/usb-host.c
 delete mode 100644 arch/arm/mach-omap2/usb-musb.c
 delete mode 100644 arch/arm/plat-omap/i2c.c
Signature · 1 line
1.8.1.1
author maintainer
#1 lore raw

PATCH 1/12 ARM: OMAP2+: Remove legacy omap3 board-*.c files and make mach-omap2 DT only for booting

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.

---

Here's the diet version of this patch as the full patch was too big for the lists it seems.

This diet version of the patch just removes the legacy board-*.c file entries from Kconfig and Makefile, which should be enough for most people for testing.

If the full patch does not make it to the lists, it's also available here:

http://git.kernel.org/cgit/linux/kernel/git/tmlind/linux-omap.git/commit/?id=1f7260bc2ba270ef04b8eaa2a7824fb32aa516aa

The full patch also removes the following board-*.c files:

 arch/arm/mach-omap2/board-3430sdp.c          |  633 ------------
 arch/arm/mach-omap2/board-am3517crane.c      |  150 ---
 arch/arm/mach-omap2/board-am3517evm.c        |  379 -------
 arch/arm/mach-omap2/board-cm-t35.c           |  771 ---------------
 arch/arm/mach-omap2/board-cm-t3517.c         |  337 ------
 arch/arm/mach-omap2/board-devkit8000.c       |  655 -------------
 arch/arm/mach-omap2/board-ldp.c              |  425 --------
 arch/arm/mach-omap2/board-omap3beagle.c      |  596 ------------
 arch/arm/mach-omap2/board-omap3logic.c       |  251 -----
 arch/arm/mach-omap2/board-omap3pandora.c     |  630 ------------
 arch/arm/mach-omap2/board-omap3stalker.c     |  438 --------
 arch/arm/mach-omap2/board-omap3touchbook.c   |  396 --------
 arch/arm/mach-omap2/board-overo.c            |  572 -----------
 arch/arm/mach-omap2/board-rx51-peripherals.c | 1323 ---------------------------
 arch/arm/mach-omap2/board-rx51-video.c       |   67 -
 arch/arm/mach-omap2/board-rx51.c             |  142 --
 arch/arm/mach-omap2/board-ti8168evm.c        |   62 -
arch/arm/mach-omap2/Kconfig +0 -112
@@ -192,80 +192,6 @@ config MACH_OMAP2_TUSB6010
 	depends on ARCH_OMAP2 && SOC_OMAP2420
 	default y if MACH_NOKIA_N8X0
 
-config MACH_OMAP3_BEAGLE
-	bool "OMAP3 BEAGLE board"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-
-config MACH_DEVKIT8000
-	bool "DEVKIT8000 board"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CUS
-
-config MACH_OMAP_LDP
-	bool "OMAP3 LDP board"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-
-config MACH_OMAP3530_LV_SOM
-	bool "OMAP3 Logic 3530 LV SOM board"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-	help
-	 Support for the LogicPD OMAP3530 SOM Development kit
-	 for full description please see the products webpage at
-	 http://www.logicpd.com/products/development-kits/texas-instruments-zoom%E2%84%A2-omap35x-development-kit
-
-config MACH_OMAP3_TORPEDO
-	bool "OMAP3 Logic 35x Torpedo board"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-	help
-	 Support for the LogicPD OMAP35x Torpedo Development kit
-	 for full description please see the products webpage at
-	 http://www.logicpd.com/products/development-kits/zoom-omap35x-torpedo-development-kit
-
-config MACH_OVERO
-	bool "Gumstix Overo board"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-
-config MACH_OMAP3517EVM
-	bool "OMAP3517/ AM3517 EVM board"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-
-config MACH_CRANEBOARD
-	bool "AM3517/05 CRANE board"
-	depends on ARCH_OMAP3
-	select OMAP_PACKAGE_CBB
-
-config MACH_OMAP3_PANDORA
-	bool "OMAP3 Pandora"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-	select REGULATOR_FIXED_VOLTAGE if REGULATOR
-
-config MACH_TOUCHBOOK
-	bool "OMAP3 Touch Book"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-
-config MACH_OMAP_3430SDP
-	bool "OMAP 3430 SDP board"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-
 config MACH_NOKIA_N800
        bool
 
@@ -284,44 +210,6 @@ config MACH_NOKIA_N8X0
 	select MACH_NOKIA_N810_WIMAX
 	select OMAP_PACKAGE_ZAC
 
-config MACH_NOKIA_RX51
-	bool "Nokia N900 (RX-51) phone"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-
-config MACH_CM_T35
-	bool "CompuLab CM-T35/CM-T3730 modules"
-	depends on ARCH_OMAP3
-	default y
-	select MACH_CM_T3730
-	select OMAP_PACKAGE_CUS
-
-config MACH_CM_T3517
-	bool "CompuLab CM-T3517 module"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CBB
-
-config MACH_CM_T3730
-       bool
-
-config MACH_SBC3530
-	bool "OMAP3 SBC STALKER board"
-	depends on ARCH_OMAP3
-	default y
-	select OMAP_PACKAGE_CUS
-
-config MACH_TI8168EVM
-	bool "TI8168 Evaluation Module"
-	depends on SOC_TI81XX
-	default y
-
-config MACH_TI8148EVM
-	bool "TI8148 Evaluation Module"
-	depends on SOC_TI81XX
-	default y
-
 config OMAP3_EMU
 	bool "OMAP3 debugging peripherals"
 	depends on ARCH_OMAP3
arch/arm/mach-omap2/Makefile +0 -22
index f78b177..914256e 100644
@@ -235,29 +235,7 @@ obj-$(CONFIG_SOC_OMAP2420)		+= msdi.o
 
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)		+= board-generic.o pdata-quirks.o
-obj-$(CONFIG_MACH_OMAP3_BEAGLE)		+= board-omap3beagle.o
-obj-$(CONFIG_MACH_DEVKIT8000)     	+= board-devkit8000.o
-obj-$(CONFIG_MACH_OMAP_LDP)		+= board-ldp.o
-obj-$(CONFIG_MACH_OMAP3530_LV_SOM)      += board-omap3logic.o
-obj-$(CONFIG_MACH_OMAP3_TORPEDO)        += board-omap3logic.o
-obj-$(CONFIG_MACH_OVERO)		+= board-overo.o
-obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o
-obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)		+= board-n8x0.o
-obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51.o sdram-nokia.o
-obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51-peripherals.o
-obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51-video.o
-obj-$(CONFIG_MACH_CM_T35)		+= board-cm-t35.o
-obj-$(CONFIG_MACH_CM_T3517)		+= board-cm-t3517.o
-obj-$(CONFIG_MACH_TOUCHBOOK)		+= board-omap3touchbook.o
-
-obj-$(CONFIG_MACH_OMAP3517EVM)		+= board-am3517evm.o
-
-obj-$(CONFIG_MACH_CRANEBOARD)		+= board-am3517crane.o
-
-obj-$(CONFIG_MACH_SBC3530)		+= board-omap3stalker.o
-obj-$(CONFIG_MACH_TI8168EVM)		+= board-ti8168evm.o
-obj-$(CONFIG_MACH_TI8148EVM)		+= board-ti8168evm.o
 
 # Platform specific device init code
 
#2 lore raw

PATCH 1/12 ARM: OMAP2+: Remove legacy omap3 board-*.c files and make mach-omap2 DT only for booting

Quoted 3 lines · Tony Lindgren

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.

Not really the same, quite some drivers are still missing, and it makes pandora unusable :( . For example, SDIO variation of wl1251, that one is non-probeable and used to be "detected" by using MMC_QUIRK_NONSTD_SDIO quirk (see pandora_wl1251_init_card() in board-omap3pandora.c). Also there are at least pandora-backlight, twl4030_keypad and panel drivers that are not converted yet.

Can pdata-quirks.c be used for SDIO wl1251 at least, as I have no idea how to express it using device tree?

--
Gra?vydas

#3 lore raw

PATCH 1/12 ARM: OMAP2+: Remove legacy omap3 board-*.c files and make mach-omap2 DT only for booting

Hi Grazvydas,

Quoted 12 lines · Grazvydas Ignotas
Quoted 3 lines · Tony Lindgren

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.

Not really the same, quite some drivers are still missing, and it makes pandora unusable :( . For example, SDIO variation of wl1251, that one is non-probeable and used to be "detected" by using MMC_QUIRK_NONSTD_SDIO quirk (see pandora_wl1251_init_card() in board-omap3pandora.c). Also there are at least pandora-backlight, twl4030_keypad and panel drivers that are not converted yet.

Quoted 3 lines

Can pdata-quirks.c be used for SDIO wl1251 at least, as I have no idea how to express it using device tree?

Yes, pdata-quirks.c can be used to initialize any platform device that does not have DT support yet and still needs platform data. Until we add the proper bindings and get rid of it.

Quoted 3 lines

--
Gra?vydas
--

Best regards,
Javier

author maintainer
#4 lore raw

PATCH 1/12 ARM: OMAP2+: Remove legacy omap3 board-*.c files and make mach-omap2 DT only for booting

Quoted 14 lines · Javier Martinez Canillas

Hi Grazvydas,

Quoted 11 lines · Grazvydas Ignotas
Quoted 3 lines · Tony Lindgren

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.

Not really the same, quite some drivers are still missing, and it makes pandora unusable :( . For example, SDIO variation of wl1251, that one is non-probeable and used to be "detected" by using MMC_QUIRK_NONSTD_SDIO quirk (see pandora_wl1251_init_card() in board-omap3pandora.c). Also there are at least pandora-backlight, twl4030_keypad and panel drivers that are not converted yet.

Sounds like the pandora-backlight should be initialized using pdata-quirks.c for now. Then Sebastian has posted some twl4030-keypad patches at:

http://linux-kernel.2935.n7.nabble.com/PATCHv3-0-2-twl4030-keypad-DT-binding-td750095.html

Other than wl1251 below, looking at board-omap3pandora.c there should not be anything that we could not support with device tree. It seems that pandora can use the panel dpi pdata-quirks.c similar to the LDP.

Quoted 7 lines
Quoted 3 lines

Can pdata-quirks.c be used for SDIO wl1251 at least, as I have no idea how to express it using device tree?

Yes, pdata-quirks.c can be used to initialize any platform device that does not have DT support yet and still needs platform data. Until we add the proper bindings and get rid of it.

Yeah at least initially. It should be just a question of adding a new entry to auxdata_quirks[] for pandora to populate the hsmmc platform data, then also add a new entry to omap_auxdata_lookup[] for hsmmc platform data. Similar to what n8x0 is already doing.

But ideally we'd completely get rid of the platform data for the omap_hsmmc.c so we can simplify the driver and remove all the callback functions.

So we could pass the non-standard configuration by adding a new compatible flag to omap_hsmmc.c for ti,omap3-hsmmc-wl1251. Then based on that omap_hsmmc.c could set the .init_card function from the struct of_device_id match table in the driver.

Or we could specify the non-standard SDIO card properties as a child of the hsmmc .dts entry. But that can be done later on naturally and should be discussed on the linux-mmc and device tree lists.

Let me know if you need help with the pandora .dts file, I don't have a pandora, but doing the basic .dts file for it should be quite easy.

Regards,

Tony

author maintainer
#5 lore raw

PATCH 2/12 ARM: OMAP2+: Remove legacy serial.c

In reply to Tony Lindgren

We can now initialize the UARTs using device tree.

---
 arch/arm/mach-omap2/Makefile |   2 +-
 arch/arm/mach-omap2/serial.c | 335 -------------------------------------------
 2 files changed, 1 insertion(+), 336 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/serial.c
arch/arm/mach-omap2/Makefile +1 -1
index 914256e..bb9629e 100644
@@ -6,7 +6,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 	-I$(srctree)/arch/arm/plat-omap/include
 
 # Common support
-obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
+obj-y := id.o io.o control.o mux.o devices.o fb.o gpmc.o timer.o pm.o \
 	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
 	 omap_device.o sram.o drm.o
 
arch/arm/mach-omap2/serial.c deleted +0 -335

335 lines not on this page · raw message

Signature · 1 line
1.8.1.1
author maintainer
#6 lore raw

PATCH 3/12 ARM: OMAP2+: Remove legacy hsmmc.c

In reply to Tony Lindgren

We can now initialize the hsmmc using devicetree

---
 arch/arm/mach-omap2/Makefile |   3 -
 arch/arm/mach-omap2/hsmmc.c  | 518 -------------------------------------------
 2 files changed, 521 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/hsmmc.c
arch/arm/mach-omap2/Makefile +0 -3
index bb9629e..a5e13c0 100644
@@ -243,9 +243,6 @@ omap-flash-$(CONFIG_MTD_NAND_OMAP2)	:= board-flash.o
 omap-flash-$(CONFIG_MTD_ONENAND_OMAP2)	:= board-flash.o
 obj-y					+= $(omap-flash-y) $(omap-flash-m)
 
-omap-hsmmc-$(CONFIG_MMC_OMAP_HS)	:= hsmmc.o
-obj-y					+= $(omap-hsmmc-m) $(omap-hsmmc-y)
-
 obj-y					+= usb-musb.o
 obj-y					+= omap_phy_internal.o
 
arch/arm/mach-omap2/hsmmc.c deleted +0 -518

518 lines not on this page · raw message

Signature · 1 line
1.8.1.1
author maintainer
#7 lore raw

PATCH 4/12 ARM: OMAP2+: Remove legacy i2c.c platform init code

In reply to Tony Lindgren

We can now initialize I2C for mach-omap2 using device tree. And we can move the remaining code in plat-omap/i2c.c into mach-omap1/i2c.c.

Note that we cannot remove some of the I2C bus reset functions as they are being used by hwmod code.

---
 arch/arm/mach-omap1/i2c.c        |  83 ++++++++++++++++++++++++++++
 arch/arm/mach-omap2/i2c.c        |  97 --------------------------------
 arch/arm/mach-omap2/twl-common.c |   2 -
 arch/arm/plat-omap/Makefile      |   3 -
 arch/arm/plat-omap/i2c.c         | 116 ---------------------------------------
 5 files changed, 83 insertions(+), 218 deletions(-)
 delete mode 100644 arch/arm/plat-omap/i2c.c
arch/arm/mach-omap1/i2c.c +83 -0
index 7f5761c..3f6384e 100644
@@ -19,6 +19,7 @@
  *
  */
 
+#include <linux/i2c.h>
 #include <linux/i2c-omap.h>
 #include <mach/mux.h>
 #include "soc.h"
@@ -92,6 +93,88 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *pdata,
 	return platform_device_register(pdev);
 }
 
+#define OMAP_I2C_MAX_CONTROLLERS 4
+static struct omap_i2c_bus_platform_data i2c_pdata[OMAP_I2C_MAX_CONTROLLERS];
+
+#define OMAP_I2C_CMDLINE_SETUP	(BIT(31))
+
+/**
+ * omap_i2c_bus_setup - Process command line options for the I2C bus speed
+ * @str: String of options
+ *
+ * This function allow to override the default I2C bus speed for given I2C
+ * bus with a command line option.
+ *
+ * Format: i2c_bus=bus_id,clkrate (in kHz)
+ *
+ * Returns 1 on success, 0 otherwise.
+ */
+static int __init omap_i2c_bus_setup(char *str)
+{
+	int ints[3];
+
+	get_options(str, 3, ints);
+	if (ints[0] < 2 || ints[1] < 1 ||
+			ints[1] > OMAP_I2C_MAX_CONTROLLERS)
+		return 0;
+	i2c_pdata[ints[1] - 1].clkrate = ints[2];
+	i2c_pdata[ints[1] - 1].clkrate |= OMAP_I2C_CMDLINE_SETUP;
+
+	return 1;
+}
+__setup("i2c_bus=", omap_i2c_bus_setup);
+
+/*
+ * Register busses defined in command line but that are not registered with
+ * omap_register_i2c_bus from board initialization code.
+ */
+int __init omap_register_i2c_bus_cmdline(void)
+{
+	int i, err = 0;
+
+	for (i = 0; i < ARRAY_SIZE(i2c_pdata); i++)
+		if (i2c_pdata[i].clkrate & OMAP_I2C_CMDLINE_SETUP) {
+			i2c_pdata[i].clkrate &= ~OMAP_I2C_CMDLINE_SETUP;
+			err = omap_i2c_add_bus(&i2c_pdata[i], i + 1);
+			if (err)
+				goto out;
+		}
+
+out:
+	return err;
+}
+
+/**
+ * omap_register_i2c_bus - register I2C bus with device descriptors
+ * @bus_id: bus id counting from number 1
+ * @clkrate: clock rate of the bus in kHz
+ * @info: pointer into I2C device descriptor table or NULL
+ * @len: number of descriptors in the table
+ *
+ * Returns 0 on success or an error code.
+ */
+int __init omap_register_i2c_bus(int bus_id, u32 clkrate,
+			  struct i2c_board_info const *info,
+			  unsigned len)
+{
+	int err;
+
+	BUG_ON(bus_id < 1 || bus_id > OMAP_I2C_MAX_CONTROLLERS);
+
+	if (info) {
+		err = i2c_register_board_info(bus_id, info, len);
+		if (err)
+			return err;
+	}
+
+	if (!i2c_pdata[bus_id - 1].clkrate)
+		i2c_pdata[bus_id - 1].clkrate = clkrate;
+
+	i2c_pdata[bus_id - 1].clkrate &= ~OMAP_I2C_CMDLINE_SETUP;
+
+	return omap_i2c_add_bus(&i2c_pdata[bus_id - 1], bus_id);
+}
+
 static  int __init omap_i2c_cmdline(void)
 {
 	return omap_register_i2c_bus_cmdline();
arch/arm/mach-omap2/i2c.c +0 -97

112 lines not on this page · raw message

arch/arm/mach-omap2/twl-common.c +0 -2
index b0d54da..e816966 100644
@@ -62,8 +62,6 @@ void __init omap_pmic_init(int bus, u32 clkrate,
 		sizeof(pmic_i2c_board_info.type));
 	pmic_i2c_board_info.irq = pmic_irq;
 	pmic_i2c_board_info.platform_data = pmic_data;
-
-	omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
 }
 
 void __init omap4_pmic_init(const char *pmic_type,
arch/arm/plat-omap/Makefile +0 -3
index 0b01b68..cdf999a 100644
@@ -14,6 +14,3 @@ obj-  :=
 
 obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
 obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
-i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o
-obj-y += $(i2c-omap-m) $(i2c-omap-y)
-
arch/arm/plat-omap/i2c.c deleted +0 -116

116 lines not on this page · raw message

Signature · 1 line
1.8.1.1
author maintainer
#8 lore raw

PATCH 5/12 ARM: OMAP2+: Remove legacy PM init

In reply to Tony Lindgren

This is no longer needed when booted with device tree.

---
 arch/arm/mach-omap2/pm.c | 161 +----------------------------------------------
 1 file changed, 1 insertion(+), 160 deletions(-)
arch/arm/mach-omap2/pm.c +1 -160
index e1b4141..cc3b00d 100644
@@ -30,7 +30,6 @@
 #include "powerdomain.h"
 #include "clockdomain.h"
 #include "pm.h"
-#include "twl-common.h"
 
 /*
  * omap_pm_suspend: points to a function that does the SoC-specific
@@ -70,42 +69,6 @@ void omap_pm_get_oscillator(u32 *tstart, u32 *tshut)
 }
 #endif
 
-static int __init _init_omap_device(char *name)
-{
-	struct omap_hwmod *oh;
-	struct platform_device *pdev;
-
-	oh = omap_hwmod_lookup(name);
-	if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
-		 __func__, name))
-		return -ENODEV;
-
-	pdev = omap_device_build(oh->name, 0, oh, NULL, 0);
-	if (WARN(IS_ERR(pdev), "%s: could not build omap_device for %s\n",
-		 __func__, name))
-		return -ENODEV;
-
-	return 0;
-}
-
-/*
- * Build omap_devices for processors and bus.
- */
-static void __init omap2_init_processor_devices(void)
-{
-	_init_omap_device("mpu");
-	if (omap3_has_iva())
-		_init_omap_device("iva");
-
-	if (cpu_is_omap44xx()) {
-		_init_omap_device("l3_main_1");
-		_init_omap_device("dsp");
-		_init_omap_device("iva");
-	} else {
-		_init_omap_device("l3_main");
-	}
-}
-
 int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
 {
 	/* XXX The usecount test is racy */
@@ -118,84 +81,6 @@ int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
 	return 0;
 }
 
-/*
- * This API is to be called during init to set the various voltage
- * domains to the voltage as per the opp table. Typically we boot up
- * at the nominal voltage. So this function finds out the rate of
- * the clock associated with the voltage domain, finds out the correct
- * opp entry and sets the voltage domain to the voltage specified
- * in the opp entry
- */
-static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
-					 const char *oh_name)
-{
-	struct voltagedomain *voltdm;
-	struct clk *clk;
-	struct dev_pm_opp *opp;
-	unsigned long freq, bootup_volt;
-	struct device *dev;
-
-	if (!vdd_name || !clk_name || !oh_name) {
-		pr_err("%s: invalid parameters\n", __func__);
-		goto exit;
-	}
-
-	if (!strncmp(oh_name, "mpu", 3))
-		/* 
-		 * All current OMAPs share voltage rail and clock
-		 * source, so CPU0 is used to represent the MPU-SS.
-		 */
-		dev = get_cpu_device(0);
-	else
-		dev = omap_device_get_by_hwmod_name(oh_name);
-
-	if (IS_ERR(dev)) {
-		pr_err("%s: Unable to get dev pointer for hwmod %s\n",
-			__func__, oh_name);
-		goto exit;
-	}
-
-	voltdm = voltdm_lookup(vdd_name);
-	if (!voltdm) {
-		pr_err("%s: unable to get vdd pointer for vdd_%s\n",
-			__func__, vdd_name);
-		goto exit;
-	}
-
-	clk =  clk_get(NULL, clk_name);
-	if (IS_ERR(clk)) {
-		pr_err("%s: unable to get clk %s\n", __func__, clk_name);
-		goto exit;
-	}
-
-	freq = clk_get_rate(clk);
-	clk_put(clk);
-
-	rcu_read_lock();
-	opp = dev_pm_opp_find_freq_ceil(dev, &freq);
-	if (IS_ERR(opp)) {
-		rcu_read_unlock();
-		pr_err("%s: unable to find boot up OPP for vdd_%s\n",
-			__func__, vdd_name);
-		goto exit;
-	}
-
-	bootup_volt = dev_pm_opp_get_voltage(opp);
-	rcu_read_unlock();
-	if (!bootup_volt) {
-		pr_err("%s: unable to find voltage corresponding to the bootup OPP for vdd_%s\n",
-		       __func__, vdd_name);
-		goto exit;
-	}
-
-	voltdm_scale(voltdm, bootup_volt);
-	return 0;
-
-exit:
-	pr_err("%s: unable to set vdd_%s\n", __func__, vdd_name);
-	return -EINVAL;
-}
-
 #ifdef CONFIG_SUSPEND
 static int omap_pm_enter(suspend_state_t suspend_state)
 {
@@ -245,40 +130,16 @@ static const struct platform_suspend_ops omap_pm_ops = {
 
 #endif /* CONFIG_SUSPEND */
 
-static void __init omap3_init_voltages(void)
-{
-	if (!cpu_is_omap34xx())
-		return;
-
-	omap2_set_init_voltage("mpu_iva", "dpll1_ck", "mpu");
-	omap2_set_init_voltage("core", "l3_ick", "l3_main");
-}
-
-static void __init omap4_init_voltages(void)
-{
-	if (!cpu_is_omap44xx())
-		return;
-
-	omap2_set_init_voltage("mpu", "dpll_mpu_ck", "mpu");
-	omap2_set_init_voltage("core", "l3_div_ck", "l3_main_1");
-	omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva");
-}
-
 static inline void omap_init_cpufreq(void)
 {
 	struct platform_device_info devinfo = { };
 
-	if (!of_have_populated_dt())
-		devinfo.name = "omap-cpufreq";
-	else
-		devinfo.name = "cpufreq-cpu0";
+	devinfo.name = "cpufreq-cpu0";
 	platform_device_register_full(&devinfo);
 }
 
 static int __init omap2_common_pm_init(void)
 {
-	if (!of_have_populated_dt())
-		omap2_init_processor_devices();
 	omap_pm_if_init();
 
 	return 0;
@@ -287,26 +148,6 @@ omap_postcore_initcall(omap2_common_pm_init);
 
 int __init omap2_common_pm_late_init(void)
 {
-	/*
-	 * In the case of DT, the PMIC and SR initialization will be done using
-	 * a completely different mechanism.
-	 * Disable this part if a DT blob is available.
-	 */
-	if (!of_have_populated_dt()) {
-
-		/* Init the voltage layer */
-		omap_pmic_late_init();
-		omap_voltage_late_init();
-
-		/* Initialize the voltages */
-		omap3_init_voltages();
-		omap4_init_voltages();
-
-		/* Smartreflex device init */
-		omap_devinit_smartreflex();
-
-	}
-
 	/* cpufreq dummy device instantiation */
 	omap_init_cpufreq();
 
Signature · 1 line
1.8.1.1
#9 lore raw

PATCH 5/12 ARM: OMAP2+: Remove legacy PM init

Quoted 1 line · Tony Lindgren

This is no longer needed when booted with device tree.

[...]

arch/arm/mach-omap2/pm.c static const struct platform_suspend_ops omap_pm_ops = { · line 137

Quoted 9 lines

static inline void omap_init_cpufreq(void)

 {
        struct platform_device_info devinfo = { };
arch/arm/mach-omap2/pm.c +1 -4
-       if (!of_have_populated_dt())
-               devinfo.name = "omap-cpufreq";
-       else
-               devinfo.name = "cpufreq-cpu0";
+       devinfo.name = "cpufreq-cpu0";

struct platform_device_info devinfo = { .name = "cpufreq-cpu0" };

otherwise, ok with the change.
Thanks and Regards,
Nishanth Menon

author maintainer
#10 lore raw

PATCH 5/12 ARM: OMAP2+: Remove legacy PM init

Quoted 13 lines · Nishanth Menon
Quoted 1 line · Tony Lindgren

This is no longer needed when booted with device tree.

[...]

Review

Quoted 9 lines

static inline void omap_init_cpufreq(void)

 {
        struct platform_device_info devinfo = { };
(quoted diff) +1 -4
-       if (!of_have_populated_dt())
-               devinfo.name = "omap-cpufreq";
-       else
-               devinfo.name = "cpufreq-cpu0";
+       devinfo.name = "cpufreq-cpu0";
Quoted 3 lines

struct platform_device_info devinfo = { .name = "cpufreq-cpu0" };

otherwise, ok with the change.

OK thanks, updated patch below.

Regards,

Tony

From: Tony Lindgren <[email protected]>
Date: Mon, 25 Nov 2013 11:37:25 -0800
Subject: [PATCH] ARM: OMAP2+: Remove legacy PM init

This is no longer needed when booted with device tree.

arch/arm/mach-omap2/pm.c +3 -161
@@ -30,7 +30,6 @@
 #include "powerdomain.h"
 #include "clockdomain.h"
 #include "pm.h"
-#include "twl-common.h"
 
 /*
  * omap_pm_suspend: points to a function that does the SoC-specific
@@ -70,42 +69,6 @@ void omap_pm_get_oscillator(u32 *tstart, u32 *tshut)
 }
 #endif
 
-static int __init _init_omap_device(char *name)
-{
-	struct omap_hwmod *oh;
-	struct platform_device *pdev;
-
-	oh = omap_hwmod_lookup(name);
-	if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
-		 __func__, name))
-		return -ENODEV;
-
-	pdev = omap_device_build(oh->name, 0, oh, NULL, 0);
-	if (WARN(IS_ERR(pdev), "%s: could not build omap_device for %s\n",
-		 __func__, name))
-		return -ENODEV;
-
-	return 0;
-}
-
-/*
- * Build omap_devices for processors and bus.
- */
-static void __init omap2_init_processor_devices(void)
-{
-	_init_omap_device("mpu");
-	if (omap3_has_iva())
-		_init_omap_device("iva");
-
-	if (cpu_is_omap44xx()) {
-		_init_omap_device("l3_main_1");
-		_init_omap_device("dsp");
-		_init_omap_device("iva");
-	} else {
-		_init_omap_device("l3_main");
-	}
-}
-
 int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
 {
 	/* XXX The usecount test is racy */
@@ -118,84 +81,6 @@ int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
 	return 0;
 }
 
-/*
- * This API is to be called during init to set the various voltage
- * domains to the voltage as per the opp table. Typically we boot up
- * at the nominal voltage. So this function finds out the rate of
- * the clock associated with the voltage domain, finds out the correct
- * opp entry and sets the voltage domain to the voltage specified
- * in the opp entry
- */
-static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
-					 const char *oh_name)
-{
-	struct voltagedomain *voltdm;
-	struct clk *clk;
-	struct dev_pm_opp *opp;
-	unsigned long freq, bootup_volt;
-	struct device *dev;
-
-	if (!vdd_name || !clk_name || !oh_name) {
-		pr_err("%s: invalid parameters\n", __func__);
-		goto exit;
-	}
-
-	if (!strncmp(oh_name, "mpu", 3))
-		/* 
-		 * All current OMAPs share voltage rail and clock
-		 * source, so CPU0 is used to represent the MPU-SS.
-		 */
-		dev = get_cpu_device(0);
-	else
-		dev = omap_device_get_by_hwmod_name(oh_name);
-
-	if (IS_ERR(dev)) {
-		pr_err("%s: Unable to get dev pointer for hwmod %s\n",
-			__func__, oh_name);
-		goto exit;
-	}
-
-	voltdm = voltdm_lookup(vdd_name);
-	if (!voltdm) {
-		pr_err("%s: unable to get vdd pointer for vdd_%s\n",
-			__func__, vdd_name);
-		goto exit;
-	}
-
-	clk =  clk_get(NULL, clk_name);
-	if (IS_ERR(clk)) {
-		pr_err("%s: unable to get clk %s\n", __func__, clk_name);
-		goto exit;
-	}
-
-	freq = clk_get_rate(clk);
-	clk_put(clk);
-
-	rcu_read_lock();
-	opp = dev_pm_opp_find_freq_ceil(dev, &freq);
-	if (IS_ERR(opp)) {
-		rcu_read_unlock();
-		pr_err("%s: unable to find boot up OPP for vdd_%s\n",
-			__func__, vdd_name);
-		goto exit;
-	}
-
-	bootup_volt = dev_pm_opp_get_voltage(opp);
-	rcu_read_unlock();
-	if (!bootup_volt) {
-		pr_err("%s: unable to find voltage corresponding to the bootup OPP for vdd_%s\n",
-		       __func__, vdd_name);
-		goto exit;
-	}
-
-	voltdm_scale(voltdm, bootup_volt);
-	return 0;
-
-exit:
-	pr_err("%s: unable to set vdd_%s\n", __func__, vdd_name);
-	return -EINVAL;
-}
-
 #ifdef CONFIG_SUSPEND
 static int omap_pm_enter(suspend_state_t suspend_state)
 {
@@ -245,40 +130,17 @@ static const struct platform_suspend_ops omap_pm_ops = {
 
 #endif /* CONFIG_SUSPEND */
 
-static void __init omap3_init_voltages(void)
-{
-	if (!cpu_is_omap34xx())
-		return;
-
-	omap2_set_init_voltage("mpu_iva", "dpll1_ck", "mpu");
-	omap2_set_init_voltage("core", "l3_ick", "l3_main");
-}
-
-static void __init omap4_init_voltages(void)
-{
-	if (!cpu_is_omap44xx())
-		return;
-
-	omap2_set_init_voltage("mpu", "dpll_mpu_ck", "mpu");
-	omap2_set_init_voltage("core", "l3_div_ck", "l3_main_1");
-	omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva");
-}
-
 static inline void omap_init_cpufreq(void)
 {
-	struct platform_device_info devinfo = { };
+	struct platform_device_info devinfo = {
+		.name = "cpufreq-cpu0",
+	};
 
-	if (!of_have_populated_dt())
-		devinfo.name = "omap-cpufreq";
-	else
-		devinfo.name = "cpufreq-cpu0";
 	platform_device_register_full(&devinfo);
 }
 
 static int __init omap2_common_pm_init(void)
 {
-	if (!of_have_populated_dt())
-		omap2_init_processor_devices();
 	omap_pm_if_init();
 
 	return 0;
@@ -287,26 +149,6 @@ omap_postcore_initcall(omap2_common_pm_init);
 
 int __init omap2_common_pm_late_init(void)
 {
-	/*
-	 * In the case of DT, the PMIC and SR initialization will be done using
-	 * a completely different mechanism.
-	 * Disable this part if a DT blob is available.
-	 */
-	if (!of_have_populated_dt()) {
-
-		/* Init the voltage layer */
-		omap_pmic_late_init();
-		omap_voltage_late_init();
-
-		/* Initialize the voltages */
-		omap3_init_voltages();
-		omap4_init_voltages();
-
-		/* Smartreflex device init */
-		omap_devinit_smartreflex();
-
-	}
-
 	/* cpufreq dummy device instantiation */
 	omap_init_cpufreq();
 
#11 lore raw

PATCH 5/12 ARM: OMAP2+: Remove legacy PM init

Quoted 22 lines · Tony Lindgren
Quoted 13 lines · Nishanth Menon
Quoted 1 line · Tony Lindgren

This is no longer needed when booted with device tree.

[...]

arch/arm/mach-omap2/pm.c static const struct platform_suspend_ops omap_pm_ops = {

Quoted 9 lines

static inline void omap_init_cpufreq(void)

 {
        struct platform_device_info devinfo = { };
arch/arm/mach-omap2/pm.c +1 -4
-       if (!of_have_populated_dt())
-               devinfo.name = "omap-cpufreq";
-       else
-               devinfo.name = "cpufreq-cpu0";
+       devinfo.name = "cpufreq-cpu0";
Quoted 3 lines

struct platform_device_info devinfo = { .name = "cpufreq-cpu0" };

otherwise, ok with the change.

OK thanks, updated patch below.

Regards,

Quoted 8 lines

Tony

From: Tony Lindgren <[email protected]>
Date: Mon, 25 Nov 2013 11:37:25 -0800
Subject: [PATCH] ARM: OMAP2+: Remove legacy PM init

This is no longer needed when booted with device tree.

This looks good to me, with this, I think we can drop drivers/cpufreq/omap-cpufreq.c - bunch of pm code as well could be slated to be dropped as well.

Quoted 213 lines
arch/arm/mach-omap2/pm.c +3 -162
@@ -30,7 +30,6 @@
 #include "powerdomain.h"
 #include "clockdomain.h"
 #include "pm.h"
-#include "twl-common.h"
 
 /*
  * omap_pm_suspend: points to a function that does the SoC-specific
@@ -70,42 +69,6 @@ void omap_pm_get_oscillator(u32 *tstart, u32 *tshut)
 }
 #endif
 
-static int __init _init_omap_device(char *name)
-{
-	struct omap_hwmod *oh;
-	struct platform_device *pdev;
-
-	oh = omap_hwmod_lookup(name);
-	if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
-		 __func__, name))
-		return -ENODEV;
-
-	pdev = omap_device_build(oh->name, 0, oh, NULL, 0);
-	if (WARN(IS_ERR(pdev), "%s: could not build omap_device for %s\n",
-		 __func__, name))
-		return -ENODEV;
-
-	return 0;
-}
-
-/*
- * Build omap_devices for processors and bus.
- */
-static void __init omap2_init_processor_devices(void)
-{
-	_init_omap_device("mpu");
-	if (omap3_has_iva())
-		_init_omap_device("iva");
-
-	if (cpu_is_omap44xx()) {
-		_init_omap_device("l3_main_1");
-		_init_omap_device("dsp");
-		_init_omap_device("iva");
-	} else {
-		_init_omap_device("l3_main");
-	}
-}
-
 int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
 {
 	/* XXX The usecount test is racy */
@@ -118,84 +81,6 @@ int __init omap_pm_clkdms_setup(struct clockdomain *clkdm, void *unused)
 	return 0;
 }
 
-/*
- * This API is to be called during init to set the various voltage
- * domains to the voltage as per the opp table. Typically we boot up
- * at the nominal voltage. So this function finds out the rate of
- * the clock associated with the voltage domain, finds out the correct
- * opp entry and sets the voltage domain to the voltage specified
- * in the opp entry
- */
-static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
-					 const char *oh_name)
-{
-	struct voltagedomain *voltdm;
-	struct clk *clk;
-	struct dev_pm_opp *opp;
-	unsigned long freq, bootup_volt;
-	struct device *dev;
-
-	if (!vdd_name || !clk_name || !oh_name) {
-		pr_err("%s: invalid parameters\n", __func__);
-		goto exit;
-	}
-
-	if (!strncmp(oh_name, "mpu", 3))
-		/* 
-		 * All current OMAPs share voltage rail and clock
-		 * source, so CPU0 is used to represent the MPU-SS.
-		 */
-		dev = get_cpu_device(0);
-	else
-		dev = omap_device_get_by_hwmod_name(oh_name);
-
-	if (IS_ERR(dev)) {
-		pr_err("%s: Unable to get dev pointer for hwmod %s\n",
-			__func__, oh_name);
-		goto exit;
-	}
-
-	voltdm = voltdm_lookup(vdd_name);
-	if (!voltdm) {
-		pr_err("%s: unable to get vdd pointer for vdd_%s\n",
-			__func__, vdd_name);
-		goto exit;
-	}
-
-	clk =  clk_get(NULL, clk_name);
-	if (IS_ERR(clk)) {
-		pr_err("%s: unable to get clk %s\n", __func__, clk_name);
-		goto exit;
-	}
-
-	freq = clk_get_rate(clk);
-	clk_put(clk);
-
-	rcu_read_lock();
-	opp = dev_pm_opp_find_freq_ceil(dev, &freq);
-	if (IS_ERR(opp)) {
-		rcu_read_unlock();
-		pr_err("%s: unable to find boot up OPP for vdd_%s\n",
-			__func__, vdd_name);
-		goto exit;
-	}
-
-	bootup_volt = dev_pm_opp_get_voltage(opp);
-	rcu_read_unlock();
-	if (!bootup_volt) {
-		pr_err("%s: unable to find voltage corresponding to the bootup OPP for vdd_%s\n",
-		       __func__, vdd_name);
-		goto exit;
-	}
-
-	voltdm_scale(voltdm, bootup_volt);
-	return 0;
-
-exit:
-	pr_err("%s: unable to set vdd_%s\n", __func__, vdd_name);
-	return -EINVAL;
-}
-
 #ifdef CONFIG_SUSPEND
 static int omap_pm_enter(suspend_state_t suspend_state)
 {
@@ -245,40 +130,17 @@ static const struct platform_suspend_ops omap_pm_ops = {
 
 #endif /* CONFIG_SUSPEND */
 
-static void __init omap3_init_voltages(void)
-{
-	if (!cpu_is_omap34xx())
-		return;
-
-	omap2_set_init_voltage("mpu_iva", "dpll1_ck", "mpu");
-	omap2_set_init_voltage("core", "l3_ick", "l3_main");
-}
-
-static void __init omap4_init_voltages(void)
-{
-	if (!cpu_is_omap44xx())
-		return;
-
-	omap2_set_init_voltage("mpu", "dpll_mpu_ck", "mpu");
-	omap2_set_init_voltage("core", "l3_div_ck", "l3_main_1");
-	omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva");
-}
-
 static inline void omap_init_cpufreq(void)
 {
-	struct platform_device_info devinfo = { };
+	struct platform_device_info devinfo = {
+		.name = "cpufreq-cpu0",
+	};
 
-	if (!of_have_populated_dt())
-		devinfo.name = "omap-cpufreq";
-	else
-		devinfo.name = "cpufreq-cpu0";
 	platform_device_register_full(&devinfo);
 }
 
 static int __init omap2_common_pm_init(void)
 {
-	if (!of_have_populated_dt())
-		omap2_init_processor_devices();
 	omap_pm_if_init();
 
 	return 0;
@@ -287,26 +149,6 @@ omap_postcore_initcall(omap2_common_pm_init);
 
 int __init omap2_common_pm_late_init(void)
 {
-	/*
-	 * In the case of DT, the PMIC and SR initialization will be done using
-	 * a completely different mechanism.
-	 * Disable this part if a DT blob is available.
-	 */
-	if (!of_have_populated_dt()) {
-
-		/* Init the voltage layer */
-		omap_pmic_late_init();
-		omap_voltage_late_init();
-
-		/* Initialize the voltages */
-		omap3_init_voltages();
-		omap4_init_voltages();
-
-		/* Smartreflex device init */
-		omap_devinit_smartreflex();
-
-	}
-
 	/* cpufreq dummy device instantiation */
 	omap_init_cpufreq();
 
--
Signature · 2 lines
Regards,
Nishanth Menon
author maintainer
#12 lore raw

PATCH 6/12 ARM: OMAP2+: Remove legacy twl4030 platform init code

In reply to Tony Lindgren

We can now initialize twl4030 with device tree.

---
 arch/arm/mach-omap2/Makefile               |   3 +-
 arch/arm/mach-omap2/common-board-devices.h |   2 -
 arch/arm/mach-omap2/omap_twl.c             | 314 ----------------
 arch/arm/mach-omap2/twl-common.c           | 568 -----------------------------
 arch/arm/mach-omap2/twl-common.h           |  66 ----
 5 files changed, 1 insertion(+), 952 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/omap_twl.c
 delete mode 100644 arch/arm/mach-omap2/twl-common.c
 delete mode 100644 arch/arm/mach-omap2/twl-common.h
arch/arm/mach-omap2/Makefile +1 -2
index a5e13c0..1f50fae 100644
@@ -29,7 +29,6 @@ ifneq ($(CONFIG_SND_OMAP_SOC_MCBSP),)
 obj-y += mcbsp.o
 endif
 
-obj-$(CONFIG_TWL4030_CORE) += omap_twl.o
 obj-$(CONFIG_SOC_HAS_OMAP2_SDRC)	+= sdrc.o
 
 # SMP support ONLY available for OMAP4
@@ -267,4 +266,4 @@ endif
 emac-$(CONFIG_TI_DAVINCI_EMAC)		:= am35xx-emac.o
 obj-y					+= $(emac-m) $(emac-y)
 
-obj-y					+= common-board-devices.o twl-common.o dss-common.o
+obj-y					+= common-board-devices.o dss-common.o
arch/arm/mach-omap2/common-board-devices.h +0 -2
index f338177..663dfa3 100644
@@ -1,8 +1,6 @@
 #ifndef __OMAP_COMMON_BOARD_DEVICES__
 #define __OMAP_COMMON_BOARD_DEVICES__
 
-#include "twl-common.h"
-
 #define NAND_BLOCK_SIZE	SZ_128K
 
 struct mtd_partition;
arch/arm/mach-omap2/omap_twl.c deleted +0 -314

314 lines not on this page · raw message

arch/arm/mach-omap2/twl-common.c deleted +0 -568

568 lines not on this page · raw message

arch/arm/mach-omap2/twl-common.h deleted +0 -66

66 lines not on this page · raw message

Signature · 1 line
1.8.1.1
author maintainer
#13 lore raw

PATCH 7/12 ARM: OMAP2+: Remove legacy usb-host.c platform init code

In reply to Tony Lindgren

This is no longer needed when booted with device tree.

---
 arch/arm/mach-omap2/Makefile   |   1 -
 arch/arm/mach-omap2/usb-host.c | 496 -----------------------------------------
 2 files changed, 497 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/usb-host.c
arch/arm/mach-omap2/Makefile +0 -1
index 1f50fae..bfc5459 100644
@@ -246,7 +246,6 @@ obj-y					+= usb-musb.o
 obj-y					+= omap_phy_internal.o
 
 obj-$(CONFIG_MACH_OMAP2_TUSB6010)	+= usb-tusb6010.o
-obj-y					+= usb-host.o
 
 onenand-$(CONFIG_MTD_ONENAND_OMAP2)	:= gpmc-onenand.o
 obj-y					+= $(onenand-m) $(onenand-y)
arch/arm/mach-omap2/usb-host.c deleted +0 -496

496 lines not on this page · raw message

Signature · 1 line
1.8.1.1
author maintainer
#14 lore raw

PATCH 8/12 ARM: OMAP2+: Remove legacy muxing for usb-tusb6010.c

In reply to Tony Lindgren

We are moving to device tree based booting, and this should be done using pinctrl-single instead.

---
 arch/arm/mach-omap2/usb-tusb6010.c | 21 ---------------------
 1 file changed, 21 deletions(-)
arch/arm/mach-omap2/usb-tusb6010.c +0 -21
index e832bc7..99ee036 100644
@@ -22,8 +22,6 @@
 
 #include "gpmc.h"
 
-#include "mux.h"
-
 static u8		async_cs, sync_cs;
 static unsigned		refclk_psec;
 
@@ -227,25 +225,6 @@ tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
 	}
 	tusb_device.dev.platform_data = data;
 
-	/* REVISIT let the driver know what DMA channels work */
-	if (!dmachan)
-		tusb_device.dev.dma_mask = NULL;
-	else {
-		/* assume OMAP 2420 ES2.0 and later */
-		if (dmachan & (1 << 0))
-			omap_mux_init_signal("sys_ndmareq0", 0);
-		if (dmachan & (1 << 1))
-			omap_mux_init_signal("sys_ndmareq1", 0);
-		if (dmachan & (1 << 2))
-			omap_mux_init_signal("sys_ndmareq2", 0);
-		if (dmachan & (1 << 3))
-			omap_mux_init_signal("sys_ndmareq3", 0);
-		if (dmachan & (1 << 4))
-			omap_mux_init_signal("sys_ndmareq4", 0);
-		if (dmachan & (1 << 5))
-			omap_mux_init_signal("sys_ndmareq5", 0);
-	}
-
 	/* so far so good ... register the device */
 	status = platform_device_register(&tusb_device);
 	if (status < 0) {
Signature · 1 line
1.8.1.1
author maintainer
#15 lore raw

PATCH 9/12 ARM: OMAP2+: Remove legacy usb-musb.c platform init code

In reply to Tony Lindgren

This is no longer needed when booted with device tree.

---
 arch/arm/mach-omap2/Makefile   |   1 -
 arch/arm/mach-omap2/usb-musb.c | 114 -----------------------------------------
 2 files changed, 115 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/usb-musb.c
arch/arm/mach-omap2/Makefile +0 -1
index bfc5459..66b7218 100644
@@ -242,7 +242,6 @@ omap-flash-$(CONFIG_MTD_NAND_OMAP2)	:= board-flash.o
 omap-flash-$(CONFIG_MTD_ONENAND_OMAP2)	:= board-flash.o
 obj-y					+= $(omap-flash-y) $(omap-flash-m)
 
-obj-y					+= usb-musb.o
 obj-y					+= omap_phy_internal.o
 
 obj-$(CONFIG_MACH_OMAP2_TUSB6010)	+= usb-tusb6010.o
arch/arm/mach-omap2/usb-musb.c deleted +0 -114

114 lines not on this page · raw message

Signature · 1 line
1.8.1.1
author maintainer
#16 lore raw

PATCH 10/12 ARM: OMAP2+: Remove legacy hwmod mux code

In reply to Tony Lindgren

This is no longer needed when booted with device tree.

---
 arch/arm/mach-omap2/devices.c    |   2 -
 arch/arm/mach-omap2/omap_hwmod.c | 160 +--------------------------------------
 2 files changed, 1 insertion(+), 161 deletions(-)
arch/arm/mach-omap2/devices.c +0 -2
index 0dd6398..8e85fa0 100644
@@ -33,7 +33,6 @@
 
 #include "soc.h"
 #include "common.h"
-#include "mux.h"
 #include "control.h"
 #include "devices.h"
 #include "display.h"
@@ -278,7 +277,6 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
 						name, oh->name);
 		return PTR_ERR(pdev);
 	}
-	oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt);
 
 	return 0;
 }
arch/arm/mach-omap2/omap_hwmod.c +1 -159

228 lines not on this page · raw message

Signature · 1 line
1.8.1.1
#17 lore raw

cover Drop omap3 board files and make mach-omap2 boot in DT only mode

In reply to Tony Lindgren

Hi,

Quoted 36 lines · Tony Lindgren

Hi all,

We can finally make mach-omap2 to boot in device tree only mode for v3.14.

By doing that, we can get rid of about 20000 lines of legacy code for v3.14 that's no longer needed with device tree :) And that's not counting the additional removal of the code that comes with the pending patches to move clocks to drivers/clk.

Looks like we still have some legacy boards that don't have a .dts file, so if you're using one, please post the .dts file. I've posted some quick instructions in the first patch of this series for bringing up omaps with device tree.

For most omap2+ boards that are not yet supported with device tree just the .dts file is needed. Some boards also may need additional entries to pdata-quirks.c. If there are more complicated issues, please let me know so we can sort out those issues ASAP.

I don't have all omap boards so I have not been able to do a .dts file for those. Some help would be appreciated there if you are using a board with no .dts file posted yet. I can naturally help too where possible so we get the devices working with device tree as needed :)

These patches need v3.13-rc1 and some of the following patches depending on your board:

[PATCH 0/8] Various omap device tree usability fixes for v3.13 merge window [PATCH 00/11] Make omap24xx booting device tree based for v3.14 merge window [PATCH 0/3] Yet more fixes for booting omaps with device tree [PATCH 0/5] Prepare making omap3 device tree only and convert LDP

I've also pushed all the patches into a temporary testing branch:

omap-for-v3.14/tmp-testing-unstable-not-immutable

Quoted 8 lines

Regards,

Tony

Tony Lindgren (12):
ARM: OMAP2+: Remove legacy omap3 board-*.c files and make mach-omap2
DT only for booting

looks like this patch didn't make it to the list, maybe it's too large ?

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131125/e481c047/attachment-0001.sig>
author maintainer
#18 lore raw

cover Drop omap3 board files and make mach-omap2 boot in DT only mode

Quoted 3 lines · Felipe Balbi
Quoted 2 lines · Tony Lindgren

We can finally make mach-omap2 to boot in device tree only mode for v3.14.

...

Quoted 6 lines
Quoted 4 lines

Tony Lindgren (12):
ARM: OMAP2+: Remove legacy omap3 board-*.c files and make mach-omap2
DT only for booting

looks like this patch didn't make it to the list, maybe it's too large ?

Yeah looks like patches 1 and 11 were too bloated. I just posted dietx versions of those as a reply to this thread that don't yet remove the legacy board-*.c files and mux*.c files.

Regards,

Tony

author maintainer
#19 lore raw

PATCH 11/12 ARM: OMAP2+: Remove legacy mux code

In reply to Tony Lindgren

We can now use drivers/pinctrl-single.c instead.

---

Here's a diet version of this patch that does not remove the mux*.[ch] files because it was too big for the mailing lists.

The full version of the patch is available at:

http://git.kernel.org/cgit/linux/kernel/git/tmlind/linux-omap.git/commit/?id=10f4ba76928338e78a63c7f68e5a491bdbc46554

And it also removes the following:

 arch/arm/mach-omap2/mux.c          | 1161 --------------------
 arch/arm/mach-omap2/mux.h          |  355 ------
 arch/arm/mach-omap2/mux34xx.c      | 2061 -------------------------------------
 arch/arm/mach-omap2/mux34xx.h      |  402 -------
arch/arm/mach-omap2/Makefile +1 -4
index 66b7218..8e6b0a4 100644
@@ -6,7 +6,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 	-I$(srctree)/arch/arm/plat-omap/include
 
 # Common support
-obj-y := id.o io.o control.o mux.o devices.o fb.o gpmc.o timer.o pm.o \
+obj-y := id.o io.o control.o devices.o fb.o gpmc.o timer.o pm.o \
 	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
 	 omap_device.o sram.o drm.o
 
@@ -64,9 +64,6 @@ obj-$(CONFIG_ARCH_OMAP4)		+= omap4-restart.o
 obj-$(CONFIG_SOC_OMAP5)			+= omap4-restart.o
 obj-$(CONFIG_SOC_DRA7XX)		+= omap4-restart.o
 
-# Pin multiplexing
-obj-$(CONFIG_ARCH_OMAP3)		+= mux34xx.o
-
 # SMS/SDRC
 obj-$(CONFIG_ARCH_OMAP2)		+= sdrc2xxx.o
 # obj-$(CONFIG_ARCH_OMAP3)		+= sdrc3xxx.o
arch/arm/mach-omap2/common.h +0 -9
index 240db38..a3040a4 100644
@@ -69,15 +69,6 @@ static inline int omap4_pm_init(void)
 }
 #endif
 
-#ifdef CONFIG_OMAP_MUX
-int omap_mux_late_init(void);
-#else
-static inline int omap_mux_late_init(void)
-{
-	return 0;
-}
-#endif
-
 extern void omap2_init_common_infrastructure(void);
 
 extern void omap2_sync32k_timer_init(void);
arch/arm/mach-omap2/dss-common.c +0 -1
index 86e98c5..6b0c446 100644
@@ -32,7 +32,6 @@
 
 #include "soc.h"
 #include "dss-common.h"
-#include "mux.h"
 
 #define HDMI_GPIO_CT_CP_HPD 60 /* HPD mode enable/disable */
 #define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
arch/arm/mach-omap2/io.c +0 -1
index cd22262..88b1d5d 100644
@@ -396,7 +396,6 @@ static void __init omap_hwmod_init_postsetup(void)
 
 static void __init __maybe_unused omap_common_late_init(void)
 {
-	omap_mux_late_init();
 	omap2_common_pm_late_init();
 	omap_soc_device_init();
 }
arch/arm/mach-omap2/msdi.c +0 -1
index 828e0db..aaea57c 100644
@@ -30,7 +30,6 @@
 #include "control.h"
 #include "omap_hwmod.h"
 #include "omap_device.h"
-#include "mux.h"
 #include "mmc.h"
 
 /*
author maintainer
#20 lore raw

PATCH 11/12 ARM: OMAP2+: Remove legacy mux code

Quoted 54 lines · Tony Lindgren

We can now use drivers/pinctrl-single.c instead.

---

Here's a diet version of this patch that does not remove the mux*.[ch] files because it was too big for the mailing lists.

The full version of the patch is available at:

http://git.kernel.org/cgit/linux/kernel/git/tmlind/linux-omap.git/commit/?id=10f4ba76928338e78a63c7f68e5a491bdbc46554

And it also removes the following:

 arch/arm/mach-omap2/mux.c          | 1161 --------------------
 arch/arm/mach-omap2/mux.h          |  355 ------
 arch/arm/mach-omap2/mux34xx.c      | 2061 -------------------------------------
 arch/arm/mach-omap2/mux34xx.h      |  402 -------
arch/arm/mach-omap2/Makefile +1 -4
index 66b7218..8e6b0a4 100644
@@ -6,7 +6,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 	-I$(srctree)/arch/arm/plat-omap/include
 
 # Common support
-obj-y := id.o io.o control.o mux.o devices.o fb.o gpmc.o timer.o pm.o \
+obj-y := id.o io.o control.o devices.o fb.o gpmc.o timer.o pm.o \
 	 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
 	 omap_device.o sram.o drm.o
 
@@ -64,9 +64,6 @@ obj-$(CONFIG_ARCH_OMAP4)		+= omap4-restart.o
 obj-$(CONFIG_SOC_OMAP5)			+= omap4-restart.o
 obj-$(CONFIG_SOC_DRA7XX)		+= omap4-restart.o
 
-# Pin multiplexing
-obj-$(CONFIG_ARCH_OMAP3)		+= mux34xx.o
-
 # SMS/SDRC
 obj-$(CONFIG_ARCH_OMAP2)		+= sdrc2xxx.o
 # obj-$(CONFIG_ARCH_OMAP3)		+= sdrc3xxx.o
arch/arm/mach-omap2/common.h +0 -2
index 240db38..a3040a4 100644
@@ -69,15 +69,6 @@ static inline int omap4_pm_init(void)
 }
 #endif
 
-#ifdef CONFIG_OMAP_MUX
-int omap_mux_late_init(void);

arch/arm/mach-omap2/common.h static inline int omap4_pm_init(void) · line 74

Quoted 10 lines
arch/arm/mach-omap2/common.h +0 -7
-#else
-static inline int omap_mux_late_init(void)
-{
-	return 0;
-}
-#endif
-
 extern void omap2_init_common_infrastructure(void);
 
 extern void omap2_sync32k_timer_init(void);

Looks like we can now also move the related Kconfig entries from plat-omap to be mach-omap1 specific, so I'll fold in the following changes.

Regards,

Tony

arch/arm/mach-omap1/Kconfig +26 -0
@@ -31,6 +31,32 @@ config ARCH_OMAP16XX
 	select ARCH_OMAP_OTG
 	select CPU_ARM926T
 
+config OMAP_MUX
+	bool "OMAP multiplexing support"
+	depends on ARCH_OMAP
+	default y
+	help
+	  Pin multiplexing support for OMAP boards. If your bootloader
+	  sets the multiplexing correctly, say N. Otherwise, or if unsure,
+	  say Y.
+
+config OMAP_MUX_DEBUG
+	bool "Multiplexing debug output"
+	depends on OMAP_MUX
+	help
+	  Makes the multiplexing functions print out a lot of debug info.
+	  This is useful if you want to find out the correct values of the
+	  multiplexing registers.
+
+config OMAP_MUX_WARNINGS
+	bool "Warn about pins the bootloader didn't set up"
+	depends on OMAP_MUX
+	default y
+	help
+	  Choose Y here to warn whenever driver initialization logic needs
+	  to change the pin multiplexing setup.	 When there are no warnings
+	  printed, it's safe to deselect OMAP_MUX for your product.
+
 comment "OMAP Board Type"
 	depends on ARCH_OMAP1
 
arch/arm/plat-omap/Kconfig +0 -26
@@ -60,32 +60,6 @@ config OMAP_RESET_CLOCKS
 	  probably do not want this option enabled until your
 	  device drivers work properly.
 
-config OMAP_MUX
-	bool "OMAP multiplexing support"
-	depends on ARCH_OMAP
-	default y
-	help
-	  Pin multiplexing support for OMAP boards. If your bootloader
-	  sets the multiplexing correctly, say N. Otherwise, or if unsure,
-	  say Y.
-
-config OMAP_MUX_DEBUG
-	bool "Multiplexing debug output"
-	depends on OMAP_MUX
-	help
-	  Makes the multiplexing functions print out a lot of debug info.
-	  This is useful if you want to find out the correct values of the
-	  multiplexing registers.
-
-config OMAP_MUX_WARNINGS
-	bool "Warn about pins the bootloader didn't set up"
-	depends on OMAP_MUX
-	default y
-	help
-	  Choose Y here to warn whenever driver initialization logic needs
-	  to change the pin multiplexing setup.	 When there are no warnings
-	  printed, it's safe to deselect OMAP_MUX for your product.
-
 config OMAP_IOMMU_IVA2
 	bool
 
author maintainer
#21 lore raw

PATCH 12/12 ARM: OMAP2+: Remove legacy data from hwmod for omap3

In reply to Tony Lindgren

This data is now coming from device tree so we can remove the duplicate data. Let's keep the DSS and DMA related things for now until those have been converted to device tree completely.

While at it, let's also add the trailing commas to data structures so further processing with scripts will be a bit easier.

---
 .../omap_hwmod_2xxx_3xxx_interconnect_data.c       | 134 +---
 .../mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c | 201 +----
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c         | 833 +--------------------
 3 files changed, 49 insertions(+), 1119 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_interconnect_data.c +8 -126
index 0413dab..b58fe8f 100644
@@ -17,165 +17,47 @@
 
 #include "omap_hwmod_common_data.h"
 
-struct omap_hwmod_addr_space omap2430_mmc1_addr_space[] = {
-	{
-		.pa_start	= 0x4809c000,
-		.pa_end		= 0x4809c1ff,
-		.flags		= ADDR_TYPE_RT,
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2430_mmc2_addr_space[] = {
-	{
-		.pa_start	= 0x480b4000,
-		.pa_end		= 0x480b41ff,
-		.flags		= ADDR_TYPE_RT,
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2_i2c1_addr_space[] = {
-	{
-		.pa_start	= 0x48070000,
-		.pa_end		= 0x48070000 + SZ_128 - 1,
-		.flags		= ADDR_TYPE_RT,
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2_i2c2_addr_space[] = {
-	{
-		.pa_start	= 0x48072000,
-		.pa_end		= 0x48072000 + SZ_128 - 1,
-		.flags		= ADDR_TYPE_RT,
-	},
-	{ }
-};
-
 struct omap_hwmod_addr_space omap2_dss_addrs[] = {
 	{
 		.pa_start	= 0x48050000,
 		.pa_end		= 0x48050000 + SZ_1K - 1,
-		.flags		= ADDR_TYPE_RT
+		.flags		= ADDR_TYPE_RT,
 	},
-	{ }
+	{ },
 };
 
 struct omap_hwmod_addr_space omap2_dss_dispc_addrs[] = {
 	{
 		.pa_start	= 0x48050400,
 		.pa_end		= 0x48050400 + SZ_1K - 1,
-		.flags		= ADDR_TYPE_RT
+		.flags		= ADDR_TYPE_RT,
 	},
-	{ }
+	{ },
 };
 
 struct omap_hwmod_addr_space omap2_dss_rfbi_addrs[] = {
 	{
 		.pa_start	= 0x48050800,
 		.pa_end		= 0x48050800 + SZ_1K - 1,
-		.flags		= ADDR_TYPE_RT
+		.flags		= ADDR_TYPE_RT,
 	},
-	{ }
+	{ },
 };
 
 struct omap_hwmod_addr_space omap2_dss_venc_addrs[] = {
 	{
 		.pa_start	= 0x48050C00,
 		.pa_end		= 0x48050C00 + SZ_1K - 1,
-		.flags		= ADDR_TYPE_RT
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2_timer10_addrs[] = {
-	{
-		.pa_start	= 0x48086000,
-		.pa_end		= 0x48086000 + SZ_1K - 1,
-		.flags		= ADDR_TYPE_RT
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2_timer11_addrs[] = {
-	{
-		.pa_start	= 0x48088000,
-		.pa_end		= 0x48088000 + SZ_1K - 1,
-		.flags		= ADDR_TYPE_RT
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2xxx_timer12_addrs[] = {
-	{
-		.pa_start	= 0x4808a000,
-		.pa_end		= 0x4808a000 + SZ_1K - 1,
-		.flags		= ADDR_TYPE_RT
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2_mcspi1_addr_space[] = {
-	{
-		.pa_start	= 0x48098000,
-		.pa_end		= 0x48098000 + SZ_256 - 1,
-		.flags		= ADDR_TYPE_RT,
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2_mcspi2_addr_space[] = {
-	{
-		.pa_start	= 0x4809a000,
-		.pa_end		= 0x4809a000 + SZ_256 - 1,
-		.flags		= ADDR_TYPE_RT,
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2430_mcspi3_addr_space[] = {
-	{
-		.pa_start	= 0x480b8000,
-		.pa_end		= 0x480b8000 + SZ_256 - 1,
 		.flags		= ADDR_TYPE_RT,
 	},
-	{ }
+	{ },
 };
 
 struct omap_hwmod_addr_space omap2_dma_system_addrs[] = {
 	{
 		.pa_start	= 0x48056000,
 		.pa_end		= 0x48056000 + SZ_4K - 1,
-		.flags		= ADDR_TYPE_RT
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2_mailbox_addrs[] = {
-	{
-		.pa_start	= 0x48094000,
-		.pa_end		= 0x48094000 + SZ_512 - 1,
 		.flags		= ADDR_TYPE_RT,
 	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2_mcbsp1_addrs[] = {
-	{
-		.name		= "mpu",
-		.pa_start	= 0x48074000,
-		.pa_end		= 0x480740ff,
-		.flags		= ADDR_TYPE_RT
-	},
-	{ }
-};
-
-struct omap_hwmod_addr_space omap2_hdq1w_addr_space[] = {
-	{
-		.pa_start       = 0x480b2000,
-		.pa_end         = 0x480b2fff,
-		.flags          = ADDR_TYPE_RT,
-	},
-	{ }
+	{ },
 };
arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c +6 -195

236 lines not on this page · raw message

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +35 -798

2,071 lines not on this page · raw message

Signature · 1 line
1.8.1.1
#22 lore raw

cover Drop omap3 board files and make mach-omap2 boot in DT only mode

In reply to Tony Lindgren

Hello Tony,

Quoted 9 lines · Tony Lindgren

Hi all,

We can finally make mach-omap2 to boot in device tree only mode for v3.14.

By doing that, we can get rid of about 20000 lines of legacy code for v3.14 that's no longer needed with device tree :) And that's not counting the additional removal of the code that comes with the pending patches to move clocks to drivers/clk.

Great news :)

Quoted 10 lines

Looks like we still have some legacy boards that don't have a .dts file, so if you're using one, please post the .dts file. I've posted some quick instructions in the first patch of this series for bringing up omaps with device tree.

For most omap2+ boards that are not yet supported with device tree just the .dts file is needed. Some boards also may need additional entries to pdata-quirks.c. If there are more complicated issues, please let me know so we can sort out those issues ASAP.

I just tested your tree with my custom Overo-based board (OMAP3630). I see some new warnings popping up, nothing dramatic at first glance. I will continue testing to see if I lost something in the transition.

IMHO one remaining issue is the missing binding for the camera interface (ISP). I saw recently an RFC from Sebastian Reichel to add the necessary binding [1], but this work will probably take some time. So probably a quirk is necessary here to bring up this IP.

Best regards,

Florian

[1]
http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/70533

#23 lore raw

cover Drop omap3 board files and make mach-omap2 boot in DT only mode

Hi,

Quoted 4 lines · Florian Vaussard

IMHO one remaining issue is the missing binding for the camera interface (ISP). I saw recently an RFC from Sebastian Reichel to add the necessary binding [1], but this work will probably take some time. So probably a quirk is necessary here to bring up this IP.

My DT patches for omap3-isp won't be ready for 3.14.

-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131126/4bf2260e/attachment.sig>

author maintainer
#24 lore raw

cover Drop omap3 board files and make mach-omap2 boot in DT only mode

Quoted 9 lines · Sebastian Reichel

Hi,

Quoted 4 lines · Florian Vaussard

IMHO one remaining issue is the missing binding for the camera interface (ISP). I saw recently an RFC from Sebastian Reichel to add the necessary binding [1], but this work will probably take some time. So probably a quirk is necessary here to bring up this IP.

My DT patches for omap3-isp won't be ready for 3.14.

No problem, we can init omap3-isp with auxdata from pdata-quirks.c meanwhile.

Regards,

Tony

#25 lore raw

cover Drop omap3 board files and make mach-omap2 boot in DT only mode

In reply to Tony Lindgren

Hi Tony,

Quoted 32 lines · Tony Lindgren

Hi all,

We can finally make mach-omap2 to boot in device tree only mode for v3.14.

By doing that, we can get rid of about 20000 lines of legacy code for v3.14 that's no longer needed with device tree :) And that's not counting the additional removal of the code that comes with the pending patches to move clocks to drivers/clk.

Looks like we still have some legacy boards that don't have a .dts file, so if you're using one, please post the .dts file. I've posted some quick instructions in the first patch of this series for bringing up omaps with device tree.

For most omap2+ boards that are not yet supported with device tree just the .dts file is needed. Some boards also may need additional entries to pdata-quirks.c. If there are more complicated issues, please let me know so we can sort out those issues ASAP.

I don't have all omap boards so I have not been able to do a .dts file for those. Some help would be appreciated there if you are using a board with no .dts file posted yet. I can naturally help too where possible so we get the devices working with device tree as needed :)

These patches need v3.13-rc1 and some of the following patches depending on your board:

[PATCH 0/8] Various omap device tree usability fixes for v3.13 merge window [PATCH 00/11] Make omap24xx booting device tree based for v3.14 merge window [PATCH 0/3] Yet more fixes for booting omaps with device tree [PATCH 0/5] Prepare making omap3 device tree only and convert LDP

Quoted 8 lines

I've also pushed all the patches into a temporary testing branch:

omap-for-v3.14/tmp-testing-unstable-not-immutable

Regards,

Tony

That's great!

I just tested your branch on my DM3730 IGEPv2 board and everything works correctly.

Also, I noticed that there are some remaining code that is unused now that the board files are gone and can be removed.

I'll send now as a separate series but the diffstat is

 arch/arm/mach-omap2/Makefile        |   9 -----
 arch/arm/mach-omap2/board-flash.c   | 245
----------------------------------------------------------------------------------------------------------------------------
 arch/arm/mach-omap2/board-flash.h   |  62 --------------------------------
 arch/arm/mach-omap2/gpmc-smc91x.c   | 186
----------------------------------------------------------------------------------------------
 arch/arm/mach-omap2/gpmc-smc91x.h   |  42 ----------------------
 arch/arm/mach-omap2/gpmc-smsc911x.c | 100
---------------------------------------------------
 arch/arm/mach-omap2/gpmc-smsc911x.h |  35 ------------------
 arch/arm/mach-omap2/gpmc.c          |   1 -
 8 files changed, 680 deletions(-)

Best regards,
Javier

Quoted 100 lines

Tony Lindgren (12):
ARM: OMAP2+: Remove legacy omap3 board-*.c files and make mach-omap2
DT only for booting
ARM: OMAP2+: Remove legacy serial.c
ARM: OMAP2+: Remove legacy hsmmc.c
ARM: OMAP2+: Remove legacy i2c.c platform init code
ARM: OMAP2+: Remove legacy PM init
ARM: OMAP2+: Remove legacy twl4030 platform init code
ARM: OMAP2+: Remove legacy usb-host.c platform init code
ARM: OMAP2+: Remove legacy muxing for usb-tusb6010.c
ARM: OMAP2+: Remove legacy usb-musb.c platform init code
ARM: OMAP2+: Remove legacy hwmod mux code
ARM: OMAP2+: Remove legacy mux code
ARM: OMAP2+: Remove legacy data from hwmod for omap3

 arch/arm/mach-omap1/i2c.c                          |   83 +
 arch/arm/mach-omap2/Kconfig                        |  112 --
 arch/arm/mach-omap2/Makefile                       |   35 +-
 arch/arm/mach-omap2/board-3430sdp.c                |  633 ------
 arch/arm/mach-omap2/board-am3517crane.c            |  150 --
 arch/arm/mach-omap2/board-am3517evm.c              |  379 ----
 arch/arm/mach-omap2/board-cm-t35.c                 |  771 --------
 arch/arm/mach-omap2/board-cm-t3517.c               |  337 ----
 arch/arm/mach-omap2/board-devkit8000.c             |  655 -------
 arch/arm/mach-omap2/board-ldp.c                    |  425 ----
 arch/arm/mach-omap2/board-omap3beagle.c            |  596 ------
 arch/arm/mach-omap2/board-omap3logic.c             |  251 ---
 arch/arm/mach-omap2/board-omap3pandora.c           |  630 ------
 arch/arm/mach-omap2/board-omap3stalker.c           |  438 -----
 arch/arm/mach-omap2/board-omap3touchbook.c         |  396 ----
 arch/arm/mach-omap2/board-overo.c                  |  572 ------
 arch/arm/mach-omap2/board-rx51-peripherals.c       | 1323 -------------
 arch/arm/mach-omap2/board-rx51-video.c             |   67 -
 arch/arm/mach-omap2/board-rx51.c                   |  142 --
 arch/arm/mach-omap2/board-ti8168evm.c              |   62 -
 arch/arm/mach-omap2/common-board-devices.h         |    2 -
 arch/arm/mach-omap2/common.h                       |    9 -
 arch/arm/mach-omap2/devices.c                      |    2 -
 arch/arm/mach-omap2/dss-common.c                   |    1 -
 arch/arm/mach-omap2/hsmmc.c                        |  518 -----
 arch/arm/mach-omap2/i2c.c                          |   97 -
 arch/arm/mach-omap2/io.c                           |    1 -
 arch/arm/mach-omap2/msdi.c                         |    1 -
 arch/arm/mach-omap2/mux.c                          | 1161 -----------
 arch/arm/mach-omap2/mux.h                          |  355 ----
 arch/arm/mach-omap2/mux34xx.c                      | 2061 --------------------
 arch/arm/mach-omap2/mux34xx.h                      |  402 ----
 arch/arm/mach-omap2/omap_hwmod.c                   |  160 +-
 .../omap_hwmod_2xxx_3xxx_interconnect_data.c       |  134 +-
 .../mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c |  201 +-
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c         |  833 +-------
 arch/arm/mach-omap2/omap_twl.c                     |  314 ---
 arch/arm/mach-omap2/pm.c                           |  161 +-
 arch/arm/mach-omap2/serial.c                       |  335 ----
 arch/arm/mach-omap2/twl-common.c                   |  570 ------
 arch/arm/mach-omap2/twl-common.h                   |   66 -
 arch/arm/mach-omap2/usb-host.c                     |  496 -----
 arch/arm/mach-omap2/usb-musb.c                     |  114 --
 arch/arm/mach-omap2/usb-tusb6010.c                 |   21 -
 arch/arm/plat-omap/Makefile                        |    3 -
 arch/arm/plat-omap/i2c.c                           |  116 --
 46 files changed, 136 insertions(+), 16055 deletions(-)
 delete mode 100644 arch/arm/mach-omap2/board-3430sdp.c
 delete mode 100644 arch/arm/mach-omap2/board-am3517crane.c
 delete mode 100644 arch/arm/mach-omap2/board-am3517evm.c
 delete mode 100644 arch/arm/mach-omap2/board-cm-t35.c
 delete mode 100644 arch/arm/mach-omap2/board-cm-t3517.c
 delete mode 100644 arch/arm/mach-omap2/board-devkit8000.c
 delete mode 100644 arch/arm/mach-omap2/board-ldp.c
 delete mode 100644 arch/arm/mach-omap2/board-omap3beagle.c
 delete mode 100644 arch/arm/mach-omap2/board-omap3logic.c
 delete mode 100644 arch/arm/mach-omap2/board-omap3pandora.c
 delete mode 100644 arch/arm/mach-omap2/board-omap3stalker.c
 delete mode 100644 arch/arm/mach-omap2/board-omap3touchbook.c
 delete mode 100644 arch/arm/mach-omap2/board-overo.c
 delete mode 100644 arch/arm/mach-omap2/board-rx51-peripherals.c
 delete mode 100644 arch/arm/mach-omap2/board-rx51-video.c
 delete mode 100644 arch/arm/mach-omap2/board-rx51.c
 delete mode 100644 arch/arm/mach-omap2/board-ti8168evm.c
 delete mode 100644 arch/arm/mach-omap2/hsmmc.c
 delete mode 100644 arch/arm/mach-omap2/mux.c
 delete mode 100644 arch/arm/mach-omap2/mux.h
 delete mode 100644 arch/arm/mach-omap2/mux34xx.c
 delete mode 100644 arch/arm/mach-omap2/mux34xx.h
 delete mode 100644 arch/arm/mach-omap2/omap_twl.c
 delete mode 100644 arch/arm/mach-omap2/serial.c
 delete mode 100644 arch/arm/mach-omap2/twl-common.c
 delete mode 100644 arch/arm/mach-omap2/twl-common.h
 delete mode 100644 arch/arm/mach-omap2/usb-host.c
 delete mode 100644 arch/arm/mach-omap2/usb-musb.c
 delete mode 100644 arch/arm/plat-omap/i2c.c

--
1.8.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

author maintainer
#26 lore raw

cover Drop omap3 board files and make mach-omap2 boot in DT only mode

Quoted 3 lines · Javier Martinez Canillas

I just tested your branch on my DM3730 IGEPv2 board and everything works correctly.

OK good to hear.

Quoted 5 lines

Also, I noticed that there are some remaining code that is unused now that the board files are gone and can be removed.

I'll send now as a separate series but the diffstat is

Quoted 12 lines
 arch/arm/mach-omap2/Makefile        |   9 -----
 arch/arm/mach-omap2/board-flash.c   | 245
----------------------------------------------------------------------------------------------------------------------------
 arch/arm/mach-omap2/board-flash.h   |  62 --------------------------------
 arch/arm/mach-omap2/gpmc-smc91x.c   | 186
----------------------------------------------------------------------------------------------
 arch/arm/mach-omap2/gpmc-smc91x.h   |  42 ----------------------
 arch/arm/mach-omap2/gpmc-smsc911x.c | 100
---------------------------------------------------
 arch/arm/mach-omap2/gpmc-smsc911x.h |  35 ------------------
 arch/arm/mach-omap2/gpmc.c          |   1 -
 8 files changed, 680 deletions(-)

Yeah great, saw that, will look at it more on Monday.

Regards,

Tony