From: Gary Jennejohn <garyj@denx.de>
To: linuxppc-dev@ozlabs.org
Subject: 440EPx - SPI and IIC1 conflict
Date: Thu, 15 May 2008 21:02:21 +0200 [thread overview]
Message-ID: <20080515210221.2cd19762@peedub.jennejohn.org> (raw)
Hello,
I've developed a driver for the SPI controller in the 440EPx, which should
also work for e.g. the 460EX, and maybe other AMCC processors.
According to the UM bit 14 in SDR0_PFC1 controls whether certain signals
are for IIC1 or SPI. My driver assures that this bit is set to 0. Note
that I haven't been able to find any code in the Linux tree which
manipulates this register except for my driver, so IIC1 isn't actually
enabled for the 440EPx or the 460EX.
Anyway. In order to guarantee that IIC1 doesn't interfere with the
operation of SPI I have this code snippet in i2c-ibm_of.c:
#if (defined(CONFIG_SPI_PPC4xx) || defined(CONFIG_SPI_PPC4xx_MODULE)) \
&& defined(CONFIG_440EPX)
/*
* Hack, but on the 440EPx we can have either IIC1 or SPI.
*/
if (dev->paddr == 0x1ef600800ULL)
goto fail1;
#endif
which skips IIC1 if the SPI controller is being used.
However, this isn't very aesthetically pleasing.
A colleague suggested testing bit 14 in SDR0_PFC1 and bailing if it's
set.
The problem with this is that the test would depend on the order in which
the init routines are called. Right now the SPI driver is initialized
before the i2c driver, but I'm not certain that this would be the case for
all time.
Basically I'm wondering whether anyone on this list has any brilliant
idea for handling this problem or whether my present solution is really
just OK.
---
Gary Jennejohn
*********************************************************************
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@denx.de
*********************************************************************
next reply other threads:[~2008-05-15 19:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-15 19:02 Gary Jennejohn [this message]
2008-05-15 22:20 ` 440EPx - SPI and IIC1 conflict Grant Likely
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=20080515210221.2cd19762@peedub.jennejohn.org \
--to=garyj@denx.de \
--cc=gary.jennejohn@freenet.de \
--cc=linuxppc-dev@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).