Re: [PATCH 3/4] MIPS: ralink: add support for MT7620n

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

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

This is the small version of MT7620a.

Signed-off-by: John Crispin <blogic@xxxxxxxxxxx>
---
  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






[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux