All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 6/7] mxc_spi: add support for i.MX35 processor
Date: Wed, 19 Jan 2011 11:09:09 +0100	[thread overview]
Message-ID: <4D36B845.1000908@denx.de> (raw)
In-Reply-To: <20110119074848.B5BE52FC@gemini.denx.de>

On 01/19/2011 08:48 AM, Wolfgang Denk wrote:
> Dear Stefano Babic,
> 
> In message <1295012124-15551-6-git-send-email-sbabic@denx.de> you wrote:
>> Signed-off-by: Stefano Babic <sbabic@denx.de>
>> ---
>>  drivers/spi/mxc_spi.c |   96 +++++++++++++++++++++++++++++++++++++------------
>>  1 files changed, 73 insertions(+), 23 deletions(-)
>>
>> diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
>> index d558137..b353c83 100644
>> --- a/drivers/spi/mxc_spi.c
>> +++ b/drivers/spi/mxc_spi.c
>> @@ -70,6 +70,8 @@ static unsigned long spi_bases[] = {
>>  	0x53f84000,
>>  };
>>  
>> +#define spi_cfg	spi_cfg_mx3
> ...
>> +#define spi_cfg	spi_cfg_mx51
> 
> Hm... this repeats below, but in the end both spi_cfg_mx3() and
> spi_cfg_mx51() are just static functions within the same source file,
> with #ifdef's around them so only one can ever be enabled at a time.

You are right, there is already an #ifdef. I think I had in mind to
remove the #ifdef surrounding the functions, but I give up because I
have added unneeded code (mx51 code for mx3 and viceversa). I will fix it.

> 
> I suggest you omit all these "#define spi_cfg" lines and rename both
> versions of these functions into spi_cfg_mx().
> 
>> +#define MXC_CSPIRXDATA		0x00
>> +#define MXC_CSPITXDATA		0x04
>> +#define MXC_CSPICTRL		0x08
>> +#define MXC_CSPIINT		0x0C
>> +#define MXC_CSPIDMA		0x10
>> +#define MXC_CSPISTAT		0x14
>> +#define MXC_CSPIPERIOD		0x18
>> +#define MXC_CSPITEST		0x1C
> 
> As mentioned before: please use a C struct.

This is another issue. I agree that is ugly code, but it comes from the
originally written driver for the i.MX31. This issue should be fixed,
but in a separate patch, and for all supported processors
(MX.31/MX.25/MX.51/MX.35).

There are at the moment two other patches by Anatolji regarding this
driver. I have already rebased one of them and post to the ML, but I
admit that, as they are not in the same patchset, it is quite difficult
to have an overview of the changes. My proposal is that I will add these
other two patches to my patchset to simplify review.

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
=====================================================================

  reply	other threads:[~2011-01-19 10:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-14 13:35 [U-Boot] [PATCH 1/7] Add support for MX35 processor Stefano Babic
2011-01-14 13:35 ` [U-Boot] [PATCH 2/7] serial_mxc: add support for Freescale's i.MX35 processor Stefano Babic
2011-01-19  7:19   ` Wolfgang Denk
2011-01-14 13:35 ` [U-Boot] [PATCH 3/7] mxc_i2c: Add support for the " Stefano Babic
2011-01-19  7:37   ` Wolfgang Denk
2011-01-19  9:46     ` Stefano Babic
2011-01-14 13:35 ` [U-Boot] [PATCH 4/7] mxc_nand: add support for " Stefano Babic
2011-01-14 18:33   ` Scott Wood
2011-01-14 13:35 ` [U-Boot] [PATCH 5/7] Add basic support for Freescale's mc9sdz60 Stefano Babic
2011-01-19  7:40   ` Wolfgang Denk
2011-01-14 13:35 ` [U-Boot] [PATCH 6/7] mxc_spi: add support for i.MX35 processor Stefano Babic
2011-01-19  7:48   ` Wolfgang Denk
2011-01-19 10:09     ` Stefano Babic [this message]
2011-01-19 11:40       ` Wolfgang Denk
2011-01-14 13:35 ` [U-Boot] [PATCH 7/7] Add support for Freescale's mx35pdk board Stefano Babic
2011-01-17 16:43   ` Jason Liu
2011-01-17 16:54     ` Stefano Babic
2011-01-17 17:29       ` Stefano Babic
2011-01-18  9:40       ` Wolfgang Denk
2011-01-18 10:18         ` Stefano Babic
2011-01-19  8:06   ` Wolfgang Denk
2011-01-19 10:01     ` Stefano Babic
2011-01-19  7:35 ` [U-Boot] [PATCH 1/7] Add support for MX35 processor Wolfgang Denk
2011-01-19  9:45   ` Stefano Babic
2011-01-19 11:37     ` Wolfgang Denk
2011-01-19 11:54       ` Stefano Babic
2011-01-21  9:36       ` Detlev Zundel

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=4D36B845.1000908@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.