From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: "Richard Röjfors"
<richard.rojfors.ext-l7gf1WXxx3uGw+nKnLezzg@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Linux Kernel Mailing List
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [RESEND][PATCH] SPI: xilinx_spi: Added platform driver and support for DS570
Date: Tue, 23 Jun 2009 12:37:54 -0700 [thread overview]
Message-ID: <200906231237.54278.david-b@pacbell.net> (raw)
In-Reply-To: <4A366622.2050606-l7gf1WXxx3uGw+nKnLezzg@public.gmane.org>
On Monday 15 June 2009, Richard Röjfors wrote:
> This patch splits xilinx_spi into three parts, an OF and a platform
> driver and generic part.
>
> The generic part now also works on X86 and also supports the Xilinx
> SPI IP DS570
Your Kconfig still mentions only DS464.
Is there any reason the platform driver shouldn't also build on x86?
Surely *any* system should be able to talk to an FPGA which exports
this register interface?
>
> Signed-off-by: Richard Röjfors <richard.rojfors.ext-l7gf1WXxx3uGw+nKnLezzg@public.gmane.org>
I'll second Andrew's comments. Also, for my review, it'd be
better to split OF bits out from the rest ... but maybe that's
not practical given the previous xilinx_spi code. At least
future patches will have a more-sane structure to build on.
> +config SPI_XILINX_OF
> + tristate "Xilinx SPI controller OF device"
> + depends on SPI_XILINX && XILINX_VIRTEX
> + help
> + This exposes the SPI controller IP from the Xilinx EDK.
If it's IP, then why is it dependent on VIRTEX? Surely
the same IP should work on Spartan etc. I'd think just
depending on something like OF should suffice.
> +
> + See the "OPB Serial Peripheral Interface (SPI) (v1.00e)"
> + Product Specification document (DS464) for hardware details.
> +
> +config SPI_XILINX_PLTFM
> + tristate "Xilinx SPI controller platform device"
> + depends on SPI_XILINX
This should go first in the Kconfig, so that you don't goof up
the dependency display ... the OF bits depend on it.
> --- linux-2.6.30-rc7-spi/drivers/spi/xilinx_spi_of.c (revision 0)
> +++ linux-2.6.30-rc7-spi/drivers/spi/xilinx_spi_of.c (revision 912)
> @@ -0,0 +1,123 @@
> ...
> +
> +/* work with hotplug and coldplug */
> +MODULE_ALIAS("platform:" XILINX_SPI_NAME);
This is clearly inappropriate for a file with an OpenFirmware driver.
For that matter, it's not needed with platform devices any more either;
so take it out of your platform driver code too.
> --- linux-2.6.30-rc7-spi/include/linux/spi/xilinx_spi.h (revision 0)
> +++ linux-2.6.30-rc7-spi/include/linux/spi/xilinx_spi.h (revision 912)
> @@ -0,0 +1,19 @@
> +#ifndef __LINUX_SPI_XILINX_SPI_H
> +#define __LINUX_SPI_XILINX_SPI_H
> +
> +#define XILINX_SPI_MODEL_DS464 0
> +#define XILINX_SPI_MODEL_DS570 1
> +
> +/* SPI Controller IP */
> +struct xspi_platform_data {
> + s16 bus_num;
Not needed on the platform_bus; pdev->id suffices.
This is specific to the OF glue, yes?
> + u16 num_chipselect;
> + u8 model;
> + u8 bits_per_word;
Synthesis data that's not explicitly visible in
the IP registers, I guess.
> + /* devices to add to the bus when the host is up */
> + struct spi_board_info *devices;
> + u8 num_devices;
This is duplicating functionality in the SPI core code.
That's not really the way to fly. That may also be
specific to the OF glue.
> +};
> +
> +#endif /* __LINUX_SPI_XILINX_SPI_H */
> +
>
>
------------------------------------------------------------------------------
WARNING: multiple messages have this Message-ID (diff)
From: David Brownell <david-b@pacbell.net>
To: "Richard Röjfors" <richard.rojfors.ext@mocean-labs.com>
Cc: spi-devel-general@lists.sourceforge.net,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RESEND][PATCH] SPI: xilinx_spi: Added platform driver and support for DS570
Date: Tue, 23 Jun 2009 12:37:54 -0700 [thread overview]
Message-ID: <200906231237.54278.david-b@pacbell.net> (raw)
In-Reply-To: <4A366622.2050606@mocean-labs.com>
On Monday 15 June 2009, Richard Röjfors wrote:
> This patch splits xilinx_spi into three parts, an OF and a platform
> driver and generic part.
>
> The generic part now also works on X86 and also supports the Xilinx
> SPI IP DS570
Your Kconfig still mentions only DS464.
Is there any reason the platform driver shouldn't also build on x86?
Surely *any* system should be able to talk to an FPGA which exports
this register interface?
>
> Signed-off-by: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
I'll second Andrew's comments. Also, for my review, it'd be
better to split OF bits out from the rest ... but maybe that's
not practical given the previous xilinx_spi code. At least
future patches will have a more-sane structure to build on.
> +config SPI_XILINX_OF
> + tristate "Xilinx SPI controller OF device"
> + depends on SPI_XILINX && XILINX_VIRTEX
> + help
> + This exposes the SPI controller IP from the Xilinx EDK.
If it's IP, then why is it dependent on VIRTEX? Surely
the same IP should work on Spartan etc. I'd think just
depending on something like OF should suffice.
> +
> + See the "OPB Serial Peripheral Interface (SPI) (v1.00e)"
> + Product Specification document (DS464) for hardware details.
> +
> +config SPI_XILINX_PLTFM
> + tristate "Xilinx SPI controller platform device"
> + depends on SPI_XILINX
This should go first in the Kconfig, so that you don't goof up
the dependency display ... the OF bits depend on it.
> --- linux-2.6.30-rc7-spi/drivers/spi/xilinx_spi_of.c (revision 0)
> +++ linux-2.6.30-rc7-spi/drivers/spi/xilinx_spi_of.c (revision 912)
> @@ -0,0 +1,123 @@
> ...
> +
> +/* work with hotplug and coldplug */
> +MODULE_ALIAS("platform:" XILINX_SPI_NAME);
This is clearly inappropriate for a file with an OpenFirmware driver.
For that matter, it's not needed with platform devices any more either;
so take it out of your platform driver code too.
> --- linux-2.6.30-rc7-spi/include/linux/spi/xilinx_spi.h (revision 0)
> +++ linux-2.6.30-rc7-spi/include/linux/spi/xilinx_spi.h (revision 912)
> @@ -0,0 +1,19 @@
> +#ifndef __LINUX_SPI_XILINX_SPI_H
> +#define __LINUX_SPI_XILINX_SPI_H
> +
> +#define XILINX_SPI_MODEL_DS464 0
> +#define XILINX_SPI_MODEL_DS570 1
> +
> +/* SPI Controller IP */
> +struct xspi_platform_data {
> + s16 bus_num;
Not needed on the platform_bus; pdev->id suffices.
This is specific to the OF glue, yes?
> + u16 num_chipselect;
> + u8 model;
> + u8 bits_per_word;
Synthesis data that's not explicitly visible in
the IP registers, I guess.
> + /* devices to add to the bus when the host is up */
> + struct spi_board_info *devices;
> + u8 num_devices;
This is duplicating functionality in the SPI core code.
That's not really the way to fly. That may also be
specific to the OF glue.
> +};
> +
> +#endif /* __LINUX_SPI_XILINX_SPI_H */
> +
>
>
next prev parent reply other threads:[~2009-06-23 19:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-15 15:17 [RESEND][PATCH] SPI: xilinx_spi: Added platform driver and support for DS570 Richard Röjfors
2009-06-23 5:04 ` Andrew Morton
2009-06-23 5:04 ` Andrew Morton
2009-06-23 5:04 ` Andrew Morton
[not found] ` <4A366622.2050606-l7gf1WXxx3uGw+nKnLezzg@public.gmane.org>
2009-06-23 19:37 ` David Brownell [this message]
2009-06-23 19:37 ` David Brownell
2009-06-24 8:09 ` Richard Röjfors
2009-07-03 1:09 ` [spi-devel-general] " David Brownell
2009-07-08 9:15 ` Richard Röjfors
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=200906231237.54278.david-b@pacbell.net \
--to=david-b-ybekhbn/0ldr7s880joybq@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=richard.rojfors.ext-l7gf1WXxx3uGw+nKnLezzg@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/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.