From patchwork Fri Dec 10 20:38:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Bounine, Alexandre" X-Patchwork-Id: 75137 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id A8A94B7720 for ; Sat, 11 Dec 2010 07:40:54 +1100 (EST) Received: from mxout1.idt.com (mxout1.idt.com [157.165.5.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mxout1.idt.com", Issuer "idt.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 08081B6F14 for ; Sat, 11 Dec 2010 07:38:49 +1100 (EST) Received: from mail.idt.com (localhost [127.0.0.1]) by mxout1.idt.com (8.13.1/8.13.1) with ESMTP id oBAKcaL9019243; Fri, 10 Dec 2010 12:38:36 -0800 Received: from corpml1.corp.idt.com (corpml1.corp.idt.com [157.165.140.20]) by mail.idt.com (8.13.8/8.13.8) with ESMTP id oBAKcZS0024477; Fri, 10 Dec 2010 12:38:36 -0800 (PST) Received: from corpvpnfw (localhost [127.0.0.1]) by corpml1.corp.idt.com (8.11.7p1+Sun/8.11.7) with SMTP id oBAKcZu25478; Fri, 10 Dec 2010 12:38:35 -0800 (PST) Received: from amak.ott.idt.com ([10.1.0.134]) by corpvpnfw; Fri, 10 Dec 2010 20:38:27 +0000 (GMT) Received: from amak.tundra.com (localhost.localdomain [127.0.0.1]) by amak.tundra.com (8.13.1/8.13.1) with ESMTP id oBAKcQuL031510; Fri, 10 Dec 2010 15:38:26 -0500 Received: (from abounine@localhost) by amak.tundra.com (8.13.1/8.13.1/Submit) id oBAKcQm7031509; Fri, 10 Dec 2010 15:38:26 -0500 From: Alexandre Bounine To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH -mm 1/4] RapidIO: Add definitions of Component Tag fields Date: Fri, 10 Dec 2010 15:38:15 -0500 Message-Id: <1292013498-31406-2-git-send-email-alexandre.bounine@idt.com> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1292013498-31406-1-git-send-email-alexandre.bounine@idt.com> References: <1292013498-31406-1-git-send-email-alexandre.bounine@idt.com> X-Scanned-By: MIMEDefang 2.43 Cc: Alexandre Bounine , Thomas Moll X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Add definition of the unique device identifier field in the component tag. RIO_CTAG_UDEVID does not take all 32 bits of the component tag value to allow future extensions to the component tag use. Selected size of the RIO_CTAG_UDEVID field (17 bits) is sufficient to accommodate maximum number of endpoints in large RIO network (16-bit id) plus switches. Signed-off-by: Alexandre Bounine Cc: Kumar Gala Cc: Matt Porter Cc: Li Yang Cc: Thomas Moll Cc: Micha Nelissen --- drivers/rapidio/rio.c | 2 +- include/linux/rio.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c index c13289e..cc2a3b7 100644 --- a/drivers/rapidio/rio.c +++ b/drivers/rapidio/rio.c @@ -710,7 +710,7 @@ int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg) u32 err_status, em_perrdet, em_ltlerrdet; int rc, portnum; - rdev = rio_get_comptag(pw_msg->em.comptag, NULL); + rdev = rio_get_comptag((pw_msg->em.comptag & RIO_CTAG_UDEVID), NULL); if (rdev == NULL) { /* Device removed or enumeration error */ pr_debug("RIO: %s No matching device for CTag 0x%08x\n", diff --git a/include/linux/rio.h b/include/linux/rio.h index 9b55885..ff681eb 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h @@ -66,6 +66,16 @@ #define RIO_PW_MSG_SIZE 64 +/* + * A component tag value (stored in the component tag CSR) is used as device's + * unique identifier assigned during enumeration. Besides being used for + * identifying switches (which do not have device ID register), it also is used + * by error management notification and therefore has to be assigned + * to endpoints as well. + */ +#define RIO_CTAG_RESRVD 0xfffe0000 /* Reserved */ +#define RIO_CTAG_UDEVID 0x0001ffff /* Unique device identifier */ + extern struct bus_type rio_bus_type; extern struct device rio_bus; extern struct list_head rio_devices; /* list of all devices */