All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leif Liddy <leif.linux@gmail.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-acpi@vger.kernel.org, jarkko.nikula@linux.intel.com
Subject: Re: ACPI SPI slave device
Date: Wed, 2 Mar 2016 04:13:16 +0100	[thread overview]
Message-ID: <CAAbRKOsNxsu4CYq=EByck997RWRO3fQ-+LAAS5AbSL3XNRSh7A@mail.gmail.com> (raw)
In-Reply-To: <CAAbRKOuESP+_65cmeCPNtO5HzN1+ct7bDv1stbE+a8u=KEwDKw@mail.gmail.com>

 I finally got the SPI slave enumerated....by modifying the DSDT table

P: /devices/pci0000:00/0000:00:15.4/pxa2xx-spi.0/spi_master/spi0/spi-APP000D:00
E: DEVPATH=/devices/pci0000:00/0000:00:15.4/pxa2xx-spi.0/spi_master/spi0/spi-APP000D:00
E: ID_VENDOR_FROM_DATABASE=Apple Computer Inc
E: MODALIAS=acpi:APP000D:APPLE-SPI-TOPCASE:
E: SUBSYSTEM=spi
E: USEC_INITIALIZED=27944872

/proc/acpi/wakeup
Device S-state  Status   Sysfs node
SPIT  S3 *disabled   spi:spi-APP000D:00

I'll post more tomorrow, need to evaluate the changes I made --but I
think the change that did it was changing this:

Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
{
    If (!OSDW ())
    {
        Return (WBUF) /* \_SB_.PCI0.SPI1.WBUF */
    }

    Return (ConcatenateResTemplate (RBUF, DBUF))
}

to:

Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
{
      Return (ConcatenateResTemplate (RBUF, DBUF))
}

On Wed, Mar 2, 2016 at 12:33 AM, Leif Liddy <leif.linux@gmail.com> wrote:
> Thanks for that!!!
>
> Ok, I added a few more printk statments to spi.c. It looks like the
> root cause of the issue is that the
> "ares->type == ACPI_RESOURCE_TYPE_SERIAL_BUS" check is failing.
>
> pxa2xx-spi pxa2xx-spi.0: found DMA channel "tx" at index 0
> xxx resource.c acpi_dev_get_resources acpi_dev_name=INT33C1:00 returns
> c.count 0...
> dma dma0chan0: dwc_alloc_chan_resources: allocated 64 descriptors
> dmaengine: __dma_request_channel: success (dma0chan0)
> pxa2xx-spi pxa2xx-spi.0: found DMA channel "rx" at index 1
> xxx resource.c acpi_dev_get_resources acpi_dev_name=INT33C1:00 returns
> c.count 0...
> dmaengine: private_candidate: dma0chan0 busy
> dma dma0chan1: dwc_alloc_chan_resources: allocated 64 descriptors
> dmaengine: __dma_request_channel: success (dma0chan1)
> pxa2xx-spi pxa2xx-spi.0: registered master spi0
> xxx spi.c acpi_register_spi_devices acpi_handle is ffff8802650bdcd0 (INT33C1:00)
> xxx spi.c acpi_spi_add_device() start
> xxx spi.c *spi_alloc_device() start
> xxx spi.c acpi_spi_add_device acpi_dev_name=APP000D:00
> xxx spi.c acpi_spi_add_resource() start
> xxx spi.c acpi_spi_add_resource spi->irq = -1
> xxx spi.c acpi_spi_add_resource failed check: ares->type ==
> ACPI_RESOURCE_TYPE_SERIAL_BUS
> xxx spi.c acpi_spi_add_resource :else if (spi->irq < 0)
> xxx spi.c acpi_spi_add_resource return 1
> xxx resource.c acpi_dev_get_resources acpi_dev_name=APP000D:00 returns
> c.count 0...
> xxx spi.c acpi_spi_add_device ret returns 0
> xxx spi.c acpi_spi_add_device spi->max_speed_hz is 0
> xxx spi.c acpi_spi_add_device  (ret < 0 || !spi->max_speed_hz) --->
> spi_dev_put(spi) --> return AE_OK
>
>
> I assume it's looking for SpiSerialBus in  the _CRS method,  not sure
> why it can't find it. I wonder if there's a way to just manually
> configure the slave device.
>
>
>  Device (SPIT)
>    {
>      Name (_HID, EisaId ("APP000D"))  // _HID: Hardware ID
>      .....
>
>     Method (_CRS, 0, Serialized)  // _CRS: Current Resource Settings
>     {
>         Name (UBUF, ResourceTemplate ()
>         {
>             SpiSerialBus (0x0000, PolarityLow, FourWireMode, 0x08,
>                 ControllerInitiated, 0x007A1200, ClockPolarityLow,
>                 ClockPhaseFirst, "\\_SB.PCI0.SPI1",
>                 0x00, ResourceConsumer, ,
>                 )
>             Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, ,, )
>             {
>                 0x0000001E,
>             }
>         })
>         Name (ABUF, ResourceTemplate ()
>         {
>         })
>         If (!OSDW ())
>         {
>             Return (UBUF) /* \_SB_.PCI0.SPI1.SPIT._CRS.UBUF */
>         }
>
>        Return (ABUF) /* \_SB_.PCI0.SPI1.SPIT._CRS.ABUF */
>    }
>
> On Tue, Mar 1, 2016 at 5:07 PM, Lukas Wunner <lukas@wunner.de> wrote:
>> Hi Leif,
>>
>> On Tue, Mar 01, 2016 at 04:42:18PM +0100, Leif Liddy wrote:
>>> Do you know how I could print out the the name or id of the ACPI
>>> device from the acpi_device pointer?
>>
>> printk("acpi_dev_name=%s\n", acpi_dev_name(adev));
>>
>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/linux/acpi.h#n83
>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/acpi/acpi_bus.h#n354
>>
>> Best regards,
>>
>> Lukas

  reply	other threads:[~2016-03-02  3:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23  1:54 ACPI SPI slave device Leif Liddy
2016-02-23  7:38 ` Mika Westerberg
2016-02-23 14:18   ` Leif Liddy
2016-02-23 15:02     ` Mika Westerberg
2016-02-23 15:32       ` Mika Westerberg
2016-02-23 20:30         ` Leif Liddy
2016-02-29  8:21           ` Mika Westerberg
2016-02-29 17:21             ` Leif Liddy
2016-03-01 15:42               ` Leif Liddy
2016-03-01 16:07                 ` Lukas Wunner
2016-03-01 23:33                   ` Leif Liddy
2016-03-02  3:13                     ` Leif Liddy [this message]
2016-03-02 11:42                       ` Lukas Wunner
2016-03-02 13:07                         ` Leif Liddy
2016-03-02 14:37                           ` Leif Liddy
2016-03-03 11:47                             ` Lukas Wunner
     [not found]                               ` <20160303114740.GA24132-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-03-03 17:45                                 ` Matthew Garrett
2016-03-03 18:55                                   ` Lukas Wunner
2016-03-03 19:12                                     ` Matthew Garrett
2016-03-08 14:40                                       ` Leif Liddy
     [not found]                                         ` <CAAbRKOu8UWrn5bhxjrHx5cykFWOChyxr_ZCWK=R4nYCc11cvsw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-09 12:36                                           ` Lukas Wunner
     [not found]                                             ` <20160309123625.GA26143-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-03-10 18:12                                               ` Leif Liddy
2016-03-03 17:48                                 ` Matthew Garrett
  -- strict thread matches above, loose matches on Subject: below --
2016-02-22 19:37 ACPI: " Leif Liddy

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='CAAbRKOsNxsu4CYq=EByck997RWRO3fQ-+LAAS5AbSL3XNRSh7A@mail.gmail.com' \
    --to=leif.linux@gmail.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mika.westerberg@linux.intel.com \
    /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.