From owner-svn-src-stable@freebsd.org Fri Dec 30 20:18:51 2016 Return-Path: Delivered-To: svn-src-stable@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 BB640C97CC0; Fri, 30 Dec 2016 20:18:51 +0000 (UTC) (envelope-from loos@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 95F5E169A; Fri, 30 Dec 2016 20:18:51 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUKIoDJ076912; Fri, 30 Dec 2016 20:18:50 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUKIofF076909; Fri, 30 Dec 2016 20:18:50 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612302018.uBUKIofF076909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Dec 2016 20:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r310855 - in stable/11/sys/arm/ti: am335x cpsw X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 20:18:51 -0000 Author: loos Date: Fri Dec 30 20:18:50 2016 New Revision: 310855 URL: https://svnweb.freebsd.org/changeset/base/310855 Log: MFC of r305112, r305113, r305119, r305141 and r305432: Replace magic numbers with the proper register names. Fix the build, revert r305119, move the control module register data to am335x_scm.h and fix if_cpsw.c to include the correct header. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/11/sys/arm/ti/am335x/am335x_prcm.c stable/11/sys/arm/ti/am335x/am335x_scm.h stable/11/sys/arm/ti/cpsw/if_cpsw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_prcm.c Fri Dec 30 20:16:09 2016 (r310854) +++ stable/11/sys/arm/ti/am335x/am335x_prcm.c Fri Dec 30 20:18:50 2016 (r310855) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include +#include "am335x_scm.h" + #define CM_PER 0 #define CM_PER_L4LS_CLKSTCTRL (CM_PER + 0x000) #define CM_PER_L3S_CLKSTCTRL (CM_PER + 0x004) @@ -619,10 +621,9 @@ am335x_clk_get_sysclk_freq(struct ti_clo { uint32_t ctrl_status; - /* Read the input clock freq from the control module */ - /* control_status reg (0x40) */ - if (ti_scm_reg_read_4(0x40, &ctrl_status)) - return ENXIO; + /* Read the input clock freq from the control module. */ + if (ti_scm_reg_read_4(SCM_CTRL_STATUS, &ctrl_status)) + return (ENXIO); switch ((ctrl_status>>22) & 0x3) { case 0x0: Modified: stable/11/sys/arm/ti/am335x/am335x_scm.h ============================================================================== --- stable/11/sys/arm/ti/am335x/am335x_scm.h Fri Dec 30 20:16:09 2016 (r310854) +++ stable/11/sys/arm/ti/am335x/am335x_scm.h Fri Dec 30 20:18:50 2016 (r310855) @@ -29,10 +29,13 @@ #define __AM335X_SCM_H__ /* AM335x-specific registers for control module (scm) */ +#define SCM_CTRL_STATUS 0x40 #define SCM_USB_CTRL0 0x620 #define SCM_USB_STS0 0x624 #define SCM_USB_CTRL1 0x628 #define SCM_USB_STS1 0x62C +#define SCM_MAC_ID0_LO 0x630 +#define SCM_MAC_ID0_HI 0x634 #define SCM_PWMSS_CTRL 0x664 #endif /* __AM335X_SCM_H__ */ Modified: stable/11/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:16:09 2016 (r310854) +++ stable/11/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 30 20:18:50 2016 (r310855) @@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -87,8 +90,6 @@ __FBSDID("$FreeBSD$"); #include "if_cpswreg.h" #include "if_cpswvar.h" - -#include #include "miibus_if.h" @@ -1019,14 +1020,14 @@ cpswp_attach(device_t dev) IFQ_SET_READY(&ifp->if_snd); /* Get high part of MAC address from control module (mac_id[0|1]_hi) */ - ti_scm_reg_read_4(0x634 + sc->unit * 8, ®); + ti_scm_reg_read_4(SCM_MAC_ID0_HI + sc->unit * 8, ®); mac_addr[0] = reg & 0xFF; mac_addr[1] = (reg >> 8) & 0xFF; mac_addr[2] = (reg >> 16) & 0xFF; mac_addr[3] = (reg >> 24) & 0xFF; /* Get low part of MAC address from control module (mac_id[0|1]_lo) */ - ti_scm_reg_read_4(0x630 + sc->unit * 8, ®); + ti_scm_reg_read_4(SCM_MAC_ID0_LO + sc->unit * 8, ®); mac_addr[4] = reg & 0xFF; mac_addr[5] = (reg >> 8) & 0xFF;