[00/22] ARM: omap1 multiplatform support

Message ID 20190808212234.2213262-1-arnd@arndb.de
Headers show
Series
  • ARM: omap1 multiplatform support
Related show

Message

Arnd Bergmann Aug. 8, 2019, 9:22 p.m.
I spent some time cleaning up omap1, which is one of the last
remaining ARM9 platforms that is not yet part of
CONFIG_ARCH_MULTIPLATFORM.

There are two main parts here:

1. Avoiding mach/*.h header file dependencies, in particular
   mach/memory.h and mach/io.h. I managed to split out a
   small set of headers that are moved to include/linux/soc/ti,
   to avoid completely rewriting the platform interfaces,
   while getting all drivers to be actually self-contained
   aside from these headers.

2. Rewriting the clock driver to use common-clk
   I've never written a clock driver before, and I tried to
   stick to the original code without changing too much here,
   so the result is not overly pretty, and likely contains
   bugs, but I think I'm on the track here. I did not test
   any of this on real hardware, so I need some help in
   testing and fixing this.

I would hope to merge the entire series through the arm-soc
tree for the next merge window, along with other some of the
other platforms I worked on.

     Arnd

Arnd Bergmann (22):
  ARM: omap1: innovator: pass lcd control address as pdata
  ARM: omap1: make omapfb standalone compilable
  ARM: omap1: move omap15xx local bus handling to usb.c
  ARM: omap1: move ohci phy power handling to board files
  ARM: omap1: move mach/usb.h to include/linux/soc
  ARM: omap1: move some headers to include/linux/soc
  ARM: omap1: move perseus spi pinconf to board file
  ARM: omap1: move CF chipselect setup to board file
  fbdev: omap: avoid using mach/*.h files
  usb: omap: avoid mach/*.h headers
  clocksource: ti-dmtimer: avoid using mach/hardware.h
  serial: 8250/omap1: include linux/soc/ti/omap1-soc.h
  input: omap: void using mach/*.h headers
  ARM: omap1: use pci_ioremap_io() for omap_cf
  ARM: omap1: move mach/*.h into mach directory
  ARM: omap1: move clk support into a single file
  ARM: omap1: remove some dead clock code
  ARM: omap1: clk: rework 'struct clk'
  ARM: omap1: clk: use common_clk-like callbacks
  ARM: omap1: clk: use clk_init_data
  ARM: omap1: use common clk framework
  ARM: omap1: enable multiplatform

 arch/arm/Kconfig                              |   18 -
 arch/arm/configs/omap1_defconfig              |    3 +
 arch/arm/mach-omap1/Kconfig                   |   20 +-
 arch/arm/mach-omap1/Makefile                  |   10 +-
 arch/arm/mach-omap1/ams-delta-fiq-handler.S   |    3 +-
 arch/arm/mach-omap1/ams-delta-fiq.c           |    2 +
 arch/arm/mach-omap1/ams-delta-fiq.h           |    2 +-
 arch/arm/mach-omap1/board-ams-delta.c         |    7 +-
 arch/arm/mach-omap1/board-fsample.c           |   10 +-
 arch/arm/mach-omap1/board-generic.c           |    8 +-
 arch/arm/mach-omap1/board-h2.c                |   12 +-
 arch/arm/mach-omap1/board-h3.c                |   14 +-
 arch/arm/mach-omap1/board-htcherald.c         |   10 +-
 arch/arm/mach-omap1/board-innovator.c         |   34 +-
 arch/arm/mach-omap1/board-nokia770.c          |    9 +-
 arch/arm/mach-omap1/board-osk.c               |   68 +-
 arch/arm/mach-omap1/board-palmte.c            |   14 +-
 arch/arm/mach-omap1/board-palmtt.c            |   14 +-
 arch/arm/mach-omap1/board-palmz71.c           |   14 +-
 arch/arm/mach-omap1/board-perseus2.c          |   13 +-
 arch/arm/mach-omap1/board-sx1-mmc.c           |    3 +-
 arch/arm/mach-omap1/board-sx1.c               |   12 +-
 arch/arm/mach-omap1/clock.c                   | 1515 ++++++++++++-----
 arch/arm/mach-omap1/clock.h                   |  288 ----
 arch/arm/mach-omap1/clock_data.c              |  921 ----------
 arch/arm/mach-omap1/common.h                  |    5 +-
 arch/arm/mach-omap1/devices.c                 |    9 +-
 arch/arm/mach-omap1/fb.c                      |   19 +-
 arch/arm/mach-omap1/flash.c                   |    3 +-
 arch/arm/mach-omap1/fpga.c                    |    3 +-
 arch/arm/mach-omap1/gpio15xx.c                |    3 +-
 arch/arm/mach-omap1/gpio16xx.c                |    5 +-
 arch/arm/mach-omap1/gpio7xx.c                 |    3 +-
 .../mach-omap1/{include/mach => }/hardware.h  |  132 +-
 arch/arm/mach-omap1/i2c.c                     |    3 +-
 arch/arm/mach-omap1/id.c                      |    5 +-
 arch/arm/mach-omap1/include/mach/io.h         |   45 -
 arch/arm/mach-omap1/include/mach/lcdc.h       |   44 -
 arch/arm/mach-omap1/include/mach/memory.h     |   55 -
 arch/arm/mach-omap1/include/mach/uncompress.h |  117 --
 arch/arm/mach-omap1/io.c                      |    6 +-
 arch/arm/mach-omap1/irq.c                     |    4 +-
 arch/arm/mach-omap1/{include/mach => }/irqs.h |    2 -
 arch/arm/mach-omap1/mcbsp.c                   |    9 +-
 .../mach-omap1/{include/mach => }/mtd-xip.h   |    3 +-
 arch/arm/mach-omap1/mux.c                     |    6 +-
 arch/arm/mach-omap1/mux.h                     |  144 ++
 arch/arm/mach-omap1/ocpi.c                    |    4 +-
 .../mach-omap1/{include/mach => }/omap1510.h  |    1 -
 .../mach-omap1/{include/mach => }/omap16xx.h  |    0
 .../mach-omap1/{include/mach => }/omap7xx.h   |    0
 arch/arm/mach-omap1/opp.h                     |   26 -
 arch/arm/mach-omap1/opp_data.c                |   51 -
 arch/arm/mach-omap1/pm.c                      |    8 +-
 arch/arm/mach-omap1/pm.h                      |    2 +
 arch/arm/mach-omap1/reset.c                   |    3 +-
 arch/arm/mach-omap1/serial.c                  |    4 +-
 .../mach-omap1/{include/mach => }/serial.h    |    0
 arch/arm/mach-omap1/sleep.S                   |    2 +-
 arch/arm/mach-omap1/soc.h                     |    6 +-
 arch/arm/mach-omap1/sram.S                    |    4 +-
 arch/arm/mach-omap1/time.c                    |    2 +-
 arch/arm/mach-omap1/timer.c                   |    1 +
 arch/arm/mach-omap1/timer32k.c                |    3 +-
 arch/arm/mach-omap1/usb.c                     |   87 +-
 arch/arm/mach-omap1/usb.h                     |   25 +
 arch/arm/plat-omap/Makefile                   |    1 +
 arch/arm/plat-omap/dma.c                      |    4 +-
 arch/arm/plat-omap/include/plat/cpu.h         |   21 -
 drivers/clocksource/timer-ti-dm.c             |    2 +-
 drivers/input/keyboard/Kconfig                |    2 +-
 drivers/input/keyboard/omap-keypad.c          |    1 +
 drivers/pcmcia/Kconfig                        |    3 +-
 drivers/pcmcia/omap_cf.c                      |   47 +-
 drivers/spi/Kconfig                           |    2 +-
 drivers/spi/spi-omap-uwire.c                  |   15 +-
 drivers/tty/serial/8250/8250.h                |    1 +
 drivers/usb/gadget/udc/Kconfig                |    2 +-
 drivers/usb/gadget/udc/omap_udc.c             |    5 +-
 drivers/usb/host/Kconfig                      |    2 +-
 drivers/usb/host/ohci-omap.c                  |  111 +-
 drivers/usb/phy/Kconfig                       |    3 +-
 drivers/usb/phy/phy-isp1301-omap.c            |    6 +-
 drivers/video/backlight/Kconfig               |    4 +-
 drivers/video/backlight/omap1_bl.c            |    4 +-
 drivers/video/fbdev/Makefile                  |    2 +-
 drivers/video/fbdev/omap/Kconfig              |    4 +-
 drivers/video/fbdev/omap/Makefile             |    5 +
 drivers/video/fbdev/omap/lcd_ams_delta.c      |    2 +-
 .../video/fbdev/omap}/lcd_dma.c               |    7 +-
 .../video/fbdev/omap}/lcd_dma.h               |    2 -
 drivers/video/fbdev/omap/lcd_inn1510.c        |    9 +-
 drivers/video/fbdev/omap/lcd_osk.c            |    4 +-
 drivers/video/fbdev/omap/lcdc.c               |   10 +-
 drivers/video/fbdev/omap/lcdc.h               |   35 +
 drivers/video/fbdev/omap/omapfb.h             |    2 +
 drivers/video/fbdev/omap/omapfb_main.c        |   19 +-
 drivers/video/fbdev/omap/sossi.c              |    4 +-
 include/linux/omap-dma.h                      |    7 +-
 include/linux/platform_data/keypad-omap.h     |    5 -
 include/linux/platform_data/usb-omap1.h       |    4 +
 include/linux/soc/ti/omap1-io.h               |  143 ++
 .../mux.h => include/linux/soc/ti/omap1-mux.h |  142 +-
 .../soc.h => include/linux/soc/ti/omap1-soc.h |   22 -
 .../usb.h => include/linux/soc/ti/omap1-usb.h |   28 +-
 105 files changed, 1856 insertions(+), 2714 deletions(-)
 delete mode 100644 arch/arm/mach-omap1/clock.h
 delete mode 100644 arch/arm/mach-omap1/clock_data.c
 rename arch/arm/mach-omap1/{include/mach => }/hardware.h (59%)
 delete mode 100644 arch/arm/mach-omap1/include/mach/io.h
 delete mode 100644 arch/arm/mach-omap1/include/mach/lcdc.h
 delete mode 100644 arch/arm/mach-omap1/include/mach/memory.h
 delete mode 100644 arch/arm/mach-omap1/include/mach/uncompress.h
 rename arch/arm/mach-omap1/{include/mach => }/irqs.h (99%)
 rename arch/arm/mach-omap1/{include/mach => }/mtd-xip.h (97%)
 create mode 100644 arch/arm/mach-omap1/mux.h
 rename arch/arm/mach-omap1/{include/mach => }/omap1510.h (99%)
 rename arch/arm/mach-omap1/{include/mach => }/omap16xx.h (100%)
 rename arch/arm/mach-omap1/{include/mach => }/omap7xx.h (100%)
 delete mode 100644 arch/arm/mach-omap1/opp.h
 delete mode 100644 arch/arm/mach-omap1/opp_data.c
 rename arch/arm/mach-omap1/{include/mach => }/serial.h (100%)
 create mode 100644 arch/arm/mach-omap1/usb.h
 delete mode 100644 arch/arm/plat-omap/include/plat/cpu.h
 rename {arch/arm/mach-omap1 => drivers/video/fbdev/omap}/lcd_dma.c (98%)
 rename {arch/arm/mach-omap1/include/mach => drivers/video/fbdev/omap}/lcd_dma.h (98%)
 create mode 100644 include/linux/soc/ti/omap1-io.h
 rename arch/arm/mach-omap1/include/mach/mux.h => include/linux/soc/ti/omap1-mux.h (53%)
 rename arch/arm/mach-omap1/include/mach/soc.h => include/linux/soc/ti/omap1-soc.h (90%)
 rename arch/arm/mach-omap1/include/mach/usb.h => include/linux/soc/ti/omap1-usb.h (86%)

-- 
2.20.0

Comments

Felipe Balbi Aug. 9, 2019, 5:32 a.m. | #1
Arnd Bergmann <arnd@arndb.de> writes:

> The mach/memory.h file only exists to implement a dma offset for "Local

> Bus" devices, and that consists of the OHCI USB controller for practical

> purposes.

>

> The generic dma-mapping interface has gained this exact feature some

> years ago and can do it much more efficiently, so replace the complex

> __arch_virt_to_dma/__arch_dma_to_pfn/... logic with a much simpler boot

> time initialization.

>

> This should also make any code that performs dma mapping calls at

> runtime much more efficient, by eliminating the strcmp() along with

> the computation.

>

> Similar, a portion of the ohci-omap driver is just there for configuring

> the memory translation, this too can get moved into usb.c

>

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


For all of these patches related to usb:

Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>


Thanks for cleaning this up, Arnd.

-- 
balbi
Bartlomiej Zolnierkiewicz Aug. 9, 2019, 11:29 a.m. | #2
On 8/8/19 11:22 PM, Arnd Bergmann wrote:
> To avoid using the mach/omap1510.h header file, pass the correct

> address as platform data.

> 

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


For fbdev part:

Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>


Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> ---

>  arch/arm/mach-omap1/board-innovator.c  | 3 +++

>  drivers/video/fbdev/omap/lcd_inn1510.c | 7 +++++--

>  2 files changed, 8 insertions(+), 2 deletions(-)

> 

> diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c

> index cbe093f969d5..2425f1bacb33 100644

> --- a/arch/arm/mach-omap1/board-innovator.c

> +++ b/arch/arm/mach-omap1/board-innovator.c

> @@ -194,6 +194,9 @@ static struct platform_device innovator1510_smc91x_device = {

>  static struct platform_device innovator1510_lcd_device = {

>  	.name		= "lcd_inn1510",

>  	.id		= -1,

> +	.dev	= {

> +		.platform_data = (void __force *)OMAP1510_FPGA_LCD_PANEL_CONTROL,

> +	}

>  };

>  

>  static struct platform_device innovator1510_spi_device = {

> diff --git a/drivers/video/fbdev/omap/lcd_inn1510.c b/drivers/video/fbdev/omap/lcd_inn1510.c

> index 776e7f8d656e..37ed0c14aa5a 100644

> --- a/drivers/video/fbdev/omap/lcd_inn1510.c

> +++ b/drivers/video/fbdev/omap/lcd_inn1510.c

> @@ -14,15 +14,17 @@

>  

>  #include "omapfb.h"

>  

> +static void __iomem *omap1510_fpga_lcd_panel_control;

> +

>  static int innovator1510_panel_enable(struct lcd_panel *panel)

>  {

> -	__raw_writeb(0x7, OMAP1510_FPGA_LCD_PANEL_CONTROL);

> +	__raw_writeb(0x7, omap1510_fpga_lcd_panel_control);

>  	return 0;

>  }

>  

>  static void innovator1510_panel_disable(struct lcd_panel *panel)

>  {

> -	__raw_writeb(0x0, OMAP1510_FPGA_LCD_PANEL_CONTROL);

> +	__raw_writeb(0x0, omap1510_fpga_lcd_panel_control);

>  }

>  

>  static struct lcd_panel innovator1510_panel = {

> @@ -48,6 +50,7 @@ static struct lcd_panel innovator1510_panel = {

>  

>  static int innovator1510_panel_probe(struct platform_device *pdev)

>  {

> +	omap1510_fpga_lcd_panel_control = (void __iomem *)pdev->dev.platform_data;

>  	omapfb_register_panel(&innovator1510_panel);

>  	return 0;

>  }
Bartlomiej Zolnierkiewicz Aug. 9, 2019, 11:32 a.m. | #3
On 8/8/19 11:22 PM, Arnd Bergmann wrote:
> The omapfb driver is split into platform specific code for omap1, and

> driver code that is also specific to omap1.

> 

> Moving both parts into the driver directory simplifies the structure

> and avoids the dependency on certain omap machine header files.

> 

> The interrupt numbers in particular however must not be referenced

> directly from the driver to allow building in a multiplatform

> configuration, so these have to be passed through resources, is

> done for all other omap drivers.

> 

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


For fbdev part:

Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>


[ It seems that adding of static inline for omap_set_dma_priority()
  when ARCH_OMAP=n should be in patch #9 but this is a minor issue. ]

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> ---

>  arch/arm/mach-omap1/Makefile                  |  4 --

>  arch/arm/mach-omap1/fb.c                      | 19 +++++++-

>  arch/arm/mach-omap1/include/mach/lcdc.h       | 44 -------------------

>  drivers/video/fbdev/Makefile                  |  2 +-

>  drivers/video/fbdev/omap/Makefile             |  5 +++

>  .../video/fbdev/omap}/lcd_dma.c               |  4 +-

>  .../video/fbdev/omap}/lcd_dma.h               |  2 -

>  drivers/video/fbdev/omap/lcdc.c               |  8 ++--

>  drivers/video/fbdev/omap/lcdc.h               | 35 +++++++++++++++

>  drivers/video/fbdev/omap/omapfb.h             |  2 +

>  drivers/video/fbdev/omap/omapfb_main.c        | 16 ++++++-

>  drivers/video/fbdev/omap/sossi.c              |  3 +-

>  include/linux/omap-dma.h                      |  7 ++-

>  13 files changed, 90 insertions(+), 61 deletions(-)

>  delete mode 100644 arch/arm/mach-omap1/include/mach/lcdc.h

>  rename {arch/arm/mach-omap1 => drivers/video/fbdev/omap}/lcd_dma.c (99%)

>  rename {arch/arm/mach-omap1/include/mach => drivers/video/fbdev/omap}/lcd_dma.h (98%)

> 

> diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile

> index c757a52d0801..450bbf552b57 100644

> --- a/arch/arm/mach-omap1/Makefile

> +++ b/arch/arm/mach-omap1/Makefile

> @@ -57,7 +57,3 @@ obj-$(CONFIG_ARCH_OMAP730)		+= gpio7xx.o

>  obj-$(CONFIG_ARCH_OMAP850)		+= gpio7xx.o

>  obj-$(CONFIG_ARCH_OMAP15XX)		+= gpio15xx.o

>  obj-$(CONFIG_ARCH_OMAP16XX)		+= gpio16xx.o

> -

> -ifneq ($(CONFIG_FB_OMAP),)

> -obj-y += lcd_dma.o

> -endif

> diff --git a/arch/arm/mach-omap1/fb.c b/arch/arm/mach-omap1/fb.c

> index 0e32a959f254..b093375afc27 100644

> --- a/arch/arm/mach-omap1/fb.c

> +++ b/arch/arm/mach-omap1/fb.c

> @@ -17,9 +17,12 @@

>  #include <linux/io.h>

>  #include <linux/omapfb.h>

>  #include <linux/dma-mapping.h>

> +#include <linux/irq.h>

>  

>  #include <asm/mach/map.h>

>  

> +#include <mach/irqs.h>

> +

>  #if IS_ENABLED(CONFIG_FB_OMAP)

>  

>  static bool omapfb_lcd_configured;

> @@ -27,6 +30,19 @@ static struct omapfb_platform_data omapfb_config;

>  

>  static u64 omap_fb_dma_mask = ~(u32)0;

>  

> +struct resource omap_fb_resources[] = {

> +	{

> +		.name  = "irq",

> +		.start = INT_LCD_CTRL,

> +		.flags = IORESOURCE_IRQ,

> +	},

> +	{

> +		.name  = "irq",

> +		.start = INT_SOSSI_MATCH,

> +		.flags = IORESOURCE_IRQ,

> +	},

> +};

> +

>  static struct platform_device omap_fb_device = {

>  	.name		= "omapfb",

>  	.id		= -1,

> @@ -35,7 +51,8 @@ static struct platform_device omap_fb_device = {

>  		.coherent_dma_mask	= DMA_BIT_MASK(32),

>  		.platform_data		= &omapfb_config,

>  	},

> -	.num_resources = 0,

> +	.num_resources = ARRAY_SIZE(omap_fb_resources),

> +	.resource = omap_fb_resources,

>  };

>  

>  void __init omapfb_set_lcd_config(const struct omap_lcd_config *config)

> diff --git a/arch/arm/mach-omap1/include/mach/lcdc.h b/arch/arm/mach-omap1/include/mach/lcdc.h

> deleted file mode 100644

> index 7152db1f5361..000000000000

> --- a/arch/arm/mach-omap1/include/mach/lcdc.h

> +++ /dev/null

> @@ -1,44 +0,0 @@

> -/* SPDX-License-Identifier: GPL-2.0-or-later */

> -/*

> - * arch/arm/mach-omap1/include/mach/lcdc.h

> - *

> - * Extracted from drivers/video/omap/lcdc.c

> - * Copyright (C) 2004 Nokia Corporation

> - * Author: Imre Deak <imre.deak@nokia.com>

> - */

> -#ifndef __MACH_LCDC_H__

> -#define __MACH_LCDC_H__

> -

> -#define OMAP_LCDC_BASE			0xfffec000

> -#define OMAP_LCDC_SIZE			256

> -#define OMAP_LCDC_IRQ			INT_LCD_CTRL

> -

> -#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)

> -#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)

> -#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)

> -#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)

> -#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)

> -#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)

> -#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)

> -#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)

> -

> -#define OMAP_LCDC_STAT_DONE		(1 << 0)

> -#define OMAP_LCDC_STAT_VSYNC		(1 << 1)

> -#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)

> -#define OMAP_LCDC_STAT_ABC		(1 << 3)

> -#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)

> -#define OMAP_LCDC_STAT_FUF		(1 << 5)

> -#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)

> -

> -#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)

> -#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)

> -#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)

> -

> -#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)

> -#define OMAP_LCDC_IRQ_DONE		(1 << 3)

> -#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)

> -#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)

> -#define OMAP_LCDC_IRQ_LINE		(1 << 6)

> -#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)

> -

> -#endif /* __MACH_LCDC_H__ */

> diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile

> index aab7155884ea..3324301e4c36 100644

> --- a/drivers/video/fbdev/Makefile

> +++ b/drivers/video/fbdev/Makefile

> @@ -111,7 +111,7 @@ obj-$(CONFIG_FB_UDL)		  += udlfb.o

>  obj-$(CONFIG_FB_SMSCUFX)	  += smscufx.o

>  obj-$(CONFIG_FB_XILINX)           += xilinxfb.o

>  obj-$(CONFIG_FB_SH_MOBILE_LCDC)	  += sh_mobile_lcdcfb.o

> -obj-$(CONFIG_FB_OMAP)             += omap/

> +obj-y				  += omap/

>  obj-y                             += omap2/

>  obj-$(CONFIG_XEN_FBDEV_FRONTEND)  += xen-fbfront.o

>  obj-$(CONFIG_FB_CARMINE)          += carminefb.o

> diff --git a/drivers/video/fbdev/omap/Makefile b/drivers/video/fbdev/omap/Makefile

> index daaa73a94e7f..b88e02f5cb1f 100644

> --- a/drivers/video/fbdev/omap/Makefile

> +++ b/drivers/video/fbdev/omap/Makefile

> @@ -5,6 +5,11 @@

>  

>  obj-$(CONFIG_FB_OMAP) += omapfb.o

>  

> +ifdef CONFIG_FB_OMAP

> +# must be built-in

> +obj-y += lcd_dma.o

> +endif

> +

>  objs-yy := omapfb_main.o lcdc.o

>  

>  objs-y$(CONFIG_FB_OMAP_LCDC_EXTERNAL) += sossi.o

> diff --git a/arch/arm/mach-omap1/lcd_dma.c b/drivers/video/fbdev/omap/lcd_dma.c

> similarity index 99%

> rename from arch/arm/mach-omap1/lcd_dma.c

> rename to drivers/video/fbdev/omap/lcd_dma.c

> index a72ac0c02b4f..867a63c06f42 100644

> --- a/arch/arm/mach-omap1/lcd_dma.c

> +++ b/drivers/video/fbdev/omap/lcd_dma.c

> @@ -26,7 +26,9 @@

>  #include <linux/omap-dma.h>

>  

>  #include <mach/hardware.h>

> -#include <mach/lcdc.h>

> +

> +#include "lcdc.h"

> +#include "lcd_dma.h"

>  

>  int omap_lcd_dma_running(void)

>  {

> diff --git a/arch/arm/mach-omap1/include/mach/lcd_dma.h b/drivers/video/fbdev/omap/lcd_dma.h

> similarity index 98%

> rename from arch/arm/mach-omap1/include/mach/lcd_dma.h

> rename to drivers/video/fbdev/omap/lcd_dma.h

> index 1a3c0cf17899..1b4780197381 100644

> --- a/arch/arm/mach-omap1/include/mach/lcd_dma.h

> +++ b/drivers/video/fbdev/omap/lcd_dma.h

> @@ -60,6 +60,4 @@ extern void omap_set_lcd_dma_b1_vxres(unsigned long vxres);

>  extern void omap_set_lcd_dma_b1_mirror(int mirror);

>  extern void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale);

>  

> -extern int omap_lcd_dma_running(void);

> -

>  #endif /* __MACH_OMAP1_LCD_DMA_H__ */

> diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c

> index fa73acfc1371..65953b7fbdb9 100644

> --- a/drivers/video/fbdev/omap/lcdc.c

> +++ b/drivers/video/fbdev/omap/lcdc.c

> @@ -17,7 +17,6 @@

>  #include <linux/clk.h>

>  #include <linux/gfp.h>

>  

> -#include <mach/lcdc.h>

>  #include <linux/omap-dma.h>

>  

>  #include <asm/mach-types.h>

> @@ -25,6 +24,7 @@

>  #include "omapfb.h"

>  

>  #include "lcdc.h"

> +#include "lcd_dma.h"

>  

>  #define MODULE_NAME			"lcdc"

>  

> @@ -713,7 +713,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode,

>  	}

>  	clk_enable(lcdc.lcd_ck);

>  

> -	r = request_irq(OMAP_LCDC_IRQ, lcdc_irq_handler, 0, MODULE_NAME, fbdev);

> +	r = request_irq(fbdev->int_irq, lcdc_irq_handler, 0, MODULE_NAME, fbdev);

>  	if (r) {

>  		dev_err(fbdev->dev, "unable to get IRQ\n");

>  		goto fail2;

> @@ -744,7 +744,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode,

>  fail4:

>  	omap_free_lcd_dma();

>  fail3:

> -	free_irq(OMAP_LCDC_IRQ, lcdc.fbdev);

> +	free_irq(fbdev->int_irq, lcdc.fbdev);

>  fail2:

>  	clk_disable(lcdc.lcd_ck);

>  fail1:

> @@ -759,7 +759,7 @@ static void omap_lcdc_cleanup(void)

>  		free_palette_ram();

>  	free_fbmem();

>  	omap_free_lcd_dma();

> -	free_irq(OMAP_LCDC_IRQ, lcdc.fbdev);

> +	free_irq(lcdc.fbdev->int_irq, lcdc.fbdev);

>  	clk_disable(lcdc.lcd_ck);

>  	clk_put(lcdc.lcd_ck);

>  }

> diff --git a/drivers/video/fbdev/omap/lcdc.h b/drivers/video/fbdev/omap/lcdc.h

> index 8a7607d861c1..cbbfd9b9e949 100644

> --- a/drivers/video/fbdev/omap/lcdc.h

> +++ b/drivers/video/fbdev/omap/lcdc.h

> @@ -1,6 +1,41 @@

>  /* SPDX-License-Identifier: GPL-2.0 */

>  #ifndef LCDC_H

>  #define LCDC_H

> +/*

> + * Copyright (C) 2004 Nokia Corporation

> + * Author: Imre Deak <imre.deak@nokia.com>

> + */

> +#define OMAP_LCDC_BASE			0xfffec000

> +#define OMAP_LCDC_SIZE			256

> +#define OMAP_LCDC_IRQ			INT_LCD_CTRL

> +

> +#define OMAP_LCDC_CONTROL		(OMAP_LCDC_BASE + 0x00)

> +#define OMAP_LCDC_TIMING0		(OMAP_LCDC_BASE + 0x04)

> +#define OMAP_LCDC_TIMING1		(OMAP_LCDC_BASE + 0x08)

> +#define OMAP_LCDC_TIMING2		(OMAP_LCDC_BASE + 0x0c)

> +#define OMAP_LCDC_STATUS		(OMAP_LCDC_BASE + 0x10)

> +#define OMAP_LCDC_SUBPANEL		(OMAP_LCDC_BASE + 0x14)

> +#define OMAP_LCDC_LINE_INT		(OMAP_LCDC_BASE + 0x18)

> +#define OMAP_LCDC_DISPLAY_STATUS	(OMAP_LCDC_BASE + 0x1c)

> +

> +#define OMAP_LCDC_STAT_DONE		(1 << 0)

> +#define OMAP_LCDC_STAT_VSYNC		(1 << 1)

> +#define OMAP_LCDC_STAT_SYNC_LOST	(1 << 2)

> +#define OMAP_LCDC_STAT_ABC		(1 << 3)

> +#define OMAP_LCDC_STAT_LINE_INT		(1 << 4)

> +#define OMAP_LCDC_STAT_FUF		(1 << 5)

> +#define OMAP_LCDC_STAT_LOADED_PALETTE	(1 << 6)

> +

> +#define OMAP_LCDC_CTRL_LCD_EN		(1 << 0)

> +#define OMAP_LCDC_CTRL_LCD_TFT		(1 << 7)

> +#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL	(1 << 10)

> +

> +#define OMAP_LCDC_IRQ_VSYNC		(1 << 2)

> +#define OMAP_LCDC_IRQ_DONE		(1 << 3)

> +#define OMAP_LCDC_IRQ_LOADED_PALETTE	(1 << 4)

> +#define OMAP_LCDC_IRQ_LINE_NIRQ		(1 << 5)

> +#define OMAP_LCDC_IRQ_LINE		(1 << 6)

> +#define OMAP_LCDC_IRQ_MASK		(((1 << 5) - 1) << 2)

>  

>  int omap_lcdc_set_dma_callback(void (*callback)(void *data), void *data);

>  void omap_lcdc_free_dma_callback(void);

> diff --git a/drivers/video/fbdev/omap/omapfb.h b/drivers/video/fbdev/omap/omapfb.h

> index d930152c289c..313a051fe7a4 100644

> --- a/drivers/video/fbdev/omap/omapfb.h

> +++ b/drivers/video/fbdev/omap/omapfb.h

> @@ -204,6 +204,8 @@ struct omapfb_device {

>  	struct lcd_panel	*panel;			/* LCD panel */

>  	const struct lcd_ctrl	*ctrl;			/* LCD controller */

>  	const struct lcd_ctrl	*int_ctrl;		/* internal LCD ctrl */

> +	int			ext_irq;

> +	int			int_irq;

>  	struct lcd_ctrl_extif	*ext_if;		/* LCD ctrl external

>  							   interface */

>  	struct device		*dev;

> diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c

> index 90eca64e3144..dc06057de91d 100644

> --- a/drivers/video/fbdev/omap/omapfb_main.c

> +++ b/drivers/video/fbdev/omap/omapfb_main.c

> @@ -1618,7 +1618,7 @@ static int omapfb_do_probe(struct platform_device *pdev,

>  

>  	init_state = 0;

>  

> -	if (pdev->num_resources != 0) {

> +	if (pdev->num_resources != 1) {

>  		dev_err(&pdev->dev, "probed for an unknown device\n");

>  		r = -ENODEV;

>  		goto cleanup;

> @@ -1637,6 +1637,20 @@ static int omapfb_do_probe(struct platform_device *pdev,

>  		r = -ENOMEM;

>  		goto cleanup;

>  	}

> +	fbdev->int_irq = platform_get_irq(pdev, 0);

> +	if (!fbdev->int_irq) {

> +		dev_err(&pdev->dev, "unable to get irq\n");

> +		r = ENXIO;

> +		goto cleanup;

> +	}

> +

> +	fbdev->ext_irq = platform_get_irq(pdev, 1);

> +	if (!fbdev->ext_irq) {

> +		dev_err(&pdev->dev, "unable to get irq\n");

> +		r = ENXIO;

> +		goto cleanup;

> +	}

> +

>  	init_state++;

>  

>  	fbdev->dev = &pdev->dev;

> diff --git a/drivers/video/fbdev/omap/sossi.c b/drivers/video/fbdev/omap/sossi.c

> index 80ac67f27f0d..ade9d452254c 100644

> --- a/drivers/video/fbdev/omap/sossi.c

> +++ b/drivers/video/fbdev/omap/sossi.c

> @@ -15,6 +15,7 @@

>  #include <linux/omap-dma.h>

>  

>  #include "omapfb.h"

> +#include "lcd_dma.h"

>  #include "lcdc.h"

>  

>  #define MODULE_NAME		"omapfb-sossi"

> @@ -638,7 +639,7 @@ static int sossi_init(struct omapfb_device *fbdev)

>  	l &= ~(1 << 31); /* REORDERING */

>  	sossi_write_reg(SOSSI_INIT1_REG, l);

>  

> -	if ((r = request_irq(INT_1610_SoSSI_MATCH, sossi_match_irq,

> +	if ((r = request_irq(fbdev->ext_irq, sossi_match_irq,

>  			     IRQ_TYPE_EDGE_FALLING,

>  	     "sossi_match", sossi.fbdev->dev)) < 0) {

>  		dev_err(sossi.fbdev->dev, "can't get SoSSI match IRQ\n");

> diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h

> index ba3cfbb52312..e9d76ac6321d 100644

> --- a/include/linux/omap-dma.h

> +++ b/include/linux/omap-dma.h

> @@ -346,8 +346,8 @@ extern void omap_dma_set_global_params(int arb_rate, int max_fifo_depth,

>  void omap_dma_global_context_save(void);

>  void omap_dma_global_context_restore(void);

>  

> -#if defined(CONFIG_ARCH_OMAP1) && IS_ENABLED(CONFIG_FB_OMAP)

> -#include <mach/lcd_dma.h>

> +#if IS_ENABLED(CONFIG_FB_OMAP)

> +extern int omap_lcd_dma_running(void);

>  #else

>  static inline int omap_lcd_dma_running(void)

>  {

> @@ -356,6 +356,9 @@ static inline int omap_lcd_dma_running(void)

>  #endif

>  

>  #else /* CONFIG_ARCH_OMAP */

> +static inline void omap_set_dma_priority(int lch, int dst_port, int priority)

> +{

> +}

>  

>  static inline struct omap_system_dma_plat_info *omap_get_plat_info(void)

>  {
Arnd Bergmann Aug. 9, 2019, 11:43 a.m. | #4
On Fri, Aug 9, 2019 at 1:32 PM Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
> On 8/8/19 11:22 PM, Arnd Bergmann wrote:

> > The omapfb driver is split into platform specific code for omap1, and

> > driver code that is also specific to omap1.

> >

> > Moving both parts into the driver directory simplifies the structure

> > and avoids the dependency on certain omap machine header files.

> >

> > The interrupt numbers in particular however must not be referenced

> > directly from the driver to allow building in a multiplatform

> > configuration, so these have to be passed through resources, is

> > done for all other omap drivers.

> >

> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

>

> For fbdev part:

>

> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>


Thanks for taking a look.

> [ It seems that adding of static inline for omap_set_dma_priority()

>   when ARCH_OMAP=n should be in patch #9 but this is a minor issue. ]


That would have been ok as well, but having the addition here was
intentional and seems more logical to me as this is where the headers
get moved around.

      Arnd
Bartlomiej Zolnierkiewicz Aug. 9, 2019, 2:36 p.m. | #5
On 8/9/19 1:43 PM, Arnd Bergmann wrote:
> On Fri, Aug 9, 2019 at 1:32 PM Bartlomiej Zolnierkiewicz

> <b.zolnierkie@samsung.com> wrote:

>> On 8/8/19 11:22 PM, Arnd Bergmann wrote:

>>> The omapfb driver is split into platform specific code for omap1, and

>>> driver code that is also specific to omap1.

>>>

>>> Moving both parts into the driver directory simplifies the structure

>>> and avoids the dependency on certain omap machine header files.

>>>

>>> The interrupt numbers in particular however must not be referenced

>>> directly from the driver to allow building in a multiplatform

>>> configuration, so these have to be passed through resources, is

>>> done for all other omap drivers.

>>>

>>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

>>

>> For fbdev part:

>>

>> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

> 

> Thanks for taking a look.

> 

>> [ It seems that adding of static inline for omap_set_dma_priority()

>>   when ARCH_OMAP=n should be in patch #9 but this is a minor issue. ]

> 

> That would have been ok as well, but having the addition here was

> intentional and seems more logical to me as this is where the headers

> get moved around.

I see that this is an optimization for making the patch series more
compact but I think that this addition logically belongs to patch #9
(which adds support for COMPILE_TEST) where the new code is required.

Moreover patch description for patch #2 lacks any comment about this
addition being a preparation for changes in patch #9 so I was quite
puzzled about its purpose when seeing it first.

Therefore please have mercy on the poor/stupid reviewer and don't do
such optimizations intentionally (or at least describe them properly
somewhere).. ;-)

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
Arnd Bergmann Aug. 9, 2019, 7:55 p.m. | #6
On Fri, Aug 9, 2019 at 4:36 PM Bartlomiej Zolnierkiewicz
<b.zolnierkie@samsung.com> wrote:
> On 8/9/19 1:43 PM, Arnd Bergmann wrote:


> >

> > That would have been ok as well, but having the addition here was

> > intentional and seems more logical to me as this is where the headers

> > get moved around.

> I see that this is an optimization for making the patch series more

> compact but I think that this addition logically belongs to patch #9

> (which adds support for COMPILE_TEST) where the new code is required.

>

> Moreover patch description for patch #2 lacks any comment about this

> addition being a preparation for changes in patch #9 so I was quite

> puzzled about its purpose when seeing it first.

>

> Therefore please have mercy on the poor/stupid reviewer and don't do

> such optimizations intentionally (or at least describe them properly

> somewhere).. ;-)


Ok, I looked at it some more and agree that you are right. I've split it
up further now into patches that make more sense by themselves:

commit ad71cdc54404ecde2e88678ee6bc7ae7fb8aec97
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Tue Aug 6 16:08:34 2019 +0200

    fbdev: omap: avoid using mach/*.h files

    All the headers we actually need are now in include/linux/soc,
    so use those versions instead and allow compile-testing on
    other architectures.

    Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>


 drivers/video/backlight/Kconfig          | 4 ++--
 drivers/video/backlight/omap1_bl.c       | 4 ++--
 drivers/video/fbdev/omap/Kconfig         | 4 ++--
 drivers/video/fbdev/omap/lcd_ams_delta.c | 2 +-
 drivers/video/fbdev/omap/lcd_dma.c       | 3 ++-
 drivers/video/fbdev/omap/lcd_inn1510.c   | 2 +-
 drivers/video/fbdev/omap/lcd_osk.c       | 4 ++--
 drivers/video/fbdev/omap/lcdc.c          | 2 ++
 drivers/video/fbdev/omap/omapfb_main.c   | 3 +--
 drivers/video/fbdev/omap/sossi.c         | 1 +
 10 files changed, 16 insertions(+), 13 deletions(-)

commit 959e0d68751757e84dd703f60405c7268763dba4
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Fri Aug 9 21:27:01 2019 +0200

    fbdev: omap: pass irqs as resource

    To avoid relying on the mach/irqs.h header, stop using
    OMAP_LCDC_IRQ and INT_1610_SoSSI_MATCH directly in the driver
    code, but instead pass these as resources.

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>


 arch/arm/mach-omap1/fb.c               | 19 ++++++++++++++++++-
 drivers/video/fbdev/omap/lcdc.c        |  6 +++---
 drivers/video/fbdev/omap/omapfb.h      |  2 ++
 drivers/video/fbdev/omap/omapfb_main.c | 16 +++++++++++++++-
 drivers/video/fbdev/omap/sossi.c       |  2 +-
 5 files changed, 39 insertions(+), 6 deletions(-)


commit 6643f7a7da3ca7ce8f2ff094fecab7a0fd706acf
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Fri Aug 9 21:42:31 2019 +0200

    ARM: omap1: declare a dummy omap_set_dma_priority

    omapfb calls directly into the omap_set_dma_priority() function in
    the DMA driver. This prevents compile-testing omapfb on other
    architectures. Add an inline function next to the other ones
    for non-omap configurations.

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>


 include/linux/omap-dma.h | 3 +++
 1 file changed, 3 insertions(+)

commit 154bfb7ddcecdbca66d9a086776a3108831ef0b9
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Mon Aug 5 23:15:37 2019 +0200

    ARM: omap1: move lcd_dma code into omapfb driver

    The omapfb driver is split into platform specific code for omap1, and
    driver code that is also specific to omap1.

    Moving both parts into the driver directory simplifies the structure
    and avoids the dependency on certain omap machine header files.

    As mach/lcd_dma.h can not be included from include/linux/omap-dma.h
    any more now, move the omap_lcd_dma_running() declaration into the
    omap-dma header, which matches where it is defined.

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>


 arch/arm/mach-omap1/Makefile
   |  4 ----
 arch/arm/mach-omap1/include/mach/lcdc.h
   | 44 --------------------------------------------
 drivers/video/fbdev/Makefile
   |  2 +-
 drivers/video/fbdev/omap/Makefile
   |  5 +++++
 {arch/arm/mach-omap1 => drivers/video/fbdev/omap}/lcd_dma.c
   |  4 +++-
 {arch/arm/mach-omap1/include/mach =>
drivers/video/fbdev/omap}/lcd_dma.h |  2 --
 drivers/video/fbdev/omap/lcdc.c
   |  2 +-
 drivers/video/fbdev/omap/lcdc.h
   | 35 +++++++++++++++++++++++++++++++++++
 drivers/video/fbdev/omap/sossi.c                                         |  1 +
 include/linux/omap-dma.h
   |  4 ++--
 10 files changed, 48 insertions(+), 55 deletions(-)

commit b8ddb98d29a43fecb4387d0d8218935cb1997a28
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Tue Aug 6 14:59:00 2019 +0200

    ARM: omap1: innovator: pass lcd control address as pdata

    To avoid using the mach/omap1510.h header file, pass the correct
    address as platform data.

    Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

    Signed-off-by: Arnd Bergmann <arnd@arndb.de>


 arch/arm/mach-omap1/board-innovator.c  | 3 +++
 drivers/video/fbdev/omap/lcd_inn1510.c | 7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

The resulting code is the same as before, I'll post that again along
the rest of the series next week. Should I add your Ack to each
patch already?

       Arnd
Christoph Hellwig Aug. 10, 2019, 10:28 a.m. | #7
Thanks for doing this!  The odd platforms have always been very
confusing.

> diff --git a/arch/arm/mach-omap1/include/mach/omap1510.h b/arch/arm/mach-omap1/include/mach/omap1510.h

> index 3d235244bf5c..7af9c0c7c5ab 100644

> --- a/arch/arm/mach-omap1/include/mach/omap1510.h

> +++ b/arch/arm/mach-omap1/include/mach/omap1510.h

> @@ -159,4 +159,3 @@

>  #define OMAP1510_INT_FPGA23		(OMAP_FPGA_IRQ_BASE + 23)

>  

>  #endif /*  __ASM_ARCH_OMAP15XX_H */

> -


Spurious whitespace change?

> diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c

> index d8e9bbda8f7b..740c876ae46b 100644

> --- a/arch/arm/mach-omap1/usb.c

> +++ b/arch/arm/mach-omap1/usb.c

> @@ -10,6 +10,7 @@

>  #include <linux/init.h>

>  #include <linux/platform_device.h>

>  #include <linux/io.h>

> +#include <linux/delay.h>

>  

>  #include <asm/irq.h>

>  

> @@ -127,6 +128,7 @@ omap_otg_init(struct omap_usb_config *config)

>  

>  		syscon &= ~HST_IDLE_EN;

>  		ohci_device->dev.platform_data = config;

> +

>  		status = platform_device_register(ohci_device);


Same here.

> +#define OMAP1510_LB_OFFSET	   UL(0x30000000)

> +#define OMAP1510_LB_DMA_PFN_OFFSET ((OMAP1510_LB_OFFSET - PAGE_OFFSET) >> PAGE_SHIFT)


Overly long line.

> +/*

> + * OMAP-1510 specific Local Bus clock on/off

> + */

> +static int omap_1510_local_bus_power(int on)

> +{

> +	if (on) {

> +		omap_writel((1 << 1) | (1 << 0), OMAP1510_LB_MMU_CTL);

> +		udelay(200);

> +	} else {

> +		omap_writel(0, OMAP1510_LB_MMU_CTL);

> +	}

> +

> +	return 0;

> +}


The caller never checks the const return value, and on is always true as
well.  In fact it seems like omap_1510_local_bus_power and
omap_1510_local_bus_init could probably just be merged into the caller.

> +

> +/*

> + * OMAP-1510 specific Local Bus initialization

> + * NOTE: This assumes 32MB memory size in OMAP1510LB_MEMSIZE.

> + *       See also arch/mach-omap/memory.h for __virt_to_dma() and

> + *       __dma_to_virt() which need to match with the physical

> + *       Local Bus address below.


I think that NOTE is out of date, as __virt_to_dma and __dma_to_virt
don't exist anymore.

> +static int omap_1510_local_bus_init(void)

> +{

> +	unsigned int tlb;

> +	unsigned long lbaddr, physaddr;

> +

> +	omap_writel((omap_readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4,

> +	       OMAP1510_LB_CLOCK_DIV);

> +

> +	/* Configure the Local Bus MMU table */

> +	for (tlb = 0; tlb < OMAP1510_LB_MEMSIZE; tlb++) {

> +		lbaddr = tlb * 0x00100000 + OMAP1510_LB_OFFSET;

> +		physaddr = tlb * 0x00100000 + PHYS_OFFSET;

> +		omap_writel((lbaddr & 0x0fffffff) >> 22, OMAP1510_LB_MMU_CAM_H);

> +		omap_writel(((lbaddr & 0x003ffc00) >> 6) | 0xc,

> +		       OMAP1510_LB_MMU_CAM_L);

> +		omap_writel(physaddr >> 16, OMAP1510_LB_MMU_RAM_H);

> +		omap_writel((physaddr & 0x0000fc00) | 0x300, OMAP1510_LB_MMU_RAM_L);


Another > 80 chars line.

> +		omap_writel(tlb << 4, OMAP1510_LB_MMU_LCK);

> +		omap_writel(0x1, OMAP1510_LB_MMU_LD_TLB);

> +	}

> +

> +	/* Enable the walking table */

> +	omap_writel(omap_readl(OMAP1510_LB_MMU_CTL) | (1 << 3), OMAP1510_LB_MMU_CTL);


One more.

> +	udelay(200);

> +

> +	return 0;


The return value is ignored.