From: "Cousson, Benoit" <b-cousson@ti.com>
To: "ABRAHAM, KISHON VIJAY" <kishon@ti.com>, Paul Walmsley <paul@pwsan.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
"Kamat, Nishant" <nskamat@ti.com>,
"Varadarajan, Charulatha" <charu@ti.com>,
"Datta, Shubhrajyoti" <shubhrajyoti@ti.com>,
"Basak, Partha" <p-basak2@ti.com>
Subject: Re: [PATCH 3/7] [RFC] OMAP: MCBSP: hwmod database for 4xxx devices
Date: Wed, 6 Oct 2010 11:20:59 +0200 [thread overview]
Message-ID: <4CAC3F7B.30700@ti.com> (raw)
In-Reply-To: <1286296662-7639-3-git-send-email-kishon@ti.com>
Hi Kishon,
On 10/5/2010 6:37 PM, ABRAHAM, KISHON VIJAY wrote:
> From: Benoit Cousson<b-cousson@ti.com>
>
> MCBSP hwmod data values are auto-generated. The order of omap44xx_mcbsp3_slaves
> contents are changed since the driver uses the base address of
> omap44xx_l4_abe__mcbsp3_dma.
You should not do that... in theory.
In your case I do understand why, but we should find a better way to
handle that. Ideally you should not rely on the order to get the proper
resource. For some reason the memory areas are not named today, but this
can be fixed if needed.
The other concern or question is don't we have to use direct access
whenever possible? The second mapping is only needed for the SDMA
access, not for the registers accesses.
So in your case, you will have to use two base address, for previous
OMAPs, both will be the same, but in the case of OMAP4, you will use the
direct one for all the register settings and the DMA one for DMA access.
Benoit
>
> Signed-off-by: Kishon Vijay Abraham I<kishon@ti.com>
> Signed-off-by: Charulatha V<charu@ti.com>
> Signed-off-by: Shubhrajyoti D<shubhrajyoti@ti.com>
> Cc: Partha Basak<p-basak2@ti.com>
> ---
> arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 293 ++++++++++++++++++++++++++++
> 1 files changed, 293 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> index 7274db4..1467840 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
> @@ -811,6 +811,294 @@ static struct omap_hwmod omap44xx_uart4_hwmod = {
> .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
> };
>
> +/*
> + * 'mcbsp' class
> + * multi channel buffered serial port controller
> + */
> +
> +static struct omap_hwmod_class_sysconfig omap44xx_mcbsp_sysc = {
> + .sysc_offs = 0x008c,
> + .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_ENAWAKEUP |
> + SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
> + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
> + .sysc_fields =&omap_hwmod_sysc_type1,
> +};
> +
> +static struct omap_hwmod_class omap44xx_mcbsp_hwmod_class = {
> + .name = "mcbsp",
> + .sysc =&omap44xx_mcbsp_sysc,
> +};
> +
> +/* mcbsp1 */
> +static struct omap_hwmod omap44xx_mcbsp1_hwmod;
> +static struct omap_hwmod_irq_info omap44xx_mcbsp1_irqs[] = {
> + { .name = "tx", .irq = 17 + OMAP44XX_IRQ_GIC_START },
> + { .name = "rx", .irq = 0 },
> +};
> +
> +static struct omap_hwmod_dma_info omap44xx_mcbsp1_sdma_reqs[] = {
> + { .name = "tx", .dma_req = 32 + OMAP44XX_DMA_REQ_START },
> + { .name = "rx", .dma_req = 33 + OMAP44XX_DMA_REQ_START },
> +};
> +
> +static struct omap_hwmod_addr_space omap44xx_mcbsp1_addrs[] = {
> + {
> + .pa_start = 0x40122000,
> + .pa_end = 0x401220ff,
> + .flags = ADDR_TYPE_RT
> + },
> +};
> +
> +/* l4_abe -> mcbsp1 */
> +static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1 = {
> + .master =&omap44xx_l4_abe_hwmod,
> + .slave =&omap44xx_mcbsp1_hwmod,
> + .clk = "ocp_abe_iclk",
> + .addr = omap44xx_mcbsp1_addrs,
> + .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp1_addrs),
> + .user = OCP_USER_MPU,
> +};
> +
> +static struct omap_hwmod_addr_space omap44xx_mcbsp1_dma_addrs[] = {
> + {
> + .pa_start = 0x49022000,
> + .pa_end = 0x490220ff,
> + .flags = ADDR_TYPE_RT
> + },
> +};
> +
> +/* l4_abe -> mcbsp1 (dma) */
> +static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1_dma = {
> + .master =&omap44xx_l4_abe_hwmod,
> + .slave =&omap44xx_mcbsp1_hwmod,
> + .clk = "ocp_abe_iclk",
> + .addr = omap44xx_mcbsp1_dma_addrs,
> + .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp1_dma_addrs),
> + .user = OCP_USER_SDMA,
> +};
> +
> +/* mcbsp1 slave ports */
> +static struct omap_hwmod_ocp_if *omap44xx_mcbsp1_slaves[] = {
> + &omap44xx_l4_abe__mcbsp1_dma,
> + &omap44xx_l4_abe__mcbsp1,
> +};
> +
> +static struct omap_hwmod omap44xx_mcbsp1_hwmod = {
> + .name = "mcbsp1",
> + .class =&omap44xx_mcbsp_hwmod_class,
> + .mpu_irqs = omap44xx_mcbsp1_irqs,
> + .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp1_irqs),
> + .sdma_reqs = omap44xx_mcbsp1_sdma_reqs,
> + .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp1_sdma_reqs),
> + .main_clk = "mcbsp1_fck",
> + .prcm = {
> + .omap4 = {
> + .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP1_CLKCTRL,
> + },
> + },
> + .slaves = omap44xx_mcbsp1_slaves,
> + .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves),
> + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
> +};
> +
> +/* mcbsp2 */
> +static struct omap_hwmod omap44xx_mcbsp2_hwmod;
> +static struct omap_hwmod_irq_info omap44xx_mcbsp2_irqs[] = {
> + { .name = "tx", .irq = 22 + OMAP44XX_IRQ_GIC_START },
> + { .name = "rx", .irq = 0 },
> +};
> +
> +static struct omap_hwmod_dma_info omap44xx_mcbsp2_sdma_reqs[] = {
> + { .name = "tx", .dma_req = 16 + OMAP44XX_DMA_REQ_START },
> + { .name = "rx", .dma_req = 17 + OMAP44XX_DMA_REQ_START },
> +};
> +
> +static struct omap_hwmod_addr_space omap44xx_mcbsp2_addrs[] = {
> + {
> + .pa_start = 0x40124000,
> + .pa_end = 0x401240ff,
> + .flags = ADDR_TYPE_RT
> + },
> +};
> +
> +/* l4_abe -> mcbsp2 */
> +static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2 = {
> + .master =&omap44xx_l4_abe_hwmod,
> + .slave =&omap44xx_mcbsp2_hwmod,
> + .clk = "ocp_abe_iclk",
> + .addr = omap44xx_mcbsp2_addrs,
> + .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp2_addrs),
> + .user = OCP_USER_MPU,
> +};
> +
> +static struct omap_hwmod_addr_space omap44xx_mcbsp2_dma_addrs[] = {
> + {
> + .pa_start = 0x49024000,
> + .pa_end = 0x490240ff,
> + .flags = ADDR_TYPE_RT
> + },
> +};
> +
> +/* l4_abe -> mcbsp2 (dma) */
> +static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2_dma = {
> + .master =&omap44xx_l4_abe_hwmod,
> + .slave =&omap44xx_mcbsp2_hwmod,
> + .clk = "ocp_abe_iclk",
> + .addr = omap44xx_mcbsp2_dma_addrs,
> + .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp2_dma_addrs),
> + .user = OCP_USER_SDMA,
> +};
> +
> +/* mcbsp2 slave ports */
> +static struct omap_hwmod_ocp_if *omap44xx_mcbsp2_slaves[] = {
> + &omap44xx_l4_abe__mcbsp2_dma,
> + &omap44xx_l4_abe__mcbsp2,
> +};
> +
> +static struct omap_hwmod omap44xx_mcbsp2_hwmod = {
> + .name = "mcbsp2",
> + .class =&omap44xx_mcbsp_hwmod_class,
> + .mpu_irqs = omap44xx_mcbsp2_irqs,
> + .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp2_irqs),
> + .sdma_reqs = omap44xx_mcbsp2_sdma_reqs,
> + .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp2_sdma_reqs),
> + .main_clk = "mcbsp2_fck",
> + .prcm = {
> + .omap4 = {
> + .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP2_CLKCTRL,
> + },
> + },
> + .slaves = omap44xx_mcbsp2_slaves,
> + .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves),
> + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
> +};
> +
> +/* mcbsp3 */
> +static struct omap_hwmod omap44xx_mcbsp3_hwmod;
> +static struct omap_hwmod_irq_info omap44xx_mcbsp3_irqs[] = {
> + { .name = "tx", .irq = 23 + OMAP44XX_IRQ_GIC_START },
> + { .name = "rx", .irq = 0 },
> +};
> +
> +static struct omap_hwmod_dma_info omap44xx_mcbsp3_sdma_reqs[] = {
> + { .name = "tx", .dma_req = 18 + OMAP44XX_DMA_REQ_START },
> + { .name = "rx", .dma_req = 19 + OMAP44XX_DMA_REQ_START },
> +};
> +
> +static struct omap_hwmod_addr_space omap44xx_mcbsp3_addrs[] = {
> + {
> + .pa_start = 0x40126000,
> + .pa_end = 0x401260ff,
> + .flags = ADDR_TYPE_RT
> + },
> +};
> +
> +/* l4_abe -> mcbsp3 */
> +static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3 = {
> + .master =&omap44xx_l4_abe_hwmod,
> + .slave =&omap44xx_mcbsp3_hwmod,
> + .clk = "ocp_abe_iclk",
> + .addr = omap44xx_mcbsp3_addrs,
> + .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp3_addrs),
> + .user = OCP_USER_MPU,
> +};
> +
> +static struct omap_hwmod_addr_space omap44xx_mcbsp3_dma_addrs[] = {
> + {
> + .pa_start = 0x49026000,
> + .pa_end = 0x490260ff,
> + .flags = ADDR_TYPE_RT
> + },
> +};
> +
> +/* l4_abe -> mcbsp3 (dma) */
> +static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3_dma = {
> + .master =&omap44xx_l4_abe_hwmod,
> + .slave =&omap44xx_mcbsp3_hwmod,
> + .clk = "ocp_abe_iclk",
> + .addr = omap44xx_mcbsp3_dma_addrs,
> + .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp3_dma_addrs),
> + .user = OCP_USER_SDMA,
> +};
> +
> +/* mcbsp3 slave ports */
> +static struct omap_hwmod_ocp_if *omap44xx_mcbsp3_slaves[] = {
> + &omap44xx_l4_abe__mcbsp3_dma,
> + &omap44xx_l4_abe__mcbsp3,
> +};
> +
> +static struct omap_hwmod omap44xx_mcbsp3_hwmod = {
> + .name = "mcbsp3",
> + .class =&omap44xx_mcbsp_hwmod_class,
> + .mpu_irqs = omap44xx_mcbsp3_irqs,
> + .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp3_irqs),
> + .sdma_reqs = omap44xx_mcbsp3_sdma_reqs,
> + .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp3_sdma_reqs),
> + .main_clk = "mcbsp3_fck",
> + .prcm = {
> + .omap4 = {
> + .clkctrl_reg = OMAP4430_CM1_ABE_MCBSP3_CLKCTRL,
> + },
> + },
> + .slaves = omap44xx_mcbsp3_slaves,
> + .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves),
> + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
> +};
> +
> +/* mcbsp4 */
> +static struct omap_hwmod omap44xx_mcbsp4_hwmod;
> +static struct omap_hwmod_irq_info omap44xx_mcbsp4_irqs[] = {
> + { .name = "tx", .irq = 16 + OMAP44XX_IRQ_GIC_START },
> + { .name = "rx", .irq = 0 },
> +};
> +
> +static struct omap_hwmod_dma_info omap44xx_mcbsp4_sdma_reqs[] = {
> + { .name = "tx", .dma_req = 30 + OMAP44XX_DMA_REQ_START },
> + { .name = "rx", .dma_req = 31 + OMAP44XX_DMA_REQ_START },
> +};
> +
> +static struct omap_hwmod_addr_space omap44xx_mcbsp4_addrs[] = {
> + {
> + .pa_start = 0x48096000,
> + .pa_end = 0x480960ff,
> + .flags = ADDR_TYPE_RT
> + },
> +};
> +
> +/* l4_per -> mcbsp4 */
> +static struct omap_hwmod_ocp_if omap44xx_l4_per__mcbsp4 = {
> + .master =&omap44xx_l4_per_hwmod,
> + .slave =&omap44xx_mcbsp4_hwmod,
> + .clk = "l4_div_ck",
> + .addr = omap44xx_mcbsp4_addrs,
> + .addr_cnt = ARRAY_SIZE(omap44xx_mcbsp4_addrs),
> + .user = OCP_USER_MPU | OCP_USER_SDMA,
> +};
> +
> +/* mcbsp4 slave ports */
> +static struct omap_hwmod_ocp_if *omap44xx_mcbsp4_slaves[] = {
> + &omap44xx_l4_per__mcbsp4,
> +};
> +
> +static struct omap_hwmod omap44xx_mcbsp4_hwmod = {
> + .name = "mcbsp4",
> + .class =&omap44xx_mcbsp_hwmod_class,
> + .mpu_irqs = omap44xx_mcbsp4_irqs,
> + .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_mcbsp4_irqs),
> + .sdma_reqs = omap44xx_mcbsp4_sdma_reqs,
> + .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_mcbsp4_sdma_reqs),
> + .main_clk = "mcbsp4_fck",
> + .prcm = {
> + .omap4 = {
> + .clkctrl_reg = OMAP4430_CM_L4PER_MCBSP4_CLKCTRL,
> + },
> + },
> + .slaves = omap44xx_mcbsp4_slaves,
> + .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves),
> + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
> +};
> +
> +
> static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
> /* dmm class */
> &omap44xx_dmm_hwmod,
> @@ -840,6 +1128,11 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
> &omap44xx_uart2_hwmod,
> &omap44xx_uart3_hwmod,
> &omap44xx_uart4_hwmod,
> + /* mcbsp class */
> + &omap44xx_mcbsp1_hwmod,
> + &omap44xx_mcbsp2_hwmod,
> + &omap44xx_mcbsp3_hwmod,
> + &omap44xx_mcbsp4_hwmod,
> NULL,
> };
>
next prev parent reply other threads:[~2010-10-06 9:21 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-05 16:37 [PATCH 1/7] [RFC] OMAP: MCBSP: hwmod database for 2xxx devices Kishon Vijay Abraham I
2010-10-05 16:37 ` [PATCH 2/7] [RFC] OMAP: MCBSP: hwmod database for 3xxx devices Kishon Vijay Abraham I
2010-10-05 16:37 ` [PATCH 3/7] [RFC] OMAP: MCBSP: hwmod database for 4xxx devices Kishon Vijay Abraham I
2010-10-06 9:20 ` Cousson, Benoit [this message]
2010-10-06 9:51 ` kishon
2010-10-05 16:37 ` [PATCH 4/7] [RFC] OMAP: hwmod implementation for MCBSP Kishon Vijay Abraham I
2010-10-06 6:01 ` Peter Ujfalusi
2010-10-06 6:12 ` Varadarajan, Charulatha
2010-10-06 6:58 ` Peter Ujfalusi
2010-10-06 7:06 ` Varadarajan, Charulatha
2010-10-06 9:34 ` Cousson, Benoit
2010-10-06 10:39 ` kishon
2010-10-07 16:53 ` kishon
2010-10-05 16:37 ` [PATCH 5/7] [RFC] OMAP: hwmod: New API to modify the autoidle bit of sysconfig register Kishon Vijay Abraham I
2010-10-05 16:37 ` [PATCH 6/7] [RFC] OMAP: hwmod: SYSCONFIG register modification for MCBSP Kishon Vijay Abraham I
2010-10-08 7:42 ` Cousson, Benoit
2010-10-11 6:18 ` kishon
[not found] ` <AANLkTi=a80MLvj5YuC==evfGqY6xUToHcBU3TyWEBHAo@mail.gmail.com>
2010-11-22 15:59 ` ABRAHAM, KISHON VIJAY
2010-11-30 16:03 ` Cousson, Benoit
2010-12-01 7:14 ` Basak, Partha
2010-12-01 11:15 ` Cousson, Benoit
2010-12-01 12:05 ` Govindraj
2010-12-02 10:54 ` Kevin Hilman
2010-12-07 13:15 ` Basak, Partha
2010-10-05 16:37 ` [PATCH 7/7] [RFC] OMAP: pm_runtime support " Kishon Vijay Abraham I
2010-10-06 7:01 ` [PATCH 1/7] [RFC] OMAP: MCBSP: hwmod database for 2xxx devices Varadarajan, Charulatha
2010-10-06 7:17 ` Peter Ujfalusi
2010-10-08 6:20 ` Varadarajan, Charulatha
2010-10-08 7:22 ` Cousson, Benoit
2010-10-12 9:33 ` kishon
2010-10-13 8:31 ` Peter Ujfalusi
2010-10-14 14:51 ` Varadarajan, Charulatha
2010-10-15 6:51 ` Jarkko Nikula
2010-10-15 14:24 ` Mark Brown
2010-10-15 7:13 ` Peter Ujfalusi
2010-10-06 10:32 ` kishon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CAC3F7B.30700@ti.com \
--to=b-cousson@ti.com \
--cc=charu@ti.com \
--cc=kishon@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=nskamat@ti.com \
--cc=p-basak2@ti.com \
--cc=paul@pwsan.com \
--cc=shubhrajyoti@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.