From: James Hogan <jhogan@kernel.org>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
Allan Nielsen <Allan.Nielsen@microsemi.com>,
linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 4/5] MIPS: generic: Add support for Microsemi Ocelot
Date: Wed, 7 Mar 2018 15:47:39 +0000 [thread overview]
Message-ID: <20180307154739.GR4197@saruman> (raw)
In-Reply-To: <20180306121607.1567-5-alexandre.belloni@bootlin.com>
[-- Attachment #1: Type: text/plain, Size: 2843 bytes --]
On Tue, Mar 06, 2018 at 01:16:06PM +0100, Alexandre Belloni wrote:
> diff --git a/arch/mips/Makefile b/arch/mips/Makefile
> index d1ca839c3981..d2882244cf1f 100644
> --- a/arch/mips/Makefile
> +++ b/arch/mips/Makefile
> @@ -543,6 +543,10 @@ generic_defconfig:
> # now that the boards have been converted to use the generic kernel they are
> # wrappers around the generic rules above.
> #
> +.PHONY: ocelot_defconfig
> +ocelot_defconfig:
> + $(Q)$(MAKE) -f $(srctree)/Makefile 32r2el_defconfig BOARDS=ocelot
FYI this conflicts with https://patchwork.linux-mips.org/patch/18596/,
but can be trivially fixed up when applied to the following, so no need
for you to rebase:
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 2ed4c8927701..646a2d98012d 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -565,6 +565,9 @@ generic_defconfig:
# now that the boards have been converted to use the generic kernel they are
# wrappers around the generic rules above.
#
+legacy_defconfigs += ocelot_defconfig
+ocelot_defconfig-y := 32r2el_defconfig BOARDS=ocelot
+
legacy_defconfigs += sead3_defconfig
sead3_defconfig-y := 32r2el_defconfig BOARDS=sead-3
> +
> .PHONY: sead3_defconfig
> sead3_defconfig:
> $(Q)$(MAKE) -f $(srctree)/Makefile 32r2el_defconfig BOARDS=sead-3
> diff --git a/arch/mips/configs/generic/board-ocelot.config b/arch/mips/configs/generic/board-ocelot.config
> new file mode 100644
> index 000000000000..fa4e8988ebc8
> --- /dev/null
> +++ b/arch/mips/configs/generic/board-ocelot.config
> @@ -0,0 +1,36 @@
> +# require CONFIG_32BIT=y
That should be implied now by CPU_SUPPORTS_64BIT_KERNEL=n since
CONFIG_CPU_MIPS32_R2=y.
> +# require CONFIG_CPU_MIPS32_R2=y
> +static __init bool ocelot_detect(void)
> +{
> + u32 rev;
> +
> + rev = __raw_readl((void *)DEVCPU_GCB_CHIP_REGS_CHIP_ID);
How about a TLB check first, a bit like _kvm_mips_host_tlb_inv() in
arch/mips/kvm/tlb.c, i.e.:
int idx;
/* Look for the TLB entry set up by redboot before trying to use it */
write_c0_entryhi(DEVCPU_GCB_CHIP_REGS_CHIP_ID);
mtc0_tlbw_hazard();
tlb_probe();
tlb_probe_hazard();
idx = read_c0_index();
if (idx < 0)
return 0;
/* A TLB entry exists, lets assume its usable and check the CHIP ID */
rev = __raw_readl((void __iomem *)DEVCPU_GCB_CHIP_REGS_CHIP_ID);
(That assumes that if a TLB entry exists that it will be usable, which
isn't technically complete since the entry may not be marked valid, but
its probably sufficient in practice).
Incidentally you need to use __iomem there to avoid the following sparse
error:
arch/mips/generic/board-ocelot.c:21:28: warning: incorrect type in argument 1 (different address spaces)
arch/mips/generic/board-ocelot.c:21:28: expected void const volatile [noderef] <asn:2>*mem
arch/mips/generic/board-ocelot.c:21:28: got void *<noident>
Cheers
James
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-03-07 15:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 12:16 [PATCH v5 0/5] MIPS: add support for Microsemi MIPS SoCs Alexandre Belloni
2018-03-06 12:16 ` [PATCH v5 1/5] dt-bindings: mips: Add bindings for Microsemi SoCs Alexandre Belloni
2018-03-06 12:16 ` [PATCH v5 2/5] MIPS: mscc: add ocelot dtsi Alexandre Belloni
2018-03-07 15:17 ` James Hogan
2018-03-07 15:27 ` Alexandre Belloni
2018-03-07 15:56 ` James Hogan
2018-03-07 16:04 ` Alexandre Belloni
2018-03-07 16:08 ` Rob Herring
2018-03-07 21:49 ` MIPS DT W=1 warnings (was Re: [PATCH v5 2/5] MIPS: mscc: add ocelot dtsi) James Hogan
2018-03-06 12:16 ` [PATCH v5 3/5] MIPS: mscc: add ocelot PCB123 device tree Alexandre Belloni
2018-03-06 12:16 ` [PATCH v5 4/5] MIPS: generic: Add support for Microsemi Ocelot Alexandre Belloni
2018-03-07 15:47 ` James Hogan [this message]
2018-03-06 12:16 ` [PATCH v5 5/5] MAINTAINERS: Add entry for Microsemi MIPS SoCs Alexandre Belloni
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=20180307154739.GR4197@saruman \
--to=jhogan@kernel.org \
--cc=Allan.Nielsen@microsemi.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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