All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 7/7] dm: x86: spi: Convert ICH SPI driver to driver model PCI API
Date: Wed, 16 Dec 2015 21:10:12 -0700	[thread overview]
Message-ID: <CAPnjgZ3KCMaSMOnH+Ce5r9yjCQ+okrc6x7VOO5Qt5C9=YzwHdQ@mail.gmail.com> (raw)
In-Reply-To: <CAEUhbmWXH+5C4wjPnT8=dQqfX=XwcMa0Vpy3x5NH5Wpk-aT2Sg@mail.gmail.com>

Hi Bin,

On 8 December 2015 at 06:24, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Simon,
>
> On Tue, Dec 1, 2015 at 12:11 PM, Simon Glass <sjg@chromium.org> wrote:
>> At present this SPI driver works by searching the PCI buses for its
>> peripheral. It also uses the legacy PCI API.
>>
>> In addition the driver has code to determine the type of Intel PCH that is
>> used (version 7 or version 9). Now that we have proper PCH drivers we can
>> use those to obtain the information we need.
>>
>> While the device tree has a node for the SPI peripheral it is not in the
>> right place. It should be on the PCI bus as a sub-peripheral of the LPC
>> device.
>>
>> Update the device tree files to show the SPI controller within the PCH, so
>> that PCI access works as expected.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>>  arch/x86/cpu/irq.c                  |   7 +-
>>  arch/x86/cpu/ivybridge/bd82x6x.c    |  11 +++
>>  arch/x86/dts/bayleybay.dts          | 160 +++++++++++++++++++-----------------
>>  arch/x86/dts/broadwell_som-6896.dts |  23 ++++--
>>  arch/x86/dts/chromebook_link.dts    |   3 +-
>>  arch/x86/dts/chromebox_panther.dts  |  33 ++++----
>>  arch/x86/dts/crownbay.dts           | 150 +++++++++++++++++----------------
>>  arch/x86/dts/galileo.dts            |  98 +++++++++++-----------
>>  arch/x86/dts/minnowmax.dts          | 158 ++++++++++++++++++-----------------
>>  arch/x86/dts/qemu-x86_i440fx.dts    |  26 +++---
>>  arch/x86/dts/qemu-x86_q35.dts       |  38 +++++----
>>  drivers/spi/ich.c                   | 115 ++++++--------------------
>>  12 files changed, 409 insertions(+), 413 deletions(-)
>>
>> diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c
>> index 35b29f6..205405b 100644
>> --- a/arch/x86/cpu/irq.c
>> +++ b/arch/x86/cpu/irq.c
>> @@ -97,6 +97,7 @@ static int create_pirq_routing_table(void)
>>         struct irq_routing_table *rt;
>>         struct irq_info *slot, *slot_base;
>>         int irq_entries = 0;
>> +       int parent;
>>         int i;
>>         int ret;
>>
>> @@ -106,7 +107,11 @@ static int create_pirq_routing_table(void)
>>                 return -EINVAL;
>>         }
>>
>> -       ret = fdtdec_get_pci_addr(blob, node, FDT_PCI_SPACE_CONFIG,
>> +       /* TODO(sjg at chromium.org): Drop this when PIRQ is a driver */
>> +       parent = fdt_parent_offset(blob, node);
>> +       if (parent < 0)
>> +               return -EINVAL;
>> +       ret = fdtdec_get_pci_addr(blob, parent, FDT_PCI_SPACE_CONFIG,
>>                                   "reg", &addr);
>>         if (ret)
>>                 return ret;
>> diff --git a/arch/x86/cpu/ivybridge/bd82x6x.c b/arch/x86/cpu/ivybridge/bd82x6x.c
>> index 434dfd6..abd59da 100644
>> --- a/arch/x86/cpu/ivybridge/bd82x6x.c
>> +++ b/arch/x86/cpu/ivybridge/bd82x6x.c
>> @@ -9,6 +9,7 @@
>>  #include <errno.h>
>>  #include <fdtdec.h>
>>  #include <malloc.h>
>> +#include <pch.h>
>>  #include <asm/lapic.h>
>>  #include <asm/pci.h>
>>  #include <asm/arch/bd82x6x.h>
>> @@ -116,6 +117,15 @@ int bd82x6x_init(void)
>
> Should this bd82x6x_init() be moved to init op of the pch driver?

That's a later patch.

>
>>         return 0;

[snip]

Re using get_sbase() properly, I'll send a v2 patch and see what you think.

Regards,
Simon

      reply	other threads:[~2015-12-17  4:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01  4:11 [U-Boot] [PATCH 0/7] dm: x86: Convert ICH driver fully to driver model PCI API Simon Glass
2015-12-01  4:11 ` [U-Boot] [PATCH 1/7] dm: pci: Move pci_bus_to_hose() to compatibility Simon Glass
2015-12-08 13:22   ` Bin Meng
2015-12-01  4:11 ` [U-Boot] [PATCH 2/7] dm: pci: Add a function to write a BAR Simon Glass
2015-12-08 13:23   ` Bin Meng
2015-12-19  2:51     ` Simon Glass
2015-12-01  4:11 ` [U-Boot] [PATCH 3/7] dm: pci: Avoid using pci_bus_to_hose() in the uclass Simon Glass
2015-12-08 13:23   ` Bin Meng
2015-12-01  4:11 ` [U-Boot] [PATCH 4/7] dm: Expand the uclass for Peripheral Controller Hubs (PCH) Simon Glass
2015-12-08 13:23   ` Bin Meng
2015-12-08 13:45     ` Bin Meng
2015-12-17  4:09     ` Simon Glass
2015-12-17 10:09       ` Bin Meng
2015-12-18  2:46         ` Simon Glass
2015-12-01  4:11 ` [U-Boot] [PATCH 5/7] dm: x86: Add a driver for Intel PCH7 Simon Glass
2015-12-08 13:23   ` Bin Meng
2015-12-01  4:11 ` [U-Boot] [PATCH 6/7] dm: x86: Add a driver for Intel PCH9 Simon Glass
2015-12-08 13:23   ` Bin Meng
2015-12-01  4:11 ` [U-Boot] [PATCH 7/7] dm: x86: spi: Convert ICH SPI driver to driver model PCI API Simon Glass
2015-12-03 11:47   ` Jagan Teki
2015-12-08 13:24   ` Bin Meng
2015-12-17  4:10     ` Simon Glass [this message]

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='CAPnjgZ3KCMaSMOnH+Ce5r9yjCQ+okrc6x7VOO5Qt5C9=YzwHdQ@mail.gmail.com' \
    --to=sjg@chromium.org \
    --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 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.