public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 05/29] dm: spi: Add a uclass for SPI
Date: Wed, 29 Oct 2014 14:02:43 +0100	[thread overview]
Message-ID: <5450E573.50705@denx.de> (raw)
In-Reply-To: <1413265336-9571-6-git-send-email-sjg@chromium.org>

Hi Simon!

On 14.10.2014 07:41, Simon Glass wrote:
> Add a uclass which provides access to SPI buses and includes operations
> required by SPI.
>
> For a time driver model will need to co-exist with the legacy SPI interface
> so some parts of the header file are changed depending on which is in use.
> The exports are adjusted also since some functions are not available with
> driver model.
>
> Boards must define CONFIG_DM_SPI to use driver model for SPI.

I'm starting to use DM now. Finally! ;)

In my case I'm implementing the Designware master SPI driver for the 
SoCFPGA. And since its a new driver it really makes sense to use DM 
directly. I'm starting to get an overview now. One thing though that I 
noticed is, that the SPI DM implementation seems to be a bit FDT 
centric. Please see below.

<snip>

 > diff --git a/drivers/spi/spi-uclass.c b/drivers/spi/spi-uclass.c

<snip>

> +int spi_post_bind(struct udevice *dev)
> +{
> +	/* Scan the bus for devices */
> +	return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
> +}

SoCFPGA currently does not support CONFIG_OF_CONTROL (no dtb supplied). 
So I'm planning to use platform_data to instantiate the device. 
Something like this in the board file:

static const struct dw_spi_platdata spi_platdata = {
	.base = SOCFPGA_SPIM0_ADDRESS,
};

U_BOOT_DEVICE(dw_spi) = {
	.name = "dw_spi",
	.platdata = &spi_platdata,
};

What would the non-fdt method have to be to bind the device in 
spi_post_bind() above?

Thanks,
Stefan

  parent reply	other threads:[~2014-10-29 13:02 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-14  5:41 [U-Boot] [PATCH v4 0/29] Introduce driver model support for SPI, SPI flash, cros_ec Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 01/29] sandbox: dts: Add a SPI device and cros_ec device Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 02/29] dm: core: Add functions for iterating through device children Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 03/29] dm: core: Allow parents to pass data to children during probe Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 04/29] dm: core: Add a clarifying comment on struct udevice's seq member Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 05/29] dm: spi: Add a uclass for SPI Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-29 13:02   ` Stefan Roese [this message]
2014-10-29 15:39     ` Jagan Teki
2014-10-29 16:16       ` Stefan Roese
2014-10-30  1:43     ` Simon Glass
2014-10-30  4:38       ` Stefan Roese
2014-10-31  1:30         ` Simon Glass
2014-10-31  8:01           ` Stefan Roese
2014-11-01 15:12             ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 06/29] dm: sandbox: Add a SPI emulation uclass Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 07/29] dm: Remove spi_init() from board_r.c when using driver model Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 08/29] dm: Add spi.h header to a few files Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 09/29] dm: spi: Adjust cmd_spi to work with driver model Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 10/29] dm: sandbox: spi: Move to " Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 11/29] dm: spi: Rename soft_spi.c to soft_spi_legacy.c Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:41 ` [U-Boot] [PATCH v4 12/29] dm: spi: Remove SPI_INIT feature Simon Glass
2014-10-23  3:03   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 13/29] dm: spi: Add soft_spi implementation Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 14/29] dm: exynos: Convert SPI to driver model Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 15/29] dm: spi: Add documentation on how to convert over SPI drivers Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 16/29] exynos: universal_c210: Move to driver model soft_spi Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 17/29] sf: Tidy up public and private header files Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 18/29] spi: Use error return value in sf_ops Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 19/29] dm: sf: Add a uclass for SPI flash Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 20/29] dm: Convert spi_flash_probe() and 'sf probe' to use driver model Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 21/29] dm: sf: sandbox: Convert SPI flash driver to " Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 22/29] dm: exynos: config: Use driver model for SPI flash Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 23/29] dm: spi: Add tests Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 24/29] dm: sf: Add tests for SPI flash Simon Glass
2014-10-23  3:04   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 25/29] dm: tegra: dts: Add aliases for spi on tegra30 boards Simon Glass
2014-10-23  3:05   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 26/29] dm: tegra: spi: Convert to driver model Simon Glass
2014-10-23  3:05   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 27/29] dm: cros_ec: Add support for " Simon Glass
2014-10-23  3:05   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 28/29] dm: sandbox: cros_ec: Move sandbox cros_ec to driver module Simon Glass
2014-10-23  3:05   ` Simon Glass
2014-10-14  5:42 ` [U-Boot] [PATCH v4 29/29] dm: exynos: cros_ec: Move cros_ec_spi to driver model Simon Glass
2014-10-23  3:05   ` Simon Glass

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=5450E573.50705@denx.de \
    --to=sr@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox