Commit 81a3c10c authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'next/cleanup2' of git://git.linaro.org/people/arnd/arm-soc

* 'next/cleanup2' of git://git.linaro.org/people/arnd/arm-soc: (31 commits)
  ARM: OMAP: Warn if omap_ioremap is called before SoC detection
  ARM: OMAP: Move set_globals initialization to happen in init_early
  ARM: OMAP: Map SRAM later on with ioremap_exec()
  ARM: OMAP: Remove calls to SRAM allocations for framebuffer
  ARM: OMAP: Avoid cpu_is_omapxxxx usage until map_io is done
  ARM: OMAP1: Use generic map_io, init_early and init_irq
  arm/dts: OMAP3+: Add mpu, dsp and iva nodes
  arm/dts: OMAP4: Add a main ocp entry bound to l3-noc driver
  ARM: OMAP2+: l3-noc: Add support for device-tree
  ARM: OMAP2+: board-generic: Add i2c static init
  ARM: OMAP2+: board-generic: Add DT support to generic board
  arm/dts: Add support for OMAP3 Beagle board
  arm/dts: Add initial device tree support for OMAP3 SoC
  arm/dts: Add support for OMAP4 SDP board
  arm/dts: Add support for OMAP4 PandaBoard
  arm/dts: Add initial device tree support for OMAP4 SoC
  ARM: OMAP: omap_device: Add a method to build an omap_device from a DT node
  ARM: OMAP: omap_device: Add omap_device_[alloc|delete] for DT integration
  of: Add helpers to get one string in multiple strings property
  ARM: OMAP2+: devices: Remove all omap_device_pm_latency structures
  ...

Fix up trivial header file conflicts in arch/arm/mach-omap2/board-generic.c
parents 6585dea1 df80442d
* TI - DSP (Digital Signal Processor)
TI DSP included in OMAP SoC
Required properties:
- compatible : Should be "ti,omap3-c64" for OMAP3 & 4
- ti,hwmods: "dsp"
Examples:
dsp {
compatible = "ti,omap3-c64";
ti,hwmods = "dsp";
};
* TI - IVA (Imaging and Video Accelerator) subsystem
The IVA contain various audio, video or imaging HW accelerator
depending of the version.
Required properties:
- compatible : Should be:
- "ti,ivahd" for OMAP4
- "ti,iva2.2" for OMAP3
- "ti,iva2.1" for OMAP2430
- "ti,iva1" for OMAP2420
- ti,hwmods: "iva"
Examples:
iva {
compatible = "ti,ivahd", "ti,iva";
ti,hwmods = "iva";
};
* TI - L3 Network On Chip (NoC)
This version is an implementation of the generic NoC IP
provided by Arteris.
Required properties:
- compatible : Should be "ti,omap3-l3-smx" for OMAP3 family
Should be "ti,omap4-l3-noc" for OMAP4 family
- ti,hwmods: "l3_main_1", ... One hwmod for each noc domain.
Examples:
ocp {
compatible = "ti,omap4-l3-noc", "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges;
ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
};
* TI - MPU (Main Processor Unit) subsystem
The MPU subsystem contain one or several ARM cores
depending of the version.
The MPU contain CPUs, GIC, L2 cache and a local PRCM.
Required properties:
- compatible : Should be "ti,omap3-mpu" for OMAP3
Should be "ti,omap4-mpu" for OMAP4
- ti,hwmods: "mpu"
Examples:
- For an OMAP4 SMP system:
mpu {
compatible = "ti,omap4-mpu";
ti,hwmods = "mpu";
};
- For an OMAP3 monocore system:
mpu {
compatible = "ti,omap3-mpu";
ti,hwmods = "mpu";
};
* Texas Instruments OMAP
OMAP is currently using a static file per SoC family to describe the
IPs present in the SoC.
On top of that an omap_device is created to extend the platform_device
capabilities and to allow binding with one or several hwmods.
The hwmods will contain all the information to build the device:
adresse range, irq lines, dma lines, interconnect, PRCM register,
clock domain, input clocks.
For the moment just point to the existing hwmod, the next step will be
to move data from hwmod to device-tree representation.
Required properties:
- compatible: Every devices present in OMAP SoC should be in the
form: "ti,XXX"
- ti,hwmods: list of hwmod names (ascii strings), that comes from the OMAP
HW documentation, attached to a device. Must contain at least
one hwmod.
Optional properties:
- ti,no_idle_on_suspend: When present, it prevents the PM to idle the module
during suspend.
Example:
spinlock@1 {
compatible = "ti,omap4-spinlock";
ti,hwmods = "spinlock";
};
Boards:
- OMAP3 BeagleBoard : Low cost community board
compatible = "ti,omap3-beagle", "ti,omap3"
- OMAP4 SDP : Software Developement Board
compatible = "ti,omap4-sdp", "ti,omap4430"
- OMAP4 PandaBoard : Low cost community board
compatible = "ti,omap4-panda", "ti,omap4430"
/*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/include/ "omap3.dtsi"
/ {
model = "TI OMAP3 BeagleBoard";
compatible = "ti,omap3-beagle", "ti,omap3";
/*
* Since the initial device tree board file does not create any
* devices (MMC, network...), the only way to boot is to provide a
* ramdisk.
*/
chosen {
bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug earlyprintk";
};
memory {
device_type = "memory";
reg = <0x80000000 0x20000000>; /* 512 MB */
};
};
/*
* Device Tree Source for OMAP3 SoC
*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied.
*/
/include/ "skeleton.dtsi"
/ {
compatible = "ti,omap3430", "ti,omap3";
cpus {
cpu@0 {
compatible = "arm,cortex-a8";
};
};
/*
* The soc node represents the soc top level view. It is uses for IPs
* that are not memory mapped in the MPU view or for the MPU itself.
*/
soc {
compatible = "ti,omap-infra";
mpu {
compatible = "ti,omap3-mpu";
ti,hwmods = "mpu";
};
iva {
compatible = "ti,iva2.2";
ti,hwmods = "iva";
dsp {
compatible = "ti,omap3-c64";
};
};
};
/*
* XXX: Use a flat representation of the OMAP3 interconnect.
* The real OMAP interconnect network is quite complex.
* Since that will not bring real advantage to represent that in DT for
* the moment, just use a fake OCP bus entry to represent the whole bus
* hierarchy.
*/
ocp {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges;
ti,hwmods = "l3_main";
intc: interrupt-controller@1 {
compatible = "ti,omap3-intc";
interrupt-controller;
#interrupt-cells = <1>;
};
};
};
/*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/include/ "omap4.dtsi"
/ {
model = "TI OMAP4 PandaBoard";
compatible = "ti,omap4-panda", "ti,omap4430", "ti,omap4";
/*
* Since the initial device tree board file does not create any
* devices (MMC, network...), the only way to boot is to provide a
* ramdisk.
*/
chosen {
bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug";
};
memory {
device_type = "memory";
reg = <0x80000000 0x40000000>; /* 1 GB */
};
};
/*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/include/ "omap4.dtsi"
/ {
model = "TI OMAP4 SDP board";
compatible = "ti,omap4-sdp", "ti,omap4430", "ti,omap4";
/*
* Since the initial device tree board file does not create any
* devices (MMC, network...), the only way to boot is to provide a
* ramdisk.
*/
chosen {
bootargs = "root=/dev/ram0 rw console=ttyO2,115200n8 initrd=0x81600000,20M ramdisk_size=20480 no_console_suspend debug";
};
memory {
device_type = "memory";
reg = <0x80000000 0x40000000>; /* 1 GB */
};
};
/*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/*
* Carveout for multimedia usecases
* It should be the last 48MB of the first 512MB memory part
* In theory, it should not even exist. That zone should be reserved
* dynamically during the .reserve callback.
*/
/memreserve/ 0x9d000000 0x03000000;
/include/ "skeleton.dtsi"
/ {
compatible = "ti,omap4430", "ti,omap4";
interrupt-parent = <&gic>;
aliases {
};
cpus {
cpu@0 {
compatible = "arm,cortex-a9";
};
cpu@1 {
compatible = "arm,cortex-a9";
};
};
/*
* The soc node represents the soc top level view. It is uses for IPs
* that are not memory mapped in the MPU view or for the MPU itself.
*/
soc {
compatible = "ti,omap-infra";
mpu {
compatible = "ti,omap4-mpu";
ti,hwmods = "mpu";
};
dsp {
compatible = "ti,omap3-c64";
ti,hwmods = "dsp";
};
iva {
compatible = "ti,ivahd";
ti,hwmods = "iva";
};
};
/*
* XXX: Use a flat representation of the OMAP4 interconnect.
* The real OMAP interconnect network is quite complex.
*
* MPU -+-- MPU_PRIVATE - GIC, L2
* |
* +----------------+----------+
* | | |
* + +- EMIF - DDR |
* | | |
* | + +--------+
* | | |
* | +- L4_ABE - AESS, MCBSP, TIMERs...
* | |
* +- L3_MAIN --+- L4_CORE - IPs...
* |
* +- L4_PER - IPs...
* |
* +- L4_CFG -+- L4_WKUP - IPs...
* | |
* | +- IPs...
* +- IPU ----+
* | |
* +- DSP ----+
* | |
* +- DSS ----+
*
* Since that will not bring real advantage to represent that in DT for
* the moment, just use a fake OCP bus entry to represent the whole bus
* hierarchy.
*/
ocp {
compatible = "ti,omap4-l3-noc", "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
ranges;
ti,hwmods = "l3_main_1", "l3_main_2", "l3_main_3";
gic: interrupt-controller@48241000 {
compatible = "arm,cortex-a9-gic";
interrupt-controller;
#interrupt-cells = <1>;
reg = <0x48241000 0x1000>,
<0x48240100 0x0100>;
};
};
};
...@@ -134,12 +134,6 @@ void ams_delta_latch2_write(u16 mask, u16 value) ...@@ -134,12 +134,6 @@ void ams_delta_latch2_write(u16 mask, u16 value)
*(volatile __u16 *) AMS_DELTA_LATCH2_VIRT = ams_delta_latch2_reg; *(volatile __u16 *) AMS_DELTA_LATCH2_VIRT = ams_delta_latch2_reg;
} }
static void __init ams_delta_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
static struct map_desc ams_delta_io_desc[] __initdata = { static struct map_desc ams_delta_io_desc[] __initdata = {
/* AMS_DELTA_LATCH1 */ /* AMS_DELTA_LATCH1 */
{ {
...@@ -378,17 +372,13 @@ static int __init ams_delta_modem_init(void) ...@@ -378,17 +372,13 @@ static int __init ams_delta_modem_init(void)
} }
arch_initcall(ams_delta_modem_init); arch_initcall(ams_delta_modem_init);
static void __init ams_delta_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)") MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
/* Maintainer: Jonathan McDowell <noodles@earth.li> */ /* Maintainer: Jonathan McDowell <noodles@earth.li> */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = ams_delta_map_io, .map_io = omap15xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = ams_delta_init_irq, .init_irq = omap1_init_irq,
.init_machine = ams_delta_init, .init_machine = ams_delta_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
......
...@@ -296,6 +296,39 @@ static struct omap_board_config_kernel fsample_config[] __initdata = { ...@@ -296,6 +296,39 @@ static struct omap_board_config_kernel fsample_config[] __initdata = {
static void __init omap_fsample_init(void) static void __init omap_fsample_init(void)
{ {
/* Early, board-dependent init */
/*
* Hold GSM Reset until needed
*/
omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL);
/*
* UARTs -> done automagically by 8250 driver
*/
/*
* CSx timings, GPIO Mux ... setup
*/
/* Flash: CS0 timings setup */
omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0);
omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0);
/*
* Ethernet support through the debug board
* CS1 timings setup
*/
omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1);
omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1);
/*
* Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
* It is used as the Ethernet controller interrupt
*/
omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF,
OMAP7XX_IO_CONF_9);
fsample_init_smc91x(); fsample_init_smc91x();
if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0) if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0)
...@@ -325,12 +358,6 @@ static void __init omap_fsample_init(void) ...@@ -325,12 +358,6 @@ static void __init omap_fsample_init(void)
omap_register_i2c_bus(1, 100, NULL, 0); omap_register_i2c_bus(1, 100, NULL, 0);
} }
static void __init omap_fsample_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
/* Only FPGA needs to be mapped here. All others are done with ioremap */ /* Only FPGA needs to be mapped here. All others are done with ioremap */
static struct map_desc omap_fsample_io_desc[] __initdata = { static struct map_desc omap_fsample_io_desc[] __initdata = {
{ {
...@@ -349,49 +376,18 @@ static struct map_desc omap_fsample_io_desc[] __initdata = { ...@@ -349,49 +376,18 @@ static struct map_desc omap_fsample_io_desc[] __initdata = {
static void __init omap_fsample_map_io(void) static void __init omap_fsample_map_io(void)
{ {
omap1_map_common_io(); omap15xx_map_io();
iotable_init(omap_fsample_io_desc, iotable_init(omap_fsample_io_desc,
ARRAY_SIZE(omap_fsample_io_desc)); ARRAY_SIZE(omap_fsample_io_desc));
/* Early, board-dependent init */
/*
* Hold GSM Reset until needed
*/
omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL);
/*
* UARTs -> done automagically by 8250 driver
*/
/*
* CSx timings, GPIO Mux ... setup
*/
/* Flash: CS0 timings setup */
omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0);
omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0);
/*
* Ethernet support through the debug board
* CS1 timings setup
*/
omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1);
omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1);
/*
* Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
* It is used as the Ethernet controller interrupt
*/
omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, OMAP7XX_IO_CONF_9);
} }
MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample") MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample")
/* Maintainer: Brian Swetland <swetland@google.com> */ /* Maintainer: Brian Swetland <swetland@google.com> */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = omap_fsample_map_io, .map_io = omap_fsample_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = omap_fsample_init_irq, .init_irq = omap1_init_irq,
.init_machine = omap_fsample_init, .init_machine = omap_fsample_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -27,12 +27,6 @@ ...@@ -27,12 +27,6 @@
#include <plat/board.h> #include <plat/board.h>
#include <plat/common.h> #include <plat/common.h>
static void __init omap_generic_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
/* assume no Mini-AB port */ /* assume no Mini-AB port */
#ifdef CONFIG_ARCH_OMAP15XX #ifdef CONFIG_ARCH_OMAP15XX
...@@ -86,17 +80,13 @@ static void __init omap_generic_init(void) ...@@ -86,17 +80,13 @@ static void __init omap_generic_init(void)
omap_register_i2c_bus(1, 100, NULL, 0); omap_register_i2c_bus(1, 100, NULL, 0);
} }
static void __init omap_generic_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710") MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
/* Maintainer: Tony Lindgren <tony@atomide.com> */ /* Maintainer: Tony Lindgren <tony@atomide.com> */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = omap_generic_map_io, .map_io = omap16xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = omap_generic_init_irq, .init_irq = omap1_init_irq,
.init_machine = omap_generic_init, .init_machine = omap_generic_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -372,12 +372,6 @@ static struct i2c_board_info __initdata h2_i2c_board_info[] = { ...@@ -372,12 +372,6 @@ static struct i2c_board_info __initdata h2_i2c_board_info[] = {
}, },
}; };
static void __init h2_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
static struct omap_usb_config h2_usb_config __initdata = { static struct omap_usb_config h2_usb_config __initdata = {
/* usb1 has a Mini-AB port and external isp1301 transceiver */ /* usb1 has a Mini-AB port and external isp1301 transceiver */
.otg = 2, .otg = 2,
...@@ -453,17 +447,13 @@ static void __init h2_init(void) ...@@ -453,17 +447,13 @@ static void __init h2_init(void)
h2_mmc_init(); h2_mmc_init();
} }
static void __init h2_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(OMAP_H2, "TI-H2") MACHINE_START(OMAP_H2, "TI-H2")
/* Maintainer: Imre Deak <imre.deak@nokia.com> */ /* Maintainer: Imre Deak <imre.deak@nokia.com> */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = h2_map_io, .map_io = omap16xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = h2_init_irq, .init_irq = omap1_init_irq,
.init_machine = h2_init, .init_machine = h2_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -435,23 +435,13 @@ static void __init h3_init(void) ...@@ -435,23 +435,13 @@ static void __init h3_init(void)
h3_mmc_init(); h3_mmc_init();
} }
static void __init h3_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
static void __init h3_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
/* Maintainer: Texas Instruments, Inc. */ /* Maintainer: Texas Instruments, Inc. */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = h3_map_io, .map_io = omap16xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = h3_init_irq, .init_irq = omap1_init_irq,
.init_machine = h3_init, .init_machine = h3_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -499,7 +499,7 @@ static void __init htcherald_lcd_init(void) ...@@ -499,7 +499,7 @@ static void __init htcherald_lcd_init(void)
static void __init htcherald_map_io(void) static void __init htcherald_map_io(void)
{ {
omap1_map_common_io(); omap7xx_map_io();
/* /*
* The LCD panel must be disabled and DMA turned off here, as doing * The LCD panel must be disabled and DMA turned off here, as doing
...@@ -600,20 +600,14 @@ static void __init htcherald_init(void) ...@@ -600,20 +600,14 @@ static void __init htcherald_init(void)
#endif #endif
} }
static void __init htcherald_init_irq(void)
{
printk(KERN_INFO "htcherald_init_irq.\n");
omap1_init_common_hw();
omap1_init_irq();
}
MACHINE_START(HERALD, "HTC Herald") MACHINE_START(HERALD, "HTC Herald")
/* Maintainer: Cory Maccarrone <darkstar6262@gmail.com> */ /* Maintainer: Cory Maccarrone <darkstar6262@gmail.com> */
/* Maintainer: wing-linux.sourceforge.net */ /* Maintainer: wing-linux.sourceforge.net */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = htcherald_map_io, .map_io = htcherald_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = htcherald_init_irq, .init_irq = omap1_init_irq,
.init_machine = htcherald_init, .init_machine = htcherald_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -288,12 +288,6 @@ static void __init innovator_init_smc91x(void) ...@@ -288,12 +288,6 @@ static void __init innovator_init_smc91x(void)
} }
} }
static void __init innovator_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
#ifdef CONFIG_ARCH_OMAP15XX #ifdef CONFIG_ARCH_OMAP15XX
static struct omap_usb_config innovator1510_usb_config __initdata = { static struct omap_usb_config innovator1510_usb_config __initdata = {
/* for bundled non-standard host and peripheral cables */ /* for bundled non-standard host and peripheral cables */
...@@ -438,30 +432,32 @@ static void __init innovator_init(void) ...@@ -438,30 +432,32 @@ static void __init innovator_init(void)
innovator_mmc_init(); innovator_mmc_init();
} }
/*
* REVISIT: Assume 15xx for now, we don't want to do revision check
* until later on. The right way to fix this is to set up a different
* machine_id for 16xx Innovator, or use device tree.
*/
static void __init innovator_map_io(void) static void __init innovator_map_io(void)
{ {
omap1_map_common_io(); omap15xx_map_io();
#ifdef CONFIG_ARCH_OMAP15XX
if (cpu_is_omap1510()) {
iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc)); iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc));
udelay(10); /* Delay needed for FPGA */ udelay(10); /* Delay needed for FPGA */
/* Dump the Innovator FPGA rev early - useful info for support. */ /* Dump the Innovator FPGA rev early - useful info for support. */
printk("Innovator FPGA Rev %d.%d Board Rev %d\n", pr_debug("Innovator FPGA Rev %d.%d Board Rev %d\n",
fpga_read(OMAP1510_FPGA_REV_HIGH), fpga_read(OMAP1510_FPGA_REV_HIGH),
fpga_read(OMAP1510_FPGA_REV_LOW), fpga_read(OMAP1510_FPGA_REV_LOW),
fpga_read(OMAP1510_FPGA_BOARD_REV)); fpga_read(OMAP1510_FPGA_BOARD_REV));
}
#endif
} }
MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
/* Maintainer: MontaVista Software, Inc. */ /* Maintainer: MontaVista Software, Inc. */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = innovator_map_io, .map_io = innovator_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = innovator_init_irq, .init_irq = omap1_init_irq,
.init_machine = innovator_init, .init_machine = innovator_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -38,21 +38,6 @@ ...@@ -38,21 +38,6 @@
#define ADS7846_PENDOWN_GPIO 15 #define ADS7846_PENDOWN_GPIO 15
static void __init omap_nokia770_init_irq(void)
{
/* On Nokia 770, the SleepX signal is masked with an
* MPUIO line by default. It has to be unmasked for it
* to become functional */
/* SleepX mask direction */
omap_writew((omap_readw(0xfffb5008) & ~2), 0xfffb5008);
/* Unmask SleepX signal */
omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);
omap1_init_common_hw();
omap1_init_irq();
}
static const unsigned int nokia770_keymap[] = { static const unsigned int nokia770_keymap[] = {
KEY(1, 0, GROUP_0 | KEY_UP), KEY(1, 0, GROUP_0 | KEY_UP),
KEY(2, 0, GROUP_1 | KEY_F5), KEY(2, 0, GROUP_1 | KEY_F5),
...@@ -245,6 +230,15 @@ static inline void nokia770_mmc_init(void) ...@@ -245,6 +230,15 @@ static inline void nokia770_mmc_init(void)
static void __init omap_nokia770_init(void) static void __init omap_nokia770_init(void)
{ {
/* On Nokia 770, the SleepX signal is masked with an
* MPUIO line by default. It has to be unmasked for it
* to become functional */
/* SleepX mask direction */
omap_writew((omap_readw(0xfffb5008) & ~2), 0xfffb5008);
/* Unmask SleepX signal */
omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004);
platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices)); platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices));
spi_register_board_info(nokia770_spi_board_info, spi_register_board_info(nokia770_spi_board_info,
ARRAY_SIZE(nokia770_spi_board_info)); ARRAY_SIZE(nokia770_spi_board_info));
...@@ -257,16 +251,12 @@ static void __init omap_nokia770_init(void) ...@@ -257,16 +251,12 @@ static void __init omap_nokia770_init(void)
nokia770_mmc_init(); nokia770_mmc_init();
} }
static void __init omap_nokia770_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(NOKIA770, "Nokia 770") MACHINE_START(NOKIA770, "Nokia 770")
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = omap_nokia770_map_io, .map_io = omap16xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = omap_nokia770_init_irq, .init_irq = omap1_init_irq,
.init_machine = omap_nokia770_init, .init_machine = omap_nokia770_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -278,12 +278,6 @@ static void __init osk_init_cf(void) ...@@ -278,12 +278,6 @@ static void __init osk_init_cf(void)
irq_set_irq_type(gpio_to_irq(62), IRQ_TYPE_EDGE_FALLING); irq_set_irq_type(gpio_to_irq(62), IRQ_TYPE_EDGE_FALLING);
} }
static void __init osk_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
static struct omap_usb_config osk_usb_config __initdata = { static struct omap_usb_config osk_usb_config __initdata = {
/* has usb host connector (A) ... for development it can also /* has usb host connector (A) ... for development it can also
* be used, with a NONSTANDARD gender-bending cable/dongle, as * be used, with a NONSTANDARD gender-bending cable/dongle, as
...@@ -575,17 +569,13 @@ static void __init osk_init(void) ...@@ -575,17 +569,13 @@ static void __init osk_init(void)
osk_mistral_init(); osk_mistral_init();
} }
static void __init osk_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(OMAP_OSK, "TI-OSK") MACHINE_START(OMAP_OSK, "TI-OSK")
/* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */ /* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = osk_map_io, .map_io = omap16xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = osk_init_irq, .init_irq = omap1_init_irq,
.init_machine = osk_init, .init_machine = osk_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -58,12 +58,6 @@ ...@@ -58,12 +58,6 @@
#define PALMTE_MMC2_GPIO OMAP_MPUIO(7) #define PALMTE_MMC2_GPIO OMAP_MPUIO(7)
#define PALMTE_MMC3_GPIO OMAP_MPUIO(11) #define PALMTE_MMC3_GPIO OMAP_MPUIO(11)
static void __init omap_palmte_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
static const unsigned int palmte_keymap[] = { static const unsigned int palmte_keymap[] = {
KEY(0, 0, KEY_F1), /* Calendar */ KEY(0, 0, KEY_F1), /* Calendar */
KEY(1, 0, KEY_F2), /* Contacts */ KEY(1, 0, KEY_F2), /* Contacts */
...@@ -268,16 +262,12 @@ static void __init omap_palmte_init(void) ...@@ -268,16 +262,12 @@ static void __init omap_palmte_init(void)
omap_register_i2c_bus(1, 100, NULL, 0); omap_register_i2c_bus(1, 100, NULL, 0);
} }
static void __init omap_palmte_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E") MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E")
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = omap_palmte_map_io, .map_io = omap15xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = omap_palmte_init_irq, .init_irq = omap1_init_irq,
.init_machine = omap_palmte_init, .init_machine = omap_palmte_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -263,12 +263,6 @@ static struct spi_board_info __initdata palmtt_boardinfo[] = { ...@@ -263,12 +263,6 @@ static struct spi_board_info __initdata palmtt_boardinfo[] = {
} }
}; };
static void __init omap_palmtt_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
static struct omap_usb_config palmtt_usb_config __initdata = { static struct omap_usb_config palmtt_usb_config __initdata = {
.register_dev = 1, .register_dev = 1,
.hmc_mode = 0, .hmc_mode = 0,
...@@ -315,16 +309,12 @@ static void __init omap_palmtt_init(void) ...@@ -315,16 +309,12 @@ static void __init omap_palmtt_init(void)
omap_register_i2c_bus(1, 100, NULL, 0); omap_register_i2c_bus(1, 100, NULL, 0);
} }
static void __init omap_palmtt_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T") MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T")
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = omap_palmtt_map_io, .map_io = omap15xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = omap_palmtt_init_irq, .init_irq = omap1_init_irq,
.init_machine = omap_palmtt_init, .init_machine = omap_palmtt_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -57,13 +57,6 @@ ...@@ -57,13 +57,6 @@
#define PALMZ71_SLIDER_GPIO OMAP_MPUIO(3) #define PALMZ71_SLIDER_GPIO OMAP_MPUIO(3)
#define PALMZ71_MMC_IN_GPIO OMAP_MPUIO(4) #define PALMZ71_MMC_IN_GPIO OMAP_MPUIO(4)
static void __init
omap_palmz71_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
static const unsigned int palmz71_keymap[] = { static const unsigned int palmz71_keymap[] = {
KEY(0, 0, KEY_F1), KEY(0, 0, KEY_F1),
KEY(1, 0, KEY_F2), KEY(1, 0, KEY_F2),
...@@ -334,17 +327,12 @@ omap_palmz71_init(void) ...@@ -334,17 +327,12 @@ omap_palmz71_init(void)
palmz71_gpio_setup(0); palmz71_gpio_setup(0);
} }
static void __init
omap_palmz71_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71") MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71")
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = omap_palmz71_map_io, .map_io = omap15xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = omap_palmz71_init_irq, .init_irq = omap1_init_irq,
.init_machine = omap_palmz71_init, .init_machine = omap_palmz71_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -264,6 +264,39 @@ static void __init perseus2_init_smc91x(void) ...@@ -264,6 +264,39 @@ static void __init perseus2_init_smc91x(void)
static void __init omap_perseus2_init(void) static void __init omap_perseus2_init(void)
{ {
/* Early, board-dependent init */
/*
* Hold GSM Reset until needed
*/
omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL);
/*
* UARTs -> done automagically by 8250 driver
*/
/*
* CSx timings, GPIO Mux ... setup
*/
/* Flash: CS0 timings setup */
omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0);
omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0);
/*
* Ethernet support through the debug board
* CS1 timings setup
*/
omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1);
omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1);
/*
* Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
* It is used as the Ethernet controller interrupt
*/
omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF,
OMAP7XX_IO_CONF_9);
perseus2_init_smc91x(); perseus2_init_smc91x();
if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0) if (gpio_request(P2_NAND_RB_GPIO_PIN, "NAND ready") < 0)
...@@ -293,11 +326,6 @@ static void __init omap_perseus2_init(void) ...@@ -293,11 +326,6 @@ static void __init omap_perseus2_init(void)
omap_register_i2c_bus(1, 100, NULL, 0); omap_register_i2c_bus(1, 100, NULL, 0);
} }
static void __init omap_perseus2_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
/* Only FPGA needs to be mapped here. All others are done with ioremap */ /* Only FPGA needs to be mapped here. All others are done with ioremap */
static struct map_desc omap_perseus2_io_desc[] __initdata = { static struct map_desc omap_perseus2_io_desc[] __initdata = {
{ {
...@@ -310,49 +338,18 @@ static struct map_desc omap_perseus2_io_desc[] __initdata = { ...@@ -310,49 +338,18 @@ static struct map_desc omap_perseus2_io_desc[] __initdata = {
static void __init omap_perseus2_map_io(void) static void __init omap_perseus2_map_io(void)
{ {
omap1_map_common_io(); omap7xx_map_io();
iotable_init(omap_perseus2_io_desc, iotable_init(omap_perseus2_io_desc,
ARRAY_SIZE(omap_perseus2_io_desc)); ARRAY_SIZE(omap_perseus2_io_desc));
/* Early, board-dependent init */
/*
* Hold GSM Reset until needed
*/
omap_writew(omap_readw(OMAP7XX_DSP_M_CTL) & ~1, OMAP7XX_DSP_M_CTL);
/*
* UARTs -> done automagically by 8250 driver
*/
/*
* CSx timings, GPIO Mux ... setup
*/
/* Flash: CS0 timings setup */
omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_0);
omap_writel(0x00000088, OMAP7XX_FLASH_ACFG_0);
/*
* Ethernet support through the debug board
* CS1 timings setup
*/
omap_writel(0x0000fff3, OMAP7XX_FLASH_CFG_1);
omap_writel(0x00000000, OMAP7XX_FLASH_ACFG_1);
/*
* Configure MPU_EXT_NIRQ IO in IO_CONF9 register,
* It is used as the Ethernet controller interrupt
*/
omap_writel(omap_readl(OMAP7XX_IO_CONF_9) & 0x1FFFFFFF, OMAP7XX_IO_CONF_9);
} }
MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
/* Maintainer: Kevin Hilman <kjh@hilman.org> */ /* Maintainer: Kevin Hilman <kjh@hilman.org> */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = omap_perseus2_map_io, .map_io = omap_perseus2_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = omap_perseus2_init_irq, .init_irq = omap1_init_irq,
.init_machine = omap_perseus2_init, .init_machine = omap_perseus2_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -406,24 +406,13 @@ static void __init omap_sx1_init(void) ...@@ -406,24 +406,13 @@ static void __init omap_sx1_init(void)
gpio_direction_output(11, 0); /*A_SWITCH = 0 */ gpio_direction_output(11, 0); /*A_SWITCH = 0 */
gpio_direction_output(15, 0); /*A_USB_ON = 0 */ gpio_direction_output(15, 0); /*A_USB_ON = 0 */
} }
/*----------------------------------------*/
static void __init omap_sx1_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
/*----------------------------------------*/
static void __init omap_sx1_map_io(void)
{
omap1_map_common_io();
}
MACHINE_START(SX1, "OMAP310 based Siemens SX1") MACHINE_START(SX1, "OMAP310 based Siemens SX1")
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = omap_sx1_map_io, .map_io = omap15xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = omap_sx1_init_irq, .init_irq = omap1_init_irq,
.init_machine = omap_sx1_init, .init_machine = omap_sx1_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -159,17 +159,6 @@ static struct omap_usb_config voiceblue_usb_config __initdata = { ...@@ -159,17 +159,6 @@ static struct omap_usb_config voiceblue_usb_config __initdata = {
static struct omap_board_config_kernel voiceblue_config[] = { static struct omap_board_config_kernel voiceblue_config[] = {
}; };
static void __init voiceblue_init_irq(void)
{
omap1_init_common_hw();
omap1_init_irq();
}
static void __init voiceblue_map_io(void)
{
omap1_map_common_io();
}
#define MACHINE_PANICED 1 #define MACHINE_PANICED 1
#define MACHINE_REBOOTING 2 #define MACHINE_REBOOTING 2
#define MACHINE_REBOOT 4 #define MACHINE_REBOOT 4
...@@ -302,9 +291,10 @@ static void __init voiceblue_init(void) ...@@ -302,9 +291,10 @@ static void __init voiceblue_init(void)
MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
/* Maintainer: Ladislav Michl <michl@2n.cz> */ /* Maintainer: Ladislav Michl <michl@2n.cz> */
.atag_offset = 0x100, .atag_offset = 0x100,
.map_io = voiceblue_map_io, .map_io = omap15xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve, .reserve = omap_reserve,
.init_irq = voiceblue_init_irq, .init_irq = omap1_init_irq,
.init_machine = voiceblue_init, .init_machine = voiceblue_init,
.timer = &omap1_timer, .timer = &omap1_timer,
MACHINE_END MACHINE_END
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <plat/common.h>
#include <plat/tc.h> #include <plat/tc.h>
#include <plat/board.h> #include <plat/board.h>
#include <plat/mux.h> #include <plat/mux.h>
...@@ -291,6 +292,8 @@ static int __init omap1_init_devices(void) ...@@ -291,6 +292,8 @@ static int __init omap1_init_devices(void)
if (!cpu_class_is_omap1()) if (!cpu_class_is_omap1())
return -ENODEV; return -ENODEV;
omap_sram_init();
/* please keep these calls, and their implementations above, /* please keep these calls, and their implementations above,
* in alphabetical order so they're easier to sort through. * in alphabetical order so they're easier to sort through.
*/ */
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "clock.h" #include "clock.h"
extern void omap_check_revision(void); extern void omap_check_revision(void);
extern void omap_sram_init(void);
/* /*
* The machine specific code may provide the extra mapping besides the * The machine specific code may provide the extra mapping besides the
...@@ -85,51 +84,45 @@ static struct map_desc omap16xx_io_desc[] __initdata = { ...@@ -85,51 +84,45 @@ static struct map_desc omap16xx_io_desc[] __initdata = {
#endif #endif
/* /*
* Maps common IO regions for omap1. This should only get called from * Maps common IO regions for omap1
* board specific init.
*/ */
void __init omap1_map_common_io(void) static void __init omap1_map_common_io(void)
{ {
iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc)); iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc));
}
/* Normally devicemaps_init() would flush caches and tlb after
* mdesc->map_io(), but we must also do it here because of the CPU
* revision check below.
*/
local_flush_tlb_all();
flush_cache_all();
/* We want to check CPU revision early for cpu_is_omapxxxx() macros.
* IO space mapping must be initialized before we can do that.
*/
omap_check_revision();
#if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850) #if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850)
if (cpu_is_omap7xx()) { void __init omap7xx_map_io(void)
{
omap1_map_common_io();
iotable_init(omap7xx_io_desc, ARRAY_SIZE(omap7xx_io_desc)); iotable_init(omap7xx_io_desc, ARRAY_SIZE(omap7xx_io_desc));
} }
#endif #endif
#ifdef CONFIG_ARCH_OMAP15XX #ifdef CONFIG_ARCH_OMAP15XX
if (cpu_is_omap15xx()) { void __init omap15xx_map_io(void)
{
omap1_map_common_io();
iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc)); iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc));
} }
#endif #endif
#if defined(CONFIG_ARCH_OMAP16XX) #if defined(CONFIG_ARCH_OMAP16XX)
if (cpu_is_omap16xx()) { void __init omap16xx_map_io(void)
{
omap1_map_common_io();
iotable_init(omap16xx_io_desc, ARRAY_SIZE(omap16xx_io_desc)); iotable_init(omap16xx_io_desc, ARRAY_SIZE(omap16xx_io_desc));
}
#endif
omap_sram_init();
omap_init_consistent_dma_size();
} }
#endif
/* /*
* Common low-level hardware init for omap1. This should only get called from * Common low-level hardware init for omap1.
* board specific init.
*/ */
void __init omap1_init_common_hw(void) void omap1_init_early(void)
{ {
omap_check_revision();
omap_ioremap_init();
/* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort /* REVISIT: Refer to OMAP5910 Errata, Advisory SYS_1: "Timeout Abort
* on a Posted Write in the TIPB Bridge". * on a Posted Write in the TIPB Bridge".
*/ */
...@@ -139,8 +132,8 @@ void __init omap1_init_common_hw(void) ...@@ -139,8 +132,8 @@ void __init omap1_init_common_hw(void)
/* Must init clocks early to assure that timer interrupt works /* Must init clocks early to assure that timer interrupt works
*/ */
omap1_clk_init(); omap1_clk_init();
omap1_mux_init(); omap1_mux_init();
omap_init_consistent_dma_size();
} }
/* /*
......
...@@ -108,9 +108,13 @@ comment "OMAP Board Type" ...@@ -108,9 +108,13 @@ comment "OMAP Board Type"
depends on ARCH_OMAP2PLUS depends on ARCH_OMAP2PLUS
config MACH_OMAP_GENERIC config MACH_OMAP_GENERIC
bool "Generic OMAP board" bool "Generic OMAP2+ board"
depends on ARCH_OMAP2 depends on ARCH_OMAP2PLUS
select USE_OF
default y default y
help
Support for generic TI OMAP2+ boards using Flattened Device Tree.
More information at Documentation/devicetree
config MACH_OMAP2_TUSB6010 config MACH_OMAP2_TUSB6010
bool bool
......
/* /*
* linux/arch/arm/mach-omap2/board-generic.c
*
* Copyright (C) 2005 Nokia Corporation * Copyright (C) 2005 Nokia Corporation
* Author: Paul Mundt <paul.mundt@nokia.com> * Author: Paul Mundt <paul.mundt@nokia.com>
* *
* Modified from mach-omap/omap1/board-generic.c * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
* *
* Code for generic OMAP2 board. Should work on many OMAP2 systems where * Modified from the original mach-omap/omap2/board-generic.c did by Paul
* the bootloader passes the board-specific data to the kernel. * to support the OMAP2+ device tree boards with an unique board file.
* Do not put any board specific code to this file; create a new machine
* type if you need custom low-level initializations.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/gpio.h>
#include <linux/kernel.h> #include <linux/io.h>
#include <linux/init.h> #include <linux/of_platform.h>
#include <linux/device.h> #include <linux/irqdomain.h>
#include <linux/i2c/twl.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <plat/usb.h>
#include <plat/board.h> #include <plat/board.h>
#include <plat/common.h> #include <plat/common.h>
#include <mach/omap4-common.h>
#include "common-board-devices.h"
static struct omap_board_config_kernel generic_config[] = { /*
* XXX: Still needed to boot until the i2c & twl driver is adapted to
* device-tree
*/
static struct twl4030_platform_data sdp4430_twldata = {
.irq_base = TWL6030_IRQ_BASE,
.irq_end = TWL6030_IRQ_END,
}; };
static void __init omap_generic_init_early(void) static void __init omap4_i2c_init(void)
{ {
omap2_init_common_infrastructure(); omap4_pmic_init("twl6030", &sdp4430_twldata);
} }
static struct twl4030_platform_data beagle_twldata = {
.irq_base = TWL4030_IRQ_BASE,
.irq_end = TWL4030_IRQ_END,
};
static void __init omap3_i2c_init(void)
{
omap3_pmic_init("twl4030", &beagle_twldata);
}
static struct of_device_id omap_dt_match_table[] __initdata = {
{ .compatible = "simple-bus", },
{ .compatible = "ti,omap-infra", },
{ }
};
static struct of_device_id intc_match[] __initdata = {
{ .compatible = "ti,omap3-intc", },
{ .compatible = "arm,cortex-a9-gic", },
{ }
};
static void __init omap_generic_init(void) static void __init omap_generic_init(void)
{ {
struct device_node *node = of_find_matching_node(NULL, intc_match);
if (node)
irq_domain_add_simple(node, 0);
omap_serial_init(); omap_serial_init();
omap_sdrc_init(NULL, NULL); omap_sdrc_init(NULL, NULL);
omap_board_config = generic_config;
omap_board_config_size = ARRAY_SIZE(generic_config); of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
}
static void __init omap4_init(void)
{
omap4_i2c_init();
omap_generic_init();
} }
static void __init omap_generic_map_io(void) static void __init omap3_init(void)
{ {
if (cpu_is_omap242x()) { omap3_i2c_init();
omap2_set_globals_242x(); omap_generic_init();
omap242x_map_common_io();
} else if (cpu_is_omap243x()) {
omap2_set_globals_243x();
omap243x_map_common_io();
} else if (cpu_is_omap34xx()) {
omap2_set_globals_3xxx();
omap34xx_map_common_io();
} else if (cpu_is_omap44xx()) {
omap2_set_globals_443x();
omap44xx_map_common_io();
}
} }
/* XXX This machine entry name should be updated */ #if defined(CONFIG_SOC_OMAP2420)
MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") static const char *omap242x_boards_compat[] __initdata = {
/* Maintainer: Paul Mundt <paul.mundt@nokia.com> */ "ti,omap2420",
NULL,
};
DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
.atag_offset = 0x100, .atag_offset = 0x100,
.reserve = omap_reserve, .reserve = omap_reserve,
.map_io = omap_generic_map_io, .map_io = omap242x_map_io,
.init_early = omap_generic_init_early, .init_early = omap2420_init_early,
.init_irq = omap2_init_irq, .init_irq = omap2_init_irq,
.init_machine = omap_generic_init, .init_machine = omap_generic_init,
.timer = &omap2_timer, .timer = &omap2_timer,
.dt_compat = omap242x_boards_compat,
MACHINE_END
#endif
#if defined(CONFIG_SOC_OMAP2430)
static const char *omap243x_boards_compat[] __initdata = {
"ti,omap2430",
NULL,
};
DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap243x_map_io,
.init_early = omap2430_init_early,
.init_irq = omap2_init_irq,
.init_machine = omap_generic_init,
.timer = &omap2_timer,
.dt_compat = omap243x_boards_compat,
MACHINE_END
#endif
#if defined(CONFIG_ARCH_OMAP3)
static const char *omap3_boards_compat[] __initdata = {
"ti,omap3",
NULL,
};
DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap3_map_io,
.init_early = omap3430_init_early,
.init_irq = omap3_init_irq,
.init_machine = omap3_init,
.timer = &omap3_timer,
.dt_compat = omap3_boards_compat,
MACHINE_END
#endif
#if defined(CONFIG_ARCH_OMAP4)
static const char *omap4_boards_compat[] __initdata = {
"ti,omap4",
NULL,
};
DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
.atag_offset = 0x100,
.reserve = omap_reserve,
.map_io = omap4_map_io,
.init_early = omap4430_init_early,
.init_irq = gic_init_irq,
.init_machine = omap4_init,
.timer = &omap4_timer,
.dt_compat = omap4_boards_compat,
MACHINE_END MACHINE_END
#endif
...@@ -444,11 +444,6 @@ static struct platform_device keys_gpio = { ...@@ -444,11 +444,6 @@ static struct platform_device keys_gpio = {
}, },
}; };
static void __init omap3_beagle_init_early(void)
{
omap2_init_common_infrastructure();
}
static struct platform_device *omap3_beagle_devices[] __initdata = { static struct platform_device *omap3_beagle_devices[] __initdata = {
&leds_gpio, &leds_gpio,
&keys_gpio, &keys_gpio,
...@@ -486,8 +481,8 @@ static void __init beagle_opp_init(void) ...@@ -486,8 +481,8 @@ static void __init beagle_opp_init(void)
if (cpu_is_omap3630()) { if (cpu_is_omap3630()) {
struct device *mpu_dev, *iva_dev; struct device *mpu_dev, *iva_dev;
mpu_dev = omap2_get_mpuss_device(); mpu_dev = omap_device_get_by_hwmod_name("mpu");
iva_dev = omap2_get_iva_device(); iva_dev = omap_device_get_by_hwmod_name("iva");
if (!mpu_dev || !iva_dev) { if (!mpu_dev || !iva_dev) {
pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
...@@ -555,7 +550,7 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") ...@@ -555,7 +550,7 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
.atag_offset = 0x100, .atag_offset = 0x100,
.reserve = omap_reserve, .reserve = omap_reserve,
.map_io = omap3_map_io, .map_io = omap3_map_io,
.init_early = omap3_beagle_init_early, .init_early = omap3_init_early,
.init_irq = omap3_init_irq, .init_irq = omap3_init_irq,
.init_machine = omap3_beagle_init, .init_machine = omap3_beagle_init,
.timer = &omap3_secure_timer, .timer = &omap3_secure_timer,
......
...@@ -37,7 +37,6 @@ static void __init ti8168_evm_init(void) ...@@ -37,7 +37,6 @@ static void __init ti8168_evm_init(void)
static void __init ti8168_evm_map_io(void) static void __init ti8168_evm_map_io(void)
{ {
omap2_set_globals_ti816x();
omapti816x_map_common_io(); omapti816x_map_common_io();
} }
......
...@@ -45,11 +45,11 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals) ...@@ -45,11 +45,11 @@ static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
static struct omap_globals omap242x_globals = { static struct omap_globals omap242x_globals = {
.class = OMAP242X_CLASS, .class = OMAP242X_CLASS,
.tap = OMAP2_L4_IO_ADDRESS(0x48014000), .tap = OMAP2_L4_IO_ADDRESS(0x48014000),
.sdrc = OMAP2420_SDRC_BASE, .sdrc = OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE),
.sms = OMAP2420_SMS_BASE, .sms = OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE),
.ctrl = OMAP242X_CTRL_BASE, .ctrl = OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE),
.prm = OMAP2420_PRM_BASE, .prm = OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE),
.cm = OMAP2420_CM_BASE, .cm = OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE),
}; };
void __init omap2_set_globals_242x(void) void __init omap2_set_globals_242x(void)
...@@ -59,7 +59,6 @@ void __init omap2_set_globals_242x(void) ...@@ -59,7 +59,6 @@ void __init omap2_set_globals_242x(void)
void __init omap242x_map_io(void) void __init omap242x_map_io(void)
{ {
omap2_set_globals_242x();
omap242x_map_common_io(); omap242x_map_common_io();
} }
#endif #endif
...@@ -69,11 +68,11 @@ void __init omap242x_map_io(void) ...@@ -69,11 +68,11 @@ void __init omap242x_map_io(void)
static struct omap_globals omap243x_globals = { static struct omap_globals omap243x_globals = {
.class = OMAP243X_CLASS, .class = OMAP243X_CLASS,
.tap = OMAP2_L4_IO_ADDRESS(0x4900a000), .tap = OMAP2_L4_IO_ADDRESS(0x4900a000),
.sdrc = OMAP243X_SDRC_BASE, .sdrc = OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE),
.sms = OMAP243X_SMS_BASE, .sms = OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE),
.ctrl = OMAP243X_CTRL_BASE, .ctrl = OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
.prm = OMAP2430_PRM_BASE, .prm = OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE),
.cm = OMAP2430_CM_BASE, .cm = OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE),
}; };
void __init omap2_set_globals_243x(void) void __init omap2_set_globals_243x(void)
...@@ -83,7 +82,6 @@ void __init omap2_set_globals_243x(void) ...@@ -83,7 +82,6 @@ void __init omap2_set_globals_243x(void)
void __init omap243x_map_io(void) void __init omap243x_map_io(void)
{ {
omap2_set_globals_243x();
omap243x_map_common_io(); omap243x_map_common_io();
} }
#endif #endif
...@@ -93,11 +91,11 @@ void __init omap243x_map_io(void) ...@@ -93,11 +91,11 @@ void __init omap243x_map_io(void)
static struct omap_globals omap3_globals = { static struct omap_globals omap3_globals = {
.class = OMAP343X_CLASS, .class = OMAP343X_CLASS,
.tap = OMAP2_L4_IO_ADDRESS(0x4830A000), .tap = OMAP2_L4_IO_ADDRESS(0x4830A000),
.sdrc = OMAP343X_SDRC_BASE, .sdrc = OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
.sms = OMAP343X_SMS_BASE, .sms = OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE),
.ctrl = OMAP343X_CTRL_BASE, .ctrl = OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
.prm = OMAP3430_PRM_BASE, .prm = OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
.cm = OMAP3430_CM_BASE, .cm = OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
}; };
void __init omap2_set_globals_3xxx(void) void __init omap2_set_globals_3xxx(void)
...@@ -107,7 +105,6 @@ void __init omap2_set_globals_3xxx(void) ...@@ -107,7 +105,6 @@ void __init omap2_set_globals_3xxx(void)
void __init omap3_map_io(void) void __init omap3_map_io(void)
{ {
omap2_set_globals_3xxx();
omap34xx_map_common_io(); omap34xx_map_common_io();
} }
...@@ -122,9 +119,9 @@ void __init omap3_map_io(void) ...@@ -122,9 +119,9 @@ void __init omap3_map_io(void)
static struct omap_globals ti816x_globals = { static struct omap_globals ti816x_globals = {
.class = OMAP343X_CLASS, .class = OMAP343X_CLASS,
.tap = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE), .tap = OMAP2_L4_IO_ADDRESS(TI816X_TAP_BASE),
.ctrl = TI816X_CTRL_BASE, .ctrl = OMAP2_L4_IO_ADDRESS(TI816X_CTRL_BASE),
.prm = TI816X_PRCM_BASE, .prm = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE),
.cm = TI816X_PRCM_BASE, .cm = OMAP2_L4_IO_ADDRESS(TI816X_PRCM_BASE),
}; };
void __init omap2_set_globals_ti816x(void) void __init omap2_set_globals_ti816x(void)
...@@ -137,11 +134,11 @@ void __init omap2_set_globals_ti816x(void) ...@@ -137,11 +134,11 @@ void __init omap2_set_globals_ti816x(void)
static struct omap_globals omap4_globals = { static struct omap_globals omap4_globals = {
.class = OMAP443X_CLASS, .class = OMAP443X_CLASS,
.tap = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE), .tap = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
.ctrl = OMAP443X_SCM_BASE, .ctrl = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
.ctrl_pad = OMAP443X_CTRL_BASE, .ctrl_pad = OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE),
.prm = OMAP4430_PRM_BASE, .prm = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
.cm = OMAP4430_CM_BASE, .cm = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
.cm2 = OMAP4430_CM2_BASE, .cm2 = OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),
}; };
void __init omap2_set_globals_443x(void) void __init omap2_set_globals_443x(void)
...@@ -153,7 +150,6 @@ void __init omap2_set_globals_443x(void) ...@@ -153,7 +150,6 @@ void __init omap2_set_globals_443x(void)
void __init omap4_map_io(void) void __init omap4_map_io(void)
{ {
omap2_set_globals_443x();
omap44xx_map_common_io(); omap44xx_map_common_io();
} }
#endif #endif
......
...@@ -149,17 +149,11 @@ static struct omap3_control_regs control_context; ...@@ -149,17 +149,11 @@ static struct omap3_control_regs control_context;
void __init omap2_set_globals_control(struct omap_globals *omap2_globals) void __init omap2_set_globals_control(struct omap_globals *omap2_globals)
{ {
/* Static mapping, never released */ if (omap2_globals->ctrl)
if (omap2_globals->ctrl) { omap2_ctrl_base = omap2_globals->ctrl;
omap2_ctrl_base = ioremap(omap2_globals->ctrl, SZ_4K);
WARN_ON(!omap2_ctrl_base);
}
/* Static mapping, never released */ if (omap2_globals->ctrl_pad)
if (omap2_globals->ctrl_pad) { omap4_ctrl_pad_base = omap2_globals->ctrl_pad;
omap4_ctrl_pad_base = ioremap(omap2_globals->ctrl_pad, SZ_4K);
WARN_ON(!omap4_ctrl_pad_base);
}
} }
void __iomem *omap_ctrl_base_get(void) void __iomem *omap_ctrl_base_get(void)
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/of.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/irqs.h> #include <mach/irqs.h>
...@@ -76,6 +77,10 @@ static int __init omap4_l3_init(void) ...@@ -76,6 +77,10 @@ static int __init omap4_l3_init(void)
struct platform_device *pdev; struct platform_device *pdev;
char oh_name[L3_MODULES_MAX_LEN]; char oh_name[L3_MODULES_MAX_LEN];
/* If dtb is there, the devices will be created dynamically */
if (of_have_populated_dt())
return -ENODEV;
/* /*
* To avoid code running on other OMAPs in * To avoid code running on other OMAPs in
* multi-omap builds * multi-omap builds
...@@ -220,14 +225,6 @@ static inline void omap_init_camera(void) ...@@ -220,14 +225,6 @@ static inline void omap_init_camera(void)
#endif #endif
} }
struct omap_device_pm_latency omap_keyboard_latency[] = {
{
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
int __init omap4_keyboard_init(struct omap4_keypad_platform_data int __init omap4_keyboard_init(struct omap4_keypad_platform_data
*sdp4430_keypad_data, struct omap_board_data *bdata) *sdp4430_keypad_data, struct omap_board_data *bdata)
{ {
...@@ -247,9 +244,7 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data ...@@ -247,9 +244,7 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
keypad_data = sdp4430_keypad_data; keypad_data = sdp4430_keypad_data;
pdev = omap_device_build(name, id, oh, keypad_data, pdev = omap_device_build(name, id, oh, keypad_data,
sizeof(struct omap4_keypad_platform_data), sizeof(struct omap4_keypad_platform_data), NULL, 0, 0);
omap_keyboard_latency,
ARRAY_SIZE(omap_keyboard_latency), 0);
if (IS_ERR(pdev)) { if (IS_ERR(pdev)) {
WARN(1, "Can't build omap_device for %s:%s.\n", WARN(1, "Can't build omap_device for %s:%s.\n",
...@@ -262,14 +257,6 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data ...@@ -262,14 +257,6 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data
} }
#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
static struct omap_device_pm_latency mbox_latencies[] = {
[0] = {
.activate_func = omap_device_enable_hwmods,
.deactivate_func = omap_device_idle_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
static inline void omap_init_mbox(void) static inline void omap_init_mbox(void)
{ {
struct omap_hwmod *oh; struct omap_hwmod *oh;
...@@ -281,8 +268,7 @@ static inline void omap_init_mbox(void) ...@@ -281,8 +268,7 @@ static inline void omap_init_mbox(void)
return; return;
} }
pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0, pdev = omap_device_build("omap-mailbox", -1, oh, NULL, 0, NULL, 0, 0);
mbox_latencies, ARRAY_SIZE(mbox_latencies), 0);
WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n", WARN(IS_ERR(pdev), "%s: could not build device, err %ld\n",
__func__, PTR_ERR(pdev)); __func__, PTR_ERR(pdev));
} }
...@@ -365,14 +351,6 @@ static inline void omap_init_mcpdm(void) {} ...@@ -365,14 +351,6 @@ static inline void omap_init_mcpdm(void) {}
#include <plat/mcspi.h> #include <plat/mcspi.h>
struct omap_device_pm_latency omap_mcspi_latency[] = {
[0] = {
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
{ {
struct platform_device *pdev; struct platform_device *pdev;
...@@ -403,8 +381,7 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void *unused) ...@@ -403,8 +381,7 @@ static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
spi_num++; spi_num++;
pdev = omap_device_build(name, spi_num, oh, pdata, pdev = omap_device_build(name, spi_num, oh, pdata,
sizeof(*pdata), omap_mcspi_latency, sizeof(*pdata), NULL, 0, 0);
ARRAY_SIZE(omap_mcspi_latency), 0);
WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n", WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s\n",
name, oh->name); name, oh->name);
kfree(pdata); kfree(pdata);
...@@ -730,14 +707,6 @@ static int __init omap2_init_devices(void) ...@@ -730,14 +707,6 @@ static int __init omap2_init_devices(void)
arch_initcall(omap2_init_devices); arch_initcall(omap2_init_devices);
#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE) #if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
static struct omap_device_pm_latency omap_wdt_latency[] = {
[0] = {
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
static int __init omap_init_wdt(void) static int __init omap_init_wdt(void)
{ {
int id = -1; int id = -1;
...@@ -755,9 +724,7 @@ static int __init omap_init_wdt(void) ...@@ -755,9 +724,7 @@ static int __init omap_init_wdt(void)
return -EINVAL; return -EINVAL;
} }
pdev = omap_device_build(dev_name, id, oh, NULL, 0, pdev = omap_device_build(dev_name, id, oh, NULL, 0, NULL, 0, 0);
omap_wdt_latency,
ARRAY_SIZE(omap_wdt_latency), 0);
WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n", WARN(IS_ERR(pdev), "Can't build omap_device for %s:%s.\n",
dev_name, oh->name); dev_name, oh->name);
return 0; return 0;
......
...@@ -37,14 +37,6 @@ static struct platform_device omap_display_device = { ...@@ -37,14 +37,6 @@ static struct platform_device omap_display_device = {
}, },
}; };
static struct omap_device_pm_latency omap_dss_latency[] = {
[0] = {
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
struct omap_dss_hwmod_data { struct omap_dss_hwmod_data {
const char *oh_name; const char *oh_name;
const char *dev_name; const char *dev_name;
...@@ -165,8 +157,7 @@ int __init omap_display_init(struct omap_dss_board_info *board_data) ...@@ -165,8 +157,7 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
pdev = omap_device_build(curr_dss_hwmod[i].dev_name, pdev = omap_device_build(curr_dss_hwmod[i].dev_name,
curr_dss_hwmod[i].id, oh, &pdata, curr_dss_hwmod[i].id, oh, &pdata,
sizeof(struct omap_display_platform_data), sizeof(struct omap_display_platform_data),
omap_dss_latency, NULL, 0, 0);
ARRAY_SIZE(omap_dss_latency), 0);
if (WARN((IS_ERR(pdev)), "Could not build omap_device for %s\n", if (WARN((IS_ERR(pdev)), "Could not build omap_device for %s\n",
curr_dss_hwmod[i].oh_name)) curr_dss_hwmod[i].oh_name))
......
...@@ -87,14 +87,6 @@ static u16 reg_map[] = { ...@@ -87,14 +87,6 @@ static u16 reg_map[] = {
[CCDN] = 0xd8, [CCDN] = 0xd8,
}; };
static struct omap_device_pm_latency omap2_dma_latency[] = {
{
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
static void __iomem *dma_base; static void __iomem *dma_base;
static inline void dma_write(u32 val, int reg, int lch) static inline void dma_write(u32 val, int reg, int lch)
{ {
...@@ -258,8 +250,7 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused) ...@@ -258,8 +250,7 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
p->errata = configure_dma_errata(); p->errata = configure_dma_errata();
pdev = omap_device_build(name, 0, oh, p, sizeof(*p), pdev = omap_device_build(name, 0, oh, p, sizeof(*p), NULL, 0, 0);
omap2_dma_latency, ARRAY_SIZE(omap2_dma_latency), 0);
kfree(p); kfree(p);
if (IS_ERR(pdev)) { if (IS_ERR(pdev)) {
pr_err("%s: Can't build omap_device for %s:%s.\n", pr_err("%s: Can't build omap_device for %s:%s.\n",
......
...@@ -24,14 +24,6 @@ ...@@ -24,14 +24,6 @@
#include <plat/omap_hwmod.h> #include <plat/omap_hwmod.h>
#include <plat/omap_device.h> #include <plat/omap_device.h>
static struct omap_device_pm_latency omap_gpio_latency[] = {
[0] = {
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
{ {
struct platform_device *pdev; struct platform_device *pdev;
...@@ -108,9 +100,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) ...@@ -108,9 +100,7 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
} }
pdev = omap_device_build(name, id - 1, oh, pdata, pdev = omap_device_build(name, id - 1, oh, pdata,
sizeof(*pdata), omap_gpio_latency, sizeof(*pdata), NULL, 0, false);
ARRAY_SIZE(omap_gpio_latency),
false);
kfree(pdata); kfree(pdata);
if (IS_ERR(pdev)) { if (IS_ERR(pdev)) {
......
...@@ -409,31 +409,17 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c, ...@@ -409,31 +409,17 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
return 0; return 0;
} }
static struct omap_device_pm_latency omap_hsmmc_latency[] = {
[0] = {
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
/*
* XXX There should also be an entry here to power off/on the
* MMC regulators/PBIAS cells, etc.
*/
};
#define MAX_OMAP_MMC_HWMOD_NAME_LEN 16 #define MAX_OMAP_MMC_HWMOD_NAME_LEN 16
void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr) void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
{ {
struct omap_hwmod *oh; struct omap_hwmod *oh;
struct platform_device *pdev; struct platform_device *pdev;
struct omap_device_pm_latency *ohl;
char oh_name[MAX_OMAP_MMC_HWMOD_NAME_LEN]; char oh_name[MAX_OMAP_MMC_HWMOD_NAME_LEN];
struct omap_mmc_platform_data *mmc_data; struct omap_mmc_platform_data *mmc_data;
struct omap_mmc_dev_attr *mmc_dev_attr; struct omap_mmc_dev_attr *mmc_dev_attr;
char *name; char *name;
int l; int l;
int ohl_cnt = 0;
mmc_data = kzalloc(sizeof(struct omap_mmc_platform_data), GFP_KERNEL); mmc_data = kzalloc(sizeof(struct omap_mmc_platform_data), GFP_KERNEL);
if (!mmc_data) { if (!mmc_data) {
...@@ -448,8 +434,6 @@ void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr) ...@@ -448,8 +434,6 @@ void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
omap_hsmmc_mux(mmc_data, (ctrl_nr - 1)); omap_hsmmc_mux(mmc_data, (ctrl_nr - 1));
name = "omap_hsmmc"; name = "omap_hsmmc";
ohl = omap_hsmmc_latency;
ohl_cnt = ARRAY_SIZE(omap_hsmmc_latency);
l = snprintf(oh_name, MAX_OMAP_MMC_HWMOD_NAME_LEN, l = snprintf(oh_name, MAX_OMAP_MMC_HWMOD_NAME_LEN,
"mmc%d", ctrl_nr); "mmc%d", ctrl_nr);
...@@ -468,7 +452,7 @@ void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr) ...@@ -468,7 +452,7 @@ void __init omap_init_hsmmc(struct omap2_hsmmc_info *hsmmcinfo, int ctrl_nr)
} }
pdev = omap_device_build(name, ctrl_nr - 1, oh, mmc_data, pdev = omap_device_build(name, ctrl_nr - 1, oh, mmc_data,
sizeof(struct omap_mmc_platform_data), ohl, ohl_cnt, false); sizeof(struct omap_mmc_platform_data), NULL, 0, false);
if (IS_ERR(pdev)) { if (IS_ERR(pdev)) {
WARN(1, "Can't build omap_device for %s:%s.\n", name, oh->name); WARN(1, "Can't build omap_device for %s:%s.\n", name, oh->name);
kfree(mmc_data->slots[0].name); kfree(mmc_data->slots[0].name);
......
...@@ -23,14 +23,6 @@ ...@@ -23,14 +23,6 @@
#include <plat/omap_hwmod.h> #include <plat/omap_hwmod.h>
#include <plat/omap_device.h> #include <plat/omap_device.h>
struct omap_device_pm_latency omap_spinlock_latency[] = {
{
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
}
};
int __init hwspinlocks_init(void) int __init hwspinlocks_init(void)
{ {
int retval = 0; int retval = 0;
...@@ -48,9 +40,7 @@ int __init hwspinlocks_init(void) ...@@ -48,9 +40,7 @@ int __init hwspinlocks_init(void)
if (oh == NULL) if (oh == NULL)
return -EINVAL; return -EINVAL;
pdev = omap_device_build(dev_name, 0, oh, NULL, 0, pdev = omap_device_build(dev_name, 0, oh, NULL, 0, NULL, 0, false);
omap_spinlock_latency,
ARRAY_SIZE(omap_spinlock_latency), false);
if (IS_ERR(pdev)) { if (IS_ERR(pdev)) {
pr_err("Can't build omap_device for %s:%s\n", dev_name, pr_err("Can't build omap_device for %s:%s\n", dev_name,
oh_name); oh_name);
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include "clock2xxx.h" #include "clock2xxx.h"
#include "clock3xxx.h" #include "clock3xxx.h"
#include "clock44xx.h" #include "clock44xx.h"
#include "io.h"
#include <plat/common.h>
#include <plat/omap-pm.h> #include <plat/omap-pm.h>
#include "voltage.h" #include "voltage.h"
#include "powerdomain.h" #include "powerdomain.h"
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "clockdomain.h" #include "clockdomain.h"
#include <plat/omap_hwmod.h> #include <plat/omap_hwmod.h>
#include <plat/multi.h> #include <plat/multi.h>
#include <plat/common.h>
/* /*
* The machine specific code may provide the extra mapping besides the * The machine specific code may provide the extra mapping besides the
...@@ -239,26 +240,11 @@ static struct map_desc omap44xx_io_desc[] __initdata = { ...@@ -239,26 +240,11 @@ static struct map_desc omap44xx_io_desc[] __initdata = {
}; };
#endif #endif
static void __init _omap2_map_common_io(void)
{
/* Normally devicemaps_init() would flush caches and tlb after
* mdesc->map_io(), but we must also do it here because of the CPU
* revision check below.
*/
local_flush_tlb_all();
flush_cache_all();
omap2_check_revision();
omap_sram_init();
omap_init_consistent_dma_size();
}
#ifdef CONFIG_SOC_OMAP2420 #ifdef CONFIG_SOC_OMAP2420
void __init omap242x_map_common_io(void) void __init omap242x_map_common_io(void)
{ {
iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
_omap2_map_common_io();
} }
#endif #endif
...@@ -267,7 +253,6 @@ void __init omap243x_map_common_io(void) ...@@ -267,7 +253,6 @@ void __init omap243x_map_common_io(void)
{ {
iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc)); iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
_omap2_map_common_io();
} }
#endif #endif
...@@ -275,7 +260,6 @@ void __init omap243x_map_common_io(void) ...@@ -275,7 +260,6 @@ void __init omap243x_map_common_io(void)
void __init omap34xx_map_common_io(void) void __init omap34xx_map_common_io(void)
{ {
iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc)); iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
_omap2_map_common_io();
} }
#endif #endif
...@@ -283,7 +267,6 @@ void __init omap34xx_map_common_io(void) ...@@ -283,7 +267,6 @@ void __init omap34xx_map_common_io(void)
void __init omapti816x_map_common_io(void) void __init omapti816x_map_common_io(void)
{ {
iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc)); iotable_init(omapti816x_io_desc, ARRAY_SIZE(omapti816x_io_desc));
_omap2_map_common_io();
} }
#endif #endif
...@@ -291,7 +274,6 @@ void __init omapti816x_map_common_io(void) ...@@ -291,7 +274,6 @@ void __init omapti816x_map_common_io(void)
void __init omap44xx_map_common_io(void) void __init omap44xx_map_common_io(void)
{ {
iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc)); iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc));
_omap2_map_common_io();
} }
#endif #endif
...@@ -337,33 +319,16 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) ...@@ -337,33 +319,16 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
/* See irq.c, omap4-common.c and entry-macro.S */ /* See irq.c, omap4-common.c and entry-macro.S */
void __iomem *omap_irq_base; void __iomem *omap_irq_base;
void __init omap2_init_common_infrastructure(void) static void __init omap_common_init_early(void)
{ {
u8 postsetup_state; omap2_check_revision();
omap_ioremap_init();
omap_init_consistent_dma_size();
}
if (cpu_is_omap242x()) { static void __init omap_hwmod_init_postsetup(void)
omap2xxx_voltagedomains_init(); {
omap242x_powerdomains_init(); u8 postsetup_state;
omap242x_clockdomains_init();
omap2420_hwmod_init();
} else if (cpu_is_omap243x()) {
omap2xxx_voltagedomains_init();
omap243x_powerdomains_init();
omap243x_clockdomains_init();
omap2430_hwmod_init();
} else if (cpu_is_omap34xx()) {
omap3xxx_voltagedomains_init();
omap3xxx_powerdomains_init();
omap3xxx_clockdomains_init();
omap3xxx_hwmod_init();
} else if (cpu_is_omap44xx()) {
omap44xx_voltagedomains_init();
omap44xx_powerdomains_init();
omap44xx_clockdomains_init();
omap44xx_hwmod_init();
} else {
pr_err("Could not init hwmod data - unknown SoC\n");
}
/* Set the default postsetup state for all hwmods */ /* Set the default postsetup state for all hwmods */
#ifdef CONFIG_PM_RUNTIME #ifdef CONFIG_PM_RUNTIME
...@@ -392,67 +357,101 @@ void __init omap2_init_common_infrastructure(void) ...@@ -392,67 +357,101 @@ void __init omap2_init_common_infrastructure(void)
&postsetup_state); &postsetup_state);
omap_pm_if_early_init(); omap_pm_if_early_init();
if (cpu_is_omap2420())
omap2420_clk_init();
else if (cpu_is_omap2430())
omap2430_clk_init();
else if (cpu_is_omap34xx())
omap3xxx_clk_init();
else if (cpu_is_omap44xx())
omap4xxx_clk_init();
else
pr_err("Could not init clock framework - unknown SoC\n");
} }
void __init omap2420_init_early(void) void __init omap2420_init_early(void)
{ {
omap2_init_common_infrastructure(); omap2_set_globals_242x();
omap_common_init_early();
omap2xxx_voltagedomains_init();
omap242x_powerdomains_init();
omap242x_clockdomains_init();
omap2420_hwmod_init();
omap_hwmod_init_postsetup();
omap2420_clk_init();
} }
void __init omap2430_init_early(void) void __init omap2430_init_early(void)
{ {
omap2_init_common_infrastructure(); omap2_set_globals_243x();
omap_common_init_early();
omap2xxx_voltagedomains_init();
omap243x_powerdomains_init();
omap243x_clockdomains_init();
omap2430_hwmod_init();
omap_hwmod_init_postsetup();
omap2430_clk_init();
}
/*
* Currently only board-omap3beagle.c should call this because of the
* same machine_id for 34xx and 36xx beagle.. Will get fixed with DT.
*/
void __init omap3_init_early(void)
{
omap2_set_globals_3xxx();
omap_common_init_early();
omap3xxx_voltagedomains_init();
omap3xxx_powerdomains_init();
omap3xxx_clockdomains_init();
omap3xxx_hwmod_init();
omap_hwmod_init_postsetup();
omap3xxx_clk_init();
} }
void __init omap3430_init_early(void) void __init omap3430_init_early(void)
{ {
omap2_init_common_infrastructure(); omap3_init_early();
} }
void __init omap35xx_init_early(void) void __init omap35xx_init_early(void)
{ {
omap2_init_common_infrastructure(); omap3_init_early();
} }
void __init omap3630_init_early(void) void __init omap3630_init_early(void)
{ {
omap2_init_common_infrastructure(); omap3_init_early();
} }
void __init am35xx_init_early(void) void __init am35xx_init_early(void)
{ {
omap2_init_common_infrastructure(); omap3_init_early();
} }
void __init ti816x_init_early(void) void __init ti816x_init_early(void)
{ {
omap2_init_common_infrastructure(); omap2_set_globals_ti816x();
omap_common_init_early();
omap3xxx_voltagedomains_init();
omap3xxx_powerdomains_init();
omap3xxx_clockdomains_init();
omap3xxx_hwmod_init();
omap_hwmod_init_postsetup();
omap3xxx_clk_init();
} }
void __init omap4430_init_early(void) void __init omap4430_init_early(void)
{ {
omap2_init_common_infrastructure(); omap2_set_globals_443x();
omap_common_init_early();
omap44xx_voltagedomains_init();
omap44xx_powerdomains_init();
omap44xx_clockdomains_init();
omap44xx_hwmod_init();
omap_hwmod_init_postsetup();
omap4xxx_clk_init();
} }
void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0, void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
struct omap_sdrc_params *sdrc_cs1) struct omap_sdrc_params *sdrc_cs1)
{ {
omap_sram_init();
if (cpu_is_omap24xx() || omap3_has_sdrc()) { if (cpu_is_omap24xx() || omap3_has_sdrc()) {
omap2_sdrc_init(sdrc_cs0, sdrc_cs1); omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
_omap2_init_reprogram_sdrc(); _omap2_init_reprogram_sdrc();
} }
} }
/* /*
......
#ifndef __MACH_OMAP2_IO_H__
#define __MACH_OMAP2_IO_H__
extern int __init omap_sram_init(void);
#endif /* __MACH_OMAP2_IO_H__ */
...@@ -122,14 +122,6 @@ static int omap3_enable_st_clock(unsigned int id, bool enable) ...@@ -122,14 +122,6 @@ static int omap3_enable_st_clock(unsigned int id, bool enable)
return 0; return 0;
} }
struct omap_device_pm_latency omap2_mcbsp_latency[] = {
{
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
{ {
int id, count = 1; int id, count = 1;
...@@ -175,8 +167,7 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) ...@@ -175,8 +167,7 @@ static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
count++; count++;
} }
pdev = omap_device_build_ss(name, id, oh_device, count, pdata, pdev = omap_device_build_ss(name, id, oh_device, count, pdata,
sizeof(*pdata), omap2_mcbsp_latency, sizeof(*pdata), NULL, 0, false);
ARRAY_SIZE(omap2_mcbsp_latency), false);
kfree(pdata); kfree(pdata);
if (IS_ERR(pdev)) { if (IS_ERR(pdev)) {
pr_err("%s: Can't build omap_device for %s:%s.\n", __func__, pr_err("%s: Can't build omap_device for %s:%s.\n", __func__,
......
...@@ -102,8 +102,11 @@ void __init smp_init_cpus(void) ...@@ -102,8 +102,11 @@ void __init smp_init_cpus(void)
{ {
unsigned int i, ncores; unsigned int i, ncores;
/* Never released */ /*
scu_base = ioremap(OMAP44XX_SCU_BASE, SZ_256); * Currently we can't call ioremap here because
* SoC detection won't work until after init_early.
*/
scu_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_SCU_BASE);
BUG_ON(!scu_base); BUG_ON(!scu_base);
ncores = scu_get_core_count(scu_base); ncores = scu_get_core_count(scu_base);
......
...@@ -56,11 +56,11 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3) ...@@ -56,11 +56,11 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
{ {
struct omap4_l3 *l3 = _l3; struct omap4_l3 *l3 = _l3;
int inttype, i, j; int inttype, i, k;
int err_src = 0; int err_src = 0;
u32 std_err_main_addr, std_err_main, err_reg; u32 std_err_main, err_reg, clear, masterid;
u32 base, slave_addr, clear; void __iomem *base, *l3_targ_base;
char *source_name; char *target_name, *master_name = "UN IDENTIFIED";
/* Get the Type of interrupt */ /* Get the Type of interrupt */
inttype = irq == l3->app_irq ? L3_APPLICATION_ERROR : L3_DEBUG_ERROR; inttype = irq == l3->app_irq ? L3_APPLICATION_ERROR : L3_DEBUG_ERROR;
...@@ -70,43 +70,50 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3) ...@@ -70,43 +70,50 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
* Read the regerr register of the clock domain * Read the regerr register of the clock domain
* to determine the source * to determine the source
*/ */
base = (u32)l3->l3_base[i]; base = l3->l3_base[i];
err_reg = readl(base + l3_flagmux[i] + (inttype << 3)); err_reg = __raw_readl(base + l3_flagmux[i] +
+ L3_FLAGMUX_REGERR0 + (inttype << 3));
/* Get the corresponding error and analyse */ /* Get the corresponding error and analyse */
if (err_reg) { if (err_reg) {
/* Identify the source from control status register */ /* Identify the source from control status register */
for (j = 0; !(err_reg & (1 << j)); j++) err_src = __ffs(err_reg);
;
err_src = j;
/* Read the stderrlog_main_source from clk domain */ /* Read the stderrlog_main_source from clk domain */
std_err_main_addr = base + *(l3_targ[i] + err_src); l3_targ_base = base + *(l3_targ[i] + err_src);
std_err_main = readl(std_err_main_addr); std_err_main = __raw_readl(l3_targ_base +
L3_TARG_STDERRLOG_MAIN);
masterid = __raw_readl(l3_targ_base +
L3_TARG_STDERRLOG_MSTADDR);
switch (std_err_main & CUSTOM_ERROR) { switch (std_err_main & CUSTOM_ERROR) {
case STANDARD_ERROR: case STANDARD_ERROR:
source_name = target_name =
l3_targ_stderrlog_main_name[i][err_src]; l3_targ_inst_name[i][err_src];
WARN(true, "L3 standard error: TARGET:%s at address 0x%x\n",
slave_addr = std_err_main_addr + target_name,
L3_SLAVE_ADDRESS_OFFSET; __raw_readl(l3_targ_base +
WARN(true, "L3 standard error: SOURCE:%s at address 0x%x\n", L3_TARG_STDERRLOG_SLVOFSLSB));
source_name, readl(slave_addr));
/* clear the std error log*/ /* clear the std error log*/
clear = std_err_main | CLEAR_STDERR_LOG; clear = std_err_main | CLEAR_STDERR_LOG;
writel(clear, std_err_main_addr); writel(clear, l3_targ_base +
L3_TARG_STDERRLOG_MAIN);
break; break;
case CUSTOM_ERROR: case CUSTOM_ERROR:
source_name = target_name =
l3_targ_stderrlog_main_name[i][err_src]; l3_targ_inst_name[i][err_src];
for (k = 0; k < NUM_OF_L3_MASTERS; k++) {
WARN(true, "CUSTOM SRESP error with SOURCE:%s\n", if (masterid == l3_masters[k].id)
source_name); master_name =
l3_masters[k].name;
}
WARN(true, "L3 custom error: MASTER:%s TARGET:%s\n",
master_name, target_name);
/* clear the std error log*/ /* clear the std error log*/
clear = std_err_main | CLEAR_STDERR_LOG; clear = std_err_main | CLEAR_STDERR_LOG;
writel(clear, std_err_main_addr); writel(clear, l3_targ_base +
L3_TARG_STDERRLOG_MAIN);
break; break;
default: default:
...@@ -120,12 +127,11 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3) ...@@ -120,12 +127,11 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int __init omap4_l3_probe(struct platform_device *pdev) static int __devinit omap4_l3_probe(struct platform_device *pdev)
{ {
static struct omap4_l3 *l3; static struct omap4_l3 *l3;
struct resource *res; struct resource *res;
int ret; int ret;
int irq;
l3 = kzalloc(sizeof(*l3), GFP_KERNEL); l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
if (!l3) if (!l3)
...@@ -177,8 +183,8 @@ static int __init omap4_l3_probe(struct platform_device *pdev) ...@@ -177,8 +183,8 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
/* /*
* Setup interrupt Handlers * Setup interrupt Handlers
*/ */
irq = platform_get_irq(pdev, 0); l3->debug_irq = platform_get_irq(pdev, 0);
ret = request_irq(irq, ret = request_irq(l3->debug_irq,
l3_interrupt_handler, l3_interrupt_handler,
IRQF_DISABLED, "l3-dbg-irq", l3); IRQF_DISABLED, "l3-dbg-irq", l3);
if (ret) { if (ret) {
...@@ -186,10 +192,9 @@ static int __init omap4_l3_probe(struct platform_device *pdev) ...@@ -186,10 +192,9 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
OMAP44XX_IRQ_L3_DBG); OMAP44XX_IRQ_L3_DBG);
goto err3; goto err3;
} }
l3->debug_irq = irq;
irq = platform_get_irq(pdev, 1); l3->app_irq = platform_get_irq(pdev, 1);
ret = request_irq(irq, ret = request_irq(l3->app_irq,
l3_interrupt_handler, l3_interrupt_handler,
IRQF_DISABLED, "l3-app-irq", l3); IRQF_DISABLED, "l3-app-irq", l3);
if (ret) { if (ret) {
...@@ -197,7 +202,6 @@ static int __init omap4_l3_probe(struct platform_device *pdev) ...@@ -197,7 +202,6 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
OMAP44XX_IRQ_L3_APP); OMAP44XX_IRQ_L3_APP);
goto err4; goto err4;
} }
l3->app_irq = irq;
return 0; return 0;
...@@ -214,7 +218,7 @@ static int __init omap4_l3_probe(struct platform_device *pdev) ...@@ -214,7 +218,7 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int __exit omap4_l3_remove(struct platform_device *pdev) static int __devexit omap4_l3_remove(struct platform_device *pdev)
{ {
struct omap4_l3 *l3 = platform_get_drvdata(pdev); struct omap4_l3 *l3 = platform_get_drvdata(pdev);
...@@ -228,16 +232,29 @@ static int __exit omap4_l3_remove(struct platform_device *pdev) ...@@ -228,16 +232,29 @@ static int __exit omap4_l3_remove(struct platform_device *pdev)
return 0; return 0;
} }
#if defined(CONFIG_OF)
static const struct of_device_id l3_noc_match[] = {
{.compatible = "ti,omap4-l3-noc", },
{},
}
MODULE_DEVICE_TABLE(of, l3_noc_match);
#else
#define l3_noc_match NULL
#endif
static struct platform_driver omap4_l3_driver = { static struct platform_driver omap4_l3_driver = {
.remove = __exit_p(omap4_l3_remove), .probe = omap4_l3_probe,
.remove = __devexit_p(omap4_l3_remove),
.driver = { .driver = {
.name = "omap_l3_noc", .name = "omap_l3_noc",
.owner = THIS_MODULE,
.of_match_table = l3_noc_match,
}, },
}; };
static int __init omap4_l3_init(void) static int __init omap4_l3_init(void)
{ {
return platform_driver_probe(&omap4_l3_driver, omap4_l3_probe); return platform_driver_register(&omap4_l3_driver);
} }
postcore_initcall_sync(omap4_l3_init); postcore_initcall_sync(omap4_l3_init);
......
/* /*
* OMAP4XXX L3 Interconnect error handling driver header * OMAP4XXX L3 Interconnect error handling driver header
* *
* Copyright (C) 2011 Texas Corporation * Copyright (C) 2011 Texas Corporation
...@@ -23,63 +23,94 @@ ...@@ -23,63 +23,94 @@
#ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H #ifndef __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
#define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H #define __ARCH_ARM_MACH_OMAP2_L3_INTERCONNECT_3XXX_H
/*
* L3 register offsets
*/
#define L3_MODULES 3 #define L3_MODULES 3
#define CLEAR_STDERR_LOG (1 << 31) #define CLEAR_STDERR_LOG (1 << 31)
#define CUSTOM_ERROR 0x2 #define CUSTOM_ERROR 0x2
#define STANDARD_ERROR 0x0 #define STANDARD_ERROR 0x0
#define INBAND_ERROR 0x0 #define INBAND_ERROR 0x0
#define EMIF_KERRLOG_OFFSET 0x10
#define L3_SLAVE_ADDRESS_OFFSET 0x14
#define LOGICAL_ADDR_ERRORLOG 0x4
#define L3_APPLICATION_ERROR 0x0 #define L3_APPLICATION_ERROR 0x0
#define L3_DEBUG_ERROR 0x1 #define L3_DEBUG_ERROR 0x1
u32 l3_flagmux[L3_MODULES] = { /* L3 TARG register offsets */
0x50C, #define L3_TARG_STDERRLOG_MAIN 0x48
0x100C, #define L3_TARG_STDERRLOG_SLVOFSLSB 0x5c
0X020C #define L3_TARG_STDERRLOG_MSTADDR 0x68
#define L3_FLAGMUX_REGERR0 0xc
#define NUM_OF_L3_MASTERS (sizeof(l3_masters)/sizeof(l3_masters[0]))
static u32 l3_flagmux[L3_MODULES] = {
0x500,
0x1000,
0X0200
}; };
/* /* L3 Target standard Error register offsets */
* L3 Target standard Error register offsets static u32 l3_targ_inst_clk1[] = {
*/ 0x100, /* DMM1 */
u32 l3_targ_stderrlog_main_clk1[] = { 0x200, /* DMM2 */
0x148, /* DMM1 */ 0x300, /* ABE */
0x248, /* DMM2 */ 0x400, /* L4CFG */
0x348, /* ABE */ 0x600 /* CLK2 PWR DISC */
0x448, /* L4CFG */
0x648 /* CLK2 PWR DISC */
}; };
u32 l3_targ_stderrlog_main_clk2[] = { static u32 l3_targ_inst_clk2[] = {
0x548, /* CORTEX M3 */ 0x500, /* CORTEX M3 */
0x348, /* DSS */ 0x300, /* DSS */
0x148, /* GPMC */ 0x100, /* GPMC */
0x448, /* ISS */ 0x400, /* ISS */
0x748, /* IVAHD */ 0x700, /* IVAHD */
0xD48, /* missing in TRM corresponds to AES1*/ 0xD00, /* missing in TRM corresponds to AES1*/
0x948, /* L4 PER0*/ 0x900, /* L4 PER0*/
0x248, /* OCMRAM */ 0x200, /* OCMRAM */
0x148, /* missing in TRM corresponds to GPMC sERROR*/ 0x100, /* missing in TRM corresponds to GPMC sERROR*/
0x648, /* SGX */ 0x600, /* SGX */
0x848, /* SL2 */ 0x800, /* SL2 */
0x1648, /* C2C */ 0x1600, /* C2C */
0x1148, /* missing in TRM corresponds PWR DISC CLK1*/ 0x1100, /* missing in TRM corresponds PWR DISC CLK1*/
0xF48, /* missing in TRM corrsponds to SHA1*/ 0xF00, /* missing in TRM corrsponds to SHA1*/
0xE48, /* missing in TRM corresponds to AES2*/ 0xE00, /* missing in TRM corresponds to AES2*/
0xC48, /* L4 PER3 */ 0xC00, /* L4 PER3 */
0xA48, /* L4 PER1*/ 0xA00, /* L4 PER1*/
0xB48 /* L4 PER2*/ 0xB00 /* L4 PER2*/
}; };
u32 l3_targ_stderrlog_main_clk3[] = { static u32 l3_targ_inst_clk3[] = {
0x0148 /* EMUSS */ 0x0100 /* EMUSS */
}; };
char *l3_targ_stderrlog_main_name[L3_MODULES][18] = { static struct l3_masters_data {
u32 id;
char name[10];
} l3_masters[] = {
{ 0x0 , "MPU"},
{ 0x10, "CS_ADP"},
{ 0x14, "xxx"},
{ 0x20, "DSP"},
{ 0x30, "IVAHD"},
{ 0x40, "ISS"},
{ 0x44, "DucatiM3"},
{ 0x48, "FaceDetect"},
{ 0x50, "SDMA_Rd"},
{ 0x54, "SDMA_Wr"},
{ 0x58, "xxx"},
{ 0x5C, "xxx"},
{ 0x60, "SGX"},
{ 0x70, "DSS"},
{ 0x80, "C2C"},
{ 0x88, "xxx"},
{ 0x8C, "xxx"},
{ 0x90, "HSI"},
{ 0xA0, "MMC1"},
{ 0xA4, "MMC2"},
{ 0xA8, "MMC6"},
{ 0xB0, "UNIPRO1"},
{ 0xC0, "USBHOSTHS"},
{ 0xC4, "USBOTGHS"},
{ 0xC8, "USBHOSTFS"}
};
static char *l3_targ_inst_name[L3_MODULES][18] = {
{ {
"DMM1", "DMM1",
"DMM2", "DMM2",
...@@ -112,10 +143,10 @@ char *l3_targ_stderrlog_main_name[L3_MODULES][18] = { ...@@ -112,10 +143,10 @@ char *l3_targ_stderrlog_main_name[L3_MODULES][18] = {
}, },
}; };
u32 *l3_targ[L3_MODULES] = { static u32 *l3_targ[L3_MODULES] = {
l3_targ_stderrlog_main_clk1, l3_targ_inst_clk1,
l3_targ_stderrlog_main_clk2, l3_targ_inst_clk2,
l3_targ_stderrlog_main_clk3, l3_targ_inst_clk3,
}; };
struct omap4_l3 { struct omap4_l3 {
...@@ -123,10 +154,9 @@ struct omap4_l3 { ...@@ -123,10 +154,9 @@ struct omap4_l3 {
struct clk *ick; struct clk *ick;
/* memory base */ /* memory base */
void __iomem *l3_base[4]; void __iomem *l3_base[L3_MODULES];
int debug_irq; int debug_irq;
int app_irq; int app_irq;
}; };
#endif #endif
/* /*
* OMAP3XXX L3 Interconnect Driver * OMAP3XXX L3 Interconnect Driver
* *
* Copyright (C) 2011 Texas Corporation * Copyright (C) 2011 Texas Corporation
...@@ -135,7 +135,7 @@ static char *omap3_l3_initiator_string(u8 initid) ...@@ -135,7 +135,7 @@ static char *omap3_l3_initiator_string(u8 initid)
} }
} }
/** /*
* omap3_l3_block_irq - handles a register block's irq * omap3_l3_block_irq - handles a register block's irq
* @l3: struct omap3_l3 * * @l3: struct omap3_l3 *
* @base: register block base address * @base: register block base address
...@@ -158,8 +158,7 @@ static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3, ...@@ -158,8 +158,7 @@ static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3,
WARN(true, "%s seen by %s %s at address %x\n", WARN(true, "%s seen by %s %s at address %x\n",
omap3_l3_code_string(code), omap3_l3_code_string(code),
omap3_l3_initiator_string(initid), omap3_l3_initiator_string(initid),
multi ? "Multiple Errors" : "", multi ? "Multiple Errors" : "", address);
address);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -191,14 +190,12 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) ...@@ -191,14 +190,12 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
} }
/* identify the error source */ /* identify the error source */
for (err_source = 0; !(status & (1 << err_source)); err_source++) err_source = __ffs(status);
;
base = l3->rt + *(omap3_l3_bases[int_type] + err_source); base = l3->rt + omap3_l3_bases[int_type][err_source];
error = omap3_l3_readll(base, L3_ERROR_LOG); error = omap3_l3_readll(base, L3_ERROR_LOG);
if (error) { if (error) {
error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR); error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR);
ret |= omap3_l3_block_irq(l3, error, error_addr); ret |= omap3_l3_block_irq(l3, error, error_addr);
} }
......
/* /*
* OMAP3XXX L3 Interconnect Driver header * OMAP3XXX L3 Interconnect Driver header
* *
* Copyright (C) 2011 Texas Corporation * Copyright (C) 2011 Texas Corporation
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#define L3_SI_CONTROL 0x020 #define L3_SI_CONTROL 0x020
#define L3_SI_FLAG_STATUS_0 0x510 #define L3_SI_FLAG_STATUS_0 0x510
const u64 shift = 1; static const u64 shift = 1;
#define L3_STATUS_0_MPUIA_BRST (shift << 0) #define L3_STATUS_0_MPUIA_BRST (shift << 0)
#define L3_STATUS_0_MPUIA_RSP (shift << 1) #define L3_STATUS_0_MPUIA_RSP (shift << 1)
...@@ -206,7 +206,7 @@ struct omap3_l3 { ...@@ -206,7 +206,7 @@ struct omap3_l3 {
}; };
/* offsets for l3 agents in order with the Flag status register */ /* offsets for l3 agents in order with the Flag status register */
unsigned int __iomem omap3_l3_app_bases[] = { static unsigned int omap3_l3_app_bases[] = {
/* MPU IA */ /* MPU IA */
0x1400, 0x1400,
0x1400, 0x1400,
...@@ -305,7 +305,7 @@ unsigned int __iomem omap3_l3_app_bases[] = { ...@@ -305,7 +305,7 @@ unsigned int __iomem omap3_l3_app_bases[] = {
0, 0,
}; };
unsigned int __iomem omap3_l3_debug_bases[] = { static unsigned int omap3_l3_debug_bases[] = {
/* MPU DATA IA */ /* MPU DATA IA */
0x1400, 0x1400,
/* RESERVED */ /* RESERVED */
...@@ -321,7 +321,7 @@ unsigned int __iomem omap3_l3_debug_bases[] = { ...@@ -321,7 +321,7 @@ unsigned int __iomem omap3_l3_debug_bases[] = {
/* REST RESERVED */ /* REST RESERVED */
}; };
u32 *omap3_l3_bases[] = { static u32 *omap3_l3_bases[] = {
omap3_l3_app_bases, omap3_l3_app_bases,
omap3_l3_debug_bases, omap3_l3_debug_bases,
}; };
......
...@@ -26,38 +26,7 @@ ...@@ -26,38 +26,7 @@
static struct omap_device_pm_latency *pm_lats; static struct omap_device_pm_latency *pm_lats;
static struct device *mpu_dev; static int _init_omap_device(char *name)
static struct device *iva_dev;
static struct device *l3_dev;
static struct device *dsp_dev;
struct device *omap2_get_mpuss_device(void)
{
WARN_ON_ONCE(!mpu_dev);
return mpu_dev;
}
struct device *omap2_get_iva_device(void)
{
WARN_ON_ONCE(!iva_dev);
return iva_dev;
}
struct device *omap2_get_l3_device(void)
{
WARN_ON_ONCE(!l3_dev);
return l3_dev;
}
struct device *omap4_get_dsp_device(void)
{
WARN_ON_ONCE(!dsp_dev);
return dsp_dev;
}
EXPORT_SYMBOL(omap4_get_dsp_device);
/* static int _init_omap_device(struct omap_hwmod *oh, void *user) */
static int _init_omap_device(char *name, struct device **new_dev)
{ {
struct omap_hwmod *oh; struct omap_hwmod *oh;
struct platform_device *pdev; struct platform_device *pdev;
...@@ -72,8 +41,6 @@ static int _init_omap_device(char *name, struct device **new_dev) ...@@ -72,8 +41,6 @@ static int _init_omap_device(char *name, struct device **new_dev)
__func__, name)) __func__, name))
return -ENODEV; return -ENODEV;
*new_dev = &pdev->dev;
return 0; return 0;
} }
...@@ -82,16 +49,16 @@ static int _init_omap_device(char *name, struct device **new_dev) ...@@ -82,16 +49,16 @@ static int _init_omap_device(char *name, struct device **new_dev)
*/ */
static void omap2_init_processor_devices(void) static void omap2_init_processor_devices(void)
{ {
_init_omap_device("mpu", &mpu_dev); _init_omap_device("mpu");
if (omap3_has_iva()) if (omap3_has_iva())
_init_omap_device("iva", &iva_dev); _init_omap_device("iva");
if (cpu_is_omap44xx()) { if (cpu_is_omap44xx()) {
_init_omap_device("l3_main_1", &l3_dev); _init_omap_device("l3_main_1");
_init_omap_device("dsp", &dsp_dev); _init_omap_device("dsp");
_init_omap_device("iva", &iva_dev); _init_omap_device("iva");
} else { } else {
_init_omap_device("l3_main", &l3_dev); _init_omap_device("l3_main");
} }
} }
...@@ -169,18 +136,26 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) ...@@ -169,18 +136,26 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
* in the opp entry * in the opp entry
*/ */
static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name, static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name,
struct device *dev) const char *oh_name)
{ {
struct voltagedomain *voltdm; struct voltagedomain *voltdm;
struct clk *clk; struct clk *clk;
struct opp *opp; struct opp *opp;
unsigned long freq, bootup_volt; unsigned long freq, bootup_volt;
struct device *dev;
if (!vdd_name || !clk_name || !dev) { if (!vdd_name || !clk_name || !oh_name) {
pr_err("%s: invalid parameters\n", __func__); pr_err("%s: invalid parameters\n", __func__);
goto exit; goto exit;
} }
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); voltdm = voltdm_lookup(vdd_name);
if (IS_ERR(voltdm)) { if (IS_ERR(voltdm)) {
pr_err("%s: unable to get vdd pointer for vdd_%s\n", pr_err("%s: unable to get vdd pointer for vdd_%s\n",
...@@ -224,8 +199,8 @@ static void __init omap3_init_voltages(void) ...@@ -224,8 +199,8 @@ static void __init omap3_init_voltages(void)
if (!cpu_is_omap34xx()) if (!cpu_is_omap34xx())
return; return;
omap2_set_init_voltage("mpu_iva", "dpll1_ck", mpu_dev); omap2_set_init_voltage("mpu_iva", "dpll1_ck", "mpu");
omap2_set_init_voltage("core", "l3_ick", l3_dev); omap2_set_init_voltage("core", "l3_ick", "l3_main");
} }
static void __init omap4_init_voltages(void) static void __init omap4_init_voltages(void)
...@@ -233,13 +208,14 @@ static void __init omap4_init_voltages(void) ...@@ -233,13 +208,14 @@ static void __init omap4_init_voltages(void)
if (!cpu_is_omap44xx()) if (!cpu_is_omap44xx())
return; return;
omap2_set_init_voltage("mpu", "dpll_mpu_ck", mpu_dev); omap2_set_init_voltage("mpu", "dpll_mpu_ck", "mpu");
omap2_set_init_voltage("core", "l3_div_ck", l3_dev); omap2_set_init_voltage("core", "l3_div_ck", "l3_main_1");
omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", iva_dev); omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva");
} }
static int __init omap2_common_pm_init(void) static int __init omap2_common_pm_init(void)
{ {
if (!of_have_populated_dt())
omap2_init_processor_devices(); omap2_init_processor_devices();
omap_pm_if_init(); omap_pm_if_init();
......
...@@ -151,17 +151,10 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest, ...@@ -151,17 +151,10 @@ int omap2_cm_wait_idlest(void __iomem *reg, u32 mask, u8 idlest,
void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals) void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals)
{ {
/* Static mapping, never released */ if (omap2_globals->prm)
if (omap2_globals->prm) { prm_base = omap2_globals->prm;
prm_base = ioremap(omap2_globals->prm, SZ_8K); if (omap2_globals->cm)
WARN_ON(!prm_base); cm_base = omap2_globals->cm;
} if (omap2_globals->cm2)
if (omap2_globals->cm) { cm2_base = omap2_globals->cm2;
cm_base = ioremap(omap2_globals->cm, SZ_8K);
WARN_ON(!cm_base);
}
if (omap2_globals->cm2) {
cm2_base = ioremap(omap2_globals->cm2, SZ_8K);
WARN_ON(!cm2_base);
}
} }
...@@ -117,15 +117,10 @@ int omap2_sdrc_get_params(unsigned long r, ...@@ -117,15 +117,10 @@ int omap2_sdrc_get_params(unsigned long r,
void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals) void __init omap2_set_globals_sdrc(struct omap_globals *omap2_globals)
{ {
/* Static mapping, never released */ if (omap2_globals->sdrc)
if (omap2_globals->sdrc) { omap2_sdrc_base = omap2_globals->sdrc;
omap2_sdrc_base = ioremap(omap2_globals->sdrc, SZ_64K); if (omap2_globals->sms)
WARN_ON(!omap2_sdrc_base); omap2_sms_base = omap2_globals->sms;
}
if (omap2_globals->sms) {
omap2_sms_base = ioremap(omap2_globals->sms, SZ_64K);
WARN_ON(!omap2_sms_base);
}
} }
/** /**
......
...@@ -107,28 +107,6 @@ struct omap_uart_state { ...@@ -107,28 +107,6 @@ struct omap_uart_state {
static LIST_HEAD(uart_list); static LIST_HEAD(uart_list);
static u8 num_uarts; static u8 num_uarts;
static int uart_idle_hwmod(struct omap_device *od)
{
omap_hwmod_idle(od->hwmods[0]);
return 0;
}
static int uart_enable_hwmod(struct omap_device *od)
{
omap_hwmod_enable(od->hwmods[0]);
return 0;
}
static struct omap_device_pm_latency omap_uart_latency[] = {
{
.deactivate_func = uart_idle_hwmod,
.activate_func = uart_enable_hwmod,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
static inline unsigned int __serial_read_reg(struct uart_port *up, static inline unsigned int __serial_read_reg(struct uart_port *up,
int offset) int offset)
{ {
...@@ -800,8 +778,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata) ...@@ -800,8 +778,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata)
return; return;
pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size, pdev = omap_device_build(name, uart->num, oh, pdata, pdata_size,
omap_uart_latency, NULL, 0, false);
ARRAY_SIZE(omap_uart_latency), false);
WARN(IS_ERR(pdev), "Could not build omap_device for %s: %s.\n", WARN(IS_ERR(pdev), "Could not build omap_device for %s: %s.\n",
name, oh->name); name, oh->name);
......
...@@ -31,14 +31,6 @@ ...@@ -31,14 +31,6 @@
static bool sr_enable_on_init; static bool sr_enable_on_init;
static struct omap_device_pm_latency omap_sr_latency[] = {
{
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST
},
};
/* Read EFUSE values from control registers for OMAP3430 */ /* Read EFUSE values from control registers for OMAP3430 */
static void __init sr_set_nvalues(struct omap_volt_data *volt_data, static void __init sr_set_nvalues(struct omap_volt_data *volt_data,
struct omap_sr_data *sr_data) struct omap_sr_data *sr_data)
...@@ -121,8 +113,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user) ...@@ -121,8 +113,7 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
sr_data->enable_on_init = sr_enable_on_init; sr_data->enable_on_init = sr_enable_on_init;
pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data), pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data),
omap_sr_latency, NULL, 0, 0);
ARRAY_SIZE(omap_sr_latency), 0);
if (IS_ERR(pdev)) if (IS_ERR(pdev))
pr_warning("%s: Could not build omap_device for %s: %s.\n\n", pr_warning("%s: Could not build omap_device for %s: %s.\n\n",
__func__, name, oh->name); __func__, name, oh->name);
......
...@@ -434,7 +434,7 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused) ...@@ -434,7 +434,7 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
int ret = 0; int ret = 0;
char *name = "omap_timer"; char *name = "omap_timer";
struct dmtimer_platform_data *pdata; struct dmtimer_platform_data *pdata;
struct omap_device *od; struct platform_device *pdev;
struct omap_timer_capability_dev_attr *timer_dev_attr; struct omap_timer_capability_dev_attr *timer_dev_attr;
struct powerdomain *pwrdm; struct powerdomain *pwrdm;
...@@ -476,12 +476,12 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused) ...@@ -476,12 +476,12 @@ static int __init omap_timer_init(struct omap_hwmod *oh, void *unused)
#ifdef CONFIG_PM #ifdef CONFIG_PM
pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count; pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count;
#endif #endif
od = omap_device_build(name, id, oh, pdata, sizeof(*pdata), pdev = omap_device_build(name, id, oh, pdata, sizeof(*pdata),
omap2_dmtimer_latency, omap2_dmtimer_latency,
ARRAY_SIZE(omap2_dmtimer_latency), ARRAY_SIZE(omap2_dmtimer_latency),
0); 0);
if (IS_ERR(od)) { if (IS_ERR(pdev)) {
pr_err("%s: Can't build omap_device for %s: %s.\n", pr_err("%s: Can't build omap_device for %s: %s.\n",
__func__, name, oh->name); __func__, name, oh->name);
ret = -EINVAL; ret = -EINVAL;
......
...@@ -60,14 +60,6 @@ static struct musb_hdrc_platform_data musb_plat = { ...@@ -60,14 +60,6 @@ static struct musb_hdrc_platform_data musb_plat = {
static u64 musb_dmamask = DMA_BIT_MASK(32); static u64 musb_dmamask = DMA_BIT_MASK(32);
static struct omap_device_pm_latency omap_musb_latency[] = {
{
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
static void usb_musb_mux_init(struct omap_musb_board_data *board_data) static void usb_musb_mux_init(struct omap_musb_board_data *board_data)
{ {
switch (board_data->interface_type) { switch (board_data->interface_type) {
...@@ -115,7 +107,6 @@ static struct omap_musb_board_data musb_default_board_data = { ...@@ -115,7 +107,6 @@ static struct omap_musb_board_data musb_default_board_data = {
void __init usb_musb_init(struct omap_musb_board_data *musb_board_data) void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
{ {
struct omap_hwmod *oh; struct omap_hwmod *oh;
struct omap_device *od;
struct platform_device *pdev; struct platform_device *pdev;
struct device *dev; struct device *dev;
int bus_id = -1; int bus_id = -1;
...@@ -146,21 +137,18 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data) ...@@ -146,21 +137,18 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
} }
oh = omap_hwmod_lookup(oh_name); oh = omap_hwmod_lookup(oh_name);
if (!oh) { if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
pr_err("Could not look up %s\n", oh_name); __func__, oh_name))
return; return;
}
od = omap_device_build(name, bus_id, oh, &musb_plat, pdev = omap_device_build(name, bus_id, oh, &musb_plat,
sizeof(musb_plat), omap_musb_latency, sizeof(musb_plat), NULL, 0, false);
ARRAY_SIZE(omap_musb_latency), false); if (IS_ERR(pdev)) {
if (IS_ERR(od)) {
pr_err("Could not build omap_device for %s %s\n", pr_err("Could not build omap_device for %s %s\n",
name, oh_name); name, oh_name);
return; return;
} }
pdev = &od->pdev;
dev = &pdev->dev; dev = &pdev->dev;
get_device(dev); get_device(dev);
dev->dma_mask = &musb_dmamask; dev->dma_mask = &musb_dmamask;
......
...@@ -139,14 +139,6 @@ static void omap_pm_set_max_mpu_wakeup_lat_compat(struct device *dev, long t) ...@@ -139,14 +139,6 @@ static void omap_pm_set_max_mpu_wakeup_lat_compat(struct device *dev, long t)
omap_pm_set_max_mpu_wakeup_lat(dev, t); omap_pm_set_max_mpu_wakeup_lat(dev, t);
} }
static struct omap_device_pm_latency omap_i2c_latency[] = {
[0] = {
.deactivate_func = omap_device_idle_hwmods,
.activate_func = omap_device_enable_hwmods,
.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
},
};
static inline int omap2_i2c_add_bus(int bus_id) static inline int omap2_i2c_add_bus(int bus_id)
{ {
int l; int l;
...@@ -189,7 +181,7 @@ static inline int omap2_i2c_add_bus(int bus_id) ...@@ -189,7 +181,7 @@ static inline int omap2_i2c_add_bus(int bus_id)
pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat; pdata->set_mpu_wkup_lat = omap_pm_set_max_mpu_wakeup_lat_compat;
pdev = omap_device_build(name, bus_id, oh, pdata, pdev = omap_device_build(name, bus_id, oh, pdata,
sizeof(struct omap_i2c_bus_platform_data), sizeof(struct omap_i2c_bus_platform_data),
omap_i2c_latency, ARRAY_SIZE(omap_i2c_latency), 0); NULL, 0, 0);
WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name); WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
return PTR_ERR(pdev); return PTR_ERR(pdev);
......
...@@ -50,10 +50,13 @@ void omap2430_init_early(void); ...@@ -50,10 +50,13 @@ void omap2430_init_early(void);
void omap3430_init_early(void); void omap3430_init_early(void);
void omap35xx_init_early(void); void omap35xx_init_early(void);
void omap3630_init_early(void); void omap3630_init_early(void);
void omap3_init_early(void); /* Do not use this one */
void am35xx_init_early(void); void am35xx_init_early(void);
void ti816x_init_early(void); void ti816x_init_early(void);
void omap4430_init_early(void); void omap4430_init_early(void);
void omap_sram_init(void);
/* /*
* IO bases for various OMAP processors * IO bases for various OMAP processors
* Except the tap base, rest all the io bases * Except the tap base, rest all the io bases
...@@ -62,13 +65,13 @@ void omap4430_init_early(void); ...@@ -62,13 +65,13 @@ void omap4430_init_early(void);
struct omap_globals { struct omap_globals {
u32 class; /* OMAP class to detect */ u32 class; /* OMAP class to detect */
void __iomem *tap; /* Control module ID code */ void __iomem *tap; /* Control module ID code */
unsigned long sdrc; /* SDRAM Controller */ void __iomem *sdrc; /* SDRAM Controller */
unsigned long sms; /* SDRAM Memory Scheduler */ void __iomem *sms; /* SDRAM Memory Scheduler */
unsigned long ctrl; /* System Control Module */ void __iomem *ctrl; /* System Control Module */
unsigned long ctrl_pad; /* PAD Control Module */ void __iomem *ctrl_pad; /* PAD Control Module */
unsigned long prm; /* Power and Reset Management */ void __iomem *prm; /* Power and Reset Management */
unsigned long cm; /* Clock Management */ void __iomem *cm; /* Clock Management */
unsigned long cm2; void __iomem *cm2;
}; };
void omap2_set_globals_242x(void); void omap2_set_globals_242x(void);
......
...@@ -228,13 +228,13 @@ ...@@ -228,13 +228,13 @@
#define OMAP44XX_EMIF2_PHYS OMAP44XX_EMIF2_BASE #define OMAP44XX_EMIF2_PHYS OMAP44XX_EMIF2_BASE
/* 0x4d000000 --> 0xfd200000 */ /* 0x4d000000 --> 0xfd200000 */
#define OMAP44XX_EMIF2_VIRT (OMAP44XX_EMIF2_PHYS + OMAP4_L3_PER_IO_OFFSET)
#define OMAP44XX_EMIF2_SIZE SZ_1M #define OMAP44XX_EMIF2_SIZE SZ_1M
#define OMAP44XX_EMIF2_VIRT (OMAP44XX_EMIF1_VIRT + OMAP44XX_EMIF1_SIZE)
#define OMAP44XX_DMM_PHYS OMAP44XX_DMM_BASE #define OMAP44XX_DMM_PHYS OMAP44XX_DMM_BASE
/* 0x4e000000 --> 0xfd300000 */ /* 0x4e000000 --> 0xfd300000 */
#define OMAP44XX_DMM_VIRT (OMAP44XX_DMM_PHYS + OMAP4_L3_PER_IO_OFFSET)
#define OMAP44XX_DMM_SIZE SZ_1M #define OMAP44XX_DMM_SIZE SZ_1M
#define OMAP44XX_DMM_VIRT (OMAP44XX_EMIF2_VIRT + OMAP44XX_EMIF2_SIZE)
/* /*
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
* Omap specific register access * Omap specific register access
...@@ -247,6 +247,8 @@ ...@@ -247,6 +247,8 @@
* NOTE: Please use ioremap + __raw_read/write where possible instead of these * NOTE: Please use ioremap + __raw_read/write where possible instead of these
*/ */
void omap_ioremap_init(void);
extern u8 omap_readb(u32 pa); extern u8 omap_readb(u32 pa);
extern u16 omap_readw(u32 pa); extern u16 omap_readw(u32 pa);
extern u32 omap_readl(u32 pa); extern u32 omap_readl(u32 pa);
...@@ -256,8 +258,31 @@ extern void omap_writel(u32 v, u32 pa); ...@@ -256,8 +258,31 @@ extern void omap_writel(u32 v, u32 pa);
struct omap_sdrc_params; struct omap_sdrc_params;
extern void omap1_map_common_io(void); #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
extern void omap1_init_common_hw(void); void omap7xx_map_io(void);
#else
static inline void omap_map_io(void)
{
}
#endif
#ifdef CONFIG_ARCH_OMAP15XX
void omap15xx_map_io(void);
#else
static inline void omap15xx_map_io(void)
{
}
#endif
#ifdef CONFIG_ARCH_OMAP16XX
void omap16xx_map_io(void);
#else
static inline void omap16xx_map_io(void)
{
}
#endif
void omap1_init_early(void);
#ifdef CONFIG_SOC_OMAP2420 #ifdef CONFIG_SOC_OMAP2420
extern void omap242x_map_common_io(void); extern void omap242x_map_common_io(void);
......
...@@ -101,6 +101,7 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id, ...@@ -101,6 +101,7 @@ struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
int pm_lats_cnt, int is_early_device); int pm_lats_cnt, int is_early_device);
void __iomem *omap_device_get_rt_va(struct omap_device *od); void __iomem *omap_device_get_rt_va(struct omap_device *od);
struct device *omap_device_get_by_hwmod_name(const char *oh_name);
/* OMAP PM interface */ /* OMAP PM interface */
int omap_device_align_pm_lat(struct platform_device *pdev, int omap_device_align_pm_lat(struct platform_device *pdev,
......
...@@ -24,11 +24,16 @@ ...@@ -24,11 +24,16 @@
#define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz))) #define BETWEEN(p,st,sz) ((p) >= (st) && (p) < ((st) + (sz)))
#define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst))) #define XLATE(p,pst,vst) ((void __iomem *)((p) - (pst) + (vst)))
static int initialized;
/* /*
* Intercept ioremap() requests for addresses in our fixed mapping regions. * Intercept ioremap() requests for addresses in our fixed mapping regions.
*/ */
void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type) void __iomem *omap_ioremap(unsigned long p, size_t size, unsigned int type)
{ {
WARN(!initialized, "Do not use ioremap before init_early\n");
#ifdef CONFIG_ARCH_OMAP1 #ifdef CONFIG_ARCH_OMAP1
if (cpu_class_is_omap1()) { if (cpu_class_is_omap1()) {
if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE)) if (BETWEEN(p, OMAP1_IO_PHYS, OMAP1_IO_SIZE))
...@@ -147,3 +152,8 @@ void __init omap_init_consistent_dma_size(void) ...@@ -147,3 +152,8 @@ void __init omap_init_consistent_dma_size(void)
init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20); init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
#endif #endif
} }
void __init omap_ioremap_init(void)
{
initialized++;
}
This diff is collapsed.
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/omapfb.h>
#include <asm/tlb.h> #include <asm/tlb.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
...@@ -29,10 +28,8 @@ ...@@ -29,10 +28,8 @@
#include <plat/sram.h> #include <plat/sram.h>
#include <plat/board.h> #include <plat/board.h>
#include <plat/cpu.h> #include <plat/cpu.h>
#include <plat/vram.h>
#include "sram.h" #include "sram.h"
#include "fb.h"
/* XXX These "sideways" includes are a sign that something is wrong */ /* XXX These "sideways" includes are a sign that something is wrong */
#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) #if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
...@@ -41,16 +38,9 @@ ...@@ -41,16 +38,9 @@
#endif #endif
#define OMAP1_SRAM_PA 0x20000000 #define OMAP1_SRAM_PA 0x20000000
#define OMAP1_SRAM_VA VMALLOC_END
#define OMAP2_SRAM_PUB_PA (OMAP2_SRAM_PA + 0xf800) #define OMAP2_SRAM_PUB_PA (OMAP2_SRAM_PA + 0xf800)
#define OMAP2_SRAM_VA 0xfe400000
#define OMAP2_SRAM_PUB_VA (OMAP2_SRAM_VA + 0x800)
#define OMAP3_SRAM_VA 0xfe400000
#define OMAP3_SRAM_PUB_PA (OMAP3_SRAM_PA + 0x8000) #define OMAP3_SRAM_PUB_PA (OMAP3_SRAM_PA + 0x8000)
#define OMAP3_SRAM_PUB_VA (OMAP3_SRAM_VA + 0x8000)
#define OMAP4_SRAM_VA 0xfe400000
#define OMAP4_SRAM_PUB_PA (OMAP4_SRAM_PA + 0x4000) #define OMAP4_SRAM_PUB_PA (OMAP4_SRAM_PA + 0x4000)
#define OMAP4_SRAM_PUB_VA (OMAP4_SRAM_VA + 0x4000)
#if defined(CONFIG_ARCH_OMAP2PLUS) #if defined(CONFIG_ARCH_OMAP2PLUS)
#define SRAM_BOOTLOADER_SZ 0x00 #define SRAM_BOOTLOADER_SZ 0x00
...@@ -73,9 +63,9 @@ ...@@ -73,9 +63,9 @@
#define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1))) #define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1)))
static unsigned long omap_sram_start; static unsigned long omap_sram_start;
static unsigned long omap_sram_base; static void __iomem *omap_sram_base;
static unsigned long omap_sram_size; static unsigned long omap_sram_size;
static unsigned long omap_sram_ceil; static void __iomem *omap_sram_ceil;
/* /*
* Depending on the target RAMFS firewall setup, the public usable amount of * Depending on the target RAMFS firewall setup, the public usable amount of
...@@ -112,12 +102,9 @@ static int is_sram_locked(void) ...@@ -112,12 +102,9 @@ static int is_sram_locked(void)
*/ */
static void __init omap_detect_sram(void) static void __init omap_detect_sram(void)
{ {
unsigned long reserved;
if (cpu_class_is_omap2()) { if (cpu_class_is_omap2()) {
if (is_sram_locked()) { if (is_sram_locked()) {
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx()) {
omap_sram_base = OMAP3_SRAM_PUB_VA;
omap_sram_start = OMAP3_SRAM_PUB_PA; omap_sram_start = OMAP3_SRAM_PUB_PA;
if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) || if ((omap_type() == OMAP2_DEVICE_TYPE_EMU) ||
(omap_type() == OMAP2_DEVICE_TYPE_SEC)) { (omap_type() == OMAP2_DEVICE_TYPE_SEC)) {
...@@ -126,25 +113,20 @@ static void __init omap_detect_sram(void) ...@@ -126,25 +113,20 @@ static void __init omap_detect_sram(void)
omap_sram_size = 0x8000; /* 32K */ omap_sram_size = 0x8000; /* 32K */
} }
} else if (cpu_is_omap44xx()) { } else if (cpu_is_omap44xx()) {
omap_sram_base = OMAP4_SRAM_PUB_VA;
omap_sram_start = OMAP4_SRAM_PUB_PA; omap_sram_start = OMAP4_SRAM_PUB_PA;
omap_sram_size = 0xa000; /* 40K */ omap_sram_size = 0xa000; /* 40K */
} else { } else {
omap_sram_base = OMAP2_SRAM_PUB_VA;
omap_sram_start = OMAP2_SRAM_PUB_PA; omap_sram_start = OMAP2_SRAM_PUB_PA;
omap_sram_size = 0x800; /* 2K */ omap_sram_size = 0x800; /* 2K */
} }
} else { } else {
if (cpu_is_omap34xx()) { if (cpu_is_omap34xx()) {
omap_sram_base = OMAP3_SRAM_VA;
omap_sram_start = OMAP3_SRAM_PA; omap_sram_start = OMAP3_SRAM_PA;
omap_sram_size = 0x10000; /* 64K */ omap_sram_size = 0x10000; /* 64K */
} else if (cpu_is_omap44xx()) { } else if (cpu_is_omap44xx()) {
omap_sram_base = OMAP4_SRAM_VA;
omap_sram_start = OMAP4_SRAM_PA; omap_sram_start = OMAP4_SRAM_PA;
omap_sram_size = 0xe000; /* 56K */ omap_sram_size = 0xe000; /* 56K */
} else { } else {
omap_sram_base = OMAP2_SRAM_VA;
omap_sram_start = OMAP2_SRAM_PA; omap_sram_start = OMAP2_SRAM_PA;
if (cpu_is_omap242x()) if (cpu_is_omap242x())
omap_sram_size = 0xa0000; /* 640K */ omap_sram_size = 0xa0000; /* 640K */
...@@ -153,7 +135,6 @@ static void __init omap_detect_sram(void) ...@@ -153,7 +135,6 @@ static void __init omap_detect_sram(void)
} }
} }
} else { } else {
omap_sram_base = OMAP1_SRAM_VA;
omap_sram_start = OMAP1_SRAM_PA; omap_sram_start = OMAP1_SRAM_PA;
if (cpu_is_omap7xx()) if (cpu_is_omap7xx())
...@@ -170,35 +151,14 @@ static void __init omap_detect_sram(void) ...@@ -170,35 +151,14 @@ static void __init omap_detect_sram(void)
omap_sram_size = 0x4000; omap_sram_size = 0x4000;
} }
} }
reserved = omapfb_reserve_sram(omap_sram_start, omap_sram_base,
omap_sram_size,
omap_sram_start + SRAM_BOOTLOADER_SZ,
omap_sram_size - SRAM_BOOTLOADER_SZ);
omap_sram_size -= reserved;
reserved = omap_vram_reserve_sram(omap_sram_start, omap_sram_base,
omap_sram_size,
omap_sram_start + SRAM_BOOTLOADER_SZ,
omap_sram_size - SRAM_BOOTLOADER_SZ);
omap_sram_size -= reserved;
omap_sram_ceil = omap_sram_base + omap_sram_size;
} }
static struct map_desc omap_sram_io_desc[] __initdata = {
{ /* .length gets filled in at runtime */
.virtual = OMAP1_SRAM_VA,
.pfn = __phys_to_pfn(OMAP1_SRAM_PA),
.type = MT_MEMORY
}
};
/* /*
* Note that we cannot use ioremap for SRAM, as clock init needs SRAM early. * Note that we cannot use ioremap for SRAM, as clock init needs SRAM early.
*/ */
static void __init omap_map_sram(void) static void __init omap_map_sram(void)
{ {
unsigned long base; int cached = 1;
if (omap_sram_size == 0) if (omap_sram_size == 0)
return; return;
...@@ -211,28 +171,18 @@ static void __init omap_map_sram(void) ...@@ -211,28 +171,18 @@ static void __init omap_map_sram(void)
* the ARM may attempt to write cache lines back to SDRAM * the ARM may attempt to write cache lines back to SDRAM
* which will cause the system to hang. * which will cause the system to hang.
*/ */
omap_sram_io_desc[0].type = MT_MEMORY_NONCACHED; cached = 0;
} }
omap_sram_io_desc[0].virtual = omap_sram_base; omap_sram_start = ROUND_DOWN(omap_sram_start, PAGE_SIZE);
base = omap_sram_start; omap_sram_base = __arm_ioremap_exec(omap_sram_start, omap_sram_size,
base = ROUND_DOWN(base, PAGE_SIZE); cached);
omap_sram_io_desc[0].pfn = __phys_to_pfn(base); if (!omap_sram_base) {
omap_sram_io_desc[0].length = ROUND_DOWN(omap_sram_size, PAGE_SIZE); pr_err("SRAM: Could not map\n");
iotable_init(omap_sram_io_desc, ARRAY_SIZE(omap_sram_io_desc)); return;
}
pr_info("SRAM: Mapped pa 0x%08llx to va 0x%08lx size: 0x%lx\n",
(long long) __pfn_to_phys(omap_sram_io_desc[0].pfn),
omap_sram_io_desc[0].virtual,
omap_sram_io_desc[0].length);
/* omap_sram_ceil = omap_sram_base + omap_sram_size;
* Normally devicemaps_init() would flush caches and tlb after
* mdesc->map_io(), but since we're called from map_io(), we
* must do it here.
*/
local_flush_tlb_all();
flush_cache_all();
/* /*
* Looks like we need to preserve some bootloader code at the * Looks like we need to preserve some bootloader code at the
...@@ -251,13 +201,18 @@ static void __init omap_map_sram(void) ...@@ -251,13 +201,18 @@ static void __init omap_map_sram(void)
*/ */
void *omap_sram_push_address(unsigned long size) void *omap_sram_push_address(unsigned long size)
{ {
if (size > (omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ))) { unsigned long available, new_ceil = (unsigned long)omap_sram_ceil;
available = omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ);
if (size > available) {
pr_err("Not enough space in SRAM\n"); pr_err("Not enough space in SRAM\n");
return NULL; return NULL;
} }
omap_sram_ceil -= size; new_ceil -= size;
omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, FNCPY_ALIGN); new_ceil = ROUND_DOWN(new_ceil, FNCPY_ALIGN);
omap_sram_ceil = IOMEM(new_ceil);
return (void *)omap_sram_ceil; return (void *)omap_sram_ceil;
} }
......
...@@ -715,6 +715,90 @@ int of_property_read_string(struct device_node *np, const char *propname, ...@@ -715,6 +715,90 @@ int of_property_read_string(struct device_node *np, const char *propname,
} }
EXPORT_SYMBOL_GPL(of_property_read_string); EXPORT_SYMBOL_GPL(of_property_read_string);
/**
* of_property_read_string_index - Find and read a string from a multiple
* strings property.
* @np: device node from which the property value is to be read.
* @propname: name of the property to be searched.
* @index: index of the string in the list of strings
* @out_string: pointer to null terminated return string, modified only if
* return value is 0.
*
* Search for a property in a device tree node and retrieve a null
* terminated string value (pointer to data, not a copy) in the list of strings
* contained in that property.
* Returns 0 on success, -EINVAL if the property does not exist, -ENODATA if
* property does not have a value, and -EILSEQ if the string is not
* null-terminated within the length of the property data.
*
* The out_string pointer is modified only if a valid string can be decoded.
*/
int of_property_read_string_index(struct device_node *np, const char *propname,
int index, const char **output)
{
struct property *prop = of_find_property(np, propname, NULL);
int i = 0;
size_t l = 0, total = 0;
const char *p;
if (!prop)
return -EINVAL;
if (!prop->value)
return -ENODATA;
if (strnlen(prop->value, prop->length) >= prop->length)
return -EILSEQ;
p = prop->value;
for (i = 0; total < prop->length; total += l, p += l) {
l = strlen(p) + 1;
if ((*p != 0) && (i++ == index)) {
*output = p;
return 0;
}
}
return -ENODATA;
}
EXPORT_SYMBOL_GPL(of_property_read_string_index);
/**
* of_property_count_strings - Find and return the number of strings from a
* multiple strings property.
* @np: device node from which the property value is to be read.
* @propname: name of the property to be searched.
*
* Search for a property in a device tree node and retrieve the number of null
* terminated string contain in it. Returns the number of strings on
* success, -EINVAL if the property does not exist, -ENODATA if property
* does not have a value, and -EILSEQ if the string is not null-terminated
* within the length of the property data.
*/
int of_property_count_strings(struct device_node *np, const char *propname)
{
struct property *prop = of_find_property(np, propname, NULL);
int i = 0;
size_t l = 0, total = 0;
const char *p;
if (!prop)
return -EINVAL;
if (!prop->value)
return -ENODATA;
if (strnlen(prop->value, prop->length) >= prop->length)
return -EILSEQ;
p = prop->value;
for (i = 0; total < prop->length; total += l, p += l) {
l = strlen(p) + 1;
if (*p != 0)
i++;
}
return i;
}
EXPORT_SYMBOL_GPL(of_property_count_strings);
/** /**
* of_parse_phandle - Resolve a phandle property to a device_node pointer * of_parse_phandle - Resolve a phandle property to a device_node pointer
* @np: Pointer to device node holding phandle property * @np: Pointer to device node holding phandle property
......
...@@ -207,6 +207,11 @@ extern int of_property_read_u64(const struct device_node *np, ...@@ -207,6 +207,11 @@ extern int of_property_read_u64(const struct device_node *np,
extern int of_property_read_string(struct device_node *np, extern int of_property_read_string(struct device_node *np,
const char *propname, const char *propname,
const char **out_string); const char **out_string);
extern int of_property_read_string_index(struct device_node *np,
const char *propname,
int index, const char **output);
extern int of_property_count_strings(struct device_node *np,
const char *propname);
extern int of_device_is_compatible(const struct device_node *device, extern int of_device_is_compatible(const struct device_node *device,
const char *); const char *);
extern int of_device_is_available(const struct device_node *device); extern int of_device_is_available(const struct device_node *device);
...@@ -283,6 +288,19 @@ static inline int of_property_read_string(struct device_node *np, ...@@ -283,6 +288,19 @@ static inline int of_property_read_string(struct device_node *np,
return -ENOSYS; return -ENOSYS;
} }
static inline int of_property_read_string_index(struct device_node *np,
const char *propname, int index,
const char **out_string)
{
return -ENOSYS;
}
static inline int of_property_count_strings(struct device_node *np,
const char *propname)
{
return -ENOSYS;
}
static inline const void *of_get_property(const struct device_node *node, static inline const void *of_get_property(const struct device_node *node,
const char *name, const char *name,
int *lenp) int *lenp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment