[U-Boot] [PATCH 6/7] mxc_spi: add support for i.MX35 processor
Wolfgang Denk
wd at denx.de
Wed Jan 19 08:48:48 CET 2011
Dear Stefano Babic,
In message <1295012124-15551-6-git-send-email-sbabic at denx.de> you wrote:
> Signed-off-by: Stefano Babic <sbabic at 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.
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.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If you own a machine, you are in turn owned by it, and spend your
time serving it..." - Marion Zimmer Bradley, _The Forbidden Tower_
More information about the U-Boot
mailing list