From owner-svn-src-all@freebsd.org Mon Feb 5 07:05:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85121ECBF89; Mon, 5 Feb 2018 07:05:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3898B85D1B; Mon, 5 Feb 2018 07:05:29 +0000 (UTC) (envelope-from adrian@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C93F255F4; Mon, 5 Feb 2018 07:05:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1575TLo051469; Mon, 5 Feb 2018 07:05:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1575T9K051468; Mon, 5 Feb 2018 07:05:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050705.w1575T9K051468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 07:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328873 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328873 X-SVN-Commit-Repository: base 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.25 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, 05 Feb 2018 07:05:29 -0000 Author: adrian Date: Mon Feb 5 07:05:28 2018 New Revision: 328873 URL: https://svnweb.freebsd.org/changeset/base/328873 Log: [arswitch] Enable ATU dump support for the AR9340. This indeed uses the same registers as the AR8216 and later chips. There seems to be an issue with ARP requests being sent out from the CPU through this switch here, so figuring that out is next. Learning works fine on the AR8327 ethernet switch on the /other/ gigabit ethernet port, so I don't think it's the network stack or ethernet driver. Tested: * DB120 - AR9340 SOC + ethernet switch (and other bits.) Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_9340.c Mon Feb 5 07:03:45 2018 (r328872) +++ head/sys/dev/etherswitch/arswitch/arswitch_9340.c Mon Feb 5 07:05:28 2018 (r328873) @@ -120,6 +120,11 @@ ar9340_hw_global_setup(struct arswitch_softc *sc) arswitch_modifyreg(sc->sc_dev, AR934X_REG_FLOOD_MASK, AR934X_FLOOD_MASK_MC_DP(0), AR934X_FLOOD_MASK_MC_DP(0)); +#if 0 + arswitch_modifyreg(sc->sc_dev, AR934X_REG_FLOOD_MASK, + AR934X_FLOOD_MASK_UC_DP(0), + AR934X_FLOOD_MASK_UC_DP(0)); +#endif /* Enable MIB counters */ arswitch_modifyreg(sc->sc_dev, AR8X16_REG_MIB_FUNC0, @@ -183,16 +188,6 @@ ar9340_hw_global_setup(struct arswitch_softc *sc) return (0); } -static int -ar9340_atu_fetch_table(struct arswitch_softc *sc, etherswitch_atu_entry_t *e, - int atu_fetch_op) -{ - - /* XXX TODO */ - return (ENXIO); -} - - /* * The AR9340 switch probes (almost) the same as the AR7240 on-chip switch. * @@ -223,7 +218,12 @@ ar9340_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar9340_hw_setup; sc->hal.arswitch_hw_global_setup = ar9340_hw_global_setup; sc->hal.arswitch_atu_learn_default = ar9340_atu_learn_default; - sc->hal.arswitch_atu_fetch_table = ar9340_atu_fetch_table; + /* + * Note: the ar9340 table fetch code/registers matche + * the ar8216/ar8316 for now because we're not supporting + * static entry programming that includes any of the extra + * bits in the AR9340. + */ /* Set the switch vlan capabilities. */ sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q |