From: "Jiaxun Yang" <jiaxun.yang@flygoat.com>
To: "Serge Semin" <fancer.lancer@gmail.com>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>
Cc: "paulburton@kernel.org" <paulburton@kernel.org>,
"linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 6/6] MIPS: cm: Probe GCR address from DeviceTree
Date: Tue, 10 Sep 2024 20:23:25 +0100 [thread overview]
Message-ID: <79acb1b1-9c1c-4a58-91a5-5dbb286717ec@app.fastmail.com> (raw)
In-Reply-To: <ekvyyq3vzdbyi5suf4irfixyprvtko7rpkffwpc267kiex4ex2@lpu3ctysuviw>
在2024年9月10日九月 下午1:36,Serge Semin写道:
[...]
>
> This causes the kernel boot-up procedure to crash/hang-up because the
> CM GCR base address is supposed to be redefined by means of the
> already mapped CM GCR address space by accessing the
> CM_GCR_BASE_GCRBASE register:
> change_gcr_base()
> +-> read_gcr_base()
> +-> addr_gcr_base()
> +-> return mips_gcr_base + CM_GCR_BASE_GCRBASE
>
> By the time of the change_gcr_base() call in mips_cm_phys_base(), the
> mips_gcr_base variable hasn't been defined. So the IO operations
> performed in the change_gcr_base() method would be accessing the
> NULL-based memory space. That's why the kernel crash/hanging-up.
Thanks for the analysis!
This path was not taken on my audience hardware, so I didn't catch this,
will fix in next version.
>
> In order to fix this we have to first map the CM GCR block at the
> default base-address, then update the CM GCR-base CSR and after that
> remap the CM GCR-space.
>
> Please also note, the GCR_BASE field might be RO. It depends on the
> IP-core configuration. So it's possible that the CM_GCR_BASE_GCRBASE
> field update won't work. Although that will be detected a bit later in
> the mips_cm_probe() method by comparing the address returned from
> mips_cm_phys_base() and retrieved from the CM GCR-base CSR.
Hmm, I just checked RTL and RDL for CM2 and CM3 and I didn't see it as a
configurable option. It's possible to change hardware reset value but not make it RO.
Maybe it was possible on earlier IP release, in this case it's always
user's responsibility to write correct address in DeviceTree :-)
Thanks
>
> -Serge(y)
--
- Jiaxun
next prev parent reply other threads:[~2024-09-10 19:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-12 10:08 [PATCH v2 0/6] MIPS: cm: Probe GCR address from devicetree Jiaxun Yang
2024-06-12 10:08 ` [PATCH v2 1/6] MIPS: generic: Do __dt_setup_arch in prom_init Jiaxun Yang
2024-06-12 10:08 ` [PATCH v2 2/6] MIPS: malta: Move SMP initialisation to device_tree_init Jiaxun Yang
2024-06-12 10:08 ` [PATCH v2 3/6] MIPS: cm: Prefix probe functions with __init Jiaxun Yang
2024-06-12 10:08 ` [PATCH v2 4/6] MIPS: Move mips_cm_probe after prom_init Jiaxun Yang
2024-06-12 10:08 ` [PATCH v2 5/6] dt-bindings: mips: Document mti,mips-cm Jiaxun Yang
2024-06-12 17:01 ` Conor Dooley
2024-08-06 19:56 ` Serge Semin
2024-06-12 10:08 ` [PATCH v2 6/6] MIPS: cm: Probe GCR address from DeviceTree Jiaxun Yang
2024-09-10 12:36 ` Serge Semin
2024-09-10 19:23 ` Jiaxun Yang [this message]
2024-09-10 20:07 ` Serge Semin
2024-09-10 20:48 ` Jiaxun Yang
2024-09-10 22:16 ` Serge Semin
2024-07-06 5:13 ` [PATCH v2 0/6] MIPS: cm: Probe GCR address from devicetree Jiaxun Yang
2024-07-20 7:30 ` Jiaxun Yang
2024-08-06 19:49 ` Serge Semin
2024-09-09 13:32 ` Thomas Bogendoerfer
2024-09-10 8:06 ` Serge Semin
2024-09-10 12:20 ` Serge Semin
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=79acb1b1-9c1c-4a58-91a5-5dbb286717ec@app.fastmail.com \
--to=jiaxun.yang@flygoat.com \
--cc=devicetree@vger.kernel.org \
--cc=fancer.lancer@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=paulburton@kernel.org \
--cc=tsbogend@alpha.franken.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
all inboxes | Powered by JetHome®