Thread (14 messages) flat view 14 messages, 3 authors, 2015-11-07

Re: [PATCH -next] net: hisilicon: Never build on SPARC

From: Guenter Roeck <linux@roeck-us.net>
Date: 2015-10-21 17:03:10
Also in: lkml

On 10/21/2015 08:57 AM, Arnd Bergmann wrote:
On Wednesday 21 October 2015 08:33:11 David Miller wrote:
quoted
From: Guenter Roeck <linux@roeck-us.net>
Date: Wed, 21 Oct 2015 07:56:18 -0700
quoted
quoted
@@ -57,6 +57,11 @@ extern int of_dma_get_range(struct device_node *np,
u64 *dma_addr,
                              u64 *paddr, u64 *size);
   extern bool of_dma_is_coherent(struct device_node *np);
   #else /* CONFIG_OF_ADDRESS */
+static inline u64 of_translate_address(struct device_node *np, const
__be32 *addr)
+{
+    return 0;
Maybe return OF_BAD_ADDR ?
The thing to really do on sparc, is just return the address raw untranslated
because that just works.
We still need to check #address-cells, right?

Something like this?

static inline u64 of_translate_address(struct device_node *np, const __be32 *addr)
{
#if defined(CONFIG_SPARC) || defined(CONFIG_M68K)
	int pna = of_n_addr_cells(np);
	u64 ret = be32_to_cpu(addr[pna - 1]);

	if (pna > 1)
		ret += (u64)be32_to_cpu(addr[pna - 2]) << 32;

	return ret;
That suggests that sparc would need a translation after all, which
seems to contradict what David said earlier.

Anyway, if it gets that complicated, I think we should stick with
just returning OF_BAD_ADDR. The above really suggests the need for
an architecture specific solution.

Guenter
#else
	return OF_BAD_ADDR;
#endif
}

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help