From patchwork Tue Feb 7 10:07:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 651251 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp2779011pva; Tue, 7 Feb 2023 02:08:58 -0800 (PST) X-Google-Smtp-Source: AK7set+pNmC/9tiouc7T/r9RvvW2+SFUj/BPXIgkRitt7jpNk23y9GOoKMlA8QFlI6eQQ7910Pz2 X-Received: by 2002:a05:622a:413:b0:3b6:3406:81cb with SMTP id n19-20020a05622a041300b003b6340681cbmr4712603qtx.14.1675764538400; Tue, 07 Feb 2023 02:08:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675764538; cv=none; d=google.com; s=arc-20160816; b=AILM8vZkTwWYFGgg/sB1qNovaalGET8OAY77MnYg7gZAdVMFdpGdEf+P9a+hBp3g2W +CN6b+vHgsqccm5u1vH/1sspJvAZxTff6FLLr7xVeojQFDzKGIFtgbwrg4dN/H04hsM5 Ay7420i8CsJ5pAtLSRk1n1b4cSFcnyNhYSxHxRDUPf1/dZ24BNPlJlm4ayCU1/8GYkXs CGXOn9B0oUmxN6XxDe6qx7MGPtHcC67MSKzV2z/byreH1+Wn05mq3uguYHV+/5tKlRcz s4U2EpIOiGZfdV1PNXFbOf2e98OYexgL1WASMWzxXyWGgyp4QdpGVVNeCD0dP9vcXwX8 ZrNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=xdIR+94JdJ9nETQd/TF0YS0NjjAXQS7a+hbEjd+SRiM=; b=qz3gmF+T5bNpjV6VpabzXgaIhIJx0iDJ+v3LUjUQHkxhz0SXmf+h4IiVjOYcLcXdfG PD834C36lGqavakGCd2e00Z6e2tR+4slqn2zEsZSuRgO/KX3C2Zf68OleJbu2cNMdZx3 3tYmDVy1aFONfQTRbKPkhrr3iiMz1wo5gJ1zPc8TITTuRuOCpHtglj/dwhINiZXSWkoN +ligtPB7IqelmOUx+BhaiqY29TVbnljSv0iVQUu8oSPLPV+M3CRFZLf9jJnT52JjO0R5 wZ02OVpC2t5QSPxpWLqwn2r/VSXt2XmP/N/lIM4QXGz6ledBUlubY1BB4lhnaK6WKXJg NLVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 15-20020a05620a040f00b00731114e2182si6759999qkp.236.2023.02.07.02.08.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Feb 2023 02:08:58 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPKtq-0000U6-Ax; Tue, 07 Feb 2023 05:08:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPKtS-0000P3-Ge; Tue, 07 Feb 2023 05:08:06 -0500 Received: from gandalf.ozlabs.org ([150.107.74.76]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPKtQ-0002M8-Fe; Tue, 07 Feb 2023 05:08:06 -0500 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4P9zMw61fzz4xxJ; Tue, 7 Feb 2023 21:07:56 +1100 (AEDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4P9zMv0Ynjz4wgv; Tue, 7 Feb 2023 21:07:54 +1100 (AEDT) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Peter Maydell , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= Subject: [PULL 02/25] tests/avocado: Truncate M2S-FG484 SOM SPI flash to 16MiB Date: Tue, 7 Feb 2023 11:07:21 +0100 Message-Id: <20230207100744.698694-3-clg@kaod.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230207100744.698694-1-clg@kaod.org> References: <20230207100744.698694-1-clg@kaod.org> MIME-Version: 1.0 Received-SPF: pass client-ip=150.107.74.76; envelope-from=SRS0=a43c=6D=kaod.org=clg@ozlabs.org; helo=gandalf.ozlabs.org X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé The M2S-FG484 SOM uses a 16 MiB SPI flash (Spansion S25FL128SDPBHICO). Since the test asset is bigger, truncate it to the correct size to avoid when running the test_arm_emcraft_sf2 test: qemu-system-arm: device requires 16777216 bytes, block backend provides 67108864 bytes Add comment regarding the M2S-FG484 SOM hardware in hw/arm/msf2-som.c. Reported-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- hw/arm/msf2-som.c | 5 ++++- tests/avocado/boot_linux_console.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c index a6df473ec9..7b3106c790 100644 --- a/hw/arm/msf2-som.c +++ b/hw/arm/msf2-som.c @@ -1,6 +1,9 @@ /* * SmartFusion2 SOM starter kit(from Emcraft) emulation. * + * M2S-FG484 SOM hardware architecture specification: + * https://www.emcraft.com/jdownloads/som/m2s/m2s-som-ha.pdf + * * Copyright (c) 2017 Subbaraya Sundeep * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -87,7 +90,7 @@ static void emcraft_sf2_s2s010_init(MachineState *machine) /* Attach SPI flash to SPI0 controller */ spi_bus = qdev_get_child_bus(dev, "spi0"); - spi_flash = qdev_new("s25sl12801"); + spi_flash = qdev_new("s25sl12801"); /* Spansion S25FL128SDPBHICO */ qdev_prop_set_uint8(spi_flash, "spansion-cr2nv", 1); if (dinfo) { qdev_prop_set_drive_err(spi_flash, "drive", diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py index 13e6688624..258f2ee897 100644 --- a/tests/avocado/boot_linux_console.py +++ b/tests/avocado/boot_linux_console.py @@ -400,6 +400,8 @@ def test_arm_emcraft_sf2(self): spi_hash = '65523a1835949b6f4553be96dec1b6a38fb05501' spi_path = self.fetch_asset(spi_url, asset_hash=spi_hash) + file_truncate(spi_path, 16 << 20) # Spansion S25FL128SDPBHICO is 16 MiB + self.vm.set_console() kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE self.vm.add_args('-kernel', uboot_path,