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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC946C4332F for ; Fri, 10 Nov 2023 00:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345453AbjKJAQQ (ORCPT ); Thu, 9 Nov 2023 19:16:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbjKJAQP (ORCPT ); Thu, 9 Nov 2023 19:16:15 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E42A644BB; Thu, 9 Nov 2023 16:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=chR3RzqnvNyrJbpywpEYlJDwHSWzZ2PG7kf4yN80lNA=; b=tKWwBjMuG1FWXmTOOFei9FQ5Mp 0w1GES3hcnOiyY54NhW6dpEOvy3XecPLXICPLMRKcMtnnbv2ZcwREy8dcnnw+6YUbvZTG0v2ARPUg 7hYQGeyfaIUN7CGxGHlOGii9cWavC4SMeuFTF+j4v12dmWDVjW53wXsyOybJvH9VZPgE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r1FBs-001FY5-MY; Fri, 10 Nov 2023 01:16:04 +0100 Date: Fri, 10 Nov 2023 01:16:04 +0100 From: Andrew Lunn To: Christian Marangi Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiner Kallweit , Russell King , Robert Marko , Vladimir Oltean , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next RFC PATCH v6 3/4] net: phy: aquantia: add firmware load support Message-ID: <548eec74-51fb-4cdf-9a04-bb6c65ed912f@lunn.ch> References: <20231109123253.3933-1-ansuelsmth@gmail.com> <20231109123253.3933-3-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231109123253.3933-3-ansuelsmth@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 09, 2023 at 01:32:52PM +0100, Christian Marangi wrote: > From: Robert Marko > > Aquantia PHY-s require firmware to be loaded before they start operating. > It can be automatically loaded in case when there is a SPI-NOR connected > to Aquantia PHY-s or can be loaded from the host via MDIO. > > This patch adds support for loading the firmware via MDIO as in most cases > there is no SPI-NOR being used to save on cost. > Firmware loading code itself is ported from mainline U-boot with cleanups. > > The firmware has mixed values both in big and little endian. > PHY core itself is big-endian but it expects values to be in little-endian. > The firmware is little-endian but CRC-16 value for it is stored at the end > of firmware in big-endian. > > It seems the PHY does the conversion internally from firmware that is > little-endian to the PHY that is big-endian on using the mailbox > but mailbox returns a big-endian CRC-16 to verify the written data > integrity. > > Co-developed-by: Christian Marangi > Signed-off-by: Robert Marko > Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn Andrew