Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp890839rdb; Wed, 1 Nov 2023 06:02:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkLb+DqQmQpp6XrSEF1Iw+HL6HLEZ7hL6eMdNB4nYkO5C1RY1WUtMramy0vEBkSwINZbD6 X-Received: by 2002:a17:90b:1941:b0:280:23ef:b7fd with SMTP id nk1-20020a17090b194100b0028023efb7fdmr8853096pjb.19.1698843729591; Wed, 01 Nov 2023 06:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698843729; cv=none; d=google.com; s=arc-20160816; b=LEiSeiv18N6pi83jhUaP8VS1Nq//WRZYXV6aVlwO5vA8NB35B1q2GTLvZrZIRVt3Au 16sNxu1k9NG2tdOGbjVmYpGZUZaFA+gwo4PzXg3CGjR42bZC/ffZst0ZMB7AiCqeijKQ C3owuoL80lRTHz5hq9Km0+IVnqyhqrioWymj+XkU9OOQb4vd/Tq5aE7h4KPadZKprVtN eT1+lj2BKQc4uOBLVhwb92ja/frxUiVMErNIMqbRZ46kdppuldqYtVk8nvOObzxhCqoJ dPwgxdn2e4F2JQbLZdsGGN4CPIxlKlg8zSPF6Z9JZR/UPLIdZixc8ceeNRb8T69zcplE 5bKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=tLnRbhbdsdPLZ1Nf0yZZoZdfpMaZmBV3/I942pnqjQw=; fh=VyafZBUeAhmHNIRGDVYNV/Zeo9bsBj6UKk2LY+vdul0=; b=mZeAsFpOeNVwYFixqkGLS8GjuXkW+L0QppgTb2FSEPpbH5e2n3x9CPlc2atv+F7PGQ sXF5btfmNJencPSAt2dXFOJV3QB+rkRuH06ADdFTZ6JRCwcG/+jPUurDp+qARGcWzcq2 pzo3F6JakoNldRXMRqRQtBsKgRTsETbaQ2x+WaFX9tTdwLW+FhJXhw9WeALFZ+EgGZfJ kmvI7sHY6MtgxfycbLlN8sdaVPERprNwOJQlhDTHnz2esZE2vs+3ZAfOkszEQVwb5SGd VB0CFLb4U4jrAKvBEUBwtWQQIAnFHi7qpeuiesG+u/yP8zDgmLhBKPwBol9z7hYUv8J+ fGuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=M+0nXtL3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id oo18-20020a17090b1c9200b00252d84b7af0si806451pjb.181.2023.11.01.06.02.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 06:02:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=M+0nXtL3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 5FFD2809216B; Wed, 1 Nov 2023 06:01:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235167AbjKANBl (ORCPT + 99 others); Wed, 1 Nov 2023 09:01:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231667AbjKANBi (ORCPT ); Wed, 1 Nov 2023 09:01:38 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3956DA6; Wed, 1 Nov 2023 06:01:36 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9c3aec5f326so172018066b.1; Wed, 01 Nov 2023 06:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698843694; x=1699448494; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=tLnRbhbdsdPLZ1Nf0yZZoZdfpMaZmBV3/I942pnqjQw=; b=M+0nXtL34qAs7yIOCW3fSOs0AGQlUbPuevCTgxP3kpIdg/IuoIUl7vvneaSeSbxOgv fVMHhXMAAoktlWa41osJ+9o4UKKSqqRCox+PG5RgTXqPH3SQvJgY2vqOlieb2pDUjDd6 nDhLpW/eo0ecrFW7MF0DLpUNVnONO+Q3uoQ1xI6/hT036B+jyHsgWBqiVrgdsHZwKFUn Xn+KdFpCZccKuYuqPlCwbW3bZBkH2jKAg72Uz14J5R4Wi9INA0OpF1vKRj+HMt+9ctv7 vuar/qAFygXkuPaoPpgHzSsVsZ/QT3EkxpZFzsKmIlnbGtoK9JrU2IFvQNwmjnrZhPWJ HF5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698843694; x=1699448494; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tLnRbhbdsdPLZ1Nf0yZZoZdfpMaZmBV3/I942pnqjQw=; b=ZdfCN0C88gLDvoG1KgCSUANtzvIGzoCpiRYdbIaMX+PO2x91/AH6YzCoE6SMVIUb9+ Us5GlYjgr6ZC0f9qqIExIPc4mrTyZtKI6Tw/P8kG6DWemoVldNEN6Ntd/oBZFwH15feb zyaueA/0+qMa9SIzYs6JBJvVlV4fGtOPS/dP6z4qDIuNFA9EF/26owTIegLp+NsDHKPY NNwSpLLueykyD3jdavENmoqAP49XiLJhydkPW05PkiRC3l4Xb0Sp7dZlpu+e1ttBD0tC e4UuVZ/L5duQl/4BMcfEulUuhgPorVTBIWnAVsnXWp9UVFtHqPrM4G4EtCkzAyw0CXgv 5hQw== X-Gm-Message-State: AOJu0YzMo5SVY759uXJ109XBrGmyZaBSZCryA9N3EAJ9FleIee+j6HsF Ra6Jxlutlrpv7nUwORF+rdA= X-Received: by 2002:a17:906:3282:b0:9a9:405b:26d1 with SMTP id 2-20020a170906328200b009a9405b26d1mr1974753ejw.5.1698843694239; Wed, 01 Nov 2023 06:01:34 -0700 (PDT) Received: from ?IPV6:2a01:c22:6f25:5100:302f:4dfd:b45b:b65a? (dynamic-2a01-0c22-6f25-5100-302f-4dfd-b45b-b65a.c22.pool.telefonica.de. [2a01:c22:6f25:5100:302f:4dfd:b45b:b65a]) by smtp.googlemail.com with ESMTPSA id z22-20020a170906715600b0099cb1a2cab0sm2394916ejj.28.2023.11.01.06.01.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Nov 2023 06:01:33 -0700 (PDT) Message-ID: <5af21f93-bb2d-42b1-b4d4-ee4443ffaff9@gmail.com> Date: Wed, 1 Nov 2023 14:01:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [net-next PATCH v2 1/2] net: phy: aquantia: add firmware load support Content-Language: en-US To: Christian Marangi , "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 Cc: Robert Marko References: <20231101123608.11157-1-ansuelsmth@gmail.com> From: Heiner Kallweit Autocrypt: addr=hkallweit1@gmail.com; keydata= xsFNBF/0ZFUBEAC0eZyktSE7ZNO1SFXL6cQ4i4g6Ah3mOUIXSB4pCY5kQ6OLKHh0FlOD5/5/ sY7IoIouzOjyFdFPnz4Bl3927ClT567hUJJ+SNaFEiJ9vadI6vZm2gcY4ExdIevYHWe1msJF MVE4yNwdS+UsPeCF/6CQQTzHc+n7DomE7fjJD5J1hOJjqz2XWe71fTvYXzxCFLwXXbBiqDC9 dNqOe5odPsa4TsWZ09T33g5n2nzTJs4Zw8fCy8rLqix/raVsqr8fw5qM66MVtdmEljFaJ9N8 /W56qGCp+H8Igk/F7CjlbWXiOlKHA25mPTmbVp7VlFsvsmMokr/imQr+0nXtmvYVaKEUwY2g 86IU6RAOuA8E0J5bD/BeyZdMyVEtX1kT404UJZekFytJZrDZetwxM/cAH+1fMx4z751WJmxQ J7mIXSPuDfeJhRDt9sGM6aRVfXbZt+wBogxyXepmnlv9K4A13z9DVLdKLrYUiu9/5QEl6fgI kPaXlAZmJsQfoKbmPqCHVRYj1lpQtDM/2/BO6gHASflWUHzwmBVZbS/XRs64uJO8CB3+V3fa cIivllReueGCMsHh6/8wgPAyopXOWOxbLsZ291fmZqIR0L5Y6b2HvdFN1Xhc+YrQ8TKK+Z4R mJRDh0wNQ8Gm89g92/YkHji4jIWlp2fwzCcx5+lZCQ1XdqAiHQARAQABzSZIZWluZXIgS2Fs bHdlaXQgPGhrYWxsd2VpdDFAZ21haWwuY29tPsLBjgQTAQgAOBYhBGxfqY/yOyXjyjJehXLe ig9U8DoMBQJf9GRVAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEHLeig9U8DoMSycQ AJbfg8HZEK0ljV4M8nvdaiNixWAufrcZ+SD8zhbxl8GispK4F3Yo+20Y3UoZ7FcI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SXSZo ythk/0EAuz5IkwkhYBT1MGIAvNSn9ivE5aRnBazugy0rTRkVggHvt3/7flFHlGVGpBHxFUwb /a4UjJBPtIwa4tWR8B1Ma36S8Jk456k2n1id7M0LQ+eqstmp6Y+UB+pt9NX6t0Slw1NCdYTW gJezWTVKF7pmTdXszXGxlc9kTrVUz04PqPjnYbv5UWuDd2eyzGjrrFOsJEi8OK2d2j4FfF++ AzOMdW09JVqejQARAQABwsF2BBgBCAAgFiEEbF+pj/I7JePKMl6Fct6KD1TwOgwFAl/0ZFUC GwwACgkQct6KD1TwOgxUfg//eAoYc0Vm4NrxymfcY30UjHVD0LgSvU8kUmXxil3qhFPS7KA+ y7tgcKLHOkZkXMX5MLFcS9+SmrAjSBBV8omKoHNo+kfFx/dUAtz0lot8wNGmWb+NcHeKM1eb nwUMOEa1uDdfZeKef/U/2uHBceY7Gc6zPZPWgXghEyQMTH2UhLgeam8yglyO+A6RXCh+s6ak Wje7Vo1wGK4eYxp6pwMPJXLMsI0ii/2k3YPEJPv+yJf90MbYyQSbkTwZhrsokjQEaIfjrIk3 rQRjTve/J62WIO28IbY/mENuGgWehRlTAbhC4BLTZ5uYS0YMQCR7v9UGMWdNWXFyrOB6PjSu Trn9MsPoUc8qI72mVpxEXQDLlrd2ijEWm7Nrf52YMD7hL6rXXuis7R6zY8WnnBhW0uCfhajx q+KuARXC0sDLztcjaS3ayXonpoCPZep2Bd5xqE4Ln8/COCslP7E92W1uf1EcdXXIrx1acg21 H/0Z53okMykVs3a8tECPHIxnre2UxKdTbCEkjkR4V6JyplTS47oWMw3zyI7zkaadfzVFBxk2 lo/Tny+FX1Azea3Ce7oOnRUEZtWSsUidtIjmL8YUQFZYm+JUIgfRmSpMFq8JP4VH43GXpB/S OCrl+/xujzvoUBFV/cHKjEQYBxo+MaiQa1U54ykM2W4DnHb1UiEf5xDkFd4= In-Reply-To: <20231101123608.11157-1-ansuelsmth@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 01 Nov 2023 06:01:58 -0700 (PDT) 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.