Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp893664rdb; Wed, 1 Nov 2023 06:05:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEr14zv6bxqbIzRZ4OzAk662X5p+9288t7cJwNwyv4spNNuLqSWZusmqp/ThnXdyhsY/RJP X-Received: by 2002:a5e:c914:0:b0:79d:27ef:23c3 with SMTP id z20-20020a5ec914000000b0079d27ef23c3mr2034675iol.5.1698843902138; Wed, 01 Nov 2023 06:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698843902; cv=none; d=google.com; s=arc-20160816; b=fwX1yivjLh7BArZPEZ2AzQo1UVQUxMcrXFdm8ug2DpNfDEPb9xLOmwgmDk7E00zVO4 naTVLsvOsbDDh+Vy0osMLIeKqs5MUiasDOwyUDXwr6DZjq0D/MJn4iboaub6/hnaEbLc i/Z7Nm5DdU2LwjPj1WF2/tlxuEKpD+Va40DuS0vwFslkWNb8z52uNICJsMfWuwNNNuh3 ALKqZjy0tK0IKkm4JTRqo1y5PSbPMtFKBXiYpMyU8akM7NLX2lSePb5g0N51uuhyEjnQ RyGhhE/bQvGtlGoYpEGC/U9bmdWsY6OC2qvDDyT3DJn41Asoc7y4buUlabpmn2M09yBc w7GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:subject:cc:to:from:date:message-id:dkim-signature; bh=zoHYYOTWYndoQBZFoxc6RIjyMuCKUCTERW3y4krGlPk=; fh=Ft3Bi1VxL0RsKzi3pAwiW4xrC4S9D2sqUjDO9ScRCK8=; b=dwtweBFhgAkpUGkmYo6wM+iHwvi4nBFiQnf0sF+IwKTIkQ/4oS38CfdILopwdUCK3+ bLdNrB9PMVGey0hzxEhwWXPB/DXyvIZs7snSFM8NggdxUy3heYTMEIaaOdGYFPPLurnS EHPvFbnV4jSfeJ5eCMeZtAiCD0OwTkv/lV3yUp5+xZlyQX+rZP097Ok7U0MRW10JsXwu DJR5lcrYoBZ4b1KFiUer6GsUbiT94cIiKmrroioakwYTuZsXt7oj+vxYTrgztqSCklvY NcuAqhyYNCwJFIwPGDtBjwsKvfNFDxkWfSln94XUSwk7gjni7JSJUpwvSuemT3CLYVOr STaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HppfvHQs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id v3-20020a6b6103000000b007a26ebae040si1329049iob.105.2023.11.01.06.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 06:05:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HppfvHQs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E27E08032B8E; Wed, 1 Nov 2023 06:04:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343771AbjKANEp (ORCPT + 99 others); Wed, 1 Nov 2023 09:04:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231667AbjKANEn (ORCPT ); Wed, 1 Nov 2023 09:04:43 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34087DC; Wed, 1 Nov 2023 06:04:41 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-408002b5b9fso48829205e9.3; Wed, 01 Nov 2023 06:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698843879; x=1699448679; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=zoHYYOTWYndoQBZFoxc6RIjyMuCKUCTERW3y4krGlPk=; b=HppfvHQs7G1SKSYKT6uPrpSZ3Nd60cN31HXXoOUyfVu4SBdnpBDjdOKMmUBBIKIOSK +iTCABZITixfe60rsEWK8DtNDFgM8WObPYjKyYKmDoiWXxLHLULA3lSW2M2TKmXk0Min u4EpyI5FIUy+BYUQkVijNqZzbWJcjBObuzZbiMK9GiynDgCvfQuC2vEFyD0mJZS+ZhFJ BAsvmXZIcPniufItEc7GqZZiMe+UPwsJUQ+V4pCqtLS6UvK2Hk9x7T/ut5ebumVzdo7y 5dsQQ4UTK5Py5X/heQkp/Dq8Pp9NTMR1aWf12zV2NOLDW24dgMJQx1zEoNxjYkqOz0Ur LFnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698843879; x=1699448679; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=zoHYYOTWYndoQBZFoxc6RIjyMuCKUCTERW3y4krGlPk=; b=LTnB7nH8BaCNk2a0z8A5XPMde5PNpn+L8A6p/Ymb2WXL2ppomux6cEg7jGaJMTO2sD My5qYhJiCMsmqddlw4kLPXe5L420mW+E4qyNdg25iwF2Yqom2p8T/Xqxq4m11IvYTGvC 3g5/zyVi6NCpBx0tUqah5xd6epIUOQWeVje18mW4O92C7qec2GsEqmpfCshtPN1n46/J CKLIsBgLoJsXXKC/r/yH65TsBJhyAEiKAY1gQ8JPa8ZIewagZg4SzR1LJquKR4BgKU3C t/QBjuW/+e43DKnQCIqVf25HL1LtVKaOwSFRkQxh3xgZcs8mZ1A1dIhreEEp+dK0HJYP UrOQ== X-Gm-Message-State: AOJu0YxhEobeEGRU1skOCPBmpVlCVNw7VOw5i5UoAh6t0q82/HZAWbog IBQuH0pt9XEV2TDP4xqoo9A= X-Received: by 2002:adf:d1e1:0:b0:32f:7fa0:558 with SMTP id g1-20020adfd1e1000000b0032f7fa00558mr13342254wrd.49.1698843879187; Wed, 01 Nov 2023 06:04:39 -0700 (PDT) Received: from Ansuel-xps. (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.gmail.com with ESMTPSA id v7-20020a5d6107000000b0032da49e18fasm4123612wrt.23.2023.11.01.06.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 06:04:25 -0700 (PDT) Message-ID: <65424cd9.5d0a0220.20d9a.fe0f@mx.google.com> X-Google-Original-Message-ID: Date: Wed, 1 Nov 2023 13:57:53 +0100 From: Christian Marangi To: Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Marko Subject: Re: [net-next PATCH v2 1/2] net: phy: aquantia: add firmware load support References: <20231101123608.11157-1-ansuelsmth@gmail.com> <5af21f93-bb2d-42b1-b4d4-ee4443ffaff9@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5af21f93-bb2d-42b1-b4d4-ee4443ffaff9@gmail.com> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 06:04:49 -0700 (PDT) On Wed, Nov 01, 2023 at 02:01:33PM +0100, Heiner Kallweit wrote: > On 01.11.2023 13:36, 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 > > --- > > Changes v2: > > - Move out of RFC > > - Address sanity check for offsets > > - Add additional comments on firmware load check > > - Fix some typo > > - Capitalize CRC in comments > > - Rename load_sysfs to load_fs > > > > To make the driver better maintainable: can the firmware handling code > be placed in a separate source code file, similar to what has been done > for the hwmon part? > If yes, then this could also be the right time to move the aquantia > driver to an own subdirectory. > Sure! Np for me just is it really worth it? hwmod is a bigger one but this is really a few functions. Anyway if requested, I will move in v3 the driver to a dedicated directory and move the function to a separate file! -- Ansuel