linux-mips
[Top] [All Lists]

Re: [PATCH 17/18] MIPS: Netlogic: XLP9XX PIC OF support

To: Jayachandran C <jchandra@broadcom.com>
Subject: Re: [PATCH 17/18] MIPS: Netlogic: XLP9XX PIC OF support
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Tue, 15 Oct 2013 16:28:36 +0400
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
In-reply-to: <1381756874-22616-18-git-send-email-jchandra@broadcom.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1381756874-22616-1-git-send-email-jchandra@broadcom.com> <1381756874-22616-18-git-send-email-jchandra@broadcom.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
Hello.

On 14-10-2013 17:21, Jayachandran C wrote:

Support for adding legacy IRQ domain for XLP9XX. The node id of the
PIC has to be calulated differently for XLP9XX.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
---
  arch/mips/netlogic/common/irq.c |   28 ++++++++++++++++++++++++----
  1 file changed, 24 insertions(+), 4 deletions(-)

diff --git a/arch/mips/netlogic/common/irq.c b/arch/mips/netlogic/common/irq.c
index 8092bb3..34be9bb 100644
--- a/arch/mips/netlogic/common/irq.c
+++ b/arch/mips/netlogic/common/irq.c
[...]
@@ -293,7 +292,28 @@ static int __init xlp_of_pic_init(struct device_node *node,
                pr_err("PIC %s: reg property not found!\n", node->name);
                return -EINVAL;
        }
-       socid = (res.start >> 18) & 0x3;
+
+       if (cpu_is_xlp9xx()) {
+               bus = (res.start >> 20) & 0xf;
+               for (socid = 0; socid < NLM_NR_NODES; socid++) {
+                       if (!nlm_node_present(socid))
+                               continue;
+                       if (nlm_get_node(socid)->socbus == bus)
+                               break;
+               }
+               if (socid == NLM_NR_NODES) {
+                       pr_err("PIC %s: Node mapping for bus %d not found!n",
+                                       node->name, bus);
+                       return -EINVAL;
+               }
+       } else
+               socid = (res.start >> 18) & 0x3;

Both arms of the *if* statement should have {} if one arm has it, according to Documentation/CodingStyle.

WBR, Sergei


<Prev in Thread] Current Thread [Next in Thread>