From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] i.mx: Add the initial support for freescale i.MX6Q processor
Date: Mon, 14 Nov 2011 12:49:10 +0100 [thread overview]
Message-ID: <4EC10036.7080304@denx.de> (raw)
In-Reply-To: <CAFQ4atS3EmEbMJVZ+imBJnXBKmZ3YT0jakUQ51PH3L7iWJkG_Q@mail.gmail.com>
On 11/14/2011 10:42 AM, Jason Hui wrote:
>>
>> All get_usdhcX function are identical, except for two masks
>> (MXC_CCM_CSCDR1_USDHCx_PODF_MASK and MXC_CCM_CSCMR1_USDHCx_CLK_SEL).
>> Merge them in a get_usdhc_clk(usdhc_number)
>
> Yes, I also notice this when writing the code. At that time, I just
> think to make clear about the code.
> Now, I think your comments is also reasonable. I will change it later.
ok
>>> +#if defined(CONFIG_FEC_MXC)
>>> +void imx_get_mac_from_fuse(unsigned char *mac)
>>> +{
>>> + struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
>>> + struct fuse_bank *bank = &iim->bank[4];
>>> + struct fuse_bank4_regs *fuse =
>>> + (struct fuse_bank4_regs *)bank->fuse_regs;
>>> +
>>> + u32 mac_lo = readl(&fuse->mac_addr_low);
>>> + u32 mac_hi = readl(&fuse->mac_addr_high);
>>> +
>>> + *(u32 *)mac = mac_lo;
>>> +
>>> + mac[4] = mac_hi & 0xff;
>>> + mac[5] = (mac_hi >> 8) & 0xff;
>>> +
>>> +}
>>
>> Even if the implementation is slightly different, this function (except
>> for the bank number) does the same things for MX5 and MX6 - you can als
>> put it into imx-common.
>
> Stefano, there is big difference for the memory layout. On i.mx5, the layout is:
>
> 32-bit 32-bit 32-bit 32-bit 32-bit 32-bit
> mac0 mac1 mac2 mac3 mac4 mac5
>
> but on i.mx6:
>
> 32bit 32bit [low 16bit]
> mac[0-3] mac[4-5]
>
> It's due to i.mx6q use OCOTP fuse-controller other than the fuse-box
> on the i.mx5.
>
> Thus, I think, I will keep the code as it is.
Ok - I was not aware about it.
>>
>> Checking this there something confusing in actual code. There is struct
>> mxc_ccm_reg in crm_regs.h and struct clkctl in imx-regs.h. The two
>
> I did not searched the clkctl in the patch-set by using:
> grep -nR clkctl *
>
>> structure are identical. I am asking myself why...it seems to me that
>> someting went wrong.
>> If there is no evident reason, we should even clean up this point.
>>
>> And it is better you use one of the already supplied names (mxc_ccm_reg
>> or clkctl), without adding a new one.
>
> Yes, I'm using mxc_ccm_reg.
Ok - this structure is also used in most drivers - if I am not wrong
(and I will better check), the struct clkctl is used only to generate
the offsets in asm-offsets.h. If it is so, it could be drop in a future
clean up patch...
>> Maybe do we find a way to add a common include directory ? This file is
>> duplicated. We can use include/asm/arch/imx-common
>
> I don't find one good way to add a common include directory. If I try
> to find one,
> I will put this head file to imx-common.
The easy way is to add include/asm/arch-imx-common, and then the header
are explicitely included as #include <asm/arch-imx-common/..>.
I have seen only another example in U-Boot for armv7:
arch/arm/cpu/armv7/highbank/timer.c:#include <asm/arch-armv7/systimer.h>
I am opened to other solutions, too, but I think that introducing a
common repository for IMX include files (as Linux with plat_imx does) is
the way to do.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
next prev parent reply other threads:[~2011-11-14 11:49 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-12 10:36 [U-Boot] [PATCH 0/6] i.mx: add the initial i.mx6q core/board support Jason Liu
2011-11-12 10:36 ` [U-Boot] [PATCH 1/6] i.mx: i.mx5: Move some files to imx-common folder Jason Liu
2011-11-14 8:34 ` Stefano Babic
2011-11-14 8:57 ` Jason Hui
2011-11-14 11:28 ` Stefano Babic
2011-11-12 10:36 ` [U-Boot] [PATCH 2/6] i.mx: Add the initial support for freescale i.MX6Q processor Jason Liu
2011-11-13 23:11 ` Marek Vasut
2011-11-14 8:47 ` Jason Hui
2011-11-14 10:45 ` Marek Vasut
2011-11-15 10:10 ` Jason Hui
2011-11-15 11:08 ` Stefano Babic
2011-11-14 9:03 ` Stefano Babic
2011-11-14 9:42 ` Jason Hui
2011-11-14 11:49 ` Stefano Babic [this message]
2011-11-15 10:18 ` Jason Hui
2011-11-12 10:36 ` [U-Boot] [PATCH 3/6] i.mx: mxc_gpio: add the i.mx6q support Jason Liu
2011-11-14 9:04 ` Stefano Babic
2011-11-12 10:36 ` [U-Boot] [PATCH 4/6] i.mx: serial_mxc: " Jason Liu
2011-11-12 10:36 ` [U-Boot] [PATCH 5/6] i.mx: fsl_esdhc: " Jason Liu
2011-11-12 16:35 ` Marek Vasut
2011-11-14 8:37 ` Jason Hui
2011-11-14 10:42 ` Marek Vasut
2011-11-15 9:46 ` Jason Hui
2011-11-15 11:56 ` Stefano Babic
2011-11-16 1:36 ` Jason Hui
2011-11-16 2:24 ` Marek Vasut
2011-11-14 9:06 ` Stefano Babic
2011-11-12 10:36 ` [U-Boot] [PATCH 6/6] i.mx: i.mx6q: Add the initial support for i.mx6q ARM2 board Jason Liu
2011-11-12 19:42 ` Fabio Estevam
2011-11-14 8:59 ` Jason Hui
2011-11-12 20:13 ` Fabio Estevam
2011-11-14 9:10 ` Jason Hui
2011-11-13 7:04 ` Igor Grinberg
2011-11-14 9:13 ` Jason Hui
2011-11-14 9:25 ` Stefano Babic
2011-11-14 9:55 ` Jason Hui
2011-11-14 11:36 ` Stefano Babic
2011-11-16 11:34 ` Dirk Behme
2011-11-16 12:15 ` Jason Hui
2011-11-12 16:10 ` [U-Boot] [PATCH 0/6] i.mx: add the initial i.mx6q core/board support Dirk Behme
2011-11-14 8:11 ` Jason Hui
2011-11-16 11:56 ` Dirk Behme
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=4EC10036.7080304@denx.de \
--to=sbabic@denx.de \
--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 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.