public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Eric Nelson <eric.nelson@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] mx6q: Add support for ECSPI through mxc_spi driver
Date: Wed, 18 Jan 2012 13:05:21 -0700	[thread overview]
Message-ID: <4F172601.7060300@boundarydevices.com> (raw)
In-Reply-To: <4F168529.1030608@denx.de>

On 01/18/2012 01:39 AM, Stefano Babic wrote:
> On 18/01/2012 02:44, Eric Nelson wrote:
>> I'll defer to Stefano on this one, since I did this in response
>> to his request:
>
> Yes, I admit I am guilty about this !
>
> The layout of the CSPI registers is not exactly the same for all SOCs.
> For example, the MXC_CSPICTRL_TC has a different position, as well as
> the BITCOUNT (because the MX31 can send less bits in one shot) and
> MXC_CSPICTRL_CHIPSELECT.
>
> So they are similar, but not exactly the same.
>
> Then we have the MX5 registers. Even if we check the CSPI (not eCSPI)
> controller, the layout of the registers is different compared to the MX3
> SOCs.
>
>> The struct cspi_regs is already present in mx31, mx35, and mx51 headers,
>> so I'm not breaking new ground here, only in the bitfield declarations.
>
> Right, I see the same. The cspi_regs structure is already defined into
> the imx_regs.h, only the bit layout was moved. And as the bit layout is
> SOC dependent, I think the right place for it is inside the imx-regs.h
> registers.
>
>> My interpretation of Stefano's intent is to clean up the driver at the
>> expense of extra defines in the arch-specific headers.
>
> Yes, you're right - of course, I am open also to other solutions if they
> are proofed to be better ;-).
>

I think this is about as good as things get with the current code base.
I would argue that the driver would be better if it explicitly supported
ECSPI and CSPI at the same time since the mx5x CPUs support it.

Implememting that would likely require a de-structuring (removing the
use of structs to represent the register set). IOW, a re-write.

That's probably not worth the effort unless someone's built hardware
that needs it (I'm not aware of any).

On our boards that use more than one channel of SPI (for PMIC and SF), we're 
using ECSPI on both. I think the same was true on the MX51 EVK.

  parent reply	other threads:[~2012-01-18 20:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17 22:09 [U-Boot] mxc_spi refactoring (for mx6q) Eric Nelson
2012-01-17 22:09 ` [U-Boot] [PATCH 1/6] mxc_spi: move machine specifics into CPU headers Eric Nelson
2012-01-17 22:09 ` [U-Boot] [PATCH 2/6] mx6q: Add support for ECSPI through mxc_spi driver Eric Nelson
2012-01-17 23:19   ` Marek Vasut
2012-01-18  0:36     ` Eric Nelson
2012-01-18  1:27       ` Marek Vasut
2012-01-18  1:44         ` Eric Nelson
2012-01-18  1:47           ` Marek Vasut
2012-01-18  2:02             ` Eric Nelson
2012-01-18  8:39           ` Stefano Babic
2012-01-18 16:08             ` Marek Vasut
2012-01-18 16:41               ` Stefano Babic
2012-01-18 20:05             ` Eric Nelson [this message]
2012-01-19 10:33               ` Stefano Babic
2012-01-17 22:09 ` [U-Boot] [PATCH 3/6] mx6q: mx6qsabrelite: Add ECSPI support to the Sabrelite platform Eric Nelson
2012-01-17 22:09 ` [U-Boot] [PATCH 4/6] sf command: allow default chip select through CONFIG_SPI_FLASH_CS Eric Nelson
2012-01-17 22:09 ` [U-Boot] [PATCH 5/6] mx6q: mx6qsabrelite: Provide default chip-select for serial flash Eric Nelson
2012-01-17 22:09 ` [U-Boot] [PATCH 6/6] mx6q: mx6qsabrelite: Provide defaults for placing environment in " Eric Nelson
2012-01-20  3:27   ` Jason Hui
2012-01-20  7:06     ` Dirk Behme
2012-01-20  7:48       ` Jason Hui
2012-01-20  8:47         ` Stefano Babic
2012-01-20 13:47           ` Eric Nelson
2012-01-20 13:43     ` Eric Nelson
2012-01-17 23:16 ` [U-Boot] mxc_spi refactoring (for mx6q) Marek Vasut
2012-01-18 11:51 ` 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=4F172601.7060300@boundarydevices.com \
    --to=eric.nelson@boundarydevices.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