Re: [PATCH V2] firmware: arm_scmi: Make scmi core independent of transport type
flat view
From: Arnd Bergmann <arnd@arndb.de>
Date: 2020-01-14 11:17:48
Also in:
lkml
On Tue, Jan 14, 2020 at 12:11 PM Viresh Kumar [off-list ref] wrote:
On 14-01-20, 10:56, Arnd Bergmann wrote:quoted
My point was that you cannot mix __iomem accesses with pointer accesses. As I understood it, the current version uses a pointer to aThe current version is stupid as I misunderstood the whole __iomem thing and just dropped it :)quoted
hardware mailbox with structured data, so you have to use ioremap() to get a token you can pass into ioread(), but (some of) the new transport types would just be backed by regular RAM, on which this is not a well-defined operation and you have to use memremap() and memcpy() instead.Okay, I think I understand that a bit now. So here are the things which I may need to do now: - Maybe move payload to struct scmi_mailbox structure, as that is the transport dependent structure.. - Do ioremap, etc in mailbox.c only instead of driver.c - Provide more ops in struct scmi_transport_ops to provide read/write helpers to the payload and implement the ones based on ioread/iowrite in mailbox.c .. Am I thinking in the right direction now ?
That sounds about right. What I'm still not sure about is whether the
current kernel code is actually correct and should use iomeap()
in the first place. Can you confirm that all current hardware
implementations actually use MMIO type registers here rather than
just rely on a buffer in RAM?
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel