Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp38282rdb; Wed, 4 Oct 2023 19:44:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQocJhsoICLzEkMbDo9u6QtPha+6C6loOecOB5e+Myt7JM/fcQmxj3TXOlXFt5SpJSyF4X X-Received: by 2002:aca:1b13:0:b0:3ae:2b43:dd4a with SMTP id b19-20020aca1b13000000b003ae2b43dd4amr4026596oib.45.1696473860009; Wed, 04 Oct 2023 19:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696473859; cv=none; d=google.com; s=arc-20160816; b=L0piAQAIkeVqV0tJkleAougTEIp26IqWGoF7kTl1+1hr0NlFNLj8UrclHssQaVRSwf nLQY8Swqezg7vu7iqeNmUc6K29wHpnpu36UWfmdd2/CI/dWXPaJ+bWSyNP1K9vyFj/3M ZV3W2ymk0AkgUtygIPfv+7YweOVNgbZrYlf/cN1qS5KKDjnNjR27yZlCg3Th3vgj3hHZ 9pv35QPy/6kfpSl+6KweHTfoc8XtiqIMyNin9oHCi2f7X4Jrp8No+tUclgOutA7vZ8tD XskG3FZAiaGoWX1Wp+2m241UlCNRo8C6+e7KE4X/bigjK51XP7O6q/OuH1DCUN64CDHB ue/Q== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=0NQ/g4PmP3KmQk0o9HxrWTK9sWaymND2wvzIv9n7au0=; fh=JMH5wcWXGFMv9pqijS05w2EIOYp2RioTQy8f5QbkA8M=; b=ljU1ZdzRcjfqGCv3tODfKonw7wmUoC3I1FLorTQN+wdj1PCPVQURoreQ6IL0QLnv5N Il2kvELY8OfyBlI5BgguLesWynQrmtygthyju4L99fMH7+qrFv3WysV2cpNPQS1P3VFc FNTv00FD0ojWnJ7K6pSOY1HdNYiLXvT1Q6JF+vXj4gaz4mOyABNAsd2GdzIMqN5SYoi5 pRat0fpMTRa7gypuOO+/uvSnCdLp/TT9EGDl2aHhcPB9MbIRClFLZ5n1AXrpmn0KwmJ1 6Frdv7QKiUCcOy6L1AUnCXAWJ6y1nejxwAYb9yFgNA+uvyqVrkyiSxUxt/OuWkduD62t w1hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=VD9VMX3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id a72-20020a63904b000000b0057744d09d1bsi504274pge.251.2023.10.04.19.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 19:44:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=VD9VMX3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 6927C8303A1B; Wed, 4 Oct 2023 19:44:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233830AbjJECoL (ORCPT + 99 others); Wed, 4 Oct 2023 22:44:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229767AbjJECoK (ORCPT ); Wed, 4 Oct 2023 22:44:10 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A22D3C0; Wed, 4 Oct 2023 19:44:05 -0700 (PDT) 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=0NQ/g4PmP3KmQk0o9HxrWTK9sWaymND2wvzIv9n7au0=; b=VD9VMX3YpO4p8fBX8lciuydeA6 WyT4s8XUgioC6EOCKNETFxjIG9C5ZcUGuN3RqKzqIYq/AFI8xGJrr66v3/Gcgp3gvshBwFj4sTrGS sJwR/zVWIlcIltPUmUwRafp50nLbHGGtSVXvPQAcR7hKJepgX6aUat7loXwwgaRT4pq8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qoEL9-008ICm-Od; Thu, 05 Oct 2023 04:43:51 +0200 Date: Thu, 5 Oct 2023 04:43:51 +0200 From: Andrew Lunn To: Jakub Kicinski Cc: Robert Marko , hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Marangi , Luis Chamberlain , devicetree@vger.kernel.org Subject: Re: [RFC PATCH net-next] net: phy: aquantia: add firmware load support Message-ID: <56227e76-f01f-4b90-b325-1cd9ecb8d5a3@lunn.ch> References: <20230930104008.234831-1-robimarko@gmail.com> <20231004162831.0cf1f6a8@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231004162831.0cf1f6a8@kernel.org> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 19:44:17 -0700 (PDT) X-Spam-Level: ** On Wed, Oct 04, 2023 at 04:28:31PM -0700, Jakub Kicinski wrote: > On Sat, 30 Sep 2023 12:39:44 +0200 Robert Marko wrote: > > + ret = of_property_read_string(dev->of_node, "firmware-name", > > + &fw_name); > > Perhaps a well established weirdness of the embedded world but why read > the fw name from OF?! You can identify what PHY it is and decide the > file name based on that. And also put that fw name in MODULE_FIRMWARE() > so that initramfs can be built with appropriate file in place :S The Aquantia PHY and its `firmware` is just weird. It is more than just firmware, it also contains what i think they call provisioning. That is basically the reset defaults for registers. And not everything is documented, and i think parts of that provision contains SERDES eye configuration. So i think you end up with a custom firmware per board? And you can never trust the firmware in one device will do the same thing as a different firmware in another device, because the reset defaults are a bit fuzzy. The PHY driver is somewhat built on sand, since you cannot really trust any register to have any specific reset value. So i can understand putting the board specific firmware name in DT, and that the firmware will never be in linux-firmware because it would not scale, and there never being one firmware usable for all boards. And this odd way of doing things means the usual mechanisms for getting the firmware in initramfs does not work. I suppose the question is, do we want to say this is all too ugly for Linux, solve it in the bootloader, or spend the extra $0.50 for a flash chip and put the firmware in at the factory. As a kernel developer i would want the boot loader to solve this, so i can TFTP boot the kernel. I would also like having a rescue mechanism for when i brick Linux on the box and need to boot a Debian install image to recover it. Andrew