From: Grant Likely <grant.likely@secretlab•ca>
To: gianfranco.casanova@alice•it
Cc: linuxppc-dev@ozlabs•org
Subject: Re: PSC-SPI and MMC-SPI driver on lite5200b EVB. Device registration problems.
Date: Tue, 23 Sep 2008 08:38:59 -0600 [thread overview]
Message-ID: <20080923143859.GA13593@secretlab.ca> (raw)
In-Reply-To: <47602D18F269934AB73B7E550804A1E002137944@FBCMST09V03.fbc.local>
On Tue, Sep 23, 2008 at 02:43:18PM +0200, gianfranco.casanova@alice•it wrote:
> Hi guys
>
> I'm using a lite5200b EVB (u-boot 1.2, kernel 2.6.26.3), using the psc-spi driver and the mmc-spi driver.
>
> I've modified the lite5200b.dts file, I'd have SPI on PSC6 and mmc_spi connected to SPI on PSC6
>
> and then uncommented
>
> // PSC6 in spi mode example
> spi@2c00 { // PSC6
> compatible = "fsl,mpc5200b-psc-spi","fsl,mpc5200-psc-spi";
> cell-index = <5>;
> reg = <0x2c00 0x100>;
> interrupts = <2 4 0>;
> interrupt-parent = <&mpc5200_pic>;
> mmc_spi@0 {
> linux,modalias = "mmc_spi";
> };
> };
>
> I've also added a node to spi@2c00 (I'm not sure about last change).
>
> My question are:
> a) Is this the right way to insert a node in device tree (in this example for mmc-spi) or there are an other way to pass the information to mmc-spi that SPI is on PSC6?
Yes, this is mostly right. However, you need to add 2 properties to
your PSC6 spi@2c00 node; '#address-cells = <1>;' and '#size-cells = <0>;'
These are needed so that the device tree code knows how to interpret the
address of the child node.
For the mmc_spi@0 node, you need to remove the linux,modalias property.
That method of describing the device is strongly discouraged. Instead,
add a property 'compatible = "mmc-spi";' and 'reg = <0>;'. Compatible
is the property used to bind to the device and reg gives the device
address (which is 0 since you only have one device wired to the SPI
bus).
Unfortunately, you'll need to hack around a bit with binding code.
Support for MMC devices described in the device tree has not yet been
merged, so some of this stuff is up in the air. However, as long as you
get the device tree description correct now you should be insulated from
changes in this area.
Take a look at this thread for more details:
http://www.mail-archive.com/linuxppc-dev@ozlabs.org/msg18836.html
>
> b) Why in /proc/devices I do not see any spi device (mpc5200b-psc-spi) or something like that?
> Adding some printk I have:
> Fun = mpc52xx_psc_spi_init Ret = 0
> Is my of_register_platform_driver was ok.
Poke around in /sys/bus/of_platform/devices/. See if anything shows up
there.
>
> c) BTW a Block device mmc in /proc/devices is added (not mmc-spi as I'm waiting), if I try to create a node and then write on device nothing happens.
>
> Any suggestion?
>
> Thanks J
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs•org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
next prev parent reply other threads:[~2008-09-23 14:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-23 12:43 PSC-SPI and MMC-SPI driver on lite5200b EVB. Device registration problems gianfranco.casanova
2008-09-23 14:38 ` Grant Likely [this message]
2008-09-23 15:03 ` Jon Smirl
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=20080923143859.GA13593@secretlab.ca \
--to=grant.likely@secretlab$(echo .)ca \
--cc=gianfranco.casanova@alice$(echo .)it \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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