From: gnurou@gmail.com (Alexandre Courbot)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 05/12] memory: Add NVIDIA Tegra memory controller support
Date: Sat, 1 Nov 2014 14:38:26 +0900 [thread overview]
Message-ID: <CAAVeFuKgMAF4LML5G=2k00No4AKDj7MTHB6ByXEvPzaSsAPUXg@mail.gmail.com> (raw)
In-Reply-To: <20141031132740.GA9371@ulmo.nvidia.com>
On Fri, Oct 31, 2014 at 10:27 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Thu, Oct 30, 2014 at 04:08:41PM +0100, Thierry Reding wrote:
>> On Wed, Oct 15, 2014 at 03:09:30PM -0700, Olof Johansson wrote:
>> > Hi,
>> >
>> > Oh, a few more comments:
>> >
>> > On Mon, Oct 13, 2014 at 3:33 AM, Thierry Reding
>> > <thierry.reding@gmail.com> wrote:
>> >
>> > > diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile
>> > > index c32d31981be3..1c932e7e7b8d 100644
>> > > --- a/drivers/memory/Makefile
>> > > +++ b/drivers/memory/Makefile
>> > > @@ -12,4 +12,5 @@ obj-$(CONFIG_FSL_CORENET_CF) += fsl-corenet-cf.o
>> > > obj-$(CONFIG_FSL_IFC) += fsl_ifc.o
>> > > obj-$(CONFIG_MVEBU_DEVBUS) += mvebu-devbus.o
>> > > obj-$(CONFIG_TEGRA20_MC) += tegra20-mc.o
>> > > -obj-$(CONFIG_TEGRA30_MC) += tegra30-mc.o
>> > > +
>> > > +obj-$(CONFIG_ARCH_TEGRA) += tegra/
>> > > diff --git a/drivers/memory/tegra/Makefile b/drivers/memory/tegra/Makefile
>> > > new file mode 100644
>> > > index 000000000000..51b9e8fcde1b
>> > > --- /dev/null
>> > > +++ b/drivers/memory/tegra/Makefile
>> > > @@ -0,0 +1,5 @@
>> > > +obj-y = tegra-mc.o
>> > > +obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30-mc.o
>> > > +obj-$(CONFIG_ARCH_TEGRA_114_SOC) += tegra114-mc.o
>> > > +obj-$(CONFIG_ARCH_TEGRA_124_SOC) += tegra124-mc.o
>> > > +obj-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra124-mc.o
>> >
>> > You'll need a Kconfig and not just a makefile -- there are definitely
>> > dependencies on this driver (IOMMU in particular).
>>
>> This is handled within the tegra-mc driver by only setting up the IOMMU
>> when TEGRA_IOMMU_SMMU is enabled. That config option remains in place.
>>
>> > Also, the problem of having a global enable bit that is only under
>> > control of TrustZone FW is a big problem -- if the bit is not set, the
>> > driver will not work (and the machine will crash).
>> >
>> > I think you'll need to come up with a way to detect that in the
>> > driver. I don't have a good idea of how it can be done though.
>>
>> I don't think I ever got back to you on this. We discussed this
>> internally and it seems like there's no way to detect this properly, so
>> the best suggestion so far was to make it a requirement on the secure
>> firmware to enable IOMMU or not. Since there's no way for the kernel to
>> detect whether IOMMU was enabled or not, I think the firmware would
>> equally have to adjust the SMMU's device tree node's status property
>> appropriately.
>
> The other option would be for the firmware not to touch the SMMU device
> tree node and the kernel simply assuming that if it's running in non-
> secure mode then there must be secure firmware and it has enabled the
> SMMU. Enabling the SMMU would become part of the contract between
> firmware and kernel, much like locking the VPR is required to get the
> GPU to work.
>
> Those are really the only two choices we have.
We got the exact same problem with GPU and VPR registers, and it seems
like the approach we will be taking here is to have the
firmware/bootloader do whatever is needed to get the GPU working and
enable the DT node once it did. IOW, the kernel will never touch
protected registers, and will not freeze if the hardware is not
properly set up.
It would be nice for consistency if the same approach can be taken
with the IOMMU. OTOH we will need to make sure that all these
initialization contracts are clearly documented somewhere. Maybe a
comment in the DTS to explain what is expected from the firmware to
enable such nodes would be a good idea, too.
next prev parent reply other threads:[~2014-11-01 5:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-13 10:33 [PATCH v3 01/12] clk: tegra: Implement memory-controller clock Thierry Reding
2014-10-13 10:33 ` [PATCH 02/12] amba: Add Kconfig file Thierry Reding
2014-10-13 10:33 ` [PATCH v4 03/12] ARM: tegra: Move AHB Kconfig to drivers/amba Thierry Reding
2014-10-13 10:33 ` [PATCH 04/12] of: Add NVIDIA Tegra memory controller binding Thierry Reding
2014-10-13 10:33 ` [PATCH 06/12] ARM: tegra: Add memory controller support for Tegra20 Thierry Reding
2014-10-17 17:43 ` David Riley
2014-10-30 14:45 ` Thierry Reding
2014-10-13 10:33 ` [PATCH 07/12] ARM: tegra: Add memory controller support for Tegra30 Thierry Reding
2014-10-13 10:33 ` [PATCH 08/12] ARM: tegra: Add memory controller support for Tegra114 Thierry Reding
2014-10-13 10:33 ` [PATCH 09/12] ARM: tegra: Add memory controller support for Tegra124 Thierry Reding
2014-10-13 10:33 ` [PATCH 10/12] ARM: tegra: Enable IOMMU for display controllers on Tegra30 Thierry Reding
2014-10-13 10:33 ` [PATCH 11/12] ARM: tegra: Enable IOMMU for display controllers on Tegra114 Thierry Reding
2014-10-13 10:33 ` [PATCH 12/12] ARM: tegra: Enable IOMMU for display controllers on Tegra124 Thierry Reding
2014-10-20 11:02 ` [PATCH v3 01/12] clk: tegra: Implement memory-controller clock Tomeu Vizoso
2014-10-30 14:57 ` Thierry Reding
[not found] ` <1413196434-5292-5-git-send-email-thierry.reding@gmail.com>
2014-10-15 22:05 ` [PATCH v4 05/12] memory: Add NVIDIA Tegra memory controller support Olof Johansson
2014-10-30 15:32 ` Thierry Reding
2014-10-15 22:09 ` Olof Johansson
2014-10-30 15:08 ` Thierry Reding
2014-10-31 13:27 ` Thierry Reding
2014-11-01 5:38 ` Alexandre Courbot [this message]
2014-11-03 8:22 ` Thierry Reding
2014-11-03 8:40 ` Alexandre Courbot
2014-10-30 10:03 ` Alexandre Courbot
2014-10-30 10:18 ` Terje Bergström
2014-10-30 10:22 ` Alexandre Courbot
2014-10-30 11:04 ` Terje Bergström
2014-10-30 13:35 ` Alexandre Courbot
2014-10-30 13:47 ` Terje Bergström
2014-10-30 14:56 ` Thierry Reding
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='CAAVeFuKgMAF4LML5G=2k00No4AKDj7MTHB6ByXEvPzaSsAPUXg@mail.gmail.com' \
--to=gnurou@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).