From patchwork Tue Jul 16 18:41:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 812799 Delivered-To: patch@linaro.org Received: by 2002:a5d:42c4:0:b0:367:895a:4699 with SMTP id t4csp447444wrr; Tue, 16 Jul 2024 11:44:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW6zU9vLArO1W37qb5TS3Mt0VURLWITZ3S+gaXdXHBcS8XedYTrmHuNwH0WUTZTjETxQ+k5qyilRIe3/WMhg02h X-Google-Smtp-Source: AGHT+IGfCENGOJWp8qU5A+QtALd50kMPFwA9oNTz0GRI6P0sIh/F973Q/L1VKskLtDLp0T+cpf8x X-Received: by 2002:ac8:5705:0:b0:447:e591:2d27 with SMTP id d75a77b69052e-44f7c9f9b98mr41181281cf.6.1721155442812; Tue, 16 Jul 2024 11:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1721155442; cv=none; d=google.com; s=arc-20160816; b=wEA4QwuT3N31s7bHKBae2CUGCxyPUZXCKX40lUzKdQPQQDEr9ldJ+iLxUNgG0msbNN 8c68Yg8Ebzo8eIZNS82jbwXPlw5z1ZwB+l93+kiuyvd/gDhzel7pxb4e7ZUTEHxZ3v8n MBcI659vXftm+L65EcvheRvsLU9I33hQdqKLWeUZ4ggm551QfBer4B7Pey8xV1xcPCXG wLrC6L99Q4pJApRqUNildWUKV/UIaB48n88jajPuM7mPQifvR9JtvBUo9MNuds7PG8uR wcRNeAy2pWbyxDSTFPo3pfNYQaHgatDaud3gdljW6hV/0a0ScbQuu5XhB5uCpBLZ5e+V WeCg== 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:dkim-signature; bh=/mR/0QMhMqGZbfZ0QJaQ5Uy2ur+BzQmeQAtYeietrZc=; fh=/TyiCVzPJVYkT4NtrOYZRXAcrkaiLXA/rwqp4QqIc5M=; b=bA1/bviUeSBmmXddgPa0Sc+XBc9xasoheW6pGhouzNvCwngwGI4DWmXdmzkaRijwSm hvvc7wpMEd8qzZFYXq8R6D5JaJI/pcBPKhSfhgj8cSImCpfj2xjW5hMAyy5rSZTZlu/G hm5i64+N1eKYD3l7OEzh29tpITn3XGxEq0gWXayOIZKPjBfchwuxhAfzjjSXMpWu9FYa oNXO5XpmKU2/g7v9YRaqwTNk9hVPGeFUy/nwYSR4w6rJx/ref5OP0upawI2oglchE955 Sg6+OecWQp/5LrYfLWvyZkC6GNFweZurUccmPsUVaXy7GQ1A1LbKL3fDBp36I7eqSejY oeVw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xl0yDCI4; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44f5b83460csi82886861cf.768.2024.07.16.11.44.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Jul 2024 11:44:02 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=Xl0yDCI4; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTn8r-0005Ay-Ji; Tue, 16 Jul 2024 14:43:17 -0400 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 1sTn8T-0003rR-Hz for qemu-devel@nongnu.org; Tue, 16 Jul 2024 14:42:52 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sTn8Q-0007Oe-TM for qemu-devel@nongnu.org; Tue, 16 Jul 2024 14:42:48 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4266ed6c691so37843755e9.3 for ; Tue, 16 Jul 2024 11:42:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721155365; x=1721760165; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/mR/0QMhMqGZbfZ0QJaQ5Uy2ur+BzQmeQAtYeietrZc=; b=Xl0yDCI47WdKQjLZfal5vCKzXyj273IR+slxK2DAs9dd7VNYlT1SyJkBgmB4IbFfMy Xxn1PeKQOM4rd8p+//+kG2caS4GVwxpBDwEHxF3at2ldunhhqRY6zuZKxHYynDshm4B+ mD8zUUM22TDZBQwAetQJjN7d0AXpqIra1Y8TNkwBMcnmWyA9qg4d1rPNQ42v5hsrMT1j SJ3QQm6XwvoZK9dW3vGHm8nN5g05aCV1SIvQ9z9jlmMHNYYVMWg7JBZqjdky3TLQEvET LZio7d2etyHMEEtqGqm2Ows2wMeKkhbrDUv1qzNXyhDIrZPsBdXqoKtTLMf2Yw79tsgZ CwWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721155365; x=1721760165; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/mR/0QMhMqGZbfZ0QJaQ5Uy2ur+BzQmeQAtYeietrZc=; b=u6+2OvL9bVbI80pD9MUhbbHDYPIycKEW2/V7MtIT+VFkRScTWrokrlxTsxpL0AnO75 nc5MTkuVdLjEdh3RjO/OhmzKGM0mr9tWZzt1wOghZKuW0l06gGn3DB2M62y/784x5PWT cumsj0ldfB0O4VYcc4VXRVs6DBhXnNzMOAWbtnFg7NOdEFsW/uhLAiGaRSKGr5oq9uXa Nud5khvK5tvhmAsEbVQsIxwhyCwBjfpGPj34yJ0IAC4AnVarpy8ufJpYkhYyIwsSvnDs gMJPtNouofFuZo/1XPAE9rB72xS82fMF3+Rz/J7azzsM5do+vlU4TnNYXGb9dsgmIFgN r+hw== X-Gm-Message-State: AOJu0Yx8NWDJgvoTmx+fMiSRrbpfmAwbUbl7QrPDXVcJrUFywNEJegee LouDc3OmDIEGy0QlwUaqXWP5DCry85G0o6gfKffYwABmDngSlWOK5GY9uPVJ9a2nNk8Y5QHIVZz FRJVp9w== X-Received: by 2002:a05:600c:4f53:b0:426:6617:ae4a with SMTP id 5b1f17b1804b1-427ba69a73emr20039755e9.22.1721155365258; Tue, 16 Jul 2024 11:42:45 -0700 (PDT) Received: from localhost.localdomain ([176.187.209.82]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4279f239883sm174550245e9.10.2024.07.16.11.42.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 16 Jul 2024 11:42:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= Subject: [PULL 09/11] hw/sd/sdcard: Add eMMC 'boot-partition-size' property Date: Tue, 16 Jul 2024 20:41:42 +0200 Message-ID: <20240716184144.42463-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240716184144.42463-1-philmd@linaro.org> References: <20240716184144.42463-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 Avoid hardcoding 1MiB boot size in EXT_CSD_BOOT_MULT, expose it as 'boot-partition-size' QOM property. By default, do not use any size. The board is responsible to set the boot partition size property. Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater Message-Id: <20240712162719.88165-10-philmd@linaro.org> --- hw/sd/sd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 2246213b31..d49b144214 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -135,6 +135,7 @@ struct SDState { /* Static properties */ uint8_t spec_version; + uint64_t boot_part_size; BlockBackend *blk; const SDProto *proto; @@ -492,7 +493,8 @@ static void emmc_set_ext_csd(SDState *sd, uint64_t size) /* Properties segment (RO) */ sd->ext_csd[EXT_CSD_S_CMD_SET] = 0b1; /* supported command sets */ sd->ext_csd[EXT_CSD_BOOT_INFO] = 0x0; /* Boot information */ - sd->ext_csd[EXT_CSD_BOOT_MULT] = 0x8; /* Boot partition size. 128KB unit */ + /* Boot partition size. 128KB unit */ + sd->ext_csd[EXT_CSD_BOOT_MULT] = sd->boot_part_size / (128 * KiB); sd->ext_csd[EXT_CSD_ACC_SIZE] = 0x1; /* Access size */ sd->ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] = 0x01; /* HC Erase unit size */ sd->ext_csd[EXT_CSD_ERASE_TIMEOUT_MULT] = 0x01; /* HC erase timeout */ @@ -2704,6 +2706,7 @@ static Property sd_properties[] = { }; static Property emmc_properties[] = { + DEFINE_PROP_UINT64("boot-partition-size", SDState, boot_part_size, 0), DEFINE_PROP_END_OF_LIST() };