public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: thierry.reding@avionic-design.de (Thierry Reding)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] arm/dts: Tegra30: Add device tree support for SMMU
Date: Wed, 18 Apr 2012 11:26:13 +0200	[thread overview]
Message-ID: <20120418092613.GA8632@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <20120418.121824.1894043789811063795.hdoyu@nvidia.com>

* Hiroshi Doyu wrote:
> diff --git a/drivers/of/of_dma.c b/drivers/of/of_dma.c
> new file mode 100644
> index 0000000..1db1ccd
> --- /dev/null
> +++ b/drivers/of/of_dma.c
> @@ -0,0 +1,35 @@
> +/*
> + * Stealed from:

"Stolen from"

> + *	"arch/microblaze/kernel/prom_parse.c"
> + *	"arch/powerpc/kernel/prom_parse.c"
> + */
> +
> +#include <linux/of_address.h>
> +
> +void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
> +		unsigned long *busno, unsigned long *phys, unsigned long *size)
> +{
> +	const u32 *dma_window;

Should be __be32.

> +	u32 cells;
> +	const unsigned char *prop;
> +
> +	dma_window = dma_window_prop;
> +
> +	/* busno is always one cell */
> +	if (busno)
> +		*busno = *(dma_window++);

This needs endianness conversion:

	*busno = be32_to_cpup(dma_window++);

> +
> +	prop = of_get_property(dn, "#dma-address-cells", NULL);
> +	if (!prop)
> +		prop = of_get_property(dn, "#address-cells", NULL);
> +
> +	cells = prop ? *(u32 *)prop : of_n_addr_cells(dn);

Same here.

> +	*phys = of_read_number(dma_window, cells);
> +
> +	dma_window += cells;
> +
> +	prop = of_get_property(dn, "#dma-size-cells", NULL);
> +	cells = prop ? *(u32 *)prop : of_n_size_cells(dn);

And here.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120418/e02078d4/attachment.sig>

  reply	other threads:[~2012-04-18  9:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201204161534.20089.arnd@arndb.de>
     [not found] ` <20120418081746.995724e27bdc726049cd4965@nvidia.com>
     [not found]   ` <20120418054140.GA17506@avionic-0098.adnet.avionic-design.de>
2012-04-18  6:44     ` [PATCH 1/1] arm/dts: Tegra30: Add device tree support for SMMU Hiroshi Doyu
2012-04-18  7:31       ` Arnd Bergmann
2012-04-18  9:18         ` Hiroshi Doyu
2012-04-18  9:26           ` Thierry Reding [this message]
2012-04-18 10:19             ` [PATCH 1/1] dt: Add general DMA window parser Hiroshi Doyu
2012-04-18 10:26               ` Thierry Reding
2012-04-18 10:36                 ` Hiroshi Doyu
2012-04-18 10:54                   ` Thierry Reding
2012-04-18 11:13                     ` Hiroshi Doyu
2012-04-18 17:27               ` Stephen Warren
2012-04-18 19:39                 ` Thierry Reding
2012-04-19 12:32                   ` Hiroshi Doyu
2012-04-19 12:19                 ` Hiroshi Doyu
2012-04-23 11:53                   ` [PATCH v2 " Hiroshi Doyu
2012-04-23 18:16                     ` Stephen Warren

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=20120418092613.GA8632@avionic-0098.mockup.avionic-design.de \
    --to=thierry.reding@avionic-design.de \
    --cc=linux-arm-kernel@lists.infradead.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