From owner-svn-src-all@freebsd.org Mon Sep 12 05:19:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A158BD67A5; Mon, 12 Sep 2016 05:19:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2D91EE7; Mon, 12 Sep 2016 05:19:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8C5Jubw060614; Mon, 12 Sep 2016 05:19:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8C5Jubv060613; Mon, 12 Sep 2016 05:19:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201609120519.u8C5Jubv060613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 12 Sep 2016 05:19:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305726 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2016 05:19:57 -0000 Author: imp Date: Mon Sep 12 05:19:56 2016 New Revision: 305726 URL: https://svnweb.freebsd.org/changeset/base/305726 Log: Report the Silicon Revisions for the AM335x SoCs correctly. Modified: head/sys/arm/ti/ti_cpuid.c Modified: head/sys/arm/ti/ti_cpuid.c ============================================================================== --- head/sys/arm/ti/ti_cpuid.c Mon Sep 12 05:18:30 2016 (r305725) +++ head/sys/arm/ti/ti_cpuid.c Mon Sep 12 05:19:56 2016 (r305726) @@ -201,8 +201,10 @@ static void am335x_get_revision(void) { uint32_t dev_feature; - uint8_t cpu_last_char; + char cpu_last_char; bus_space_handle_t bsh; + int major; + int minor; bus_space_map(fdtbus_bs_tag, AM335X_CONTROL_BASE, AM335X_CONTROL_SIZE, 0, &bsh); chip_revision = bus_space_read_4(fdtbus_bs_tag, bsh, AM335X_CONTROL_DEVICE_ID); @@ -232,8 +234,26 @@ am335x_get_revision(void) cpu_last_char='x'; } - printf("Texas Instruments AM335%c Processor, Revision ES1.%u\n", - cpu_last_char, AM335X_DEVREV(chip_revision)); + switch(AM335X_DEVREV(chip_revision)) { + case 0: + major = 1; + minor = 0; + break; + case 1: + major = 2; + minor = 0; + break; + case 2: + major = 2; + minor = 1; + break; + default: + major = 0; + minor = AM335X_DEVREV(chip_revision); + break; + } + printf("Texas Instruments AM335%c Processor, Revision ES%u.%u\n", + cpu_last_char, major, minor); } /**