Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258747
b: refs/heads/master
c: 962519e
h: refs/heads/master
i:
  258745: d24fcea
  258743: acbd090
v: v3
  • Loading branch information
Benoit Cousson authored and Paul Walmsley committed Jul 10, 2011
1 parent 8440c6d commit e93c0b3
Show file tree
Hide file tree
Showing 15 changed files with 2,323 additions and 1,562 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e69ed974259b42c4f87a44222415dbb7472898d
refs/heads/master: 962519e07e44bdeb381fdc7689361a144fe3491c
16 changes: 3 additions & 13 deletions trunk/arch/arm/mach-omap2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,9 @@ obj-$(CONFIG_SOC_OMAP2420) += opp2420_data.o
obj-$(CONFIG_SOC_OMAP2430) += opp2430_data.o

# hwmod data
obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2xxx_ipblock_data.o \
omap_hwmod_2xxx_3xxx_ipblock_data.o \
omap_hwmod_2xxx_interconnect_data.o \
omap_hwmod_2xxx_3xxx_interconnect_data.o \
omap_hwmod_2420_data.o
obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2xxx_ipblock_data.o \
omap_hwmod_2xxx_3xxx_ipblock_data.o \
omap_hwmod_2xxx_interconnect_data.o \
omap_hwmod_2xxx_3xxx_interconnect_data.o \
omap_hwmod_2430_data.o
obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_2xxx_3xxx_ipblock_data.o \
omap_hwmod_2xxx_3xxx_interconnect_data.o \
omap_hwmod_3xxx_data.o
obj-$(CONFIG_SOC_OMAP2420) += omap_hwmod_2420_data.o
obj-$(CONFIG_SOC_OMAP2430) += omap_hwmod_2430_data.o
obj-$(CONFIG_ARCH_OMAP3) += omap_hwmod_3xxx_data.o
obj-$(CONFIG_ARCH_OMAP4) += omap_hwmod_44xx_data.o

# EMU peripherals
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-omap2/clock44xx_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,7 @@ static struct dpll_data dpll_usb_dd = {
.enable_mask = OMAP4430_DPLL_EN_MASK,
.autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK,
.idlest_mask = OMAP4430_ST_DPLL_CLK_MASK,
.sddiv_mask = OMAP4430_DPLL_SD_DIV_MASK,
.max_multiplier = OMAP4430_MAX_DPLL_MULT,
.max_divider = OMAP4430_MAX_DPLL_DIV,
.min_divider = 1,
Expand Down
101 changes: 13 additions & 88 deletions trunk/arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* omap_hwmod implementation for OMAP2/3/4
*
* Copyright (C) 2009-2011 Nokia Corporation
* Copyright (C) 2011 Texas Instruments, Inc.
*
* Paul Walmsley, Benoît Cousson, Kevin Hilman
*
Expand Down Expand Up @@ -678,75 +677,6 @@ static void _disable_optional_clocks(struct omap_hwmod *oh)
}
}

/**
* _count_mpu_irqs - count the number of MPU IRQ lines associated with @oh
* @oh: struct omap_hwmod *oh
*
* Count and return the number of MPU IRQs associated with the hwmod
* @oh. Used to allocate struct resource data. Returns 0 if @oh is
* NULL.
*/
static int _count_mpu_irqs(struct omap_hwmod *oh)
{
struct omap_hwmod_irq_info *ohii;
int i = 0;

if (!oh || !oh->mpu_irqs)
return 0;

do {
ohii = &oh->mpu_irqs[i++];
} while (ohii->irq != -1);

return i;
}

/**
* _count_sdma_reqs - count the number of SDMA request lines associated with @oh
* @oh: struct omap_hwmod *oh
*
* Count and return the number of SDMA request lines associated with
* the hwmod @oh. Used to allocate struct resource data. Returns 0
* if @oh is NULL.
*/
static int _count_sdma_reqs(struct omap_hwmod *oh)
{
struct omap_hwmod_dma_info *ohdi;
int i = 0;

if (!oh || !oh->sdma_reqs)
return 0;

do {
ohdi = &oh->sdma_reqs[i++];
} while (ohdi->dma_req != -1);

return i;
}

/**
* _count_ocp_if_addr_spaces - count the number of address space entries for @oh
* @oh: struct omap_hwmod *oh
*
* Count and return the number of address space ranges associated with
* the hwmod @oh. Used to allocate struct resource data. Returns 0
* if @oh is NULL.
*/
static int _count_ocp_if_addr_spaces(struct omap_hwmod_ocp_if *os)
{
struct omap_hwmod_addr_space *mem;
int i = 0;

if (!os || !os->addr)
return 0;

do {
mem = &os->addr[i++];
} while (mem->pa_start != mem->pa_end);

return i;
}

/**
* _find_mpu_port_index - find hwmod OCP slave port ID intended for MPU use
* @oh: struct omap_hwmod *
Expand Down Expand Up @@ -792,22 +722,21 @@ static void __iomem * __init _find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
{
struct omap_hwmod_ocp_if *os;
struct omap_hwmod_addr_space *mem;
int i = 0, found = 0;
int i;
int found = 0;
void __iomem *va_start;

if (!oh || oh->slaves_cnt == 0)
return NULL;

os = oh->slaves[index];

if (!os->addr)
return NULL;

do {
mem = &os->addr[i++];
if (mem->flags & ADDR_TYPE_RT)
for (i = 0, mem = os->addr; i < os->addr_cnt; i++, mem++) {
if (mem->flags & ADDR_TYPE_RT) {
found = 1;
} while (!found && mem->pa_start != mem->pa_end);
break;
}
}

if (found) {
va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
Expand Down Expand Up @@ -2010,10 +1939,10 @@ int omap_hwmod_count_resources(struct omap_hwmod *oh)
{
int ret, i;

ret = _count_mpu_irqs(oh) + _count_sdma_reqs(oh);
ret = oh->mpu_irqs_cnt + oh->sdma_reqs_cnt;

for (i = 0; i < oh->slaves_cnt; i++)
ret += _count_ocp_if_addr_spaces(oh->slaves[i]);
ret += oh->slaves[i]->addr_cnt;

return ret;
}
Expand All @@ -2030,22 +1959,20 @@ int omap_hwmod_count_resources(struct omap_hwmod *oh)
*/
int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
{
int i, j, mpu_irqs_cnt, sdma_reqs_cnt;
int i, j;
int r = 0;

/* For each IRQ, DMA, memory area, fill in array.*/

mpu_irqs_cnt = _count_mpu_irqs(oh);
for (i = 0; i < mpu_irqs_cnt; i++) {
for (i = 0; i < oh->mpu_irqs_cnt; i++) {
(res + r)->name = (oh->mpu_irqs + i)->name;
(res + r)->start = (oh->mpu_irqs + i)->irq;
(res + r)->end = (oh->mpu_irqs + i)->irq;
(res + r)->flags = IORESOURCE_IRQ;
r++;
}

sdma_reqs_cnt = _count_sdma_reqs(oh);
for (i = 0; i < sdma_reqs_cnt; i++) {
for (i = 0; i < oh->sdma_reqs_cnt; i++) {
(res + r)->name = (oh->sdma_reqs + i)->name;
(res + r)->start = (oh->sdma_reqs + i)->dma_req;
(res + r)->end = (oh->sdma_reqs + i)->dma_req;
Expand All @@ -2055,12 +1982,10 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)

for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os;
int addr_cnt;

os = oh->slaves[i];
addr_cnt = _count_ocp_if_addr_spaces(os);

for (j = 0; j < addr_cnt; j++) {
for (j = 0; j < os->addr_cnt; j++) {
(res + r)->name = (os->addr + j)->name;
(res + r)->start = (os->addr + j)->pa_start;
(res + r)->end = (os->addr + j)->pa_end;
Expand Down
Loading

0 comments on commit e93c0b3

Please sign in to comment.