linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: "Paul Burton" <paulburton@kernel.org>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	周琰杰 <zhouyanjie@wanyeetech.com>,
	od@zcrc.me, linux-kernel@vger.kernel.org,
	linux-mips@vger.kernel.org
Subject: Re: [PATCH 06/13] MIPS: generic: Call the machine's .get_system_type callback if provided
Date: Tue, 11 Aug 2020 14:43:10 +0200	[thread overview]
Message-ID: <YNGWEQ.XFIJE749QSY11@crapouillou.net> (raw)
In-Reply-To: <20200803170124.231110-7-paul@crapouillou.net>



Le lun. 3 août 2020 à 19:01, Paul Cercueil <paul@crapouillou.net> a 
écrit :
> Call the machine's .get_system_type callback in the global
> get_system_type() function, if it was provided by the mips_machine
> implementation.
> 
> The get_system_type() function had to be moved within init.c to be 
> able
> to use the static variable "mach". Therefore the proc.c, now empty, 
> has
> been removed.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
>  arch/mips/generic/Makefile |  1 -
>  arch/mips/generic/init.c   | 19 +++++++++++++++++++
>  arch/mips/generic/proc.c   | 25 -------------------------
>  3 files changed, 19 insertions(+), 26 deletions(-)
>  delete mode 100644 arch/mips/generic/proc.c
> 
> diff --git a/arch/mips/generic/Makefile b/arch/mips/generic/Makefile
> index 2384a6b09e4c..f49aeede93c2 100644
> --- a/arch/mips/generic/Makefile
> +++ b/arch/mips/generic/Makefile
> @@ -6,7 +6,6 @@
> 
>  obj-y += init.o
>  obj-y += irq.o
> -obj-y += proc.o
> 
>  obj-$(CONFIG_YAMON_DT_SHIM)		+= yamon-dt.o
>  obj-$(CONFIG_LEGACY_BOARD_SEAD3)	+= board-sead3.o
> diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c
> index 805d0135a9f4..7d82b436939e 100644
> --- a/arch/mips/generic/init.c
> +++ b/arch/mips/generic/init.c
> @@ -207,3 +207,22 @@ void __init arch_init_irq(void)
>  void __init prom_free_prom_memory(void)
>  {
>  }
> +
> +const char *get_system_type(void)
> +{
> +	const char *str;
> +	int err;
> +
> +	if (mach && mach->get_system_type)
> +		return mach->get_system_type(of_root);

The 'mach' variable is __initconst, so there's a section violation 
right here. I'll send a V2.

-Paul

> +
> +	err = of_property_read_string(of_root, "model", &str);
> +	if (!err)
> +		return str;
> +
> +	err = of_property_read_string_index(of_root, "compatible", 0, &str);
> +	if (!err)
> +		return str;
> +
> +	return "Unknown";
> +}
> diff --git a/arch/mips/generic/proc.c b/arch/mips/generic/proc.c
> deleted file mode 100644
> index 4c992809cc3f..000000000000
> --- a/arch/mips/generic/proc.c
> +++ /dev/null
> @@ -1,25 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-or-later
> -/*
> - * Copyright (C) 2016 Imagination Technologies
> - * Author: Paul Burton <paul.burton@mips.com>
> - */
> -
> -#include <linux/of.h>
> -
> -#include <asm/bootinfo.h>
> -
> -const char *get_system_type(void)
> -{
> -	const char *str;
> -	int err;
> -
> -	err = of_property_read_string(of_root, "model", &str);
> -	if (!err)
> -		return str;
> -
> -	err = of_property_read_string_index(of_root, "compatible", 0, &str);
> -	if (!err)
> -		return str;
> -
> -	return "Unknown";
> -}
> --
> 2.27.0
> 



  reply	other threads:[~2020-08-11 12:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 17:01 [PATCH 00/13] MIPS: Convert Ingenic to a generic board Paul Cercueil
2020-08-03 17:01 ` [PATCH 01/13] MIPS: cpu-probe: Set Ingenic's writecombine to _CACHE_CACHABLE_WA Paul Cercueil
2020-08-03 17:01 ` [PATCH 02/13] MIPS: cpu-probe: Mark XBurst CPU as having vtagged caches Paul Cercueil
2020-08-03 17:01 ` [PATCH 03/13] MIPS: cpu-probe: ingenic: Fix broken BUG_ON Paul Cercueil
2020-08-03 17:01 ` [PATCH 04/13] MIPS: Kconfig: add MIPS_GENERIC_KERNEL symbol Paul Cercueil
2020-08-03 17:01 ` [PATCH 05/13] MIPS: machine: Add get_system_type callback Paul Cercueil
2020-08-03 17:01 ` [PATCH 06/13] MIPS: generic: Call the machine's .get_system_type callback if provided Paul Cercueil
2020-08-11 12:43   ` Paul Cercueil [this message]
2020-08-03 17:01 ` [PATCH 07/13] MIPS: generic: Support booting with built-in or appended DTB Paul Cercueil
2020-08-03 17:01 ` [PATCH 08/13] MIPS: generic: Add support for zboot Paul Cercueil
2020-08-03 17:01 ` [PATCH 09/13] MIPS: generic: Increase NR_IRQS to 256 Paul Cercueil
2020-08-03 17:01 ` [PATCH 10/13] MIPS: generic: Add support for Ingenic SoCs Paul Cercueil
2020-08-03 17:01 ` [PATCH 11/13] MIPS: jz4740: Drop folder Paul Cercueil
2020-08-03 17:01 ` [PATCH 12/13] MIPS: configs: Regenerate configs of Ingenic boards Paul Cercueil
2020-08-03 17:01 ` [PATCH 13/13] MAINTAINERS: Update paths to Ingenic platform code Paul Cercueil
2020-08-07 17:22   ` Zhou Yanjie
2020-08-07 17:43     ` Zhou Yanjie
2020-08-07 16:23 ` [PATCH 00/13] MIPS: Convert Ingenic to a generic board Zhou Yanjie
2020-08-07 16:45   ` Paul Cercueil
2020-08-07 17:20     ` Zhou Yanjie
2020-08-08  2:39     ` Jiaxun Yang
2020-08-21 19:23     ` Maciej W. Rozycki
2020-08-21 23:19       ` Paul Cercueil
2020-08-22  2:29         ` Maciej W. Rozycki
2020-08-22 13:17           ` Paul Cercueil
2020-08-22 14:00             ` Maciej W. Rozycki
2020-10-26 14:25           ` Zhou Yanjie

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=YNGWEQ.XFIJE749QSY11@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=od@zcrc.me \
    --cc=paulburton@kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=zhouyanjie@wanyeetech.com \
    /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).