diff options
Diffstat (limited to 'arch/arm/mach-stmp378x/stmp378x.c')
-rw-r--r-- | arch/arm/mach-stmp378x/stmp378x.c | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/arch/arm/mach-stmp378x/stmp378x.c b/arch/arm/mach-stmp378x/stmp378x.c index ddd49a760fd4..df6e6e018196 100644 --- a/arch/arm/mach-stmp378x/stmp378x.c +++ b/arch/arm/mach-stmp378x/stmp378x.c @@ -3,7 +3,7 @@ * * Embedded Alley Solutions, Inc <source@embeddedalley.com> * - * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved. * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. */ @@ -42,6 +42,7 @@ #include <mach/regs-apbx.h> #include <mach/regs-pxp.h> #include <mach/regs-i2c.h> +#include <mach/regs-ocotp.h> #include "stmp378x.h" /* @@ -64,14 +65,14 @@ static void stmp378x_mask_irq(unsigned int irq) { /* IRQ disable */ stmp3xxx_clearl(BM_ICOLL_INTERRUPTn_ENABLE, - REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + irq * 0x10); + REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn(irq)); } static void stmp378x_unmask_irq(unsigned int irq) { /* IRQ enable */ stmp3xxx_setl(BM_ICOLL_INTERRUPTn_ENABLE, - REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + irq * 0x10); + REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn(irq)); } static struct irq_chip stmp378x_chip = { @@ -238,6 +239,11 @@ static struct map_desc stmp378x_io_desc[] __initdata = { static u64 common_dmamask = DMA_BIT_MASK(32); +static void mxc_nop_release(struct device *dev) +{ + /* Nothing */ +} + /* * devices that are present only on stmp378x, not on all 3xxx boards: * PxP @@ -247,7 +253,7 @@ static struct resource pxp_resource[] = { { .flags = IORESOURCE_MEM, .start = REGS_PXP_PHYS, - .end = REGS_PXP_PHYS + REGS_PXP_SIZE, + .end = REGS_PXP_PHYS + REGS_PXP_SIZE - 1, }, { .flags = IORESOURCE_IRQ, .start = IRQ_PXP, @@ -259,6 +265,7 @@ struct platform_device stmp378x_pxp = { .name = "stmp3xxx-pxp", .id = -1, .dev = { + .release = mxc_nop_release, .dma_mask = &common_dmamask, .coherent_dma_mask = DMA_BIT_MASK(32), }, @@ -274,7 +281,7 @@ static struct resource i2c_resources[] = { }, { .flags = IORESOURCE_MEM, .start = REGS_I2C_PHYS, - .end = REGS_I2C_PHYS + REGS_I2C_SIZE, + .end = REGS_I2C_PHYS + REGS_I2C_SIZE - 1, }, { .flags = IORESOURCE_DMA, .start = STMP3XXX_DMA(3, STMP3XXX_BUS_APBX), @@ -286,6 +293,7 @@ struct platform_device stmp378x_i2c = { .name = "i2c_stmp3xxx", .id = 0, .dev = { + .release = mxc_nop_release, .dma_mask = &common_dmamask, .coherent_dma_mask = DMA_BIT_MASK(32), }, @@ -293,7 +301,27 @@ struct platform_device stmp378x_i2c = { .num_resources = ARRAY_SIZE(i2c_resources), }; +struct platform_device stmp378x_audio = { + .name = "stmp378x-audio", + .id = -1, + .dev = { + .release = mxc_nop_release, + }, +}; + void __init stmp378x_map_io(void) { iotable_init(stmp378x_io_desc, ARRAY_SIZE(stmp378x_io_desc)); } + +int get_evk_board_version() +{ + int boardid; + boardid = __raw_readl(REGS_OCOTP_BASE + HW_OCOTP_CUSTCAP); + boardid &= 0x30000000; + boardid = boardid >> 28; + + return boardid; +} + +EXPORT_SYMBOL_GPL(get_evk_board_version); |