All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: John Crispin <blogic@openwrt.org>, Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Subject: Re: [PATCH 3/4] MIPS: ralink: add support for MT7620n
Date: Fri, 10 Oct 2014 14:08:32 +0400	[thread overview]
Message-ID: <5437B020.3000405@cogentembedded.com> (raw)
In-Reply-To: <1412927388-60721-4-git-send-email-blogic@openwrt.org>

Hello.

On 10/10/2014 11:49 AM, John Crispin wrote:

> This is the small version of MT7620a.

> Signed-off-by: John Crispin <blogic@openwrt.org>
> ---
>   arch/mips/include/asm/mach-ralink/mt7620.h |    7 ++-----
>   arch/mips/ralink/mt7620.c                  |   20 +++++++++++++-------
>   2 files changed, 15 insertions(+), 12 deletions(-)

[...]

> diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c
> index 24fb40a..e4b1f82 100644
> --- a/arch/mips/ralink/mt7620.c
> +++ b/arch/mips/ralink/mt7620.c
[...]
> @@ -298,22 +299,27 @@ void prom_soc_init(struct ralink_soc_info *soc_info)
>   	u32 cfg0;
>   	u32 pmu0;
>   	u32 pmu1;
> +	u32 bga;
>
>   	n0 = __raw_readl(sysc + SYSC_REG_CHIP_NAME0);
>   	n1 = __raw_readl(sysc + SYSC_REG_CHIP_NAME1);
> +	rev = __raw_readl(sysc + SYSC_REG_CHIP_REV);
> +	bga = (rev >> CHIP_REV_PKG_SHIFT) & CHIP_REV_PKG_MASK;
>
> -	if (n0 == MT7620N_CHIP_NAME0 && n1 == MT7620N_CHIP_NAME1) {
> -		name = "MT7620N";
> -		soc_info->compatible = "ralink,mt7620n-soc";
> -	} else if (n0 == MT7620A_CHIP_NAME0 && n1 == MT7620A_CHIP_NAME1) {
> +	if (n0 != MT7620_CHIP_NAME0 || n1 != MT7620_CHIP_NAME1)
> +		panic("mt7620: unknown SoC, n0:%08x n1:%08x\n", n0, n1);
> +
> +	if (bga) {
>   		name = "MT7620A";
>   		soc_info->compatible = "ralink,mt7620a-soc";
>   	} else {
> -		panic("mt7620: unknown SoC, n0:%08x n1:%08x", n0, n1);
> +		name = "MT7620N";
> +		soc_info->compatible = "ralink,mt7620n-soc";
> +#ifdef CONFIG_PCI

    I suggest:

		if (IS_ENABLED(CONFIG_PCI))

in order to avoid this #ifdef.

[...]

WBR, Sergei

  reply	other threads:[~2014-10-10 10:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  7:49 [PATCH 0/4] add mt7620n and mt7628an support John Crispin
2014-10-10  7:49 ` [PATCH 1/4] MIPS: ralink: cleanup early_printk John Crispin
2014-10-10  7:49 ` [PATCH 2/4] MIPS: ralink: allow loading irq registers from the devicetree John Crispin
2014-10-10  7:49 ` [PATCH 3/4] MIPS: ralink: add support for MT7620n John Crispin
2014-10-10 10:08   ` Sergei Shtylyov [this message]
2014-10-10 10:21     ` John Crispin
2014-10-10  7:49 ` [PATCH 4/4] MIPS: ralink: add mt7628an support John Crispin

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=5437B020.3000405@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=blogic@openwrt.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.