Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (51 commits) [ARM] 5308/1: Fix Viper ISA IRQ handling [ARM] 5307/1: pxa: fix CM-X2XX PCMCIA build error [ARM] 5306/1: pxa: fix build error on CM-X270 [ARM] 5302/1: ARM: OMAP: Revert omap3 WDT changes to avoid merge conflict [ARM] 5305/1: ARM: OMAP: Fix compile of McBSP by removing unnecessary check [ARM] 5301/1: ARM: OMAP: Add missing irq defines ARM: OMAP3: Add default kernel config for OMAP LDP ARM: OMAP3: Add basic board support for OMAP LDP ARM: OMAP3: Defconfig for the Gumstix Overo board (rev 3) ARM: OMAP3: Add support for the Gumstix Overo board (rev 3) ARM: OMAP3: Add Beagle defconfig ARM: OMAP3: Add minimal Beagle board support ARM: OMAP3: Add minimal omap3430 support ARM: OMAP2: Fix sparse, checkpatch warnings in OMAP2/3 IRQ code ARM: OMAP: Fixes to omap_mcbsp_request function ARM: OMAP: Add support for OMAP2430 in McBSP ARM: OMAP: Add support for McBSP devices 3 - 5 on 34xx ARM: OMAP: Allocate McBSP devices dynamically Fix sections for omap-mcbsp platform driver [ARM] S3C24XX: Additional include moves ...
This commit is contained in:
commit
8ef50901d3
193 changed files with 10919 additions and 1145 deletions
|
@ -118,9 +118,10 @@ endif
|
|||
machine-$(CONFIG_ARCH_IXP23XX) := ixp23xx
|
||||
machine-$(CONFIG_ARCH_OMAP1) := omap1
|
||||
machine-$(CONFIG_ARCH_OMAP2) := omap2
|
||||
machine-$(CONFIG_ARCH_OMAP3) := omap2
|
||||
plat-$(CONFIG_ARCH_OMAP) := omap
|
||||
machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443
|
||||
plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx
|
||||
plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c
|
||||
machine-$(CONFIG_ARCH_LH7A40X) := lh7a40x
|
||||
machine-$(CONFIG_ARCH_VERSATILE) := versatile
|
||||
machine-$(CONFIG_ARCH_IMX) := imx
|
||||
|
|
1321
arch/arm/configs/omap3_beagle_defconfig
Normal file
1321
arch/arm/configs/omap3_beagle_defconfig
Normal file
File diff suppressed because it is too large
Load diff
1044
arch/arm/configs/omap_ldp_defconfig
Normal file
1044
arch/arm/configs/omap_ldp_defconfig
Normal file
File diff suppressed because it is too large
Load diff
1885
arch/arm/configs/overo_defconfig
Normal file
1885
arch/arm/configs/overo_defconfig
Normal file
File diff suppressed because it is too large
Load diff
|
@ -201,7 +201,7 @@ static int calc_dsor_exp(struct clk *clk, unsigned long rate)
|
|||
return -EINVAL;
|
||||
|
||||
parent = clk->parent;
|
||||
if (unlikely(parent == 0))
|
||||
if (unlikely(parent == NULL))
|
||||
return -EIO;
|
||||
|
||||
realrate = parent->rate;
|
||||
|
@ -499,7 +499,7 @@ static int omap1_clk_enable_generic(struct clk *clk)
|
|||
if (clk->flags & ALWAYS_ENABLED)
|
||||
return 0;
|
||||
|
||||
if (unlikely(clk->enable_reg == 0)) {
|
||||
if (unlikely(clk->enable_reg == NULL)) {
|
||||
printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
|
||||
clk->name);
|
||||
return -EINVAL;
|
||||
|
@ -535,7 +535,7 @@ static void omap1_clk_disable_generic(struct clk *clk)
|
|||
__u16 regval16;
|
||||
__u32 regval32;
|
||||
|
||||
if (clk->enable_reg == 0)
|
||||
if (clk->enable_reg == NULL)
|
||||
return;
|
||||
|
||||
if (clk->flags & ENABLE_REG_32BIT) {
|
||||
|
@ -577,7 +577,7 @@ static long omap1_clk_round_rate(struct clk *clk, unsigned long rate)
|
|||
return clk->parent->rate / (1 << dsor_exp);
|
||||
}
|
||||
|
||||
if(clk->round_rate != 0)
|
||||
if (clk->round_rate != NULL)
|
||||
return clk->round_rate(clk, rate);
|
||||
|
||||
return clk->rate;
|
||||
|
@ -625,7 +625,7 @@ static void __init omap1_clk_disable_unused(struct clk *clk)
|
|||
|
||||
/* Clocks in the DSP domain need api_ck. Just assume bootloader
|
||||
* has not enabled any DSP clocks */
|
||||
if ((u32)clk->enable_reg == DSP_IDLECT2) {
|
||||
if (clk->enable_reg == DSP_IDLECT2) {
|
||||
printk(KERN_INFO "Skipping reset check for DSP domain "
|
||||
"clock \"%s\"\n", clk->name);
|
||||
return;
|
||||
|
|
|
@ -324,7 +324,7 @@ static struct clk dspper_ck = {
|
|||
.parent = &ck_dpll1,
|
||||
.flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
|
||||
RATE_CKCTL | VIRTUAL_IO_ADDRESS,
|
||||
.enable_reg = (void __iomem *)DSP_IDLECT2,
|
||||
.enable_reg = DSP_IDLECT2,
|
||||
.enable_bit = EN_PERCK,
|
||||
.rate_offset = CKCTL_PERDIV_OFFSET,
|
||||
.recalc = &omap1_ckctl_recalc_dsp_domain,
|
||||
|
@ -338,7 +338,7 @@ static struct clk dspxor_ck = {
|
|||
.parent = &ck_ref,
|
||||
.flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
|
||||
VIRTUAL_IO_ADDRESS,
|
||||
.enable_reg = (void __iomem *)DSP_IDLECT2,
|
||||
.enable_reg = DSP_IDLECT2,
|
||||
.enable_bit = EN_XORPCK,
|
||||
.recalc = &followparent_recalc,
|
||||
.enable = &omap1_clk_enable_dsp_domain,
|
||||
|
@ -350,7 +350,7 @@ static struct clk dsptim_ck = {
|
|||
.parent = &ck_ref,
|
||||
.flags = CLOCK_IN_OMAP310 | CLOCK_IN_OMAP1510 | CLOCK_IN_OMAP16XX |
|
||||
VIRTUAL_IO_ADDRESS,
|
||||
.enable_reg = (void __iomem *)DSP_IDLECT2,
|
||||
.enable_reg = DSP_IDLECT2,
|
||||
.enable_bit = EN_DSPTIMCK,
|
||||
.recalc = &followparent_recalc,
|
||||
.enable = &omap1_clk_enable_dsp_domain,
|
||||
|
|
|
@ -101,7 +101,7 @@ static inline void omap_init_mbox(void) { }
|
|||
|
||||
#if defined(CONFIG_OMAP_STI)
|
||||
|
||||
#define OMAP1_STI_BASE IO_ADDRESS(0xfffea000)
|
||||
#define OMAP1_STI_BASE 0xfffea000
|
||||
#define OMAP1_STI_CHANNEL_BASE (OMAP1_STI_BASE + 0x400)
|
||||
|
||||
static struct resource sti_resources[] = {
|
||||
|
|
|
@ -103,30 +103,6 @@ static inline void omap_mcbsp_clk_init(struct mcbsp_internal_clk *mclk)
|
|||
{ }
|
||||
#endif
|
||||
|
||||
static int omap1_mcbsp_check(unsigned int id)
|
||||
{
|
||||
/* REVISIT: Check correctly for number of registered McBSPs */
|
||||
if (cpu_is_omap730()) {
|
||||
if (id > OMAP_MAX_MCBSP_COUNT - 2) {
|
||||
printk(KERN_ERR "OMAP-McBSP: McBSP%d doesn't exist\n",
|
||||
id + 1);
|
||||
return -ENODEV;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (cpu_is_omap15xx() || cpu_is_omap16xx()) {
|
||||
if (id > OMAP_MAX_MCBSP_COUNT - 1) {
|
||||
printk(KERN_ERR "OMAP-McBSP: McBSP%d doesn't exist\n",
|
||||
id + 1);
|
||||
return -ENODEV;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static void omap1_mcbsp_request(unsigned int id)
|
||||
{
|
||||
/*
|
||||
|
@ -151,7 +127,6 @@ static void omap1_mcbsp_free(unsigned int id)
|
|||
}
|
||||
|
||||
static struct omap_mcbsp_ops omap1_mcbsp_ops = {
|
||||
.check = omap1_mcbsp_check,
|
||||
.request = omap1_mcbsp_request,
|
||||
.free = omap1_mcbsp_free,
|
||||
};
|
||||
|
@ -160,7 +135,6 @@ static struct omap_mcbsp_ops omap1_mcbsp_ops = {
|
|||
static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = {
|
||||
{
|
||||
.phys_base = OMAP730_MCBSP1_BASE,
|
||||
.virt_base = io_p2v(OMAP730_MCBSP1_BASE),
|
||||
.dma_rx_sync = OMAP_DMA_MCBSP1_RX,
|
||||
.dma_tx_sync = OMAP_DMA_MCBSP1_TX,
|
||||
.rx_irq = INT_730_McBSP1RX,
|
||||
|
@ -169,7 +143,6 @@ static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = {
|
|||
},
|
||||
{
|
||||
.phys_base = OMAP730_MCBSP2_BASE,
|
||||
.virt_base = io_p2v(OMAP730_MCBSP2_BASE),
|
||||
.dma_rx_sync = OMAP_DMA_MCBSP3_RX,
|
||||
.dma_tx_sync = OMAP_DMA_MCBSP3_TX,
|
||||
.rx_irq = INT_730_McBSP2RX,
|
||||
|
@ -187,7 +160,6 @@ static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = {
|
|||
static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
|
||||
{
|
||||
.phys_base = OMAP1510_MCBSP1_BASE,
|
||||
.virt_base = OMAP1510_MCBSP1_BASE,
|
||||
.dma_rx_sync = OMAP_DMA_MCBSP1_RX,
|
||||
.dma_tx_sync = OMAP_DMA_MCBSP1_TX,
|
||||
.rx_irq = INT_McBSP1RX,
|
||||
|
@ -197,7 +169,6 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
|
|||
},
|
||||
{
|
||||
.phys_base = OMAP1510_MCBSP2_BASE,
|
||||
.virt_base = io_p2v(OMAP1510_MCBSP2_BASE),
|
||||
.dma_rx_sync = OMAP_DMA_MCBSP2_RX,
|
||||
.dma_tx_sync = OMAP_DMA_MCBSP2_TX,
|
||||
.rx_irq = INT_1510_SPI_RX,
|
||||
|
@ -206,7 +177,6 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
|
|||
},
|
||||
{
|
||||
.phys_base = OMAP1510_MCBSP3_BASE,
|
||||
.virt_base = OMAP1510_MCBSP3_BASE,
|
||||
.dma_rx_sync = OMAP_DMA_MCBSP3_RX,
|
||||
.dma_tx_sync = OMAP_DMA_MCBSP3_TX,
|
||||
.rx_irq = INT_McBSP3RX,
|
||||
|
@ -225,7 +195,6 @@ static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = {
|
|||
static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
|
||||
{
|
||||
.phys_base = OMAP1610_MCBSP1_BASE,
|
||||
.virt_base = OMAP1610_MCBSP1_BASE,
|
||||
.dma_rx_sync = OMAP_DMA_MCBSP1_RX,
|
||||
.dma_tx_sync = OMAP_DMA_MCBSP1_TX,
|
||||
.rx_irq = INT_McBSP1RX,
|
||||
|
@ -235,7 +204,6 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
|
|||
},
|
||||
{
|
||||
.phys_base = OMAP1610_MCBSP2_BASE,
|
||||
.virt_base = io_p2v(OMAP1610_MCBSP2_BASE),
|
||||
.dma_rx_sync = OMAP_DMA_MCBSP2_RX,
|
||||
.dma_tx_sync = OMAP_DMA_MCBSP2_TX,
|
||||
.rx_irq = INT_1610_McBSP2_RX,
|
||||
|
@ -244,7 +212,6 @@ static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = {
|
|||
},
|
||||
{
|
||||
.phys_base = OMAP1610_MCBSP3_BASE,
|
||||
.virt_base = OMAP1610_MCBSP3_BASE,
|
||||
.dma_rx_sync = OMAP_DMA_MCBSP3_RX,
|
||||
.dma_tx_sync = OMAP_DMA_MCBSP3_TX,
|
||||
.rx_irq = INT_McBSP3RX,
|
||||
|
@ -270,6 +237,18 @@ int __init omap1_mcbsp_init(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (cpu_is_omap730())
|
||||
omap_mcbsp_count = OMAP730_MCBSP_PDATA_SZ;
|
||||
if (cpu_is_omap15xx())
|
||||
omap_mcbsp_count = OMAP15XX_MCBSP_PDATA_SZ;
|
||||
if (cpu_is_omap16xx())
|
||||
omap_mcbsp_count = OMAP16XX_MCBSP_PDATA_SZ;
|
||||
|
||||
mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
|
||||
GFP_KERNEL);
|
||||
if (!mcbsp_ptr)
|
||||
return -ENOMEM;
|
||||
|
||||
if (cpu_is_omap730())
|
||||
omap_mcbsp_register_board_cfg(omap730_mcbsp_pdata,
|
||||
OMAP730_MCBSP_PDATA_SZ);
|
||||
|
|
|
@ -67,8 +67,8 @@ static void __init omap_serial_reset(struct plat_serial8250_port *p)
|
|||
|
||||
static struct plat_serial8250_port serial_platform_data[] = {
|
||||
{
|
||||
.membase = (char*)IO_ADDRESS(OMAP_UART1_BASE),
|
||||
.mapbase = (unsigned long)OMAP_UART1_BASE,
|
||||
.membase = IO_ADDRESS(OMAP_UART1_BASE),
|
||||
.mapbase = OMAP_UART1_BASE,
|
||||
.irq = INT_UART1,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.iotype = UPIO_MEM,
|
||||
|
@ -76,8 +76,8 @@ static struct plat_serial8250_port serial_platform_data[] = {
|
|||
.uartclk = OMAP16XX_BASE_BAUD * 16,
|
||||
},
|
||||
{
|
||||
.membase = (char*)IO_ADDRESS(OMAP_UART2_BASE),
|
||||
.mapbase = (unsigned long)OMAP_UART2_BASE,
|
||||
.membase = IO_ADDRESS(OMAP_UART2_BASE),
|
||||
.mapbase = OMAP_UART2_BASE,
|
||||
.irq = INT_UART2,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.iotype = UPIO_MEM,
|
||||
|
@ -85,8 +85,8 @@ static struct plat_serial8250_port serial_platform_data[] = {
|
|||
.uartclk = OMAP16XX_BASE_BAUD * 16,
|
||||
},
|
||||
{
|
||||
.membase = (char*)IO_ADDRESS(OMAP_UART3_BASE),
|
||||
.mapbase = (unsigned long)OMAP_UART3_BASE,
|
||||
.membase = IO_ADDRESS(OMAP_UART3_BASE),
|
||||
.mapbase = OMAP_UART3_BASE,
|
||||
.irq = INT_UART3,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.iotype = UPIO_MEM,
|
||||
|
|
|
@ -15,8 +15,17 @@ config ARCH_OMAP2430
|
|||
bool "OMAP2430 support"
|
||||
depends on ARCH_OMAP24XX
|
||||
|
||||
config ARCH_OMAP34XX
|
||||
bool "OMAP34xx Based System"
|
||||
depends on ARCH_OMAP3
|
||||
|
||||
config ARCH_OMAP3430
|
||||
bool "OMAP3430 support"
|
||||
depends on ARCH_OMAP3 && ARCH_OMAP34XX
|
||||
select ARCH_OMAP_OTG
|
||||
|
||||
comment "OMAP Board Type"
|
||||
depends on ARCH_OMAP2
|
||||
depends on ARCH_OMAP2 || ARCH_OMAP3
|
||||
|
||||
config MACH_OMAP_GENERIC
|
||||
bool "Generic OMAP board"
|
||||
|
@ -35,3 +44,14 @@ config MACH_OMAP_2430SDP
|
|||
bool "OMAP 2430 SDP board"
|
||||
depends on ARCH_OMAP2 && ARCH_OMAP24XX
|
||||
|
||||
config MACH_OMAP3_BEAGLE
|
||||
bool "OMAP3 BEAGLE board"
|
||||
depends on ARCH_OMAP3 && ARCH_OMAP34XX
|
||||
|
||||
config MACH_OMAP_LDP
|
||||
bool "OMAP3 LDP board"
|
||||
depends on ARCH_OMAP3 && ARCH_OMAP34XX
|
||||
|
||||
config MACH_OVERO
|
||||
bool "Gumstix Overo board"
|
||||
depends on ARCH_OMAP3 && ARCH_OMAP34XX
|
||||
|
|
|
@ -4,16 +4,21 @@
|
|||
|
||||
# Common support
|
||||
obj-y := irq.o id.o io.o memory.o control.o prcm.o clock.o mux.o \
|
||||
devices.o serial.o gpmc.o timer-gp.o
|
||||
devices.o serial.o gpmc.o timer-gp.o powerdomain.o \
|
||||
clockdomain.o
|
||||
|
||||
obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
|
||||
|
||||
# Functions loaded to SRAM
|
||||
obj-$(CONFIG_ARCH_OMAP2420) += sram242x.o
|
||||
obj-$(CONFIG_ARCH_OMAP2430) += sram243x.o
|
||||
obj-$(CONFIG_ARCH_OMAP3) += sram34xx.o
|
||||
|
||||
# Power Management
|
||||
obj-$(CONFIG_PM) += pm.o sleep.o
|
||||
ifeq ($(CONFIG_PM),y)
|
||||
obj-y += pm.o
|
||||
obj-$(CONFIG_ARCH_OMAP24XX) += sleep24xx.o
|
||||
endif
|
||||
|
||||
# Clock framework
|
||||
obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o
|
||||
|
@ -24,4 +29,7 @@ obj-$(CONFIG_MACH_OMAP_GENERIC) += board-generic.o
|
|||
obj-$(CONFIG_MACH_OMAP_H4) += board-h4.o
|
||||
obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o
|
||||
obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o
|
||||
obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o
|
||||
obj-$(CONFIG_MACH_OMAP_LDP) += board-ldp.o
|
||||
obj-$(CONFIG_MACH_OVERO) += board-overo.o
|
||||
|
||||
|
|
86
arch/arm/mach-omap2/board-ldp.c
Normal file
86
arch/arm/mach-omap2/board-ldp.c
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* linux/arch/arm/mach-omap2/board-ldp.c
|
||||
*
|
||||
* Copyright (C) 2008 Texas Instruments Inc.
|
||||
* Nishant Kamat <nskamat@ti.com>
|
||||
*
|
||||
* Modified from mach-omap2/board-3430sdp.c
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/ads7846.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
|
||||
#include <mach/board-ldp.h>
|
||||
#include <mach/mcspi.h>
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/board.h>
|
||||
#include <mach/common.h>
|
||||
#include <mach/gpmc.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/delay.h>
|
||||
#include <mach/control.h>
|
||||
|
||||
static void __init omap_ldp_init_irq(void)
|
||||
{
|
||||
omap2_init_common_hw();
|
||||
omap_init_irq();
|
||||
omap_gpio_init();
|
||||
}
|
||||
|
||||
static struct omap_uart_config ldp_uart_config __initdata = {
|
||||
.enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
|
||||
};
|
||||
|
||||
static struct omap_board_config_kernel ldp_config[] __initdata = {
|
||||
{ OMAP_TAG_UART, &ldp_uart_config },
|
||||
};
|
||||
|
||||
static int __init omap_i2c_init(void)
|
||||
{
|
||||
omap_register_i2c_bus(1, 2600, NULL, 0);
|
||||
omap_register_i2c_bus(2, 400, NULL, 0);
|
||||
omap_register_i2c_bus(3, 400, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __init omap_ldp_init(void)
|
||||
{
|
||||
omap_i2c_init();
|
||||
omap_board_config = ldp_config;
|
||||
omap_board_config_size = ARRAY_SIZE(ldp_config);
|
||||
omap_serial_init();
|
||||
}
|
||||
|
||||
static void __init omap_ldp_map_io(void)
|
||||
{
|
||||
omap2_set_globals_343x();
|
||||
omap2_map_common_io();
|
||||
}
|
||||
|
||||
MACHINE_START(OMAP_LDP, "OMAP LDP board")
|
||||
.phys_io = 0x48000000,
|
||||
.io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
|
||||
.boot_params = 0x80000100,
|
||||
.map_io = omap_ldp_map_io,
|
||||
.init_irq = omap_ldp_init_irq,
|
||||
.init_machine = omap_ldp_init,
|
||||
.timer = &omap_timer,
|
||||
MACHINE_END
|
244
arch/arm/mach-omap2/board-omap3beagle.c
Normal file
244
arch/arm/mach-omap2/board-omap3beagle.c
Normal file
|
@ -0,0 +1,244 @@
|
|||
/*
|
||||
* linux/arch/arm/mach-omap2/board-omap3beagle.c
|
||||
*
|
||||
* Copyright (C) 2008 Texas Instruments
|
||||
*
|
||||
* Modified from mach-omap2/board-3430sdp.c
|
||||
*
|
||||
* Initial code: Syed Mohammed Khasim
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/gpio_keys.h>
|
||||
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/mtd/nand.h>
|
||||
|
||||
#include <mach/hardware.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <asm/mach/flash.h>
|
||||
|
||||
#include <mach/board.h>
|
||||
#include <mach/common.h>
|
||||
#include <mach/gpmc.h>
|
||||
#include <mach/nand.h>
|
||||
|
||||
|
||||
#define GPMC_CS0_BASE 0x60
|
||||
#define GPMC_CS_SIZE 0x30
|
||||
|
||||
#define NAND_BLOCK_SIZE SZ_128K
|
||||
|
||||
static struct mtd_partition omap3beagle_nand_partitions[] = {
|
||||
/* All the partition sizes are listed in terms of NAND block size */
|
||||
{
|
||||
.name = "X-Loader",
|
||||
.offset = 0,
|
||||
.size = 4 * NAND_BLOCK_SIZE,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
},
|
||||
{
|
||||
.name = "U-Boot",
|
||||
.offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
|
||||
.size = 15 * NAND_BLOCK_SIZE,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
},
|
||||
{
|
||||
.name = "U-Boot Env",
|
||||
.offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */
|
||||
.size = 1 * NAND_BLOCK_SIZE,
|
||||
},
|
||||
{
|
||||
.name = "Kernel",
|
||||
.offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
|
||||
.size = 32 * NAND_BLOCK_SIZE,
|
||||
},
|
||||
{
|
||||
.name = "File System",
|
||||
.offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct omap_nand_platform_data omap3beagle_nand_data = {
|
||||
.options = NAND_BUSWIDTH_16,
|
||||
.parts = omap3beagle_nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(omap3beagle_nand_partitions),
|
||||
.dma_channel = -1, /* disable DMA in OMAP NAND driver */
|
||||
.nand_setup = NULL,
|
||||
.dev_ready = NULL,
|
||||
};
|
||||
|
||||
static struct resource omap3beagle_nand_resource = {
|
||||
.flags = IORESOURCE_MEM,
|
||||
};
|
||||
|
||||
static struct platform_device omap3beagle_nand_device = {
|
||||
.name = "omap2-nand",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &omap3beagle_nand_data,
|
||||
},
|
||||
.num_resources = 1,
|
||||
.resource = &omap3beagle_nand_resource,
|
||||
};
|
||||
|
||||
static struct omap_uart_config omap3_beagle_uart_config __initdata = {
|
||||
.enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
|
||||
};
|
||||
|
||||
static void __init omap3_beagle_init_irq(void)
|
||||
{
|
||||
omap2_init_common_hw();
|
||||
omap_init_irq();
|
||||
omap_gpio_init();
|
||||
}
|
||||
|
||||
static struct platform_device omap3_beagle_lcd_device = {
|
||||
.name = "omap3beagle_lcd",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
static struct omap_lcd_config omap3_beagle_lcd_config __initdata = {
|
||||
.ctrl_name = "internal",
|
||||
};
|
||||
|
||||
static struct gpio_led gpio_leds[] = {
|
||||
{
|
||||
.name = "beagleboard::usr0",
|
||||
.default_trigger = "heartbeat",
|
||||
.gpio = 150,
|
||||
},
|
||||
{
|
||||
.name = "beagleboard::usr1",
|
||||
.default_trigger = "mmc0",
|
||||
.gpio = 149,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_led_platform_data gpio_led_info = {
|
||||
.leds = gpio_leds,
|
||||
.num_leds = ARRAY_SIZE(gpio_leds),
|
||||
};
|
||||
|
||||
static struct platform_device leds_gpio = {
|
||||
.name = "leds-gpio",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &gpio_led_info,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_keys_button gpio_buttons[] = {
|
||||
{
|
||||
.code = BTN_EXTRA,
|
||||
.gpio = 7,
|
||||
.desc = "user",
|
||||
.wakeup = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_keys_platform_data gpio_key_info = {
|
||||
.buttons = gpio_buttons,
|
||||
.nbuttons = ARRAY_SIZE(gpio_buttons),
|
||||
};
|
||||
|
||||
static struct platform_device keys_gpio = {
|
||||
.name = "gpio-keys",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &gpio_key_info,
|
||||
},
|
||||
};
|
||||
|
||||
static struct omap_board_config_kernel omap3_beagle_config[] __initdata = {
|
||||
{ OMAP_TAG_UART, &omap3_beagle_uart_config },
|
||||
{ OMAP_TAG_LCD, &omap3_beagle_lcd_config },
|
||||
};
|
||||
|
||||
static struct platform_device *omap3_beagle_devices[] __initdata = {
|
||||
&omap3_beagle_lcd_device,
|
||||
&leds_gpio,
|
||||
&keys_gpio,
|
||||
};
|
||||
|
||||
static void __init omap3beagle_flash_init(void)
|
||||
{
|
||||
u8 cs = 0;
|
||||
u8 nandcs = GPMC_CS_NUM + 1;
|
||||
|
||||
u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
|
||||
|
||||
/* find out the chip-select on which NAND exists */
|
||||
while (cs < GPMC_CS_NUM) {
|
||||
u32 ret = 0;
|
||||
ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
|
||||
|
||||
if ((ret & 0xC00) == 0x800) {
|
||||
printk(KERN_INFO "Found NAND on CS%d\n", cs);
|
||||
if (nandcs > GPMC_CS_NUM)
|
||||
nandcs = cs;
|
||||
}
|
||||
cs++;
|
||||
}
|
||||
|
||||
if (nandcs > GPMC_CS_NUM) {
|
||||
printk(KERN_INFO "NAND: Unable to find configuration "
|
||||
"in GPMC\n ");
|
||||
return;
|
||||
}
|
||||
|
||||
if (nandcs < GPMC_CS_NUM) {
|
||||
omap3beagle_nand_data.cs = nandcs;
|
||||
omap3beagle_nand_data.gpmc_cs_baseaddr = (void *)
|
||||
(gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
|
||||
omap3beagle_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add);
|
||||
|
||||
printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
|
||||
if (platform_device_register(&omap3beagle_nand_device) < 0)
|
||||
printk(KERN_ERR "Unable to register NAND device\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void __init omap3_beagle_init(void)
|
||||
{
|
||||
platform_add_devices(omap3_beagle_devices,
|
||||
ARRAY_SIZE(omap3_beagle_devices));
|
||||
omap_board_config = omap3_beagle_config;
|
||||
omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
|
||||
omap_serial_init();
|
||||
omap3beagle_flash_init();
|
||||
}
|
||||
|
||||
static void __init omap3_beagle_map_io(void)
|
||||
{
|
||||
omap2_set_globals_343x();
|
||||
omap2_map_common_io();
|
||||
}
|
||||
|
||||
MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
|
||||
/* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
|
||||
.phys_io = 0x48000000,
|
||||
.io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
|
||||
.boot_params = 0x80000100,
|
||||
.map_io = omap3_beagle_map_io,
|
||||
.init_irq = omap3_beagle_init_irq,
|
||||
.init_machine = omap3_beagle_init,
|
||||
.timer = &omap_timer,
|
||||
MACHINE_END
|
242
arch/arm/mach-omap2/board-overo.c
Normal file
242
arch/arm/mach-omap2/board-overo.c
Normal file
|
@ -0,0 +1,242 @@
|
|||
/*
|
||||
* board-overo.c (Gumstix Overo)
|
||||
*
|
||||
* Initial code: Steve Sakoman <steve@sakoman.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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/nand.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/flash.h>
|
||||
#include <asm/mach/map.h>
|
||||
|
||||
#include <mach/board-overo.h>
|
||||
#include <mach/board.h>
|
||||
#include <mach/common.h>
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/gpmc.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/nand.h>
|
||||
|
||||
#define NAND_BLOCK_SIZE SZ_128K
|
||||
#define GPMC_CS0_BASE 0x60
|
||||
#define GPMC_CS_SIZE 0x30
|
||||
|
||||
static struct mtd_partition overo_nand_partitions[] = {
|
||||
{
|
||||
.name = "xloader",
|
||||
.offset = 0, /* Offset = 0x00000 */
|
||||
.size = 4 * NAND_BLOCK_SIZE,
|
||||
.mask_flags = MTD_WRITEABLE
|
||||
},
|
||||
{
|
||||
.name = "uboot",
|
||||
.offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
|
||||
.size = 14 * NAND_BLOCK_SIZE,
|
||||
},
|
||||
{
|
||||
.name = "uboot environment",
|
||||
.offset = MTDPART_OFS_APPEND, /* Offset = 0x240000 */
|
||||
.size = 2 * NAND_BLOCK_SIZE,
|
||||
},
|
||||
{
|
||||
.name = "linux",
|
||||
.offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
|
||||
.size = 32 * NAND_BLOCK_SIZE,
|
||||
},
|
||||
{
|
||||
.name = "rootfs",
|
||||
.offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct omap_nand_platform_data overo_nand_data = {
|
||||
.parts = overo_nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(overo_nand_partitions),
|
||||
.dma_channel = -1, /* disable DMA in OMAP NAND driver */
|
||||
};
|
||||
|
||||
static struct resource overo_nand_resource = {
|
||||
.flags = IORESOURCE_MEM,
|
||||
};
|
||||
|
||||
static struct platform_device overo_nand_device = {
|
||||
.name = "omap2-nand",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &overo_nand_data,
|
||||
},
|
||||
.num_resources = 1,
|
||||
.resource = &overo_nand_resource,
|
||||
};
|
||||
|
||||
|
||||
static void __init overo_flash_init(void)
|
||||
{
|
||||
u8 cs = 0;
|
||||
u8 nandcs = GPMC_CS_NUM + 1;
|
||||
|
||||
u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
|
||||
|
||||
/* find out the chip-select on which NAND exists */
|
||||
while (cs < GPMC_CS_NUM) {
|
||||
u32 ret = 0;
|
||||
ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
|
||||
|
||||
if ((ret & 0xC00) == 0x800) {
|
||||
printk(KERN_INFO "Found NAND on CS%d\n", cs);
|
||||
if (nandcs > GPMC_CS_NUM)
|
||||
nandcs = cs;
|
||||
}
|
||||
cs++;
|
||||
}
|
||||
|
||||
if (nandcs > GPMC_CS_NUM) {
|
||||
printk(KERN_INFO "NAND: Unable to find configuration "
|
||||
"in GPMC\n ");
|
||||
return;
|
||||
}
|
||||
|
||||
if (nandcs < GPMC_CS_NUM) {
|
||||
overo_nand_data.cs = nandcs;
|
||||
overo_nand_data.gpmc_cs_baseaddr = (void *)
|
||||
(gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
|
||||
overo_nand_data.gpmc_baseaddr = (void *) (gpmc_base_add);
|
||||
|
||||
printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
|
||||
if (platform_device_register(&overo_nand_device) < 0)
|
||||
printk(KERN_ERR "Unable to register NAND device\n");
|
||||
}
|
||||
}
|
||||
static struct omap_uart_config overo_uart_config __initdata = {
|
||||
.enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
|
||||
};
|
||||
|
||||
static int __init overo_i2c_init(void)
|
||||
{
|
||||
/* i2c2 pins are used for gpio */
|
||||
omap_register_i2c_bus(3, 400, NULL, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __init overo_init_irq(void)
|
||||
{
|
||||
omap2_init_common_hw();
|
||||
omap_init_irq();
|
||||
omap_gpio_init();
|
||||
}
|
||||
|
||||
static struct platform_device overo_lcd_device = {
|
||||
.name = "overo_lcd",
|
||||
.id = -1,
|
||||
};
|
||||
|
||||
static struct omap_lcd_config overo_lcd_config __initdata = {
|
||||
.ctrl_name = "internal",
|
||||
};
|
||||
|
||||
static struct omap_board_config_kernel overo_config[] __initdata = {
|
||||
{ OMAP_TAG_UART, &overo_uart_config },
|
||||
{ OMAP_TAG_LCD, &overo_lcd_config },
|
||||
};
|
||||
|
||||
static struct platform_device *overo_devices[] __initdata = {
|
||||
&overo_lcd_device,
|
||||
};
|
||||
|
||||
static void __init overo_init(void)
|
||||
{
|
||||
overo_i2c_init();
|
||||
platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
|
||||
omap_board_config = overo_config;
|
||||
omap_board_config_size = ARRAY_SIZE(overo_config);
|
||||
omap_serial_init();
|
||||
overo_flash_init();
|
||||
|
||||
if ((gpio_request(OVERO_GPIO_W2W_NRESET,
|
||||
"OVERO_GPIO_W2W_NRESET") == 0) &&
|
||||
(gpio_direction_output(OVERO_GPIO_W2W_NRESET, 1) == 0)) {
|
||||
gpio_export(OVERO_GPIO_W2W_NRESET, 0);
|
||||
gpio_set_value(OVERO_GPIO_W2W_NRESET, 0);
|
||||
udelay(10);
|
||||
gpio_set_value(OVERO_GPIO_W2W_NRESET, 1);
|
||||
} else {
|
||||
printk(KERN_ERR "could not obtain gpio for "
|
||||
"OVERO_GPIO_W2W_NRESET\n");
|
||||
}
|
||||
|
||||
if ((gpio_request(OVERO_GPIO_BT_XGATE, "OVERO_GPIO_BT_XGATE") == 0) &&
|
||||
(gpio_direction_output(OVERO_GPIO_BT_XGATE, 0) == 0))
|
||||
gpio_export(OVERO_GPIO_BT_XGATE, 0);
|
||||
else
|
||||
printk(KERN_ERR "could not obtain gpio for OVERO_GPIO_BT_XGATE\n");
|
||||
|
||||
if ((gpio_request(OVERO_GPIO_BT_NRESET, "OVERO_GPIO_BT_NRESET") == 0) &&
|
||||
(gpio_direction_output(OVERO_GPIO_BT_NRESET, 1) == 0)) {
|
||||
gpio_export(OVERO_GPIO_BT_NRESET, 0);
|
||||
gpio_set_value(OVERO_GPIO_BT_NRESET, 0);
|
||||
mdelay(6);
|
||||
gpio_set_value(OVERO_GPIO_BT_NRESET, 1);
|
||||
} else {
|
||||
printk(KERN_ERR "could not obtain gpio for "
|
||||
"OVERO_GPIO_BT_NRESET\n");
|
||||
}
|
||||
|
||||
if ((gpio_request(OVERO_GPIO_USBH_CPEN, "OVERO_GPIO_USBH_CPEN") == 0) &&
|
||||
(gpio_direction_output(OVERO_GPIO_USBH_CPEN, 1) == 0))
|
||||
gpio_export(OVERO_GPIO_USBH_CPEN, 0);
|
||||
else
|
||||
printk(KERN_ERR "could not obtain gpio for "
|
||||
"OVERO_GPIO_USBH_CPEN\n");
|
||||
|
||||
if ((gpio_request(OVERO_GPIO_USBH_NRESET,
|
||||
"OVERO_GPIO_USBH_NRESET") == 0) &&
|
||||
(gpio_direction_output(OVERO_GPIO_USBH_NRESET, 1) == 0))
|
||||
gpio_export(OVERO_GPIO_USBH_NRESET, 0);
|
||||
else
|
||||
printk(KERN_ERR "could not obtain gpio for "
|
||||
"OVERO_GPIO_USBH_NRESET\n");
|
||||
}
|
||||
|
||||
static void __init overo_map_io(void)
|
||||
{
|
||||
omap2_set_globals_343x();
|
||||
omap2_map_common_io();
|
||||
}
|
||||
|
||||
MACHINE_START(OVERO, "Gumstix Overo")
|
||||
.phys_io = 0x48000000,
|
||||
.io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
|
||||
.boot_params = 0x80000100,
|
||||
.map_io = overo_map_io,
|
||||
.init_irq = overo_init_irq,
|
||||
.init_machine = overo_init,
|
||||
.timer = &omap_timer,
|
||||
MACHINE_END
|
|
@ -25,6 +25,7 @@
|
|||
#include <linux/bitops.h>
|
||||
|
||||
#include <mach/clock.h>
|
||||
#include <mach/clockdomain.h>
|
||||
#include <mach/sram.h>
|
||||
#include <mach/cpu.h>
|
||||
#include <asm/div64.h>
|
||||
|
@ -61,9 +62,35 @@
|
|||
u8 cpu_mask;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Omap2 specific clock functions
|
||||
* OMAP2/3 specific clock functions
|
||||
*-------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk
|
||||
* @clk: OMAP clock struct ptr to use
|
||||
*
|
||||
* Convert a clockdomain name stored in a struct clk 'clk' into a
|
||||
* clockdomain pointer, and save it into the struct clk. Intended to be
|
||||
* called during clk_register(). No return value.
|
||||
*/
|
||||
void omap2_init_clk_clkdm(struct clk *clk)
|
||||
{
|
||||
struct clockdomain *clkdm;
|
||||
|
||||
if (!clk->clkdm_name)
|
||||
return;
|
||||
|
||||
clkdm = clkdm_lookup(clk->clkdm_name);
|
||||
if (clkdm) {
|
||||
pr_debug("clock: associated clk %s to clkdm %s\n",
|
||||
clk->name, clk->clkdm_name);
|
||||
clk->clkdm = clkdm;
|
||||
} else {
|
||||
pr_debug("clock: could not associate clk %s to "
|
||||
"clkdm %s\n", clk->name, clk->clkdm_name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* omap2_init_clksel_parent - set a clksel clk's parent field from the hardware
|
||||
* @clk: OMAP clock struct ptr to use
|
||||
|
@ -250,7 +277,7 @@ int _omap2_clk_enable(struct clk *clk)
|
|||
if (clk->enable)
|
||||
return clk->enable(clk);
|
||||
|
||||
if (unlikely(clk->enable_reg == 0)) {
|
||||
if (unlikely(clk->enable_reg == NULL)) {
|
||||
printk(KERN_ERR "clock.c: Enable for %s without enable code\n",
|
||||
clk->name);
|
||||
return 0; /* REVISIT: -EINVAL */
|
||||
|
@ -282,7 +309,7 @@ void _omap2_clk_disable(struct clk *clk)
|
|||
return;
|
||||
}
|
||||
|
||||
if (clk->enable_reg == 0) {
|
||||
if (clk->enable_reg == NULL) {
|
||||
/*
|
||||
* 'Independent' here refers to a clock which is not
|
||||
* controlled by its parent.
|
||||
|
@ -307,6 +334,9 @@ void omap2_clk_disable(struct clk *clk)
|
|||
_omap2_clk_disable(clk);
|
||||
if (likely((u32)clk->parent))
|
||||
omap2_clk_disable(clk->parent);
|
||||
if (clk->clkdm)
|
||||
omap2_clkdm_clk_disable(clk->clkdm, clk);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -323,11 +353,19 @@ int omap2_clk_enable(struct clk *clk)
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (clk->clkdm)
|
||||
omap2_clkdm_clk_enable(clk->clkdm, clk);
|
||||
|
||||
ret = _omap2_clk_enable(clk);
|
||||
|
||||
if (unlikely(ret != 0) && clk->parent) {
|
||||
omap2_clk_disable(clk->parent);
|
||||
clk->usecount--;
|
||||
if (unlikely(ret != 0)) {
|
||||
if (clk->clkdm)
|
||||
omap2_clkdm_clk_disable(clk->clkdm, clk);
|
||||
|
||||
if (clk->parent) {
|
||||
omap2_clk_disable(clk->parent);
|
||||
clk->usecount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -476,7 +514,7 @@ long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate)
|
|||
/* Given a clock and a rate apply a clock specific rounding function */
|
||||
long omap2_clk_round_rate(struct clk *clk, unsigned long rate)
|
||||
{
|
||||
if (clk->round_rate != 0)
|
||||
if (clk->round_rate != NULL)
|
||||
return clk->round_rate(clk, rate);
|
||||
|
||||
if (clk->flags & RATE_FIXED)
|
||||
|
@ -565,7 +603,7 @@ u32 omap2_divisor_to_clksel(struct clk *clk, u32 div)
|
|||
*/
|
||||
void __iomem *omap2_get_clksel(struct clk *clk, u32 *field_mask)
|
||||
{
|
||||
if (unlikely((clk->clksel_reg == 0) || (clk->clksel_mask == 0)))
|
||||
if (unlikely((clk->clksel_reg == NULL) || (clk->clksel_mask == NULL)))
|
||||
return NULL;
|
||||
|
||||
*field_mask = clk->clksel_mask;
|
||||
|
@ -585,7 +623,7 @@ u32 omap2_clksel_get_divisor(struct clk *clk)
|
|||
void __iomem *div_addr;
|
||||
|
||||
div_addr = omap2_get_clksel(clk, &field_mask);
|
||||
if (div_addr == 0)
|
||||
if (div_addr == NULL)
|
||||
return 0;
|
||||
|
||||
field_val = __raw_readl(div_addr) & field_mask;
|
||||
|
@ -604,7 +642,7 @@ int omap2_clksel_set_rate(struct clk *clk, unsigned long rate)
|
|||
return -EINVAL;
|
||||
|
||||
div_addr = omap2_get_clksel(clk, &field_mask);
|
||||
if (div_addr == 0)
|
||||
if (div_addr == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
field_val = omap2_divisor_to_clksel(clk, new_div);
|
||||
|
@ -642,7 +680,7 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
|
|||
return -EINVAL;
|
||||
|
||||
/* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
|
||||
if (clk->set_rate != 0)
|
||||
if (clk->set_rate != NULL)
|
||||
ret = clk->set_rate(clk, rate);
|
||||
|
||||
if (unlikely(ret == 0 && (clk->flags & RATE_PROPAGATES)))
|
||||
|
@ -663,7 +701,7 @@ static u32 omap2_clksel_get_src_field(void __iomem **src_addr,
|
|||
const struct clksel_rate *clkr;
|
||||
|
||||
*parent_div = 0;
|
||||
*src_addr = 0;
|
||||
*src_addr = NULL;
|
||||
|
||||
clks = omap2_get_clksel_by_parent(clk, src_clk);
|
||||
if (clks == NULL)
|
||||
|
@ -704,7 +742,7 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent)
|
|||
|
||||
field_val = omap2_clksel_get_src_field(&src_addr, new_parent,
|
||||
&field_mask, clk, &parent_div);
|
||||
if (src_addr == 0)
|
||||
if (src_addr == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
if (clk->usecount > 0)
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
/* The maximum error between a target DPLL rate and the rounded rate in Hz */
|
||||
#define DEFAULT_DPLL_RATE_TOLERANCE 50000
|
||||
|
||||
int omap2_clk_init(void);
|
||||
int omap2_clk_enable(struct clk *clk);
|
||||
void omap2_clk_disable(struct clk *clk);
|
||||
long omap2_clk_round_rate(struct clk *clk, unsigned long rate);
|
||||
|
@ -36,6 +37,7 @@ void omap2_clk_disable_unused(struct clk *clk);
|
|||
#endif
|
||||
|
||||
void omap2_clksel_recalc(struct clk *clk);
|
||||
void omap2_init_clk_clkdm(struct clk *clk);
|
||||
void omap2_init_clksel_parent(struct clk *clk);
|
||||
u32 omap2_clksel_get_divisor(struct clk *clk);
|
||||
u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -62,11 +62,14 @@ static void omap3_dpll_recalc(struct clk *clk)
|
|||
static void _omap3_dpll_write_clken(struct clk *clk, u8 clken_bits)
|
||||
{
|
||||
const struct dpll_data *dd;
|
||||
u32 v;
|
||||
|
||||
dd = clk->dpll_data;
|
||||
|
||||
cm_rmw_reg_bits(dd->enable_mask, clken_bits << __ffs(dd->enable_mask),
|
||||
dd->control_reg);
|
||||
v = __raw_readl(dd->control_reg);
|
||||
v &= ~dd->enable_mask;
|
||||
v |= clken_bits << __ffs(dd->enable_mask);
|
||||
__raw_writel(v, dd->control_reg);
|
||||
}
|
||||
|
||||
/* _omap3_wait_dpll_status: wait for a DPLL to enter a specific state */
|
||||
|
@ -82,7 +85,7 @@ static int _omap3_wait_dpll_status(struct clk *clk, u8 state)
|
|||
state <<= dd->idlest_bit;
|
||||
idlest_mask = 1 << dd->idlest_bit;
|
||||
|
||||
while (((cm_read_reg(dd->idlest_reg) & idlest_mask) != state) &&
|
||||
while (((__raw_readl(dd->idlest_reg) & idlest_mask) != state) &&
|
||||
i < MAX_DPLL_WAIT_TRIES) {
|
||||
i++;
|
||||
udelay(1);
|
||||
|
@ -285,7 +288,7 @@ static u32 omap3_dpll_autoidle_read(struct clk *clk)
|
|||
|
||||
dd = clk->dpll_data;
|
||||
|
||||
v = cm_read_reg(dd->autoidle_reg);
|
||||
v = __raw_readl(dd->autoidle_reg);
|
||||
v &= dd->autoidle_mask;
|
||||
v >>= __ffs(dd->autoidle_mask);
|
||||
|
||||
|
@ -304,6 +307,7 @@ static u32 omap3_dpll_autoidle_read(struct clk *clk)
|
|||
static void omap3_dpll_allow_idle(struct clk *clk)
|
||||
{
|
||||
const struct dpll_data *dd;
|
||||
u32 v;
|
||||
|
||||
if (!clk || !clk->dpll_data)
|
||||
return;
|
||||
|
@ -315,9 +319,10 @@ static void omap3_dpll_allow_idle(struct clk *clk)
|
|||
* by writing 0x5 instead of 0x1. Add some mechanism to
|
||||
* optionally enter this mode.
|
||||
*/
|
||||
cm_rmw_reg_bits(dd->autoidle_mask,
|
||||
DPLL_AUTOIDLE_LOW_POWER_STOP << __ffs(dd->autoidle_mask),
|
||||
dd->autoidle_reg);
|
||||
v = __raw_readl(dd->autoidle_reg);
|
||||
v &= ~dd->autoidle_mask;
|
||||
v |= DPLL_AUTOIDLE_LOW_POWER_STOP << __ffs(dd->autoidle_mask);
|
||||
__raw_writel(v, dd->autoidle_reg);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -329,15 +334,17 @@ static void omap3_dpll_allow_idle(struct clk *clk)
|
|||
static void omap3_dpll_deny_idle(struct clk *clk)
|
||||
{
|
||||
const struct dpll_data *dd;
|
||||
u32 v;
|
||||
|
||||
if (!clk || !clk->dpll_data)
|
||||
return;
|
||||
|
||||
dd = clk->dpll_data;
|
||||
|
||||
cm_rmw_reg_bits(dd->autoidle_mask,
|
||||
DPLL_AUTOIDLE_DISABLE << __ffs(dd->autoidle_mask),
|
||||
dd->autoidle_reg);
|
||||
v = __raw_readl(dd->autoidle_reg);
|
||||
v &= ~dd->autoidle_mask;
|
||||
v |= DPLL_AUTOIDLE_DISABLE << __ffs(dd->autoidle_mask);
|
||||
__raw_writel(v, dd->autoidle_reg);
|
||||
}
|
||||
|
||||
/* Clock control for DPLL outputs */
|
||||
|
@ -482,8 +489,10 @@ int __init omap2_clk_init(void)
|
|||
for (clkp = onchip_34xx_clks;
|
||||
clkp < onchip_34xx_clks + ARRAY_SIZE(onchip_34xx_clks);
|
||||
clkp++) {
|
||||
if ((*clkp)->flags & cpu_clkflg)
|
||||
if ((*clkp)->flags & cpu_clkflg) {
|
||||
clk_register(*clkp);
|
||||
omap2_init_clk_clkdm(*clkp);
|
||||
}
|
||||
}
|
||||
|
||||
/* REVISIT: Not yet ready for OMAP3 */
|
||||
|
|
File diff suppressed because it is too large
Load diff
623
arch/arm/mach-omap2/clockdomain.c
Normal file
623
arch/arm/mach-omap2/clockdomain.c
Normal file
|
@ -0,0 +1,623 @@
|
|||
/*
|
||||
* OMAP2/3 clockdomain framework functions
|
||||
*
|
||||
* Copyright (C) 2008 Texas Instruments, Inc.
|
||||
* Copyright (C) 2008 Nokia Corporation
|
||||
*
|
||||
* Written by Paul Walmsley and Jouni Högander
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
#ifdef CONFIG_OMAP_DEBUG_CLOCKDOMAIN
|
||||
# define DEBUG
|
||||
#endif
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/limits.h>
|
||||
|
||||
#include <linux/io.h>
|
||||
|
||||
#include <linux/bitops.h>
|
||||
|
||||
#include <mach/clock.h>
|
||||
|
||||
#include "prm.h"
|
||||
#include "prm-regbits-24xx.h"
|
||||
#include "cm.h"
|
||||
|
||||
#include <mach/powerdomain.h>
|
||||
#include <mach/clockdomain.h>
|
||||
|
||||
/* clkdm_list contains all registered struct clockdomains */
|
||||
static LIST_HEAD(clkdm_list);
|
||||
|
||||
/* clkdm_mutex protects clkdm_list add and del ops */
|
||||
static DEFINE_MUTEX(clkdm_mutex);
|
||||
|
||||
/* array of powerdomain deps to be added/removed when clkdm in hwsup mode */
|
||||
static struct clkdm_pwrdm_autodep *autodeps;
|
||||
|
||||
|
||||
/* Private functions */
|
||||
|
||||
/*
|
||||
* _autodep_lookup - resolve autodep pwrdm names to pwrdm pointers; store
|
||||
* @autodep: struct clkdm_pwrdm_autodep * to resolve
|
||||
*
|
||||
* Resolve autodep powerdomain names to powerdomain pointers via
|
||||
* pwrdm_lookup() and store the pointers in the autodep structure. An
|
||||
* "autodep" is a powerdomain sleep/wakeup dependency that is
|
||||
* automatically added and removed whenever clocks in the associated
|
||||
* clockdomain are enabled or disabled (respectively) when the
|
||||
* clockdomain is in hardware-supervised mode. Meant to be called
|
||||
* once at clockdomain layer initialization, since these should remain
|
||||
* fixed for a particular architecture. No return value.
|
||||
*/
|
||||
static void _autodep_lookup(struct clkdm_pwrdm_autodep *autodep)
|
||||
{
|
||||
struct powerdomain *pwrdm;
|
||||
|
||||
if (!autodep)
|
||||
return;
|
||||
|
||||
if (!omap_chip_is(autodep->omap_chip))
|
||||
return;
|
||||
|
||||
pwrdm = pwrdm_lookup(autodep->pwrdm_name);
|
||||
if (!pwrdm) {
|
||||
pr_debug("clockdomain: _autodep_lookup: powerdomain %s "
|
||||
"does not exist\n", autodep->pwrdm_name);
|
||||
WARN_ON(1);
|
||||
return;
|
||||
}
|
||||
autodep->pwrdm = pwrdm;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* _clkdm_add_autodeps - add auto sleepdeps/wkdeps to clkdm upon clock enable
|
||||
* @clkdm: struct clockdomain *
|
||||
*
|
||||
* Add the "autodep" sleep & wakeup dependencies to clockdomain 'clkdm'
|
||||
* in hardware-supervised mode. Meant to be called from clock framework
|
||||
* when a clock inside clockdomain 'clkdm' is enabled. No return value.
|
||||
*/
|
||||
static void _clkdm_add_autodeps(struct clockdomain *clkdm)
|
||||
{
|
||||
struct clkdm_pwrdm_autodep *autodep;
|
||||
|
||||
for (autodep = autodeps; autodep->pwrdm_name; autodep++) {
|
||||
if (!autodep->pwrdm)
|
||||
continue;
|
||||
|
||||
pr_debug("clockdomain: adding %s sleepdep/wkdep for "
|
||||
"pwrdm %s\n", autodep->pwrdm_name,
|
||||
clkdm->pwrdm->name);
|
||||
|
||||
pwrdm_add_sleepdep(clkdm->pwrdm, autodep->pwrdm);
|
||||
pwrdm_add_wkdep(clkdm->pwrdm, autodep->pwrdm);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* _clkdm_add_autodeps - remove auto sleepdeps/wkdeps from clkdm
|
||||
* @clkdm: struct clockdomain *
|
||||
*
|
||||
* Remove the "autodep" sleep & wakeup dependencies from clockdomain 'clkdm'
|
||||
* in hardware-supervised mode. Meant to be called from clock framework
|
||||
* when a clock inside clockdomain 'clkdm' is disabled. No return value.
|
||||
*/
|
||||
static void _clkdm_del_autodeps(struct clockdomain *clkdm)
|
||||
{
|
||||
struct clkdm_pwrdm_autodep *autodep;
|
||||
|
||||
for (autodep = autodeps; autodep->pwrdm_name; autodep++) {
|
||||
if (!autodep->pwrdm)
|
||||
continue;
|
||||
|
||||
pr_debug("clockdomain: removing %s sleepdep/wkdep for "
|
||||
"pwrdm %s\n", autodep->pwrdm_name,
|
||||
clkdm->pwrdm->name);
|
||||
|
||||
pwrdm_del_sleepdep(clkdm->pwrdm, autodep->pwrdm);
|
||||
pwrdm_del_wkdep(clkdm->pwrdm, autodep->pwrdm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static struct clockdomain *_clkdm_lookup(const char *name)
|
||||
{
|
||||
struct clockdomain *clkdm, *temp_clkdm;
|
||||
|
||||
if (!name)
|
||||
return NULL;
|
||||
|
||||
clkdm = NULL;
|
||||
|
||||
list_for_each_entry(temp_clkdm, &clkdm_list, node) {
|
||||
if (!strcmp(name, temp_clkdm->name)) {
|
||||
clkdm = temp_clkdm;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return clkdm;
|
||||
}
|
||||
|
||||
|
||||
/* Public functions */
|
||||
|
||||
/**
|
||||
* clkdm_init - set up the clockdomain layer
|
||||
* @clkdms: optional pointer to an array of clockdomains to register
|
||||
* @init_autodeps: optional pointer to an array of autodeps to register
|
||||
*
|
||||
* Set up internal state. If a pointer to an array of clockdomains
|
||||
* was supplied, loop through the list of clockdomains, register all
|
||||
* that are available on the current platform. Similarly, if a
|
||||
* pointer to an array of clockdomain-powerdomain autodependencies was
|
||||
* provided, register those. No return value.
|
||||
*/
|
||||
void clkdm_init(struct clockdomain **clkdms,
|
||||
struct clkdm_pwrdm_autodep *init_autodeps)
|
||||
{
|
||||
struct clockdomain **c = NULL;
|
||||
struct clkdm_pwrdm_autodep *autodep = NULL;
|
||||
|
||||
if (clkdms)
|
||||
for (c = clkdms; *c; c++)
|
||||
clkdm_register(*c);
|
||||
|
||||
autodeps = init_autodeps;
|
||||
if (autodeps)
|
||||
for (autodep = autodeps; autodep->pwrdm_name; autodep++)
|
||||
_autodep_lookup(autodep);
|
||||
}
|
||||
|
||||
/**
|
||||
* clkdm_register - register a clockdomain
|
||||
* @clkdm: struct clockdomain * to register
|
||||
*
|
||||
* Adds a clockdomain to the internal clockdomain list.
|
||||
* Returns -EINVAL if given a null pointer, -EEXIST if a clockdomain is
|
||||
* already registered by the provided name, or 0 upon success.
|
||||
*/
|
||||
int clkdm_register(struct clockdomain *clkdm)
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
struct powerdomain *pwrdm;
|
||||
|
||||
if (!clkdm || !clkdm->name)
|
||||
return -EINVAL;
|
||||
|
||||
if (!omap_chip_is(clkdm->omap_chip))
|
||||
return -EINVAL;
|
||||
|
||||
pwrdm = pwrdm_lookup(clkdm->pwrdm_name);
|
||||
if (!pwrdm) {
|
||||
pr_debug("clockdomain: clkdm_register %s: powerdomain %s "
|
||||
"does not exist\n", clkdm->name, clkdm->pwrdm_name);
|
||||
return -EINVAL;
|
||||
}
|
||||
clkdm->pwrdm = pwrdm;
|
||||
|
||||
mutex_lock(&clkdm_mutex);
|
||||
/* Verify that the clockdomain is not already registered */
|
||||
if (_clkdm_lookup(clkdm->name)) {
|
||||
ret = -EEXIST;
|
||||
goto cr_unlock;
|
||||
};
|
||||
|
||||
list_add(&clkdm->node, &clkdm_list);
|
||||
|
||||
pwrdm_add_clkdm(pwrdm, clkdm);
|
||||
|
||||
pr_debug("clockdomain: registered %s\n", clkdm->name);
|
||||
ret = 0;
|
||||
|
||||
cr_unlock:
|
||||
mutex_unlock(&clkdm_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* clkdm_unregister - unregister a clockdomain
|
||||
* @clkdm: struct clockdomain * to unregister
|
||||
*
|
||||
* Removes a clockdomain from the internal clockdomain list. Returns
|
||||
* -EINVAL if clkdm argument is NULL.
|
||||
*/
|
||||
int clkdm_unregister(struct clockdomain *clkdm)
|
||||
{
|
||||
if (!clkdm)
|
||||
return -EINVAL;
|
||||
|
||||
pwrdm_del_clkdm(clkdm->pwrdm, clkdm);
|
||||
|
||||
mutex_lock(&clkdm_mutex);
|
||||
list_del(&clkdm->node);
|
||||
mutex_unlock(&clkdm_mutex);
|
||||
|
||||
pr_debug("clockdomain: unregistered %s\n", clkdm->name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* clkdm_lookup - look up a clockdomain by name, return a pointer
|
||||
* @name: name of clockdomain
|
||||
*
|
||||
* Find a registered clockdomain by its name. Returns a pointer to the
|
||||
* struct clockdomain if found, or NULL otherwise.
|
||||
*/
|
||||
struct clockdomain *clkdm_lookup(const char *name)
|
||||
{
|
||||
struct clockdomain *clkdm, *temp_clkdm;
|
||||
|
||||
if (!name)
|
||||
return NULL;
|
||||
|
||||
clkdm = NULL;
|
||||
|
||||
mutex_lock(&clkdm_mutex);
|
||||
list_for_each_entry(temp_clkdm, &clkdm_list, node) {
|
||||
if (!strcmp(name, temp_clkdm->name)) {
|
||||
clkdm = temp_clkdm;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&clkdm_mutex);
|
||||
|
||||
return clkdm;
|
||||
}
|
||||
|
||||
/**
|
||||
* clkdm_for_each - call function on each registered clockdomain
|
||||
* @fn: callback function *
|
||||
*
|
||||
* Call the supplied function for each registered clockdomain.
|
||||
* The callback function can return anything but 0 to bail
|
||||
* out early from the iterator. The callback function is called with
|
||||
* the clkdm_mutex held, so no clockdomain structure manipulation
|
||||
* functions should be called from the callback, although hardware
|
||||
* clockdomain control functions are fine. Returns the last return
|
||||
* value of the callback function, which should be 0 for success or
|
||||
* anything else to indicate failure; or -EINVAL if the function pointer
|
||||
* is null.
|
||||
*/
|
||||
int clkdm_for_each(int (*fn)(struct clockdomain *clkdm))
|
||||
{
|
||||
struct clockdomain *clkdm;
|
||||
int ret = 0;
|
||||
|
||||
if (!fn)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&clkdm_mutex);
|
||||
list_for_each_entry(clkdm, &clkdm_list, node) {
|
||||
ret = (*fn)(clkdm);
|
||||
if (ret)
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&clkdm_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* clkdm_get_pwrdm - return a ptr to the pwrdm that this clkdm resides in
|
||||
* @clkdm: struct clockdomain *
|
||||
*
|
||||
* Return a pointer to the struct powerdomain that the specified clockdomain
|
||||
* 'clkdm' exists in, or returns NULL if clkdm argument is NULL.
|
||||
*/
|
||||
struct powerdomain *clkdm_get_pwrdm(struct clockdomain *clkdm)
|
||||
{
|
||||
if (!clkdm)
|
||||
return NULL;
|
||||
|
||||
return clkdm->pwrdm;
|
||||
}
|
||||
|
||||
|
||||
/* Hardware clockdomain control */
|
||||
|
||||
/**
|
||||
* omap2_clkdm_clktrctrl_read - read the clkdm's current state transition mode
|
||||
* @clk: struct clk * of a clockdomain
|
||||
*
|
||||
* Return the clockdomain's current state transition mode from the
|
||||
* corresponding domain CM_CLKSTCTRL register. Returns -EINVAL if clk
|
||||
* is NULL or the current mode upon success.
|
||||
*/
|
||||
static int omap2_clkdm_clktrctrl_read(struct clockdomain *clkdm)
|
||||
{
|
||||
u32 v;
|
||||
|
||||
if (!clkdm)
|
||||
return -EINVAL;
|
||||
|
||||
v = cm_read_mod_reg(clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL);
|
||||
v &= clkdm->clktrctrl_mask;
|
||||
v >>= __ffs(clkdm->clktrctrl_mask);
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* omap2_clkdm_sleep - force clockdomain sleep transition
|
||||
* @clkdm: struct clockdomain *
|
||||
*
|
||||
* Instruct the CM to force a sleep transition on the specified
|
||||
* clockdomain 'clkdm'. Returns -EINVAL if clk is NULL or if
|
||||
* clockdomain does not support software-initiated sleep; 0 upon
|
||||
* success.
|
||||
*/
|
||||
int omap2_clkdm_sleep(struct clockdomain *clkdm)
|
||||
{
|
||||
if (!clkdm)
|
||||
return -EINVAL;
|
||||
|
||||
if (!(clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) {
|
||||
pr_debug("clockdomain: %s does not support forcing "
|
||||
"sleep via software\n", clkdm->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pr_debug("clockdomain: forcing sleep on %s\n", clkdm->name);
|
||||
|
||||
if (cpu_is_omap24xx()) {
|
||||
|
||||
cm_set_mod_reg_bits(OMAP24XX_FORCESTATE,
|
||||
clkdm->pwrdm->prcm_offs, PM_PWSTCTRL);
|
||||
|
||||
} else if (cpu_is_omap34xx()) {
|
||||
|
||||
u32 v = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP <<
|
||||
__ffs(clkdm->clktrctrl_mask));
|
||||
|
||||
cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v,
|
||||
clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL);
|
||||
|
||||
} else {
|
||||
BUG();
|
||||
};
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* omap2_clkdm_wakeup - force clockdomain wakeup transition
|
||||
* @clkdm: struct clockdomain *
|
||||
*
|
||||
* Instruct the CM to force a wakeup transition on the specified
|
||||
* clockdomain 'clkdm'. Returns -EINVAL if clkdm is NULL or if the
|
||||
* clockdomain does not support software-controlled wakeup; 0 upon
|
||||
* success.
|
||||
*/
|
||||
int omap2_clkdm_wakeup(struct clockdomain *clkdm)
|
||||
{
|
||||
if (!clkdm)
|
||||
return -EINVAL;
|
||||
|
||||
if (!(clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)) {
|
||||
pr_debug("clockdomain: %s does not support forcing "
|
||||
"wakeup via software\n", clkdm->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pr_debug("clockdomain: forcing wakeup on %s\n", clkdm->name);
|
||||
|
||||
if (cpu_is_omap24xx()) {
|
||||
|
||||
cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE,
|
||||
clkdm->pwrdm->prcm_offs, PM_PWSTCTRL);
|
||||
|
||||
} else if (cpu_is_omap34xx()) {
|
||||
|
||||
u32 v = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP <<
|
||||
__ffs(clkdm->clktrctrl_mask));
|
||||
|
||||
cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask, v,
|
||||
clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL);
|
||||
|
||||
} else {
|
||||
BUG();
|
||||
};
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* omap2_clkdm_allow_idle - enable hwsup idle transitions for clkdm
|
||||
* @clkdm: struct clockdomain *
|
||||
*
|
||||
* Allow the hardware to automatically switch the clockdomain into
|
||||
* active or idle states, as needed by downstream clocks. If the
|
||||
* clockdomain has any downstream clocks enabled in the clock
|
||||
* framework, wkdep/sleepdep autodependencies are added; this is so
|
||||
* device drivers can read and write to the device. No return value.
|
||||
*/
|
||||
void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
|
||||
{
|
||||
u32 v;
|
||||
|
||||
if (!clkdm)
|
||||
return;
|
||||
|
||||
if (!(clkdm->flags & CLKDM_CAN_ENABLE_AUTO)) {
|
||||
pr_debug("clock: automatic idle transitions cannot be enabled "
|
||||
"on clockdomain %s\n", clkdm->name);
|
||||
return;
|
||||
}
|
||||
|
||||
pr_debug("clockdomain: enabling automatic idle transitions for %s\n",
|
||||
clkdm->name);
|
||||
|
||||
if (atomic_read(&clkdm->usecount) > 0)
|
||||
_clkdm_add_autodeps(clkdm);
|
||||
|
||||
if (cpu_is_omap24xx())
|
||||
v = OMAP24XX_CLKSTCTRL_ENABLE_AUTO;
|
||||
else if (cpu_is_omap34xx())
|
||||
v = OMAP34XX_CLKSTCTRL_ENABLE_AUTO;
|
||||
else
|
||||
BUG();
|
||||
|
||||
|
||||
cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask,
|
||||
v << __ffs(clkdm->clktrctrl_mask),
|
||||
clkdm->pwrdm->prcm_offs,
|
||||
CM_CLKSTCTRL);
|
||||
}
|
||||
|
||||
/**
|
||||
* omap2_clkdm_deny_idle - disable hwsup idle transitions for clkdm
|
||||
* @clkdm: struct clockdomain *
|
||||
*
|
||||
* Prevent the hardware from automatically switching the clockdomain
|
||||
* into inactive or idle states. If the clockdomain has downstream
|
||||
* clocks enabled in the clock framework, wkdep/sleepdep
|
||||
* autodependencies are removed. No return value.
|
||||
*/
|
||||
void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
|
||||
{
|
||||
u32 v;
|
||||
|
||||
if (!clkdm)
|
||||
return;
|
||||
|
||||
if (!(clkdm->flags & CLKDM_CAN_DISABLE_AUTO)) {
|
||||
pr_debug("clockdomain: automatic idle transitions cannot be "
|
||||
"disabled on %s\n", clkdm->name);
|
||||
return;
|
||||
}
|
||||
|
||||
pr_debug("clockdomain: disabling automatic idle transitions for %s\n",
|
||||
clkdm->name);
|
||||
|
||||
if (cpu_is_omap24xx())
|
||||
v = OMAP24XX_CLKSTCTRL_DISABLE_AUTO;
|
||||
else if (cpu_is_omap34xx())
|
||||
v = OMAP34XX_CLKSTCTRL_DISABLE_AUTO;
|
||||
else
|
||||
BUG();
|
||||
|
||||
cm_rmw_mod_reg_bits(clkdm->clktrctrl_mask,
|
||||
v << __ffs(clkdm->clktrctrl_mask),
|
||||
clkdm->pwrdm->prcm_offs, CM_CLKSTCTRL);
|
||||
|
||||
if (atomic_read(&clkdm->usecount) > 0)
|
||||
_clkdm_del_autodeps(clkdm);
|
||||
}
|
||||
|
||||
|
||||
/* Clockdomain-to-clock framework interface code */
|
||||
|
||||
/**
|
||||
* omap2_clkdm_clk_enable - add an enabled downstream clock to this clkdm
|
||||
* @clkdm: struct clockdomain *
|
||||
* @clk: struct clk * of the enabled downstream clock
|
||||
*
|
||||
* Increment the usecount of this clockdomain 'clkdm' and ensure that
|
||||
* it is awake. Intended to be called by clk_enable() code. If the
|
||||
* clockdomain is in software-supervised idle mode, force the
|
||||
* clockdomain to wake. If the clockdomain is in hardware-supervised
|
||||
* idle mode, add clkdm-pwrdm autodependencies, to ensure that devices
|
||||
* in the clockdomain can be read from/written to by on-chip processors.
|
||||
* Returns -EINVAL if passed null pointers; returns 0 upon success or
|
||||
* if the clockdomain is in hwsup idle mode.
|
||||
*/
|
||||
int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk)
|
||||
{
|
||||
int v;
|
||||
|
||||
/*
|
||||
* XXX Rewrite this code to maintain a list of enabled
|
||||
* downstream clocks for debugging purposes?
|
||||
*/
|
||||
|
||||
if (!clkdm || !clk)
|
||||
return -EINVAL;
|
||||
|
||||
if (atomic_inc_return(&clkdm->usecount) > 1)
|
||||
return 0;
|
||||
|
||||
/* Clockdomain now has one enabled downstream clock */
|
||||
|
||||
pr_debug("clockdomain: clkdm %s: clk %s now enabled\n", clkdm->name,
|
||||
clk->name);
|
||||
|
||||
v = omap2_clkdm_clktrctrl_read(clkdm);
|
||||
|
||||
if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ||
|
||||
(cpu_is_omap24xx() && v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO))
|
||||
_clkdm_add_autodeps(clkdm);
|
||||
else
|
||||
omap2_clkdm_wakeup(clkdm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* omap2_clkdm_clk_disable - remove an enabled downstream clock from this clkdm
|
||||
* @clkdm: struct clockdomain *
|
||||
* @clk: struct clk * of the disabled downstream clock
|
||||
*
|
||||
* Decrement the usecount of this clockdomain 'clkdm'. Intended to be
|
||||
* called by clk_disable() code. If the usecount goes to 0, put the
|
||||
* clockdomain to sleep (software-supervised mode) or remove the
|
||||
* clkdm-pwrdm autodependencies (hardware-supervised mode). Returns
|
||||
* -EINVAL if passed null pointers; -ERANGE if the clkdm usecount
|
||||
* underflows and debugging is enabled; or returns 0 upon success or
|
||||
* if the clockdomain is in hwsup idle mode.
|
||||
*/
|
||||
int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk *clk)
|
||||
{
|
||||
int v;
|
||||
|
||||
/*
|
||||
* XXX Rewrite this code to maintain a list of enabled
|
||||
* downstream clocks for debugging purposes?
|
||||
*/
|
||||
|
||||
if (!clkdm || !clk)
|
||||
return -EINVAL;
|
||||
|
||||
#ifdef DEBUG
|
||||
if (atomic_read(&clkdm->usecount) == 0) {
|
||||
WARN_ON(1); /* underflow */
|
||||
return -ERANGE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (atomic_dec_return(&clkdm->usecount) > 0)
|
||||
return 0;
|
||||
|
||||
/* All downstream clocks of this clockdomain are now disabled */
|
||||
|
||||
pr_debug("clockdomain: clkdm %s: clk %s now disabled\n", clkdm->name,
|
||||
clk->name);
|
||||
|
||||
v = omap2_clkdm_clktrctrl_read(clkdm);
|
||||
|
||||
if ((cpu_is_omap34xx() && v == OMAP34XX_CLKSTCTRL_ENABLE_AUTO) ||
|
||||
(cpu_is_omap24xx() && v == OMAP24XX_CLKSTCTRL_ENABLE_AUTO))
|
||||
_clkdm_del_autodeps(clkdm);
|
||||
else
|
||||
omap2_clkdm_sleep(clkdm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
305
arch/arm/mach-omap2/clockdomains.h
Normal file
305
arch/arm/mach-omap2/clockdomains.h
Normal file
|
@ -0,0 +1,305 @@
|
|||
/*
|
||||
* OMAP2/3 clockdomains
|
||||
*
|
||||
* Copyright (C) 2008 Texas Instruments, Inc.
|
||||
* Copyright (C) 2008 Nokia Corporation
|
||||
*
|
||||
* Written by Paul Walmsley
|
||||
*/
|
||||
|
||||
#ifndef __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H
|
||||
#define __ARCH_ARM_MACH_OMAP2_CLOCKDOMAINS_H
|
||||
|
||||
#include <mach/clockdomain.h>
|
||||
|
||||
/*
|
||||
* OMAP2/3-common clockdomains
|
||||
*/
|
||||
|
||||
/* This is an implicit clockdomain - it is never defined as such in TRM */
|
||||
static struct clockdomain wkup_clkdm = {
|
||||
.name = "wkup_clkdm",
|
||||
.pwrdm_name = "wkup_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
/*
|
||||
* 2420-only clockdomains
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP2420)
|
||||
|
||||
static struct clockdomain mpu_2420_clkdm = {
|
||||
.name = "mpu_clkdm",
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP,
|
||||
.clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
|
||||
};
|
||||
|
||||
static struct clockdomain iva1_2420_clkdm = {
|
||||
.name = "iva1_clkdm",
|
||||
.pwrdm_name = "dsp_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
|
||||
};
|
||||
|
||||
#endif /* CONFIG_ARCH_OMAP2420 */
|
||||
|
||||
|
||||
/*
|
||||
* 2430-only clockdomains
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP2430)
|
||||
|
||||
static struct clockdomain mpu_2430_clkdm = {
|
||||
.name = "mpu_clkdm",
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
|
||||
};
|
||||
|
||||
static struct clockdomain mdm_clkdm = {
|
||||
.name = "mdm_clkdm",
|
||||
.pwrdm_name = "mdm_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
|
||||
};
|
||||
|
||||
#endif /* CONFIG_ARCH_OMAP2430 */
|
||||
|
||||
|
||||
/*
|
||||
* 24XX-only clockdomains
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP24XX)
|
||||
|
||||
static struct clockdomain dsp_clkdm = {
|
||||
.name = "dsp_clkdm",
|
||||
.pwrdm_name = "dsp_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
|
||||
};
|
||||
|
||||
static struct clockdomain gfx_24xx_clkdm = {
|
||||
.name = "gfx_clkdm",
|
||||
.pwrdm_name = "gfx_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
|
||||
};
|
||||
|
||||
static struct clockdomain core_l3_24xx_clkdm = {
|
||||
.name = "core_l3_clkdm",
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP,
|
||||
.clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
|
||||
};
|
||||
|
||||
static struct clockdomain core_l4_24xx_clkdm = {
|
||||
.name = "core_l4_clkdm",
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP,
|
||||
.clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
|
||||
};
|
||||
|
||||
static struct clockdomain dss_24xx_clkdm = {
|
||||
.name = "dss_clkdm",
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP,
|
||||
.clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
|
||||
};
|
||||
|
||||
#endif /* CONFIG_ARCH_OMAP24XX */
|
||||
|
||||
|
||||
/*
|
||||
* 34xx clockdomains
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP34XX)
|
||||
|
||||
static struct clockdomain mpu_34xx_clkdm = {
|
||||
.name = "mpu_clkdm",
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP,
|
||||
.clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
static struct clockdomain neon_clkdm = {
|
||||
.name = "neon_clkdm",
|
||||
.pwrdm_name = "neon_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
static struct clockdomain iva2_clkdm = {
|
||||
.name = "iva2_clkdm",
|
||||
.pwrdm_name = "iva2_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
static struct clockdomain gfx_3430es1_clkdm = {
|
||||
.name = "gfx_clkdm",
|
||||
.pwrdm_name = "gfx_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES1),
|
||||
};
|
||||
|
||||
static struct clockdomain sgx_clkdm = {
|
||||
.name = "sgx_clkdm",
|
||||
.pwrdm_name = "sgx_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2),
|
||||
};
|
||||
|
||||
/*
|
||||
* The die-to-die clockdomain was documented in the 34xx ES1 TRM, but
|
||||
* then that information was removed from the 34xx ES2+ TRM. It is
|
||||
* unclear whether the core is still there, but the clockdomain logic
|
||||
* is there, and must be programmed to an appropriate state if the
|
||||
* CORE clockdomain is to become inactive.
|
||||
*/
|
||||
static struct clockdomain d2d_clkdm = {
|
||||
.name = "d2d_clkdm",
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP,
|
||||
.clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
static struct clockdomain core_l3_34xx_clkdm = {
|
||||
.name = "core_l3_clkdm",
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP,
|
||||
.clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
static struct clockdomain core_l4_34xx_clkdm = {
|
||||
.name = "core_l4_clkdm",
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP,
|
||||
.clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
static struct clockdomain dss_34xx_clkdm = {
|
||||
.name = "dss_clkdm",
|
||||
.pwrdm_name = "dss_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
static struct clockdomain cam_clkdm = {
|
||||
.name = "cam_clkdm",
|
||||
.pwrdm_name = "cam_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
static struct clockdomain usbhost_clkdm = {
|
||||
.name = "usbhost_clkdm",
|
||||
.pwrdm_name = "usbhost_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2),
|
||||
};
|
||||
|
||||
static struct clockdomain per_clkdm = {
|
||||
.name = "per_clkdm",
|
||||
.pwrdm_name = "per_pwrdm",
|
||||
.flags = CLKDM_CAN_HWSUP_SWSUP,
|
||||
.clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
static struct clockdomain emu_clkdm = {
|
||||
.name = "emu_clkdm",
|
||||
.pwrdm_name = "emu_pwrdm",
|
||||
.flags = CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_SWSUP,
|
||||
.clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
#endif /* CONFIG_ARCH_OMAP34XX */
|
||||
|
||||
/*
|
||||
* Clockdomain-powerdomain hwsup dependencies (34XX only)
|
||||
*/
|
||||
|
||||
static struct clkdm_pwrdm_autodep clkdm_pwrdm_autodeps[] = {
|
||||
{
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "iva2_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
static struct clockdomain *clockdomains_omap[] = {
|
||||
|
||||
&wkup_clkdm,
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP2420
|
||||
&mpu_2420_clkdm,
|
||||
&iva1_2420_clkdm,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP2430
|
||||
&mpu_2430_clkdm,
|
||||
&mdm_clkdm,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP24XX
|
||||
&dsp_clkdm,
|
||||
&gfx_24xx_clkdm,
|
||||
&core_l3_24xx_clkdm,
|
||||
&core_l4_24xx_clkdm,
|
||||
&dss_24xx_clkdm,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP34XX
|
||||
&mpu_34xx_clkdm,
|
||||
&neon_clkdm,
|
||||
&iva2_clkdm,
|
||||
&gfx_3430es1_clkdm,
|
||||
&sgx_clkdm,
|
||||
&d2d_clkdm,
|
||||
&core_l3_34xx_clkdm,
|
||||
&core_l4_34xx_clkdm,
|
||||
&dss_34xx_clkdm,
|
||||
&cam_clkdm,
|
||||
&usbhost_clkdm,
|
||||
&per_clkdm,
|
||||
&emu_clkdm,
|
||||
#endif
|
||||
|
||||
NULL,
|
||||
};
|
||||
|
||||
#endif
|
|
@ -63,7 +63,8 @@
|
|||
#define OMAP24XX_CLKSEL_MPU_MASK (0x1f << 0)
|
||||
|
||||
/* CM_CLKSTCTRL_MPU */
|
||||
#define OMAP24XX_AUTOSTATE_MPU (1 << 0)
|
||||
#define OMAP24XX_AUTOSTATE_MPU_SHIFT 0
|
||||
#define OMAP24XX_AUTOSTATE_MPU_MASK (1 << 0)
|
||||
|
||||
/* CM_FCLKEN1_CORE specific bits*/
|
||||
#define OMAP24XX_EN_TV_SHIFT 2
|
||||
|
@ -238,9 +239,12 @@
|
|||
#define OMAP24XX_CLKSEL_GPT2_MASK (0x3 << 2)
|
||||
|
||||
/* CM_CLKSTCTRL_CORE */
|
||||
#define OMAP24XX_AUTOSTATE_DSS (1 << 2)
|
||||
#define OMAP24XX_AUTOSTATE_L4 (1 << 1)
|
||||
#define OMAP24XX_AUTOSTATE_L3 (1 << 0)
|
||||
#define OMAP24XX_AUTOSTATE_DSS_SHIFT 2
|
||||
#define OMAP24XX_AUTOSTATE_DSS_MASK (1 << 2)
|
||||
#define OMAP24XX_AUTOSTATE_L4_SHIFT 1
|
||||
#define OMAP24XX_AUTOSTATE_L4_MASK (1 << 1)
|
||||
#define OMAP24XX_AUTOSTATE_L3_SHIFT 0
|
||||
#define OMAP24XX_AUTOSTATE_L3_MASK (1 << 0)
|
||||
|
||||
/* CM_FCLKEN_GFX */
|
||||
#define OMAP24XX_EN_3D_SHIFT 2
|
||||
|
@ -255,7 +259,8 @@
|
|||
/* CM_CLKSEL_GFX specific bits */
|
||||
|
||||
/* CM_CLKSTCTRL_GFX */
|
||||
#define OMAP24XX_AUTOSTATE_GFX (1 << 0)
|
||||
#define OMAP24XX_AUTOSTATE_GFX_SHIFT 0
|
||||
#define OMAP24XX_AUTOSTATE_GFX_MASK (1 << 0)
|
||||
|
||||
/* CM_FCLKEN_WKUP specific bits */
|
||||
|
||||
|
@ -367,8 +372,10 @@
|
|||
#define OMAP24XX_CLKSEL_DSP_MASK (0x1f << 0)
|
||||
|
||||
/* CM_CLKSTCTRL_DSP */
|
||||
#define OMAP2420_AUTOSTATE_IVA (1 << 8)
|
||||
#define OMAP24XX_AUTOSTATE_DSP (1 << 0)
|
||||
#define OMAP2420_AUTOSTATE_IVA_SHIFT 8
|
||||
#define OMAP2420_AUTOSTATE_IVA_MASK (1 << 8)
|
||||
#define OMAP24XX_AUTOSTATE_DSP_SHIFT 0
|
||||
#define OMAP24XX_AUTOSTATE_DSP_MASK (1 << 0)
|
||||
|
||||
/* CM_FCLKEN_MDM */
|
||||
/* 2430 only */
|
||||
|
@ -396,6 +403,7 @@
|
|||
|
||||
/* CM_CLKSTCTRL_MDM */
|
||||
/* 2430 only */
|
||||
#define OMAP2430_AUTOSTATE_MDM (1 << 0)
|
||||
#define OMAP2430_AUTOSTATE_MDM_SHIFT 0
|
||||
#define OMAP2430_AUTOSTATE_MDM_MASK (1 << 0)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -96,7 +96,8 @@
|
|||
#define OMAP3430_CLKTRCTRL_IVA2_MASK (0x3 << 0)
|
||||
|
||||
/* CM_CLKSTST_IVA2 */
|
||||
#define OMAP3430_CLKACTIVITY_IVA2 (1 << 0)
|
||||
#define OMAP3430_CLKACTIVITY_IVA2_SHIFT 0
|
||||
#define OMAP3430_CLKACTIVITY_IVA2_MASK (1 << 0)
|
||||
|
||||
/* CM_REVISION specific bits */
|
||||
|
||||
|
@ -140,7 +141,8 @@
|
|||
#define OMAP3430_CLKTRCTRL_MPU_MASK (0x3 << 0)
|
||||
|
||||
/* CM_CLKSTST_MPU */
|
||||
#define OMAP3430_CLKACTIVITY_MPU (1 << 0)
|
||||
#define OMAP3430_CLKACTIVITY_MPU_SHIFT 0
|
||||
#define OMAP3430_CLKACTIVITY_MPU_MASK (1 << 0)
|
||||
|
||||
/* CM_FCLKEN1_CORE specific bits */
|
||||
|
||||
|
@ -300,9 +302,12 @@
|
|||
#define OMAP3430_CLKTRCTRL_L3_MASK (0x3 << 0)
|
||||
|
||||
/* CM_CLKSTST_CORE */
|
||||
#define OMAP3430ES1_CLKACTIVITY_D2D (1 << 2)
|
||||
#define OMAP3430_CLKACTIVITY_L4 (1 << 1)
|
||||
#define OMAP3430_CLKACTIVITY_L3 (1 << 0)
|
||||
#define OMAP3430ES1_CLKACTIVITY_D2D_SHIFT 2
|
||||
#define OMAP3430ES1_CLKACTIVITY_D2D_MASK (1 << 2)
|
||||
#define OMAP3430_CLKACTIVITY_L4_SHIFT 1
|
||||
#define OMAP3430_CLKACTIVITY_L4_MASK (1 << 1)
|
||||
#define OMAP3430_CLKACTIVITY_L3_SHIFT 0
|
||||
#define OMAP3430_CLKACTIVITY_L3_MASK (1 << 0)
|
||||
|
||||
/* CM_FCLKEN_GFX */
|
||||
#define OMAP3430ES1_EN_3D (1 << 2)
|
||||
|
@ -323,7 +328,8 @@
|
|||
#define OMAP3430ES1_CLKTRCTRL_GFX_MASK (0x3 << 0)
|
||||
|
||||
/* CM_CLKSTST_GFX */
|
||||
#define OMAP3430ES1_CLKACTIVITY_GFX (1 << 0)
|
||||
#define OMAP3430ES1_CLKACTIVITY_GFX_SHIFT 0
|
||||
#define OMAP3430ES1_CLKACTIVITY_GFX_MASK (1 << 0)
|
||||
|
||||
/* CM_FCLKEN_SGX */
|
||||
#define OMAP3430ES2_EN_SGX_SHIFT 1
|
||||
|
@ -333,6 +339,14 @@
|
|||
#define OMAP3430ES2_CLKSEL_SGX_SHIFT 0
|
||||
#define OMAP3430ES2_CLKSEL_SGX_MASK (0x7 << 0)
|
||||
|
||||
/* CM_CLKSTCTRL_SGX */
|
||||
#define OMAP3430ES2_CLKTRCTRL_SGX_SHIFT 0
|
||||
#define OMAP3430ES2_CLKTRCTRL_SGX_MASK (0x3 << 0)
|
||||
|
||||
/* CM_CLKSTST_SGX */
|
||||
#define OMAP3430ES2_CLKACTIVITY_SGX_SHIFT 0
|
||||
#define OMAP3430ES2_CLKACTIVITY_SGX_MASK (1 << 0)
|
||||
|
||||
/* CM_FCLKEN_WKUP specific bits */
|
||||
#define OMAP3430ES2_EN_USIMOCP_SHIFT 9
|
||||
|
||||
|
@ -498,7 +512,8 @@
|
|||
#define OMAP3430_CLKTRCTRL_DSS_MASK (0x3 << 0)
|
||||
|
||||
/* CM_CLKSTST_DSS */
|
||||
#define OMAP3430_CLKACTIVITY_DSS (1 << 0)
|
||||
#define OMAP3430_CLKACTIVITY_DSS_SHIFT 0
|
||||
#define OMAP3430_CLKACTIVITY_DSS_MASK (1 << 0)
|
||||
|
||||
/* CM_FCLKEN_CAM specific bits */
|
||||
|
||||
|
@ -522,7 +537,8 @@
|
|||
#define OMAP3430_CLKTRCTRL_CAM_MASK (0x3 << 0)
|
||||
|
||||
/* CM_CLKSTST_CAM */
|
||||
#define OMAP3430_CLKACTIVITY_CAM (1 << 0)
|
||||
#define OMAP3430_CLKACTIVITY_CAM_SHIFT 0
|
||||
#define OMAP3430_CLKACTIVITY_CAM_MASK (1 << 0)
|
||||
|
||||
/* CM_FCLKEN_PER specific bits */
|
||||
|
||||
|
@ -598,7 +614,8 @@
|
|||
#define OMAP3430_CLKTRCTRL_PER_MASK (0x3 << 0)
|
||||
|
||||
/* CM_CLKSTST_PER */
|
||||
#define OMAP3430_CLKACTIVITY_PER (1 << 0)
|
||||
#define OMAP3430_CLKACTIVITY_PER_SHIFT 0
|
||||
#define OMAP3430_CLKACTIVITY_PER_MASK (1 << 0)
|
||||
|
||||
/* CM_CLKSEL1_EMU */
|
||||
#define OMAP3430_DIV_DPLL4_SHIFT 24
|
||||
|
@ -623,7 +640,8 @@
|
|||
#define OMAP3430_CLKTRCTRL_EMU_MASK (0x3 << 0)
|
||||
|
||||
/* CM_CLKSTST_EMU */
|
||||
#define OMAP3430_CLKACTIVITY_EMU (1 << 0)
|
||||
#define OMAP3430_CLKACTIVITY_EMU_SHIFT 0
|
||||
#define OMAP3430_CLKACTIVITY_EMU_MASK (1 << 0)
|
||||
|
||||
/* CM_CLKSEL2_EMU specific bits */
|
||||
#define OMAP3430_CORE_DPLL_EMU_MULT_SHIFT 8
|
||||
|
@ -673,6 +691,8 @@
|
|||
#define OMAP3430ES2_CLKTRCTRL_USBHOST_SHIFT 0
|
||||
#define OMAP3430ES2_CLKTRCTRL_USBHOST_MASK (3 << 0)
|
||||
|
||||
|
||||
/* CM_CLKSTST_USBHOST */
|
||||
#define OMAP3430ES2_CLKACTIVITY_USBHOST_SHIFT 0
|
||||
#define OMAP3430ES2_CLKACTIVITY_USBHOST_MASK (1 << 0)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#ifndef __ASSEMBLER__
|
||||
#define OMAP_CM_REGADDR(module, reg) \
|
||||
(void __iomem *)IO_ADDRESS(OMAP2_CM_BASE + (module) + (reg))
|
||||
IO_ADDRESS(OMAP2_CM_BASE + (module) + (reg))
|
||||
#else
|
||||
#define OMAP2420_CM_REGADDR(module, reg) \
|
||||
IO_ADDRESS(OMAP2420_CM_BASE + (module) + (reg))
|
||||
|
|
|
@ -23,50 +23,7 @@
|
|||
#include <mach/board.h>
|
||||
#include <mach/mux.h>
|
||||
#include <mach/gpio.h>
|
||||
|
||||
#if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE)
|
||||
|
||||
#define OMAP2_I2C_BASE2 0x48072000
|
||||
#define OMAP2_I2C_INT2 57
|
||||
|
||||
static struct resource i2c_resources2[] = {
|
||||
{
|
||||
.start = OMAP2_I2C_BASE2,
|
||||
.end = OMAP2_I2C_BASE2 + 0x3f,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = OMAP2_I2C_INT2,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device omap_i2c_device2 = {
|
||||
.name = "i2c_omap",
|
||||
.id = 2,
|
||||
.num_resources = ARRAY_SIZE(i2c_resources2),
|
||||
.resource = i2c_resources2,
|
||||
};
|
||||
|
||||
/* See also arch/arm/plat-omap/devices.c for first I2C on 24xx */
|
||||
static void omap_init_i2c(void)
|
||||
{
|
||||
/* REVISIT: Second I2C not in use on H4? */
|
||||
if (machine_is_omap_h4())
|
||||
return;
|
||||
|
||||
if (!cpu_is_omap2430()) {
|
||||
omap_cfg_reg(J15_24XX_I2C2_SCL);
|
||||
omap_cfg_reg(H19_24XX_I2C2_SDA);
|
||||
}
|
||||
(void) platform_device_register(&omap_i2c_device2);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void omap_init_i2c(void) {}
|
||||
|
||||
#endif
|
||||
#include <mach/eac.h>
|
||||
|
||||
#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
|
||||
#define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE)
|
||||
|
@ -104,7 +61,9 @@ static inline void omap_init_mbox(void) { }
|
|||
|
||||
#if defined(CONFIG_OMAP_STI)
|
||||
|
||||
#define OMAP2_STI_BASE IO_ADDRESS(0x48068000)
|
||||
#if defined(CONFIG_ARCH_OMAP2)
|
||||
|
||||
#define OMAP2_STI_BASE 0x48068000
|
||||
#define OMAP2_STI_CHANNEL_BASE 0x54000000
|
||||
#define OMAP2_STI_IRQ 4
|
||||
|
||||
|
@ -124,6 +83,25 @@ static struct resource sti_resources[] = {
|
|||
.flags = IORESOURCE_IRQ,
|
||||
}
|
||||
};
|
||||
#elif defined(CONFIG_ARCH_OMAP3)
|
||||
|
||||
#define OMAP3_SDTI_BASE 0x54500000
|
||||
#define OMAP3_SDTI_CHANNEL_BASE 0x54600000
|
||||
|
||||
static struct resource sti_resources[] = {
|
||||
{
|
||||
.start = OMAP3_SDTI_BASE,
|
||||
.end = OMAP3_SDTI_BASE + 0xFFF,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = OMAP3_SDTI_CHANNEL_BASE,
|
||||
.end = OMAP3_SDTI_CHANNEL_BASE + SZ_1M - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
static struct platform_device sti_device = {
|
||||
.name = "sti",
|
||||
|
@ -140,12 +118,14 @@ static inline void omap_init_sti(void)
|
|||
static inline void omap_init_sti(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SPI_OMAP24XX)
|
||||
#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
|
||||
|
||||
#include <mach/mcspi.h>
|
||||
|
||||
#define OMAP2_MCSPI1_BASE 0x48098000
|
||||
#define OMAP2_MCSPI2_BASE 0x4809a000
|
||||
#define OMAP2_MCSPI3_BASE 0x480b8000
|
||||
#define OMAP2_MCSPI4_BASE 0x480ba000
|
||||
|
||||
static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
|
||||
.num_cs = 4,
|
||||
|
@ -159,7 +139,7 @@ static struct resource omap2_mcspi1_resources[] = {
|
|||
},
|
||||
};
|
||||
|
||||
struct platform_device omap2_mcspi1 = {
|
||||
static struct platform_device omap2_mcspi1 = {
|
||||
.name = "omap2_mcspi",
|
||||
.id = 1,
|
||||
.num_resources = ARRAY_SIZE(omap2_mcspi1_resources),
|
||||
|
@ -181,7 +161,7 @@ static struct resource omap2_mcspi2_resources[] = {
|
|||
},
|
||||
};
|
||||
|
||||
struct platform_device omap2_mcspi2 = {
|
||||
static struct platform_device omap2_mcspi2 = {
|
||||
.name = "omap2_mcspi",
|
||||
.id = 2,
|
||||
.num_resources = ARRAY_SIZE(omap2_mcspi2_resources),
|
||||
|
@ -191,16 +171,162 @@ struct platform_device omap2_mcspi2 = {
|
|||
},
|
||||
};
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3)
|
||||
static struct omap2_mcspi_platform_config omap2_mcspi3_config = {
|
||||
.num_cs = 2,
|
||||
};
|
||||
|
||||
static struct resource omap2_mcspi3_resources[] = {
|
||||
{
|
||||
.start = OMAP2_MCSPI3_BASE,
|
||||
.end = OMAP2_MCSPI3_BASE + 0xff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device omap2_mcspi3 = {
|
||||
.name = "omap2_mcspi",
|
||||
.id = 3,
|
||||
.num_resources = ARRAY_SIZE(omap2_mcspi3_resources),
|
||||
.resource = omap2_mcspi3_resources,
|
||||
.dev = {
|
||||
.platform_data = &omap2_mcspi3_config,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP3
|
||||
static struct omap2_mcspi_platform_config omap2_mcspi4_config = {
|
||||
.num_cs = 1,
|
||||
};
|
||||
|
||||
static struct resource omap2_mcspi4_resources[] = {
|
||||
{
|
||||
.start = OMAP2_MCSPI4_BASE,
|
||||
.end = OMAP2_MCSPI4_BASE + 0xff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device omap2_mcspi4 = {
|
||||
.name = "omap2_mcspi",
|
||||
.id = 4,
|
||||
.num_resources = ARRAY_SIZE(omap2_mcspi4_resources),
|
||||
.resource = omap2_mcspi4_resources,
|
||||
.dev = {
|
||||
.platform_data = &omap2_mcspi4_config,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
static void omap_init_mcspi(void)
|
||||
{
|
||||
platform_device_register(&omap2_mcspi1);
|
||||
platform_device_register(&omap2_mcspi2);
|
||||
#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3)
|
||||
platform_device_register(&omap2_mcspi3);
|
||||
#endif
|
||||
#ifdef CONFIG_ARCH_OMAP3
|
||||
platform_device_register(&omap2_mcspi4);
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
static inline void omap_init_mcspi(void) {}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SND_OMAP24XX_EAC
|
||||
|
||||
#define OMAP2_EAC_BASE 0x48090000
|
||||
|
||||
static struct resource omap2_eac_resources[] = {
|
||||
{
|
||||
.start = OMAP2_EAC_BASE,
|
||||
.end = OMAP2_EAC_BASE + 0x109,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device omap2_eac_device = {
|
||||
.name = "omap24xx-eac",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(omap2_eac_resources),
|
||||
.resource = omap2_eac_resources,
|
||||
.dev = {
|
||||
.platform_data = NULL,
|
||||
},
|
||||
};
|
||||
|
||||
void omap_init_eac(struct eac_platform_data *pdata)
|
||||
{
|
||||
omap2_eac_device.dev.platform_data = pdata;
|
||||
platform_device_register(&omap2_eac_device);
|
||||
}
|
||||
|
||||
#else
|
||||
void omap_init_eac(struct eac_platform_data *pdata) {}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OMAP_SHA1_MD5
|
||||
static struct resource sha1_md5_resources[] = {
|
||||
{
|
||||
.start = OMAP24XX_SEC_SHA1MD5_BASE,
|
||||
.end = OMAP24XX_SEC_SHA1MD5_BASE + 0x64,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = INT_24XX_SHA1MD5,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
}
|
||||
};
|
||||
|
||||
static struct platform_device sha1_md5_device = {
|
||||
.name = "OMAP SHA1/MD5",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(sha1_md5_resources),
|
||||
.resource = sha1_md5_resources,
|
||||
};
|
||||
|
||||
static void omap_init_sha1_md5(void)
|
||||
{
|
||||
platform_device_register(&sha1_md5_device);
|
||||
}
|
||||
#else
|
||||
static inline void omap_init_sha1_md5(void) { }
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE)
|
||||
#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)
|
||||
#define OMAP_HDQ_BASE 0x480B2000
|
||||
#endif
|
||||
static struct resource omap_hdq_resources[] = {
|
||||
{
|
||||
.start = OMAP_HDQ_BASE,
|
||||
.end = OMAP_HDQ_BASE + 0x1C,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = INT_24XX_HDQ_IRQ,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
static struct platform_device omap_hdq_dev = {
|
||||
.name = "omap_hdq",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = NULL,
|
||||
},
|
||||
.num_resources = ARRAY_SIZE(omap_hdq_resources),
|
||||
.resource = omap_hdq_resources,
|
||||
};
|
||||
static inline void omap_hdq_init(void)
|
||||
{
|
||||
(void) platform_device_register(&omap_hdq_dev);
|
||||
}
|
||||
#else
|
||||
static inline void omap_hdq_init(void) {}
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
static int __init omap2_init_devices(void)
|
||||
|
@ -208,10 +334,11 @@ static int __init omap2_init_devices(void)
|
|||
/* please keep these calls, and their implementations above,
|
||||
* in alphabetical order so they're easier to sort through.
|
||||
*/
|
||||
omap_init_i2c();
|
||||
omap_init_mbox();
|
||||
omap_init_mcspi();
|
||||
omap_hdq_init();
|
||||
omap_init_sti();
|
||||
omap_init_sha1_md5();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#undef DEBUG
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/err.h>
|
||||
|
@ -16,20 +18,14 @@
|
|||
#include <linux/ioport.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <mach/gpmc.h>
|
||||
|
||||
#undef DEBUG
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP2420
|
||||
#define GPMC_BASE 0x6800a000
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP2430
|
||||
#define GPMC_BASE 0x6E000000
|
||||
#endif
|
||||
#include <mach/sdrc.h>
|
||||
|
||||
/* GPMC register offsets */
|
||||
#define GPMC_REVISION 0x00
|
||||
#define GPMC_SYSCONFIG 0x10
|
||||
#define GPMC_SYSSTATUS 0x14
|
||||
|
@ -51,7 +47,6 @@
|
|||
#define GPMC_CS0 0x60
|
||||
#define GPMC_CS_SIZE 0x30
|
||||
|
||||
#define GPMC_CS_NUM 8
|
||||
#define GPMC_MEM_START 0x00000000
|
||||
#define GPMC_MEM_END 0x3FFFFFFF
|
||||
#define BOOT_ROM_SPACE 0x100000 /* 1MB */
|
||||
|
@ -64,12 +59,9 @@ static struct resource gpmc_cs_mem[GPMC_CS_NUM];
|
|||
static DEFINE_SPINLOCK(gpmc_mem_lock);
|
||||
static unsigned gpmc_cs_map;
|
||||
|
||||
static void __iomem *gpmc_base =
|
||||
(void __iomem *) IO_ADDRESS(GPMC_BASE);
|
||||
static void __iomem *gpmc_cs_base =
|
||||
(void __iomem *) IO_ADDRESS(GPMC_BASE) + GPMC_CS0;
|
||||
static void __iomem *gpmc_base;
|
||||
|
||||
static struct clk *gpmc_fck;
|
||||
static struct clk *gpmc_l3_clk;
|
||||
|
||||
static void gpmc_write_reg(int idx, u32 val)
|
||||
{
|
||||
|
@ -85,19 +77,32 @@ void gpmc_cs_write_reg(int cs, int idx, u32 val)
|
|||
{
|
||||
void __iomem *reg_addr;
|
||||
|
||||
reg_addr = gpmc_cs_base + (cs * GPMC_CS_SIZE) + idx;
|
||||
reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
|
||||
__raw_writel(val, reg_addr);
|
||||
}
|
||||
|
||||
u32 gpmc_cs_read_reg(int cs, int idx)
|
||||
{
|
||||
return __raw_readl(gpmc_cs_base + (cs * GPMC_CS_SIZE) + idx);
|
||||
void __iomem *reg_addr;
|
||||
|
||||
reg_addr = gpmc_base + GPMC_CS0 + (cs * GPMC_CS_SIZE) + idx;
|
||||
return __raw_readl(reg_addr);
|
||||
}
|
||||
|
||||
/* TODO: Add support for gpmc_fck to clock framework and use it */
|
||||
unsigned long gpmc_get_fclk_period(void)
|
||||
{
|
||||
/* In picoseconds */
|
||||
return 1000000000 / ((clk_get_rate(gpmc_fck)) / 1000);
|
||||
unsigned long rate = clk_get_rate(gpmc_l3_clk);
|
||||
|
||||
if (rate == 0) {
|
||||
printk(KERN_WARNING "gpmc_l3_clk not enabled\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
rate /= 1000;
|
||||
rate = 1000000000 / rate; /* In picoseconds */
|
||||
|
||||
return rate;
|
||||
}
|
||||
|
||||
unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
|
||||
|
@ -110,6 +115,11 @@ unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
|
|||
return (time_ns * 1000 + tick_ps - 1) / tick_ps;
|
||||
}
|
||||
|
||||
unsigned int gpmc_ticks_to_ns(unsigned int ticks)
|
||||
{
|
||||
return ticks * gpmc_get_fclk_period() / 1000;
|
||||
}
|
||||
|
||||
unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns)
|
||||
{
|
||||
unsigned long ticks = gpmc_ns_to_ticks(time_ns);
|
||||
|
@ -210,6 +220,11 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
|
|||
|
||||
GPMC_SET_ONE(GPMC_CS_CONFIG5, 24, 27, page_burst_access);
|
||||
|
||||
if (cpu_is_omap34xx()) {
|
||||
GPMC_SET_ONE(GPMC_CS_CONFIG6, 16, 19, wr_data_mux_bus);
|
||||
GPMC_SET_ONE(GPMC_CS_CONFIG6, 24, 28, wr_access);
|
||||
}
|
||||
|
||||
/* caller is expected to have initialized CONFIG1 to cover
|
||||
* at least sync vs async
|
||||
*/
|
||||
|
@ -350,6 +365,7 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
|
|||
spin_unlock(&gpmc_mem_lock);
|
||||
return r;
|
||||
}
|
||||
EXPORT_SYMBOL(gpmc_cs_request);
|
||||
|
||||
void gpmc_cs_free(int cs)
|
||||
{
|
||||
|
@ -365,8 +381,9 @@ void gpmc_cs_free(int cs)
|
|||
gpmc_cs_set_reserved(cs, 0);
|
||||
spin_unlock(&gpmc_mem_lock);
|
||||
}
|
||||
EXPORT_SYMBOL(gpmc_cs_free);
|
||||
|
||||
void __init gpmc_mem_init(void)
|
||||
static void __init gpmc_mem_init(void)
|
||||
{
|
||||
int cs;
|
||||
unsigned long boot_rom_space = 0;
|
||||
|
@ -396,12 +413,33 @@ void __init gpmc_mem_init(void)
|
|||
void __init gpmc_init(void)
|
||||
{
|
||||
u32 l;
|
||||
char *ck;
|
||||
|
||||
gpmc_fck = clk_get(NULL, "gpmc_fck"); /* Always on ENABLE_ON_INIT */
|
||||
if (IS_ERR(gpmc_fck))
|
||||
WARN_ON(1);
|
||||
else
|
||||
clk_enable(gpmc_fck);
|
||||
if (cpu_is_omap24xx()) {
|
||||
ck = "core_l3_ck";
|
||||
if (cpu_is_omap2420())
|
||||
l = OMAP2420_GPMC_BASE;
|
||||
else
|
||||
l = OMAP34XX_GPMC_BASE;
|
||||
} else if (cpu_is_omap34xx()) {
|
||||
ck = "gpmc_fck";
|
||||
l = OMAP34XX_GPMC_BASE;
|
||||
}
|
||||
|
||||
gpmc_l3_clk = clk_get(NULL, ck);
|
||||
if (IS_ERR(gpmc_l3_clk)) {
|
||||
printk(KERN_ERR "Could not get GPMC clock %s\n", ck);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
gpmc_base = ioremap(l, SZ_4K);
|
||||
if (!gpmc_base) {
|
||||
clk_put(gpmc_l3_clk);
|
||||
printk(KERN_ERR "Could not get GPMC register memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
BUG_ON(IS_ERR(gpmc_l3_clk));
|
||||
|
||||
l = gpmc_read_reg(GPMC_REVISION);
|
||||
printk(KERN_INFO "GPMC revision %d.%d\n", (l >> 4) & 0x0f, l & 0x0f);
|
||||
|
|
|
@ -18,24 +18,15 @@
|
|||
|
||||
#include <asm/cputype.h>
|
||||
|
||||
#include <mach/common.h>
|
||||
#include <mach/control.h>
|
||||
#include <mach/cpu.h>
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP2420)
|
||||
#define TAP_BASE io_p2v(0x48014000)
|
||||
#elif defined(CONFIG_ARCH_OMAP2430)
|
||||
#define TAP_BASE io_p2v(0x4900A000)
|
||||
#elif defined(CONFIG_ARCH_OMAP34XX)
|
||||
#define TAP_BASE io_p2v(0x4830A000)
|
||||
#endif
|
||||
static u32 class;
|
||||
static void __iomem *tap_base;
|
||||
static u16 tap_prod_id;
|
||||
|
||||
#define OMAP_TAP_IDCODE 0x0204
|
||||
#if defined(CONFIG_ARCH_OMAP34XX)
|
||||
#define OMAP_TAP_PROD_ID 0x0210
|
||||
#else
|
||||
#define OMAP_TAP_PROD_ID 0x0208
|
||||
#endif
|
||||
|
||||
#define OMAP_TAP_DIE_ID_0 0x0218
|
||||
#define OMAP_TAP_DIE_ID_1 0x021C
|
||||
#define OMAP_TAP_DIE_ID_2 0x0220
|
||||
|
@ -94,18 +85,24 @@ static u32 __init read_tap_reg(int reg)
|
|||
* it means its Cortex r0p0 which is 3430 ES1
|
||||
*/
|
||||
if ((((cpuid >> 4) & 0xFFF) == 0xC08) && ((cpuid & 0xF) == 0x0)) {
|
||||
|
||||
if (reg == tap_prod_id) {
|
||||
regval = 0x000F00F0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
switch (reg) {
|
||||
case OMAP_TAP_IDCODE : regval = 0x0B7AE02F; break;
|
||||
/* Making DevType as 0xF in ES1 to differ from ES2 */
|
||||
case OMAP_TAP_PROD_ID : regval = 0x000F00F0; break;
|
||||
case OMAP_TAP_DIE_ID_0: regval = 0x01000000; break;
|
||||
case OMAP_TAP_DIE_ID_1: regval = 0x1012d687; break;
|
||||
case OMAP_TAP_DIE_ID_2: regval = 0x00000000; break;
|
||||
case OMAP_TAP_DIE_ID_3: regval = 0x2d2c0000; break;
|
||||
}
|
||||
} else
|
||||
regval = __raw_readl(TAP_BASE + reg);
|
||||
regval = __raw_readl(tap_base + reg);
|
||||
|
||||
out:
|
||||
return regval;
|
||||
|
||||
}
|
||||
|
@ -204,7 +201,7 @@ void __init omap2_check_revision(void)
|
|||
u8 rev;
|
||||
|
||||
idcode = read_tap_reg(OMAP_TAP_IDCODE);
|
||||
prod_id = read_tap_reg(OMAP_TAP_PROD_ID);
|
||||
prod_id = read_tap_reg(tap_prod_id);
|
||||
hawkeye = (idcode >> 12) & 0xffff;
|
||||
rev = (idcode >> 28) & 0x0f;
|
||||
dev_type = (prod_id >> 16) & 0x0f;
|
||||
|
@ -269,3 +266,13 @@ void __init omap2_check_revision(void)
|
|||
|
||||
}
|
||||
|
||||
void __init omap2_set_globals_tap(struct omap_globals *omap2_globals)
|
||||
{
|
||||
class = omap2_globals->class;
|
||||
tap_base = omap2_globals->tap;
|
||||
|
||||
if (class == 0x3430)
|
||||
tap_prod_id = 0x0210;
|
||||
else
|
||||
tap_prod_id = 0x0208;
|
||||
}
|
||||
|
|
|
@ -4,8 +4,11 @@
|
|||
* OMAP2 I/O mapping code
|
||||
*
|
||||
* Copyright (C) 2005 Nokia Corporation
|
||||
* Author: Juha Yrjölä <juha.yrjola@nokia.com>
|
||||
* Updated map desc to add 2430 support : <x0khasim@ti.com>
|
||||
* Copyright (C) 2007 Texas Instruments
|
||||
*
|
||||
* Author:
|
||||
* Juha Yrjola <juha.yrjola@nokia.com>
|
||||
* Syed Khasim <x0khasim@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
|
||||
|
@ -23,19 +26,26 @@
|
|||
|
||||
#include <mach/mux.h>
|
||||
#include <mach/omapfb.h>
|
||||
#include <mach/sram.h>
|
||||
|
||||
extern void omap_sram_init(void);
|
||||
extern int omap2_clk_init(void);
|
||||
extern void omap2_check_revision(void);
|
||||
extern void omap2_init_memory(void);
|
||||
extern void gpmc_init(void);
|
||||
extern void omapfb_reserve_sdram(void);
|
||||
#include "memory.h"
|
||||
|
||||
#include "clock.h"
|
||||
|
||||
#include <mach/powerdomain.h>
|
||||
|
||||
#include "powerdomains.h"
|
||||
|
||||
#include <mach/clockdomain.h>
|
||||
#include "clockdomains.h"
|
||||
|
||||
/*
|
||||
* The machine specific code may provide the extra mapping besides the
|
||||
* default mapping provided here.
|
||||
*/
|
||||
static struct map_desc omap2_io_desc[] __initdata = {
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP24XX
|
||||
static struct map_desc omap24xx_io_desc[] __initdata = {
|
||||
{
|
||||
.virtual = L3_24XX_VIRT,
|
||||
.pfn = __phys_to_pfn(L3_24XX_PHYS),
|
||||
|
@ -43,25 +53,15 @@ static struct map_desc omap2_io_desc[] __initdata = {
|
|||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = L4_24XX_VIRT,
|
||||
.pfn = __phys_to_pfn(L4_24XX_PHYS),
|
||||
.length = L4_24XX_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
#ifdef CONFIG_ARCH_OMAP2430
|
||||
{
|
||||
.virtual = L4_WK_243X_VIRT,
|
||||
.pfn = __phys_to_pfn(L4_WK_243X_PHYS),
|
||||
.length = L4_WK_243X_SIZE,
|
||||
.virtual = L4_24XX_VIRT,
|
||||
.pfn = __phys_to_pfn(L4_24XX_PHYS),
|
||||
.length = L4_24XX_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = OMAP243X_GPMC_VIRT,
|
||||
.pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS),
|
||||
.length = OMAP243X_GPMC_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP2420
|
||||
static struct map_desc omap242x_io_desc[] __initdata = {
|
||||
{
|
||||
.virtual = DSP_MEM_24XX_VIRT,
|
||||
.pfn = __phys_to_pfn(DSP_MEM_24XX_PHYS),
|
||||
|
@ -79,12 +79,109 @@ static struct map_desc omap2_io_desc[] __initdata = {
|
|||
.pfn = __phys_to_pfn(DSP_MMU_24XX_PHYS),
|
||||
.length = DSP_MMU_24XX_SIZE,
|
||||
.type = MT_DEVICE
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP2430
|
||||
static struct map_desc omap243x_io_desc[] __initdata = {
|
||||
{
|
||||
.virtual = L4_WK_243X_VIRT,
|
||||
.pfn = __phys_to_pfn(L4_WK_243X_PHYS),
|
||||
.length = L4_WK_243X_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = OMAP243X_GPMC_VIRT,
|
||||
.pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS),
|
||||
.length = OMAP243X_GPMC_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = OMAP243X_SDRC_VIRT,
|
||||
.pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS),
|
||||
.length = OMAP243X_SDRC_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = OMAP243X_SMS_VIRT,
|
||||
.pfn = __phys_to_pfn(OMAP243X_SMS_PHYS),
|
||||
.length = OMAP243X_SMS_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP34XX
|
||||
static struct map_desc omap34xx_io_desc[] __initdata = {
|
||||
{
|
||||
.virtual = L3_34XX_VIRT,
|
||||
.pfn = __phys_to_pfn(L3_34XX_PHYS),
|
||||
.length = L3_34XX_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = L4_34XX_VIRT,
|
||||
.pfn = __phys_to_pfn(L4_34XX_PHYS),
|
||||
.length = L4_34XX_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = L4_WK_34XX_VIRT,
|
||||
.pfn = __phys_to_pfn(L4_WK_34XX_PHYS),
|
||||
.length = L4_WK_34XX_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = OMAP34XX_GPMC_VIRT,
|
||||
.pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS),
|
||||
.length = OMAP34XX_GPMC_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = OMAP343X_SMS_VIRT,
|
||||
.pfn = __phys_to_pfn(OMAP343X_SMS_PHYS),
|
||||
.length = OMAP343X_SMS_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = OMAP343X_SDRC_VIRT,
|
||||
.pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS),
|
||||
.length = OMAP343X_SDRC_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = L4_PER_34XX_VIRT,
|
||||
.pfn = __phys_to_pfn(L4_PER_34XX_PHYS),
|
||||
.length = L4_PER_34XX_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
{
|
||||
.virtual = L4_EMU_34XX_VIRT,
|
||||
.pfn = __phys_to_pfn(L4_EMU_34XX_PHYS),
|
||||
.length = L4_EMU_34XX_SIZE,
|
||||
.type = MT_DEVICE
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
void __init omap2_map_common_io(void)
|
||||
{
|
||||
iotable_init(omap2_io_desc, ARRAY_SIZE(omap2_io_desc));
|
||||
#if defined(CONFIG_ARCH_OMAP2420)
|
||||
iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
|
||||
iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP2430)
|
||||
iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
|
||||
iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARCH_OMAP34XX)
|
||||
iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
|
||||
#endif
|
||||
|
||||
/* Normally devicemaps_init() would flush caches and tlb after
|
||||
* mdesc->map_io(), but we must also do it here because of the CPU
|
||||
|
@ -101,12 +198,9 @@ void __init omap2_map_common_io(void)
|
|||
void __init omap2_init_common_hw(void)
|
||||
{
|
||||
omap2_mux_init();
|
||||
pwrdm_init(powerdomains_omap);
|
||||
clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps);
|
||||
omap2_clk_init();
|
||||
/*
|
||||
* Need to Fix this for 2430
|
||||
*/
|
||||
#ifndef CONFIG_ARCH_OMAP2430
|
||||
omap2_init_memory();
|
||||
#endif
|
||||
gpmc_init();
|
||||
}
|
||||
|
|
|
@ -16,14 +16,20 @@
|
|||
#include <linux/io.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <asm/mach/irq.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#define INTC_REVISION 0x0000
|
||||
#define INTC_SYSCONFIG 0x0010
|
||||
#define INTC_SYSSTATUS 0x0014
|
||||
#define INTC_CONTROL 0x0048
|
||||
#define INTC_MIR_CLEAR0 0x0088
|
||||
#define INTC_MIR_SET0 0x008c
|
||||
|
||||
/* selected INTC register offsets */
|
||||
|
||||
#define INTC_REVISION 0x0000
|
||||
#define INTC_SYSCONFIG 0x0010
|
||||
#define INTC_SYSSTATUS 0x0014
|
||||
#define INTC_CONTROL 0x0048
|
||||
#define INTC_MIR_CLEAR0 0x0088
|
||||
#define INTC_MIR_SET0 0x008c
|
||||
#define INTC_PENDING_IRQ0 0x0098
|
||||
|
||||
/* Number of IRQ state bits in each MIR register */
|
||||
#define IRQ_BITS_PER_REG 32
|
||||
|
||||
/*
|
||||
* OMAP2 has a number of different interrupt controllers, each interrupt
|
||||
|
@ -32,48 +38,50 @@
|
|||
* for each bank.. when in doubt, consult the TRM.
|
||||
*/
|
||||
static struct omap_irq_bank {
|
||||
unsigned long base_reg;
|
||||
void __iomem *base_reg;
|
||||
unsigned int nr_irqs;
|
||||
} __attribute__ ((aligned(4))) irq_banks[] = {
|
||||
{
|
||||
/* MPU INTC */
|
||||
.base_reg = IO_ADDRESS(OMAP24XX_IC_BASE),
|
||||
.base_reg = 0,
|
||||
.nr_irqs = 96,
|
||||
}, {
|
||||
/* XXX: DSP INTC */
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
/* INTC bank register get/set */
|
||||
|
||||
static void intc_bank_write_reg(u32 val, struct omap_irq_bank *bank, u16 reg)
|
||||
{
|
||||
__raw_writel(val, bank->base_reg + reg);
|
||||
}
|
||||
|
||||
static u32 intc_bank_read_reg(struct omap_irq_bank *bank, u16 reg)
|
||||
{
|
||||
return __raw_readl(bank->base_reg + reg);
|
||||
}
|
||||
|
||||
/* XXX: FIQ and additional INTC support (only MPU at the moment) */
|
||||
static void omap_ack_irq(unsigned int irq)
|
||||
{
|
||||
__raw_writel(0x1, irq_banks[0].base_reg + INTC_CONTROL);
|
||||
intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL);
|
||||
}
|
||||
|
||||
static void omap_mask_irq(unsigned int irq)
|
||||
{
|
||||
int offset = (irq >> 5) << 5;
|
||||
int offset = irq & (~(IRQ_BITS_PER_REG - 1));
|
||||
|
||||
if (irq >= 64) {
|
||||
irq %= 64;
|
||||
} else if (irq >= 32) {
|
||||
irq %= 32;
|
||||
}
|
||||
irq &= (IRQ_BITS_PER_REG - 1);
|
||||
|
||||
__raw_writel(1 << irq, irq_banks[0].base_reg + INTC_MIR_SET0 + offset);
|
||||
intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset);
|
||||
}
|
||||
|
||||
static void omap_unmask_irq(unsigned int irq)
|
||||
{
|
||||
int offset = (irq >> 5) << 5;
|
||||
int offset = irq & (~(IRQ_BITS_PER_REG - 1));
|
||||
|
||||
if (irq >= 64) {
|
||||
irq %= 64;
|
||||
} else if (irq >= 32) {
|
||||
irq %= 32;
|
||||
}
|
||||
irq &= (IRQ_BITS_PER_REG - 1);
|
||||
|
||||
__raw_writel(1 << irq, irq_banks[0].base_reg + INTC_MIR_CLEAR0 + offset);
|
||||
intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_CLEAR0 + offset);
|
||||
}
|
||||
|
||||
static void omap_mask_ack_irq(unsigned int irq)
|
||||
|
@ -93,20 +101,20 @@ static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
|
|||
{
|
||||
unsigned long tmp;
|
||||
|
||||
tmp = __raw_readl(bank->base_reg + INTC_REVISION) & 0xff;
|
||||
printk(KERN_INFO "IRQ: Found an INTC at 0x%08lx "
|
||||
tmp = intc_bank_read_reg(bank, INTC_REVISION) & 0xff;
|
||||
printk(KERN_INFO "IRQ: Found an INTC at 0x%p "
|
||||
"(revision %ld.%ld) with %d interrupts\n",
|
||||
bank->base_reg, tmp >> 4, tmp & 0xf, bank->nr_irqs);
|
||||
|
||||
tmp = __raw_readl(bank->base_reg + INTC_SYSCONFIG);
|
||||
tmp = intc_bank_read_reg(bank, INTC_SYSCONFIG);
|
||||
tmp |= 1 << 1; /* soft reset */
|
||||
__raw_writel(tmp, bank->base_reg + INTC_SYSCONFIG);
|
||||
intc_bank_write_reg(tmp, bank, INTC_SYSCONFIG);
|
||||
|
||||
while (!(__raw_readl(bank->base_reg + INTC_SYSSTATUS) & 0x1))
|
||||
while (!(intc_bank_read_reg(bank, INTC_SYSSTATUS) & 0x1))
|
||||
/* Wait for reset to complete */;
|
||||
|
||||
/* Enable autoidle */
|
||||
__raw_writel(1 << 0, bank->base_reg + INTC_SYSCONFIG);
|
||||
intc_bank_write_reg(1 << 0, bank, INTC_SYSCONFIG);
|
||||
}
|
||||
|
||||
void __init omap_init_irq(void)
|
||||
|
@ -118,9 +126,10 @@ void __init omap_init_irq(void)
|
|||
for (i = 0; i < ARRAY_SIZE(irq_banks); i++) {
|
||||
struct omap_irq_bank *bank = irq_banks + i;
|
||||
|
||||
/* XXX */
|
||||
if (!bank->base_reg)
|
||||
continue;
|
||||
if (cpu_is_omap24xx())
|
||||
bank->base_reg = OMAP2_IO_ADDRESS(OMAP24XX_IC_BASE);
|
||||
else if (cpu_is_omap34xx())
|
||||
bank->base_reg = OMAP2_IO_ADDRESS(OMAP34XX_IC_BASE);
|
||||
|
||||
omap_irq_bank_init_one(bank);
|
||||
|
||||
|
|
|
@ -89,6 +89,30 @@ static struct mcbsp_internal_clk omap_mcbsp_clks[] = {
|
|||
.disable = omap_mcbsp_clk_disable,
|
||||
},
|
||||
},
|
||||
{
|
||||
.clk = {
|
||||
.name = "mcbsp_clk",
|
||||
.id = 3,
|
||||
.enable = omap_mcbsp_clk_enable,
|
||||
.disable = omap_mcbsp_clk_disable,
|
||||
},
|
||||
},
|
||||
{
|
||||
.clk = {
|
||||
.name = "mcbsp_clk",
|
||||
.id = 4,
|
||||
.enable = omap_mcbsp_clk_enable,
|
||||
.disable = omap_mcbsp_clk_disable,
|
||||
},
|
||||
},
|
||||
{
|
||||
.clk = {
|
||||
.name = "mcbsp_clk",
|
||||
.id = 5,
|
||||
.enable = omap_mcbsp_clk_enable,
|
||||
.disable = omap_mcbsp_clk_disable,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
#define omap_mcbsp_clks_size ARRAY_SIZE(omap_mcbsp_clks)
|
||||
|
@ -117,25 +141,14 @@ static void omap2_mcbsp_request(unsigned int id)
|
|||
omap2_mcbsp2_mux_setup();
|
||||
}
|
||||
|
||||
static int omap2_mcbsp_check(unsigned int id)
|
||||
{
|
||||
if (id > OMAP_MAX_MCBSP_COUNT - 1) {
|
||||
printk(KERN_ERR "OMAP-McBSP: McBSP%d doesn't exist\n", id + 1);
|
||||
return -ENODEV;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct omap_mcbsp_ops omap2_mcbsp_ops = {
|
||||
.request = omap2_mcbsp_request,
|
||||
.check = omap2_mcbsp_check,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP24XX
|
||||
static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = {
|
||||
#ifdef CONFIG_ARCH_OMAP2420
|
||||
static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = {
|
||||
{
|
||||
.phys_base = OMAP24XX_MCBSP1_BASE,
|
||||
.virt_base = IO_ADDRESS(OMAP24XX_MCBSP1_BASE),
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX,
|
||||
.rx_irq = INT_24XX_MCBSP1_IRQ_RX,
|
||||
|
@ -145,7 +158,6 @@ static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = {
|
|||
},
|
||||
{
|
||||
.phys_base = OMAP24XX_MCBSP2_BASE,
|
||||
.virt_base = IO_ADDRESS(OMAP24XX_MCBSP2_BASE),
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
|
||||
.rx_irq = INT_24XX_MCBSP2_IRQ_RX,
|
||||
|
@ -154,17 +166,70 @@ static struct omap_mcbsp_platform_data omap24xx_mcbsp_pdata[] = {
|
|||
.clk_name = "mcbsp_clk",
|
||||
},
|
||||
};
|
||||
#define OMAP24XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap24xx_mcbsp_pdata)
|
||||
#define OMAP2420_MCBSP_PDATA_SZ ARRAY_SIZE(omap2420_mcbsp_pdata)
|
||||
#else
|
||||
#define omap24xx_mcbsp_pdata NULL
|
||||
#define OMAP24XX_MCBSP_PDATA_SZ 0
|
||||
#define omap2420_mcbsp_pdata NULL
|
||||
#define OMAP2420_MCBSP_PDATA_SZ 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP2430
|
||||
static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = {
|
||||
{
|
||||
.phys_base = OMAP24XX_MCBSP1_BASE,
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX,
|
||||
.rx_irq = INT_24XX_MCBSP1_IRQ_RX,
|
||||
.tx_irq = INT_24XX_MCBSP1_IRQ_TX,
|
||||
.ops = &omap2_mcbsp_ops,
|
||||
.clk_name = "mcbsp_clk",
|
||||
},
|
||||
{
|
||||
.phys_base = OMAP24XX_MCBSP2_BASE,
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
|
||||
.rx_irq = INT_24XX_MCBSP2_IRQ_RX,
|
||||
.tx_irq = INT_24XX_MCBSP2_IRQ_TX,
|
||||
.ops = &omap2_mcbsp_ops,
|
||||
.clk_name = "mcbsp_clk",
|
||||
},
|
||||
{
|
||||
.phys_base = OMAP2430_MCBSP3_BASE,
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX,
|
||||
.rx_irq = INT_24XX_MCBSP3_IRQ_RX,
|
||||
.tx_irq = INT_24XX_MCBSP3_IRQ_TX,
|
||||
.ops = &omap2_mcbsp_ops,
|
||||
.clk_name = "mcbsp_clk",
|
||||
},
|
||||
{
|
||||
.phys_base = OMAP2430_MCBSP4_BASE,
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX,
|
||||
.rx_irq = INT_24XX_MCBSP4_IRQ_RX,
|
||||
.tx_irq = INT_24XX_MCBSP4_IRQ_TX,
|
||||
.ops = &omap2_mcbsp_ops,
|
||||
.clk_name = "mcbsp_clk",
|
||||
},
|
||||
{
|
||||
.phys_base = OMAP2430_MCBSP5_BASE,
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX,
|
||||
.rx_irq = INT_24XX_MCBSP5_IRQ_RX,
|
||||
.tx_irq = INT_24XX_MCBSP5_IRQ_TX,
|
||||
.ops = &omap2_mcbsp_ops,
|
||||
.clk_name = "mcbsp_clk",
|
||||
},
|
||||
};
|
||||
#define OMAP2430_MCBSP_PDATA_SZ ARRAY_SIZE(omap2430_mcbsp_pdata)
|
||||
#else
|
||||
#define omap2430_mcbsp_pdata NULL
|
||||
#define OMAP2430_MCBSP_PDATA_SZ 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP34XX
|
||||
static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
|
||||
{
|
||||
.phys_base = OMAP34XX_MCBSP1_BASE,
|
||||
.virt_base = IO_ADDRESS(OMAP34XX_MCBSP1_BASE),
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP1_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP1_TX,
|
||||
.rx_irq = INT_24XX_MCBSP1_IRQ_RX,
|
||||
|
@ -174,7 +239,6 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
|
|||
},
|
||||
{
|
||||
.phys_base = OMAP34XX_MCBSP2_BASE,
|
||||
.virt_base = IO_ADDRESS(OMAP34XX_MCBSP2_BASE),
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP2_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP2_TX,
|
||||
.rx_irq = INT_24XX_MCBSP2_IRQ_RX,
|
||||
|
@ -182,6 +246,33 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
|
|||
.ops = &omap2_mcbsp_ops,
|
||||
.clk_name = "mcbsp_clk",
|
||||
},
|
||||
{
|
||||
.phys_base = OMAP34XX_MCBSP3_BASE,
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP3_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP3_TX,
|
||||
.rx_irq = INT_24XX_MCBSP3_IRQ_RX,
|
||||
.tx_irq = INT_24XX_MCBSP3_IRQ_TX,
|
||||
.ops = &omap2_mcbsp_ops,
|
||||
.clk_name = "mcbsp_clk",
|
||||
},
|
||||
{
|
||||
.phys_base = OMAP34XX_MCBSP4_BASE,
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP4_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP4_TX,
|
||||
.rx_irq = INT_24XX_MCBSP4_IRQ_RX,
|
||||
.tx_irq = INT_24XX_MCBSP4_IRQ_TX,
|
||||
.ops = &omap2_mcbsp_ops,
|
||||
.clk_name = "mcbsp_clk",
|
||||
},
|
||||
{
|
||||
.phys_base = OMAP34XX_MCBSP5_BASE,
|
||||
.dma_rx_sync = OMAP24XX_DMA_MCBSP5_RX,
|
||||
.dma_tx_sync = OMAP24XX_DMA_MCBSP5_TX,
|
||||
.rx_irq = INT_24XX_MCBSP5_IRQ_RX,
|
||||
.tx_irq = INT_24XX_MCBSP5_IRQ_TX,
|
||||
.ops = &omap2_mcbsp_ops,
|
||||
.clk_name = "mcbsp_clk",
|
||||
},
|
||||
};
|
||||
#define OMAP34XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap34xx_mcbsp_pdata)
|
||||
#else
|
||||
|
@ -189,7 +280,7 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = {
|
|||
#define OMAP34XX_MCBSP_PDATA_SZ 0
|
||||
#endif
|
||||
|
||||
int __init omap2_mcbsp_init(void)
|
||||
static int __init omap2_mcbsp_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -199,10 +290,24 @@ int __init omap2_mcbsp_init(void)
|
|||
clk_register(&omap_mcbsp_clks[i].clk);
|
||||
}
|
||||
|
||||
if (cpu_is_omap24xx())
|
||||
omap_mcbsp_register_board_cfg(omap24xx_mcbsp_pdata,
|
||||
OMAP24XX_MCBSP_PDATA_SZ);
|
||||
if (cpu_is_omap2420())
|
||||
omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ;
|
||||
if (cpu_is_omap2430())
|
||||
omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ;
|
||||
if (cpu_is_omap34xx())
|
||||
omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ;
|
||||
|
||||
mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),
|
||||
GFP_KERNEL);
|
||||
if (!mcbsp_ptr)
|
||||
return -ENOMEM;
|
||||
|
||||
if (cpu_is_omap2420())
|
||||
omap_mcbsp_register_board_cfg(omap2420_mcbsp_pdata,
|
||||
OMAP2420_MCBSP_PDATA_SZ);
|
||||
if (cpu_is_omap2430())
|
||||
omap_mcbsp_register_board_cfg(omap2430_mcbsp_pdata,
|
||||
OMAP2430_MCBSP_PDATA_SZ);
|
||||
if (cpu_is_omap34xx())
|
||||
omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata,
|
||||
OMAP34XX_MCBSP_PDATA_SZ);
|
||||
|
|
|
@ -101,6 +101,17 @@ u32 omap2_reprogram_sdrc(u32 level, u32 force)
|
|||
return prev;
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_ARCH_OMAP2)
|
||||
void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,
|
||||
u32 base_cs, u32 force_unlock)
|
||||
{
|
||||
}
|
||||
void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val,
|
||||
u32 mem_type)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void omap2_init_memory_params(u32 force_lock_to_unlock_mode)
|
||||
{
|
||||
unsigned long dll_cnt;
|
||||
|
@ -165,6 +176,9 @@ void __init omap2_init_memory(void)
|
|||
{
|
||||
u32 l;
|
||||
|
||||
if (!cpu_is_omap2420())
|
||||
return;
|
||||
|
||||
l = sms_read_reg(SMS_SYSCONFIG);
|
||||
l &= ~(0x3 << 3);
|
||||
l |= (0x2 << 3);
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef ARCH_ARM_MACH_OMAP2_MEMORY_H
|
||||
#define ARCH_ARM_MACH_OMAP2_MEMORY_H
|
||||
|
||||
/* Memory timings */
|
||||
#define M_DDR 1
|
||||
#define M_LOCK_CTRL (1 << 2)
|
||||
|
@ -34,3 +37,7 @@ extern u32 omap2_memory_get_fast_dll_ctrl(void);
|
|||
extern u32 omap2_memory_get_type(void);
|
||||
u32 omap2_dll_force_needed(void);
|
||||
u32 omap2_reprogram_sdrc(u32 level, u32 force);
|
||||
void __init omap2_init_memory(void);
|
||||
void __init gpmc_init(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* linux/arch/arm/mach-omap2/mux.c
|
||||
*
|
||||
* OMAP2 pin multiplexing configurations
|
||||
* OMAP2 and OMAP3 pin multiplexing configurations
|
||||
*
|
||||
* Copyright (C) 2004 - 2008 Texas Instruments Inc.
|
||||
* Copyright (C) 2003 - 2008 Nokia Corporation
|
||||
|
@ -220,16 +220,222 @@ MUX_CFG_24XX("AD13_2430_MCBSP2_DR_OFF", 0x0131, 0, 0, 0, 1)
|
|||
#define OMAP24XX_PINS_SZ 0
|
||||
#endif /* CONFIG_ARCH_OMAP24XX */
|
||||
|
||||
#define OMAP24XX_PULL_ENA (1 << 3)
|
||||
#define OMAP24XX_PULL_UP (1 << 4)
|
||||
#ifdef CONFIG_ARCH_OMAP34XX
|
||||
static struct pin_config __initdata_or_module omap34xx_pins[] = {
|
||||
/*
|
||||
* Name, reg-offset,
|
||||
* mux-mode | [active-mode | off-mode]
|
||||
*/
|
||||
|
||||
/* 34xx I2C */
|
||||
MUX_CFG_34XX("K21_34XX_I2C1_SCL", 0x1ba,
|
||||
OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
MUX_CFG_34XX("J21_34XX_I2C1_SDA", 0x1bc,
|
||||
OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
MUX_CFG_34XX("AF15_34XX_I2C2_SCL", 0x1be,
|
||||
OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
MUX_CFG_34XX("AE15_34XX_I2C2_SDA", 0x1c0,
|
||||
OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
MUX_CFG_34XX("AF14_34XX_I2C3_SCL", 0x1c2,
|
||||
OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
MUX_CFG_34XX("AG14_34XX_I2C3_SDA", 0x1c4,
|
||||
OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
MUX_CFG_34XX("AD26_34XX_I2C4_SCL", 0xa00,
|
||||
OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
MUX_CFG_34XX("AE26_34XX_I2C4_SDA", 0xa02,
|
||||
OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
|
||||
/* PHY - HSUSB: 12-pin ULPI PHY: Port 1*/
|
||||
MUX_CFG_34XX("Y8_3430_USB1HS_PHY_CLK", 0x5da,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_OUTPUT)
|
||||
MUX_CFG_34XX("Y9_3430_USB1HS_PHY_STP", 0x5d8,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_OUTPUT)
|
||||
MUX_CFG_34XX("AA14_3430_USB1HS_PHY_DIR", 0x5ec,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AA11_3430_USB1HS_PHY_NXT", 0x5ee,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W13_3430_USB1HS_PHY_D0", 0x5dc,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W12_3430_USB1HS_PHY_D1", 0x5de,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W11_3430_USB1HS_PHY_D2", 0x5e0,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y11_3430_USB1HS_PHY_D3", 0x5ea,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W9_3430_USB1HS_PHY_D4", 0x5e4,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y12_3430_USB1HS_PHY_D5", 0x5e6,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W8_3430_USB1HS_PHY_D6", 0x5e8,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y13_3430_USB1HS_PHY_D7", 0x5e2,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
|
||||
/* PHY - HSUSB: 12-pin ULPI PHY: Port 2*/
|
||||
MUX_CFG_34XX("AA8_3430_USB2HS_PHY_CLK", 0x5f0,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_OUTPUT)
|
||||
MUX_CFG_34XX("AA10_3430_USB2HS_PHY_STP", 0x5f2,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_OUTPUT)
|
||||
MUX_CFG_34XX("AA9_3430_USB2HS_PHY_DIR", 0x5f4,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB11_3430_USB2HS_PHY_NXT", 0x5f6,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB10_3430_USB2HS_PHY_D0", 0x5f8,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB9_3430_USB2HS_PHY_D1", 0x5fa,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W3_3430_USB2HS_PHY_D2", 0x1d4,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("T4_3430_USB2HS_PHY_D3", 0x1de,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("T3_3430_USB2HS_PHY_D4", 0x1d8,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("R3_3430_USB2HS_PHY_D5", 0x1da,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("R4_3430_USB2HS_PHY_D6", 0x1dc,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("T2_3430_USB2HS_PHY_D7", 0x1d6,
|
||||
OMAP34XX_MUX_MODE3 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
|
||||
/* TLL - HSUSB: 12-pin TLL Port 1*/
|
||||
MUX_CFG_34XX("Y8_3430_USB1HS_TLL_CLK", 0x5da,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y9_3430_USB1HS_TLL_STP", 0x5d8,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
MUX_CFG_34XX("AA14_3430_USB1HS_TLL_DIR", 0x5ec,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AA11_3430_USB1HS_TLL_NXT", 0x5ee,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W13_3430_USB1HS_TLL_D0", 0x5dc,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W12_3430_USB1HS_TLL_D1", 0x5de,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W11_3430_USB1HS_TLL_D2", 0x5e0,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y11_3430_USB1HS_TLL_D3", 0x5ea,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W9_3430_USB1HS_TLL_D4", 0x5e4,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y12_3430_USB1HS_TLL_D5", 0x5e6,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W8_3430_USB1HS_TLL_D6", 0x5e8,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y13_3430_USB1HS_TLL_D7", 0x5e2,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
|
||||
/* TLL - HSUSB: 12-pin TLL Port 2*/
|
||||
MUX_CFG_34XX("AA8_3430_USB2HS_TLL_CLK", 0x5f0,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AA10_3430_USB2HS_TLL_STP", 0x5f2,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
MUX_CFG_34XX("AA9_3430_USB2HS_TLL_DIR", 0x5f4,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB11_3430_USB2HS_TLL_NXT", 0x5f6,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB10_3430_USB2HS_TLL_D0", 0x5f8,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB9_3430_USB2HS_TLL_D1", 0x5fa,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W3_3430_USB2HS_TLL_D2", 0x1d4,
|
||||
OMAP34XX_MUX_MODE2 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("T4_3430_USB2HS_TLL_D3", 0x1de,
|
||||
OMAP34XX_MUX_MODE2 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("T3_3430_USB2HS_TLL_D4", 0x1d8,
|
||||
OMAP34XX_MUX_MODE2 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("R3_3430_USB2HS_TLL_D5", 0x1da,
|
||||
OMAP34XX_MUX_MODE2 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("R4_3430_USB2HS_TLL_D6", 0x1dc,
|
||||
OMAP34XX_MUX_MODE2 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("T2_3430_USB2HS_TLL_D7", 0x1d6,
|
||||
OMAP34XX_MUX_MODE2 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
|
||||
/* TLL - HSUSB: 12-pin TLL Port 3*/
|
||||
MUX_CFG_34XX("AA6_3430_USB3HS_TLL_CLK", 0x180,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB3_3430_USB3HS_TLL_STP", 0x166,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLUP)
|
||||
MUX_CFG_34XX("AA3_3430_USB3HS_TLL_DIR", 0x168,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y3_3430_USB3HS_TLL_NXT", 0x16a,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AA5_3430_USB3HS_TLL_D0", 0x186,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y4_3430_USB3HS_TLL_D1", 0x184,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y5_3430_USB3HS_TLL_D2", 0x188,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W5_3430_USB3HS_TLL_D3", 0x18a,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB12_3430_USB3HS_TLL_D4", 0x16c,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB13_3430_USB3HS_TLL_D5", 0x16e,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AA13_3430_USB3HS_TLL_D6", 0x170,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AA12_3430_USB3HS_TLL_D7", 0x172,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
|
||||
/* PHY FSUSB: FS Serial for Port 1 (multiple PHY modes supported) */
|
||||
MUX_CFG_34XX("AF10_3430_USB1FS_PHY_MM1_RXDP", 0x5d8,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AG9_3430_USB1FS_PHY_MM1_RXDM", 0x5ee,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W13_3430_USB1FS_PHY_MM1_RXRCV", 0x5dc,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W12_3430_USB1FS_PHY_MM1_TXSE0", 0x5de,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W11_3430_USB1FS_PHY_MM1_TXDAT", 0x5e0,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("Y11_3430_USB1FS_PHY_MM1_TXEN_N", 0x5ea,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_OUTPUT)
|
||||
|
||||
/* PHY FSUSB: FS Serial for Port 2 (multiple PHY modes supported) */
|
||||
MUX_CFG_34XX("AF7_3430_USB2FS_PHY_MM2_RXDP", 0x5f2,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AH7_3430_USB2FS_PHY_MM2_RXDM", 0x5f6,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB10_3430_USB2FS_PHY_MM2_RXRCV", 0x5f8,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AB9_3430_USB2FS_PHY_MM2_TXSE0", 0x5fa,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("W3_3430_USB2FS_PHY_MM2_TXDAT", 0x1d4,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("T4_3430_USB2FS_PHY_MM2_TXEN_N", 0x1de,
|
||||
OMAP34XX_MUX_MODE5 | OMAP34XX_PIN_OUTPUT)
|
||||
|
||||
/* PHY FSUSB: FS Serial for Port 3 (multiple PHY modes supported) */
|
||||
MUX_CFG_34XX("AH3_3430_USB3FS_PHY_MM3_RXDP", 0x166,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AE3_3430_USB3FS_PHY_MM3_RXDM", 0x16a,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AD1_3430_USB3FS_PHY_MM3_RXRCV", 0x186,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AE1_3430_USB3FS_PHY_MM3_TXSE0", 0x184,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AD2_3430_USB3FS_PHY_MM3_TXDAT", 0x188,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_INPUT_PULLDOWN)
|
||||
MUX_CFG_34XX("AC1_3430_USB3FS_PHY_MM3_TXEN_N", 0x18a,
|
||||
OMAP34XX_MUX_MODE6 | OMAP34XX_PIN_OUTPUT)
|
||||
|
||||
};
|
||||
|
||||
#define OMAP34XX_PINS_SZ ARRAY_SIZE(omap34xx_pins)
|
||||
|
||||
#else
|
||||
#define omap34xx_pins NULL
|
||||
#define OMAP34XX_PINS_SZ 0
|
||||
#endif /* CONFIG_ARCH_OMAP34XX */
|
||||
|
||||
#if defined(CONFIG_OMAP_MUX_DEBUG) || defined(CONFIG_OMAP_MUX_WARNINGS)
|
||||
void __init_or_module omap2_cfg_debug(const struct pin_config *cfg, u8 reg)
|
||||
static void __init_or_module omap2_cfg_debug(const struct pin_config *cfg, u16 reg)
|
||||
{
|
||||
u16 orig;
|
||||
u8 warn = 0, debug = 0;
|
||||
|
||||
orig = omap_ctrl_readb(cfg->mux_reg);
|
||||
if (cpu_is_omap24xx())
|
||||
orig = omap_ctrl_readb(cfg->mux_reg);
|
||||
else
|
||||
orig = omap_ctrl_readw(cfg->mux_reg);
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX_DEBUG
|
||||
debug = cfg->debug;
|
||||
|
@ -255,9 +461,9 @@ int __init_or_module omap24xx_cfg_reg(const struct pin_config *cfg)
|
|||
spin_lock_irqsave(&mux_spin_lock, flags);
|
||||
reg |= cfg->mask & 0x7;
|
||||
if (cfg->pull_val)
|
||||
reg |= OMAP24XX_PULL_ENA;
|
||||
reg |= OMAP2_PULL_ENA;
|
||||
if (cfg->pu_pd_val)
|
||||
reg |= OMAP24XX_PULL_UP;
|
||||
reg |= OMAP2_PULL_UP;
|
||||
omap2_cfg_debug(cfg, reg);
|
||||
omap_ctrl_writeb(reg, cfg->mux_reg);
|
||||
spin_unlock_irqrestore(&mux_spin_lock, flags);
|
||||
|
@ -265,7 +471,26 @@ int __init_or_module omap24xx_cfg_reg(const struct pin_config *cfg)
|
|||
return 0;
|
||||
}
|
||||
#else
|
||||
#define omap24xx_cfg_reg 0
|
||||
#define omap24xx_cfg_reg NULL
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP34XX
|
||||
static int __init_or_module omap34xx_cfg_reg(const struct pin_config *cfg)
|
||||
{
|
||||
static DEFINE_SPINLOCK(mux_spin_lock);
|
||||
unsigned long flags;
|
||||
u16 reg = 0;
|
||||
|
||||
spin_lock_irqsave(&mux_spin_lock, flags);
|
||||
reg |= cfg->mux_val;
|
||||
omap2_cfg_debug(cfg, reg);
|
||||
omap_ctrl_writew(reg, cfg->mux_reg);
|
||||
spin_unlock_irqrestore(&mux_spin_lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
#define omap34xx_cfg_reg NULL
|
||||
#endif
|
||||
|
||||
int __init omap2_mux_init(void)
|
||||
|
@ -274,6 +499,10 @@ int __init omap2_mux_init(void)
|
|||
arch_mux_cfg.pins = omap24xx_pins;
|
||||
arch_mux_cfg.size = OMAP24XX_PINS_SZ;
|
||||
arch_mux_cfg.cfg_reg = omap24xx_cfg_reg;
|
||||
} else if (cpu_is_omap34xx()) {
|
||||
arch_mux_cfg.pins = omap34xx_pins;
|
||||
arch_mux_cfg.size = OMAP34XX_PINS_SZ;
|
||||
arch_mux_cfg.cfg_reg = omap34xx_cfg_reg;
|
||||
}
|
||||
|
||||
return omap_mux_register(&arch_mux_cfg);
|
||||
|
|
1113
arch/arm/mach-omap2/powerdomain.c
Normal file
1113
arch/arm/mach-omap2/powerdomain.c
Normal file
File diff suppressed because it is too large
Load diff
187
arch/arm/mach-omap2/powerdomains.h
Normal file
187
arch/arm/mach-omap2/powerdomains.h
Normal file
|
@ -0,0 +1,187 @@
|
|||
/*
|
||||
* OMAP2/3 common powerdomain definitions
|
||||
*
|
||||
* Copyright (C) 2007-8 Texas Instruments, Inc.
|
||||
* Copyright (C) 2007-8 Nokia Corporation
|
||||
*
|
||||
* Written by Paul Walmsley
|
||||
* Debugging and integration fixes by Jouni Högander
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS
|
||||
#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS
|
||||
|
||||
/*
|
||||
* This file contains all of the powerdomains that have some element
|
||||
* of software control for the OMAP24xx and OMAP34XX chips.
|
||||
*
|
||||
* A few notes:
|
||||
*
|
||||
* This is not an exhaustive listing of powerdomains on the chips; only
|
||||
* powerdomains that can be controlled in software.
|
||||
*
|
||||
* A useful validation rule for struct powerdomain:
|
||||
* Any powerdomain referenced by a wkdep_srcs or sleepdep_srcs array
|
||||
* must have a dep_bit assigned. So wkdep_srcs/sleepdep_srcs are really
|
||||
* just software-controllable dependencies. Non-software-controllable
|
||||
* dependencies do exist, but they are not encoded below (yet).
|
||||
*
|
||||
* 24xx does not support programmable sleep dependencies (SLEEPDEP)
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The names for the DSP/IVA2 powerdomains are confusing.
|
||||
*
|
||||
* Most OMAP chips have an on-board DSP.
|
||||
*
|
||||
* On the 2420, this is a 'C55 DSP called, simply, the DSP. Its
|
||||
* powerdomain is called the "DSP power domain." On the 2430, the
|
||||
* on-board DSP is a 'C64 DSP, now called the IVA2 or IVA2.1. Its
|
||||
* powerdomain is still called the "DSP power domain." On the 3430,
|
||||
* the DSP is a 'C64 DSP like the 2430, also known as the IVA2; but
|
||||
* its powerdomain is now called the "IVA2 power domain."
|
||||
*
|
||||
* The 2420 also has something called the IVA, which is a separate ARM
|
||||
* core, and has nothing to do with the DSP/IVA2.
|
||||
*
|
||||
* Ideally the DSP/IVA2 could just be the same powerdomain, but the PRCM
|
||||
* address offset is different between the C55 and C64 DSPs.
|
||||
*
|
||||
* The overly-specific dep_bit names are due to a bit name collision
|
||||
* with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift
|
||||
* value are the same for all powerdomains: 2
|
||||
*/
|
||||
|
||||
/*
|
||||
* XXX should dep_bit be a mask, so we can test to see if it is 0 as a
|
||||
* sanity check?
|
||||
* XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE
|
||||
*/
|
||||
|
||||
#include <mach/powerdomain.h>
|
||||
|
||||
#include "prcm-common.h"
|
||||
#include "prm.h"
|
||||
#include "cm.h"
|
||||
|
||||
/* OMAP2/3-common powerdomains and wakeup dependencies */
|
||||
|
||||
/*
|
||||
* 2420/2430 PM_WKDEP_GFX: CORE, MPU, WKUP
|
||||
* 3430ES1 PM_WKDEP_GFX: adds IVA2, removes CORE
|
||||
* 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE
|
||||
*/
|
||||
static struct pwrdm_dep gfx_sgx_wkdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "iva2_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
|
||||
CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "wkup_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
|
||||
CHIP_IS_OMAP3430)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
/*
|
||||
* 3430: CM_SLEEPDEP_CAM: MPU
|
||||
* 3430ES1: CM_SLEEPDEP_GFX: MPU
|
||||
* 3430ES2: CM_SLEEPDEP_SGX: MPU
|
||||
*/
|
||||
static struct pwrdm_dep cam_gfx_sleepdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
#include "powerdomains24xx.h"
|
||||
#include "powerdomains34xx.h"
|
||||
|
||||
|
||||
/*
|
||||
* OMAP2/3 common powerdomains
|
||||
*/
|
||||
|
||||
/*
|
||||
* The GFX powerdomain is not present on 3430ES2, but currently we do not
|
||||
* have a macro to filter it out at compile-time.
|
||||
*/
|
||||
static struct powerdomain gfx_pwrdm = {
|
||||
.name = "gfx_pwrdm",
|
||||
.prcm_offs = GFX_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX |
|
||||
CHIP_IS_OMAP3430ES1),
|
||||
.wkdep_srcs = gfx_sgx_wkdeps,
|
||||
.sleepdep_srcs = cam_gfx_sleepdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRDM_POWER_RET,
|
||||
.banks = 1,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRDM_POWER_RET, /* MEMRETSTATE */
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRDM_POWER_ON, /* MEMONSTATE */
|
||||
},
|
||||
};
|
||||
|
||||
static struct powerdomain wkup_pwrdm = {
|
||||
.name = "wkup_pwrdm",
|
||||
.prcm_offs = WKUP_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430),
|
||||
.dep_bit = OMAP_EN_WKUP_SHIFT,
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* As powerdomains are added or removed above, this list must also be changed */
|
||||
static struct powerdomain *powerdomains_omap[] __initdata = {
|
||||
|
||||
&gfx_pwrdm,
|
||||
&wkup_pwrdm,
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP24XX
|
||||
&dsp_pwrdm,
|
||||
&mpu_24xx_pwrdm,
|
||||
&core_24xx_pwrdm,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP2430
|
||||
&mdm_pwrdm,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP34XX
|
||||
&iva2_pwrdm,
|
||||
&mpu_34xx_pwrdm,
|
||||
&neon_pwrdm,
|
||||
&core_34xx_pwrdm,
|
||||
&cam_pwrdm,
|
||||
&dss_pwrdm,
|
||||
&per_pwrdm,
|
||||
&emu_pwrdm,
|
||||
&sgx_pwrdm,
|
||||
&usbhost_pwrdm,
|
||||
#endif
|
||||
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
#endif
|
200
arch/arm/mach-omap2/powerdomains24xx.h
Normal file
200
arch/arm/mach-omap2/powerdomains24xx.h
Normal file
|
@ -0,0 +1,200 @@
|
|||
/*
|
||||
* OMAP24XX powerdomain definitions
|
||||
*
|
||||
* Copyright (C) 2007-2008 Texas Instruments, Inc.
|
||||
* Copyright (C) 2007-2008 Nokia Corporation
|
||||
*
|
||||
* Written by Paul Walmsley
|
||||
* Debugging and integration fixes by Jouni Högander
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS24XX
|
||||
#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS24XX
|
||||
|
||||
/*
|
||||
* N.B. If powerdomains are added or removed from this file, update
|
||||
* the array in mach-omap2/powerdomains.h.
|
||||
*/
|
||||
|
||||
#include <mach/powerdomain.h>
|
||||
|
||||
#include "prcm-common.h"
|
||||
#include "prm.h"
|
||||
#include "prm-regbits-24xx.h"
|
||||
#include "cm.h"
|
||||
#include "cm-regbits-24xx.h"
|
||||
|
||||
/* 24XX powerdomains and dependencies */
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP24XX
|
||||
|
||||
|
||||
/* Wakeup dependency source arrays */
|
||||
|
||||
/*
|
||||
* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP
|
||||
* 2430 PM_WKDEP_MDM: same as above
|
||||
*/
|
||||
static struct pwrdm_dep dsp_mdm_24xx_wkdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "wkup_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
/*
|
||||
* 2420 PM_WKDEP_MPU: CORE, DSP, WKUP
|
||||
* 2430 adds MDM
|
||||
*/
|
||||
static struct pwrdm_dep mpu_24xx_wkdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "dsp_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "wkup_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "mdm_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
/*
|
||||
* 2420 PM_WKDEP_CORE: DSP, GFX, MPU, WKUP
|
||||
* 2430 adds MDM
|
||||
*/
|
||||
static struct pwrdm_dep core_24xx_wkdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "dsp_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "gfx_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "wkup_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "mdm_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
/* Powerdomains */
|
||||
|
||||
static struct powerdomain dsp_pwrdm = {
|
||||
.name = "dsp_pwrdm",
|
||||
.prcm_offs = OMAP24XX_DSP_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
|
||||
.dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT,
|
||||
.wkdep_srcs = dsp_mdm_24xx_wkdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRDM_POWER_RET,
|
||||
.banks = 1,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRDM_POWER_RET,
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRDM_POWER_ON,
|
||||
},
|
||||
};
|
||||
|
||||
static struct powerdomain mpu_24xx_pwrdm = {
|
||||
.name = "mpu_pwrdm",
|
||||
.prcm_offs = MPU_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
|
||||
.dep_bit = OMAP24XX_EN_MPU_SHIFT,
|
||||
.wkdep_srcs = mpu_24xx_wkdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRSTS_OFF_RET,
|
||||
.banks = 1,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRDM_POWER_RET,
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRDM_POWER_ON,
|
||||
},
|
||||
};
|
||||
|
||||
static struct powerdomain core_24xx_pwrdm = {
|
||||
.name = "core_pwrdm",
|
||||
.prcm_offs = CORE_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP24XX),
|
||||
.wkdep_srcs = core_24xx_wkdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.dep_bit = OMAP24XX_EN_CORE_SHIFT,
|
||||
.banks = 3,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
|
||||
[1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
|
||||
[2] = PWRSTS_OFF_RET, /* MEM3RETSTATE */
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
|
||||
[1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
|
||||
[2] = PWRSTS_OFF_RET_ON, /* MEM3ONSTATE */
|
||||
},
|
||||
};
|
||||
|
||||
#endif /* CONFIG_ARCH_OMAP24XX */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 2430-specific powerdomains
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP2430
|
||||
|
||||
/* XXX 2430 KILLDOMAINWKUP bit? No current users apparently */
|
||||
|
||||
/* Another case of bit name collisions between several registers: EN_MDM */
|
||||
static struct powerdomain mdm_pwrdm = {
|
||||
.name = "mdm_pwrdm",
|
||||
.prcm_offs = OMAP2430_MDM_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
|
||||
.dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT,
|
||||
.wkdep_srcs = dsp_mdm_24xx_wkdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRDM_POWER_RET,
|
||||
.banks = 1,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRDM_POWER_RET, /* MEMRETSTATE */
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRDM_POWER_ON, /* MEMONSTATE */
|
||||
},
|
||||
};
|
||||
|
||||
#endif /* CONFIG_ARCH_OMAP2430 */
|
||||
|
||||
|
||||
#endif
|
327
arch/arm/mach-omap2/powerdomains34xx.h
Normal file
327
arch/arm/mach-omap2/powerdomains34xx.h
Normal file
|
@ -0,0 +1,327 @@
|
|||
/*
|
||||
* OMAP34XX powerdomain definitions
|
||||
*
|
||||
* Copyright (C) 2007-2008 Texas Instruments, Inc.
|
||||
* Copyright (C) 2007-2008 Nokia Corporation
|
||||
*
|
||||
* Written by Paul Walmsley
|
||||
* Debugging and integration fixes by Jouni Högander
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ARCH_ARM_MACH_OMAP2_POWERDOMAINS34XX
|
||||
#define ARCH_ARM_MACH_OMAP2_POWERDOMAINS34XX
|
||||
|
||||
/*
|
||||
* N.B. If powerdomains are added or removed from this file, update
|
||||
* the array in mach-omap2/powerdomains.h.
|
||||
*/
|
||||
|
||||
#include <mach/powerdomain.h>
|
||||
|
||||
#include "prcm-common.h"
|
||||
#include "prm.h"
|
||||
#include "prm-regbits-34xx.h"
|
||||
#include "cm.h"
|
||||
#include "cm-regbits-34xx.h"
|
||||
|
||||
/*
|
||||
* 34XX-specific powerdomains, dependencies
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP34XX
|
||||
|
||||
/*
|
||||
* 3430: PM_WKDEP_{PER,USBHOST}: CORE, IVA2, MPU, WKUP
|
||||
* (USBHOST is ES2 only)
|
||||
*/
|
||||
static struct pwrdm_dep per_usbhost_wkdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "iva2_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "wkup_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
/*
|
||||
* 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER
|
||||
*/
|
||||
static struct pwrdm_dep mpu_34xx_wkdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "iva2_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "dss_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "per_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
/*
|
||||
* 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER
|
||||
*/
|
||||
static struct pwrdm_dep iva2_wkdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "core_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "wkup_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "dss_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "per_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
/* 3430 PM_WKDEP_{CAM,DSS}: IVA2, MPU, WKUP */
|
||||
static struct pwrdm_dep cam_dss_wkdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "iva2_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "wkup_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
/* 3430: PM_WKDEP_NEON: MPU */
|
||||
static struct pwrdm_dep neon_wkdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
/* Sleep dependency source arrays for 34xx-specific pwrdms - 34XX only */
|
||||
|
||||
/*
|
||||
* 3430: CM_SLEEPDEP_{DSS,PER}: MPU, IVA
|
||||
* 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA
|
||||
*/
|
||||
static struct pwrdm_dep dss_per_usbhost_sleepdeps[] = {
|
||||
{
|
||||
.pwrdm_name = "mpu_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{
|
||||
.pwrdm_name = "iva2_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
|
||||
},
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Powerdomains
|
||||
*/
|
||||
|
||||
static struct powerdomain iva2_pwrdm = {
|
||||
.name = "iva2_pwrdm",
|
||||
.prcm_offs = OMAP3430_IVA2_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
.dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT,
|
||||
.wkdep_srcs = iva2_wkdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRSTS_OFF_RET,
|
||||
.banks = 4,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRSTS_OFF_RET,
|
||||
[1] = PWRSTS_OFF_RET,
|
||||
[2] = PWRSTS_OFF_RET,
|
||||
[3] = PWRSTS_OFF_RET,
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRDM_POWER_ON,
|
||||
[1] = PWRDM_POWER_ON,
|
||||
[2] = PWRSTS_OFF_ON,
|
||||
[3] = PWRDM_POWER_ON,
|
||||
},
|
||||
};
|
||||
|
||||
static struct powerdomain mpu_34xx_pwrdm = {
|
||||
.name = "mpu_pwrdm",
|
||||
.prcm_offs = MPU_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
.dep_bit = OMAP3430_EN_MPU_SHIFT,
|
||||
.wkdep_srcs = mpu_34xx_wkdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRSTS_OFF_RET,
|
||||
.banks = 1,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRSTS_OFF_RET,
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_OFF_ON,
|
||||
},
|
||||
};
|
||||
|
||||
/* No wkdeps or sleepdeps for 34xx core apparently */
|
||||
static struct powerdomain core_34xx_pwrdm = {
|
||||
.name = "core_pwrdm",
|
||||
.prcm_offs = CORE_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.dep_bit = OMAP3430_EN_CORE_SHIFT,
|
||||
.banks = 2,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
|
||||
[1] = PWRSTS_OFF_RET, /* MEM2RETSTATE */
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRSTS_OFF_RET_ON, /* MEM1ONSTATE */
|
||||
[1] = PWRSTS_OFF_RET_ON, /* MEM2ONSTATE */
|
||||
},
|
||||
};
|
||||
|
||||
/* Another case of bit name collisions between several registers: EN_DSS */
|
||||
static struct powerdomain dss_pwrdm = {
|
||||
.name = "dss_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
.prcm_offs = OMAP3430_DSS_MOD,
|
||||
.dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT,
|
||||
.wkdep_srcs = cam_dss_wkdeps,
|
||||
.sleepdep_srcs = dss_per_usbhost_sleepdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRDM_POWER_RET,
|
||||
.banks = 1,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRDM_POWER_RET, /* MEMRETSTATE */
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRDM_POWER_ON, /* MEMONSTATE */
|
||||
},
|
||||
};
|
||||
|
||||
static struct powerdomain sgx_pwrdm = {
|
||||
.name = "sgx_pwrdm",
|
||||
.prcm_offs = OMAP3430ES2_SGX_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2),
|
||||
.wkdep_srcs = gfx_sgx_wkdeps,
|
||||
.sleepdep_srcs = cam_gfx_sleepdeps,
|
||||
/* XXX This is accurate for 3430 SGX, but what about GFX? */
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRDM_POWER_RET,
|
||||
.banks = 1,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRDM_POWER_RET, /* MEMRETSTATE */
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRDM_POWER_ON, /* MEMONSTATE */
|
||||
},
|
||||
};
|
||||
|
||||
static struct powerdomain cam_pwrdm = {
|
||||
.name = "cam_pwrdm",
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
.prcm_offs = OMAP3430_CAM_MOD,
|
||||
.wkdep_srcs = cam_dss_wkdeps,
|
||||
.sleepdep_srcs = cam_gfx_sleepdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRDM_POWER_RET,
|
||||
.banks = 1,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRDM_POWER_RET, /* MEMRETSTATE */
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRDM_POWER_ON, /* MEMONSTATE */
|
||||
},
|
||||
};
|
||||
|
||||
static struct powerdomain per_pwrdm = {
|
||||
.name = "per_pwrdm",
|
||||
.prcm_offs = OMAP3430_PER_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
.dep_bit = OMAP3430_EN_PER_SHIFT,
|
||||
.wkdep_srcs = per_usbhost_wkdeps,
|
||||
.sleepdep_srcs = dss_per_usbhost_sleepdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRSTS_OFF_RET,
|
||||
.banks = 1,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRDM_POWER_RET, /* MEMRETSTATE */
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRDM_POWER_ON, /* MEMONSTATE */
|
||||
},
|
||||
};
|
||||
|
||||
static struct powerdomain emu_pwrdm = {
|
||||
.name = "emu_pwrdm",
|
||||
.prcm_offs = OMAP3430_EMU_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
};
|
||||
|
||||
static struct powerdomain neon_pwrdm = {
|
||||
.name = "neon_pwrdm",
|
||||
.prcm_offs = OMAP3430_NEON_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
|
||||
.wkdep_srcs = neon_wkdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRDM_POWER_RET,
|
||||
};
|
||||
|
||||
static struct powerdomain usbhost_pwrdm = {
|
||||
.name = "usbhost_pwrdm",
|
||||
.prcm_offs = OMAP3430ES2_USBHOST_MOD,
|
||||
.omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430ES2),
|
||||
.wkdep_srcs = per_usbhost_wkdeps,
|
||||
.sleepdep_srcs = dss_per_usbhost_sleepdeps,
|
||||
.pwrsts = PWRSTS_OFF_RET_ON,
|
||||
.pwrsts_logic_ret = PWRDM_POWER_RET,
|
||||
.banks = 1,
|
||||
.pwrsts_mem_ret = {
|
||||
[0] = PWRDM_POWER_RET, /* MEMRETSTATE */
|
||||
},
|
||||
.pwrsts_mem_on = {
|
||||
[0] = PWRDM_POWER_ON, /* MEMONSTATE */
|
||||
},
|
||||
};
|
||||
|
||||
#endif /* CONFIG_ARCH_OMAP34XX */
|
||||
|
||||
|
||||
#endif
|
|
@ -312,7 +312,8 @@
|
|||
#define OMAP3430_ST_GPT2 (1 << 3)
|
||||
|
||||
/* CM_SLEEPDEP_PER, PM_WKDEP_IVA2, PM_WKDEP_MPU, PM_WKDEP_PER shared bits */
|
||||
#define OMAP3430_EN_CORE (1 << 0)
|
||||
#define OMAP3430_EN_CORE_SHIFT 0
|
||||
#define OMAP3430_EN_CORE_MASK (1 << 0)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -29,8 +29,10 @@
|
|||
#define OMAP24XX_WKUP1_EN (1 << 0)
|
||||
|
||||
/* PM_WKDEP_GFX, PM_WKDEP_MPU, PM_WKDEP_DSP, PM_WKDEP_MDM shared bits */
|
||||
#define OMAP24XX_EN_MPU (1 << 1)
|
||||
#define OMAP24XX_EN_CORE (1 << 0)
|
||||
#define OMAP24XX_EN_MPU_SHIFT 1
|
||||
#define OMAP24XX_EN_MPU_MASK (1 << 1)
|
||||
#define OMAP24XX_EN_CORE_SHIFT 0
|
||||
#define OMAP24XX_EN_CORE_MASK (1 << 0)
|
||||
|
||||
/*
|
||||
* PM_PWSTCTRL_MPU, PM_PWSTCTRL_GFX, PM_PWSTCTRL_DSP, PM_PWSTCTRL_MDM
|
||||
|
@ -140,8 +142,10 @@
|
|||
/* 2430 calls GLOBALWMPU_RST "GLOBALWARM_RST" instead */
|
||||
|
||||
/* PM_WKDEP_MPU specific bits */
|
||||
#define OMAP2430_PM_WKDEP_MPU_EN_MDM (1 << 5)
|
||||
#define OMAP24XX_PM_WKDEP_MPU_EN_DSP (1 << 2)
|
||||
#define OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT 5
|
||||
#define OMAP2430_PM_WKDEP_MPU_EN_MDM_MASK (1 << 5)
|
||||
#define OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT 2
|
||||
#define OMAP24XX_PM_WKDEP_MPU_EN_DSP_MASK (1 << 2)
|
||||
|
||||
/* PM_EVGENCTRL_MPU specific bits */
|
||||
|
||||
|
|
|
@ -68,7 +68,8 @@
|
|||
#define OMAP3430_VPINIDLE (1 << 0)
|
||||
|
||||
/* PM_WKDEP_IVA2, PM_WKDEP_MPU shared bits */
|
||||
#define OMAP3430_EN_PER (1 << 7)
|
||||
#define OMAP3430_EN_PER_SHIFT 7
|
||||
#define OMAP3430_EN_PER_MASK (1 << 7)
|
||||
|
||||
/* PM_PWSTCTRL_IVA2, PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE shared bits */
|
||||
#define OMAP3430_MEMORYCHANGE (1 << 3)
|
||||
|
@ -77,7 +78,7 @@
|
|||
#define OMAP3430_LOGICSTATEST (1 << 2)
|
||||
|
||||
/* PM_PREPWSTST_IVA2, PM_PREPWSTST_CORE shared bits */
|
||||
#define OMAP3430_LASTLOGICSTATEENTERED (1 << 2)
|
||||
#define OMAP3430_LASTLOGICSTATEENTERED (1 << 2)
|
||||
|
||||
/*
|
||||
* PM_PREPWSTST_IVA2, PM_PREPWSTST_MPU, PM_PREPWSTST_CORE,
|
||||
|
@ -278,8 +279,10 @@
|
|||
#define OMAP3430_EMULATION_MPU_RST (1 << 11)
|
||||
|
||||
/* PM_WKDEP_MPU specific bits */
|
||||
#define OMAP3430_PM_WKDEP_MPU_EN_DSS (1 << 5)
|
||||
#define OMAP3430_PM_WKDEP_MPU_EN_IVA2 (1 << 2)
|
||||
#define OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT 5
|
||||
#define OMAP3430_PM_WKDEP_MPU_EN_DSS_MASK (1 << 5)
|
||||
#define OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT 2
|
||||
#define OMAP3430_PM_WKDEP_MPU_EN_IVA2_MASK (1 << 2)
|
||||
|
||||
/* PM_EVGENCTRL_MPU */
|
||||
#define OMAP3430_OFFLOADMODE_SHIFT 3
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#ifndef __ASSEMBLER__
|
||||
#define OMAP_PRM_REGADDR(module, reg) \
|
||||
(void __iomem *)IO_ADDRESS(OMAP2_PRM_BASE + (module) + (reg))
|
||||
IO_ADDRESS(OMAP2_PRM_BASE + (module) + (reg))
|
||||
#else
|
||||
#define OMAP2420_PRM_REGADDR(module, reg) \
|
||||
IO_ADDRESS(OMAP2420_PRM_BASE + (module) + (reg))
|
||||
|
@ -305,7 +305,8 @@ static inline u32 prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx)
|
|||
* 3430: PM_WKDEP_IVA2, PM_WKDEP_GFX, PM_WKDEP_DSS, PM_WKDEP_CAM,
|
||||
* PM_WKDEP_PER
|
||||
*/
|
||||
#define OMAP_EN_WKUP (1 << 4)
|
||||
#define OMAP_EN_WKUP_SHIFT 4
|
||||
#define OMAP_EN_WKUP_MASK (1 << 4)
|
||||
|
||||
/*
|
||||
* 24XX: PM_PWSTCTRL_MPU, PM_PWSTCTRL_CORE, PM_PWSTCTRL_GFX,
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* OMAP2 serial support.
|
||||
*
|
||||
* Copyright (C) 2005 Nokia Corporation
|
||||
* Copyright (C) 2005-2008 Nokia Corporation
|
||||
* Author: Paul Mundt <paul.mundt@nokia.com>
|
||||
*
|
||||
* Based off of arch/arm/mach-omap/omap1/serial.c
|
||||
|
@ -22,38 +22,34 @@
|
|||
#include <mach/common.h>
|
||||
#include <mach/board.h>
|
||||
|
||||
static struct clk * uart1_ick = NULL;
|
||||
static struct clk * uart1_fck = NULL;
|
||||
static struct clk * uart2_ick = NULL;
|
||||
static struct clk * uart2_fck = NULL;
|
||||
static struct clk * uart3_ick = NULL;
|
||||
static struct clk * uart3_fck = NULL;
|
||||
static struct clk *uart_ick[OMAP_MAX_NR_PORTS];
|
||||
static struct clk *uart_fck[OMAP_MAX_NR_PORTS];
|
||||
|
||||
static struct plat_serial8250_port serial_platform_data[] = {
|
||||
{
|
||||
.membase = (char *)IO_ADDRESS(OMAP_UART1_BASE),
|
||||
.mapbase = (unsigned long)OMAP_UART1_BASE,
|
||||
.membase = IO_ADDRESS(OMAP_UART1_BASE),
|
||||
.mapbase = OMAP_UART1_BASE,
|
||||
.irq = 72,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.iotype = UPIO_MEM,
|
||||
.regshift = 2,
|
||||
.uartclk = OMAP16XX_BASE_BAUD * 16,
|
||||
.uartclk = OMAP24XX_BASE_BAUD * 16,
|
||||
}, {
|
||||
.membase = (char *)IO_ADDRESS(OMAP_UART2_BASE),
|
||||
.mapbase = (unsigned long)OMAP_UART2_BASE,
|
||||
.membase = IO_ADDRESS(OMAP_UART2_BASE),
|
||||
.mapbase = OMAP_UART2_BASE,
|
||||
.irq = 73,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.iotype = UPIO_MEM,
|
||||
.regshift = 2,
|
||||
.uartclk = OMAP16XX_BASE_BAUD * 16,
|
||||
.uartclk = OMAP24XX_BASE_BAUD * 16,
|
||||
}, {
|
||||
.membase = (char *)IO_ADDRESS(OMAP_UART3_BASE),
|
||||
.mapbase = (unsigned long)OMAP_UART3_BASE,
|
||||
.membase = IO_ADDRESS(OMAP_UART3_BASE),
|
||||
.mapbase = OMAP_UART3_BASE,
|
||||
.irq = 74,
|
||||
.flags = UPF_BOOT_AUTOCONF,
|
||||
.iotype = UPIO_MEM,
|
||||
.regshift = 2,
|
||||
.uartclk = OMAP16XX_BASE_BAUD * 16,
|
||||
.uartclk = OMAP24XX_BASE_BAUD * 16,
|
||||
}, {
|
||||
.flags = 0
|
||||
}
|
||||
|
@ -70,7 +66,7 @@ static inline void serial_write_reg(struct plat_serial8250_port *p, int offset,
|
|||
int value)
|
||||
{
|
||||
offset <<= p->regshift;
|
||||
__raw_writeb(value, (unsigned long)(p->membase + offset));
|
||||
__raw_writeb(value, p->membase + offset);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -86,10 +82,27 @@ static inline void __init omap_serial_reset(struct plat_serial8250_port *p)
|
|||
serial_write_reg(p, UART_OMAP_SYSC, (0x02 << 3) | (1 << 2) | (1 << 0));
|
||||
}
|
||||
|
||||
void __init omap_serial_init()
|
||||
void omap_serial_enable_clocks(int enable)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OMAP_MAX_NR_PORTS; i++) {
|
||||
if (uart_ick[i] && uart_fck[i]) {
|
||||
if (enable) {
|
||||
clk_enable(uart_ick[i]);
|
||||
clk_enable(uart_fck[i]);
|
||||
} else {
|
||||
clk_disable(uart_ick[i]);
|
||||
clk_disable(uart_fck[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void __init omap_serial_init(void)
|
||||
{
|
||||
int i;
|
||||
const struct omap_uart_config *info;
|
||||
char name[16];
|
||||
|
||||
/*
|
||||
* Make sure the serial ports are muxed on at this point.
|
||||
|
@ -97,8 +110,7 @@ void __init omap_serial_init()
|
|||
* if not needed.
|
||||
*/
|
||||
|
||||
info = omap_get_config(OMAP_TAG_UART,
|
||||
struct omap_uart_config);
|
||||
info = omap_get_config(OMAP_TAG_UART, struct omap_uart_config);
|
||||
|
||||
if (info == NULL)
|
||||
return;
|
||||
|
@ -107,58 +119,26 @@ void __init omap_serial_init()
|
|||
struct plat_serial8250_port *p = serial_platform_data + i;
|
||||
|
||||
if (!(info->enabled_uarts & (1 << i))) {
|
||||
p->membase = 0;
|
||||
p->membase = NULL;
|
||||
p->mapbase = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
uart1_ick = clk_get(NULL, "uart1_ick");
|
||||
if (IS_ERR(uart1_ick))
|
||||
printk("Could not get uart1_ick\n");
|
||||
else {
|
||||
clk_enable(uart1_ick);
|
||||
}
|
||||
sprintf(name, "uart%d_ick", i+1);
|
||||
uart_ick[i] = clk_get(NULL, name);
|
||||
if (IS_ERR(uart_ick[i])) {
|
||||
printk(KERN_ERR "Could not get uart%d_ick\n", i+1);
|
||||
uart_ick[i] = NULL;
|
||||
} else
|
||||
clk_enable(uart_ick[i]);
|
||||
|
||||
uart1_fck = clk_get(NULL, "uart1_fck");
|
||||
if (IS_ERR(uart1_fck))
|
||||
printk("Could not get uart1_fck\n");
|
||||
else {
|
||||
clk_enable(uart1_fck);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
uart2_ick = clk_get(NULL, "uart2_ick");
|
||||
if (IS_ERR(uart2_ick))
|
||||
printk("Could not get uart2_ick\n");
|
||||
else {
|
||||
clk_enable(uart2_ick);
|
||||
}
|
||||
|
||||
uart2_fck = clk_get(NULL, "uart2_fck");
|
||||
if (IS_ERR(uart2_fck))
|
||||
printk("Could not get uart2_fck\n");
|
||||
else {
|
||||
clk_enable(uart2_fck);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
uart3_ick = clk_get(NULL, "uart3_ick");
|
||||
if (IS_ERR(uart3_ick))
|
||||
printk("Could not get uart3_ick\n");
|
||||
else {
|
||||
clk_enable(uart3_ick);
|
||||
}
|
||||
|
||||
uart3_fck = clk_get(NULL, "uart3_fck");
|
||||
if (IS_ERR(uart3_fck))
|
||||
printk("Could not get uart3_fck\n");
|
||||
else {
|
||||
clk_enable(uart3_fck);
|
||||
}
|
||||
break;
|
||||
}
|
||||
sprintf(name, "uart%d_fck", i+1);
|
||||
uart_fck[i] = clk_get(NULL, name);
|
||||
if (IS_ERR(uart_fck[i])) {
|
||||
printk(KERN_ERR "Could not get uart%d_fck\n", i+1);
|
||||
uart_fck[i] = NULL;
|
||||
} else
|
||||
clk_enable(uart_fck[i]);
|
||||
|
||||
omap_serial_reset(p);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
* Texas Instruments, <www.ti.com>
|
||||
* Richard Woodruff <r-woodruff2@ti.com>
|
||||
*
|
||||
* (C) Copyright 2006 Nokia Corporation
|
||||
* Fixed idle loop sleep
|
||||
* Igor Stoppa <igor.stoppa@nokia.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
|
@ -26,6 +30,8 @@
|
|||
#include <mach/io.h>
|
||||
#include <mach/pm.h>
|
||||
|
||||
#include <mach/omap24xx.h>
|
||||
|
||||
#include "sdrc.h"
|
||||
|
||||
/* First address of reserved address space? apparently valid for OMAP2 & 3 */
|
||||
|
@ -52,15 +58,14 @@ ENTRY(omap24xx_idle_loop_suspend_sz)
|
|||
.word . - omap24xx_idle_loop_suspend
|
||||
|
||||
/*
|
||||
* omap242x_cpu_suspend() - Forces OMAP into deep sleep state by completing
|
||||
* omap24xx_cpu_suspend() - Forces OMAP into deep sleep state by completing
|
||||
* SDRC shutdown then ARM shutdown. Upon wake MPU is back on so just restore
|
||||
* SDRC.
|
||||
*
|
||||
* Input:
|
||||
* R0 : DLL ctrl value pre-Sleep
|
||||
* R1 : Processor+Revision
|
||||
* 2420: 0x21 = 242xES1, 0x26 = 242xES2.2
|
||||
* 2430: 0x31 = 2430ES1, 0x32 = 2430ES2
|
||||
* R1 : SDRC_DLLA_CTRL
|
||||
* R2 : SDRC_POWER
|
||||
*
|
||||
* The if the DPLL is going to AutoIdle. It seems like the DPLL may be back on
|
||||
* when we get called, but the DLL probably isn't. We will wait a bit more in
|
||||
|
@ -80,15 +85,14 @@ ENTRY(omap24xx_idle_loop_suspend_sz)
|
|||
*/
|
||||
ENTRY(omap24xx_cpu_suspend)
|
||||
stmfd sp!, {r0 - r12, lr} @ save registers on stack
|
||||
mov r3, #0x0 @ clear for mrc call
|
||||
mov r3, #0x0 @ clear for mcr call
|
||||
mcr p15, 0, r3, c7, c10, 4 @ memory barrier, hope SDR/DDR finished
|
||||
nop
|
||||
nop
|
||||
ldr r3, A_SDRC_POWER @ addr of sdrc power
|
||||
ldr r4, [r3] @ value of sdrc power
|
||||
ldr r4, [r2] @ read SDRC_POWER
|
||||
orr r4, r4, #0x40 @ enable self refresh on idle req
|
||||
mov r5, #0x2000 @ set delay (DPLL relock + DLL relock)
|
||||
str r4, [r3] @ make it so
|
||||
str r4, [r2] @ make it so
|
||||
mov r2, #0
|
||||
nop
|
||||
mcr p15, 0, r2, c7, c0, 4 @ wait for interrupt
|
||||
|
@ -97,14 +101,13 @@ loop:
|
|||
subs r5, r5, #0x1 @ awake, wait just a bit
|
||||
bne loop
|
||||
|
||||
/* The DPLL has on before we take the DDR out of self refresh */
|
||||
/* The DPLL has to be on before we take the DDR out of self refresh */
|
||||
bic r4, r4, #0x40 @ now clear self refresh bit.
|
||||
str r4, [r3] @ put vlaue back.
|
||||
str r4, [r2] @ write to SDRC_POWER
|
||||
ldr r4, A_SDRC0 @ make a clock happen
|
||||
ldr r4, [r4]
|
||||
ldr r4, [r4] @ read A_SDRC0
|
||||
nop @ start auto refresh only after clk ok
|
||||
movs r0, r0 @ see if DDR or SDR
|
||||
ldrne r1, A_SDRC_DLLA_CTRL_S @ get addr of DLL ctrl
|
||||
strne r0, [r1] @ rewrite DLLA to force DLL reload
|
||||
addne r1, r1, #0x8 @ move to DLLB
|
||||
strne r0, [r1] @ rewrite DLLB to force DLL reload
|
||||
|
@ -116,13 +119,8 @@ loop2:
|
|||
/* resume*/
|
||||
ldmfd sp!, {r0 - r12, pc} @ restore regs and return
|
||||
|
||||
A_SDRC_POWER:
|
||||
.word OMAP242X_SDRC_REGADDR(SDRC_POWER)
|
||||
A_SDRC0:
|
||||
.word A_SDRC0_V
|
||||
A_SDRC_DLLA_CTRL_S:
|
||||
.word OMAP242X_SDRC_REGADDR(SDRC_DLLA_CTRL)
|
||||
|
||||
ENTRY(omap24xx_cpu_suspend_sz)
|
||||
.word . - omap24xx_cpu_suspend
|
||||
|
179
arch/arm/mach-omap2/sram34xx.S
Normal file
179
arch/arm/mach-omap2/sram34xx.S
Normal file
|
@ -0,0 +1,179 @@
|
|||
/*
|
||||
* linux/arch/arm/mach-omap3/sram.S
|
||||
*
|
||||
* Omap3 specific functions that need to be run in internal SRAM
|
||||
*
|
||||
* (C) Copyright 2007
|
||||
* Texas Instruments Inc.
|
||||
* Rajendra Nayak <rnayak@ti.com>
|
||||
*
|
||||
* (C) Copyright 2004
|
||||
* Texas Instruments, <www.ti.com>
|
||||
* Richard Woodruff <r-woodruff2@ti.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR /PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*/
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/assembler.h>
|
||||
#include <mach/hardware.h>
|
||||
|
||||
#include <mach/io.h>
|
||||
|
||||
#include "sdrc.h"
|
||||
#include "cm.h"
|
||||
|
||||
.text
|
||||
|
||||
/*
|
||||
* Change frequency of core dpll
|
||||
* r0 = sdrc_rfr_ctrl r1 = sdrc_actim_ctrla r2 = sdrc_actim_ctrlb r3 = M2
|
||||
*/
|
||||
ENTRY(omap3_sram_configure_core_dpll)
|
||||
stmfd sp!, {r1-r12, lr} @ store regs to stack
|
||||
cmp r3, #0x2
|
||||
blne configure_sdrc
|
||||
cmp r3, #0x2
|
||||
blne lock_dll
|
||||
cmp r3, #0x1
|
||||
blne unlock_dll
|
||||
bl sdram_in_selfrefresh @ put the SDRAM in self refresh
|
||||
bl configure_core_dpll
|
||||
bl enable_sdrc
|
||||
cmp r3, #0x1
|
||||
blne wait_dll_unlock
|
||||
cmp r3, #0x2
|
||||
blne wait_dll_lock
|
||||
cmp r3, #0x1
|
||||
blne configure_sdrc
|
||||
mov r0, #0 @ return value
|
||||
ldmfd sp!, {r1-r12, pc} @ restore regs and return
|
||||
unlock_dll:
|
||||
ldr r4, omap3_sdrc_dlla_ctrl
|
||||
ldr r5, [r4]
|
||||
orr r5, r5, #0x4
|
||||
str r5, [r4]
|
||||
bx lr
|
||||
lock_dll:
|
||||
ldr r4, omap3_sdrc_dlla_ctrl
|
||||
ldr r5, [r4]
|
||||
bic r5, r5, #0x4
|
||||
str r5, [r4]
|
||||
bx lr
|
||||
sdram_in_selfrefresh:
|
||||
mov r5, #0x0 @ Move 0 to R5
|
||||
mcr p15, 0, r5, c7, c10, 5 @ memory barrier
|
||||
ldr r4, omap3_sdrc_power @ read the SDRC_POWER register
|
||||
ldr r5, [r4] @ read the contents of SDRC_POWER
|
||||
orr r5, r5, #0x40 @ enable self refresh on idle req
|
||||
str r5, [r4] @ write back to SDRC_POWER register
|
||||
ldr r4, omap3_cm_iclken1_core @ read the CM_ICLKEN1_CORE reg
|
||||
ldr r5, [r4]
|
||||
bic r5, r5, #0x2 @ disable iclk bit for SRDC
|
||||
str r5, [r4]
|
||||
wait_sdrc_idle:
|
||||
ldr r4, omap3_cm_idlest1_core
|
||||
ldr r5, [r4]
|
||||
and r5, r5, #0x2 @ check for SDRC idle
|
||||
cmp r5, #2
|
||||
bne wait_sdrc_idle
|
||||
bx lr
|
||||
configure_core_dpll:
|
||||
ldr r4, omap3_cm_clksel1_pll
|
||||
ldr r5, [r4]
|
||||
ldr r6, core_m2_mask_val @ modify m2 for core dpll
|
||||
and r5, r5, r6
|
||||
orr r5, r5, r3, lsl #0x1B @ r3 contains the M2 val
|
||||
str r5, [r4]
|
||||
mov r5, #0x800 @ wait for the clock to stabilise
|
||||
cmp r3, #2
|
||||
bne wait_clk_stable
|
||||
bx lr
|
||||
wait_clk_stable:
|
||||
subs r5, r5, #1
|
||||
bne wait_clk_stable
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
bx lr
|
||||
enable_sdrc:
|
||||
ldr r4, omap3_cm_iclken1_core
|
||||
ldr r5, [r4]
|
||||
orr r5, r5, #0x2 @ enable iclk bit for SDRC
|
||||
str r5, [r4]
|
||||
wait_sdrc_idle1:
|
||||
ldr r4, omap3_cm_idlest1_core
|
||||
ldr r5, [r4]
|
||||
and r5, r5, #0x2
|
||||
cmp r5, #0
|
||||
bne wait_sdrc_idle1
|
||||
ldr r4, omap3_sdrc_power
|
||||
ldr r5, [r4]
|
||||
bic r5, r5, #0x40
|
||||
str r5, [r4]
|
||||
bx lr
|
||||
wait_dll_lock:
|
||||
ldr r4, omap3_sdrc_dlla_status
|
||||
ldr r5, [r4]
|
||||
and r5, r5, #0x4
|
||||
cmp r5, #0x4
|
||||
bne wait_dll_lock
|
||||
bx lr
|
||||
wait_dll_unlock:
|
||||
ldr r4, omap3_sdrc_dlla_status
|
||||
ldr r5, [r4]
|
||||
and r5, r5, #0x4
|
||||
cmp r5, #0x0
|
||||
bne wait_dll_unlock
|
||||
bx lr
|
||||
configure_sdrc:
|
||||
ldr r4, omap3_sdrc_rfr_ctrl
|
||||
str r0, [r4]
|
||||
ldr r4, omap3_sdrc_actim_ctrla
|
||||
str r1, [r4]
|
||||
ldr r4, omap3_sdrc_actim_ctrlb
|
||||
str r2, [r4]
|
||||
bx lr
|
||||
|
||||
omap3_sdrc_power:
|
||||
.word OMAP34XX_SDRC_REGADDR(SDRC_POWER)
|
||||
omap3_cm_clksel1_pll:
|
||||
.word OMAP34XX_CM_REGADDR(PLL_MOD, CM_CLKSEL1)
|
||||
omap3_cm_idlest1_core:
|
||||
.word OMAP34XX_CM_REGADDR(CORE_MOD, CM_IDLEST)
|
||||
omap3_cm_iclken1_core:
|
||||
.word OMAP34XX_CM_REGADDR(CORE_MOD, CM_ICLKEN1)
|
||||
omap3_sdrc_rfr_ctrl:
|
||||
.word OMAP34XX_SDRC_REGADDR(SDRC_RFR_CTRL_0)
|
||||
omap3_sdrc_actim_ctrla:
|
||||
.word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_A_0)
|
||||
omap3_sdrc_actim_ctrlb:
|
||||
.word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_B_0)
|
||||
omap3_sdrc_dlla_status:
|
||||
.word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS)
|
||||
omap3_sdrc_dlla_ctrl:
|
||||
.word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_CTRL)
|
||||
core_m2_mask_val:
|
||||
.word 0x07FFFFFF
|
||||
|
||||
ENTRY(omap3_sram_configure_core_dpll_sz)
|
||||
.word . - omap3_sram_configure_core_dpll
|
|
@ -162,7 +162,7 @@ static void __init cmx270_init_rtc(void)
|
|||
platform_device_register(&cmx270_rtc_device);
|
||||
}
|
||||
#else
|
||||
static inline void cmx2xx_init_rtc(void) {}
|
||||
static inline void cmx270_init_rtc(void) {}
|
||||
#endif
|
||||
|
||||
/* 2700G graphics */
|
||||
|
|
|
@ -204,25 +204,54 @@ static void viper_set_core_cpu_voltage(unsigned long khz, int force)
|
|||
|
||||
/* Interrupt handling */
|
||||
static unsigned long viper_irq_enabled_mask;
|
||||
static const int viper_isa_irqs[] = { 3, 4, 5, 6, 7, 10, 11, 12, 9, 14, 15 };
|
||||
static const int viper_isa_irq_map[] = {
|
||||
0, /* ISA irq #0, invalid */
|
||||
0, /* ISA irq #1, invalid */
|
||||
0, /* ISA irq #2, invalid */
|
||||
1 << 0, /* ISA irq #3 */
|
||||
1 << 1, /* ISA irq #4 */
|
||||
1 << 2, /* ISA irq #5 */
|
||||
1 << 3, /* ISA irq #6 */
|
||||
1 << 4, /* ISA irq #7 */
|
||||
0, /* ISA irq #8, invalid */
|
||||
1 << 8, /* ISA irq #9 */
|
||||
1 << 5, /* ISA irq #10 */
|
||||
1 << 6, /* ISA irq #11 */
|
||||
1 << 7, /* ISA irq #12 */
|
||||
0, /* ISA irq #13, invalid */
|
||||
1 << 9, /* ISA irq #14 */
|
||||
1 << 10, /* ISA irq #15 */
|
||||
};
|
||||
|
||||
static inline int viper_irq_to_bitmask(unsigned int irq)
|
||||
{
|
||||
return viper_isa_irq_map[irq - PXA_ISA_IRQ(0)];
|
||||
}
|
||||
|
||||
static inline int viper_bit_to_irq(int bit)
|
||||
{
|
||||
return viper_isa_irqs[bit] + PXA_ISA_IRQ(0);
|
||||
}
|
||||
|
||||
static void viper_ack_irq(unsigned int irq)
|
||||
{
|
||||
int viper_irq = irq - PXA_ISA_IRQ(0);
|
||||
int viper_irq = viper_irq_to_bitmask(irq);
|
||||
|
||||
if (viper_irq < 8)
|
||||
VIPER_LO_IRQ_STATUS = 1 << viper_irq;
|
||||
if (viper_irq & 0xff)
|
||||
VIPER_LO_IRQ_STATUS = viper_irq;
|
||||
else
|
||||
VIPER_HI_IRQ_STATUS = 1 << (viper_irq - 8);
|
||||
VIPER_HI_IRQ_STATUS = (viper_irq >> 8);
|
||||
}
|
||||
|
||||
static void viper_mask_irq(unsigned int irq)
|
||||
{
|
||||
viper_irq_enabled_mask &= ~(1 << (irq - PXA_ISA_IRQ(0)));
|
||||
viper_irq_enabled_mask &= ~(viper_irq_to_bitmask(irq));
|
||||
}
|
||||
|
||||
static void viper_unmask_irq(unsigned int irq)
|
||||
{
|
||||
viper_irq_enabled_mask |= (1 << (irq - PXA_ISA_IRQ(0)));
|
||||
viper_irq_enabled_mask |= viper_irq_to_bitmask(irq);
|
||||
}
|
||||
|
||||
static inline unsigned long viper_irq_pending(void)
|
||||
|
@ -237,8 +266,12 @@ static void viper_irq_handler(unsigned int irq, struct irq_desc *desc)
|
|||
|
||||
pending = viper_irq_pending();
|
||||
do {
|
||||
/* we're in a chained irq handler,
|
||||
* so ack the interrupt by hand */
|
||||
GEDR(VIPER_CPLD_GPIO) = GPIO_bit(VIPER_CPLD_GPIO);
|
||||
|
||||
if (likely(pending)) {
|
||||
irq = PXA_ISA_IRQ(0) + __ffs(pending);
|
||||
irq = viper_bit_to_irq(__ffs(pending));
|
||||
generic_handle_irq(irq);
|
||||
}
|
||||
pending = viper_irq_pending();
|
||||
|
@ -254,15 +287,14 @@ static struct irq_chip viper_irq_chip = {
|
|||
|
||||
static void __init viper_init_irq(void)
|
||||
{
|
||||
const int isa_irqs[] = { 3, 4, 5, 6, 7, 10, 11, 12, 9, 14, 15 };
|
||||
int irq;
|
||||
int level;
|
||||
int isa_irq;
|
||||
|
||||
pxa25x_init_irq();
|
||||
|
||||
/* setup ISA IRQs */
|
||||
for (irq = 0; irq < ARRAY_SIZE(isa_irqs); irq++) {
|
||||
isa_irq = isa_irqs[irq];
|
||||
for (level = 0; level < ARRAY_SIZE(viper_isa_irqs); level++) {
|
||||
isa_irq = viper_bit_to_irq(level);
|
||||
set_irq_chip(isa_irq, &viper_irq_chip);
|
||||
set_irq_handler(isa_irq, handle_edge_irq);
|
||||
set_irq_flags(isa_irq, IRQF_VALID | IRQF_PROBE);
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <mach/bast-map.h>
|
||||
#include <mach/bast-irq.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/irq.h>
|
||||
#include <plat/irq.h>
|
||||
|
||||
#if 0
|
||||
#include <asm/debug-ll.h>
|
||||
|
|
|
@ -37,13 +37,13 @@
|
|||
|
||||
#include <mach/hardware.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-clock.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2410.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2410.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
int s3c2410_clkcon_enable(struct clk *clk, int enable)
|
||||
{
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
#include <asm/dma.h>
|
||||
#include <mach/dma.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/dma.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/dma.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <asm/plat-s3c/regs-ac97.h>
|
||||
#include <mach/regs-mem.h>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include <mach/map.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
|
||||
#define S3C2410_UART1_OFF (0x4000)
|
||||
#define SHIFT_2440TXF (14-9)
|
||||
|
@ -99,4 +99,4 @@
|
|||
|
||||
/* include the reset of the code which will do the work */
|
||||
|
||||
#include <asm/plat-s3c/debug-macro.S>
|
||||
#include <plat/debug-macro.S>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#ifndef __ASM_ARCH_MAP_H
|
||||
#define __ASM_ARCH_MAP_H
|
||||
|
||||
#include <asm/plat-s3c/map.h>
|
||||
#include <plat/map.h>
|
||||
|
||||
#define S3C2410_ADDR(x) S3C_ADDR(x)
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#undef S3C2410_GPIOREG
|
||||
#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x)))
|
||||
|
||||
#include <asm/plat-s3c/uncompress.h>
|
||||
#include <plat/uncompress.h>
|
||||
|
||||
static inline int is_arm926(void)
|
||||
{
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
#include <linux/ioport.h>
|
||||
#include <linux/sysdev.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/pm.h>
|
||||
|
||||
static int s3c2410_irq_add(struct sys_device *sysdev)
|
||||
{
|
||||
|
|
|
@ -48,12 +48,12 @@
|
|||
#include <asm/mach-types.h>
|
||||
#include <mach/fb.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#ifdef CONFIG_MTD_PARTITIONS
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
#include <asm/mach-types.h>
|
||||
|
||||
//#include <asm/debug-ll.h>
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-mem.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
|
@ -55,9 +55,9 @@
|
|||
|
||||
#include <linux/serial_8250.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include "usb-simtec.h"
|
||||
#include "nor-simtec.h"
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-clock.h>
|
||||
|
@ -40,10 +40,10 @@
|
|||
#include <mach/fb.h>
|
||||
#include <asm/plat-s3c24xx/udc.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/pm.h>
|
||||
|
||||
static struct map_desc h1940_iodesc[] __initdata = {
|
||||
[0] = {
|
||||
|
|
|
@ -41,12 +41,12 @@
|
|||
#include <asm/mach/map.h>
|
||||
|
||||
#include <asm/plat-s3c/iic.h>
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/s3c2410.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/s3c2410.h>
|
||||
#include <asm/plat-s3c24xx/udc.h>
|
||||
|
||||
static struct map_desc n30_iodesc[] __initdata = {
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2410.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2410.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
static struct map_desc otom11_iodesc[] __initdata = {
|
||||
/* Device area */
|
||||
|
|
|
@ -48,17 +48,17 @@
|
|||
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/leds-gpio.h>
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/fb.h>
|
||||
#include <asm/plat-s3c/nand.h>
|
||||
#include <asm/plat-s3c24xx/udc.h>
|
||||
#include <mach/spi.h>
|
||||
#include <mach/spi-gpio.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/common-smdk.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <plat/common-smdk.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/pm.h>
|
||||
|
||||
static struct map_desc qt2410_iodesc[] __initdata = {
|
||||
{ 0xe0000000, __phys_to_pfn(S3C2410_CS3+0x01000000), SZ_1M, MT_DEVICE }
|
||||
|
|
|
@ -46,12 +46,12 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/common-smdk.h>
|
||||
#include <plat/common-smdk.h>
|
||||
|
||||
static struct map_desc smdk2410_iodesc[] __initdata = {
|
||||
/* nothing here yet */
|
||||
|
|
|
@ -44,9 +44,9 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#ifdef CONFIG_MTD_PARTITIONS
|
||||
|
||||
|
|
|
@ -40,13 +40,13 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/leds-gpio.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include "usb-simtec.h"
|
||||
#include "nor-simtec.h"
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
#include <mach/regs-gpio.h>
|
||||
#include <mach/h1940.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/pm.h>
|
||||
|
||||
#ifdef CONFIG_S3C2410_PM_DEBUG
|
||||
extern void pm_dbg(const char *fmt, ...);
|
||||
|
|
|
@ -29,12 +29,12 @@
|
|||
#include <asm/irq.h>
|
||||
|
||||
#include <mach/regs-clock.h>
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2410.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <plat/s3c2410.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/clock.h>
|
||||
|
||||
/* Initial IO mappings */
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-clock.h>
|
||||
#include <mach/regs-mem.h>
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
|
||||
/* s3c2410_cpu_suspend
|
||||
*
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <mach/hardware.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <plat/devs.h>
|
||||
#include "usb-simtec.h"
|
||||
|
||||
/* control power and monitor over-current events on various Simtec
|
||||
|
|
|
@ -37,13 +37,13 @@
|
|||
|
||||
#include <mach/hardware.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-clock.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2412.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2412.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
/* We currently have to assume that the system is running
|
||||
* from the XTPll input, and that all ***REFCLKs are being
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
#include <asm/dma.h>
|
||||
#include <mach/dma.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/dma.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/dma.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <asm/plat-s3c/regs-ac97.h>
|
||||
#include <mach/regs-mem.h>
|
||||
|
|
|
@ -35,9 +35,9 @@
|
|||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-power.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/irq.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/irq.h>
|
||||
#include <plat/pm.h>
|
||||
|
||||
#define INTMSK(start, end) ((1 << ((end) + 1 - (start))) - 1)
|
||||
#define INTMSK_SUB(start, end) (INTMSK(start, end) << ((start - S3C2410_IRQSUB(0))))
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <asm/mach/map.h>
|
||||
#include <asm/mach/irq.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <asm/plat-s3c/nand.h>
|
||||
#include <asm/plat-s3c/iic.h>
|
||||
|
||||
|
@ -48,10 +48,10 @@
|
|||
#include <linux/mtd/nand_ecc.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/pm.h>
|
||||
#include <asm/plat-s3c24xx/udc.h>
|
||||
|
||||
static struct map_desc jive_iodesc[] __initdata = {
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <asm/mach-types.h>
|
||||
|
||||
//#include <asm/debug-ll.h>
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
|
||||
|
@ -40,13 +40,13 @@
|
|||
#include <asm/plat-s3c24xx/udc.h>
|
||||
#include <mach/fb.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2410.h>
|
||||
#include <asm/plat-s3c24xx/s3c2412.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2410.h>
|
||||
#include <plat/s3c2412.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/common-smdk.h>
|
||||
#include <plat/common-smdk.h>
|
||||
|
||||
static struct map_desc smdk2413_iodesc[] __initdata = {
|
||||
};
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
|
||||
|
@ -41,11 +41,11 @@
|
|||
|
||||
#include <asm/plat-s3c/nand.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2410.h>
|
||||
#include <asm/plat-s3c24xx/s3c2412.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2410.h>
|
||||
#include <plat/s3c2412.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
|
||||
static struct map_desc vstms_iodesc[] __initdata = {
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-dsc.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/pm.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2412.h>
|
||||
#include <plat/s3c2412.h>
|
||||
|
||||
extern void s3c2412_sleep_enter(void);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <mach/idle.h>
|
||||
|
||||
#include <mach/regs-clock.h>
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-power.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-gpioj.h>
|
||||
|
@ -42,11 +42,11 @@
|
|||
#include <asm/plat-s3c24xx/regs-spi.h>
|
||||
#include <mach/regs-s3c2412.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2412.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <plat/s3c2412.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/pm.h>
|
||||
|
||||
#ifndef CONFIG_CPU_S3C2412_ONLY
|
||||
void __iomem *s3c24xx_va_gpio2 = S3C24XX_VA_GPIO;
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
|
||||
#include <mach/regs-clock.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
/* S3C2440 extended clock support */
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
#include <asm/dma.h>
|
||||
#include <mach/dma.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/dma.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/dma.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <asm/plat-s3c/regs-ac97.h>
|
||||
#include <mach/regs-mem.h>
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-dsc.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/s3c2440.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/s3c2440.h>
|
||||
|
||||
int s3c2440_set_dsc(unsigned int pin, unsigned int value)
|
||||
{
|
||||
|
|
|
@ -34,9 +34,9 @@
|
|||
#include <mach/regs-irq.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <asm/plat-s3c24xx/irq.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/pm.h>
|
||||
#include <plat/irq.h>
|
||||
|
||||
/* WDT/AC97 */
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-mem.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
|
@ -48,9 +48,9 @@
|
|||
|
||||
#include <net/ax88796.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#define COPYRIGHT ", (c) 2005 Simtec Electronics"
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-mem.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
|
@ -42,9 +42,9 @@
|
|||
#include <linux/mtd/nand_ecc.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
static struct map_desc at2440evb_iodesc[] __initdata = {
|
||||
/* Nothing here */
|
||||
|
|
|
@ -36,13 +36,13 @@
|
|||
|
||||
//#include <asm/debug-ll.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2410.h>
|
||||
#include <asm/plat-s3c24xx/s3c2440.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2410.h>
|
||||
#include <plat/s3c2440.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
static struct map_desc nexcoder_iodesc[] __initdata = {
|
||||
/* nothing here yet */
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-mem.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
|
@ -44,9 +44,9 @@
|
|||
#include <linux/mtd/nand_ecc.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
/* onboard perihperal map */
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
|
||||
|
@ -45,10 +45,10 @@
|
|||
#include <asm/plat-s3c/nand.h>
|
||||
#include <mach/fb.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/pm.h>
|
||||
|
||||
static struct map_desc rx3715_iodesc[] __initdata = {
|
||||
/* dump ISA space somewhere unused */
|
||||
|
|
|
@ -31,20 +31,20 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
|
||||
#include <mach/idle.h>
|
||||
#include <mach/fb.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2410.h>
|
||||
#include <asm/plat-s3c24xx/s3c2440.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2410.h>
|
||||
#include <plat/s3c2440.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/common-smdk.h>
|
||||
#include <plat/common-smdk.h>
|
||||
|
||||
static struct map_desc smdk2440_iodesc[] __initdata = {
|
||||
/* ISA IO Space map (memory space selected by A24) */
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
#include <mach/hardware.h>
|
||||
#include <asm/irq.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2440.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2440.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
static struct sys_device s3c2440_sysdev = {
|
||||
.cls = &s3c2440_sysclass,
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
|
||||
#include <mach/regs-clock.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
/* S3C2442 extended clock support */
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
#include <linux/serial_core.h>
|
||||
#include <linux/sysdev.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2442.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2442.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
static struct sys_device s3c2442_sysdev = {
|
||||
.cls = &s3c2442_sysclass,
|
||||
|
|
|
@ -39,9 +39,9 @@
|
|||
|
||||
#include <mach/regs-s3c2443-clock.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2443.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2443.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
/* We currently have to assume that the system is running
|
||||
* from the XTPll input, and that all ***REFCLKs are being
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
#include <asm/dma.h>
|
||||
#include <mach/dma.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/dma.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/dma.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <asm/plat-s3c/regs-ac97.h>
|
||||
#include <mach/regs-mem.h>
|
||||
|
|
|
@ -34,9 +34,9 @@
|
|||
#include <mach/regs-irq.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <asm/plat-s3c24xx/pm.h>
|
||||
#include <asm/plat-s3c24xx/irq.h>
|
||||
#include <plat/cpu.h>
|
||||
#include <plat/pm.h>
|
||||
#include <plat/irq.h>
|
||||
|
||||
#define INTMSK(start, end) ((1 << ((end) + 1 - (start))) - 1)
|
||||
|
||||
|
|
|
@ -31,20 +31,20 @@
|
|||
#include <asm/irq.h>
|
||||
#include <asm/mach-types.h>
|
||||
|
||||
#include <asm/plat-s3c/regs-serial.h>
|
||||
#include <plat/regs-serial.h>
|
||||
#include <mach/regs-gpio.h>
|
||||
#include <mach/regs-lcd.h>
|
||||
|
||||
#include <mach/idle.h>
|
||||
#include <mach/fb.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2410.h>
|
||||
#include <asm/plat-s3c24xx/s3c2440.h>
|
||||
#include <asm/plat-s3c24xx/clock.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2410.h>
|
||||
#include <plat/s3c2440.h>
|
||||
#include <plat/clock.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/common-smdk.h>
|
||||
#include <plat/common-smdk.h>
|
||||
|
||||
static struct map_desc smdk2443_iodesc[] __initdata = {
|
||||
/* ISA IO Space map (memory space selected by A24) */
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
#include <mach/regs-s3c2443-clock.h>
|
||||
#include <mach/reset.h>
|
||||
|
||||
#include <asm/plat-s3c24xx/s3c2443.h>
|
||||
#include <asm/plat-s3c24xx/devs.h>
|
||||
#include <asm/plat-s3c24xx/cpu.h>
|
||||
#include <plat/s3c2443.h>
|
||||
#include <plat/devs.h>
|
||||
#include <plat/cpu.h>
|
||||
|
||||
static struct map_desc s3c2443_iodesc[] __initdata = {
|
||||
IODESC_ENT(WATCHDOG),
|
||||
|
|
|
@ -428,7 +428,7 @@ config CPU_32v6K
|
|||
# ARMv7
|
||||
config CPU_V7
|
||||
bool "Support ARM V7 processor"
|
||||
depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB
|
||||
depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_OMAP3
|
||||
select CPU_32v6K
|
||||
select CPU_32v7
|
||||
select CPU_ABRT_EV7
|
||||
|
|
|
@ -15,6 +15,9 @@ config ARCH_OMAP1
|
|||
config ARCH_OMAP2
|
||||
bool "TI OMAP2"
|
||||
|
||||
config ARCH_OMAP3
|
||||
bool "TI OMAP3"
|
||||
|
||||
endchoice
|
||||
|
||||
comment "OMAP Feature Selections"
|
||||
|
@ -29,6 +32,30 @@ config OMAP_DEBUG_LEDS
|
|||
depends on OMAP_DEBUG_DEVICES
|
||||
default y if LEDS || LEDS_OMAP_DEBUG
|
||||
|
||||
config OMAP_DEBUG_POWERDOMAIN
|
||||
bool "Emit debug messages from powerdomain layer"
|
||||
depends on ARCH_OMAP2 || ARCH_OMAP3
|
||||
default n
|
||||
help
|
||||
Say Y here if you want to compile in powerdomain layer
|
||||
debugging messages for OMAP2/3. These messages can
|
||||
provide more detail as to why some powerdomain calls
|
||||
may be failing, and will also emit a descriptive message
|
||||
for every powerdomain register write. However, the
|
||||
extra detail costs some memory.
|
||||
|
||||
config OMAP_DEBUG_CLOCKDOMAIN
|
||||
bool "Emit debug messages from clockdomain layer"
|
||||
depends on ARCH_OMAP2 || ARCH_OMAP3
|
||||
default n
|
||||
help
|
||||
Say Y here if you want to compile in clockdomain layer
|
||||
debugging messages for OMAP2/3. These messages can
|
||||
provide more detail as to why some clockdomain calls
|
||||
may be failing, and will also emit a descriptive message
|
||||
for every clockdomain register write. However, the
|
||||
extra detail costs some memory.
|
||||
|
||||
config OMAP_RESET_CLOCKS
|
||||
bool "Reset unused clocks during boot"
|
||||
depends on ARCH_OMAP
|
||||
|
@ -88,13 +115,13 @@ config OMAP_MPU_TIMER
|
|||
|
||||
config OMAP_32K_TIMER
|
||||
bool "Use 32KHz timer"
|
||||
depends on ARCH_OMAP16XX || ARCH_OMAP24XX
|
||||
depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX
|
||||
help
|
||||
Select this option if you want to enable the OMAP 32KHz timer.
|
||||
This timer saves power compared to the OMAP_MPU_TIMER, and has
|
||||
support for no tick during idle. The 32KHz timer provides less
|
||||
intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is
|
||||
currently only available for OMAP16XX and 24XX.
|
||||
currently only available for OMAP16XX, 24XX and 34XX.
|
||||
|
||||
endchoice
|
||||
|
||||
|
@ -109,7 +136,7 @@ config OMAP_32K_TIMER_HZ
|
|||
|
||||
config OMAP_DM_TIMER
|
||||
bool "Use dual-mode timer"
|
||||
depends on ARCH_OMAP16XX || ARCH_OMAP24XX
|
||||
depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX
|
||||
help
|
||||
Select this option if you want to use OMAP Dual-Mode timers.
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
# Common support
|
||||
obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \
|
||||
usb.o fb.o
|
||||
usb.o fb.o io.o
|
||||
obj-m :=
|
||||
obj-n :=
|
||||
obj- :=
|
||||
|
|
|
@ -248,6 +248,7 @@ static struct omap_globals *omap2_globals;
|
|||
|
||||
static void __init __omap2_set_globals(void)
|
||||
{
|
||||
omap2_set_globals_tap(omap2_globals);
|
||||
omap2_set_globals_memory(omap2_globals);
|
||||
omap2_set_globals_control(omap2_globals);
|
||||
omap2_set_globals_prcm(omap2_globals);
|
||||
|
@ -258,12 +259,13 @@ static void __init __omap2_set_globals(void)
|
|||
#if defined(CONFIG_ARCH_OMAP2420)
|
||||
|
||||
static struct omap_globals omap242x_globals = {
|
||||
.tap = (__force void __iomem *)OMAP2_IO_ADDRESS(0x48014000),
|
||||
.sdrc = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_SDRC_BASE),
|
||||
.sms = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_SMS_BASE),
|
||||
.ctrl = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_CTRL_BASE),
|
||||
.prm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_PRM_BASE),
|
||||
.cm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2420_CM_BASE),
|
||||
.class = OMAP242X_CLASS,
|
||||
.tap = OMAP2_IO_ADDRESS(0x48014000),
|
||||
.sdrc = OMAP2_IO_ADDRESS(OMAP2420_SDRC_BASE),
|
||||
.sms = OMAP2_IO_ADDRESS(OMAP2420_SMS_BASE),
|
||||
.ctrl = OMAP2_IO_ADDRESS(OMAP2420_CTRL_BASE),
|
||||
.prm = OMAP2_IO_ADDRESS(OMAP2420_PRM_BASE),
|
||||
.cm = OMAP2_IO_ADDRESS(OMAP2420_CM_BASE),
|
||||
};
|
||||
|
||||
void __init omap2_set_globals_242x(void)
|
||||
|
@ -276,12 +278,13 @@ void __init omap2_set_globals_242x(void)
|
|||
#if defined(CONFIG_ARCH_OMAP2430)
|
||||
|
||||
static struct omap_globals omap243x_globals = {
|
||||
.tap = (__force void __iomem *)OMAP2_IO_ADDRESS(0x4900a000),
|
||||
.sdrc = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_SDRC_BASE),
|
||||
.sms = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_SMS_BASE),
|
||||
.ctrl = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE),
|
||||
.prm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2430_PRM_BASE),
|
||||
.cm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP2430_CM_BASE),
|
||||
.class = OMAP243X_CLASS,
|
||||
.tap = OMAP2_IO_ADDRESS(0x4900a000),
|
||||
.sdrc = OMAP2_IO_ADDRESS(OMAP243X_SDRC_BASE),
|
||||
.sms = OMAP2_IO_ADDRESS(OMAP243X_SMS_BASE),
|
||||
.ctrl = OMAP2_IO_ADDRESS(OMAP243X_CTRL_BASE),
|
||||
.prm = OMAP2_IO_ADDRESS(OMAP2430_PRM_BASE),
|
||||
.cm = OMAP2_IO_ADDRESS(OMAP2430_CM_BASE),
|
||||
};
|
||||
|
||||
void __init omap2_set_globals_243x(void)
|
||||
|
@ -294,12 +297,13 @@ void __init omap2_set_globals_243x(void)
|
|||
#if defined(CONFIG_ARCH_OMAP3430)
|
||||
|
||||
static struct omap_globals omap343x_globals = {
|
||||
.tap = (__force void __iomem *)OMAP2_IO_ADDRESS(0x4830A000),
|
||||
.sdrc = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
|
||||
.sms = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
|
||||
.ctrl = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
|
||||
.prm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
|
||||
.cm = (__force void __iomem *)OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
|
||||
.class = OMAP343X_CLASS,
|
||||
.tap = OMAP2_IO_ADDRESS(0x4830A000),
|
||||
.sdrc = OMAP2_IO_ADDRESS(OMAP343X_SDRC_BASE),
|
||||
.sms = OMAP2_IO_ADDRESS(OMAP343X_SMS_BASE),
|
||||
.ctrl = OMAP2_IO_ADDRESS(OMAP343X_CTRL_BASE),
|
||||
.prm = OMAP2_IO_ADDRESS(OMAP3430_PRM_BASE),
|
||||
.cm = OMAP2_IO_ADDRESS(OMAP3430_CM_BASE),
|
||||
};
|
||||
|
||||
void __init omap2_set_globals_343x(void)
|
||||
|
|
|
@ -20,17 +20,17 @@
|
|||
#include <asm/mach/map.h>
|
||||
|
||||
#include <mach/tc.h>
|
||||
#include <mach/control.h>
|
||||
#include <mach/board.h>
|
||||
#include <mach/mmc.h>
|
||||
#include <mach/mux.h>
|
||||
#include <mach/gpio.h>
|
||||
#include <mach/menelaus.h>
|
||||
#include <mach/mcbsp.h>
|
||||
#include <mach/dsp_common.h>
|
||||
|
||||
#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE)
|
||||
|
||||
#include "../plat-omap/dsp/dsp_common.h"
|
||||
|
||||
static struct dsp_platform_data dsp_pdata = {
|
||||
.kdev_list = LIST_HEAD_INIT(dsp_pdata.kdev_list),
|
||||
};
|
||||
|
@ -76,7 +76,7 @@ int dsp_kfunc_device_register(struct dsp_kfunc_device *kdev)
|
|||
{
|
||||
static DEFINE_MUTEX(dsp_pdata_lock);
|
||||
|
||||
mutex_init(&kdev->lock);
|
||||
spin_lock_init(&kdev->lock);
|
||||
|
||||
mutex_lock(&dsp_pdata_lock);
|
||||
list_add_tail(&kdev->entry, &dsp_pdata.kdev_list);
|
||||
|
@ -95,6 +95,10 @@ static inline void omap_init_dsp(void) { }
|
|||
|
||||
static void omap_init_kp(void)
|
||||
{
|
||||
/* 2430 and 34xx keypad is on TWL4030 */
|
||||
if (cpu_is_omap2430() || cpu_is_omap34xx())
|
||||
return;
|
||||
|
||||
if (machine_is_omap_h2() || machine_is_omap_h3()) {
|
||||
omap_cfg_reg(F18_1610_KBC0);
|
||||
omap_cfg_reg(D20_1610_KBC1);
|
||||
|
@ -156,13 +160,6 @@ void omap_mcbsp_register_board_cfg(struct omap_mcbsp_platform_data *config,
|
|||
{
|
||||
int i;
|
||||
|
||||
if (size > OMAP_MAX_MCBSP_COUNT) {
|
||||
printk(KERN_WARNING "Registered too many McBSPs platform_data."
|
||||
" Using maximum (%d) available.\n",
|
||||
OMAP_MAX_MCBSP_COUNT);
|
||||
size = OMAP_MAX_MCBSP_COUNT;
|
||||
}
|
||||
|
||||
omap_mcbsp_devices = kzalloc(size * sizeof(struct platform_device *),
|
||||
GFP_KERNEL);
|
||||
if (!omap_mcbsp_devices) {
|
||||
|
@ -530,10 +527,6 @@ static inline void omap_init_rng(void) {}
|
|||
*/
|
||||
static int __init omap_init_devices(void)
|
||||
{
|
||||
/*
|
||||
* Need to enable relevant once for 2430 SDP
|
||||
*/
|
||||
#ifndef CONFIG_MACH_OMAP_2430SDP
|
||||
/* please keep these calls, and their implementations above,
|
||||
* in alphabetical order so they're easier to sort through.
|
||||
*/
|
||||
|
@ -543,7 +536,6 @@ static int __init omap_init_devices(void)
|
|||
omap_init_uwire();
|
||||
omap_init_wdt();
|
||||
omap_init_rng();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
arch_initcall(omap_init_devices);
|
||||
|
|
|
@ -1233,7 +1233,7 @@ int omap_request_dma_chain(int dev_id, const char *dev_name,
|
|||
/* request and reserve DMA channels for the chain */
|
||||
for (i = 0; i < no_of_chans; i++) {
|
||||
err = omap_request_dma(dev_id, dev_name,
|
||||
callback, 0, &channels[i]);
|
||||
callback, NULL, &channels[i]);
|
||||
if (err < 0) {
|
||||
int j;
|
||||
for (j = 0; j < i; j++)
|
||||
|
@ -2297,13 +2297,13 @@ static int __init omap_init_dma(void)
|
|||
int ch, r;
|
||||
|
||||
if (cpu_class_is_omap1()) {
|
||||
omap_dma_base = (void __iomem *)IO_ADDRESS(OMAP1_DMA_BASE);
|
||||
omap_dma_base = IO_ADDRESS(OMAP1_DMA_BASE);
|
||||
dma_lch_count = OMAP1_LOGICAL_DMA_CH_COUNT;
|
||||
} else if (cpu_is_omap24xx()) {
|
||||
omap_dma_base = (void __iomem *)IO_ADDRESS(OMAP24XX_DMA4_BASE);
|
||||
omap_dma_base = IO_ADDRESS(OMAP24XX_DMA4_BASE);
|
||||
dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
|
||||
} else if (cpu_is_omap34xx()) {
|
||||
omap_dma_base = (void __iomem *)IO_ADDRESS(OMAP34XX_DMA4_BASE);
|
||||
omap_dma_base = IO_ADDRESS(OMAP34XX_DMA4_BASE);
|
||||
dma_lch_count = OMAP_DMA4_LOGICAL_DMA_CH_COUNT;
|
||||
} else {
|
||||
pr_err("DMA init failed for unsupported omap\n");
|
||||
|
|
|
@ -693,7 +693,7 @@ int __init omap_dm_timer_init(void)
|
|||
|
||||
for (i = 0; i < dm_timer_count; i++) {
|
||||
timer = &dm_timers[i];
|
||||
timer->io_base = (void __iomem *)io_p2v(timer->phys_base);
|
||||
timer->io_base = IO_ADDRESS(timer->phys_base);
|
||||
#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
|
||||
if (cpu_class_is_omap2()) {
|
||||
char clk_name[16];
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
/*
|
||||
* OMAP1510 GPIO registers
|
||||
*/
|
||||
#define OMAP1510_GPIO_BASE (void __iomem *)0xfffce000
|
||||
#define OMAP1510_GPIO_BASE IO_ADDRESS(0xfffce000)
|
||||
#define OMAP1510_GPIO_DATA_INPUT 0x00
|
||||
#define OMAP1510_GPIO_DATA_OUTPUT 0x04
|
||||
#define OMAP1510_GPIO_DIR_CONTROL 0x08
|
||||
|
@ -42,10 +42,10 @@
|
|||
/*
|
||||
* OMAP1610 specific GPIO registers
|
||||
*/
|
||||
#define OMAP1610_GPIO1_BASE (void __iomem *)0xfffbe400
|
||||
#define OMAP1610_GPIO2_BASE (void __iomem *)0xfffbec00
|
||||
#define OMAP1610_GPIO3_BASE (void __iomem *)0xfffbb400
|
||||
#define OMAP1610_GPIO4_BASE (void __iomem *)0xfffbbc00
|
||||
#define OMAP1610_GPIO1_BASE IO_ADDRESS(0xfffbe400)
|
||||
#define OMAP1610_GPIO2_BASE IO_ADDRESS(0xfffbec00)
|
||||
#define OMAP1610_GPIO3_BASE IO_ADDRESS(0xfffbb400)
|
||||
#define OMAP1610_GPIO4_BASE IO_ADDRESS(0xfffbbc00)
|
||||
#define OMAP1610_GPIO_REVISION 0x0000
|
||||
#define OMAP1610_GPIO_SYSCONFIG 0x0010
|
||||
#define OMAP1610_GPIO_SYSSTATUS 0x0014
|
||||
|
@ -67,12 +67,12 @@
|
|||
/*
|
||||
* OMAP730 specific GPIO registers
|
||||
*/
|
||||
#define OMAP730_GPIO1_BASE (void __iomem *)0xfffbc000
|
||||
#define OMAP730_GPIO2_BASE (void __iomem *)0xfffbc800
|
||||
#define OMAP730_GPIO3_BASE (void __iomem *)0xfffbd000
|
||||
#define OMAP730_GPIO4_BASE (void __iomem *)0xfffbd800
|
||||
#define OMAP730_GPIO5_BASE (void __iomem *)0xfffbe000
|
||||
#define OMAP730_GPIO6_BASE (void __iomem *)0xfffbe800
|
||||
#define OMAP730_GPIO1_BASE IO_ADDRESS(0xfffbc000)
|
||||
#define OMAP730_GPIO2_BASE IO_ADDRESS(0xfffbc800)
|
||||
#define OMAP730_GPIO3_BASE IO_ADDRESS(0xfffbd000)
|
||||
#define OMAP730_GPIO4_BASE IO_ADDRESS(0xfffbd800)
|
||||
#define OMAP730_GPIO5_BASE IO_ADDRESS(0xfffbe000)
|
||||
#define OMAP730_GPIO6_BASE IO_ADDRESS(0xfffbe800)
|
||||
#define OMAP730_GPIO_DATA_INPUT 0x00
|
||||
#define OMAP730_GPIO_DATA_OUTPUT 0x04
|
||||
#define OMAP730_GPIO_DIR_CONTROL 0x08
|
||||
|
@ -83,16 +83,16 @@
|
|||
/*
|
||||
* omap24xx specific GPIO registers
|
||||
*/
|
||||
#define OMAP242X_GPIO1_BASE (void __iomem *)0x48018000
|
||||
#define OMAP242X_GPIO2_BASE (void __iomem *)0x4801a000
|
||||
#define OMAP242X_GPIO3_BASE (void __iomem *)0x4801c000
|
||||
#define OMAP242X_GPIO4_BASE (void __iomem *)0x4801e000
|
||||
#define OMAP242X_GPIO1_BASE IO_ADDRESS(0x48018000)
|
||||
#define OMAP242X_GPIO2_BASE IO_ADDRESS(0x4801a000)
|
||||
#define OMAP242X_GPIO3_BASE IO_ADDRESS(0x4801c000)
|
||||
#define OMAP242X_GPIO4_BASE IO_ADDRESS(0x4801e000)
|
||||
|
||||
#define OMAP243X_GPIO1_BASE (void __iomem *)0x4900C000
|
||||
#define OMAP243X_GPIO2_BASE (void __iomem *)0x4900E000
|
||||
#define OMAP243X_GPIO3_BASE (void __iomem *)0x49010000
|
||||
#define OMAP243X_GPIO4_BASE (void __iomem *)0x49012000
|
||||
#define OMAP243X_GPIO5_BASE (void __iomem *)0x480B6000
|
||||
#define OMAP243X_GPIO1_BASE IO_ADDRESS(0x4900C000)
|
||||
#define OMAP243X_GPIO2_BASE IO_ADDRESS(0x4900E000)
|
||||
#define OMAP243X_GPIO3_BASE IO_ADDRESS(0x49010000)
|
||||
#define OMAP243X_GPIO4_BASE IO_ADDRESS(0x49012000)
|
||||
#define OMAP243X_GPIO5_BASE IO_ADDRESS(0x480B6000)
|
||||
|
||||
#define OMAP24XX_GPIO_REVISION 0x0000
|
||||
#define OMAP24XX_GPIO_SYSCONFIG 0x0010
|
||||
|
@ -122,13 +122,14 @@
|
|||
* omap34xx specific GPIO registers
|
||||
*/
|
||||
|
||||
#define OMAP34XX_GPIO1_BASE (void __iomem *)0x48310000
|
||||
#define OMAP34XX_GPIO2_BASE (void __iomem *)0x49050000
|
||||
#define OMAP34XX_GPIO3_BASE (void __iomem *)0x49052000
|
||||
#define OMAP34XX_GPIO4_BASE (void __iomem *)0x49054000
|
||||
#define OMAP34XX_GPIO5_BASE (void __iomem *)0x49056000
|
||||
#define OMAP34XX_GPIO6_BASE (void __iomem *)0x49058000
|
||||
#define OMAP34XX_GPIO1_BASE IO_ADDRESS(0x48310000)
|
||||
#define OMAP34XX_GPIO2_BASE IO_ADDRESS(0x49050000)
|
||||
#define OMAP34XX_GPIO3_BASE IO_ADDRESS(0x49052000)
|
||||
#define OMAP34XX_GPIO4_BASE IO_ADDRESS(0x49054000)
|
||||
#define OMAP34XX_GPIO5_BASE IO_ADDRESS(0x49056000)
|
||||
#define OMAP34XX_GPIO6_BASE IO_ADDRESS(0x49058000)
|
||||
|
||||
#define OMAP_MPUIO_VBASE IO_ADDRESS(OMAP_MPUIO_BASE)
|
||||
|
||||
struct gpio_bank {
|
||||
void __iomem *base;
|
||||
|
@ -160,7 +161,7 @@ struct gpio_bank {
|
|||
|
||||
#ifdef CONFIG_ARCH_OMAP16XX
|
||||
static struct gpio_bank gpio_bank_1610[5] = {
|
||||
{ OMAP_MPUIO_BASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO},
|
||||
{ OMAP_MPUIO_VBASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO},
|
||||
{ OMAP1610_GPIO1_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1610 },
|
||||
{ OMAP1610_GPIO2_BASE, INT_1610_GPIO_BANK2, IH_GPIO_BASE + 16, METHOD_GPIO_1610 },
|
||||
{ OMAP1610_GPIO3_BASE, INT_1610_GPIO_BANK3, IH_GPIO_BASE + 32, METHOD_GPIO_1610 },
|
||||
|
@ -170,14 +171,14 @@ static struct gpio_bank gpio_bank_1610[5] = {
|
|||
|
||||
#ifdef CONFIG_ARCH_OMAP15XX
|
||||
static struct gpio_bank gpio_bank_1510[2] = {
|
||||
{ OMAP_MPUIO_BASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
|
||||
{ OMAP_MPUIO_VBASE, INT_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
|
||||
{ OMAP1510_GPIO_BASE, INT_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_1510 }
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_OMAP730
|
||||
static struct gpio_bank gpio_bank_730[7] = {
|
||||
{ OMAP_MPUIO_BASE, INT_730_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
|
||||
{ OMAP_MPUIO_VBASE, INT_730_MPUIO, IH_MPUIO_BASE, METHOD_MPUIO },
|
||||
{ OMAP730_GPIO1_BASE, INT_730_GPIO_BANK1, IH_GPIO_BASE, METHOD_GPIO_730 },
|
||||
{ OMAP730_GPIO2_BASE, INT_730_GPIO_BANK2, IH_GPIO_BASE + 32, METHOD_GPIO_730 },
|
||||
{ OMAP730_GPIO3_BASE, INT_730_GPIO_BANK3, IH_GPIO_BASE + 64, METHOD_GPIO_730 },
|
||||
|
@ -1389,7 +1390,7 @@ static int __init _omap_gpio_init(void)
|
|||
|
||||
gpio_bank_count = 5;
|
||||
gpio_bank = gpio_bank_1610;
|
||||
rev = omap_readw(gpio_bank[1].base + OMAP1610_GPIO_REVISION);
|
||||
rev = __raw_readw(gpio_bank[1].base + OMAP1610_GPIO_REVISION);
|
||||
printk(KERN_INFO "OMAP GPIO hardware version %d.%d\n",
|
||||
(rev >> 4) & 0x0f, rev & 0x0f);
|
||||
}
|
||||
|
@ -1408,7 +1409,7 @@ static int __init _omap_gpio_init(void)
|
|||
|
||||
gpio_bank_count = 4;
|
||||
gpio_bank = gpio_bank_242x;
|
||||
rev = omap_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
|
||||
rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
|
||||
printk(KERN_INFO "OMAP242x GPIO hardware version %d.%d\n",
|
||||
(rev >> 4) & 0x0f, rev & 0x0f);
|
||||
}
|
||||
|
@ -1417,7 +1418,7 @@ static int __init _omap_gpio_init(void)
|
|||
|
||||
gpio_bank_count = 5;
|
||||
gpio_bank = gpio_bank_243x;
|
||||
rev = omap_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
|
||||
rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
|
||||
printk(KERN_INFO "OMAP243x GPIO hardware version %d.%d\n",
|
||||
(rev >> 4) & 0x0f, rev & 0x0f);
|
||||
}
|
||||
|
@ -1428,7 +1429,7 @@ static int __init _omap_gpio_init(void)
|
|||
|
||||
gpio_bank_count = OMAP34XX_NR_GPIOS;
|
||||
gpio_bank = gpio_bank_34xx;
|
||||
rev = omap_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
|
||||
rev = __raw_readl(gpio_bank[0].base + OMAP24XX_GPIO_REVISION);
|
||||
printk(KERN_INFO "OMAP34xx GPIO hardware version %d.%d\n",
|
||||
(rev >> 4) & 0x0f, rev & 0x0f);
|
||||
}
|
||||
|
@ -1437,10 +1438,9 @@ static int __init _omap_gpio_init(void)
|
|||
int j, gpio_count = 16;
|
||||
|
||||
bank = &gpio_bank[i];
|
||||
bank->base = IO_ADDRESS(bank->base);
|
||||
spin_lock_init(&bank->lock);
|
||||
if (bank_is_mpuio(bank))
|
||||
omap_writew(0xFFFF, OMAP_MPUIO_BASE + OMAP_MPUIO_GPIO_MASKIT);
|
||||
__raw_writew(0xffff, bank->base + OMAP_MPUIO_GPIO_MASKIT);
|
||||
if (cpu_is_omap15xx() && bank->method == METHOD_GPIO_1510) {
|
||||
__raw_writew(0xffff, bank->base + OMAP1510_GPIO_INT_MASK);
|
||||
__raw_writew(0x0000, bank->base + OMAP1510_GPIO_INT_STATUS);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue