qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Jean-Christophe Dubois <jcd@tribudubois.net>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v3 12/12] i.MX: Add sabrelite i.MX6 emulation.
Date: Thu, 10 Mar 2016 17:38:37 +0700	[thread overview]
Message-ID: <CAFEAcA8ETuWFzqy13wANvOpd-vJ8miRyTzSNwp+aL_qE8ryM6w@mail.gmail.com> (raw)
In-Reply-To: <bdd266de649a0d05e7373dd147e58af33677a012.1456868959.git.jcd@tribudubois.net>

On 2 March 2016 at 05:27, Jean-Christophe Dubois <jcd@tribudubois.net> wrote:
> The sabrelite supports one SPI FLASH memory on SPI1
>
> Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
> ---
>
> +
> +    {
> +        /* Add the sst25vf016b NOR FLASH memory to first SPI */
> +        Object *spi_dev;
> +
> +        spi_dev = object_resolve_path_component(OBJECT(&s->soc), "spi1");
> +        if (spi_dev) {
> +            SSIBus *spi_bus;
> +
> +            spi_bus = (SSIBus *)qdev_get_child_bus(DEVICE(spi_dev), "spi");

This looks odd. You should just be able to do
 spi_bus = (SSIBus *)qdev_get_child_bus(DEVICE(&s->soc), "spi1");
without using object_resolve_path_component() to try to find an
SPI device object, because your SoC device should have alias properties
which provide access to its SPI subcomponents' SPI buses.
See hw/arm/xlnx-ep108.c for an example of the board code for this and
hw/arm/xlnx-zynqmp.c for the SoC code which calls
object_property_add_alias() to set up the aliases.

> +            if (spi_bus) {
> +                DeviceState *flash_dev;
> +
> +                flash_dev = ssi_create_slave(spi_bus, "sst25vf016b");
> +                if (flash_dev) {
> +                    qemu_irq cs_line = qdev_get_gpio_in_named(flash_dev,
> +                                                              SSI_GPIO_CS, 0);
> +                    sysbus_connect_irq(SYS_BUS_DEVICE(spi_dev), 1, cs_line);
> +                }
> +            }
> +        }
> +    }

thanks
-- PMM

  reply	other threads:[~2016-03-10 10:39 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 22:27 [Qemu-devel] [PATCH v3 00/12] Add i.MX6 (Single/Dual/Quad) support Jean-Christophe Dubois
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 01/12] i.MX: Allow GPT timer to rollover Jean-Christophe Dubois
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 02/12] i.MX: Rename CCM NOCLK to CLK_NONE for naming consistency Jean-Christophe Dubois
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 03/12] i.MX: Remove CCM useless clock computation handling Jean-Christophe Dubois
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 04/12] i.MX: Add the CLK_IPG_HIGH clock Jean-Christophe Dubois
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 05/12] i.MX: Add i.MX6 CCM and ANALOG device Jean-Christophe Dubois
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 06/12] ARM: Factor out ARM on/off PSCI control functions Jean-Christophe Dubois
2016-03-10 10:14   ` Peter Maydell
2016-03-16 22:19     ` Jean-Christophe DUBOIS
2016-03-17  8:46       ` Peter Maydell
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 07/12] i.MX: Add i.MX6 System Reset Controller device Jean-Christophe Dubois
2016-03-10 10:20   ` Peter Maydell
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 08/12] i.MX: Add missing descriptions in devices Jean-Christophe Dubois
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 09/12] FIFO: Add a FIFO32 implementation Jean-Christophe Dubois
2016-03-10 10:25   ` Peter Maydell
2016-03-10 19:26     ` Jean-Christophe DUBOIS
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 10/12] i.MX: Add the Freescale SPI Controller Jean-Christophe Dubois
2016-03-10 10:31   ` Peter Maydell
2016-03-10 19:26     ` Jean-Christophe DUBOIS
2016-03-11  0:01       ` Peter Maydell
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 11/12] i.MX: Add i.MX6 SOC implementation Jean-Christophe Dubois
2016-03-10 10:33   ` Peter Maydell
2016-03-01 22:27 ` [Qemu-devel] [PATCH v3 12/12] i.MX: Add sabrelite i.MX6 emulation Jean-Christophe Dubois
2016-03-10 10:38   ` Peter Maydell [this message]
2016-03-10 19:24     ` Jean-Christophe DUBOIS
2016-03-10 23:57       ` Peter Maydell
2016-03-15 21:40         ` Jean-Christophe DUBOIS
2016-03-16  6:32           ` Peter Maydell
2016-03-16 11:28             ` Peter Maydell
2016-03-16 11:04 ` [Qemu-devel] [PATCH v3 00/12] Add i.MX6 (Single/Dual/Quad) support Peter Maydell

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=CAFEAcA8ETuWFzqy13wANvOpd-vJ8miRyTzSNwp+aL_qE8ryM6w@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=crosthwaite.peter@gmail.com \
    --cc=jcd@tribudubois.net \
    --cc=qemu-devel@nongnu.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).