From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B66B6C2B9F7 for ; Tue, 25 May 2021 02:19:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 94CB16141E for ; Tue, 25 May 2021 02:19:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbhEYCU5 (ORCPT ); Mon, 24 May 2021 22:20:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230115AbhEYCUz (ORCPT ); Mon, 24 May 2021 22:20:55 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9BB9C061574 for ; Mon, 24 May 2021 19:19:25 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id a7so6890726plh.3 for ; Mon, 24 May 2021 19:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PtMKv8H8fr0/cGUPfPuqk5XV9KgBYgm65hebSFoOV3s=; b=YqbqjeuWsUB5kt3eTTsLdf73fha29fSbbR8U0dPfLee+CaM0lwoqrEq+kGspYq9hTp 8DZq9ErV3zLOTLkSjYid9FVWsftnR+bKRNXXP1Lx929SEeXz+SbzW9ctaLAENRXhGoYp 6zMlpsTd3qQix/78VyX6mFDM64AkNFAE1msfTCwpo24/RXN6YrD5CPJuRzYOnz66LSr5 f9anP+9Uns2cUvTKXUfdS44Cx/cFS6RC7N4hnsyQt9CJTaD79R3pNId9TCHZH0WIhM/s qhnq63EAqmGuJF7x4TTkez15Zhhe3cVFZ0MpVbUK9RLzOCckgNkZU2UI3glRwCV1eSOL HwHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PtMKv8H8fr0/cGUPfPuqk5XV9KgBYgm65hebSFoOV3s=; b=ki47HLn56BJu6faGZpS/OxdHLIHQZPOCkxBWYTDAvHemRojtohsdzTfPtrctk2x3Iy ODVyiOFM1BloTyCDxc8yJhaniTjFOkpp3SZUEAjsHSvh+lImtFby3jKwZ3WvUvkSf8Cb IiKPgxpEofJRywhODDTS5Ox8OwOH6pjTrG8de5WZsPK2VorQMOr/E2H4yKlpBznjM0hc CfPKB/ZHCF/fy1TkfCf3wBNX0iQ4o8lTD5IMugRSOOWpaVmciNAGbIomnuKW+BuYBwLa lJpihsJtv80FCIRYr3GLAxDp8ZnpMP5uy3pGQfVO1CFHAhzVCDPDdyHplWY3ym73r/wY 5r6w== X-Gm-Message-State: AOAM533m8VLgHzPlm8DpOSfWw9BhMTWSxYEtb3yH/8098m26ep+cWROs U0M9B/95jY69ACaG14Df2es= X-Google-Smtp-Source: ABdhPJww4k2paLPRiHAxnjlbHHeGUZSES6TNWsXllyLTXa7kYh+zH5kBy+ILMMLrZk5uALlfS5iOyA== X-Received: by 2002:a17:902:ce90:b029:f7:72be:b420 with SMTP id f16-20020a170902ce90b02900f772beb420mr18662583plg.67.1621909165423; Mon, 24 May 2021 19:19:25 -0700 (PDT) Received: from [10.230.29.202] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id e22sm5640744pfl.188.2021.05.24.19.19.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 May 2021 19:19:24 -0700 (PDT) Subject: Re: [PATCH net-next 03/13] net: dsa: sja1105: the 0x1F0000 SGMII "base address" is actually MDIO_MMD_VEND2 To: Vladimir Oltean , Jakub Kicinski , "David S. Miller" , netdev@vger.kernel.org Cc: Andrew Lunn , Vivien Didelot , Vladimir Oltean References: <20210524232214.1378937-1-olteanv@gmail.com> <20210524232214.1378937-4-olteanv@gmail.com> From: Florian Fainelli Message-ID: <65e73b63-2c9b-b847-9221-91f23d2511d3@gmail.com> Date: Mon, 24 May 2021 19:19:17 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210524232214.1378937-4-olteanv@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 5/24/2021 4:22 PM, Vladimir Oltean wrote: > From: Vladimir Oltean > > Looking at the SGMII PCS from SJA1110, which is accessed indirectly > through a different base address as can be seen in the next patch, it > appears odd that the address accessed through indirection still > references the base address from the SJA1105S register map (first MDIO > register is at 0x1f0000), when it could index the SGMII registers > starting from zero. > > Except that the 0x1f0000 is not a base address at all, it seems. It is > 0x1f << 16 | 0x0000, and 0x1f is coding for the vendor-specific MMD2. > So, it turns out, the Synopsys PCS implements all its registers inside > the vendor-specific MMDs 1 and 2 (0x1e and 0x1f). This explains why the > PCS has no overlaps (for the other MMDs) with other register regions of > the switch (because no other MMDs are implemented). > > Change the code to remove the SGMII "base address" and explicitly encode > the MMD for reads/writes. This will become necessary for SJA1110 support. > > Signed-off-by: Vladimir Oltean > --- [snip] > > @@ -1905,7 +1904,9 @@ int sja1105_static_config_reload(struct sja1105_private *priv, > mac[i].speed = SJA1105_SPEED_AUTO; > > if (sja1105_supports_sgmii(priv, i)) > - bmcr[i] = sja1105_sgmii_read(priv, i, MII_BMCR); > + bmcr[i] = sja1105_sgmii_read(priv, i, > + MDIO_MMD_VEND2, > + MDIO_CTRL1); This appears different from what you had before? -- Florian