From owner-svn-src-head@FreeBSD.ORG Sun Mar 2 05:47:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A4534CD; Sun, 2 Mar 2014 05:47:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1365D1D39; Sun, 2 Mar 2014 05:47:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s225l5mZ078340; Sun, 2 Mar 2014 05:47:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s225l5YY078339; Sun, 2 Mar 2014 05:47:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403020547.s225l5YY078339@svn.freebsd.org> From: Adrian Chadd Date: Sun, 2 Mar 2014 05:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262680 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 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: Sun, 02 Mar 2014 05:47:06 -0000 Author: adrian Date: Sun Mar 2 05:47:05 2014 New Revision: 262680 URL: http://svnweb.freebsd.org/changeset/base/262680 Log: Add AR8216 era ATU management/configuration register definitions. Obtained from: OpenWRT Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Sun Mar 2 03:34:06 2014 (r262679) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Sun Mar 2 05:47:05 2014 (r262680) @@ -38,6 +38,11 @@ #define SM(_v, _f) (((_v) << _f##_S) & (_f)) #define MS(_v, _f) (((_v) & (_f)) >> _f##_S) +/* XXX Linux define compatibility stuff */ +#define BIT(_m) (1UL << (_m)) +#define BITM(_count) ((1UL << (_count)) - 1) +#define BITS(_shift, _count) (BITM(_count) << (_shift)) + /* Atheros specific MII registers */ #define MII_ATH_MMD_ADDR 0x0d #define MII_ATH_MMD_DATA 0x0e @@ -119,10 +124,34 @@ #define AR8X16_VLAN_MEMBER 0x0000003f #define AR8X16_VLAN_VALID (1 << 11) -#define AR8X16_REG_ARL_CTRL0 0x0050 -#define AR8X16_REG_ARL_CTRL1 0x0054 +#define AR8216_REG_ATU 0x0050 +#define AR8216_ATU_OP BITS(0, 3) +#define AR8216_ATU_OP_NOOP 0x0 +#define AR8216_ATU_OP_FLUSH 0x1 +#define AR8216_ATU_OP_LOAD 0x2 +#define AR8216_ATU_OP_PURGE 0x3 +#define AR8216_ATU_OP_FLUSH_LOCKED 0x4 +#define AR8216_ATU_OP_FLUSH_UNICAST 0x5 +#define AR8216_ATU_OP_GET_NEXT 0x6 +#define AR8216_ATU_ACTIVE BIT(3) +#define AR8216_ATU_PORT_NUM BITS(8, 4) +#define AR8216_ATU_FULL_VIO BIT(12) +#define AR8216_ATU_ADDR4 BITS(16, 8) +#define AR8216_ATU_ADDR5 BITS(24, 8) + +#define AR8216_REG_ATU_DATA 0x0054 +#define AR8216_ATU_ADDR3 BITS(0, 8) +#define AR8216_ATU_ADDR2 BITS(8, 8) +#define AR8216_ATU_ADDR1 BITS(16, 8) +#define AR8216_ATU_ADDR0 BITS(24, 8) + #define AR8X16_REG_ARL_CTRL2 0x0058 +#define AR8216_REG_ATU_CTRL 0x005C +#define AR8216_ATU_CTRL_AGE_EN BIT(17) +#define AR8216_ATU_CTRL_AGE_TIME BITS(0, 16) +#define AR8216_ATU_CTRL_AGE_TIME_S 0 + #define AR8X16_REG_AT_CTRL 0x005c #define AR8X16_AT_CTRL_ARP_EN (1 << 20) @@ -295,10 +324,6 @@ * AR9340 switch specific definitions. */ -/* XXX Linux define compatibility stuff */ -#define BITM(_count) ((1UL << _count) - 1) -#define BITS(_shift, _count) (BITM(_count) << _shift) - #define AR934X_REG_OPER_MODE0 0x04 #define AR934X_OPER_MODE0_MAC_GMII_EN (1 << 6) #define AR934X_OPER_MODE0_PHY_MII_EN (1 << 10)