Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: linux-mips@linux-mips.org
Cc: John Crispin <john@phrozen.org>,
	Stanislaw Gruszka <sgruszka@redhat.com>,
	Tom Psyborg <pozega.tomislav@gmail.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	Gabor Juhos <juhosg@freemail.hu>,
	Paul Burton <paul.burton@mips.com>
Subject: [PATCH] mips: ralink: add accessors for MT7620 chipver and pkg
Date: Fri, 2 Nov 2018 03:07:19 +0100	[thread overview]
Message-ID: <20181102020713.GA880@makrotopia.org> (raw)
In-Reply-To: <20181016103806.GA1544@makrotopia.org>

The RT6352 wireless core included in all MT7620 chips is implemented
differently in MT7620A (TFBGA) and MT7620N (DR-QFN).
Hence provide accessor functions similar to the already existing
mt7620_get_eco() function which allow the rt2x00 wireless driver to
figure out which WiSoC it is being run on.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 arch/mips/include/asm/mach-ralink/mt7620.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/mips/include/asm/mach-ralink/mt7620.h b/arch/mips/include/asm/mach-ralink/mt7620.h
index 66af4ccb5c6c..d0310a92a63f 100644
--- a/arch/mips/include/asm/mach-ralink/mt7620.h
+++ b/arch/mips/include/asm/mach-ralink/mt7620.h
@@ -137,4 +137,16 @@ static inline int mt7620_get_eco(void)
 	return rt_sysc_r32(SYSC_REG_CHIP_REV) & CHIP_REV_ECO_MASK;
 }
 
+static inline int mt7620_get_chipver(void)
+{
+	return (rt_sysc_r32(SYSC_REG_CHIP_REV) >> CHIP_REV_VER_SHIFT) &
+		CHIP_REV_VER_MASK;
+}
+
+static inline int mt7620_get_pkg(void)
+{
+	return (rt_sysc_r32(SYSC_REG_CHIP_REV) >> CHIP_REV_PKG_SHIFT) &
+		CHIP_REV_PKG_MASK;
+}
+
 #endif
-- 
2.19.1

  reply	other threads:[~2018-11-02  2:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1539334591-9965-1-git-send-email-sgruszka@redhat.com>
     [not found] ` <1539334591-9965-5-git-send-email-sgruszka@redhat.com>
     [not found]   ` <CAKR_QVJ60VTDjyC59BEDsRKrKR495xjGwob0QqvX333L+L+=Zg@mail.gmail.com>
     [not found]     ` <20181016081115.GA4401@redhat.com>
2018-10-16 10:38       ` [PATCH v4 4/8] rt2800: fix registers init for MT7620 Daniel Golle
2018-11-02  2:07         ` Daniel Golle [this message]
2018-11-05 18:36           ` [PATCH] mips: ralink: add accessors for MT7620 chipver and pkg Paul Burton
2018-11-05 20:19             ` Daniel Golle
2018-11-05 23:05               ` Paul Burton
2018-11-05 23:27                 ` Tom Psyborg

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=20181102020713.GA880@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=john@phrozen.org \
    --cc=juhosg@freemail.hu \
    --cc=linux-mips@linux-mips.org \
    --cc=paul.burton@mips.com \
    --cc=pozega.tomislav@gmail.com \
    --cc=ralf@linux-mips.org \
    --cc=sgruszka@redhat.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