From owner-svn-src-head@FreeBSD.ORG Mon Jul 9 10:24:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1732106564A; Mon, 9 Jul 2012 10:24:45 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C35358FC14; Mon, 9 Jul 2012 10:24:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q69AOjl8010384; Mon, 9 Jul 2012 10:24:45 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q69AOjmc010381; Mon, 9 Jul 2012 10:24:45 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201207091024.q69AOjmc010381@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 9 Jul 2012 10:24:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238290 - head/sys/mips/nlm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 10:24:46 -0000 Author: jchandra Date: Mon Jul 9 10:24:45 2012 New Revision: 238290 URL: http://svn.freebsd.org/changeset/base/238290 Log: Identify Netlogic XLP 8xx B1 chip revisions Add functions to check for 8xx B0 and 3xx Ax revisions which will be used in network block initialization. Modified: head/sys/mips/nlm/board.c head/sys/mips/nlm/xlp.h Modified: head/sys/mips/nlm/board.c ============================================================================== --- head/sys/mips/nlm/board.c Mon Jul 9 10:17:06 2012 (r238289) +++ head/sys/mips/nlm/board.c Mon Jul 9 10:24:45 2012 (r238290) @@ -362,6 +362,8 @@ nlm_print_processor_info(void) revstr = "A2"; break; case 3: revstr = "B0"; break; + case 4: + revstr = "B1"; break; default: revstr = "??"; break; } Modified: head/sys/mips/nlm/xlp.h ============================================================================== --- head/sys/mips/nlm/xlp.h Mon Jul 9 10:17:06 2012 (r238289) +++ head/sys/mips/nlm/xlp.h Mon Jul 9 10:24:45 2012 (r238290) @@ -57,6 +57,7 @@ #define XLP_REVISION_A1 0x01 #define XLP_REVISION_A2 0x02 #define XLP_REVISION_B0 0x03 +#define XLP_REVISION_B1 0x04 #ifndef LOCORE /* @@ -87,6 +88,16 @@ static __inline int nlm_is_xlp3xx(void) return (nlm_processor_id() == CHIP_PROCESSOR_ID_XLP_3XX); } +static __inline int nlm_is_xlp3xx_ax(void) +{ + uint32_t procid = mips_rd_prid(); + int prid = (procid >> 8) & 0xff; + int rev = procid & 0xff; + + return (prid == CHIP_PROCESSOR_ID_XLP_3XX && + rev < XLP_REVISION_B0); +} + static __inline int nlm_is_xlp4xx(void) { int prid = nlm_processor_id(); @@ -116,5 +127,17 @@ static __inline int nlm_is_xlp8xx_ax(voi (rev < XLP_REVISION_B0)); } +static __inline int nlm_is_xlp8xx_b0(void) +{ + uint32_t procid = mips_rd_prid(); + int prid = (procid >> 8) & 0xff; + int rev = procid & 0xff; + + return ((prid == CHIP_PROCESSOR_ID_XLP_8XX || + prid == CHIP_PROCESSOR_ID_XLP_432 || + prid == CHIP_PROCESSOR_ID_XLP_416) && + rev == XLP_REVISION_B0); +} + #endif /* LOCORE */ #endif /* __NLM_XLP_H__ */