Commit 0189a028 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'omap-devel-hwmod-for-v3.5' of...

Merge tag 'omap-devel-hwmod-for-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/pm

Add most of remaining hwmods for omap4

By Paul Walmsley (37) and others
via Tony Lindgren (2) and Paul Walmsley (1)
* tag 'omap-devel-hwmod-for-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (44 commits)
  ARM: OMAP4: hwmod data: add DEBUGSS skeleton
  ARM: OMAP4: hwmod data: add PRCM and related IP blocks
  ARM: OMAP4: hwmod data: add System Control Module
  ARM: OMAP4: hwmod data: add the OCP-WP IP block
  ARM: OMAP4: hwmod data: add OCM RAM IP block
  ARM: OMAP4: hwmod data: add remaining USB-related IP blocks
  ARM: OMAP4: hwmod data: add some interconnect-related IP blocks
  ARM: OMAP4: hwmod data: add McASP
  ARM: OMAP4: hwmod data: add the Slimbus IP blocks
  ARM: OMAP4: hwmod data: add GPU
  ARM: OMAP4: hwmod data: add EMIF1 and 2
  ARM: OMAP4: hwmod data: add GPMC
  ARM: OMAP4: hwmod data: add HDQ/1-wire
  ARM: OMAP4: hwmod data: introduce fdif(face detect module) hwmod
  ARM: OMAP2+: clockdomains: make {prm,cm}_clkdm common
  ARM: OMAP2xxx: hwmod data: start to fix the IVA1, IVA2 and DSP
  ARM: OMAP3: hwmod data: add IVA hard reset lines, main clock, clockdomain
  ARM: OMAP3: hwmod data: fix IVA interface clock
  ARM: OMAP2xxx: hwmod data: share common interface data
  ARM: OMAP2xxx: hwmod data: share common hwmods between OMAP2420 and OMAP2430
  ...
parents 0f8b7137 1df82cd6
...@@ -118,16 +118,18 @@ obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \ ...@@ -118,16 +118,18 @@ obj-$(CONFIG_ARCH_OMAP4) += $(powerdomain-common) \
powerdomains44xx_data.o powerdomains44xx_data.o
# PRCM clockdomain control # PRCM clockdomain control
obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \ clockdomain-common += clockdomain.o \
clockdomains_common_data.o
obj-$(CONFIG_ARCH_OMAP2) += $(clockdomain-common) \
clockdomain2xxx_3xxx.o \ clockdomain2xxx_3xxx.o \
clockdomains2xxx_3xxx_data.o clockdomains2xxx_3xxx_data.o
obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o obj-$(CONFIG_SOC_OMAP2420) += clockdomains2420_data.o
obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o obj-$(CONFIG_SOC_OMAP2430) += clockdomains2430_data.o
obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \ obj-$(CONFIG_ARCH_OMAP3) += $(clockdomain-common) \
clockdomain2xxx_3xxx.o \ clockdomain2xxx_3xxx.o \
clockdomains2xxx_3xxx_data.o \ clockdomains2xxx_3xxx_data.o \
clockdomains3xxx_data.o clockdomains3xxx_data.o
obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \ obj-$(CONFIG_ARCH_OMAP4) += $(clockdomain-common) \
clockdomain44xx.o \ clockdomain44xx.o \
clockdomains44xx_data.o clockdomains44xx_data.o
......
...@@ -51,6 +51,9 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm) ...@@ -51,6 +51,9 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm)
struct clkdm_dep *cd; struct clkdm_dep *cd;
u32 mask = 0; u32 mask = 0;
if (!clkdm->prcm_partition)
return 0;
for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) { for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
if (!cd->clkdm) if (!cd->clkdm)
continue; /* only happens if data is erroneous */ continue; /* only happens if data is erroneous */
...@@ -103,6 +106,9 @@ static int omap4_clkdm_clk_disable(struct clockdomain *clkdm) ...@@ -103,6 +106,9 @@ static int omap4_clkdm_clk_disable(struct clockdomain *clkdm)
{ {
bool hwsup = false; bool hwsup = false;
if (!clkdm->prcm_partition)
return 0;
hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition, hwsup = omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
clkdm->cm_inst, clkdm->clkdm_offs); clkdm->cm_inst, clkdm->clkdm_offs);
......
...@@ -89,13 +89,3 @@ struct clockdomain wkup_common_clkdm = { ...@@ -89,13 +89,3 @@ struct clockdomain wkup_common_clkdm = {
.pwrdm = { .name = "wkup_pwrdm" }, .pwrdm = { .name = "wkup_pwrdm" },
.dep_bit = OMAP_EN_WKUP_SHIFT, .dep_bit = OMAP_EN_WKUP_SHIFT,
}; };
struct clockdomain prm_common_clkdm = {
.name = "prm_clkdm",
.pwrdm = { .name = "wkup_pwrdm" },
};
struct clockdomain cm_common_clkdm = {
.name = "cm_clkdm",
.pwrdm = { .name = "core_pwrdm" },
};
...@@ -430,6 +430,8 @@ static struct clockdomain *clockdomains_omap44xx[] __initdata = { ...@@ -430,6 +430,8 @@ static struct clockdomain *clockdomains_omap44xx[] __initdata = {
&l4_wkup_44xx_clkdm, &l4_wkup_44xx_clkdm,
&emu_sys_44xx_clkdm, &emu_sys_44xx_clkdm,
&l3_dma_44xx_clkdm, &l3_dma_44xx_clkdm,
&prm_common_clkdm,
&cm_common_clkdm,
NULL NULL
}; };
......
/*
* OMAP2+-common clockdomain data
*
* Copyright (C) 2008-2012 Texas Instruments, Inc.
* Copyright (C) 2008-2010 Nokia Corporation
*
* Paul Walmsley, Jouni Högander
*/
#include <linux/kernel.h>
#include <linux/io.h>
#include "clockdomain.h"
/* These are implicit clockdomains - they are never defined as such in TRM */
struct clockdomain prm_common_clkdm = {
.name = "prm_clkdm",
.pwrdm = { .name = "wkup_pwrdm" },
};
struct clockdomain cm_common_clkdm = {
.name = "cm_clkdm",
.pwrdm = { .name = "core_pwrdm" },
};
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* omap_hwmod implementation for OMAP2/3/4 * omap_hwmod implementation for OMAP2/3/4
* *
* Copyright (C) 2009-2011 Nokia Corporation * Copyright (C) 2009-2011 Nokia Corporation
* Copyright (C) 2011 Texas Instruments, Inc. * Copyright (C) 2011-2012 Texas Instruments, Inc.
* *
* Paul Walmsley, Benoît Cousson, Kevin Hilman * Paul Walmsley, Benoît Cousson, Kevin Hilman
* *
...@@ -137,6 +137,7 @@ ...@@ -137,6 +137,7 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/bootmem.h>
#include "common.h" #include "common.h"
#include <plat/cpu.h> #include <plat/cpu.h>
...@@ -159,15 +160,57 @@ ...@@ -159,15 +160,57 @@
/* Name of the OMAP hwmod for the MPU */ /* Name of the OMAP hwmod for the MPU */
#define MPU_INITIATOR_NAME "mpu" #define MPU_INITIATOR_NAME "mpu"
/*
* Number of struct omap_hwmod_link records per struct
* omap_hwmod_ocp_if record (master->slave and slave->master)
*/
#define LINKS_PER_OCP_IF 2
/* omap_hwmod_list contains all registered struct omap_hwmods */ /* omap_hwmod_list contains all registered struct omap_hwmods */
static LIST_HEAD(omap_hwmod_list); static LIST_HEAD(omap_hwmod_list);
/* mpu_oh: used to add/remove MPU initiator from sleepdep list */ /* mpu_oh: used to add/remove MPU initiator from sleepdep list */
static struct omap_hwmod *mpu_oh; static struct omap_hwmod *mpu_oh;
/*
* linkspace: ptr to a buffer that struct omap_hwmod_link records are
* allocated from - used to reduce the number of small memory
* allocations, which has a significant impact on performance
*/
static struct omap_hwmod_link *linkspace;
/*
* free_ls, max_ls: array indexes into linkspace; representing the
* next free struct omap_hwmod_link index, and the maximum number of
* struct omap_hwmod_link records allocated (respectively)
*/
static unsigned short free_ls, max_ls, ls_supp;
/* Private functions */ /* Private functions */
/**
* _fetch_next_ocp_if - return the next OCP interface in a list
* @p: ptr to a ptr to the list_head inside the ocp_if to return
* @i: pointer to the index of the element pointed to by @p in the list
*
* Return a pointer to the struct omap_hwmod_ocp_if record
* containing the struct list_head pointed to by @p, and increment
* @p such that a future call to this routine will return the next
* record.
*/
static struct omap_hwmod_ocp_if *_fetch_next_ocp_if(struct list_head **p,
int *i)
{
struct omap_hwmod_ocp_if *oi;
oi = list_entry(*p, struct omap_hwmod_link, node)->ocp_if;
*p = (*p)->next;
*i = *i + 1;
return oi;
}
/** /**
* _update_sysc_cache - return the module OCP_SYSCONFIG register, keep copy * _update_sysc_cache - return the module OCP_SYSCONFIG register, keep copy
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
...@@ -582,16 +625,16 @@ static int _init_main_clk(struct omap_hwmod *oh) ...@@ -582,16 +625,16 @@ static int _init_main_clk(struct omap_hwmod *oh)
*/ */
static int _init_interface_clks(struct omap_hwmod *oh) static int _init_interface_clks(struct omap_hwmod *oh)
{ {
struct omap_hwmod_ocp_if *os;
struct list_head *p;
struct clk *c; struct clk *c;
int i; int i = 0;
int ret = 0; int ret = 0;
if (oh->slaves_cnt == 0) p = oh->slave_ports.next;
return 0;
for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os = oh->slaves[i];
while (i < oh->slaves_cnt) {
os = _fetch_next_ocp_if(&p, &i);
if (!os->clk) if (!os->clk)
continue; continue;
...@@ -643,21 +686,22 @@ static int _init_opt_clks(struct omap_hwmod *oh) ...@@ -643,21 +686,22 @@ static int _init_opt_clks(struct omap_hwmod *oh)
*/ */
static int _enable_clocks(struct omap_hwmod *oh) static int _enable_clocks(struct omap_hwmod *oh)
{ {
int i; struct omap_hwmod_ocp_if *os;
struct list_head *p;
int i = 0;
pr_debug("omap_hwmod: %s: enabling clocks\n", oh->name); pr_debug("omap_hwmod: %s: enabling clocks\n", oh->name);
if (oh->_clk) if (oh->_clk)
clk_enable(oh->_clk); clk_enable(oh->_clk);
if (oh->slaves_cnt > 0) { p = oh->slave_ports.next;
for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os = oh->slaves[i];
struct clk *c = os->_clk;
if (c && (os->flags & OCPIF_SWSUP_IDLE)) while (i < oh->slaves_cnt) {
clk_enable(c); os = _fetch_next_ocp_if(&p, &i);
}
if (os->_clk && (os->flags & OCPIF_SWSUP_IDLE))
clk_enable(os->_clk);
} }
/* The opt clocks are controlled by the device driver. */ /* The opt clocks are controlled by the device driver. */
...@@ -673,21 +717,22 @@ static int _enable_clocks(struct omap_hwmod *oh) ...@@ -673,21 +717,22 @@ static int _enable_clocks(struct omap_hwmod *oh)
*/ */
static int _disable_clocks(struct omap_hwmod *oh) static int _disable_clocks(struct omap_hwmod *oh)
{ {
int i; struct omap_hwmod_ocp_if *os;
struct list_head *p;
int i = 0;
pr_debug("omap_hwmod: %s: disabling clocks\n", oh->name); pr_debug("omap_hwmod: %s: disabling clocks\n", oh->name);
if (oh->_clk) if (oh->_clk)
clk_disable(oh->_clk); clk_disable(oh->_clk);
if (oh->slaves_cnt > 0) { p = oh->slave_ports.next;
for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os = oh->slaves[i];
struct clk *c = os->_clk;
if (c && (os->flags & OCPIF_SWSUP_IDLE)) while (i < oh->slaves_cnt) {
clk_disable(c); os = _fetch_next_ocp_if(&p, &i);
}
if (os->_clk && (os->flags & OCPIF_SWSUP_IDLE))
clk_disable(os->_clk);
} }
/* The opt clocks are controlled by the device driver. */ /* The opt clocks are controlled by the device driver. */
...@@ -780,39 +825,6 @@ static int _omap4_wait_target_disable(struct omap_hwmod *oh) ...@@ -780,39 +825,6 @@ static int _omap4_wait_target_disable(struct omap_hwmod *oh)
oh->prcm.omap4.clkctrl_offs); oh->prcm.omap4.clkctrl_offs);
} }
/**
* _omap4_disable_module - enable CLKCTRL modulemode on OMAP4
* @oh: struct omap_hwmod *
*
* Disable the PRCM module mode related to the hwmod @oh.
* Return EINVAL if the modulemode is not supported and 0 in case of success.
*/
static int _omap4_disable_module(struct omap_hwmod *oh)
{
int v;
/* The module mode does not exist prior OMAP4 */
if (!cpu_is_omap44xx())
return -EINVAL;
if (!oh->clkdm || !oh->prcm.omap4.modulemode)
return -EINVAL;
pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__);
omap4_cminst_module_disable(oh->clkdm->prcm_partition,
oh->clkdm->cm_inst,
oh->clkdm->clkdm_offs,
oh->prcm.omap4.clkctrl_offs);
v = _omap4_wait_target_disable(oh);
if (v)
pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
oh->name);
return 0;
}
/** /**
* _count_mpu_irqs - count the number of MPU IRQ lines associated with @oh * _count_mpu_irqs - count the number of MPU IRQ lines associated with @oh
* @oh: struct omap_hwmod *oh * @oh: struct omap_hwmod *oh
...@@ -883,59 +895,220 @@ static int _count_ocp_if_addr_spaces(struct omap_hwmod_ocp_if *os) ...@@ -883,59 +895,220 @@ static int _count_ocp_if_addr_spaces(struct omap_hwmod_ocp_if *os)
} }
/** /**
* _find_mpu_port_index - find hwmod OCP slave port ID intended for MPU use * _get_mpu_irq_by_name - fetch MPU interrupt line number by name
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod * to operate on
* @name: pointer to the name of the MPU interrupt number to fetch (optional)
* @irq: pointer to an unsigned int to store the MPU IRQ number to
* *
* Returns the array index of the OCP slave port that the MPU * Retrieve a MPU hardware IRQ line number named by @name associated
* addresses the device on, or -EINVAL upon error or not found. * with the IP block pointed to by @oh. The IRQ number will be filled
* into the address pointed to by @dma. When @name is non-null, the
* IRQ line number associated with the named entry will be returned.
* If @name is null, the first matching entry will be returned. Data
* order is not meaningful in hwmod data, so callers are strongly
* encouraged to use a non-null @name whenever possible to avoid
* unpredictable effects if hwmod data is later added that causes data
* ordering to change. Returns 0 upon success or a negative error
* code upon error.
*/ */
static int __init _find_mpu_port_index(struct omap_hwmod *oh) static int _get_mpu_irq_by_name(struct omap_hwmod *oh, const char *name,
unsigned int *irq)
{ {
int i; int i;
int found = 0; bool found = false;
if (!oh || oh->slaves_cnt == 0) if (!oh->mpu_irqs)
return -EINVAL; return -ENOENT;
for (i = 0; i < oh->slaves_cnt; i++) { i = 0;
struct omap_hwmod_ocp_if *os = oh->slaves[i]; while (oh->mpu_irqs[i].irq != -1) {
if (name == oh->mpu_irqs[i].name ||
!strcmp(name, oh->mpu_irqs[i].name)) {
found = true;
break;
}
i++;
}
if (os->user & OCP_USER_MPU) { if (!found)
found = 1; return -ENOENT;
*irq = oh->mpu_irqs[i].irq;
return 0;
}
/**
* _get_sdma_req_by_name - fetch SDMA request line ID by name
* @oh: struct omap_hwmod * to operate on
* @name: pointer to the name of the SDMA request line to fetch (optional)
* @dma: pointer to an unsigned int to store the request line ID to
*
* Retrieve an SDMA request line ID named by @name on the IP block
* pointed to by @oh. The ID will be filled into the address pointed
* to by @dma. When @name is non-null, the request line ID associated
* with the named entry will be returned. If @name is null, the first
* matching entry will be returned. Data order is not meaningful in
* hwmod data, so callers are strongly encouraged to use a non-null
* @name whenever possible to avoid unpredictable effects if hwmod
* data is later added that causes data ordering to change. Returns 0
* upon success or a negative error code upon error.
*/
static int _get_sdma_req_by_name(struct omap_hwmod *oh, const char *name,
unsigned int *dma)
{
int i;
bool found = false;
if (!oh->sdma_reqs)
return -ENOENT;
i = 0;
while (oh->sdma_reqs[i].dma_req != -1) {
if (name == oh->sdma_reqs[i].name ||
!strcmp(name, oh->sdma_reqs[i].name)) {
found = true;
break; break;
} }
i++;
} }
if (found) if (!found)
pr_debug("omap_hwmod: %s: MPU OCP slave port ID %d\n", return -ENOENT;
oh->name, i);
else *dma = oh->sdma_reqs[i].dma_req;
pr_debug("omap_hwmod: %s: no MPU OCP slave port found\n",
oh->name);
return (found) ? i : -EINVAL; return 0;
} }
/** /**
* _find_mpu_rt_base - find hwmod register target base addr accessible by MPU * _get_addr_space_by_name - fetch address space start & end by name
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod * to operate on
* @name: pointer to the name of the address space to fetch (optional)
* @pa_start: pointer to a u32 to store the starting address to
* @pa_end: pointer to a u32 to store the ending address to
* *
* Return the virtual address of the base of the register target of * Retrieve address space start and end addresses for the IP block
* device @oh, or NULL on error. * pointed to by @oh. The data will be filled into the addresses
* pointed to by @pa_start and @pa_end. When @name is non-null, the
* address space data associated with the named entry will be
* returned. If @name is null, the first matching entry will be
* returned. Data order is not meaningful in hwmod data, so callers
* are strongly encouraged to use a non-null @name whenever possible
* to avoid unpredictable effects if hwmod data is later added that
* causes data ordering to change. Returns 0 upon success or a
* negative error code upon error.
*/ */
static void __iomem * __init _find_mpu_rt_base(struct omap_hwmod *oh, u8 index) static int _get_addr_space_by_name(struct omap_hwmod *oh, const char *name,
u32 *pa_start, u32 *pa_end)
{ {
int i, j;
struct omap_hwmod_ocp_if *os; struct omap_hwmod_ocp_if *os;
struct omap_hwmod_addr_space *mem; struct list_head *p = NULL;
int i = 0, found = 0; bool found = false;
void __iomem *va_start;
p = oh->slave_ports.next;
i = 0;
while (i < oh->slaves_cnt) {
os = _fetch_next_ocp_if(&p, &i);
if (!os->addr)
return -ENOENT;
j = 0;
while (os->addr[j].pa_start != os->addr[j].pa_end) {
if (name == os->addr[j].name ||
!strcmp(name, os->addr[j].name)) {
found = true;
break;
}
j++;
}
if (found)
break;
}
if (!found)
return -ENOENT;
*pa_start = os->addr[j].pa_start;
*pa_end = os->addr[j].pa_end;
return 0;
}
/**
* _save_mpu_port_index - find and save the index to @oh's MPU port
* @oh: struct omap_hwmod *
*
* Determines the array index of the OCP slave port that the MPU uses
* to address the device, and saves it into the struct omap_hwmod.
* Intended to be called during hwmod registration only. No return
* value.
*/
static void __init _save_mpu_port_index(struct omap_hwmod *oh)
{
struct omap_hwmod_ocp_if *os = NULL;
struct list_head *p;
int i = 0;
if (!oh)
return;
if (!oh || oh->slaves_cnt == 0) oh->_int_flags |= _HWMOD_NO_MPU_PORT;
p = oh->slave_ports.next;
while (i < oh->slaves_cnt) {
os = _fetch_next_ocp_if(&p, &i);
if (os->user & OCP_USER_MPU) {
oh->_mpu_port = os;
oh->_int_flags &= ~_HWMOD_NO_MPU_PORT;
break;
}
}
return;
}
/**
* _find_mpu_rt_port - return omap_hwmod_ocp_if accessible by the MPU
* @oh: struct omap_hwmod *
*
* Given a pointer to a struct omap_hwmod record @oh, return a pointer
* to the struct omap_hwmod_ocp_if record that is used by the MPU to
* communicate with the IP block. This interface need not be directly
* connected to the MPU (and almost certainly is not), but is directly
* connected to the IP block represented by @oh. Returns a pointer
* to the struct omap_hwmod_ocp_if * upon success, or returns NULL upon
* error or if there does not appear to be a path from the MPU to this
* IP block.
*/
static struct omap_hwmod_ocp_if *_find_mpu_rt_port(struct omap_hwmod *oh)
{
if (!oh || oh->_int_flags & _HWMOD_NO_MPU_PORT || oh->slaves_cnt == 0)
return NULL; return NULL;
os = oh->slaves[index]; return oh->_mpu_port;
};
/**
* _find_mpu_rt_addr_space - return MPU register target address space for @oh
* @oh: struct omap_hwmod *
*
* Returns a pointer to the struct omap_hwmod_addr_space record representing
* the register target MPU address space; or returns NULL upon error.
*/
static struct omap_hwmod_addr_space * __init _find_mpu_rt_addr_space(struct omap_hwmod *oh)
{
struct omap_hwmod_ocp_if *os;
struct omap_hwmod_addr_space *mem;
int found = 0, i = 0;
if (!os->addr) os = _find_mpu_rt_port(oh);
if (!os || !os->addr)
return NULL; return NULL;
do { do {
...@@ -944,20 +1117,7 @@ static void __iomem * __init _find_mpu_rt_base(struct omap_hwmod *oh, u8 index) ...@@ -944,20 +1117,7 @@ static void __iomem * __init _find_mpu_rt_base(struct omap_hwmod *oh, u8 index)
found = 1; found = 1;
} while (!found && mem->pa_start != mem->pa_end); } while (!found && mem->pa_start != mem->pa_end);
if (found) { return (found) ? mem : NULL;
va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
if (!va_start) {
pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name);
return NULL;
}
pr_debug("omap_hwmod: %s: MPU register target at va %p\n",
oh->name, va_start);
} else {
pr_debug("omap_hwmod: %s: no MPU register target found\n",
oh->name);
}
return (found) ? va_start : NULL;
} }
/** /**
...@@ -1205,12 +1365,11 @@ static int _wait_target_ready(struct omap_hwmod *oh) ...@@ -1205,12 +1365,11 @@ static int _wait_target_ready(struct omap_hwmod *oh)
if (!oh) if (!oh)
return -EINVAL; return -EINVAL;
if (oh->_int_flags & _HWMOD_NO_MPU_PORT) if (oh->flags & HWMOD_NO_IDLEST)
return 0; return 0;
os = oh->slaves[oh->_mpu_port_index]; os = _find_mpu_rt_port(oh);
if (!os)
if (oh->flags & HWMOD_NO_IDLEST)
return 0; return 0;
/* XXX check module SIDLEMODE */ /* XXX check module SIDLEMODE */
...@@ -1377,14 +1536,74 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name) ...@@ -1377,14 +1536,74 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name)
} }
} }
/**
* _are_any_hardreset_lines_asserted - return true if part of @oh is hard-reset
* @oh: struct omap_hwmod *
*
* If any hardreset line associated with @oh is asserted, then return true.
* Otherwise, if @oh has no hardreset lines associated with it, or if
* no hardreset lines associated with @oh are asserted, then return false.
* This function is used to avoid executing some parts of the IP block
* enable/disable sequence if a hardreset line is set.
*/
static bool _are_any_hardreset_lines_asserted(struct omap_hwmod *oh)
{
int i;
if (oh->rst_lines_cnt == 0)
return false;
for (i = 0; i < oh->rst_lines_cnt; i++)
if (_read_hardreset(oh, oh->rst_lines[i].name) > 0)
return true;
return false;
}
/**
* _omap4_disable_module - enable CLKCTRL modulemode on OMAP4
* @oh: struct omap_hwmod *
*
* Disable the PRCM module mode related to the hwmod @oh.
* Return EINVAL if the modulemode is not supported and 0 in case of success.
*/
static int _omap4_disable_module(struct omap_hwmod *oh)
{
int v;
/* The module mode does not exist prior OMAP4 */
if (!cpu_is_omap44xx())
return -EINVAL;
if (!oh->clkdm || !oh->prcm.omap4.modulemode)
return -EINVAL;
pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__);
omap4_cminst_module_disable(oh->clkdm->prcm_partition,
oh->clkdm->cm_inst,
oh->clkdm->clkdm_offs,
oh->prcm.omap4.clkctrl_offs);
if (_are_any_hardreset_lines_asserted(oh))
return 0;
v = _omap4_wait_target_disable(oh);
if (v)
pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
oh->name);
return 0;
}
/** /**
* _ocp_softreset - reset an omap_hwmod via the OCP_SYSCONFIG bit * _ocp_softreset - reset an omap_hwmod via the OCP_SYSCONFIG bit
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
* *
* Resets an omap_hwmod @oh via the OCP_SYSCONFIG bit. hwmod must be * Resets an omap_hwmod @oh via the OCP_SYSCONFIG bit. hwmod must be
* enabled for this to work. Returns -EINVAL if the hwmod cannot be * enabled for this to work. Returns -ENOENT if the hwmod cannot be
* reset this way or if the hwmod is in the wrong state, -ETIMEDOUT if * reset this way, -EINVAL if the hwmod is in the wrong state,
* the module did not reset in time, or 0 upon success. * -ETIMEDOUT if the module did not reset in time, or 0 upon success.
* *
* In OMAP3 a specific SYSSTATUS register is used to get the reset status. * In OMAP3 a specific SYSSTATUS register is used to get the reset status.
* Starting in OMAP4, some IPs do not have SYSSTATUS registers and instead * Starting in OMAP4, some IPs do not have SYSSTATUS registers and instead
...@@ -1401,7 +1620,7 @@ static int _ocp_softreset(struct omap_hwmod *oh) ...@@ -1401,7 +1620,7 @@ static int _ocp_softreset(struct omap_hwmod *oh)
if (!oh->class->sysc || if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_SOFTRESET)) !(oh->class->sysc->sysc_flags & SYSC_HAS_SOFTRESET))
return -EINVAL; return -ENOENT;
/* clocks must be on for this operation */ /* clocks must be on for this operation */
if (oh->_state != _HWMOD_STATE_ENABLED) { if (oh->_state != _HWMOD_STATE_ENABLED) {
...@@ -1462,32 +1681,60 @@ static int _ocp_softreset(struct omap_hwmod *oh) ...@@ -1462,32 +1681,60 @@ static int _ocp_softreset(struct omap_hwmod *oh)
* _reset - reset an omap_hwmod * _reset - reset an omap_hwmod
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
* *
* Resets an omap_hwmod @oh. The default software reset mechanism for * Resets an omap_hwmod @oh. If the module has a custom reset
* most OMAP IP blocks is triggered via the OCP_SYSCONFIG.SOFTRESET * function pointer defined, then call it to reset the IP block, and
* bit. However, some hwmods cannot be reset via this method: some * pass along its return value to the caller. Otherwise, if the IP
* are not targets and therefore have no OCP header registers to * block has an OCP_SYSCONFIG register with a SOFTRESET bitfield
* access; others (like the IVA) have idiosyncratic reset sequences. * associated with it, call a function to reset the IP block via that
* So for these relatively rare cases, custom reset code can be * method, and pass along the return value to the caller. Finally, if
* supplied in the struct omap_hwmod_class .reset function pointer. * the IP block has some hardreset lines associated with it, assert
* Passes along the return value from either _reset() or the custom * all of those, but do _not_ deassert them. (This is because driver
* reset function - these must return -EINVAL if the hwmod cannot be * authors have expressed an apparent requirement to control the
* reset this way or if the hwmod is in the wrong state, -ETIMEDOUT if * deassertion of the hardreset lines themselves.)
* the module did not reset in time, or 0 upon success. *
* The default software reset mechanism for most OMAP IP blocks is
* triggered via the OCP_SYSCONFIG.SOFTRESET bit. However, some
* hwmods cannot be reset via this method. Some are not targets and
* therefore have no OCP header registers to access. Others (like the
* IVA) have idiosyncratic reset sequences. So for these relatively
* rare cases, custom reset code can be supplied in the struct
* omap_hwmod_class .reset function pointer. Passes along the return
* value from either _ocp_softreset() or the custom reset function -
* these must return -EINVAL if the hwmod cannot be reset this way or
* if the hwmod is in the wrong state, -ETIMEDOUT if the module did
* not reset in time, or 0 upon success.
*/ */
static int _reset(struct omap_hwmod *oh) static int _reset(struct omap_hwmod *oh)
{ {
int ret; int i, r;
pr_debug("omap_hwmod: %s: resetting\n", oh->name); pr_debug("omap_hwmod: %s: resetting\n", oh->name);
ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); if (oh->class->reset) {
r = oh->class->reset(oh);
} else {
if (oh->rst_lines_cnt > 0) {
for (i = 0; i < oh->rst_lines_cnt; i++)
_assert_hardreset(oh, oh->rst_lines[i].name);
return 0;
} else {
r = _ocp_softreset(oh);
if (r == -ENOENT)
r = 0;
}
}
/*
* OCP_SYSCONFIG bits need to be reprogrammed after a
* softreset. The _enable() function should be split to avoid
* the rewrite of the OCP_SYSCONFIG register.
*/
if (oh->class->sysc) { if (oh->class->sysc) {
_update_sysc_cache(oh); _update_sysc_cache(oh);
_enable_sysc(oh); _enable_sysc(oh);
} }
return ret; return r;
} }
/** /**
...@@ -1506,10 +1753,9 @@ static int _enable(struct omap_hwmod *oh) ...@@ -1506,10 +1753,9 @@ static int _enable(struct omap_hwmod *oh)
pr_debug("omap_hwmod: %s: enabling\n", oh->name); pr_debug("omap_hwmod: %s: enabling\n", oh->name);
/* /*
* hwmods with HWMOD_INIT_NO_IDLE flag set are left * hwmods with HWMOD_INIT_NO_IDLE flag set are left in enabled
* in enabled state at init. * state at init. Now that someone is really trying to enable
* Now that someone is really trying to enable them, * them, just ensure that the hwmod mux is set.
* just ensure that the hwmod mux is set.
*/ */
if (oh->_int_flags & _HWMOD_SKIP_ENABLE) { if (oh->_int_flags & _HWMOD_SKIP_ENABLE) {
/* /*
...@@ -1532,15 +1778,17 @@ static int _enable(struct omap_hwmod *oh) ...@@ -1532,15 +1778,17 @@ static int _enable(struct omap_hwmod *oh)
return -EINVAL; return -EINVAL;
} }
/* /*
* If an IP contains only one HW reset line, then de-assert it in order * If an IP block contains HW reset lines and any of them are
* to allow the module state transition. Otherwise the PRCM will return * asserted, we let integration code associated with that
* Intransition status, and the init will failed. * block handle the enable. We've received very little
* information on what those driver authors need, and until
* detailed information is provided and the driver code is
* posted to the public lists, this is probably the best we
* can do.
*/ */
if ((oh->_state == _HWMOD_STATE_INITIALIZED || if (_are_any_hardreset_lines_asserted(oh))
oh->_state == _HWMOD_STATE_DISABLED) && oh->rst_lines_cnt == 1) return 0;
_deassert_hardreset(oh, oh->rst_lines[0].name);
/* Mux pins for device runtime if populated */ /* Mux pins for device runtime if populated */
if (oh->mux && (!oh->mux->enabled || if (oh->mux && (!oh->mux->enabled ||
...@@ -1615,6 +1863,9 @@ static int _idle(struct omap_hwmod *oh) ...@@ -1615,6 +1863,9 @@ static int _idle(struct omap_hwmod *oh)
return -EINVAL; return -EINVAL;
} }
if (_are_any_hardreset_lines_asserted(oh))
return 0;
if (oh->class->sysc) if (oh->class->sysc)
_idle_sysc(oh); _idle_sysc(oh);
_del_initiator_dep(oh, mpu_oh); _del_initiator_dep(oh, mpu_oh);
...@@ -1687,7 +1938,7 @@ int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle) ...@@ -1687,7 +1938,7 @@ int omap_hwmod_set_ocp_autoidle(struct omap_hwmod *oh, u8 autoidle)
*/ */
static int _shutdown(struct omap_hwmod *oh) static int _shutdown(struct omap_hwmod *oh)
{ {
int ret; int ret, i;
u8 prev_state; u8 prev_state;
if (oh->_state != _HWMOD_STATE_IDLE && if (oh->_state != _HWMOD_STATE_IDLE &&
...@@ -1697,6 +1948,9 @@ static int _shutdown(struct omap_hwmod *oh) ...@@ -1697,6 +1948,9 @@ static int _shutdown(struct omap_hwmod *oh)
return -EINVAL; return -EINVAL;
} }
if (_are_any_hardreset_lines_asserted(oh))
return 0;
pr_debug("omap_hwmod: %s: disabling\n", oh->name); pr_debug("omap_hwmod: %s: disabling\n", oh->name);
if (oh->class->pre_shutdown) { if (oh->class->pre_shutdown) {
...@@ -1728,12 +1982,8 @@ static int _shutdown(struct omap_hwmod *oh) ...@@ -1728,12 +1982,8 @@ static int _shutdown(struct omap_hwmod *oh)
} }
/* XXX Should this code also force-disable the optional clocks? */ /* XXX Should this code also force-disable the optional clocks? */
/* for (i = 0; i < oh->rst_lines_cnt; i++)
* If an IP contains only one HW reset line, then assert it _assert_hardreset(oh, oh->rst_lines[i].name);
* after disabling the clocks and before shutting down the IP.
*/
if (oh->rst_lines_cnt == 1)
_assert_hardreset(oh, oh->rst_lines[0].name);
/* Mux pins to safe mode or use populated off mode values */ /* Mux pins to safe mode or use populated off mode values */
if (oh->mux) if (oh->mux)
...@@ -1745,59 +1995,186 @@ static int _shutdown(struct omap_hwmod *oh) ...@@ -1745,59 +1995,186 @@ static int _shutdown(struct omap_hwmod *oh)
} }
/** /**
* _setup - do initial configuration of omap_hwmod * _init_mpu_rt_base - populate the virtual address for a hwmod
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod * to locate the virtual address
* *
* Writes the CLOCKACTIVITY bits @clockact to the hwmod @oh * Cache the virtual address used by the MPU to access this IP block's
* OCP_SYSCONFIG register. Returns 0. * registers. This address is needed early so the OCP registers that
* are part of the device's address space can be ioremapped properly.
* No return value.
*/ */
static int _setup(struct omap_hwmod *oh, void *data) static void __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data)
{ {
int i, r; struct omap_hwmod_addr_space *mem;
u8 postsetup_state; void __iomem *va_start;
if (!oh)
return;
_save_mpu_port_index(oh);
if (oh->_state != _HWMOD_STATE_CLKS_INITED) if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
return;
mem = _find_mpu_rt_addr_space(oh);
if (!mem) {
pr_debug("omap_hwmod: %s: no MPU register target found\n",
oh->name);
return;
}
va_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);
if (!va_start) {
pr_err("omap_hwmod: %s: Could not ioremap\n", oh->name);
return;
}
pr_debug("omap_hwmod: %s: MPU register target at va %p\n",
oh->name, va_start);
oh->_mpu_rt_va = va_start;
}
/**
* _init - initialize internal data for the hwmod @oh
* @oh: struct omap_hwmod *
* @n: (unused)
*
* Look up the clocks and the address space used by the MPU to access
* registers belonging to the hwmod @oh. @oh must already be
* registered at this point. This is the first of two phases for
* hwmod initialization. Code called here does not touch any hardware
* registers, it simply prepares internal data structures. Returns 0
* upon success or if the hwmod isn't registered, or -EINVAL upon
* failure.
*/
static int __init _init(struct omap_hwmod *oh, void *data)
{
int r;
if (oh->_state != _HWMOD_STATE_REGISTERED)
return 0; return 0;
/* Set iclk autoidle mode */ _init_mpu_rt_base(oh, NULL);
if (oh->slaves_cnt > 0) {
for (i = 0; i < oh->slaves_cnt; i++) {
struct omap_hwmod_ocp_if *os = oh->slaves[i];
struct clk *c = os->_clk;
if (!c) r = _init_clocks(oh, NULL);
continue; if (IS_ERR_VALUE(r)) {
WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh->name);
return -EINVAL;
}
if (os->flags & OCPIF_SWSUP_IDLE) { oh->_state = _HWMOD_STATE_INITIALIZED;
/* XXX omap_iclk_deny_idle(c); */
} else { return 0;
/* XXX omap_iclk_allow_idle(c); */ }
clk_enable(c);
} /**
* _setup_iclk_autoidle - configure an IP block's interface clocks
* @oh: struct omap_hwmod *
*
* Set up the module's interface clocks. XXX This function is still mostly
* a stub; implementing this properly requires iclk autoidle usecounting in
* the clock code. No return value.
*/
static void __init _setup_iclk_autoidle(struct omap_hwmod *oh)
{
struct omap_hwmod_ocp_if *os;
struct list_head *p;
int i = 0;
if (oh->_state != _HWMOD_STATE_INITIALIZED)
return;
p = oh->slave_ports.next;
while (i < oh->slaves_cnt) {
os = _fetch_next_ocp_if(&p, &i);
if (!os->_clk)
continue;
if (os->flags & OCPIF_SWSUP_IDLE) {
/* XXX omap_iclk_deny_idle(c); */
} else {
/* XXX omap_iclk_allow_idle(c); */
clk_enable(os->_clk);
} }
} }
oh->_state = _HWMOD_STATE_INITIALIZED; return;
}
/* /**
* In the case of hwmod with hardreset that should not be * _setup_reset - reset an IP block during the setup process
* de-assert at boot time, we have to keep the module * @oh: struct omap_hwmod *
* initialized, because we cannot enable it properly with the *
* reset asserted. Exit without warning because that behavior is * Reset the IP block corresponding to the hwmod @oh during the setup
* expected. * process. The IP block is first enabled so it can be successfully
*/ * reset. Returns 0 upon success or a negative error code upon
if ((oh->flags & HWMOD_INIT_NO_RESET) && oh->rst_lines_cnt == 1) * failure.
return 0; */
static int __init _setup_reset(struct omap_hwmod *oh)
{
int r;
r = _enable(oh); if (oh->_state != _HWMOD_STATE_INITIALIZED)
if (r) { return -EINVAL;
pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n",
oh->name, oh->_state); if (oh->rst_lines_cnt == 0) {
return 0; r = _enable(oh);
if (r) {
pr_warning("omap_hwmod: %s: cannot be enabled for reset (%d)\n",
oh->name, oh->_state);
return -EINVAL;
}
} }
if (!(oh->flags & HWMOD_INIT_NO_RESET)) if (!(oh->flags & HWMOD_INIT_NO_RESET))
_reset(oh); r = _reset(oh);
return r;
}
/**
* _setup_postsetup - transition to the appropriate state after _setup
* @oh: struct omap_hwmod *
*
* Place an IP block represented by @oh into a "post-setup" state --
* either IDLE, ENABLED, or DISABLED. ("post-setup" simply means that
* this function is called at the end of _setup().) The postsetup
* state for an IP block can be changed by calling
* omap_hwmod_enter_postsetup_state() early in the boot process,
* before one of the omap_hwmod_setup*() functions are called for the
* IP block.
*
* The IP block stays in this state until a PM runtime-based driver is
* loaded for that IP block. A post-setup state of IDLE is
* appropriate for almost all IP blocks with runtime PM-enabled
* drivers, since those drivers are able to enable the IP block. A
* post-setup state of ENABLED is appropriate for kernels with PM
* runtime disabled. The DISABLED state is appropriate for unusual IP
* blocks such as the MPU WDTIMER on kernels without WDTIMER drivers
* included, since the WDTIMER starts running on reset and will reset
* the MPU if left active.
*
* This post-setup mechanism is deprecated. Once all of the OMAP
* drivers have been converted to use PM runtime, and all of the IP
* block data and interconnect data is available to the hwmod code, it
* should be possible to replace this mechanism with a "lazy reset"
* arrangement. In a "lazy reset" setup, each IP block is enabled
* when the driver first probes, then all remaining IP blocks without
* drivers are either shut down or enabled after the drivers have
* loaded. However, this cannot take place until the above
* preconditions have been met, since otherwise the late reset code
* has no way of knowing which IP blocks are in use by drivers, and
* which ones are unused.
*
* No return value.
*/
static void __init _setup_postsetup(struct omap_hwmod *oh)
{
u8 postsetup_state;
if (oh->rst_lines_cnt > 0)
return;
postsetup_state = oh->_postsetup_state; postsetup_state = oh->_postsetup_state;
if (postsetup_state == _HWMOD_STATE_UNKNOWN) if (postsetup_state == _HWMOD_STATE_UNKNOWN)
...@@ -1821,6 +2198,35 @@ static int _setup(struct omap_hwmod *oh, void *data) ...@@ -1821,6 +2198,35 @@ static int _setup(struct omap_hwmod *oh, void *data)
WARN(1, "hwmod: %s: unknown postsetup state %d! defaulting to enabled\n", WARN(1, "hwmod: %s: unknown postsetup state %d! defaulting to enabled\n",
oh->name, postsetup_state); oh->name, postsetup_state);
return;
}
/**
* _setup - prepare IP block hardware for use
* @oh: struct omap_hwmod *
* @n: (unused, pass NULL)
*
* Configure the IP block represented by @oh. This may include
* enabling the IP block, resetting it, and placing it into a
* post-setup state, depending on the type of IP block and applicable
* flags. IP blocks are reset to prevent any previous configuration
* by the bootloader or previous operating system from interfering
* with power management or other parts of the system. The reset can
* be avoided; see omap_hwmod_no_setup_reset(). This is the second of
* two phases for hwmod initialization. Code called here generally
* affects the IP block hardware, or system integration hardware
* associated with the IP block. Returns 0.
*/
static int __init _setup(struct omap_hwmod *oh, void *data)
{
if (oh->_state != _HWMOD_STATE_INITIALIZED)
return 0;
_setup_iclk_autoidle(oh);
if (!_setup_reset(oh))
_setup_postsetup(oh);
return 0; return 0;
} }
...@@ -1843,8 +2249,6 @@ static int _setup(struct omap_hwmod *oh, void *data) ...@@ -1843,8 +2249,6 @@ static int _setup(struct omap_hwmod *oh, void *data)
*/ */
static int __init _register(struct omap_hwmod *oh) static int __init _register(struct omap_hwmod *oh)
{ {
int ms_id;
if (!oh || !oh->name || !oh->class || !oh->class->name || if (!oh || !oh->name || !oh->class || !oh->class->name ||
(oh->_state != _HWMOD_STATE_UNKNOWN)) (oh->_state != _HWMOD_STATE_UNKNOWN))
return -EINVAL; return -EINVAL;
...@@ -1854,14 +2258,10 @@ static int __init _register(struct omap_hwmod *oh) ...@@ -1854,14 +2258,10 @@ static int __init _register(struct omap_hwmod *oh)
if (_lookup(oh->name)) if (_lookup(oh->name))
return -EEXIST; return -EEXIST;
ms_id = _find_mpu_port_index(oh);
if (!IS_ERR_VALUE(ms_id))
oh->_mpu_port_index = ms_id;
else
oh->_int_flags |= _HWMOD_NO_MPU_PORT;
list_add_tail(&oh->node, &omap_hwmod_list); list_add_tail(&oh->node, &omap_hwmod_list);
INIT_LIST_HEAD(&oh->master_ports);
INIT_LIST_HEAD(&oh->slave_ports);
spin_lock_init(&oh->_lock); spin_lock_init(&oh->_lock);
oh->_state = _HWMOD_STATE_REGISTERED; oh->_state = _HWMOD_STATE_REGISTERED;
...@@ -1876,6 +2276,160 @@ static int __init _register(struct omap_hwmod *oh) ...@@ -1876,6 +2276,160 @@ static int __init _register(struct omap_hwmod *oh)
return 0; return 0;
} }
/**
* _alloc_links - return allocated memory for hwmod links
* @ml: pointer to a struct omap_hwmod_link * for the master link
* @sl: pointer to a struct omap_hwmod_link * for the slave link
*
* Return pointers to two struct omap_hwmod_link records, via the
* addresses pointed to by @ml and @sl. Will first attempt to return
* memory allocated as part of a large initial block, but if that has
* been exhausted, will allocate memory itself. Since ideally this
* second allocation path will never occur, the number of these
* 'supplemental' allocations will be logged when debugging is
* enabled. Returns 0.
*/
static int __init _alloc_links(struct omap_hwmod_link **ml,
struct omap_hwmod_link **sl)
{
unsigned int sz;
if ((free_ls + LINKS_PER_OCP_IF) <= max_ls) {
*ml = &linkspace[free_ls++];
*sl = &linkspace[free_ls++];
return 0;
}
sz = sizeof(struct omap_hwmod_link) * LINKS_PER_OCP_IF;
*sl = NULL;
*ml = alloc_bootmem(sz);
memset(*ml, 0, sz);
*sl = (void *)(*ml) + sizeof(struct omap_hwmod_link);
ls_supp++;
pr_debug("omap_hwmod: supplemental link allocations needed: %d\n",
ls_supp * LINKS_PER_OCP_IF);
return 0;
};
/**
* _add_link - add an interconnect between two IP blocks
* @oi: pointer to a struct omap_hwmod_ocp_if record
*
* Add struct omap_hwmod_link records connecting the master IP block
* specified in @oi->master to @oi, and connecting the slave IP block
* specified in @oi->slave to @oi. This code is assumed to run before
* preemption or SMP has been enabled, thus avoiding the need for
* locking in this code. Changes to this assumption will require
* additional locking. Returns 0.
*/
static int __init _add_link(struct omap_hwmod_ocp_if *oi)
{
struct omap_hwmod_link *ml, *sl;
pr_debug("omap_hwmod: %s -> %s: adding link\n", oi->master->name,
oi->slave->name);
_alloc_links(&ml, &sl);
ml->ocp_if = oi;
INIT_LIST_HEAD(&ml->node);
list_add(&ml->node, &oi->master->master_ports);
oi->master->masters_cnt++;
sl->ocp_if = oi;
INIT_LIST_HEAD(&sl->node);
list_add(&sl->node, &oi->slave->slave_ports);
oi->slave->slaves_cnt++;
return 0;
}
/**
* _register_link - register a struct omap_hwmod_ocp_if
* @oi: struct omap_hwmod_ocp_if *
*
* Registers the omap_hwmod_ocp_if record @oi. Returns -EEXIST if it
* has already been registered; -EINVAL if @oi is NULL or if the
* record pointed to by @oi is missing required fields; or 0 upon
* success.
*
* XXX The data should be copied into bootmem, so the original data
* should be marked __initdata and freed after init. This would allow
* unneeded omap_hwmods to be freed on multi-OMAP configurations.
*/
static int __init _register_link(struct omap_hwmod_ocp_if *oi)
{
if (!oi || !oi->master || !oi->slave || !oi->user)
return -EINVAL;
if (oi->_int_flags & _OCPIF_INT_FLAGS_REGISTERED)
return -EEXIST;
pr_debug("omap_hwmod: registering link from %s to %s\n",
oi->master->name, oi->slave->name);
/*
* Register the connected hwmods, if they haven't been
* registered already
*/
if (oi->master->_state != _HWMOD_STATE_REGISTERED)
_register(oi->master);
if (oi->slave->_state != _HWMOD_STATE_REGISTERED)
_register(oi->slave);
_add_link(oi);
oi->_int_flags |= _OCPIF_INT_FLAGS_REGISTERED;
return 0;
}
/**
* _alloc_linkspace - allocate large block of hwmod links
* @ois: pointer to an array of struct omap_hwmod_ocp_if records to count
*
* Allocate a large block of struct omap_hwmod_link records. This
* improves boot time significantly by avoiding the need to allocate
* individual records one by one. If the number of records to
* allocate in the block hasn't been manually specified, this function
* will count the number of struct omap_hwmod_ocp_if records in @ois
* and use that to determine the allocation size. For SoC families
* that require multiple list registrations, such as OMAP3xxx, this
* estimation process isn't optimal, so manual estimation is advised
* in those cases. Returns -EEXIST if the allocation has already occurred
* or 0 upon success.
*/
static int __init _alloc_linkspace(struct omap_hwmod_ocp_if **ois)
{
unsigned int i = 0;
unsigned int sz;
if (linkspace) {
WARN(1, "linkspace already allocated\n");
return -EEXIST;
}
if (max_ls == 0)
while (ois[i++])
max_ls += LINKS_PER_OCP_IF;
sz = sizeof(struct omap_hwmod_link) * max_ls;
pr_debug("omap_hwmod: %s: allocating %d byte linkspace (%d links)\n",
__func__, sz, max_ls);
linkspace = alloc_bootmem(sz);
memset(linkspace, 0, sz);
return 0;
}
/* Public functions */ /* Public functions */
...@@ -2004,120 +2558,101 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), ...@@ -2004,120 +2558,101 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
} }
/** /**
* omap_hwmod_register - register an array of hwmods * omap_hwmod_register_links - register an array of hwmod links
* @ohs: pointer to an array of omap_hwmods to register * @ois: pointer to an array of omap_hwmod_ocp_if to register
* *
* Intended to be called early in boot before the clock framework is * Intended to be called early in boot before the clock framework is
* initialized. If @ohs is not null, will register all omap_hwmods * initialized. If @ois is not null, will register all omap_hwmods
* listed in @ohs that are valid for this chip. Returns 0. * listed in @ois that are valid for this chip. Returns 0.
*/ */
int __init omap_hwmod_register(struct omap_hwmod **ohs) int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois)
{ {
int r, i; int r, i;
if (!ohs) if (!ois)
return 0; return 0;
if (!linkspace) {
if (_alloc_linkspace(ois)) {
pr_err("omap_hwmod: could not allocate link space\n");
return -ENOMEM;
}
}
i = 0; i = 0;
do { do {
r = _register(ohs[i]); r = _register_link(ois[i]);
WARN(r, "omap_hwmod: %s: _register returned %d\n", ohs[i]->name, WARN(r && r != -EEXIST,
r); "omap_hwmod: _register_link(%s -> %s) returned %d\n",
} while (ohs[++i]); ois[i]->master->name, ois[i]->slave->name, r);
} while (ois[++i]);
return 0; return 0;
} }
/* /**
* _populate_mpu_rt_base - populate the virtual address for a hwmod * _ensure_mpu_hwmod_is_setup - ensure the MPU SS hwmod is init'ed and set up
* @oh: pointer to the hwmod currently being set up (usually not the MPU)
* *
* Must be called only from omap_hwmod_setup_*() so ioremap works properly. * If the hwmod data corresponding to the MPU subsystem IP block
* Assumes the caller takes care of locking if needed. * hasn't been initialized and set up yet, do so now. This must be
* done first since sleep dependencies may be added from other hwmods
* to the MPU. Intended to be called only by omap_hwmod_setup*(). No
* return value.
*/ */
static int __init _populate_mpu_rt_base(struct omap_hwmod *oh, void *data) static void __init _ensure_mpu_hwmod_is_setup(struct omap_hwmod *oh)
{ {
if (oh->_state != _HWMOD_STATE_REGISTERED) if (!mpu_oh || mpu_oh->_state == _HWMOD_STATE_UNKNOWN)
return 0; pr_err("omap_hwmod: %s: MPU initiator hwmod %s not yet registered\n",
__func__, MPU_INITIATOR_NAME);
if (oh->_int_flags & _HWMOD_NO_MPU_PORT) else if (mpu_oh->_state == _HWMOD_STATE_REGISTERED && oh != mpu_oh)
return 0; omap_hwmod_setup_one(MPU_INITIATOR_NAME);
oh->_mpu_rt_va = _find_mpu_rt_base(oh, oh->_mpu_port_index);
return 0;
} }
/** /**
* omap_hwmod_setup_one - set up a single hwmod * omap_hwmod_setup_one - set up a single hwmod
* @oh_name: const char * name of the already-registered hwmod to set up * @oh_name: const char * name of the already-registered hwmod to set up
* *
* Must be called after omap2_clk_init(). Resolves the struct clk * Initialize and set up a single hwmod. Intended to be used for a
* names to struct clk pointers for each registered omap_hwmod. Also * small number of early devices, such as the timer IP blocks used for
* calls _setup() on each hwmod. Returns -EINVAL upon error or 0 upon * the scheduler clock. Must be called after omap2_clk_init().
* success. * Resolves the struct clk names to struct clk pointers for each
* registered omap_hwmod. Also calls _setup() on each hwmod. Returns
* -EINVAL upon error or 0 upon success.
*/ */
int __init omap_hwmod_setup_one(const char *oh_name) int __init omap_hwmod_setup_one(const char *oh_name)
{ {
struct omap_hwmod *oh; struct omap_hwmod *oh;
int r;
pr_debug("omap_hwmod: %s: %s\n", oh_name, __func__); pr_debug("omap_hwmod: %s: %s\n", oh_name, __func__);
if (!mpu_oh) {
pr_err("omap_hwmod: %s: cannot setup_one: MPU initiator hwmod %s not yet registered\n",
oh_name, MPU_INITIATOR_NAME);
return -EINVAL;
}
oh = _lookup(oh_name); oh = _lookup(oh_name);
if (!oh) { if (!oh) {
WARN(1, "omap_hwmod: %s: hwmod not yet registered\n", oh_name); WARN(1, "omap_hwmod: %s: hwmod not yet registered\n", oh_name);
return -EINVAL; return -EINVAL;
} }
if (mpu_oh->_state == _HWMOD_STATE_REGISTERED && oh != mpu_oh) _ensure_mpu_hwmod_is_setup(oh);
omap_hwmod_setup_one(MPU_INITIATOR_NAME);
r = _populate_mpu_rt_base(oh, NULL);
if (IS_ERR_VALUE(r)) {
WARN(1, "omap_hwmod: %s: couldn't set mpu_rt_base\n", oh_name);
return -EINVAL;
}
r = _init_clocks(oh, NULL);
if (IS_ERR_VALUE(r)) {
WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh_name);
return -EINVAL;
}
_init(oh, NULL);
_setup(oh, NULL); _setup(oh, NULL);
return 0; return 0;
} }
/** /**
* omap_hwmod_setup - do some post-clock framework initialization * omap_hwmod_setup_all - set up all registered IP blocks
* *
* Must be called after omap2_clk_init(). Resolves the struct clk names * Initialize and set up all IP blocks registered with the hwmod code.
* to struct clk pointers for each registered omap_hwmod. Also calls * Must be called after omap2_clk_init(). Resolves the struct clk
* _setup() on each hwmod. Returns 0 upon success. * names to struct clk pointers for each registered omap_hwmod. Also
* calls _setup() on each hwmod. Returns 0 upon success.
*/ */
static int __init omap_hwmod_setup_all(void) static int __init omap_hwmod_setup_all(void)
{ {
int r; _ensure_mpu_hwmod_is_setup(NULL);
if (!mpu_oh) {
pr_err("omap_hwmod: %s: MPU initiator hwmod %s not yet registered\n",
__func__, MPU_INITIATOR_NAME);
return -EINVAL;
}
r = omap_hwmod_for_each(_populate_mpu_rt_base, NULL);
r = omap_hwmod_for_each(_init_clocks, NULL);
WARN(IS_ERR_VALUE(r),
"omap_hwmod: %s: _init_clocks failed\n", __func__);
omap_hwmod_for_each(_init, NULL);
omap_hwmod_for_each(_setup, NULL); omap_hwmod_for_each(_setup, NULL);
return 0; return 0;
...@@ -2274,6 +2809,10 @@ int omap_hwmod_reset(struct omap_hwmod *oh) ...@@ -2274,6 +2809,10 @@ int omap_hwmod_reset(struct omap_hwmod *oh)
return r; return r;
} }
/*
* IP block data retrieval functions
*/
/** /**
* omap_hwmod_count_resources - count number of struct resources needed by hwmod * omap_hwmod_count_resources - count number of struct resources needed by hwmod
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
...@@ -2292,12 +2831,19 @@ int omap_hwmod_reset(struct omap_hwmod *oh) ...@@ -2292,12 +2831,19 @@ int omap_hwmod_reset(struct omap_hwmod *oh)
*/ */
int omap_hwmod_count_resources(struct omap_hwmod *oh) int omap_hwmod_count_resources(struct omap_hwmod *oh)
{ {
int ret, i; struct omap_hwmod_ocp_if *os;
struct list_head *p;
int ret;
int i = 0;
ret = _count_mpu_irqs(oh) + _count_sdma_reqs(oh); ret = _count_mpu_irqs(oh) + _count_sdma_reqs(oh);
for (i = 0; i < oh->slaves_cnt; i++) p = oh->slave_ports.next;
ret += _count_ocp_if_addr_spaces(oh->slaves[i]);
while (i < oh->slaves_cnt) {
os = _fetch_next_ocp_if(&p, &i);
ret += _count_ocp_if_addr_spaces(os);
}
return ret; return ret;
} }
...@@ -2314,7 +2860,9 @@ int omap_hwmod_count_resources(struct omap_hwmod *oh) ...@@ -2314,7 +2860,9 @@ int omap_hwmod_count_resources(struct omap_hwmod *oh)
*/ */
int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
{ {
int i, j, mpu_irqs_cnt, sdma_reqs_cnt; struct omap_hwmod_ocp_if *os;
struct list_head *p;
int i, j, mpu_irqs_cnt, sdma_reqs_cnt, addr_cnt;
int r = 0; int r = 0;
/* For each IRQ, DMA, memory area, fill in array.*/ /* For each IRQ, DMA, memory area, fill in array.*/
...@@ -2337,11 +2885,11 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) ...@@ -2337,11 +2885,11 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
r++; r++;
} }
for (i = 0; i < oh->slaves_cnt; i++) { p = oh->slave_ports.next;
struct omap_hwmod_ocp_if *os;
int addr_cnt;
os = oh->slaves[i]; i = 0;
while (i < oh->slaves_cnt) {
os = _fetch_next_ocp_if(&p, &i);
addr_cnt = _count_ocp_if_addr_spaces(os); addr_cnt = _count_ocp_if_addr_spaces(os);
for (j = 0; j < addr_cnt; j++) { for (j = 0; j < addr_cnt; j++) {
...@@ -2356,6 +2904,69 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) ...@@ -2356,6 +2904,69 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
return r; return r;
} }
/**
* omap_hwmod_get_resource_byname - fetch IP block integration data by name
* @oh: struct omap_hwmod * to operate on
* @type: one of the IORESOURCE_* constants from include/linux/ioport.h
* @name: pointer to the name of the data to fetch (optional)
* @rsrc: pointer to a struct resource, allocated by the caller
*
* Retrieve MPU IRQ, SDMA request line, or address space start/end
* data for the IP block pointed to by @oh. The data will be filled
* into a struct resource record pointed to by @rsrc. The struct
* resource must be allocated by the caller. When @name is non-null,
* the data associated with the matching entry in the IRQ/SDMA/address
* space hwmod data arrays will be returned. If @name is null, the
* first array entry will be returned. Data order is not meaningful
* in hwmod data, so callers are strongly encouraged to use a non-null
* @name whenever possible to avoid unpredictable effects if hwmod
* data is later added that causes data ordering to change. This
* function is only intended for use by OMAP core code. Device
* drivers should not call this function - the appropriate bus-related
* data accessor functions should be used instead. Returns 0 upon
* success or a negative error code upon error.
*/
int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
const char *name, struct resource *rsrc)
{
int r;
unsigned int irq, dma;
u32 pa_start, pa_end;
if (!oh || !rsrc)
return -EINVAL;
if (type == IORESOURCE_IRQ) {
r = _get_mpu_irq_by_name(oh, name, &irq);
if (r)
return r;
rsrc->start = irq;
rsrc->end = irq;
} else if (type == IORESOURCE_DMA) {
r = _get_sdma_req_by_name(oh, name, &dma);
if (r)
return r;
rsrc->start = dma;
rsrc->end = dma;
} else if (type == IORESOURCE_MEM) {
r = _get_addr_space_by_name(oh, name, &pa_start, &pa_end);
if (r)
return r;
rsrc->start = pa_start;
rsrc->end = pa_end;
} else {
return -EINVAL;
}
rsrc->flags = type;
rsrc->name = name;
return 0;
}
/** /**
* omap_hwmod_get_pwrdm - return pointer to this module's main powerdomain * omap_hwmod_get_pwrdm - return pointer to this module's main powerdomain
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
...@@ -2370,6 +2981,7 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res) ...@@ -2370,6 +2981,7 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)
struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh) struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh)
{ {
struct clk *c; struct clk *c;
struct omap_hwmod_ocp_if *oi;
if (!oh) if (!oh)
return NULL; return NULL;
...@@ -2377,9 +2989,10 @@ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh) ...@@ -2377,9 +2989,10 @@ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh)
if (oh->_clk) { if (oh->_clk) {
c = oh->_clk; c = oh->_clk;
} else { } else {
if (oh->_int_flags & _HWMOD_NO_MPU_PORT) oi = _find_mpu_rt_port(oh);
if (!oi)
return NULL; return NULL;
c = oh->slaves[oh->_mpu_port_index]->_clk; c = oi->_clk;
} }
if (!c->clkdm) if (!c->clkdm)
...@@ -2653,10 +3266,10 @@ int omap_hwmod_for_each_by_class(const char *classname, ...@@ -2653,10 +3266,10 @@ int omap_hwmod_for_each_by_class(const char *classname,
* @state: state that _setup() should leave the hwmod in * @state: state that _setup() should leave the hwmod in
* *
* Sets the hwmod state that @oh will enter at the end of _setup() * Sets the hwmod state that @oh will enter at the end of _setup()
* (called by omap_hwmod_setup_*()). Only valid to call between * (called by omap_hwmod_setup_*()). See also the documentation
* calling omap_hwmod_register() and omap_hwmod_setup_*(). Returns * for _setup_postsetup(), above. Returns 0 upon success or
* 0 upon success or -EINVAL if there is a problem with the arguments * -EINVAL if there is a problem with the arguments or if the hwmod is
* or if the hwmod is in the wrong state. * in the wrong state.
*/ */
int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state) int omap_hwmod_set_postsetup_state(struct omap_hwmod *oh, u8 state)
{ {
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* omap_hwmod_2420_data.c - hardware modules present on the OMAP2420 chips * omap_hwmod_2420_data.c - hardware modules present on the OMAP2420 chips
* *
* Copyright (C) 2009-2011 Nokia Corporation * Copyright (C) 2009-2011 Nokia Corporation
* Copyright (C) 2012 Texas Instruments, Inc.
* Paul Walmsley * Paul Walmsley
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -32,1073 +33,284 @@ ...@@ -32,1073 +33,284 @@
/* /*
* OMAP2420 hardware module integration data * OMAP2420 hardware module integration data
* *
* ALl of the data in this section should be autogeneratable from the * All of the data in this section should be autogeneratable from the
* TI hardware database or other technical documentation. Data that * TI hardware database or other technical documentation. Data that
* is driver-specific or driver-kernel integration-specific belongs * is driver-specific or driver-kernel integration-specific belongs
* elsewhere. * elsewhere.
*/ */
static struct omap_hwmod omap2420_mpu_hwmod;
static struct omap_hwmod omap2420_iva_hwmod;
static struct omap_hwmod omap2420_l3_main_hwmod;
static struct omap_hwmod omap2420_l4_core_hwmod;
static struct omap_hwmod omap2420_dss_core_hwmod;
static struct omap_hwmod omap2420_dss_dispc_hwmod;
static struct omap_hwmod omap2420_dss_rfbi_hwmod;
static struct omap_hwmod omap2420_dss_venc_hwmod;
static struct omap_hwmod omap2420_wd_timer2_hwmod;
static struct omap_hwmod omap2420_gpio1_hwmod;
static struct omap_hwmod omap2420_gpio2_hwmod;
static struct omap_hwmod omap2420_gpio3_hwmod;
static struct omap_hwmod omap2420_gpio4_hwmod;
static struct omap_hwmod omap2420_dma_system_hwmod;
static struct omap_hwmod omap2420_mcspi1_hwmod;
static struct omap_hwmod omap2420_mcspi2_hwmod;
/* L3 -> L4_CORE interface */
static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
.master = &omap2420_l3_main_hwmod,
.slave = &omap2420_l4_core_hwmod,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* MPU -> L3 interface */
static struct omap_hwmod_ocp_if omap2420_mpu__l3_main = {
.master = &omap2420_mpu_hwmod,
.slave = &omap2420_l3_main_hwmod,
.user = OCP_USER_MPU,
};
/* Slave interfaces on the L3 interconnect */
static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = {
&omap2420_mpu__l3_main,
};
/* DSS -> l3 */
static struct omap_hwmod_ocp_if omap2420_dss__l3 = {
.master = &omap2420_dss_core_hwmod,
.slave = &omap2420_l3_main_hwmod,
.fw = {
.omap2 = {
.l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS,
.flags = OMAP_FIREWALL_L3,
}
},
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* Master interfaces on the L3 interconnect */
static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
&omap2420_l3_main__l4_core,
};
/* L3 */
static struct omap_hwmod omap2420_l3_main_hwmod = {
.name = "l3_main",
.class = &l3_hwmod_class,
.masters = omap2420_l3_main_masters,
.masters_cnt = ARRAY_SIZE(omap2420_l3_main_masters),
.slaves = omap2420_l3_main_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_l3_main_slaves),
.flags = HWMOD_NO_IDLEST,
};
static struct omap_hwmod omap2420_l4_wkup_hwmod;
static struct omap_hwmod omap2420_uart1_hwmod;
static struct omap_hwmod omap2420_uart2_hwmod;
static struct omap_hwmod omap2420_uart3_hwmod;
static struct omap_hwmod omap2420_i2c1_hwmod;
static struct omap_hwmod omap2420_i2c2_hwmod;
static struct omap_hwmod omap2420_mcbsp1_hwmod;
static struct omap_hwmod omap2420_mcbsp2_hwmod;
/* l4 core -> mcspi1 interface */
static struct omap_hwmod_ocp_if omap2420_l4_core__mcspi1 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_mcspi1_hwmod,
.clk = "mcspi1_ick",
.addr = omap2_mcspi1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4 core -> mcspi2 interface */
static struct omap_hwmod_ocp_if omap2420_l4_core__mcspi2 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_mcspi2_hwmod,
.clk = "mcspi2_ick",
.addr = omap2_mcspi2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4_CORE -> L4_WKUP interface */
static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_l4_wkup_hwmod,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4 CORE -> UART1 interface */
static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_uart1_hwmod,
.clk = "uart1_ick",
.addr = omap2xxx_uart1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4 CORE -> UART2 interface */
static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_uart2_hwmod,
.clk = "uart2_ick",
.addr = omap2xxx_uart2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4 PER -> UART3 interface */
static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_uart3_hwmod,
.clk = "uart3_ick",
.addr = omap2xxx_uart3_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4 CORE -> I2C1 interface */
static struct omap_hwmod_ocp_if omap2420_l4_core__i2c1 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_i2c1_hwmod,
.clk = "i2c1_ick",
.addr = omap2_i2c1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4 CORE -> I2C2 interface */
static struct omap_hwmod_ocp_if omap2420_l4_core__i2c2 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_i2c2_hwmod,
.clk = "i2c2_ick",
.addr = omap2_i2c2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* Slave interfaces on the L4_CORE interconnect */
static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = {
&omap2420_l3_main__l4_core,
};
/* Master interfaces on the L4_CORE interconnect */
static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {
&omap2420_l4_core__l4_wkup,
&omap2_l4_core__uart1,
&omap2_l4_core__uart2,
&omap2_l4_core__uart3,
&omap2420_l4_core__i2c1,
&omap2420_l4_core__i2c2
};
/* L4 CORE */
static struct omap_hwmod omap2420_l4_core_hwmod = {
.name = "l4_core",
.class = &l4_hwmod_class,
.masters = omap2420_l4_core_masters,
.masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters),
.slaves = omap2420_l4_core_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves),
.flags = HWMOD_NO_IDLEST,
};
/* Slave interfaces on the L4_WKUP interconnect */
static struct omap_hwmod_ocp_if *omap2420_l4_wkup_slaves[] = {
&omap2420_l4_core__l4_wkup,
};
/* Master interfaces on the L4_WKUP interconnect */
static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = {
};
/* L4 WKUP */
static struct omap_hwmod omap2420_l4_wkup_hwmod = {
.name = "l4_wkup",
.class = &l4_hwmod_class,
.masters = omap2420_l4_wkup_masters,
.masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters),
.slaves = omap2420_l4_wkup_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves),
.flags = HWMOD_NO_IDLEST,
};
/* Master interfaces on the MPU device */
static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = {
&omap2420_mpu__l3_main,
};
/* MPU */
static struct omap_hwmod omap2420_mpu_hwmod = {
.name = "mpu",
.class = &mpu_hwmod_class,
.main_clk = "mpu_ck",
.masters = omap2420_mpu_masters,
.masters_cnt = ARRAY_SIZE(omap2420_mpu_masters),
};
/* /*
* IVA1 interface data * IP blocks
*/ */
/* IVA <- L3 interface */ /* IVA1 (IVA1) */
static struct omap_hwmod_ocp_if omap2420_l3__iva = { static struct omap_hwmod_class iva1_hwmod_class = {
.master = &omap2420_l3_main_hwmod, .name = "iva1",
.slave = &omap2420_iva_hwmod,
.clk = "iva1_ifck",
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
static struct omap_hwmod_ocp_if *omap2420_iva_masters[] = { static struct omap_hwmod_rst_info omap2420_iva_resets[] = {
&omap2420_l3__iva, { .name = "iva", .rst_shift = 8 },
}; };
/*
* IVA2 (IVA2)
*/
static struct omap_hwmod omap2420_iva_hwmod = { static struct omap_hwmod omap2420_iva_hwmod = {
.name = "iva", .name = "iva",
.class = &iva_hwmod_class, .class = &iva1_hwmod_class,
.masters = omap2420_iva_masters, .clkdm_name = "iva1_clkdm",
.masters_cnt = ARRAY_SIZE(omap2420_iva_masters), .rst_lines = omap2420_iva_resets,
.rst_lines_cnt = ARRAY_SIZE(omap2420_iva_resets),
.main_clk = "iva1_ifck",
}; };
/* always-on timers dev attribute */ /* DSP */
static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = { static struct omap_hwmod_class dsp_hwmod_class = {
.timer_capability = OMAP_TIMER_ALWON, .name = "dsp",
}; };
/* pwm timers dev attribute */ static struct omap_hwmod_rst_info omap2420_dsp_resets[] = {
static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = { { .name = "logic", .rst_shift = 0 },
.timer_capability = OMAP_TIMER_HAS_PWM, { .name = "mmu", .rst_shift = 1 },
}; };
/* timer1 */ static struct omap_hwmod omap2420_dsp_hwmod = {
static struct omap_hwmod omap2420_timer1_hwmod; .name = "dsp",
.class = &dsp_hwmod_class,
static struct omap_hwmod_addr_space omap2420_timer1_addrs[] = { .clkdm_name = "dsp_clkdm",
{ .rst_lines = omap2420_dsp_resets,
.pa_start = 0x48028000, .rst_lines_cnt = ARRAY_SIZE(omap2420_dsp_resets),
.pa_end = 0x48028000 + SZ_1K - 1, .main_clk = "dsp_fck",
.flags = ADDR_TYPE_RT
},
{ }
}; };
/* l4_wkup -> timer1 */ /* I2C common */
static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = { static struct omap_hwmod_class_sysconfig i2c_sysc = {
.master = &omap2420_l4_wkup_hwmod, .rev_offs = 0x00,
.slave = &omap2420_timer1_hwmod, .sysc_offs = 0x20,
.clk = "gpt1_ick", .syss_offs = 0x10,
.addr = omap2420_timer1_addrs, .sysc_flags = (SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
.user = OCP_USER_MPU | OCP_USER_SDMA, .sysc_fields = &omap_hwmod_sysc_type1,
};
/* timer1 slave port */
static struct omap_hwmod_ocp_if *omap2420_timer1_slaves[] = {
&omap2420_l4_wkup__timer1,
};
/* timer1 hwmod */
static struct omap_hwmod omap2420_timer1_hwmod = {
.name = "timer1",
.mpu_irqs = omap2_timer1_mpu_irqs,
.main_clk = "gpt1_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT1_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2420_timer1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_timer1_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* timer2 */
static struct omap_hwmod omap2420_timer2_hwmod;
/* l4_core -> timer2 */
static struct omap_hwmod_ocp_if omap2420_l4_core__timer2 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_timer2_hwmod,
.clk = "gpt2_ick",
.addr = omap2xxx_timer2_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* timer2 slave port */
static struct omap_hwmod_ocp_if *omap2420_timer2_slaves[] = {
&omap2420_l4_core__timer2,
};
/* timer2 hwmod */
static struct omap_hwmod omap2420_timer2_hwmod = {
.name = "timer2",
.mpu_irqs = omap2_timer2_mpu_irqs,
.main_clk = "gpt2_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT2_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2420_timer2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_timer2_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* timer3 */
static struct omap_hwmod omap2420_timer3_hwmod;
/* l4_core -> timer3 */
static struct omap_hwmod_ocp_if omap2420_l4_core__timer3 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_timer3_hwmod,
.clk = "gpt3_ick",
.addr = omap2xxx_timer3_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* timer3 slave port */
static struct omap_hwmod_ocp_if *omap2420_timer3_slaves[] = {
&omap2420_l4_core__timer3,
};
/* timer3 hwmod */
static struct omap_hwmod omap2420_timer3_hwmod = {
.name = "timer3",
.mpu_irqs = omap2_timer3_mpu_irqs,
.main_clk = "gpt3_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT3_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2420_timer3_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_timer3_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* timer4 */
static struct omap_hwmod omap2420_timer4_hwmod;
/* l4_core -> timer4 */
static struct omap_hwmod_ocp_if omap2420_l4_core__timer4 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_timer4_hwmod,
.clk = "gpt4_ick",
.addr = omap2xxx_timer4_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* timer4 slave port */
static struct omap_hwmod_ocp_if *omap2420_timer4_slaves[] = {
&omap2420_l4_core__timer4,
};
/* timer4 hwmod */
static struct omap_hwmod omap2420_timer4_hwmod = {
.name = "timer4",
.mpu_irqs = omap2_timer4_mpu_irqs,
.main_clk = "gpt4_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT4_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2420_timer4_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_timer4_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* timer5 */
static struct omap_hwmod omap2420_timer5_hwmod;
/* l4_core -> timer5 */
static struct omap_hwmod_ocp_if omap2420_l4_core__timer5 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_timer5_hwmod,
.clk = "gpt5_ick",
.addr = omap2xxx_timer5_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* timer5 slave port */
static struct omap_hwmod_ocp_if *omap2420_timer5_slaves[] = {
&omap2420_l4_core__timer5,
};
/* timer5 hwmod */
static struct omap_hwmod omap2420_timer5_hwmod = {
.name = "timer5",
.mpu_irqs = omap2_timer5_mpu_irqs,
.main_clk = "gpt5_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT5_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2420_timer5_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_timer5_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* timer6 */
static struct omap_hwmod omap2420_timer6_hwmod;
/* l4_core -> timer6 */
static struct omap_hwmod_ocp_if omap2420_l4_core__timer6 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_timer6_hwmod,
.clk = "gpt6_ick",
.addr = omap2xxx_timer6_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* timer6 slave port */
static struct omap_hwmod_ocp_if *omap2420_timer6_slaves[] = {
&omap2420_l4_core__timer6,
};
/* timer6 hwmod */
static struct omap_hwmod omap2420_timer6_hwmod = {
.name = "timer6",
.mpu_irqs = omap2_timer6_mpu_irqs,
.main_clk = "gpt6_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT6_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2420_timer6_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_timer6_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* timer7 */ static struct omap_hwmod_class i2c_class = {
static struct omap_hwmod omap2420_timer7_hwmod; .name = "i2c",
.sysc = &i2c_sysc,
/* l4_core -> timer7 */ .rev = OMAP_I2C_IP_VERSION_1,
static struct omap_hwmod_ocp_if omap2420_l4_core__timer7 = { .reset = &omap_i2c_reset,
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_timer7_hwmod,
.clk = "gpt7_ick",
.addr = omap2xxx_timer7_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer7 slave port */ static struct omap_i2c_dev_attr i2c_dev_attr = {
static struct omap_hwmod_ocp_if *omap2420_timer7_slaves[] = { .flags = OMAP_I2C_FLAG_NO_FIFO |
&omap2420_l4_core__timer7, OMAP_I2C_FLAG_SIMPLE_CLOCK |
OMAP_I2C_FLAG_16BIT_DATA_REG |
OMAP_I2C_FLAG_BUS_SHIFT_2,
}; };
/* timer7 hwmod */ /* I2C1 */
static struct omap_hwmod omap2420_timer7_hwmod = { static struct omap_hwmod omap2420_i2c1_hwmod = {
.name = "timer7", .name = "i2c1",
.mpu_irqs = omap2_timer7_mpu_irqs, .mpu_irqs = omap2_i2c1_mpu_irqs,
.main_clk = "gpt7_fck", .sdma_reqs = omap2_i2c1_sdma_reqs,
.main_clk = "i2c1_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT7_SHIFT,
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2420_timer7_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_timer7_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* timer8 */
static struct omap_hwmod omap2420_timer8_hwmod;
/* l4_core -> timer8 */
static struct omap_hwmod_ocp_if omap2420_l4_core__timer8 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_timer8_hwmod,
.clk = "gpt8_ick",
.addr = omap2xxx_timer8_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* timer8 slave port */
static struct omap_hwmod_ocp_if *omap2420_timer8_slaves[] = {
&omap2420_l4_core__timer8,
};
/* timer8 hwmod */
static struct omap_hwmod omap2420_timer8_hwmod = {
.name = "timer8",
.mpu_irqs = omap2_timer8_mpu_irqs,
.main_clk = "gpt8_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT8_SHIFT, .module_bit = OMAP2420_EN_I2C1_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1, .idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, .idlest_idle_bit = OMAP2420_ST_I2C1_SHIFT,
}, },
}, },
.dev_attr = &capability_alwon_dev_attr, .class = &i2c_class,
.slaves = omap2420_timer8_slaves, .dev_attr = &i2c_dev_attr,
.slaves_cnt = ARRAY_SIZE(omap2420_timer8_slaves), .flags = HWMOD_16BIT_REG,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer9 */
static struct omap_hwmod omap2420_timer9_hwmod;
/* l4_core -> timer9 */
static struct omap_hwmod_ocp_if omap2420_l4_core__timer9 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_timer9_hwmod,
.clk = "gpt9_ick",
.addr = omap2xxx_timer9_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* timer9 slave port */
static struct omap_hwmod_ocp_if *omap2420_timer9_slaves[] = {
&omap2420_l4_core__timer9,
}; };
/* timer9 hwmod */ /* I2C2 */
static struct omap_hwmod omap2420_timer9_hwmod = { static struct omap_hwmod omap2420_i2c2_hwmod = {
.name = "timer9", .name = "i2c2",
.mpu_irqs = omap2_timer9_mpu_irqs, .mpu_irqs = omap2_i2c2_mpu_irqs,
.main_clk = "gpt9_fck", .sdma_reqs = omap2_i2c2_sdma_reqs,
.main_clk = "i2c2_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT9_SHIFT,
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
},
},
.dev_attr = &capability_pwm_dev_attr,
.slaves = omap2420_timer9_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_timer9_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* timer10 */
static struct omap_hwmod omap2420_timer10_hwmod;
/* l4_core -> timer10 */
static struct omap_hwmod_ocp_if omap2420_l4_core__timer10 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_timer10_hwmod,
.clk = "gpt10_ick",
.addr = omap2_timer10_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* timer10 slave port */
static struct omap_hwmod_ocp_if *omap2420_timer10_slaves[] = {
&omap2420_l4_core__timer10,
};
/* timer10 hwmod */
static struct omap_hwmod omap2420_timer10_hwmod = {
.name = "timer10",
.mpu_irqs = omap2_timer10_mpu_irqs,
.main_clk = "gpt10_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT10_SHIFT, .module_bit = OMAP2420_EN_I2C2_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1, .idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT, .idlest_idle_bit = OMAP2420_ST_I2C2_SHIFT,
}, },
}, },
.dev_attr = &capability_pwm_dev_attr, .class = &i2c_class,
.slaves = omap2420_timer10_slaves, .dev_attr = &i2c_dev_attr,
.slaves_cnt = ARRAY_SIZE(omap2420_timer10_slaves), .flags = HWMOD_16BIT_REG,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer11 */
static struct omap_hwmod omap2420_timer11_hwmod;
/* l4_core -> timer11 */
static struct omap_hwmod_ocp_if omap2420_l4_core__timer11 = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_timer11_hwmod,
.clk = "gpt11_ick",
.addr = omap2_timer11_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* timer11 slave port */
static struct omap_hwmod_ocp_if *omap2420_timer11_slaves[] = {
&omap2420_l4_core__timer11,
}; };
/* timer11 hwmod */ /* dma attributes */
static struct omap_hwmod omap2420_timer11_hwmod = { static struct omap_dma_dev_attr dma_dev_attr = {
.name = "timer11", .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
.mpu_irqs = omap2_timer11_mpu_irqs, IS_CSSA_32 | IS_CDSA_32,
.main_clk = "gpt11_fck", .lch_count = 32,
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT11_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
},
},
.dev_attr = &capability_pwm_dev_attr,
.slaves = omap2420_timer11_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_timer11_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* timer12 */ static struct omap_hwmod omap2420_dma_system_hwmod = {
static struct omap_hwmod omap2420_timer12_hwmod; .name = "dma",
.class = &omap2xxx_dma_hwmod_class,
/* l4_core -> timer12 */ .mpu_irqs = omap2_dma_system_irqs,
static struct omap_hwmod_ocp_if omap2420_l4_core__timer12 = { .main_clk = "core_l3_ck",
.master = &omap2420_l4_core_hwmod, .dev_attr = &dma_dev_attr,
.slave = &omap2420_timer12_hwmod, .flags = HWMOD_NO_IDLEST,
.clk = "gpt12_ick",
.addr = omap2xxx_timer12_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer12 slave port */ /* mailbox */
static struct omap_hwmod_ocp_if *omap2420_timer12_slaves[] = { static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
&omap2420_l4_core__timer12, { .name = "dsp", .irq = 26 },
{ .name = "iva", .irq = 34 },
{ .irq = -1 }
}; };
/* timer12 hwmod */ static struct omap_hwmod omap2420_mailbox_hwmod = {
static struct omap_hwmod omap2420_timer12_hwmod = { .name = "mailbox",
.name = "timer12", .class = &omap2xxx_mailbox_hwmod_class,
.mpu_irqs = omap2xxx_timer12_mpu_irqs, .mpu_irqs = omap2420_mailbox_irqs,
.main_clk = "gpt12_fck", .main_clk = "mailboxes_ick",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT12_SHIFT, .module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1, .idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT, .idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
}, },
}, },
.dev_attr = &capability_pwm_dev_attr,
.slaves = omap2420_timer12_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_timer12_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* l4_wkup -> wd_timer2 */
static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = {
{
.pa_start = 0x48022000,
.pa_end = 0x4802207f,
.flags = ADDR_TYPE_RT
},
{ }
}; };
static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = { /*
.master = &omap2420_l4_wkup_hwmod, * 'mcbsp' class
.slave = &omap2420_wd_timer2_hwmod, * multi channel buffered serial port controller
.clk = "mpu_wdt_ick", */
.addr = omap2420_wd_timer2_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* wd_timer2 */
static struct omap_hwmod_ocp_if *omap2420_wd_timer2_slaves[] = {
&omap2420_l4_wkup__wd_timer2,
};
static struct omap_hwmod omap2420_wd_timer2_hwmod = { static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = {
.name = "wd_timer2", .name = "mcbsp",
.class = &omap2xxx_wd_timer_hwmod_class,
.main_clk = "mpu_wdt_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
},
},
.slaves = omap2420_wd_timer2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_wd_timer2_slaves),
}; };
/* UART1 */ /* mcbsp1 */
static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = {
static struct omap_hwmod_ocp_if *omap2420_uart1_slaves[] = { { .name = "tx", .irq = 59 },
&omap2_l4_core__uart1, { .name = "rx", .irq = 60 },
{ .irq = -1 }
}; };
static struct omap_hwmod omap2420_uart1_hwmod = { static struct omap_hwmod omap2420_mcbsp1_hwmod = {
.name = "uart1", .name = "mcbsp1",
.mpu_irqs = omap2_uart1_mpu_irqs, .class = &omap2420_mcbsp_hwmod_class,
.sdma_reqs = omap2_uart1_sdma_reqs, .mpu_irqs = omap2420_mcbsp1_irqs,
.main_clk = "uart1_fck", .sdma_reqs = omap2_mcbsp1_sdma_reqs,
.main_clk = "mcbsp1_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1, .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_UART1_SHIFT, .module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
},
},
.slaves = omap2420_uart1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_uart1_slaves),
.class = &omap2_uart_class,
};
/* UART2 */
static struct omap_hwmod_ocp_if *omap2420_uart2_slaves[] = {
&omap2_l4_core__uart2,
};
static struct omap_hwmod omap2420_uart2_hwmod = {
.name = "uart2",
.mpu_irqs = omap2_uart2_mpu_irqs,
.sdma_reqs = omap2_uart2_sdma_reqs,
.main_clk = "uart2_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_UART2_SHIFT,
.idlest_reg_id = 1, .idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT, .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
},
},
.slaves = omap2420_uart2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_uart2_slaves),
.class = &omap2_uart_class,
};
/* UART3 */
static struct omap_hwmod_ocp_if *omap2420_uart3_slaves[] = {
&omap2_l4_core__uart3,
};
static struct omap_hwmod omap2420_uart3_hwmod = {
.name = "uart3",
.mpu_irqs = omap2_uart3_mpu_irqs,
.sdma_reqs = omap2_uart3_sdma_reqs,
.main_clk = "uart3_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 2,
.module_bit = OMAP24XX_EN_UART3_SHIFT,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
}, },
}, },
.slaves = omap2420_uart3_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_uart3_slaves),
.class = &omap2_uart_class,
};
/* dss */
/* dss master ports */
static struct omap_hwmod_ocp_if *omap2420_dss_masters[] = {
&omap2420_dss__l3,
}; };
/* l4_core -> dss */ /* mcbsp2 */
static struct omap_hwmod_ocp_if omap2420_l4_core__dss = { static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = {
.master = &omap2420_l4_core_hwmod, { .name = "tx", .irq = 62 },
.slave = &omap2420_dss_core_hwmod, { .name = "rx", .irq = 63 },
.clk = "dss_ick", { .irq = -1 }
.addr = omap2_dss_addrs,
.fw = {
.omap2 = {
.l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
.flags = OMAP_FIREWALL_L4,
}
},
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* dss slave ports */
static struct omap_hwmod_ocp_if *omap2420_dss_slaves[] = {
&omap2420_l4_core__dss,
};
static struct omap_hwmod_opt_clk dss_opt_clks[] = {
/*
* The DSS HW needs all DSS clocks enabled during reset. The dss_core
* driver does not use these clocks.
*/
{ .role = "tv_clk", .clk = "dss_54m_fck" },
{ .role = "sys_clk", .clk = "dss2_fck" },
}; };
static struct omap_hwmod omap2420_dss_core_hwmod = { static struct omap_hwmod omap2420_mcbsp2_hwmod = {
.name = "dss_core", .name = "mcbsp2",
.class = &omap2_dss_hwmod_class, .class = &omap2420_mcbsp_hwmod_class,
.main_clk = "dss1_fck", /* instead of dss_fck */ .mpu_irqs = omap2420_mcbsp2_irqs,
.sdma_reqs = omap2xxx_dss_sdma_chs, .sdma_reqs = omap2_mcbsp2_sdma_reqs,
.main_clk = "mcbsp2_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT, .module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1, .idlest_reg_id = 1,
.idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT, .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
}, },
}, },
.opt_clks = dss_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
.slaves = omap2420_dss_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_dss_slaves),
.masters = omap2420_dss_masters,
.masters_cnt = ARRAY_SIZE(omap2420_dss_masters),
.flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
}; };
/* l4_core -> dss_dispc */ /*
static struct omap_hwmod_ocp_if omap2420_l4_core__dss_dispc = { * interfaces
.master = &omap2420_l4_core_hwmod, */
.slave = &omap2420_dss_dispc_hwmod,
.clk = "dss_ick",
.addr = omap2_dss_dispc_addrs,
.fw = {
.omap2 = {
.l4_fw_region = OMAP2420_L4_CORE_FW_DSS_DISPC_REGION,
.flags = OMAP_FIREWALL_L4,
}
},
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* dss_dispc slave ports */
static struct omap_hwmod_ocp_if *omap2420_dss_dispc_slaves[] = {
&omap2420_l4_core__dss_dispc,
};
static struct omap_hwmod omap2420_dss_dispc_hwmod = {
.name = "dss_dispc",
.class = &omap2_dispc_hwmod_class,
.mpu_irqs = omap2_dispc_irqs,
.main_clk = "dss1_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
},
},
.slaves = omap2420_dss_dispc_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_dss_dispc_slaves),
.flags = HWMOD_NO_IDLEST,
.dev_attr = &omap2_3_dss_dispc_dev_attr
};
/* l4_core -> dss_rfbi */ /* L4 CORE -> I2C1 interface */
static struct omap_hwmod_ocp_if omap2420_l4_core__dss_rfbi = { static struct omap_hwmod_ocp_if omap2420_l4_core__i2c1 = {
.master = &omap2420_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2420_dss_rfbi_hwmod, .slave = &omap2420_i2c1_hwmod,
.clk = "dss_ick", .clk = "i2c1_ick",
.addr = omap2_dss_rfbi_addrs, .addr = omap2_i2c1_addr_space,
.fw = {
.omap2 = {
.l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
.flags = OMAP_FIREWALL_L4,
}
},
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* dss_rfbi slave ports */ /* L4 CORE -> I2C2 interface */
static struct omap_hwmod_ocp_if *omap2420_dss_rfbi_slaves[] = { static struct omap_hwmod_ocp_if omap2420_l4_core__i2c2 = {
&omap2420_l4_core__dss_rfbi, .master = &omap2xxx_l4_core_hwmod,
}; .slave = &omap2420_i2c2_hwmod,
.clk = "i2c2_ick",
static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = { .addr = omap2_i2c2_addr_space,
{ .role = "ick", .clk = "dss_ick" },
};
static struct omap_hwmod omap2420_dss_rfbi_hwmod = {
.name = "dss_rfbi",
.class = &omap2_rfbi_hwmod_class,
.main_clk = "dss1_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
},
},
.opt_clks = dss_rfbi_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
.slaves = omap2420_dss_rfbi_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_dss_rfbi_slaves),
.flags = HWMOD_NO_IDLEST,
};
/* l4_core -> dss_venc */
static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = {
.master = &omap2420_l4_core_hwmod,
.slave = &omap2420_dss_venc_hwmod,
.clk = "dss_ick",
.addr = omap2_dss_venc_addrs,
.fw = {
.omap2 = {
.l4_fw_region = OMAP2420_L4_CORE_FW_DSS_VENC_REGION,
.flags = OMAP_FIREWALL_L4,
}
},
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* dss_venc slave ports */ /* IVA <- L3 interface */
static struct omap_hwmod_ocp_if *omap2420_dss_venc_slaves[] = { static struct omap_hwmod_ocp_if omap2420_l3__iva = {
&omap2420_l4_core__dss_venc, .master = &omap2xxx_l3_main_hwmod,
}; .slave = &omap2420_iva_hwmod,
.clk = "core_l3_ck",
static struct omap_hwmod omap2420_dss_venc_hwmod = { .user = OCP_USER_MPU | OCP_USER_SDMA,
.name = "dss_venc",
.class = &omap2_venc_hwmod_class,
.main_clk = "dss_54m_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
},
},
.slaves = omap2420_dss_venc_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_dss_venc_slaves),
.flags = HWMOD_NO_IDLEST,
};
/* I2C common */
static struct omap_hwmod_class_sysconfig i2c_sysc = {
.rev_offs = 0x00,
.sysc_offs = 0x20,
.syss_offs = 0x10,
.sysc_flags = (SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
.sysc_fields = &omap_hwmod_sysc_type1,
};
static struct omap_hwmod_class i2c_class = {
.name = "i2c",
.sysc = &i2c_sysc,
.rev = OMAP_I2C_IP_VERSION_1,
.reset = &omap_i2c_reset,
};
static struct omap_i2c_dev_attr i2c_dev_attr = {
.flags = OMAP_I2C_FLAG_NO_FIFO |
OMAP_I2C_FLAG_SIMPLE_CLOCK |
OMAP_I2C_FLAG_16BIT_DATA_REG |
OMAP_I2C_FLAG_BUS_SHIFT_2,
};
/* I2C1 */
static struct omap_hwmod_ocp_if *omap2420_i2c1_slaves[] = {
&omap2420_l4_core__i2c1,
};
static struct omap_hwmod omap2420_i2c1_hwmod = {
.name = "i2c1",
.mpu_irqs = omap2_i2c1_mpu_irqs,
.sdma_reqs = omap2_i2c1_sdma_reqs,
.main_clk = "i2c1_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP2420_EN_I2C1_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP2420_ST_I2C1_SHIFT,
},
},
.slaves = omap2420_i2c1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_i2c1_slaves),
.class = &i2c_class,
.dev_attr = &i2c_dev_attr,
.flags = HWMOD_16BIT_REG,
}; };
/* I2C2 */ /* DSP <- L3 interface */
static struct omap_hwmod_ocp_if omap2420_l3__dsp = {
.master = &omap2xxx_l3_main_hwmod,
.slave = &omap2420_dsp_hwmod,
.clk = "dsp_ick",
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
static struct omap_hwmod_ocp_if *omap2420_i2c2_slaves[] = { static struct omap_hwmod_addr_space omap2420_timer1_addrs[] = {
&omap2420_l4_core__i2c2, {
.pa_start = 0x48028000,
.pa_end = 0x48028000 + SZ_1K - 1,
.flags = ADDR_TYPE_RT
},
{ }
}; };
static struct omap_hwmod omap2420_i2c2_hwmod = { /* l4_wkup -> timer1 */
.name = "i2c2", static struct omap_hwmod_ocp_if omap2420_l4_wkup__timer1 = {
.mpu_irqs = omap2_i2c2_mpu_irqs, .master = &omap2xxx_l4_wkup_hwmod,
.sdma_reqs = omap2_i2c2_sdma_reqs, .slave = &omap2xxx_timer1_hwmod,
.main_clk = "i2c2_fck", .clk = "gpt1_ick",
.prcm = { .addr = omap2420_timer1_addrs,
.omap2 = { .user = OCP_USER_MPU | OCP_USER_SDMA,
.module_offs = CORE_MOD, };
.prcm_reg_id = 1,
.module_bit = OMAP2420_EN_I2C2_SHIFT, /* l4_wkup -> wd_timer2 */
.idlest_reg_id = 1, static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = {
.idlest_idle_bit = OMAP2420_ST_I2C2_SHIFT, {
}, .pa_start = 0x48022000,
.pa_end = 0x4802207f,
.flags = ADDR_TYPE_RT
}, },
.slaves = omap2420_i2c2_slaves, { }
.slaves_cnt = ARRAY_SIZE(omap2420_i2c2_slaves), };
.class = &i2c_class,
.dev_attr = &i2c_dev_attr, static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = {
.flags = HWMOD_16BIT_REG, .master = &omap2xxx_l4_wkup_hwmod,
.slave = &omap2xxx_wd_timer2_hwmod,
.clk = "mpu_wdt_ick",
.addr = omap2420_wd_timer2_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* l4_wkup -> gpio1 */ /* l4_wkup -> gpio1 */
...@@ -1112,8 +324,8 @@ static struct omap_hwmod_addr_space omap2420_gpio1_addr_space[] = { ...@@ -1112,8 +324,8 @@ static struct omap_hwmod_addr_space omap2420_gpio1_addr_space[] = {
}; };
static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = { static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = {
.master = &omap2420_l4_wkup_hwmod, .master = &omap2xxx_l4_wkup_hwmod,
.slave = &omap2420_gpio1_hwmod, .slave = &omap2xxx_gpio1_hwmod,
.clk = "gpios_ick", .clk = "gpios_ick",
.addr = omap2420_gpio1_addr_space, .addr = omap2420_gpio1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
...@@ -1130,8 +342,8 @@ static struct omap_hwmod_addr_space omap2420_gpio2_addr_space[] = { ...@@ -1130,8 +342,8 @@ static struct omap_hwmod_addr_space omap2420_gpio2_addr_space[] = {
}; };
static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = { static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = {
.master = &omap2420_l4_wkup_hwmod, .master = &omap2xxx_l4_wkup_hwmod,
.slave = &omap2420_gpio2_hwmod, .slave = &omap2xxx_gpio2_hwmod,
.clk = "gpios_ick", .clk = "gpios_ick",
.addr = omap2420_gpio2_addr_space, .addr = omap2420_gpio2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
...@@ -1148,8 +360,8 @@ static struct omap_hwmod_addr_space omap2420_gpio3_addr_space[] = { ...@@ -1148,8 +360,8 @@ static struct omap_hwmod_addr_space omap2420_gpio3_addr_space[] = {
}; };
static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = { static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = {
.master = &omap2420_l4_wkup_hwmod, .master = &omap2xxx_l4_wkup_hwmod,
.slave = &omap2420_gpio3_hwmod, .slave = &omap2xxx_gpio3_hwmod,
.clk = "gpios_ick", .clk = "gpios_ick",
.addr = omap2420_gpio3_addr_space, .addr = omap2420_gpio3_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
...@@ -1166,408 +378,100 @@ static struct omap_hwmod_addr_space omap2420_gpio4_addr_space[] = { ...@@ -1166,408 +378,100 @@ static struct omap_hwmod_addr_space omap2420_gpio4_addr_space[] = {
}; };
static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = { static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = {
.master = &omap2420_l4_wkup_hwmod, .master = &omap2xxx_l4_wkup_hwmod,
.slave = &omap2420_gpio4_hwmod, .slave = &omap2xxx_gpio4_hwmod,
.clk = "gpios_ick", .clk = "gpios_ick",
.addr = omap2420_gpio4_addr_space, .addr = omap2420_gpio4_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* gpio dev_attr */
static struct omap_gpio_dev_attr gpio_dev_attr = {
.bank_width = 32,
.dbck_flag = false,
};
/* gpio1 */
static struct omap_hwmod_ocp_if *omap2420_gpio1_slaves[] = {
&omap2420_l4_wkup__gpio1,
};
static struct omap_hwmod omap2420_gpio1_hwmod = {
.name = "gpio1",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio1_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.slaves = omap2420_gpio1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_gpio1_slaves),
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &gpio_dev_attr,
};
/* gpio2 */
static struct omap_hwmod_ocp_if *omap2420_gpio2_slaves[] = {
&omap2420_l4_wkup__gpio2,
};
static struct omap_hwmod omap2420_gpio2_hwmod = {
.name = "gpio2",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio2_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.slaves = omap2420_gpio2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_gpio2_slaves),
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &gpio_dev_attr,
};
/* gpio3 */
static struct omap_hwmod_ocp_if *omap2420_gpio3_slaves[] = {
&omap2420_l4_wkup__gpio3,
};
static struct omap_hwmod omap2420_gpio3_hwmod = {
.name = "gpio3",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio3_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.slaves = omap2420_gpio3_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_gpio3_slaves),
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &gpio_dev_attr,
};
/* gpio4 */
static struct omap_hwmod_ocp_if *omap2420_gpio4_slaves[] = {
&omap2420_l4_wkup__gpio4,
};
static struct omap_hwmod omap2420_gpio4_hwmod = {
.name = "gpio4",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio4_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.slaves = omap2420_gpio4_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_gpio4_slaves),
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &gpio_dev_attr,
};
/* dma attributes */
static struct omap_dma_dev_attr dma_dev_attr = {
.dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
IS_CSSA_32 | IS_CDSA_32,
.lch_count = 32,
};
/* dma_system -> L3 */ /* dma_system -> L3 */
static struct omap_hwmod_ocp_if omap2420_dma_system__l3 = { static struct omap_hwmod_ocp_if omap2420_dma_system__l3 = {
.master = &omap2420_dma_system_hwmod, .master = &omap2420_dma_system_hwmod,
.slave = &omap2420_l3_main_hwmod, .slave = &omap2xxx_l3_main_hwmod,
.clk = "core_l3_ck", .clk = "core_l3_ck",
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* dma_system master ports */
static struct omap_hwmod_ocp_if *omap2420_dma_system_masters[] = {
&omap2420_dma_system__l3,
};
/* l4_core -> dma_system */ /* l4_core -> dma_system */
static struct omap_hwmod_ocp_if omap2420_l4_core__dma_system = { static struct omap_hwmod_ocp_if omap2420_l4_core__dma_system = {
.master = &omap2420_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2420_dma_system_hwmod, .slave = &omap2420_dma_system_hwmod,
.clk = "sdma_ick", .clk = "sdma_ick",
.addr = omap2_dma_system_addrs, .addr = omap2_dma_system_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* dma_system slave ports */
static struct omap_hwmod_ocp_if *omap2420_dma_system_slaves[] = {
&omap2420_l4_core__dma_system,
};
static struct omap_hwmod omap2420_dma_system_hwmod = {
.name = "dma",
.class = &omap2xxx_dma_hwmod_class,
.mpu_irqs = omap2_dma_system_irqs,
.main_clk = "core_l3_ck",
.slaves = omap2420_dma_system_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_dma_system_slaves),
.masters = omap2420_dma_system_masters,
.masters_cnt = ARRAY_SIZE(omap2420_dma_system_masters),
.dev_attr = &dma_dev_attr,
.flags = HWMOD_NO_IDLEST,
};
/* mailbox */
static struct omap_hwmod omap2420_mailbox_hwmod;
static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = {
{ .name = "dsp", .irq = 26 },
{ .name = "iva", .irq = 34 },
{ .irq = -1 }
};
/* l4_core -> mailbox */ /* l4_core -> mailbox */
static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = { static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = {
.master = &omap2420_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2420_mailbox_hwmod, .slave = &omap2420_mailbox_hwmod,
.addr = omap2_mailbox_addrs, .addr = omap2_mailbox_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* mailbox slave ports */
static struct omap_hwmod_ocp_if *omap2420_mailbox_slaves[] = {
&omap2420_l4_core__mailbox,
};
static struct omap_hwmod omap2420_mailbox_hwmod = {
.name = "mailbox",
.class = &omap2xxx_mailbox_hwmod_class,
.mpu_irqs = omap2420_mailbox_irqs,
.main_clk = "mailboxes_ick",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
},
},
.slaves = omap2420_mailbox_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_mailbox_slaves),
};
/* mcspi1 */
static struct omap_hwmod_ocp_if *omap2420_mcspi1_slaves[] = {
&omap2420_l4_core__mcspi1,
};
static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
.num_chipselect = 4,
};
static struct omap_hwmod omap2420_mcspi1_hwmod = {
.name = "mcspi1_hwmod",
.mpu_irqs = omap2_mcspi1_mpu_irqs,
.sdma_reqs = omap2_mcspi1_sdma_reqs,
.main_clk = "mcspi1_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
},
},
.slaves = omap2420_mcspi1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_mcspi1_slaves),
.class = &omap2xxx_mcspi_class,
.dev_attr = &omap_mcspi1_dev_attr,
};
/* mcspi2 */
static struct omap_hwmod_ocp_if *omap2420_mcspi2_slaves[] = {
&omap2420_l4_core__mcspi2,
};
static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
.num_chipselect = 2,
};
static struct omap_hwmod omap2420_mcspi2_hwmod = {
.name = "mcspi2_hwmod",
.mpu_irqs = omap2_mcspi2_mpu_irqs,
.sdma_reqs = omap2_mcspi2_sdma_reqs,
.main_clk = "mcspi2_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
},
},
.slaves = omap2420_mcspi2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_mcspi2_slaves),
.class = &omap2xxx_mcspi_class,
.dev_attr = &omap_mcspi2_dev_attr,
};
/*
* 'mcbsp' class
* multi channel buffered serial port controller
*/
static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = {
.name = "mcbsp",
};
/* mcbsp1 */
static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = {
{ .name = "tx", .irq = 59 },
{ .name = "rx", .irq = 60 },
{ .irq = -1 }
};
/* l4_core -> mcbsp1 */ /* l4_core -> mcbsp1 */
static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp1 = { static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp1 = {
.master = &omap2420_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2420_mcbsp1_hwmod, .slave = &omap2420_mcbsp1_hwmod,
.clk = "mcbsp1_ick", .clk = "mcbsp1_ick",
.addr = omap2_mcbsp1_addrs, .addr = omap2_mcbsp1_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* mcbsp1 slave ports */
static struct omap_hwmod_ocp_if *omap2420_mcbsp1_slaves[] = {
&omap2420_l4_core__mcbsp1,
};
static struct omap_hwmod omap2420_mcbsp1_hwmod = {
.name = "mcbsp1",
.class = &omap2420_mcbsp_hwmod_class,
.mpu_irqs = omap2420_mcbsp1_irqs,
.sdma_reqs = omap2_mcbsp1_sdma_reqs,
.main_clk = "mcbsp1_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
},
},
.slaves = omap2420_mcbsp1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_mcbsp1_slaves),
};
/* mcbsp2 */
static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = {
{ .name = "tx", .irq = 62 },
{ .name = "rx", .irq = 63 },
{ .irq = -1 }
};
/* l4_core -> mcbsp2 */ /* l4_core -> mcbsp2 */
static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp2 = { static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp2 = {
.master = &omap2420_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2420_mcbsp2_hwmod, .slave = &omap2420_mcbsp2_hwmod,
.clk = "mcbsp2_ick", .clk = "mcbsp2_ick",
.addr = omap2xxx_mcbsp2_addrs, .addr = omap2xxx_mcbsp2_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* mcbsp2 slave ports */ static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = {
static struct omap_hwmod_ocp_if *omap2420_mcbsp2_slaves[] = { &omap2xxx_l3_main__l4_core,
&omap2xxx_mpu__l3_main,
&omap2xxx_dss__l3,
&omap2xxx_l4_core__mcspi1,
&omap2xxx_l4_core__mcspi2,
&omap2xxx_l4_core__l4_wkup,
&omap2_l4_core__uart1,
&omap2_l4_core__uart2,
&omap2_l4_core__uart3,
&omap2420_l4_core__i2c1,
&omap2420_l4_core__i2c2,
&omap2420_l3__iva,
&omap2420_l3__dsp,
&omap2420_l4_wkup__timer1,
&omap2xxx_l4_core__timer2,
&omap2xxx_l4_core__timer3,
&omap2xxx_l4_core__timer4,
&omap2xxx_l4_core__timer5,
&omap2xxx_l4_core__timer6,
&omap2xxx_l4_core__timer7,
&omap2xxx_l4_core__timer8,
&omap2xxx_l4_core__timer9,
&omap2xxx_l4_core__timer10,
&omap2xxx_l4_core__timer11,
&omap2xxx_l4_core__timer12,
&omap2420_l4_wkup__wd_timer2,
&omap2xxx_l4_core__dss,
&omap2xxx_l4_core__dss_dispc,
&omap2xxx_l4_core__dss_rfbi,
&omap2xxx_l4_core__dss_venc,
&omap2420_l4_wkup__gpio1,
&omap2420_l4_wkup__gpio2,
&omap2420_l4_wkup__gpio3,
&omap2420_l4_wkup__gpio4,
&omap2420_dma_system__l3,
&omap2420_l4_core__dma_system,
&omap2420_l4_core__mailbox,
&omap2420_l4_core__mcbsp1,
&omap2420_l4_core__mcbsp2, &omap2420_l4_core__mcbsp2,
};
static struct omap_hwmod omap2420_mcbsp2_hwmod = {
.name = "mcbsp2",
.class = &omap2420_mcbsp_hwmod_class,
.mpu_irqs = omap2420_mcbsp2_irqs,
.sdma_reqs = omap2_mcbsp2_sdma_reqs,
.main_clk = "mcbsp2_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
},
},
.slaves = omap2420_mcbsp2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2420_mcbsp2_slaves),
};
static __initdata struct omap_hwmod *omap2420_hwmods[] = {
&omap2420_l3_main_hwmod,
&omap2420_l4_core_hwmod,
&omap2420_l4_wkup_hwmod,
&omap2420_mpu_hwmod,
&omap2420_iva_hwmod,
&omap2420_timer1_hwmod,
&omap2420_timer2_hwmod,
&omap2420_timer3_hwmod,
&omap2420_timer4_hwmod,
&omap2420_timer5_hwmod,
&omap2420_timer6_hwmod,
&omap2420_timer7_hwmod,
&omap2420_timer8_hwmod,
&omap2420_timer9_hwmod,
&omap2420_timer10_hwmod,
&omap2420_timer11_hwmod,
&omap2420_timer12_hwmod,
&omap2420_wd_timer2_hwmod,
&omap2420_uart1_hwmod,
&omap2420_uart2_hwmod,
&omap2420_uart3_hwmod,
/* dss class */
&omap2420_dss_core_hwmod,
&omap2420_dss_dispc_hwmod,
&omap2420_dss_rfbi_hwmod,
&omap2420_dss_venc_hwmod,
/* i2c class */
&omap2420_i2c1_hwmod,
&omap2420_i2c2_hwmod,
/* gpio class */
&omap2420_gpio1_hwmod,
&omap2420_gpio2_hwmod,
&omap2420_gpio3_hwmod,
&omap2420_gpio4_hwmod,
/* dma_system class*/
&omap2420_dma_system_hwmod,
/* mailbox class */
&omap2420_mailbox_hwmod,
/* mcbsp class */
&omap2420_mcbsp1_hwmod,
&omap2420_mcbsp2_hwmod,
/* mcspi class */
&omap2420_mcspi1_hwmod,
&omap2420_mcspi2_hwmod,
NULL, NULL,
}; };
int __init omap2420_hwmod_init(void) int __init omap2420_hwmod_init(void)
{ {
return omap_hwmod_register(omap2420_hwmods); return omap_hwmod_register_links(omap2420_hwmod_ocp_ifs);
} }
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* omap_hwmod_2430_data.c - hardware modules present on the OMAP2430 chips * omap_hwmod_2430_data.c - hardware modules present on the OMAP2430 chips
* *
* Copyright (C) 2009-2011 Nokia Corporation * Copyright (C) 2009-2011 Nokia Corporation
* Copyright (C) 2012 Texas Instruments, Inc.
* Paul Walmsley * Paul Walmsley
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -33,777 +34,600 @@ ...@@ -33,777 +34,600 @@
/* /*
* OMAP2430 hardware module integration data * OMAP2430 hardware module integration data
* *
* ALl of the data in this section should be autogeneratable from the * All of the data in this section should be autogeneratable from the
* TI hardware database or other technical documentation. Data that * TI hardware database or other technical documentation. Data that
* is driver-specific or driver-kernel integration-specific belongs * is driver-specific or driver-kernel integration-specific belongs
* elsewhere. * elsewhere.
*/ */
static struct omap_hwmod omap2430_mpu_hwmod; /*
static struct omap_hwmod omap2430_iva_hwmod; * IP blocks
static struct omap_hwmod omap2430_l3_main_hwmod; */
static struct omap_hwmod omap2430_l4_core_hwmod;
static struct omap_hwmod omap2430_dss_core_hwmod;
static struct omap_hwmod omap2430_dss_dispc_hwmod;
static struct omap_hwmod omap2430_dss_rfbi_hwmod;
static struct omap_hwmod omap2430_dss_venc_hwmod;
static struct omap_hwmod omap2430_wd_timer2_hwmod;
static struct omap_hwmod omap2430_gpio1_hwmod;
static struct omap_hwmod omap2430_gpio2_hwmod;
static struct omap_hwmod omap2430_gpio3_hwmod;
static struct omap_hwmod omap2430_gpio4_hwmod;
static struct omap_hwmod omap2430_gpio5_hwmod;
static struct omap_hwmod omap2430_dma_system_hwmod;
static struct omap_hwmod omap2430_mcbsp1_hwmod;
static struct omap_hwmod omap2430_mcbsp2_hwmod;
static struct omap_hwmod omap2430_mcbsp3_hwmod;
static struct omap_hwmod omap2430_mcbsp4_hwmod;
static struct omap_hwmod omap2430_mcbsp5_hwmod;
static struct omap_hwmod omap2430_mcspi1_hwmod;
static struct omap_hwmod omap2430_mcspi2_hwmod;
static struct omap_hwmod omap2430_mcspi3_hwmod;
static struct omap_hwmod omap2430_mmc1_hwmod;
static struct omap_hwmod omap2430_mmc2_hwmod;
/* L3 -> L4_CORE interface */
static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
.master = &omap2430_l3_main_hwmod,
.slave = &omap2430_l4_core_hwmod,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* MPU -> L3 interface */ /* IVA2 (IVA2) */
static struct omap_hwmod_ocp_if omap2430_mpu__l3_main = { static struct omap_hwmod_rst_info omap2430_iva_resets[] = {
.master = &omap2430_mpu_hwmod, { .name = "logic", .rst_shift = 0 },
.slave = &omap2430_l3_main_hwmod, { .name = "mmu", .rst_shift = 1 },
.user = OCP_USER_MPU,
}; };
/* Slave interfaces on the L3 interconnect */ static struct omap_hwmod omap2430_iva_hwmod = {
static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = { .name = "iva",
&omap2430_mpu__l3_main, .class = &iva_hwmod_class,
.clkdm_name = "dsp_clkdm",
.rst_lines = omap2430_iva_resets,
.rst_lines_cnt = ARRAY_SIZE(omap2430_iva_resets),
.main_clk = "dsp_fck",
}; };
/* DSS -> l3 */ /* I2C common */
static struct omap_hwmod_ocp_if omap2430_dss__l3 = { static struct omap_hwmod_class_sysconfig i2c_sysc = {
.master = &omap2430_dss_core_hwmod, .rev_offs = 0x00,
.slave = &omap2430_l3_main_hwmod, .sysc_offs = 0x20,
.fw = { .syss_offs = 0x10,
.omap2 = { .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
.l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS, SYSS_HAS_RESET_STATUS),
.flags = OMAP_FIREWALL_L3, .sysc_fields = &omap_hwmod_sysc_type1,
}
},
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* Master interfaces on the L3 interconnect */ static struct omap_hwmod_class i2c_class = {
static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = { .name = "i2c",
&omap2430_l3_main__l4_core, .sysc = &i2c_sysc,
.rev = OMAP_I2C_IP_VERSION_1,
.reset = &omap_i2c_reset,
}; };
/* L3 */ static struct omap_i2c_dev_attr i2c_dev_attr = {
static struct omap_hwmod omap2430_l3_main_hwmod = { .fifo_depth = 8, /* bytes */
.name = "l3_main", .flags = OMAP_I2C_FLAG_APPLY_ERRATA_I207 |
.class = &l3_hwmod_class, OMAP_I2C_FLAG_BUS_SHIFT_2 |
.masters = omap2430_l3_main_masters, OMAP_I2C_FLAG_FORCE_19200_INT_CLK,
.masters_cnt = ARRAY_SIZE(omap2430_l3_main_masters),
.slaves = omap2430_l3_main_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_l3_main_slaves),
.flags = HWMOD_NO_IDLEST,
}; };
static struct omap_hwmod omap2430_l4_wkup_hwmod; /* I2C1 */
static struct omap_hwmod omap2430_uart1_hwmod; static struct omap_hwmod omap2430_i2c1_hwmod = {
static struct omap_hwmod omap2430_uart2_hwmod; .name = "i2c1",
static struct omap_hwmod omap2430_uart3_hwmod; .flags = HWMOD_16BIT_REG,
static struct omap_hwmod omap2430_i2c1_hwmod; .mpu_irqs = omap2_i2c1_mpu_irqs,
static struct omap_hwmod omap2430_i2c2_hwmod; .sdma_reqs = omap2_i2c1_sdma_reqs,
.main_clk = "i2chs1_fck",
static struct omap_hwmod omap2430_usbhsotg_hwmod; .prcm = {
.omap2 = {
/* l3_core -> usbhsotg interface */ /*
static struct omap_hwmod_ocp_if omap2430_usbhsotg__l3 = { * NOTE: The CM_FCLKEN* and CM_ICLKEN* for
.master = &omap2430_usbhsotg_hwmod, * I2CHS IP's do not follow the usual pattern.
.slave = &omap2430_l3_main_hwmod, * prcm_reg_id alone cannot be used to program
.clk = "core_l3_ck", * the iclk and fclk. Needs to be handled using
.user = OCP_USER_MPU, * additional flags when clk handling is moved
* to hwmod framework.
*/
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP2430_EN_I2CHS1_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP2430_ST_I2CHS1_SHIFT,
},
},
.class = &i2c_class,
.dev_attr = &i2c_dev_attr,
}; };
/* L4 CORE -> I2C1 interface */ /* I2C2 */
static struct omap_hwmod_ocp_if omap2430_l4_core__i2c1 = { static struct omap_hwmod omap2430_i2c2_hwmod = {
.master = &omap2430_l4_core_hwmod, .name = "i2c2",
.slave = &omap2430_i2c1_hwmod, .flags = HWMOD_16BIT_REG,
.clk = "i2c1_ick", .mpu_irqs = omap2_i2c2_mpu_irqs,
.addr = omap2_i2c1_addr_space, .sdma_reqs = omap2_i2c2_sdma_reqs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .main_clk = "i2chs2_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP2430_EN_I2CHS2_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP2430_ST_I2CHS2_SHIFT,
},
},
.class = &i2c_class,
.dev_attr = &i2c_dev_attr,
}; };
/* L4 CORE -> I2C2 interface */ /* gpio5 */
static struct omap_hwmod_ocp_if omap2430_l4_core__i2c2 = { static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = {
.master = &omap2430_l4_core_hwmod, { .irq = 33 }, /* INT_24XX_GPIO_BANK5 */
.slave = &omap2430_i2c2_hwmod, { .irq = -1 }
.clk = "i2c2_ick",
.addr = omap2_i2c2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* L4_CORE -> L4_WKUP interface */ static struct omap_hwmod omap2430_gpio5_hwmod = {
static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = { .name = "gpio5",
.master = &omap2430_l4_core_hwmod, .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.slave = &omap2430_l4_wkup_hwmod, .mpu_irqs = omap243x_gpio5_irqs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .main_clk = "gpio5_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 2,
.module_bit = OMAP2430_EN_GPIO5_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP2430_ST_GPIO5_SHIFT,
},
},
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &omap2xxx_gpio_dev_attr,
}; };
/* L4 CORE -> UART1 interface */ /* dma attributes */
static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = { static struct omap_dma_dev_attr dma_dev_attr = {
.master = &omap2430_l4_core_hwmod, .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
.slave = &omap2430_uart1_hwmod, IS_CSSA_32 | IS_CDSA_32 | IS_RW_PRIORITY,
.clk = "uart1_ick", .lch_count = 32,
.addr = omap2xxx_uart1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* L4 CORE -> UART2 interface */ static struct omap_hwmod omap2430_dma_system_hwmod = {
static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = { .name = "dma",
.master = &omap2430_l4_core_hwmod, .class = &omap2xxx_dma_hwmod_class,
.slave = &omap2430_uart2_hwmod, .mpu_irqs = omap2_dma_system_irqs,
.clk = "uart2_ick", .main_clk = "core_l3_ck",
.addr = omap2xxx_uart2_addr_space, .dev_attr = &dma_dev_attr,
.user = OCP_USER_MPU | OCP_USER_SDMA, .flags = HWMOD_NO_IDLEST,
}; };
/* L4 PER -> UART3 interface */ /* mailbox */
static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = { static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = {
.master = &omap2430_l4_core_hwmod, { .irq = 26 },
.slave = &omap2430_uart3_hwmod, { .irq = -1 }
.clk = "uart3_ick",
.addr = omap2xxx_uart3_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* static struct omap_hwmod omap2430_mailbox_hwmod = {
* usbhsotg interface data .name = "mailbox",
*/ .class = &omap2xxx_mailbox_hwmod_class,
static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = { .mpu_irqs = omap2430_mailbox_irqs,
{ .main_clk = "mailboxes_ick",
.pa_start = OMAP243X_HS_BASE, .prcm = {
.pa_end = OMAP243X_HS_BASE + SZ_4K - 1, .omap2 = {
.flags = ADDR_TYPE_RT .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
},
}, },
{ }
}; };
/* l4_core ->usbhsotg interface */ /* mcspi3 */
static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = { static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = {
.master = &omap2430_l4_core_hwmod, { .irq = 91 },
.slave = &omap2430_usbhsotg_hwmod, { .irq = -1 }
.clk = "usb_l4_ick",
.addr = omap2430_usbhsotg_addrs,
.user = OCP_USER_MPU,
}; };
static struct omap_hwmod_ocp_if *omap2430_usbhsotg_masters[] = { static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = {
&omap2430_usbhsotg__l3, { .name = "tx0", .dma_req = 15 }, /* DMA_SPI3_TX0 */
{ .name = "rx0", .dma_req = 16 }, /* DMA_SPI3_RX0 */
{ .name = "tx1", .dma_req = 23 }, /* DMA_SPI3_TX1 */
{ .name = "rx1", .dma_req = 24 }, /* DMA_SPI3_RX1 */
{ .dma_req = -1 }
}; };
static struct omap_hwmod_ocp_if *omap2430_usbhsotg_slaves[] = { static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = {
&omap2430_l4_core__usbhsotg, .num_chipselect = 2,
}; };
/* L4 CORE -> MMC1 interface */ static struct omap_hwmod omap2430_mcspi3_hwmod = {
static struct omap_hwmod_ocp_if omap2430_l4_core__mmc1 = { .name = "mcspi3",
.master = &omap2430_l4_core_hwmod, .mpu_irqs = omap2430_mcspi3_mpu_irqs,
.slave = &omap2430_mmc1_hwmod, .sdma_reqs = omap2430_mcspi3_sdma_reqs,
.clk = "mmchs1_ick", .main_clk = "mcspi3_fck",
.addr = omap2430_mmc1_addr_space, .prcm = {
.user = OCP_USER_MPU | OCP_USER_SDMA, .omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 2,
.module_bit = OMAP2430_EN_MCSPI3_SHIFT,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP2430_ST_MCSPI3_SHIFT,
},
},
.class = &omap2xxx_mcspi_class,
.dev_attr = &omap_mcspi3_dev_attr,
}; };
/* L4 CORE -> MMC2 interface */ /* usbhsotg */
static struct omap_hwmod_ocp_if omap2430_l4_core__mmc2 = { static struct omap_hwmod_class_sysconfig omap2430_usbhsotg_sysc = {
.master = &omap2430_l4_core_hwmod, .rev_offs = 0x0400,
.slave = &omap2430_mmc2_hwmod, .sysc_offs = 0x0404,
.clk = "mmchs2_ick", .syss_offs = 0x0408,
.addr = omap2430_mmc2_addr_space, .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
.user = OCP_USER_MPU | OCP_USER_SDMA, SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
SYSC_HAS_AUTOIDLE),
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
.sysc_fields = &omap_hwmod_sysc_type1,
}; };
/* Slave interfaces on the L4_CORE interconnect */ static struct omap_hwmod_class usbotg_class = {
static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { .name = "usbotg",
&omap2430_l3_main__l4_core, .sysc = &omap2430_usbhsotg_sysc,
}; };
/* Master interfaces on the L4_CORE interconnect */ /* usb_otg_hs */
static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = { static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = {
&omap2430_l4_core__l4_wkup,
&omap2430_l4_core__mmc1,
&omap2430_l4_core__mmc2,
};
/* L4 CORE */ { .name = "mc", .irq = 92 },
static struct omap_hwmod omap2430_l4_core_hwmod = { { .name = "dma", .irq = 93 },
.name = "l4_core", { .irq = -1 }
.class = &l4_hwmod_class,
.masters = omap2430_l4_core_masters,
.masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters),
.slaves = omap2430_l4_core_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves),
.flags = HWMOD_NO_IDLEST,
}; };
/* Slave interfaces on the L4_WKUP interconnect */ static struct omap_hwmod omap2430_usbhsotg_hwmod = {
static struct omap_hwmod_ocp_if *omap2430_l4_wkup_slaves[] = { .name = "usb_otg_hs",
&omap2430_l4_core__l4_wkup, .mpu_irqs = omap2430_usbhsotg_mpu_irqs,
&omap2_l4_core__uart1, .main_clk = "usbhs_ick",
&omap2_l4_core__uart2, .prcm = {
&omap2_l4_core__uart3, .omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP2430_EN_USBHS_MASK,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP2430_ST_USBHS_SHIFT,
},
},
.class = &usbotg_class,
/*
* Erratum ID: i479 idle_req / idle_ack mechanism potentially
* broken when autoidle is enabled
* workaround is to disable the autoidle bit at module level.
*/
.flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
| HWMOD_SWSUP_MSTANDBY,
}; };
/* Master interfaces on the L4_WKUP interconnect */ /*
static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = { * 'mcbsp' class
}; * multi channel buffered serial port controller
*/
/* l4 core -> mcspi1 interface */ static struct omap_hwmod_class_sysconfig omap2430_mcbsp_sysc = {
static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi1 = { .rev_offs = 0x007C,
.master = &omap2430_l4_core_hwmod, .sysc_offs = 0x008C,
.slave = &omap2430_mcspi1_hwmod, .sysc_flags = (SYSC_HAS_SOFTRESET),
.clk = "mcspi1_ick", .sysc_fields = &omap_hwmod_sysc_type1,
.addr = omap2_mcspi1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* l4 core -> mcspi2 interface */ static struct omap_hwmod_class omap2430_mcbsp_hwmod_class = {
static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi2 = { .name = "mcbsp",
.master = &omap2430_l4_core_hwmod, .sysc = &omap2430_mcbsp_sysc,
.slave = &omap2430_mcspi2_hwmod, .rev = MCBSP_CONFIG_TYPE2,
.clk = "mcspi2_ick",
.addr = omap2_mcspi2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4 core -> mcspi3 interface */
static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi3 = {
.master = &omap2430_l4_core_hwmod,
.slave = &omap2430_mcspi3_hwmod,
.clk = "mcspi3_ick",
.addr = omap2430_mcspi3_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4 WKUP */
static struct omap_hwmod omap2430_l4_wkup_hwmod = {
.name = "l4_wkup",
.class = &l4_hwmod_class,
.masters = omap2430_l4_wkup_masters,
.masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters),
.slaves = omap2430_l4_wkup_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves),
.flags = HWMOD_NO_IDLEST,
};
/* Master interfaces on the MPU device */
static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = {
&omap2430_mpu__l3_main,
};
/* MPU */
static struct omap_hwmod omap2430_mpu_hwmod = {
.name = "mpu",
.class = &mpu_hwmod_class,
.main_clk = "mpu_ck",
.masters = omap2430_mpu_masters,
.masters_cnt = ARRAY_SIZE(omap2430_mpu_masters),
};
/*
* IVA2_1 interface data
*/
/* IVA2 <- L3 interface */
static struct omap_hwmod_ocp_if omap2430_l3__iva = {
.master = &omap2430_l3_main_hwmod,
.slave = &omap2430_iva_hwmod,
.clk = "dsp_fck",
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
static struct omap_hwmod_ocp_if *omap2430_iva_masters[] = {
&omap2430_l3__iva,
};
/*
* IVA2 (IVA2)
*/
static struct omap_hwmod omap2430_iva_hwmod = {
.name = "iva",
.class = &iva_hwmod_class,
.masters = omap2430_iva_masters,
.masters_cnt = ARRAY_SIZE(omap2430_iva_masters),
};
/* always-on timers dev attribute */
static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
.timer_capability = OMAP_TIMER_ALWON,
};
/* pwm timers dev attribute */
static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
.timer_capability = OMAP_TIMER_HAS_PWM,
};
/* timer1 */
static struct omap_hwmod omap2430_timer1_hwmod;
static struct omap_hwmod_addr_space omap2430_timer1_addrs[] = {
{
.pa_start = 0x49018000,
.pa_end = 0x49018000 + SZ_1K - 1,
.flags = ADDR_TYPE_RT
},
{ }
};
/* l4_wkup -> timer1 */
static struct omap_hwmod_ocp_if omap2430_l4_wkup__timer1 = {
.master = &omap2430_l4_wkup_hwmod,
.slave = &omap2430_timer1_hwmod,
.clk = "gpt1_ick",
.addr = omap2430_timer1_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer1 slave port */ /* mcbsp1 */
static struct omap_hwmod_ocp_if *omap2430_timer1_slaves[] = { static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = {
&omap2430_l4_wkup__timer1, { .name = "tx", .irq = 59 },
{ .name = "rx", .irq = 60 },
{ .name = "ovr", .irq = 61 },
{ .name = "common", .irq = 64 },
{ .irq = -1 }
}; };
/* timer1 hwmod */ static struct omap_hwmod omap2430_mcbsp1_hwmod = {
static struct omap_hwmod omap2430_timer1_hwmod = { .name = "mcbsp1",
.name = "timer1", .class = &omap2430_mcbsp_hwmod_class,
.mpu_irqs = omap2_timer1_mpu_irqs, .mpu_irqs = omap2430_mcbsp1_irqs,
.main_clk = "gpt1_fck", .sdma_reqs = omap2_mcbsp1_sdma_reqs,
.main_clk = "mcbsp1_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT1_SHIFT, .module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
.module_offs = WKUP_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1, .idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT, .idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
}, },
}, },
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2430_timer1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer1_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* timer2 */
static struct omap_hwmod omap2430_timer2_hwmod;
/* l4_core -> timer2 */
static struct omap_hwmod_ocp_if omap2430_l4_core__timer2 = {
.master = &omap2430_l4_core_hwmod,
.slave = &omap2430_timer2_hwmod,
.clk = "gpt2_ick",
.addr = omap2xxx_timer2_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer2 slave port */ /* mcbsp2 */
static struct omap_hwmod_ocp_if *omap2430_timer2_slaves[] = { static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = {
&omap2430_l4_core__timer2, { .name = "tx", .irq = 62 },
{ .name = "rx", .irq = 63 },
{ .name = "common", .irq = 16 },
{ .irq = -1 }
}; };
/* timer2 hwmod */ static struct omap_hwmod omap2430_mcbsp2_hwmod = {
static struct omap_hwmod omap2430_timer2_hwmod = { .name = "mcbsp2",
.name = "timer2", .class = &omap2430_mcbsp_hwmod_class,
.mpu_irqs = omap2_timer2_mpu_irqs, .mpu_irqs = omap2430_mcbsp2_irqs,
.main_clk = "gpt2_fck", .sdma_reqs = omap2_mcbsp2_sdma_reqs,
.main_clk = "mcbsp2_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT2_SHIFT, .module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1, .idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT, .idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
}, },
}, },
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2430_timer2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer2_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* timer3 */
static struct omap_hwmod omap2430_timer3_hwmod;
/* l4_core -> timer3 */
static struct omap_hwmod_ocp_if omap2430_l4_core__timer3 = {
.master = &omap2430_l4_core_hwmod,
.slave = &omap2430_timer3_hwmod,
.clk = "gpt3_ick",
.addr = omap2xxx_timer3_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer3 slave port */ /* mcbsp3 */
static struct omap_hwmod_ocp_if *omap2430_timer3_slaves[] = { static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = {
&omap2430_l4_core__timer3, { .name = "tx", .irq = 89 },
{ .name = "rx", .irq = 90 },
{ .name = "common", .irq = 17 },
{ .irq = -1 }
}; };
/* timer3 hwmod */ static struct omap_hwmod omap2430_mcbsp3_hwmod = {
static struct omap_hwmod omap2430_timer3_hwmod = { .name = "mcbsp3",
.name = "timer3", .class = &omap2430_mcbsp_hwmod_class,
.mpu_irqs = omap2_timer3_mpu_irqs, .mpu_irqs = omap2430_mcbsp3_irqs,
.main_clk = "gpt3_fck", .sdma_reqs = omap2_mcbsp3_sdma_reqs,
.main_clk = "mcbsp3_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT3_SHIFT, .module_bit = OMAP2430_EN_MCBSP3_SHIFT,
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1, .idlest_reg_id = 2,
.idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT, .idlest_idle_bit = OMAP2430_ST_MCBSP3_SHIFT,
}, },
}, },
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2430_timer3_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer3_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* timer4 */ /* mcbsp4 */
static struct omap_hwmod omap2430_timer4_hwmod; static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = {
{ .name = "tx", .irq = 54 },
/* l4_core -> timer4 */ { .name = "rx", .irq = 55 },
static struct omap_hwmod_ocp_if omap2430_l4_core__timer4 = { { .name = "common", .irq = 18 },
.master = &omap2430_l4_core_hwmod, { .irq = -1 }
.slave = &omap2430_timer4_hwmod,
.clk = "gpt4_ick",
.addr = omap2xxx_timer4_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer4 slave port */ static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = {
static struct omap_hwmod_ocp_if *omap2430_timer4_slaves[] = { { .name = "rx", .dma_req = 20 },
&omap2430_l4_core__timer4, { .name = "tx", .dma_req = 19 },
{ .dma_req = -1 }
}; };
/* timer4 hwmod */ static struct omap_hwmod omap2430_mcbsp4_hwmod = {
static struct omap_hwmod omap2430_timer4_hwmod = { .name = "mcbsp4",
.name = "timer4", .class = &omap2430_mcbsp_hwmod_class,
.mpu_irqs = omap2_timer4_mpu_irqs, .mpu_irqs = omap2430_mcbsp4_irqs,
.main_clk = "gpt4_fck", .sdma_reqs = omap2430_mcbsp4_sdma_chs,
.main_clk = "mcbsp4_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT4_SHIFT, .module_bit = OMAP2430_EN_MCBSP4_SHIFT,
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1, .idlest_reg_id = 2,
.idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT, .idlest_idle_bit = OMAP2430_ST_MCBSP4_SHIFT,
}, },
}, },
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2430_timer4_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer4_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* timer5 */ /* mcbsp5 */
static struct omap_hwmod omap2430_timer5_hwmod; static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = {
{ .name = "tx", .irq = 81 },
/* l4_core -> timer5 */ { .name = "rx", .irq = 82 },
static struct omap_hwmod_ocp_if omap2430_l4_core__timer5 = { { .name = "common", .irq = 19 },
.master = &omap2430_l4_core_hwmod, { .irq = -1 }
.slave = &omap2430_timer5_hwmod,
.clk = "gpt5_ick",
.addr = omap2xxx_timer5_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer5 slave port */ static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = {
static struct omap_hwmod_ocp_if *omap2430_timer5_slaves[] = { { .name = "rx", .dma_req = 22 },
&omap2430_l4_core__timer5, { .name = "tx", .dma_req = 21 },
{ .dma_req = -1 }
}; };
/* timer5 hwmod */ static struct omap_hwmod omap2430_mcbsp5_hwmod = {
static struct omap_hwmod omap2430_timer5_hwmod = { .name = "mcbsp5",
.name = "timer5", .class = &omap2430_mcbsp_hwmod_class,
.mpu_irqs = omap2_timer5_mpu_irqs, .mpu_irqs = omap2430_mcbsp5_irqs,
.main_clk = "gpt5_fck", .sdma_reqs = omap2430_mcbsp5_sdma_chs,
.main_clk = "mcbsp5_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1, .prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT5_SHIFT, .module_bit = OMAP2430_EN_MCBSP5_SHIFT,
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1, .idlest_reg_id = 2,
.idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT, .idlest_idle_bit = OMAP2430_ST_MCBSP5_SHIFT,
}, },
}, },
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2430_timer5_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer5_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* timer6 */ /* MMC/SD/SDIO common */
static struct omap_hwmod omap2430_timer6_hwmod; static struct omap_hwmod_class_sysconfig omap2430_mmc_sysc = {
.rev_offs = 0x1fc,
/* l4_core -> timer6 */ .sysc_offs = 0x10,
static struct omap_hwmod_ocp_if omap2430_l4_core__timer6 = { .syss_offs = 0x14,
.master = &omap2430_l4_core_hwmod, .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
.slave = &omap2430_timer6_hwmod, SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
.clk = "gpt6_ick", SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
.addr = omap2xxx_timer6_addrs, .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
.user = OCP_USER_MPU | OCP_USER_SDMA, .sysc_fields = &omap_hwmod_sysc_type1,
}; };
/* timer6 slave port */ static struct omap_hwmod_class omap2430_mmc_class = {
static struct omap_hwmod_ocp_if *omap2430_timer6_slaves[] = { .name = "mmc",
&omap2430_l4_core__timer6, .sysc = &omap2430_mmc_sysc,
}; };
/* timer6 hwmod */ /* MMC/SD/SDIO1 */
static struct omap_hwmod omap2430_timer6_hwmod = { static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = {
.name = "timer6", { .irq = 83 },
.mpu_irqs = omap2_timer6_mpu_irqs, { .irq = -1 }
.main_clk = "gpt6_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT6_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.slaves = omap2430_timer6_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer6_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* timer7 */ static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = {
static struct omap_hwmod omap2430_timer7_hwmod; { .name = "tx", .dma_req = 61 }, /* DMA_MMC1_TX */
{ .name = "rx", .dma_req = 62 }, /* DMA_MMC1_RX */
{ .dma_req = -1 }
};
/* l4_core -> timer7 */ static struct omap_hwmod_opt_clk omap2430_mmc1_opt_clks[] = {
static struct omap_hwmod_ocp_if omap2430_l4_core__timer7 = { { .role = "dbck", .clk = "mmchsdb1_fck" },
.master = &omap2430_l4_core_hwmod,
.slave = &omap2430_timer7_hwmod,
.clk = "gpt7_ick",
.addr = omap2xxx_timer7_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer7 slave port */ static struct omap_mmc_dev_attr mmc1_dev_attr = {
static struct omap_hwmod_ocp_if *omap2430_timer7_slaves[] = { .flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
&omap2430_l4_core__timer7,
}; };
/* timer7 hwmod */ static struct omap_hwmod omap2430_mmc1_hwmod = {
static struct omap_hwmod omap2430_timer7_hwmod = { .name = "mmc1",
.name = "timer7", .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_timer7_mpu_irqs, .mpu_irqs = omap2430_mmc1_mpu_irqs,
.main_clk = "gpt7_fck", .sdma_reqs = omap2430_mmc1_sdma_reqs,
.opt_clks = omap2430_mmc1_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(omap2430_mmc1_opt_clks),
.main_clk = "mmchs1_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT7_SHIFT,
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1, .prcm_reg_id = 2,
.idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT, .module_bit = OMAP2430_EN_MMCHS1_SHIFT,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP2430_ST_MMCHS1_SHIFT,
}, },
}, },
.dev_attr = &capability_alwon_dev_attr, .dev_attr = &mmc1_dev_attr,
.slaves = omap2430_timer7_slaves, .class = &omap2430_mmc_class,
.slaves_cnt = ARRAY_SIZE(omap2430_timer7_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* timer8 */ /* MMC/SD/SDIO2 */
static struct omap_hwmod omap2430_timer8_hwmod; static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = {
{ .irq = 86 },
{ .irq = -1 }
};
/* l4_core -> timer8 */ static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = {
static struct omap_hwmod_ocp_if omap2430_l4_core__timer8 = { { .name = "tx", .dma_req = 47 }, /* DMA_MMC2_TX */
.master = &omap2430_l4_core_hwmod, { .name = "rx", .dma_req = 48 }, /* DMA_MMC2_RX */
.slave = &omap2430_timer8_hwmod, { .dma_req = -1 }
.clk = "gpt8_ick",
.addr = omap2xxx_timer8_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer8 slave port */ static struct omap_hwmod_opt_clk omap2430_mmc2_opt_clks[] = {
static struct omap_hwmod_ocp_if *omap2430_timer8_slaves[] = { { .role = "dbck", .clk = "mmchsdb2_fck" },
&omap2430_l4_core__timer8,
}; };
/* timer8 hwmod */ static struct omap_hwmod omap2430_mmc2_hwmod = {
static struct omap_hwmod omap2430_timer8_hwmod = { .name = "mmc2",
.name = "timer8", .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_timer8_mpu_irqs, .mpu_irqs = omap2430_mmc2_mpu_irqs,
.main_clk = "gpt8_fck", .sdma_reqs = omap2430_mmc2_sdma_reqs,
.opt_clks = omap2430_mmc2_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(omap2430_mmc2_opt_clks),
.main_clk = "mmchs2_fck",
.prcm = { .prcm = {
.omap2 = { .omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT8_SHIFT,
.module_offs = CORE_MOD, .module_offs = CORE_MOD,
.idlest_reg_id = 1, .prcm_reg_id = 2,
.idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, .module_bit = OMAP2430_EN_MMCHS2_SHIFT,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP2430_ST_MMCHS2_SHIFT,
}, },
}, },
.dev_attr = &capability_alwon_dev_attr, .class = &omap2430_mmc_class,
.slaves = omap2430_timer8_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer8_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* timer9 */ /*
static struct omap_hwmod omap2430_timer9_hwmod; * interfaces
*/
/* l4_core -> timer9 */ /* L3 -> L4_CORE interface */
static struct omap_hwmod_ocp_if omap2430_l4_core__timer9 = { /* l3_core -> usbhsotg interface */
.master = &omap2430_l4_core_hwmod, static struct omap_hwmod_ocp_if omap2430_usbhsotg__l3 = {
.slave = &omap2430_timer9_hwmod, .master = &omap2430_usbhsotg_hwmod,
.clk = "gpt9_ick", .slave = &omap2xxx_l3_main_hwmod,
.addr = omap2xxx_timer9_addrs, .clk = "core_l3_ck",
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU,
}; };
/* timer9 slave port */ /* L4 CORE -> I2C1 interface */
static struct omap_hwmod_ocp_if *omap2430_timer9_slaves[] = { static struct omap_hwmod_ocp_if omap2430_l4_core__i2c1 = {
&omap2430_l4_core__timer9, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2430_i2c1_hwmod,
.clk = "i2c1_ick",
.addr = omap2_i2c1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer9 hwmod */ /* L4 CORE -> I2C2 interface */
static struct omap_hwmod omap2430_timer9_hwmod = { static struct omap_hwmod_ocp_if omap2430_l4_core__i2c2 = {
.name = "timer9", .master = &omap2xxx_l4_core_hwmod,
.mpu_irqs = omap2_timer9_mpu_irqs, .slave = &omap2430_i2c2_hwmod,
.main_clk = "gpt9_fck", .clk = "i2c2_ick",
.prcm = { .addr = omap2_i2c2_addr_space,
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT9_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
},
},
.dev_attr = &capability_pwm_dev_attr,
.slaves = omap2430_timer9_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer9_slaves),
.class = &omap2xxx_timer_hwmod_class,
};
/* timer10 */
static struct omap_hwmod omap2430_timer10_hwmod;
/* l4_core -> timer10 */
static struct omap_hwmod_ocp_if omap2430_l4_core__timer10 = {
.master = &omap2430_l4_core_hwmod,
.slave = &omap2430_timer10_hwmod,
.clk = "gpt10_ick",
.addr = omap2_timer10_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer10 slave port */ static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = {
static struct omap_hwmod_ocp_if *omap2430_timer10_slaves[] = { {
&omap2430_l4_core__timer10, .pa_start = OMAP243X_HS_BASE,
}; .pa_end = OMAP243X_HS_BASE + SZ_4K - 1,
.flags = ADDR_TYPE_RT
/* timer10 hwmod */
static struct omap_hwmod omap2430_timer10_hwmod = {
.name = "timer10",
.mpu_irqs = omap2_timer10_mpu_irqs,
.main_clk = "gpt10_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT10_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
},
}, },
.dev_attr = &capability_pwm_dev_attr, { }
.slaves = omap2430_timer10_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer10_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* timer11 */ /* l4_core ->usbhsotg interface */
static struct omap_hwmod omap2430_timer11_hwmod; static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2430_usbhsotg_hwmod,
.clk = "usb_l4_ick",
.addr = omap2430_usbhsotg_addrs,
.user = OCP_USER_MPU,
};
/* l4_core -> timer11 */ /* L4 CORE -> MMC1 interface */
static struct omap_hwmod_ocp_if omap2430_l4_core__timer11 = { static struct omap_hwmod_ocp_if omap2430_l4_core__mmc1 = {
.master = &omap2430_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2430_timer11_hwmod, .slave = &omap2430_mmc1_hwmod,
.clk = "gpt11_ick", .clk = "mmchs1_ick",
.addr = omap2_timer11_addrs, .addr = omap2430_mmc1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer11 slave port */ /* L4 CORE -> MMC2 interface */
static struct omap_hwmod_ocp_if *omap2430_timer11_slaves[] = { static struct omap_hwmod_ocp_if omap2430_l4_core__mmc2 = {
&omap2430_l4_core__timer11, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2430_mmc2_hwmod,
.clk = "mmchs2_ick",
.addr = omap2430_mmc2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer11 hwmod */ /* l4 core -> mcspi3 interface */
static struct omap_hwmod omap2430_timer11_hwmod = { static struct omap_hwmod_ocp_if omap2430_l4_core__mcspi3 = {
.name = "timer11", .master = &omap2xxx_l4_core_hwmod,
.mpu_irqs = omap2_timer11_mpu_irqs, .slave = &omap2430_mcspi3_hwmod,
.main_clk = "gpt11_fck", .clk = "mcspi3_ick",
.prcm = { .addr = omap2430_mcspi3_addr_space,
.omap2 = { .user = OCP_USER_MPU | OCP_USER_SDMA,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT11_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
},
},
.dev_attr = &capability_pwm_dev_attr,
.slaves = omap2430_timer11_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer11_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* timer12 */ /* IVA2 <- L3 interface */
static struct omap_hwmod omap2430_timer12_hwmod; static struct omap_hwmod_ocp_if omap2430_l3__iva = {
.master = &omap2xxx_l3_main_hwmod,
/* l4_core -> timer12 */ .slave = &omap2430_iva_hwmod,
static struct omap_hwmod_ocp_if omap2430_l4_core__timer12 = { .clk = "core_l3_ck",
.master = &omap2430_l4_core_hwmod,
.slave = &omap2430_timer12_hwmod,
.clk = "gpt12_ick",
.addr = omap2xxx_timer12_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* timer12 slave port */ static struct omap_hwmod_addr_space omap2430_timer1_addrs[] = {
static struct omap_hwmod_ocp_if *omap2430_timer12_slaves[] = { {
&omap2430_l4_core__timer12, .pa_start = 0x49018000,
.pa_end = 0x49018000 + SZ_1K - 1,
.flags = ADDR_TYPE_RT
},
{ }
}; };
/* timer12 hwmod */ /* l4_wkup -> timer1 */
static struct omap_hwmod omap2430_timer12_hwmod = { static struct omap_hwmod_ocp_if omap2430_l4_wkup__timer1 = {
.name = "timer12", .master = &omap2xxx_l4_wkup_hwmod,
.mpu_irqs = omap2xxx_timer12_mpu_irqs, .slave = &omap2xxx_timer1_hwmod,
.main_clk = "gpt12_fck", .clk = "gpt1_ick",
.prcm = { .addr = omap2430_timer1_addrs,
.omap2 = { .user = OCP_USER_MPU | OCP_USER_SDMA,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT12_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
},
},
.dev_attr = &capability_pwm_dev_attr,
.slaves = omap2430_timer12_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_timer12_slaves),
.class = &omap2xxx_timer_hwmod_class,
}; };
/* l4_wkup -> wd_timer2 */ /* l4_wkup -> wd_timer2 */
...@@ -817,923 +641,146 @@ static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = { ...@@ -817,923 +641,146 @@ static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = {
}; };
static struct omap_hwmod_ocp_if omap2430_l4_wkup__wd_timer2 = { static struct omap_hwmod_ocp_if omap2430_l4_wkup__wd_timer2 = {
.master = &omap2430_l4_wkup_hwmod, .master = &omap2xxx_l4_wkup_hwmod,
.slave = &omap2430_wd_timer2_hwmod, .slave = &omap2xxx_wd_timer2_hwmod,
.clk = "mpu_wdt_ick", .clk = "mpu_wdt_ick",
.addr = omap2430_wd_timer2_addrs, .addr = omap2430_wd_timer2_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* wd_timer2 */ /* l4_wkup -> gpio1 */
static struct omap_hwmod_ocp_if *omap2430_wd_timer2_slaves[] = { static struct omap_hwmod_addr_space omap2430_gpio1_addr_space[] = {
&omap2430_l4_wkup__wd_timer2, {
}; .pa_start = 0x4900C000,
.pa_end = 0x4900C1ff,
static struct omap_hwmod omap2430_wd_timer2_hwmod = { .flags = ADDR_TYPE_RT
.name = "wd_timer2",
.class = &omap2xxx_wd_timer_hwmod_class,
.main_clk = "mpu_wdt_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
},
},
.slaves = omap2430_wd_timer2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_wd_timer2_slaves),
};
/* UART1 */
static struct omap_hwmod_ocp_if *omap2430_uart1_slaves[] = {
&omap2_l4_core__uart1,
};
static struct omap_hwmod omap2430_uart1_hwmod = {
.name = "uart1",
.mpu_irqs = omap2_uart1_mpu_irqs,
.sdma_reqs = omap2_uart1_sdma_reqs,
.main_clk = "uart1_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_UART1_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
},
},
.slaves = omap2430_uart1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_uart1_slaves),
.class = &omap2_uart_class,
};
/* UART2 */
static struct omap_hwmod_ocp_if *omap2430_uart2_slaves[] = {
&omap2_l4_core__uart2,
};
static struct omap_hwmod omap2430_uart2_hwmod = {
.name = "uart2",
.mpu_irqs = omap2_uart2_mpu_irqs,
.sdma_reqs = omap2_uart2_sdma_reqs,
.main_clk = "uart2_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_UART2_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
},
},
.slaves = omap2430_uart2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_uart2_slaves),
.class = &omap2_uart_class,
};
/* UART3 */
static struct omap_hwmod_ocp_if *omap2430_uart3_slaves[] = {
&omap2_l4_core__uart3,
};
static struct omap_hwmod omap2430_uart3_hwmod = {
.name = "uart3",
.mpu_irqs = omap2_uart3_mpu_irqs,
.sdma_reqs = omap2_uart3_sdma_reqs,
.main_clk = "uart3_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 2,
.module_bit = OMAP24XX_EN_UART3_SHIFT,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
},
}, },
.slaves = omap2430_uart3_slaves, { }
.slaves_cnt = ARRAY_SIZE(omap2430_uart3_slaves),
.class = &omap2_uart_class,
};
/* dss */
/* dss master ports */
static struct omap_hwmod_ocp_if *omap2430_dss_masters[] = {
&omap2430_dss__l3,
}; };
/* l4_core -> dss */ static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio1 = {
static struct omap_hwmod_ocp_if omap2430_l4_core__dss = { .master = &omap2xxx_l4_wkup_hwmod,
.master = &omap2430_l4_core_hwmod, .slave = &omap2xxx_gpio1_hwmod,
.slave = &omap2430_dss_core_hwmod, .clk = "gpios_ick",
.clk = "dss_ick", .addr = omap2430_gpio1_addr_space,
.addr = omap2_dss_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* dss slave ports */ /* l4_wkup -> gpio2 */
static struct omap_hwmod_ocp_if *omap2430_dss_slaves[] = { static struct omap_hwmod_addr_space omap2430_gpio2_addr_space[] = {
&omap2430_l4_core__dss, {
}; .pa_start = 0x4900E000,
.pa_end = 0x4900E1ff,
static struct omap_hwmod_opt_clk dss_opt_clks[] = { .flags = ADDR_TYPE_RT
/*
* The DSS HW needs all DSS clocks enabled during reset. The dss_core
* driver does not use these clocks.
*/
{ .role = "tv_clk", .clk = "dss_54m_fck" },
{ .role = "sys_clk", .clk = "dss2_fck" },
};
static struct omap_hwmod omap2430_dss_core_hwmod = {
.name = "dss_core",
.class = &omap2_dss_hwmod_class,
.main_clk = "dss1_fck", /* instead of dss_fck */
.sdma_reqs = omap2xxx_dss_sdma_chs,
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
},
}, },
.opt_clks = dss_opt_clks, { }
.opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
.slaves = omap2430_dss_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_dss_slaves),
.masters = omap2430_dss_masters,
.masters_cnt = ARRAY_SIZE(omap2430_dss_masters),
.flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
};
/* l4_core -> dss_dispc */
static struct omap_hwmod_ocp_if omap2430_l4_core__dss_dispc = {
.master = &omap2430_l4_core_hwmod,
.slave = &omap2430_dss_dispc_hwmod,
.clk = "dss_ick",
.addr = omap2_dss_dispc_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* dss_dispc slave ports */ static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio2 = {
static struct omap_hwmod_ocp_if *omap2430_dss_dispc_slaves[] = { .master = &omap2xxx_l4_wkup_hwmod,
&omap2430_l4_core__dss_dispc, .slave = &omap2xxx_gpio2_hwmod,
.clk = "gpios_ick",
.addr = omap2430_gpio2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
static struct omap_hwmod omap2430_dss_dispc_hwmod = { /* l4_wkup -> gpio3 */
.name = "dss_dispc", static struct omap_hwmod_addr_space omap2430_gpio3_addr_space[] = {
.class = &omap2_dispc_hwmod_class, {
.mpu_irqs = omap2_dispc_irqs, .pa_start = 0x49010000,
.main_clk = "dss1_fck", .pa_end = 0x490101ff,
.prcm = { .flags = ADDR_TYPE_RT
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
},
}, },
.slaves = omap2430_dss_dispc_slaves, { }
.slaves_cnt = ARRAY_SIZE(omap2430_dss_dispc_slaves),
.flags = HWMOD_NO_IDLEST,
.dev_attr = &omap2_3_dss_dispc_dev_attr
}; };
/* l4_core -> dss_rfbi */ static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio3 = {
static struct omap_hwmod_ocp_if omap2430_l4_core__dss_rfbi = { .master = &omap2xxx_l4_wkup_hwmod,
.master = &omap2430_l4_core_hwmod, .slave = &omap2xxx_gpio3_hwmod,
.slave = &omap2430_dss_rfbi_hwmod, .clk = "gpios_ick",
.clk = "dss_ick", .addr = omap2430_gpio3_addr_space,
.addr = omap2_dss_rfbi_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* dss_rfbi slave ports */ /* l4_wkup -> gpio4 */
static struct omap_hwmod_ocp_if *omap2430_dss_rfbi_slaves[] = { static struct omap_hwmod_addr_space omap2430_gpio4_addr_space[] = {
&omap2430_l4_core__dss_rfbi, {
}; .pa_start = 0x49012000,
.pa_end = 0x490121ff,
static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = { .flags = ADDR_TYPE_RT
{ .role = "ick", .clk = "dss_ick" },
};
static struct omap_hwmod omap2430_dss_rfbi_hwmod = {
.name = "dss_rfbi",
.class = &omap2_rfbi_hwmod_class,
.main_clk = "dss1_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
},
}, },
.opt_clks = dss_rfbi_opt_clks, { }
.opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
.slaves = omap2430_dss_rfbi_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_dss_rfbi_slaves),
.flags = HWMOD_NO_IDLEST,
}; };
/* l4_core -> dss_venc */ static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio4 = {
static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = { .master = &omap2xxx_l4_wkup_hwmod,
.master = &omap2430_l4_core_hwmod, .slave = &omap2xxx_gpio4_hwmod,
.slave = &omap2430_dss_venc_hwmod, .clk = "gpios_ick",
.clk = "dss_ick", .addr = omap2430_gpio4_addr_space,
.addr = omap2_dss_venc_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* dss_venc slave ports */ /* l4_core -> gpio5 */
static struct omap_hwmod_ocp_if *omap2430_dss_venc_slaves[] = { static struct omap_hwmod_addr_space omap2430_gpio5_addr_space[] = {
&omap2430_l4_core__dss_venc, {
}; .pa_start = 0x480B6000,
.pa_end = 0x480B61ff,
static struct omap_hwmod omap2430_dss_venc_hwmod = { .flags = ADDR_TYPE_RT
.name = "dss_venc",
.class = &omap2_venc_hwmod_class,
.main_clk = "dss_54m_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
},
}, },
.slaves = omap2430_dss_venc_slaves, { }
.slaves_cnt = ARRAY_SIZE(omap2430_dss_venc_slaves),
.flags = HWMOD_NO_IDLEST,
};
/* I2C common */
static struct omap_hwmod_class_sysconfig i2c_sysc = {
.rev_offs = 0x00,
.sysc_offs = 0x20,
.syss_offs = 0x10,
.sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
SYSS_HAS_RESET_STATUS),
.sysc_fields = &omap_hwmod_sysc_type1,
}; };
static struct omap_hwmod_class i2c_class = { static struct omap_hwmod_ocp_if omap2430_l4_core__gpio5 = {
.name = "i2c", .master = &omap2xxx_l4_core_hwmod,
.sysc = &i2c_sysc, .slave = &omap2430_gpio5_hwmod,
.rev = OMAP_I2C_IP_VERSION_1, .clk = "gpio5_ick",
.reset = &omap_i2c_reset, .addr = omap2430_gpio5_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
static struct omap_i2c_dev_attr i2c_dev_attr = { /* dma_system -> L3 */
.fifo_depth = 8, /* bytes */ static struct omap_hwmod_ocp_if omap2430_dma_system__l3 = {
.flags = OMAP_I2C_FLAG_APPLY_ERRATA_I207 | .master = &omap2430_dma_system_hwmod,
OMAP_I2C_FLAG_BUS_SHIFT_2 | .slave = &omap2xxx_l3_main_hwmod,
OMAP_I2C_FLAG_FORCE_19200_INT_CLK, .clk = "core_l3_ck",
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* I2C1 */ /* l4_core -> dma_system */
static struct omap_hwmod_ocp_if omap2430_l4_core__dma_system = {
static struct omap_hwmod_ocp_if *omap2430_i2c1_slaves[] = { .master = &omap2xxx_l4_core_hwmod,
&omap2430_l4_core__i2c1, .slave = &omap2430_dma_system_hwmod,
}; .clk = "sdma_ick",
.addr = omap2_dma_system_addrs,
static struct omap_hwmod omap2430_i2c1_hwmod = { .user = OCP_USER_MPU | OCP_USER_SDMA,
.name = "i2c1",
.flags = HWMOD_16BIT_REG,
.mpu_irqs = omap2_i2c1_mpu_irqs,
.sdma_reqs = omap2_i2c1_sdma_reqs,
.main_clk = "i2chs1_fck",
.prcm = {
.omap2 = {
/*
* NOTE: The CM_FCLKEN* and CM_ICLKEN* for
* I2CHS IP's do not follow the usual pattern.
* prcm_reg_id alone cannot be used to program
* the iclk and fclk. Needs to be handled using
* additional flags when clk handling is moved
* to hwmod framework.
*/
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP2430_EN_I2CHS1_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP2430_ST_I2CHS1_SHIFT,
},
},
.slaves = omap2430_i2c1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves),
.class = &i2c_class,
.dev_attr = &i2c_dev_attr,
};
/* I2C2 */
static struct omap_hwmod_ocp_if *omap2430_i2c2_slaves[] = {
&omap2430_l4_core__i2c2,
};
static struct omap_hwmod omap2430_i2c2_hwmod = {
.name = "i2c2",
.flags = HWMOD_16BIT_REG,
.mpu_irqs = omap2_i2c2_mpu_irqs,
.sdma_reqs = omap2_i2c2_sdma_reqs,
.main_clk = "i2chs2_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP2430_EN_I2CHS2_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP2430_ST_I2CHS2_SHIFT,
},
},
.slaves = omap2430_i2c2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves),
.class = &i2c_class,
.dev_attr = &i2c_dev_attr,
};
/* l4_wkup -> gpio1 */
static struct omap_hwmod_addr_space omap2430_gpio1_addr_space[] = {
{
.pa_start = 0x4900C000,
.pa_end = 0x4900C1ff,
.flags = ADDR_TYPE_RT
},
{ }
};
static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio1 = {
.master = &omap2430_l4_wkup_hwmod,
.slave = &omap2430_gpio1_hwmod,
.clk = "gpios_ick",
.addr = omap2430_gpio1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_wkup -> gpio2 */
static struct omap_hwmod_addr_space omap2430_gpio2_addr_space[] = {
{
.pa_start = 0x4900E000,
.pa_end = 0x4900E1ff,
.flags = ADDR_TYPE_RT
},
{ }
};
static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio2 = {
.master = &omap2430_l4_wkup_hwmod,
.slave = &omap2430_gpio2_hwmod,
.clk = "gpios_ick",
.addr = omap2430_gpio2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_wkup -> gpio3 */
static struct omap_hwmod_addr_space omap2430_gpio3_addr_space[] = {
{
.pa_start = 0x49010000,
.pa_end = 0x490101ff,
.flags = ADDR_TYPE_RT
},
{ }
};
static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio3 = {
.master = &omap2430_l4_wkup_hwmod,
.slave = &omap2430_gpio3_hwmod,
.clk = "gpios_ick",
.addr = omap2430_gpio3_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_wkup -> gpio4 */
static struct omap_hwmod_addr_space omap2430_gpio4_addr_space[] = {
{
.pa_start = 0x49012000,
.pa_end = 0x490121ff,
.flags = ADDR_TYPE_RT
},
{ }
};
static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio4 = {
.master = &omap2430_l4_wkup_hwmod,
.slave = &omap2430_gpio4_hwmod,
.clk = "gpios_ick",
.addr = omap2430_gpio4_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> gpio5 */
static struct omap_hwmod_addr_space omap2430_gpio5_addr_space[] = {
{
.pa_start = 0x480B6000,
.pa_end = 0x480B61ff,
.flags = ADDR_TYPE_RT
},
{ }
};
static struct omap_hwmod_ocp_if omap2430_l4_core__gpio5 = {
.master = &omap2430_l4_core_hwmod,
.slave = &omap2430_gpio5_hwmod,
.clk = "gpio5_ick",
.addr = omap2430_gpio5_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* gpio dev_attr */
static struct omap_gpio_dev_attr gpio_dev_attr = {
.bank_width = 32,
.dbck_flag = false,
};
/* gpio1 */
static struct omap_hwmod_ocp_if *omap2430_gpio1_slaves[] = {
&omap2430_l4_wkup__gpio1,
};
static struct omap_hwmod omap2430_gpio1_hwmod = {
.name = "gpio1",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio1_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_EN_GPIOS_SHIFT,
},
},
.slaves = omap2430_gpio1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_gpio1_slaves),
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &gpio_dev_attr,
};
/* gpio2 */
static struct omap_hwmod_ocp_if *omap2430_gpio2_slaves[] = {
&omap2430_l4_wkup__gpio2,
};
static struct omap_hwmod omap2430_gpio2_hwmod = {
.name = "gpio2",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio2_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.slaves = omap2430_gpio2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_gpio2_slaves),
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &gpio_dev_attr,
};
/* gpio3 */
static struct omap_hwmod_ocp_if *omap2430_gpio3_slaves[] = {
&omap2430_l4_wkup__gpio3,
};
static struct omap_hwmod omap2430_gpio3_hwmod = {
.name = "gpio3",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio3_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.slaves = omap2430_gpio3_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_gpio3_slaves),
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &gpio_dev_attr,
};
/* gpio4 */
static struct omap_hwmod_ocp_if *omap2430_gpio4_slaves[] = {
&omap2430_l4_wkup__gpio4,
};
static struct omap_hwmod omap2430_gpio4_hwmod = {
.name = "gpio4",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio4_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.slaves = omap2430_gpio4_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_gpio4_slaves),
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &gpio_dev_attr,
};
/* gpio5 */
static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = {
{ .irq = 33 }, /* INT_24XX_GPIO_BANK5 */
{ .irq = -1 }
};
static struct omap_hwmod_ocp_if *omap2430_gpio5_slaves[] = {
&omap2430_l4_core__gpio5,
};
static struct omap_hwmod omap2430_gpio5_hwmod = {
.name = "gpio5",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap243x_gpio5_irqs,
.main_clk = "gpio5_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 2,
.module_bit = OMAP2430_EN_GPIO5_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP2430_ST_GPIO5_SHIFT,
},
},
.slaves = omap2430_gpio5_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_gpio5_slaves),
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &gpio_dev_attr,
};
/* dma attributes */
static struct omap_dma_dev_attr dma_dev_attr = {
.dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
IS_CSSA_32 | IS_CDSA_32 | IS_RW_PRIORITY,
.lch_count = 32,
};
/* dma_system -> L3 */
static struct omap_hwmod_ocp_if omap2430_dma_system__l3 = {
.master = &omap2430_dma_system_hwmod,
.slave = &omap2430_l3_main_hwmod,
.clk = "core_l3_ck",
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* dma_system master ports */
static struct omap_hwmod_ocp_if *omap2430_dma_system_masters[] = {
&omap2430_dma_system__l3,
};
/* l4_core -> dma_system */
static struct omap_hwmod_ocp_if omap2430_l4_core__dma_system = {
.master = &omap2430_l4_core_hwmod,
.slave = &omap2430_dma_system_hwmod,
.clk = "sdma_ick",
.addr = omap2_dma_system_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* dma_system slave ports */
static struct omap_hwmod_ocp_if *omap2430_dma_system_slaves[] = {
&omap2430_l4_core__dma_system,
};
static struct omap_hwmod omap2430_dma_system_hwmod = {
.name = "dma",
.class = &omap2xxx_dma_hwmod_class,
.mpu_irqs = omap2_dma_system_irqs,
.main_clk = "core_l3_ck",
.slaves = omap2430_dma_system_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_dma_system_slaves),
.masters = omap2430_dma_system_masters,
.masters_cnt = ARRAY_SIZE(omap2430_dma_system_masters),
.dev_attr = &dma_dev_attr,
.flags = HWMOD_NO_IDLEST,
};
/* mailbox */
static struct omap_hwmod omap2430_mailbox_hwmod;
static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = {
{ .irq = 26 },
{ .irq = -1 }
}; };
/* l4_core -> mailbox */ /* l4_core -> mailbox */
static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = { static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = {
.master = &omap2430_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2430_mailbox_hwmod, .slave = &omap2430_mailbox_hwmod,
.addr = omap2_mailbox_addrs, .addr = omap2_mailbox_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* mailbox slave ports */
static struct omap_hwmod_ocp_if *omap2430_mailbox_slaves[] = {
&omap2430_l4_core__mailbox,
};
static struct omap_hwmod omap2430_mailbox_hwmod = {
.name = "mailbox",
.class = &omap2xxx_mailbox_hwmod_class,
.mpu_irqs = omap2430_mailbox_irqs,
.main_clk = "mailboxes_ick",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MAILBOXES_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT,
},
},
.slaves = omap2430_mailbox_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_mailbox_slaves),
};
/* mcspi1 */
static struct omap_hwmod_ocp_if *omap2430_mcspi1_slaves[] = {
&omap2430_l4_core__mcspi1,
};
static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
.num_chipselect = 4,
};
static struct omap_hwmod omap2430_mcspi1_hwmod = {
.name = "mcspi1_hwmod",
.mpu_irqs = omap2_mcspi1_mpu_irqs,
.sdma_reqs = omap2_mcspi1_sdma_reqs,
.main_clk = "mcspi1_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
},
},
.slaves = omap2430_mcspi1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_mcspi1_slaves),
.class = &omap2xxx_mcspi_class,
.dev_attr = &omap_mcspi1_dev_attr,
};
/* mcspi2 */
static struct omap_hwmod_ocp_if *omap2430_mcspi2_slaves[] = {
&omap2430_l4_core__mcspi2,
};
static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
.num_chipselect = 2,
};
static struct omap_hwmod omap2430_mcspi2_hwmod = {
.name = "mcspi2_hwmod",
.mpu_irqs = omap2_mcspi2_mpu_irqs,
.sdma_reqs = omap2_mcspi2_sdma_reqs,
.main_clk = "mcspi2_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
},
},
.slaves = omap2430_mcspi2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_mcspi2_slaves),
.class = &omap2xxx_mcspi_class,
.dev_attr = &omap_mcspi2_dev_attr,
};
/* mcspi3 */
static struct omap_hwmod_irq_info omap2430_mcspi3_mpu_irqs[] = {
{ .irq = 91 },
{ .irq = -1 }
};
static struct omap_hwmod_dma_info omap2430_mcspi3_sdma_reqs[] = {
{ .name = "tx0", .dma_req = 15 }, /* DMA_SPI3_TX0 */
{ .name = "rx0", .dma_req = 16 }, /* DMA_SPI3_RX0 */
{ .name = "tx1", .dma_req = 23 }, /* DMA_SPI3_TX1 */
{ .name = "rx1", .dma_req = 24 }, /* DMA_SPI3_RX1 */
{ .dma_req = -1 }
};
static struct omap_hwmod_ocp_if *omap2430_mcspi3_slaves[] = {
&omap2430_l4_core__mcspi3,
};
static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = {
.num_chipselect = 2,
};
static struct omap_hwmod omap2430_mcspi3_hwmod = {
.name = "mcspi3_hwmod",
.mpu_irqs = omap2430_mcspi3_mpu_irqs,
.sdma_reqs = omap2430_mcspi3_sdma_reqs,
.main_clk = "mcspi3_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 2,
.module_bit = OMAP2430_EN_MCSPI3_SHIFT,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP2430_ST_MCSPI3_SHIFT,
},
},
.slaves = omap2430_mcspi3_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_mcspi3_slaves),
.class = &omap2xxx_mcspi_class,
.dev_attr = &omap_mcspi3_dev_attr,
};
/*
* usbhsotg
*/
static struct omap_hwmod_class_sysconfig omap2430_usbhsotg_sysc = {
.rev_offs = 0x0400,
.sysc_offs = 0x0404,
.syss_offs = 0x0408,
.sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
SYSC_HAS_AUTOIDLE),
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
.sysc_fields = &omap_hwmod_sysc_type1,
};
static struct omap_hwmod_class usbotg_class = {
.name = "usbotg",
.sysc = &omap2430_usbhsotg_sysc,
};
/* usb_otg_hs */
static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = {
{ .name = "mc", .irq = 92 },
{ .name = "dma", .irq = 93 },
{ .irq = -1 }
};
static struct omap_hwmod omap2430_usbhsotg_hwmod = {
.name = "usb_otg_hs",
.mpu_irqs = omap2430_usbhsotg_mpu_irqs,
.main_clk = "usbhs_ick",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP2430_EN_USBHS_MASK,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP2430_ST_USBHS_SHIFT,
},
},
.masters = omap2430_usbhsotg_masters,
.masters_cnt = ARRAY_SIZE(omap2430_usbhsotg_masters),
.slaves = omap2430_usbhsotg_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_usbhsotg_slaves),
.class = &usbotg_class,
/*
* Erratum ID: i479 idle_req / idle_ack mechanism potentially
* broken when autoidle is enabled
* workaround is to disable the autoidle bit at module level.
*/
.flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
| HWMOD_SWSUP_MSTANDBY,
};
/*
* 'mcbsp' class
* multi channel buffered serial port controller
*/
static struct omap_hwmod_class_sysconfig omap2430_mcbsp_sysc = {
.rev_offs = 0x007C,
.sysc_offs = 0x008C,
.sysc_flags = (SYSC_HAS_SOFTRESET),
.sysc_fields = &omap_hwmod_sysc_type1,
};
static struct omap_hwmod_class omap2430_mcbsp_hwmod_class = {
.name = "mcbsp",
.sysc = &omap2430_mcbsp_sysc,
.rev = MCBSP_CONFIG_TYPE2,
};
/* mcbsp1 */
static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = {
{ .name = "tx", .irq = 59 },
{ .name = "rx", .irq = 60 },
{ .name = "ovr", .irq = 61 },
{ .name = "common", .irq = 64 },
{ .irq = -1 }
};
/* l4_core -> mcbsp1 */
static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp1 = {
.master = &omap2430_l4_core_hwmod,
.slave = &omap2430_mcbsp1_hwmod,
.clk = "mcbsp1_ick",
.addr = omap2_mcbsp1_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* mcbsp1 slave ports */
static struct omap_hwmod_ocp_if *omap2430_mcbsp1_slaves[] = {
&omap2430_l4_core__mcbsp1,
};
static struct omap_hwmod omap2430_mcbsp1_hwmod = {
.name = "mcbsp1",
.class = &omap2430_mcbsp_hwmod_class,
.mpu_irqs = omap2430_mcbsp1_irqs,
.sdma_reqs = omap2_mcbsp1_sdma_reqs,
.main_clk = "mcbsp1_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MCBSP1_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT,
},
},
.slaves = omap2430_mcbsp1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_mcbsp1_slaves),
}; };
/* mcbsp2 */ /* l4_core -> mcbsp1 */
static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = { static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp1 = {
{ .name = "tx", .irq = 62 }, .master = &omap2xxx_l4_core_hwmod,
{ .name = "rx", .irq = 63 }, .slave = &omap2430_mcbsp1_hwmod,
{ .name = "common", .irq = 16 }, .clk = "mcbsp1_ick",
{ .irq = -1 } .addr = omap2_mcbsp1_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* l4_core -> mcbsp2 */ /* l4_core -> mcbsp2 */
static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp2 = { static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp2 = {
.master = &omap2430_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2430_mcbsp2_hwmod, .slave = &omap2430_mcbsp2_hwmod,
.clk = "mcbsp2_ick", .clk = "mcbsp2_ick",
.addr = omap2xxx_mcbsp2_addrs, .addr = omap2xxx_mcbsp2_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* mcbsp2 slave ports */
static struct omap_hwmod_ocp_if *omap2430_mcbsp2_slaves[] = {
&omap2430_l4_core__mcbsp2,
};
static struct omap_hwmod omap2430_mcbsp2_hwmod = {
.name = "mcbsp2",
.class = &omap2430_mcbsp_hwmod_class,
.mpu_irqs = omap2430_mcbsp2_irqs,
.sdma_reqs = omap2_mcbsp2_sdma_reqs,
.main_clk = "mcbsp2_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MCBSP2_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT,
},
},
.slaves = omap2430_mcbsp2_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_mcbsp2_slaves),
};
/* mcbsp3 */
static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = {
{ .name = "tx", .irq = 89 },
{ .name = "rx", .irq = 90 },
{ .name = "common", .irq = 17 },
{ .irq = -1 }
};
static struct omap_hwmod_addr_space omap2430_mcbsp3_addrs[] = { static struct omap_hwmod_addr_space omap2430_mcbsp3_addrs[] = {
{ {
.name = "mpu", .name = "mpu",
...@@ -1746,51 +793,13 @@ static struct omap_hwmod_addr_space omap2430_mcbsp3_addrs[] = { ...@@ -1746,51 +793,13 @@ static struct omap_hwmod_addr_space omap2430_mcbsp3_addrs[] = {
/* l4_core -> mcbsp3 */ /* l4_core -> mcbsp3 */
static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp3 = { static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp3 = {
.master = &omap2430_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2430_mcbsp3_hwmod, .slave = &omap2430_mcbsp3_hwmod,
.clk = "mcbsp3_ick", .clk = "mcbsp3_ick",
.addr = omap2430_mcbsp3_addrs, .addr = omap2430_mcbsp3_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* mcbsp3 slave ports */
static struct omap_hwmod_ocp_if *omap2430_mcbsp3_slaves[] = {
&omap2430_l4_core__mcbsp3,
};
static struct omap_hwmod omap2430_mcbsp3_hwmod = {
.name = "mcbsp3",
.class = &omap2430_mcbsp_hwmod_class,
.mpu_irqs = omap2430_mcbsp3_irqs,
.sdma_reqs = omap2_mcbsp3_sdma_reqs,
.main_clk = "mcbsp3_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP2430_EN_MCBSP3_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP2430_ST_MCBSP3_SHIFT,
},
},
.slaves = omap2430_mcbsp3_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_mcbsp3_slaves),
};
/* mcbsp4 */
static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = {
{ .name = "tx", .irq = 54 },
{ .name = "rx", .irq = 55 },
{ .name = "common", .irq = 18 },
{ .irq = -1 }
};
static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = {
{ .name = "rx", .dma_req = 20 },
{ .name = "tx", .dma_req = 19 },
{ .dma_req = -1 }
};
static struct omap_hwmod_addr_space omap2430_mcbsp4_addrs[] = { static struct omap_hwmod_addr_space omap2430_mcbsp4_addrs[] = {
{ {
.name = "mpu", .name = "mpu",
...@@ -1803,51 +812,13 @@ static struct omap_hwmod_addr_space omap2430_mcbsp4_addrs[] = { ...@@ -1803,51 +812,13 @@ static struct omap_hwmod_addr_space omap2430_mcbsp4_addrs[] = {
/* l4_core -> mcbsp4 */ /* l4_core -> mcbsp4 */
static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp4 = { static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp4 = {
.master = &omap2430_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2430_mcbsp4_hwmod, .slave = &omap2430_mcbsp4_hwmod,
.clk = "mcbsp4_ick", .clk = "mcbsp4_ick",
.addr = omap2430_mcbsp4_addrs, .addr = omap2430_mcbsp4_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* mcbsp4 slave ports */
static struct omap_hwmod_ocp_if *omap2430_mcbsp4_slaves[] = {
&omap2430_l4_core__mcbsp4,
};
static struct omap_hwmod omap2430_mcbsp4_hwmod = {
.name = "mcbsp4",
.class = &omap2430_mcbsp_hwmod_class,
.mpu_irqs = omap2430_mcbsp4_irqs,
.sdma_reqs = omap2430_mcbsp4_sdma_chs,
.main_clk = "mcbsp4_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP2430_EN_MCBSP4_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP2430_ST_MCBSP4_SHIFT,
},
},
.slaves = omap2430_mcbsp4_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_mcbsp4_slaves),
};
/* mcbsp5 */
static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = {
{ .name = "tx", .irq = 81 },
{ .name = "rx", .irq = 82 },
{ .name = "common", .irq = 19 },
{ .irq = -1 }
};
static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = {
{ .name = "rx", .dma_req = 22 },
{ .name = "tx", .dma_req = 21 },
{ .dma_req = -1 }
};
static struct omap_hwmod_addr_space omap2430_mcbsp5_addrs[] = { static struct omap_hwmod_addr_space omap2430_mcbsp5_addrs[] = {
{ {
.name = "mpu", .name = "mpu",
...@@ -1860,213 +831,65 @@ static struct omap_hwmod_addr_space omap2430_mcbsp5_addrs[] = { ...@@ -1860,213 +831,65 @@ static struct omap_hwmod_addr_space omap2430_mcbsp5_addrs[] = {
/* l4_core -> mcbsp5 */ /* l4_core -> mcbsp5 */
static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp5 = { static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp5 = {
.master = &omap2430_l4_core_hwmod, .master = &omap2xxx_l4_core_hwmod,
.slave = &omap2430_mcbsp5_hwmod, .slave = &omap2430_mcbsp5_hwmod,
.clk = "mcbsp5_ick", .clk = "mcbsp5_ick",
.addr = omap2430_mcbsp5_addrs, .addr = omap2430_mcbsp5_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA, .user = OCP_USER_MPU | OCP_USER_SDMA,
}; };
/* mcbsp5 slave ports */ static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = {
static struct omap_hwmod_ocp_if *omap2430_mcbsp5_slaves[] = { &omap2xxx_l3_main__l4_core,
&omap2430_l4_core__mcbsp5, &omap2xxx_mpu__l3_main,
}; &omap2xxx_dss__l3,
&omap2430_usbhsotg__l3,
static struct omap_hwmod omap2430_mcbsp5_hwmod = { &omap2430_l4_core__i2c1,
.name = "mcbsp5", &omap2430_l4_core__i2c2,
.class = &omap2430_mcbsp_hwmod_class, &omap2xxx_l4_core__l4_wkup,
.mpu_irqs = omap2430_mcbsp5_irqs, &omap2_l4_core__uart1,
.sdma_reqs = omap2430_mcbsp5_sdma_chs, &omap2_l4_core__uart2,
.main_clk = "mcbsp5_fck", &omap2_l4_core__uart3,
.prcm = { &omap2430_l4_core__usbhsotg,
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP2430_EN_MCBSP5_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP2430_ST_MCBSP5_SHIFT,
},
},
.slaves = omap2430_mcbsp5_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_mcbsp5_slaves),
};
/* MMC/SD/SDIO common */
static struct omap_hwmod_class_sysconfig omap2430_mmc_sysc = {
.rev_offs = 0x1fc,
.sysc_offs = 0x10,
.syss_offs = 0x14,
.sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
.idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
.sysc_fields = &omap_hwmod_sysc_type1,
};
static struct omap_hwmod_class omap2430_mmc_class = {
.name = "mmc",
.sysc = &omap2430_mmc_sysc,
};
/* MMC/SD/SDIO1 */
static struct omap_hwmod_irq_info omap2430_mmc1_mpu_irqs[] = {
{ .irq = 83 },
{ .irq = -1 }
};
static struct omap_hwmod_dma_info omap2430_mmc1_sdma_reqs[] = {
{ .name = "tx", .dma_req = 61 }, /* DMA_MMC1_TX */
{ .name = "rx", .dma_req = 62 }, /* DMA_MMC1_RX */
{ .dma_req = -1 }
};
static struct omap_hwmod_opt_clk omap2430_mmc1_opt_clks[] = {
{ .role = "dbck", .clk = "mmchsdb1_fck" },
};
static struct omap_hwmod_ocp_if *omap2430_mmc1_slaves[] = {
&omap2430_l4_core__mmc1, &omap2430_l4_core__mmc1,
};
static struct omap_mmc_dev_attr mmc1_dev_attr = {
.flags = OMAP_HSMMC_SUPPORTS_DUAL_VOLT,
};
static struct omap_hwmod omap2430_mmc1_hwmod = {
.name = "mmc1",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2430_mmc1_mpu_irqs,
.sdma_reqs = omap2430_mmc1_sdma_reqs,
.opt_clks = omap2430_mmc1_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(omap2430_mmc1_opt_clks),
.main_clk = "mmchs1_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 2,
.module_bit = OMAP2430_EN_MMCHS1_SHIFT,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP2430_ST_MMCHS1_SHIFT,
},
},
.dev_attr = &mmc1_dev_attr,
.slaves = omap2430_mmc1_slaves,
.slaves_cnt = ARRAY_SIZE(omap2430_mmc1_slaves),
.class = &omap2430_mmc_class,
};
/* MMC/SD/SDIO2 */
static struct omap_hwmod_irq_info omap2430_mmc2_mpu_irqs[] = {
{ .irq = 86 },
{ .irq = -1 }
};
static struct omap_hwmod_dma_info omap2430_mmc2_sdma_reqs[] = {
{ .name = "tx", .dma_req = 47 }, /* DMA_MMC2_TX */
{ .name = "rx", .dma_req = 48 }, /* DMA_MMC2_RX */
{ .dma_req = -1 }
};
static struct omap_hwmod_opt_clk omap2430_mmc2_opt_clks[] = {
{ .role = "dbck", .clk = "mmchsdb2_fck" },
};
static struct omap_hwmod_ocp_if *omap2430_mmc2_slaves[] = {
&omap2430_l4_core__mmc2, &omap2430_l4_core__mmc2,
}; &omap2xxx_l4_core__mcspi1,
&omap2xxx_l4_core__mcspi2,
static struct omap_hwmod omap2430_mmc2_hwmod = { &omap2430_l4_core__mcspi3,
.name = "mmc2", &omap2430_l3__iva,
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET, &omap2430_l4_wkup__timer1,
.mpu_irqs = omap2430_mmc2_mpu_irqs, &omap2xxx_l4_core__timer2,
.sdma_reqs = omap2430_mmc2_sdma_reqs, &omap2xxx_l4_core__timer3,
.opt_clks = omap2430_mmc2_opt_clks, &omap2xxx_l4_core__timer4,
.opt_clks_cnt = ARRAY_SIZE(omap2430_mmc2_opt_clks), &omap2xxx_l4_core__timer5,
.main_clk = "mmchs2_fck", &omap2xxx_l4_core__timer6,
.prcm = { &omap2xxx_l4_core__timer7,
.omap2 = { &omap2xxx_l4_core__timer8,
.module_offs = CORE_MOD, &omap2xxx_l4_core__timer9,
.prcm_reg_id = 2, &omap2xxx_l4_core__timer10,
.module_bit = OMAP2430_EN_MMCHS2_SHIFT, &omap2xxx_l4_core__timer11,
.idlest_reg_id = 2, &omap2xxx_l4_core__timer12,
.idlest_idle_bit = OMAP2430_ST_MMCHS2_SHIFT, &omap2430_l4_wkup__wd_timer2,
}, &omap2xxx_l4_core__dss,
}, &omap2xxx_l4_core__dss_dispc,
.slaves = omap2430_mmc2_slaves, &omap2xxx_l4_core__dss_rfbi,
.slaves_cnt = ARRAY_SIZE(omap2430_mmc2_slaves), &omap2xxx_l4_core__dss_venc,
.class = &omap2430_mmc_class, &omap2430_l4_wkup__gpio1,
}; &omap2430_l4_wkup__gpio2,
&omap2430_l4_wkup__gpio3,
static __initdata struct omap_hwmod *omap2430_hwmods[] = { &omap2430_l4_wkup__gpio4,
&omap2430_l3_main_hwmod, &omap2430_l4_core__gpio5,
&omap2430_l4_core_hwmod, &omap2430_dma_system__l3,
&omap2430_l4_wkup_hwmod, &omap2430_l4_core__dma_system,
&omap2430_mpu_hwmod, &omap2430_l4_core__mailbox,
&omap2430_iva_hwmod, &omap2430_l4_core__mcbsp1,
&omap2430_l4_core__mcbsp2,
&omap2430_timer1_hwmod, &omap2430_l4_core__mcbsp3,
&omap2430_timer2_hwmod, &omap2430_l4_core__mcbsp4,
&omap2430_timer3_hwmod, &omap2430_l4_core__mcbsp5,
&omap2430_timer4_hwmod,
&omap2430_timer5_hwmod,
&omap2430_timer6_hwmod,
&omap2430_timer7_hwmod,
&omap2430_timer8_hwmod,
&omap2430_timer9_hwmod,
&omap2430_timer10_hwmod,
&omap2430_timer11_hwmod,
&omap2430_timer12_hwmod,
&omap2430_wd_timer2_hwmod,
&omap2430_uart1_hwmod,
&omap2430_uart2_hwmod,
&omap2430_uart3_hwmod,
/* dss class */
&omap2430_dss_core_hwmod,
&omap2430_dss_dispc_hwmod,
&omap2430_dss_rfbi_hwmod,
&omap2430_dss_venc_hwmod,
/* i2c class */
&omap2430_i2c1_hwmod,
&omap2430_i2c2_hwmod,
&omap2430_mmc1_hwmod,
&omap2430_mmc2_hwmod,
/* gpio class */
&omap2430_gpio1_hwmod,
&omap2430_gpio2_hwmod,
&omap2430_gpio3_hwmod,
&omap2430_gpio4_hwmod,
&omap2430_gpio5_hwmod,
/* dma_system class*/
&omap2430_dma_system_hwmod,
/* mcbsp class */
&omap2430_mcbsp1_hwmod,
&omap2430_mcbsp2_hwmod,
&omap2430_mcbsp3_hwmod,
&omap2430_mcbsp4_hwmod,
&omap2430_mcbsp5_hwmod,
/* mailbox class */
&omap2430_mailbox_hwmod,
/* mcspi class */
&omap2430_mcspi1_hwmod,
&omap2430_mcspi2_hwmod,
&omap2430_mcspi3_hwmod,
/* usbotg class*/
&omap2430_usbhsotg_hwmod,
NULL, NULL,
}; };
int __init omap2430_hwmod_init(void) int __init omap2430_hwmod_init(void)
{ {
return omap_hwmod_register(omap2430_hwmods); return omap_hwmod_register_links(omap2430_hwmod_ocp_ifs);
} }
...@@ -15,10 +15,12 @@ ...@@ -15,10 +15,12 @@
#include <plat/omap_hwmod.h> #include <plat/omap_hwmod.h>
#include <plat/serial.h> #include <plat/serial.h>
#include <plat/l3_2xxx.h>
#include <plat/l4_2xxx.h>
#include "omap_hwmod_common_data.h" #include "omap_hwmod_common_data.h"
struct omap_hwmod_addr_space omap2xxx_uart1_addr_space[] = { static struct omap_hwmod_addr_space omap2xxx_uart1_addr_space[] = {
{ {
.pa_start = OMAP2_UART1_BASE, .pa_start = OMAP2_UART1_BASE,
.pa_end = OMAP2_UART1_BASE + SZ_8K - 1, .pa_end = OMAP2_UART1_BASE + SZ_8K - 1,
...@@ -27,7 +29,7 @@ struct omap_hwmod_addr_space omap2xxx_uart1_addr_space[] = { ...@@ -27,7 +29,7 @@ struct omap_hwmod_addr_space omap2xxx_uart1_addr_space[] = {
{ } { }
}; };
struct omap_hwmod_addr_space omap2xxx_uart2_addr_space[] = { static struct omap_hwmod_addr_space omap2xxx_uart2_addr_space[] = {
{ {
.pa_start = OMAP2_UART2_BASE, .pa_start = OMAP2_UART2_BASE,
.pa_end = OMAP2_UART2_BASE + SZ_1K - 1, .pa_end = OMAP2_UART2_BASE + SZ_1K - 1,
...@@ -36,7 +38,7 @@ struct omap_hwmod_addr_space omap2xxx_uart2_addr_space[] = { ...@@ -36,7 +38,7 @@ struct omap_hwmod_addr_space omap2xxx_uart2_addr_space[] = {
{ } { }
}; };
struct omap_hwmod_addr_space omap2xxx_uart3_addr_space[] = { static struct omap_hwmod_addr_space omap2xxx_uart3_addr_space[] = {
{ {
.pa_start = OMAP2_UART3_BASE, .pa_start = OMAP2_UART3_BASE,
.pa_end = OMAP2_UART3_BASE + SZ_1K - 1, .pa_end = OMAP2_UART3_BASE + SZ_1K - 1,
...@@ -45,7 +47,7 @@ struct omap_hwmod_addr_space omap2xxx_uart3_addr_space[] = { ...@@ -45,7 +47,7 @@ struct omap_hwmod_addr_space omap2xxx_uart3_addr_space[] = {
{ } { }
}; };
struct omap_hwmod_addr_space omap2xxx_timer2_addrs[] = { static struct omap_hwmod_addr_space omap2xxx_timer2_addrs[] = {
{ {
.pa_start = 0x4802a000, .pa_start = 0x4802a000,
.pa_end = 0x4802a000 + SZ_1K - 1, .pa_end = 0x4802a000 + SZ_1K - 1,
...@@ -54,7 +56,7 @@ struct omap_hwmod_addr_space omap2xxx_timer2_addrs[] = { ...@@ -54,7 +56,7 @@ struct omap_hwmod_addr_space omap2xxx_timer2_addrs[] = {
{ } { }
}; };
struct omap_hwmod_addr_space omap2xxx_timer3_addrs[] = { static struct omap_hwmod_addr_space omap2xxx_timer3_addrs[] = {
{ {
.pa_start = 0x48078000, .pa_start = 0x48078000,
.pa_end = 0x48078000 + SZ_1K - 1, .pa_end = 0x48078000 + SZ_1K - 1,
...@@ -63,7 +65,7 @@ struct omap_hwmod_addr_space omap2xxx_timer3_addrs[] = { ...@@ -63,7 +65,7 @@ struct omap_hwmod_addr_space omap2xxx_timer3_addrs[] = {
{ } { }
}; };
struct omap_hwmod_addr_space omap2xxx_timer4_addrs[] = { static struct omap_hwmod_addr_space omap2xxx_timer4_addrs[] = {
{ {
.pa_start = 0x4807a000, .pa_start = 0x4807a000,
.pa_end = 0x4807a000 + SZ_1K - 1, .pa_end = 0x4807a000 + SZ_1K - 1,
...@@ -72,7 +74,7 @@ struct omap_hwmod_addr_space omap2xxx_timer4_addrs[] = { ...@@ -72,7 +74,7 @@ struct omap_hwmod_addr_space omap2xxx_timer4_addrs[] = {
{ } { }
}; };
struct omap_hwmod_addr_space omap2xxx_timer5_addrs[] = { static struct omap_hwmod_addr_space omap2xxx_timer5_addrs[] = {
{ {
.pa_start = 0x4807c000, .pa_start = 0x4807c000,
.pa_end = 0x4807c000 + SZ_1K - 1, .pa_end = 0x4807c000 + SZ_1K - 1,
...@@ -81,7 +83,7 @@ struct omap_hwmod_addr_space omap2xxx_timer5_addrs[] = { ...@@ -81,7 +83,7 @@ struct omap_hwmod_addr_space omap2xxx_timer5_addrs[] = {
{ } { }
}; };
struct omap_hwmod_addr_space omap2xxx_timer6_addrs[] = { static struct omap_hwmod_addr_space omap2xxx_timer6_addrs[] = {
{ {
.pa_start = 0x4807e000, .pa_start = 0x4807e000,
.pa_end = 0x4807e000 + SZ_1K - 1, .pa_end = 0x4807e000 + SZ_1K - 1,
...@@ -90,7 +92,7 @@ struct omap_hwmod_addr_space omap2xxx_timer6_addrs[] = { ...@@ -90,7 +92,7 @@ struct omap_hwmod_addr_space omap2xxx_timer6_addrs[] = {
{ } { }
}; };
struct omap_hwmod_addr_space omap2xxx_timer7_addrs[] = { static struct omap_hwmod_addr_space omap2xxx_timer7_addrs[] = {
{ {
.pa_start = 0x48080000, .pa_start = 0x48080000,
.pa_end = 0x48080000 + SZ_1K - 1, .pa_end = 0x48080000 + SZ_1K - 1,
...@@ -99,7 +101,7 @@ struct omap_hwmod_addr_space omap2xxx_timer7_addrs[] = { ...@@ -99,7 +101,7 @@ struct omap_hwmod_addr_space omap2xxx_timer7_addrs[] = {
{ } { }
}; };
struct omap_hwmod_addr_space omap2xxx_timer8_addrs[] = { static struct omap_hwmod_addr_space omap2xxx_timer8_addrs[] = {
{ {
.pa_start = 0x48082000, .pa_start = 0x48082000,
.pa_end = 0x48082000 + SZ_1K - 1, .pa_end = 0x48082000 + SZ_1K - 1,
...@@ -108,7 +110,7 @@ struct omap_hwmod_addr_space omap2xxx_timer8_addrs[] = { ...@@ -108,7 +110,7 @@ struct omap_hwmod_addr_space omap2xxx_timer8_addrs[] = {
{ } { }
}; };
struct omap_hwmod_addr_space omap2xxx_timer9_addrs[] = { static struct omap_hwmod_addr_space omap2xxx_timer9_addrs[] = {
{ {
.pa_start = 0x48084000, .pa_start = 0x48084000,
.pa_end = 0x48084000 + SZ_1K - 1, .pa_end = 0x48084000 + SZ_1K - 1,
...@@ -127,4 +129,246 @@ struct omap_hwmod_addr_space omap2xxx_mcbsp2_addrs[] = { ...@@ -127,4 +129,246 @@ struct omap_hwmod_addr_space omap2xxx_mcbsp2_addrs[] = {
{ } { }
}; };
/*
* Common interconnect data
*/
/* L3 -> L4_CORE interface */
struct omap_hwmod_ocp_if omap2xxx_l3_main__l4_core = {
.master = &omap2xxx_l3_main_hwmod,
.slave = &omap2xxx_l4_core_hwmod,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* MPU -> L3 interface */
struct omap_hwmod_ocp_if omap2xxx_mpu__l3_main = {
.master = &omap2xxx_mpu_hwmod,
.slave = &omap2xxx_l3_main_hwmod,
.user = OCP_USER_MPU,
};
/* DSS -> l3 */
struct omap_hwmod_ocp_if omap2xxx_dss__l3 = {
.master = &omap2xxx_dss_core_hwmod,
.slave = &omap2xxx_l3_main_hwmod,
.fw = {
.omap2 = {
.l3_perm_bit = OMAP2_L3_CORE_FW_CONNID_DSS,
.flags = OMAP_FIREWALL_L3,
}
},
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4_CORE -> L4_WKUP interface */
struct omap_hwmod_ocp_if omap2xxx_l4_core__l4_wkup = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_l4_wkup_hwmod,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4 CORE -> UART1 interface */
struct omap_hwmod_ocp_if omap2_l4_core__uart1 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_uart1_hwmod,
.clk = "uart1_ick",
.addr = omap2xxx_uart1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4 CORE -> UART2 interface */
struct omap_hwmod_ocp_if omap2_l4_core__uart2 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_uart2_hwmod,
.clk = "uart2_ick",
.addr = omap2xxx_uart2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* L4 PER -> UART3 interface */
struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_uart3_hwmod,
.clk = "uart3_ick",
.addr = omap2xxx_uart3_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4 core -> mcspi1 interface */
struct omap_hwmod_ocp_if omap2xxx_l4_core__mcspi1 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_mcspi1_hwmod,
.clk = "mcspi1_ick",
.addr = omap2_mcspi1_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4 core -> mcspi2 interface */
struct omap_hwmod_ocp_if omap2xxx_l4_core__mcspi2 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_mcspi2_hwmod,
.clk = "mcspi2_ick",
.addr = omap2_mcspi2_addr_space,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer2 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer2 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer2_hwmod,
.clk = "gpt2_ick",
.addr = omap2xxx_timer2_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer3 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer3 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer3_hwmod,
.clk = "gpt3_ick",
.addr = omap2xxx_timer3_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer4 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer4 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer4_hwmod,
.clk = "gpt4_ick",
.addr = omap2xxx_timer4_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer5 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer5 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer5_hwmod,
.clk = "gpt5_ick",
.addr = omap2xxx_timer5_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer6 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer6 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer6_hwmod,
.clk = "gpt6_ick",
.addr = omap2xxx_timer6_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer7 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer7 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer7_hwmod,
.clk = "gpt7_ick",
.addr = omap2xxx_timer7_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer8 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer8 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer8_hwmod,
.clk = "gpt8_ick",
.addr = omap2xxx_timer8_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer9 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer9 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer9_hwmod,
.clk = "gpt9_ick",
.addr = omap2xxx_timer9_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer10 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer10 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer10_hwmod,
.clk = "gpt10_ick",
.addr = omap2_timer10_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer11 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer11 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer11_hwmod,
.clk = "gpt11_ick",
.addr = omap2_timer11_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> timer12 */
struct omap_hwmod_ocp_if omap2xxx_l4_core__timer12 = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_timer12_hwmod,
.clk = "gpt12_ick",
.addr = omap2xxx_timer12_addrs,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> dss */
struct omap_hwmod_ocp_if omap2xxx_l4_core__dss = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_dss_core_hwmod,
.clk = "dss_ick",
.addr = omap2_dss_addrs,
.fw = {
.omap2 = {
.l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
.flags = OMAP_FIREWALL_L4,
}
},
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> dss_dispc */
struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_dispc = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_dss_dispc_hwmod,
.clk = "dss_ick",
.addr = omap2_dss_dispc_addrs,
.fw = {
.omap2 = {
.l4_fw_region = OMAP2420_L4_CORE_FW_DSS_DISPC_REGION,
.flags = OMAP_FIREWALL_L4,
}
},
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> dss_rfbi */
struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_rfbi = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_dss_rfbi_hwmod,
.clk = "dss_ick",
.addr = omap2_dss_rfbi_addrs,
.fw = {
.omap2 = {
.l4_fw_region = OMAP2420_L4_CORE_FW_DSS_CORE_REGION,
.flags = OMAP_FIREWALL_L4,
}
},
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
/* l4_core -> dss_venc */
struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_venc = {
.master = &omap2xxx_l4_core_hwmod,
.slave = &omap2xxx_dss_venc_hwmod,
.clk = "dss_ick",
.addr = omap2_dss_venc_addrs,
.fw = {
.omap2 = {
.l4_fw_region = OMAP2420_L4_CORE_FW_DSS_VENC_REGION,
.flags = OMAP_FIREWALL_L4,
}
},
.flags = OCPIF_SWSUP_IDLE,
.user = OCP_USER_MPU | OCP_USER_SDMA,
};
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
*/ */
#include <plat/omap_hwmod.h> #include <plat/omap_hwmod.h>
#include <plat/serial.h> #include <plat/serial.h>
#include <plat/gpio.h>
#include <plat/dma.h> #include <plat/dma.h>
#include <plat/dmtimer.h> #include <plat/dmtimer.h>
#include <plat/mcspi.h> #include <plat/mcspi.h>
...@@ -17,6 +18,8 @@ ...@@ -17,6 +18,8 @@
#include <mach/irqs.h> #include <mach/irqs.h>
#include "omap_hwmod_common_data.h" #include "omap_hwmod_common_data.h"
#include "cm-regbits-24xx.h"
#include "prm-regbits-24xx.h"
#include "wd_timer.h" #include "wd_timer.h"
struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = { struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = {
...@@ -170,3 +173,562 @@ struct omap_hwmod_class omap2xxx_mcspi_class = { ...@@ -170,3 +173,562 @@ struct omap_hwmod_class omap2xxx_mcspi_class = {
.sysc = &omap2xxx_mcspi_sysc, .sysc = &omap2xxx_mcspi_sysc,
.rev = OMAP2_MCSPI_REV, .rev = OMAP2_MCSPI_REV,
}; };
/*
* IP blocks
*/
/* L3 */
struct omap_hwmod omap2xxx_l3_main_hwmod = {
.name = "l3_main",
.class = &l3_hwmod_class,
.flags = HWMOD_NO_IDLEST,
};
/* L4 CORE */
struct omap_hwmod omap2xxx_l4_core_hwmod = {
.name = "l4_core",
.class = &l4_hwmod_class,
.flags = HWMOD_NO_IDLEST,
};
/* L4 WKUP */
struct omap_hwmod omap2xxx_l4_wkup_hwmod = {
.name = "l4_wkup",
.class = &l4_hwmod_class,
.flags = HWMOD_NO_IDLEST,
};
/* MPU */
struct omap_hwmod omap2xxx_mpu_hwmod = {
.name = "mpu",
.class = &mpu_hwmod_class,
.main_clk = "mpu_ck",
};
/* IVA2 */
struct omap_hwmod omap2xxx_iva_hwmod = {
.name = "iva",
.class = &iva_hwmod_class,
};
/* always-on timers dev attribute */
static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
.timer_capability = OMAP_TIMER_ALWON,
};
/* pwm timers dev attribute */
static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
.timer_capability = OMAP_TIMER_HAS_PWM,
};
/* timer1 */
struct omap_hwmod omap2xxx_timer1_hwmod = {
.name = "timer1",
.mpu_irqs = omap2_timer1_mpu_irqs,
.main_clk = "gpt1_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT1_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer2 */
struct omap_hwmod omap2xxx_timer2_hwmod = {
.name = "timer2",
.mpu_irqs = omap2_timer2_mpu_irqs,
.main_clk = "gpt2_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT2_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer3 */
struct omap_hwmod omap2xxx_timer3_hwmod = {
.name = "timer3",
.mpu_irqs = omap2_timer3_mpu_irqs,
.main_clk = "gpt3_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT3_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer4 */
struct omap_hwmod omap2xxx_timer4_hwmod = {
.name = "timer4",
.mpu_irqs = omap2_timer4_mpu_irqs,
.main_clk = "gpt4_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT4_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer5 */
struct omap_hwmod omap2xxx_timer5_hwmod = {
.name = "timer5",
.mpu_irqs = omap2_timer5_mpu_irqs,
.main_clk = "gpt5_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT5_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer6 */
struct omap_hwmod omap2xxx_timer6_hwmod = {
.name = "timer6",
.mpu_irqs = omap2_timer6_mpu_irqs,
.main_clk = "gpt6_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT6_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer7 */
struct omap_hwmod omap2xxx_timer7_hwmod = {
.name = "timer7",
.mpu_irqs = omap2_timer7_mpu_irqs,
.main_clk = "gpt7_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT7_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer8 */
struct omap_hwmod omap2xxx_timer8_hwmod = {
.name = "timer8",
.mpu_irqs = omap2_timer8_mpu_irqs,
.main_clk = "gpt8_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT8_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
},
},
.dev_attr = &capability_alwon_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer9 */
struct omap_hwmod omap2xxx_timer9_hwmod = {
.name = "timer9",
.mpu_irqs = omap2_timer9_mpu_irqs,
.main_clk = "gpt9_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT9_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
},
},
.dev_attr = &capability_pwm_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer10 */
struct omap_hwmod omap2xxx_timer10_hwmod = {
.name = "timer10",
.mpu_irqs = omap2_timer10_mpu_irqs,
.main_clk = "gpt10_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT10_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
},
},
.dev_attr = &capability_pwm_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer11 */
struct omap_hwmod omap2xxx_timer11_hwmod = {
.name = "timer11",
.mpu_irqs = omap2_timer11_mpu_irqs,
.main_clk = "gpt11_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT11_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
},
},
.dev_attr = &capability_pwm_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* timer12 */
struct omap_hwmod omap2xxx_timer12_hwmod = {
.name = "timer12",
.mpu_irqs = omap2xxx_timer12_mpu_irqs,
.main_clk = "gpt12_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPT12_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
},
},
.dev_attr = &capability_pwm_dev_attr,
.class = &omap2xxx_timer_hwmod_class,
};
/* wd_timer2 */
struct omap_hwmod omap2xxx_wd_timer2_hwmod = {
.name = "wd_timer2",
.class = &omap2xxx_wd_timer_hwmod_class,
.main_clk = "mpu_wdt_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
},
},
};
/* UART1 */
struct omap_hwmod omap2xxx_uart1_hwmod = {
.name = "uart1",
.mpu_irqs = omap2_uart1_mpu_irqs,
.sdma_reqs = omap2_uart1_sdma_reqs,
.main_clk = "uart1_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_UART1_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
},
},
.class = &omap2_uart_class,
};
/* UART2 */
struct omap_hwmod omap2xxx_uart2_hwmod = {
.name = "uart2",
.mpu_irqs = omap2_uart2_mpu_irqs,
.sdma_reqs = omap2_uart2_sdma_reqs,
.main_clk = "uart2_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_UART2_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
},
},
.class = &omap2_uart_class,
};
/* UART3 */
struct omap_hwmod omap2xxx_uart3_hwmod = {
.name = "uart3",
.mpu_irqs = omap2_uart3_mpu_irqs,
.sdma_reqs = omap2_uart3_sdma_reqs,
.main_clk = "uart3_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 2,
.module_bit = OMAP24XX_EN_UART3_SHIFT,
.idlest_reg_id = 2,
.idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
},
},
.class = &omap2_uart_class,
};
/* dss */
static struct omap_hwmod_opt_clk dss_opt_clks[] = {
/*
* The DSS HW needs all DSS clocks enabled during reset. The dss_core
* driver does not use these clocks.
*/
{ .role = "tv_clk", .clk = "dss_54m_fck" },
{ .role = "sys_clk", .clk = "dss2_fck" },
};
struct omap_hwmod omap2xxx_dss_core_hwmod = {
.name = "dss_core",
.class = &omap2_dss_hwmod_class,
.main_clk = "dss1_fck", /* instead of dss_fck */
.sdma_reqs = omap2xxx_dss_sdma_chs,
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
},
},
.opt_clks = dss_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
.flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
};
struct omap_hwmod omap2xxx_dss_dispc_hwmod = {
.name = "dss_dispc",
.class = &omap2_dispc_hwmod_class,
.mpu_irqs = omap2_dispc_irqs,
.main_clk = "dss1_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
.idlest_reg_id = 1,
.idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
},
},
.flags = HWMOD_NO_IDLEST,
.dev_attr = &omap2_3_dss_dispc_dev_attr
};
static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
{ .role = "ick", .clk = "dss_ick" },
};
struct omap_hwmod omap2xxx_dss_rfbi_hwmod = {
.name = "dss_rfbi",
.class = &omap2_rfbi_hwmod_class,
.main_clk = "dss1_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
},
},
.opt_clks = dss_rfbi_opt_clks,
.opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
.flags = HWMOD_NO_IDLEST,
};
struct omap_hwmod omap2xxx_dss_venc_hwmod = {
.name = "dss_venc",
.class = &omap2_venc_hwmod_class,
.main_clk = "dss_54m_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_DSS1_SHIFT,
.module_offs = CORE_MOD,
},
},
.flags = HWMOD_NO_IDLEST,
};
/* gpio dev_attr */
struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr = {
.bank_width = 32,
.dbck_flag = false,
};
/* gpio1 */
struct omap_hwmod omap2xxx_gpio1_hwmod = {
.name = "gpio1",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio1_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &omap2xxx_gpio_dev_attr,
};
/* gpio2 */
struct omap_hwmod omap2xxx_gpio2_hwmod = {
.name = "gpio2",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio2_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &omap2xxx_gpio_dev_attr,
};
/* gpio3 */
struct omap_hwmod omap2xxx_gpio3_hwmod = {
.name = "gpio3",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio3_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &omap2xxx_gpio_dev_attr,
};
/* gpio4 */
struct omap_hwmod omap2xxx_gpio4_hwmod = {
.name = "gpio4",
.flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
.mpu_irqs = omap2_gpio4_irqs,
.main_clk = "gpios_fck",
.prcm = {
.omap2 = {
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_GPIOS_SHIFT,
.module_offs = WKUP_MOD,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
},
},
.class = &omap2xxx_gpio_hwmod_class,
.dev_attr = &omap2xxx_gpio_dev_attr,
};
/* mcspi1 */
static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
.num_chipselect = 4,
};
struct omap_hwmod omap2xxx_mcspi1_hwmod = {
.name = "mcspi1",
.mpu_irqs = omap2_mcspi1_mpu_irqs,
.sdma_reqs = omap2_mcspi1_sdma_reqs,
.main_clk = "mcspi1_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
},
},
.class = &omap2xxx_mcspi_class,
.dev_attr = &omap_mcspi1_dev_attr,
};
/* mcspi2 */
static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
.num_chipselect = 2,
};
struct omap_hwmod omap2xxx_mcspi2_hwmod = {
.name = "mcspi2",
.mpu_irqs = omap2_mcspi2_mpu_irqs,
.sdma_reqs = omap2_mcspi2_sdma_reqs,
.main_clk = "mcspi2_fck",
.prcm = {
.omap2 = {
.module_offs = CORE_MOD,
.prcm_reg_id = 1,
.module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
.idlest_reg_id = 1,
.idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
},
},
.class = &omap2xxx_mcspi_class,
.dev_attr = &omap_mcspi2_dev_attr,
};
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -19,18 +19,6 @@ ...@@ -19,18 +19,6 @@
#include "display.h" #include "display.h"
/* Common address space across OMAP2xxx */ /* Common address space across OMAP2xxx */
extern struct omap_hwmod_addr_space omap2xxx_uart1_addr_space[];
extern struct omap_hwmod_addr_space omap2xxx_uart2_addr_space[];
extern struct omap_hwmod_addr_space omap2xxx_uart3_addr_space[];
extern struct omap_hwmod_addr_space omap2xxx_timer2_addrs[];
extern struct omap_hwmod_addr_space omap2xxx_timer3_addrs[];
extern struct omap_hwmod_addr_space omap2xxx_timer4_addrs[];
extern struct omap_hwmod_addr_space omap2xxx_timer5_addrs[];
extern struct omap_hwmod_addr_space omap2xxx_timer6_addrs[];
extern struct omap_hwmod_addr_space omap2xxx_timer7_addrs[];
extern struct omap_hwmod_addr_space omap2xxx_timer8_addrs[];
extern struct omap_hwmod_addr_space omap2xxx_timer9_addrs[];
extern struct omap_hwmod_addr_space omap2xxx_timer12_addrs[];
extern struct omap_hwmod_addr_space omap2xxx_mcbsp2_addrs[]; extern struct omap_hwmod_addr_space omap2xxx_mcbsp2_addrs[];
/* Common address space across OMAP2xxx/3xxx */ /* Common address space across OMAP2xxx/3xxx */
...@@ -54,6 +42,64 @@ extern struct omap_hwmod_addr_space omap2_mcbsp1_addrs[]; ...@@ -54,6 +42,64 @@ extern struct omap_hwmod_addr_space omap2_mcbsp1_addrs[];
/* Common IP block data across OMAP2xxx */ /* Common IP block data across OMAP2xxx */
extern struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[]; extern struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[];
extern struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[]; extern struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[];
extern struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr;
extern struct omap_hwmod omap2xxx_l3_main_hwmod;
extern struct omap_hwmod omap2xxx_l4_core_hwmod;
extern struct omap_hwmod omap2xxx_l4_wkup_hwmod;
extern struct omap_hwmod omap2xxx_mpu_hwmod;
extern struct omap_hwmod omap2xxx_iva_hwmod;
extern struct omap_hwmod omap2xxx_timer1_hwmod;
extern struct omap_hwmod omap2xxx_timer2_hwmod;
extern struct omap_hwmod omap2xxx_timer3_hwmod;
extern struct omap_hwmod omap2xxx_timer4_hwmod;
extern struct omap_hwmod omap2xxx_timer5_hwmod;
extern struct omap_hwmod omap2xxx_timer6_hwmod;
extern struct omap_hwmod omap2xxx_timer7_hwmod;
extern struct omap_hwmod omap2xxx_timer8_hwmod;
extern struct omap_hwmod omap2xxx_timer9_hwmod;
extern struct omap_hwmod omap2xxx_timer10_hwmod;
extern struct omap_hwmod omap2xxx_timer11_hwmod;
extern struct omap_hwmod omap2xxx_timer12_hwmod;
extern struct omap_hwmod omap2xxx_wd_timer2_hwmod;
extern struct omap_hwmod omap2xxx_uart1_hwmod;
extern struct omap_hwmod omap2xxx_uart2_hwmod;
extern struct omap_hwmod omap2xxx_uart3_hwmod;
extern struct omap_hwmod omap2xxx_dss_core_hwmod;
extern struct omap_hwmod omap2xxx_dss_dispc_hwmod;
extern struct omap_hwmod omap2xxx_dss_rfbi_hwmod;
extern struct omap_hwmod omap2xxx_dss_venc_hwmod;
extern struct omap_hwmod omap2xxx_gpio1_hwmod;
extern struct omap_hwmod omap2xxx_gpio2_hwmod;
extern struct omap_hwmod omap2xxx_gpio3_hwmod;
extern struct omap_hwmod omap2xxx_gpio4_hwmod;
extern struct omap_hwmod omap2xxx_mcspi1_hwmod;
extern struct omap_hwmod omap2xxx_mcspi2_hwmod;
/* Common interface data across OMAP2xxx */
extern struct omap_hwmod_ocp_if omap2xxx_l3_main__l4_core;
extern struct omap_hwmod_ocp_if omap2xxx_mpu__l3_main;
extern struct omap_hwmod_ocp_if omap2xxx_dss__l3;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__l4_wkup;
extern struct omap_hwmod_ocp_if omap2_l4_core__uart1;
extern struct omap_hwmod_ocp_if omap2_l4_core__uart2;
extern struct omap_hwmod_ocp_if omap2_l4_core__uart3;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__mcspi1;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__mcspi2;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer2;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer3;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer4;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer5;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer6;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer7;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer8;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer9;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer10;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer11;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__timer12;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_dispc;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_rfbi;
extern struct omap_hwmod_ocp_if omap2xxx_l4_core__dss_venc;
/* Common IP block data */ /* Common IP block data */
extern struct omap_hwmod_dma_info omap2_uart1_sdma_reqs[]; extern struct omap_hwmod_dma_info omap2_uart1_sdma_reqs[];
...@@ -94,6 +140,7 @@ extern struct omap_hwmod_irq_info omap2_gpio4_irqs[]; ...@@ -94,6 +140,7 @@ extern struct omap_hwmod_irq_info omap2_gpio4_irqs[];
extern struct omap_hwmod_irq_info omap2_dma_system_irqs[]; extern struct omap_hwmod_irq_info omap2_dma_system_irqs[];
extern struct omap_hwmod_irq_info omap2_mcspi1_mpu_irqs[]; extern struct omap_hwmod_irq_info omap2_mcspi1_mpu_irqs[];
extern struct omap_hwmod_irq_info omap2_mcspi2_mpu_irqs[]; extern struct omap_hwmod_irq_info omap2_mcspi2_mpu_irqs[];
extern struct omap_hwmod_addr_space omap2xxx_timer12_addrs[];
/* OMAP hwmod classes - forward declarations */ /* OMAP hwmod classes - forward declarations */
extern struct omap_hwmod_class l3_hwmod_class; extern struct omap_hwmod_class l3_hwmod_class;
......
...@@ -145,8 +145,10 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, ...@@ -145,8 +145,10 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
{ {
char name[10]; /* 10 = sizeof("gptXX_Xck0") */ char name[10]; /* 10 = sizeof("gptXX_Xck0") */
struct omap_hwmod *oh; struct omap_hwmod *oh;
struct resource irq_rsrc, mem_rsrc;
size_t size; size_t size;
int res = 0; int res = 0;
int r;
sprintf(name, "timer%d", gptimer_id); sprintf(name, "timer%d", gptimer_id);
omap_hwmod_setup_one(name); omap_hwmod_setup_one(name);
...@@ -154,9 +156,16 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, ...@@ -154,9 +156,16 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
if (!oh) if (!oh)
return -ENODEV; return -ENODEV;
timer->irq = oh->mpu_irqs[0].irq; r = omap_hwmod_get_resource_byname(oh, IORESOURCE_IRQ, NULL, &irq_rsrc);
timer->phys_base = oh->slaves[0]->addr->pa_start; if (r)
size = oh->slaves[0]->addr->pa_end - timer->phys_base; return -ENXIO;
timer->irq = irq_rsrc.start;
r = omap_hwmod_get_resource_byname(oh, IORESOURCE_MEM, NULL, &mem_rsrc);
if (r)
return -ENXIO;
timer->phys_base = mem_rsrc.start;
size = mem_rsrc.end - mem_rsrc.start;
/* Static mapping, never released */ /* Static mapping, never released */
timer->io_base = ioremap(timer->phys_base, size); timer->io_base = ioremap(timer->phys_base, size);
......
...@@ -213,11 +213,17 @@ struct omap_hwmod_addr_space { ...@@ -213,11 +213,17 @@ struct omap_hwmod_addr_space {
*/ */
#define OCP_USER_MPU (1 << 0) #define OCP_USER_MPU (1 << 0)
#define OCP_USER_SDMA (1 << 1) #define OCP_USER_SDMA (1 << 1)
#define OCP_USER_DSP (1 << 2)
#define OCP_USER_IVA (1 << 3)
/* omap_hwmod_ocp_if.flags bits */ /* omap_hwmod_ocp_if.flags bits */
#define OCPIF_SWSUP_IDLE (1 << 0) #define OCPIF_SWSUP_IDLE (1 << 0)
#define OCPIF_CAN_BURST (1 << 1) #define OCPIF_CAN_BURST (1 << 1)
/* omap_hwmod_ocp_if._int_flags possibilities */
#define _OCPIF_INT_FLAGS_REGISTERED (1 << 0)
/** /**
* struct omap_hwmod_ocp_if - OCP interface data * struct omap_hwmod_ocp_if - OCP interface data
* @master: struct omap_hwmod that initiates OCP transactions on this link * @master: struct omap_hwmod that initiates OCP transactions on this link
...@@ -229,6 +235,7 @@ struct omap_hwmod_addr_space { ...@@ -229,6 +235,7 @@ struct omap_hwmod_addr_space {
* @width: OCP data width * @width: OCP data width
* @user: initiators using this interface (see OCP_USER_* macros above) * @user: initiators using this interface (see OCP_USER_* macros above)
* @flags: OCP interface flags (see OCPIF_* macros above) * @flags: OCP interface flags (see OCPIF_* macros above)
* @_int_flags: internal flags (see _OCPIF_INT_FLAGS* macros above)
* *
* It may also be useful to add a tag_cnt field for OCP2.x devices. * It may also be useful to add a tag_cnt field for OCP2.x devices.
* *
...@@ -247,6 +254,7 @@ struct omap_hwmod_ocp_if { ...@@ -247,6 +254,7 @@ struct omap_hwmod_ocp_if {
u8 width; u8 width;
u8 user; u8 user;
u8 flags; u8 flags;
u8 _int_flags;
}; };
...@@ -327,9 +335,9 @@ struct omap_hwmod_sysc_fields { ...@@ -327,9 +335,9 @@ struct omap_hwmod_sysc_fields {
* then this field has to be populated with the correct offset structure. * then this field has to be populated with the correct offset structure.
*/ */
struct omap_hwmod_class_sysconfig { struct omap_hwmod_class_sysconfig {
u16 rev_offs; u32 rev_offs;
u16 sysc_offs; u32 sysc_offs;
u16 syss_offs; u32 syss_offs;
u16 sysc_flags; u16 sysc_flags;
struct omap_hwmod_sysc_fields *sysc_fields; struct omap_hwmod_sysc_fields *sysc_fields;
u8 srst_udelay; u8 srst_udelay;
...@@ -475,6 +483,16 @@ struct omap_hwmod_class { ...@@ -475,6 +483,16 @@ struct omap_hwmod_class {
int (*reset)(struct omap_hwmod *oh); int (*reset)(struct omap_hwmod *oh);
}; };
/**
* struct omap_hwmod_link - internal structure linking hwmods with ocp_ifs
* @ocp_if: OCP interface structure record pointer
* @node: list_head pointing to next struct omap_hwmod_link in a list
*/
struct omap_hwmod_link {
struct omap_hwmod_ocp_if *ocp_if;
struct list_head node;
};
/** /**
* struct omap_hwmod - integration data for OMAP hardware "modules" (IP blocks) * struct omap_hwmod - integration data for OMAP hardware "modules" (IP blocks)
* @name: name of the hwmod * @name: name of the hwmod
...@@ -487,12 +505,10 @@ struct omap_hwmod_class { ...@@ -487,12 +505,10 @@ struct omap_hwmod_class {
* @_clk: pointer to the main struct clk (filled in at runtime) * @_clk: pointer to the main struct clk (filled in at runtime)
* @opt_clks: other device clocks that drivers can request (0..*) * @opt_clks: other device clocks that drivers can request (0..*)
* @voltdm: pointer to voltage domain (filled in at runtime) * @voltdm: pointer to voltage domain (filled in at runtime)
* @masters: ptr to array of OCP ifs that this hwmod can initiate on
* @slaves: ptr to array of OCP ifs that this hwmod can respond on
* @dev_attr: arbitrary device attributes that can be passed to the driver * @dev_attr: arbitrary device attributes that can be passed to the driver
* @_sysc_cache: internal-use hwmod flags * @_sysc_cache: internal-use hwmod flags
* @_mpu_rt_va: cached register target start address (internal use) * @_mpu_rt_va: cached register target start address (internal use)
* @_mpu_port_index: cached MPU register target slave ID (internal use) * @_mpu_port: cached MPU register target slave (internal use)
* @opt_clks_cnt: number of @opt_clks * @opt_clks_cnt: number of @opt_clks
* @master_cnt: number of @master entries * @master_cnt: number of @master entries
* @slaves_cnt: number of @slave entries * @slaves_cnt: number of @slave entries
...@@ -511,6 +527,8 @@ struct omap_hwmod_class { ...@@ -511,6 +527,8 @@ struct omap_hwmod_class {
* *
* Parameter names beginning with an underscore are managed internally by * Parameter names beginning with an underscore are managed internally by
* the omap_hwmod code and should not be set during initialization. * the omap_hwmod code and should not be set during initialization.
*
* @masters and @slaves are now deprecated.
*/ */
struct omap_hwmod { struct omap_hwmod {
const char *name; const char *name;
...@@ -529,15 +547,15 @@ struct omap_hwmod { ...@@ -529,15 +547,15 @@ struct omap_hwmod {
struct omap_hwmod_opt_clk *opt_clks; struct omap_hwmod_opt_clk *opt_clks;
char *clkdm_name; char *clkdm_name;
struct clockdomain *clkdm; struct clockdomain *clkdm;
struct omap_hwmod_ocp_if **masters; /* connect to *_IA */ struct list_head master_ports; /* connect to *_IA */
struct omap_hwmod_ocp_if **slaves; /* connect to *_TA */ struct list_head slave_ports; /* connect to *_TA */
void *dev_attr; void *dev_attr;
u32 _sysc_cache; u32 _sysc_cache;
void __iomem *_mpu_rt_va; void __iomem *_mpu_rt_va;
spinlock_t _lock; spinlock_t _lock;
struct list_head node; struct list_head node;
struct omap_hwmod_ocp_if *_mpu_port;
u16 flags; u16 flags;
u8 _mpu_port_index;
u8 response_lat; u8 response_lat;
u8 rst_lines_cnt; u8 rst_lines_cnt;
u8 opt_clks_cnt; u8 opt_clks_cnt;
...@@ -549,7 +567,6 @@ struct omap_hwmod { ...@@ -549,7 +567,6 @@ struct omap_hwmod {
u8 _postsetup_state; u8 _postsetup_state;
}; };
int omap_hwmod_register(struct omap_hwmod **ohs);
struct omap_hwmod *omap_hwmod_lookup(const char *name); struct omap_hwmod *omap_hwmod_lookup(const char *name);
int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data), int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),
void *data); void *data);
...@@ -581,6 +598,8 @@ int omap_hwmod_softreset(struct omap_hwmod *oh); ...@@ -581,6 +598,8 @@ int omap_hwmod_softreset(struct omap_hwmod *oh);
int omap_hwmod_count_resources(struct omap_hwmod *oh); int omap_hwmod_count_resources(struct omap_hwmod *oh);
int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res); int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res);
int omap_hwmod_get_resource_byname(struct omap_hwmod *oh, unsigned int type,
const char *name, struct resource *res);
struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh); struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh);
void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh); void __iomem *omap_hwmod_get_mpu_rt_va(struct omap_hwmod *oh);
...@@ -619,4 +638,6 @@ extern int omap2430_hwmod_init(void); ...@@ -619,4 +638,6 @@ extern int omap2430_hwmod_init(void);
extern int omap3xxx_hwmod_init(void); extern int omap3xxx_hwmod_init(void);
extern int omap44xx_hwmod_init(void); extern int omap44xx_hwmod_init(void);
extern int __init omap_hwmod_register_links(struct omap_hwmod_ocp_if **ois);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment