Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5487090ybl; Tue, 14 Jan 2020 09:43:28 -0800 (PST) X-Google-Smtp-Source: APXvYqzzZ1yApx24KZc+W9CiCSmMMOnTHEbT9qwvFob0LvGK3R1SOWFEttnroel0AJMRekPcfl32 X-Received: by 2002:a9d:784b:: with SMTP id c11mr16794011otm.246.1579023808059; Tue, 14 Jan 2020 09:43:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579023808; cv=none; d=google.com; s=arc-20160816; b=fgXku7gDV9GDFE5fNmEQw0DldYr12719Y4oSorlhCJEZrX+A+QAFpsQxgdV+tQRss7 tzR8NDdJhNzgdXS52y22dsSQe4cwpmNLeu7elL6aerF8ZGSMASH+VSfxnWJMWXEFL5jx C+omFHzjO2HpUZJUF3xhLCYE5M92gynnkhZdT/RXj6C2INs0tbgPVuPFr7wD8VrfRNeG IXbtAPiANcEcLdz/WcEsmSeQVbIoT6V5COP4PniipFfshKBNtT2xdORLASz/qhU+AyUF IxaIYg+QkdBS/aCv2NWNU/cxVNxJamkv+kXsoH6GtA1xwEmWjqLu0BWPfgEO+oVtIowM Di7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wZGybOhmx67hFU20YW2favnPEoV6+MjtrWOZLP0uQQ8=; b=Q+hLXoKxdTwbO8hv//Kp7v+yybJZYuHh3CEDok/hUJln2w/SuKTAiOUcLDgx5JV14E oBA5Lgro3VVn0iF/btCIAUc751HeHJqZihaql8NsG4ykS/zUg2XHlo7tV/AIv4OcylKt 6TAiIhWu/QMJu+NT4zm1vafLO4fWW9Tbu0b/CQFRVgbGcXkGsHRFeDOvbvTgfZ/FlDHu U5Ngwk4MEc6UPYG8TDS5Z07nH8aOB34ZZUjANhDTKiyAqXskIq6oXrr5oqvkVJA397tB 9A9+4zacNK3FKUVkzHETPLaYjUQN4V933e0iOhRWXeCuWj4FDXmrBEorEaszOruqNrca Y3ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v145si7901240oia.68.2020.01.14.09.43.17; Tue, 14 Jan 2020 09:43:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728787AbgANRmI (ORCPT + 99 others); Tue, 14 Jan 2020 12:42:08 -0500 Received: from foss.arm.com ([217.140.110.172]:55708 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgANRmH (ORCPT ); Tue, 14 Jan 2020 12:42:07 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 337A31396; Tue, 14 Jan 2020 09:42:07 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A7063F68E; Tue, 14 Jan 2020 09:42:05 -0800 (PST) Date: Tue, 14 Jan 2020 17:41:57 +0000 From: Sudeep Holla To: Arnd Bergmann Cc: Viresh Kumar , Jassi Brar , cristian.marussi@arm.com, peng.fan@nxp.com, Sudeep Holla , "linux-kernel@vger.kernel.org" , Linux ARM Subject: Re: [PATCH V2] firmware: arm_scmi: Make scmi core independent of transport type Message-ID: <20200114174157.GA23201@bogus> References: <3f5567ec928e20963d729350e6d674c4acb0c7a0.1578648530.git.viresh.kumar@linaro.org> <20200113064156.lt3xxpzygattz3he@vireshk-i7> <20200114092615.nvj6mkwkplub5ul7@vireshk-i7> <20200114111110.jhkj2y47ncp5233r@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 14, 2020 at 12:17:28PM +0100, Arnd Bergmann wrote: > On Tue, Jan 14, 2020 at 12:11 PM Viresh Kumar wrote: > > > > > > 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? > I remember we had this discussion in the past and was trying to dig up the archive. I found it [1]. At that time and even today, I don't have knowledge of any upstream platform using memory other than SRAM and hence I found it safe to retain ioremap as is. But I agree in general, this abstraction will allow us to add shmem of other memory types like RAM. However, it's difficult to have understanding and representation of the memory type used by the platform firmware say in DT or even ACPI. -- Regards, Sudeep [1] https://www.spinics.net/lists/arm-kernel/msg647292.html