Skip to content

Commit

Permalink
ARM: OMAP1: Use generic map_io, init_early and init_irq
Browse files Browse the repository at this point in the history
This allows removing omap hacks for map_io allowing generic
map_io.

Note that in the future we can't do cpu_is_omapxxxx detection
until in init_early. This means that board-innovator.c now
assumes 15xx only, and board-generic.c assumes 16xx only.
This is best fixed later on by passing the SoC type from
device tree.

Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Tony Lindgren committed Oct 19, 2011
1 parent 3ae3e25 commit 7b88e62
Show file tree
Hide file tree
Showing 17 changed files with 183 additions and 296 deletions.
16 changes: 3 additions & 13 deletions arch/arm/mach-omap1/board-ams-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ void ams_delta_latch2_write(u16 mask, u16 value)
*(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 = {
/* AMS_DELTA_LATCH1 */
{
Expand Down Expand Up @@ -379,17 +373,13 @@ static int __init ams_delta_modem_init(void)
}
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)")
/* Maintainer: Jonathan McDowell <noodles@earth.li> */
.boot_params = 0x10000100,
.map_io = ams_delta_map_io,
.map_io = omap15xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve,
.init_irq = ams_delta_init_irq,
.init_irq = omap1_init_irq,
.init_machine = ams_delta_init,
.timer = &omap1_timer,
MACHINE_END
Expand Down
76 changes: 36 additions & 40 deletions arch/arm/mach-omap1/board-fsample.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,39 @@ static struct omap_board_config_kernel fsample_config[] __initdata = {

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();

if (gpio_request(FSAMPLE_NAND_RB_GPIO_PIN, "NAND ready") < 0)
Expand Down Expand Up @@ -326,12 +359,6 @@ static void __init omap_fsample_init(void)
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 */
static struct map_desc omap_fsample_io_desc[] __initdata = {
{
Expand All @@ -350,49 +377,18 @@ static struct map_desc omap_fsample_io_desc[] __initdata = {

static void __init omap_fsample_map_io(void)
{
omap1_map_common_io();
omap15xx_map_io();
iotable_init(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")
/* Maintainer: Brian Swetland <swetland@google.com> */
.boot_params = 0x10000100,
.map_io = omap_fsample_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve,
.init_irq = omap_fsample_init_irq,
.init_irq = omap1_init_irq,
.init_machine = omap_fsample_init,
.timer = &omap1_timer,
MACHINE_END
16 changes: 3 additions & 13 deletions arch/arm/mach-omap1/board-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
#include <plat/board.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 */

#ifdef CONFIG_ARCH_OMAP15XX
Expand Down Expand Up @@ -87,17 +81,13 @@ static void __init omap_generic_init(void)
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")
/* Maintainer: Tony Lindgren <tony@atomide.com> */
.boot_params = 0x10000100,
.map_io = omap_generic_map_io,
.map_io = omap16xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve,
.init_irq = omap_generic_init_irq,
.init_irq = omap1_init_irq,
.init_machine = omap_generic_init,
.timer = &omap1_timer,
MACHINE_END
16 changes: 3 additions & 13 deletions arch/arm/mach-omap1/board-h2.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,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 = {
/* usb1 has a Mini-AB port and external isp1301 transceiver */
.otg = 2,
Expand Down Expand Up @@ -454,17 +448,13 @@ static void __init h2_init(void)
h2_mmc_init();
}

static void __init h2_map_io(void)
{
omap1_map_common_io();
}

MACHINE_START(OMAP_H2, "TI-H2")
/* Maintainer: Imre Deak <imre.deak@nokia.com> */
.boot_params = 0x10000100,
.map_io = h2_map_io,
.map_io = omap16xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve,
.init_irq = h2_init_irq,
.init_irq = omap1_init_irq,
.init_machine = h2_init,
.timer = &omap1_timer,
MACHINE_END
16 changes: 3 additions & 13 deletions arch/arm/mach-omap1/board-h3.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,23 +436,13 @@ static void __init h3_init(void)
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")
/* Maintainer: Texas Instruments, Inc. */
.boot_params = 0x10000100,
.map_io = h3_map_io,
.map_io = omap16xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve,
.init_irq = h3_init_irq,
.init_irq = omap1_init_irq,
.init_machine = h3_init,
.timer = &omap1_timer,
MACHINE_END
12 changes: 3 additions & 9 deletions arch/arm/mach-omap1/board-htcherald.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ static void __init htcherald_lcd_init(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
Expand Down Expand Up @@ -601,20 +601,14 @@ static void __init htcherald_init(void)
#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")
/* Maintainer: Cory Maccarrone <darkstar6262@gmail.com> */
/* Maintainer: wing-linux.sourceforge.net */
.boot_params = 0x10000100,
.map_io = htcherald_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve,
.init_irq = htcherald_init_irq,
.init_irq = omap1_init_irq,
.init_machine = htcherald_init,
.timer = &omap1_timer,
MACHINE_END
36 changes: 16 additions & 20 deletions arch/arm/mach-omap1/board-innovator.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,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
static struct omap_usb_config innovator1510_usb_config __initdata = {
/* for bundled non-standard host and peripheral cables */
Expand Down Expand Up @@ -439,30 +433,32 @@ static void __init innovator_init(void)
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)
{
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));
udelay(10); /* Delay needed for FPGA */

/* Dump the Innovator FPGA rev early - useful info for support. */
printk("Innovator FPGA Rev %d.%d Board Rev %d\n",
fpga_read(OMAP1510_FPGA_REV_HIGH),
fpga_read(OMAP1510_FPGA_REV_LOW),
fpga_read(OMAP1510_FPGA_BOARD_REV));
}
#endif
iotable_init(innovator1510_io_desc, ARRAY_SIZE(innovator1510_io_desc));
udelay(10); /* Delay needed for FPGA */

/* Dump the Innovator FPGA rev early - useful info for support. */
pr_debug("Innovator FPGA Rev %d.%d Board Rev %d\n",
fpga_read(OMAP1510_FPGA_REV_HIGH),
fpga_read(OMAP1510_FPGA_REV_LOW),
fpga_read(OMAP1510_FPGA_BOARD_REV));
}

MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
/* Maintainer: MontaVista Software, Inc. */
.boot_params = 0x10000100,
.map_io = innovator_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve,
.init_irq = innovator_init_irq,
.init_irq = omap1_init_irq,
.init_machine = innovator_init,
.timer = &omap1_timer,
MACHINE_END
34 changes: 12 additions & 22 deletions arch/arm/mach-omap1/board-nokia770.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,6 @@

#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[] = {
KEY(1, 0, GROUP_0 | KEY_UP),
KEY(2, 0, GROUP_1 | KEY_F5),
Expand Down Expand Up @@ -246,6 +231,15 @@ static inline void nokia770_mmc_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));
spi_register_board_info(nokia770_spi_board_info,
ARRAY_SIZE(nokia770_spi_board_info));
Expand All @@ -258,16 +252,12 @@ static void __init omap_nokia770_init(void)
nokia770_mmc_init();
}

static void __init omap_nokia770_map_io(void)
{
omap1_map_common_io();
}

MACHINE_START(NOKIA770, "Nokia 770")
.boot_params = 0x10000100,
.map_io = omap_nokia770_map_io,
.map_io = omap16xx_map_io,
.init_early = omap1_init_early,
.reserve = omap_reserve,
.init_irq = omap_nokia770_init_irq,
.init_irq = omap1_init_irq,
.init_machine = omap_nokia770_init,
.timer = &omap1_timer,
MACHINE_END
Loading

0 comments on commit 7b88e62

Please sign in to comment.