From: Peng Fan <b51431@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 01/14] mxs: add parameter base_addr for mxs_set_lcdclk
Date: Mon, 26 Oct 2015 10:57:23 +0800 [thread overview]
Message-ID: <20151026025719.GA13617@shlinux2> (raw)
In-Reply-To: <56263C01.4080504@denx.de>
Hi Stefano,
Sorry for this late reply.
On Tue, Oct 20, 2015 at 03:05:05PM +0200, Stefano Babic wrote:
>Hi Peng,
>
>
>On 20/10/2015 13:39, Peng Fan wrote:
>> Change mxs_set_lcdclk prototype to add a new parameter
>> base_addr. There are two LCD interfaces for i.MX6SX,
>> we may support LCDIF1 or LCDIF2.
>>
>
>ok - from your commit message I am waiting that both LCDIF1 and LCDIF2
>can be supported, and a user (board maintainer) can switch between them.
>And in later patch mxs_set_lcdclk() is avalilable for mx6sx and mx6ul,
>that makes this inconsistent.
I can not get you about 'inconsistent'.
The reason to add LCDIF1 and LCDIF2
support is that the board design may use LCDIF1 or LCDIF2. The mxs_set_lcdlck
should support setting clock for LCDIF1 and LCDIF2.
There two LCDIFs for i.MX6SX and i.MX7D.
>
>But I do not understand how the support for the second LCDIF is
>implemented. I should see that the register set points to LCDIF1 or LCDIF2.
>
>More as extending to both LCDIF1 and LCDIF2, it looks to me that this is
>consistent with mxs_set_lcdclk() in mx7.
The current mxs_set_lcdclk for mx7 is same with freescale vendor uboot, but
its prototype is not consistent with the current upstream uboot.
Since its prototype is same with my idea in this patchset, I do not need to
change it.
>
>
>> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
>> Cc: Stefano Babic <sbabic@denx.de>
>> Cc: Anatolij Gustschin <agust@denx.de>
>> ---
>>
>> V2:
>> none
>>
>> arch/arm/cpu/arm926ejs/mxs/clock.c | 2 +-
>> arch/arm/include/asm/arch-mxs/clock.h | 2 +-
>> drivers/video/mxsfb.c | 2 +-
>> 3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm/cpu/arm926ejs/mxs/clock.c b/arch/arm/cpu/arm926ejs/mxs/clock.c
>> index e9d8800..dac8dc6 100644
>> --- a/arch/arm/cpu/arm926ejs/mxs/clock.c
>> +++ b/arch/arm/cpu/arm926ejs/mxs/clock.c
>> @@ -309,7 +309,7 @@ void mxs_set_ssp_busclock(unsigned int bus, uint32_t freq)
>> bus, tgtclk, freq);
>> }
>>
>> -void mxs_set_lcdclk(uint32_t freq)
>> +void mxs_set_lcdclk(uint32_t base_addr, uint32_t freq)
>> {
>> struct mxs_clkctrl_regs *clkctrl_regs =
>> (struct mxs_clkctrl_regs *)MXS_CLKCTRL_BASE;
>> diff --git a/arch/arm/include/asm/arch-mxs/clock.h b/arch/arm/include/asm/arch-mxs/clock.h
>
>This patch should generate warnings, because base_addr is not used. You
>should at least add an __maybe_unused attribute.
Ok. will add this attribute.
>
>Anyway, I am asking myself if it makes sense to pass an address. Really,
>you want to pass an index if you want to support LCDIF1 or LCDIF2. This
>makes more sense as passing an address. In you code later (patch 7/14),
>you check the address like an index:
>
>
> if (base_addr == LCDIF1_BASE_ADDR) {
>
>This makes inconsistent. If you need it as address, this means you will
>use it as address later, casting to a register structure. If you use as
>I understand as index, that please use an enumeration for it.
I'll switch to use index.
mxs_set_clk(u32 index, u32 freq), and in mxs_set_clk, choose coresponding
base address according to index.
Regards,
Peng.
>
>> index fc9d75b..8840335 100644
>> --- a/arch/arm/include/asm/arch-mxs/clock.h
>> +++ b/arch/arm/include/asm/arch-mxs/clock.h
>> @@ -46,7 +46,7 @@ uint32_t mxc_get_clock(enum mxc_clock clk);
>> void mxs_set_ioclk(enum mxs_ioclock io, uint32_t freq);
>> void mxs_set_sspclk(enum mxs_sspclock ssp, uint32_t freq, int xtal);
>> void mxs_set_ssp_busclock(unsigned int bus, uint32_t freq);
>> -void mxs_set_lcdclk(uint32_t freq);
>> +void mxs_set_lcdclk(uint32_t base_addr, uint32_t freq);
>>
>> /* Compatibility with the FEC Ethernet driver */
>> #define imx_get_fecclk() mxc_get_clock(MXC_AHB_CLK)
>> diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
>> index 03b0f88..eed57d5 100644
>> --- a/drivers/video/mxsfb.c
>> +++ b/drivers/video/mxsfb.c
>> @@ -55,7 +55,7 @@ static void mxs_lcd_init(GraphicDevice *panel,
>> uint8_t valid_data = 0;
>>
>> /* Kick in the LCDIF clock */
>> - mxs_set_lcdclk(PS2KHZ(mode->pixclock));
>> + mxs_set_lcdclk(MXS_LCDIF_BASE, PS2KHZ(mode->pixclock));
>>
>> /* Restart the LCDIF block */
>> mxs_reset_block(®s->hw_lcdif_ctrl_reg);
>>
>
>Best regards,
>Stefano Babic
>
>--
>=====================================================================
>DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
>HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
>Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
>=====================================================================
--
next prev parent reply other threads:[~2015-10-26 2:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 11:39 [U-Boot] [PATCH V2 00/14] imx: mx6/7: support lcdif Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 01/14] mxs: add parameter base_addr for mxs_set_lcdclk Peng Fan
2015-10-20 13:05 ` Stefano Babic
2015-10-26 2:57 ` Peng Fan [this message]
2015-10-26 15:52 ` Stefano Babic
2015-10-27 5:28 ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 02/14] sandisk: sfp: correct function name Peng Fan
2015-10-20 13:09 ` Stefano Babic
2015-10-20 11:39 ` [U-Boot] [PATCH V2 03/14] xfi3: " Peng Fan
2015-10-20 13:10 ` Stefano Babic
2015-10-26 3:00 ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 04/14] imx: imx-common: move lcdif structure and macro definition to imx-common Peng Fan
2015-10-20 13:15 ` Stefano Babic
2015-10-26 3:06 ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 05/14] imx: mx6: fix register address Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 06/14] imx: mx6: crm_reg: add LCDIF related macros Peng Fan
2015-10-20 13:19 ` Stefano Babic
2015-10-20 11:39 ` [U-Boot] [PATCH V2 07/14] imx: mx6: add clock api for lcdif Peng Fan
2015-10-20 13:39 ` Stefano Babic
2015-10-26 3:13 ` Peng Fan
2015-10-27 7:36 ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 08/14] imx: mx6ul_14x14_evk: support lcdif display Peng Fan
2015-10-20 13:41 ` Stefano Babic
2015-10-26 3:18 ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 09/14] video: mxsfb: introduce lcdif_power_down Peng Fan
2015-10-20 13:59 ` Stefano Babic
2015-10-26 3:24 ` Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 10/14] imx: mx6: implement reset_misc Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 11/14] imx: imx-common: power down lcdif before boot os Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 12/14] imx: mx7: compile misc.c for mx7 Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 13/14] imx: mx7 use the common lcdif register structure Peng Fan
2015-10-20 11:39 ` [U-Boot] [PATCH V2 14/14] imx: mx7dsabresd: support lcdif Peng Fan
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=20151026025719.GA13617@shlinux2 \
--to=b51431@freescale.com \
--cc=u-boot@lists.denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox