From patchwork Wed Jan 24 06:49:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: MD Danish Anwar X-Patchwork-Id: 1890268 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=GUmRoc5h; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TKkB25XqLz23dy for ; Wed, 24 Jan 2024 23:42:18 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 719F487C54; Wed, 24 Jan 2024 13:42:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="GUmRoc5h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 929B387BED; Wed, 24 Jan 2024 07:49:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 761BE87BDF for ; Wed, 24 Jan 2024 07:49:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=danishanwar@ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 40O6ndBt022622; Wed, 24 Jan 2024 00:49:39 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1706078979; bh=FdY4qktSEf3DFpp/RpFHrp96Gh1NM80MBoVuWecQ1Cc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=GUmRoc5hikjmCvKUagR4eE+wgUbtjngkX9XyXqMjPIRPPiSZaZzFD8gbBp8HhULTf 44r8piLCCT0vQfN4nQrvZ8wdb8okUyd6pwzEhHd0bjAVnwubjSQu2BCAgdgdRdSJoI n8JbqbjuZgEfUlpu/st3lx4zNyjpjkhu5Mv4NSJg= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 40O6nd2w104951 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 24 Jan 2024 00:49:39 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 24 Jan 2024 00:49:39 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 24 Jan 2024 00:49:39 -0600 Received: from fllv0122.itg.ti.com (fllv0122.itg.ti.com [10.247.120.72]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 40O6ndFi071249; Wed, 24 Jan 2024 00:49:39 -0600 Received: from localhost (danish-tpc.dhcp.ti.com [10.24.69.25]) by fllv0122.itg.ti.com (8.14.7/8.14.7) with ESMTP id 40O6ncqd024468; Wed, 24 Jan 2024 00:49:39 -0600 From: MD Danish Anwar To: Dan Carpenter , Maxime Ripard , Siddharth Vadapalli , Roger Quadros , Matthias Schiffer , Stefan Roese , Qu Wenruo , Bryan Brattlof , Sean Anderson , Martyn Welch , Heinrich Schuchardt , Christian Gmeiner , Nishanth Menon , Vignesh Raghavendra , Nikhil M Jain , Kamlesh Gurudasani , Manorit Chawdhry , Neha Malcom Francis , Andrew Davis , Simon Glass , MD Danish Anwar , FUKAUMI Naoki , Christian Hewitt , Hai Pham , Svyatoslav Ryhel , Jonas Karlman , Neil Armstrong , Marek Vasut , Michal Simek , Kever Yang , Ramon Fried , Joe Hershberger CC: , , Subject: [RFC PATCH v3 02/15] misc: fs-loader: Use fw_storage_interface instead of storage_interface Date: Wed, 24 Jan 2024 12:19:17 +0530 Message-ID: <20240124064930.1787929-3-danishanwar@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240124064930.1787929-1-danishanwar@ti.com> References: <20240124064930.1787929-1-danishanwar@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Approved-At: Wed, 24 Jan 2024 13:42:05 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The fs-loader driver reads env storage_interface and uses it to load firmware file into memory using the medium set by env. Update the driver to use env fw_storage_interface as this variable is only used to load firmwares. The env storage_interface will act as fallback so that the existing implementations do not break. Also update the FS Loader documentation accordingly. Signed-off-by: MD Danish Anwar --- doc/develop/driver-model/fs_firmware_loader.rst | 5 ++++- drivers/misc/fs_loader.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/develop/driver-model/fs_firmware_loader.rst b/doc/develop/driver-model/fs_firmware_loader.rst index 149b8b436e..410cc1442d 100644 --- a/doc/develop/driver-model/fs_firmware_loader.rst +++ b/doc/develop/driver-model/fs_firmware_loader.rst @@ -98,8 +98,11 @@ through the U-Boot environment variable during run time. For examples: +fw_storage_interface: + Firmware storage interface, it can be "mmc", "usb", "sata" or "ubi". storage_interface: - Storage interface, it can be "mmc", "usb", "sata" or "ubi". + Storage interface, it can be "mmc", "usb", "sata" or "ubi". This acts + as a fallback if fw_storage_interface is not set. fw_dev_part: Block device number and its partition, it can be "0:1". fw_ubi_mtdpart: diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c index 1ffc199ba1..3798dab5b6 100644 --- a/drivers/misc/fs_loader.c +++ b/drivers/misc/fs_loader.c @@ -153,7 +153,10 @@ static int fw_get_filesystem_firmware(struct udevice *dev) char *storage_interface, *dev_part, *ubi_mtdpart, *ubi_volume; int ret; - storage_interface = env_get("storage_interface"); + storage_interface = env_get("fw_storage_interface"); + if (!storage_interface) + storage_interface = env_get("storage_interface"); + dev_part = env_get("fw_dev_part"); ubi_mtdpart = env_get("fw_ubi_mtdpart"); ubi_volume = env_get("fw_ubi_volume");