linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: "Bernhard Rosenkränzer" <bero@baylibre.com>
Cc: linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	matthias.bgg@gmail.com, krzysztof.kozlowski+dt@linaro.org,
	robh+dt@kernel.org, gregkh@linuxfoundation.org,
	chunfeng.yun@mediatek.com, linus.walleij@linaro.org,
	lee@kernel.org, tglx@linutronix.de,
	angelogioacchino.delregno@collabora.com
Subject: Re: [PATCH v6 7/7] arm64: dts: mediatek: Initial mt8365-evk support
Date: Sun, 01 Jan 2023 22:44:39 +0000	[thread overview]
Message-ID: <87sfgteuy0.wl-maz@kernel.org> (raw)
In-Reply-To: <CAP2ifjMkKJbE_+B=XaxzXoALrc5+FUb7TKpPJQBLV3-3xqVh=g@mail.gmail.com>

On Sun, 01 Jan 2023 21:57:58 +0000,
Bernhard Rosenkränzer <bero@baylibre.com> wrote:
> 
> On Fri, Dec 30, 2022 at 11:41 PM Marc Zyngier <maz@kernel.org> wrote:
> > > +             gic: interrupt-controller@c000000 {
> > > +                     compatible = "arm,gic-v3";
> > > +                     #interrupt-cells = <4>;
> >
> > Why 4 cells? All the SPIs routed via sysirq are perfectly happy with 3
> > cells, and all the PPIs have 0 for the 4th cell (none of them use any
> > form of partitioning that'd require 4 cells). So where is this coming
> > from?
> 
> It's coming from the SoC vendor kernel (and went unnoticed because
> it happens to work).  Will send an updated version that does the
> right thing instead. I've been running it most of the day, so far
> looking good.
> 
> > > +                     interrupt-parent = <&gic>;
> > > +                     interrupt-controller;
> > > +                     reg = <0 0x0c000000 0 0x80000>, <0 0x0c080000 0 0x80000>;
> > > +
> >
> > The first region is obviously wrong (512kB for the distributor?
> > that's... most generous, but the architecture states that it is 64kB,
> > and that's wasteful enough).
> >
> > This is also missing the GICC/GICH/GICV regions that Cortex-A53
> > implements, and that must be provided as per the binding.
> 
> This was also taken from the vendor kernel; unfortunately neiter the
> datasheet for the SoC not the vendor kernel specifies the addresses
> for GICC/GICH/GICV.
> I've "guessed" based on what's in similar SoCs (MT8183, MT7986a) in
> v7; this seems to work (boots, kvm initializes hyp mode properly).

Please don't "guess", because this adds zero value, and we might as
well run with the vendor crap instead.

Read CBAR_EL1, and use this value to construct the memory map, as per
the A53 TRM. Just booting with KVM enabled means nothing, as this is
solely used at VM run time. You need run a full VM with GIC-2
emulation.

	M.

-- 
Without deviation from the norm, progress is not possible.

  reply	other threads:[~2023-01-01 22:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-30 20:35 [PATCH v6 0/7] Add minimal MT8365 and MT8365-EVK support Bernhard Rosenkränzer
2022-12-30 20:35 ` [PATCH v6 1/7] dt-bindings: arm64: dts: mediatek: Add mt8365-evk board Bernhard Rosenkränzer
2022-12-30 20:35 ` [PATCH v6 2/7] dt-bindings: irq: mtk, sysirq: add support for mt8365 Bernhard Rosenkränzer
2022-12-30 20:35 ` [PATCH v6 3/7] dt-bindings: mfd: syscon: Add mt8365-syscfg Bernhard Rosenkränzer
2022-12-30 20:35 ` [PATCH v6 4/7] dt-bindings: pinctrl: add bindings for Mediatek MT8365 SoC Bernhard Rosenkränzer
2022-12-30 20:35 ` [PATCH v6 5/7] dt-bindings: usb: mediatek,mtu3: add MT8365 SoC bindings Bernhard Rosenkränzer
2023-01-03  5:38   ` Chunfeng Yun (云春峰)
2022-12-30 20:35 ` [PATCH v6 6/7] dt-bindings: usb: mediatek,mtk-xhci: " Bernhard Rosenkränzer
2023-01-03  5:43   ` Chunfeng Yun (云春峰)
2022-12-30 20:35 ` [PATCH v6 7/7] arm64: dts: mediatek: Initial mt8365-evk support Bernhard Rosenkränzer
2022-12-30 22:39   ` Marc Zyngier
2023-01-01 21:57     ` Bernhard Rosenkränzer
2023-01-01 22:44       ` Marc Zyngier [this message]
2023-01-03  5:51   ` Chunfeng Yun (云春峰)

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=87sfgteuy0.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=bero@baylibre.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    /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).