From patchwork Wed Jul 10 14:14:05 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: 811785 Delivered-To: patch@linaro.org Received: by 2002:adf:ee12:0:b0:367:895a:4699 with SMTP id y18csp776230wrn; Wed, 10 Jul 2024 07:17:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWtiknx3VdvNcfFxRLgtX0pqs8o2/dVl5aIYl2blpTbtfx243r0a/WpKBAoR/KvqTZ5NYOTlTxEuvlG7vxb59K+ X-Google-Smtp-Source: AGHT+IE2qIH7hSWOtTfpsGQ/9FA5FiZJnvvXXWtnjqhXqcuVGJqwjEq5d3BUWfg/79LcG+8Nn4Oz X-Received: by 2002:a05:620a:218f:b0:79f:968:86c3 with SMTP id af79cd13be357-79f19a5fd84mr600554185a.17.1720621048491; Wed, 10 Jul 2024 07:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720621048; cv=none; d=google.com; s=arc-20160816; b=sVoIqBoREhTFX/iQkoZ28zy24O93dOq2b7SLnBaBDoTr07oaM3mar1NSaH0IqUAqHr 1rhp54nb4BFFHHuWK5VMOquK2rZRs3hDUg1dn+GRyl4sVAJlXXRFGDSNaowihXfS7n4I 9F68L+uu+EO0bQ9cx1HtPWsVKExsfrZWpwdbh/apoZtrQT3SWDWDydhb4GG1ldIvDTvD c5Eqj5ikuLzQAtp0N8SYjbp51N2puKRiL1UiwLaM88ZXBZ7MYXz6hmCF9Msl648U9PnN udQs2lf9Vt04zsoj+DfnzCH89JPxnn60Re2FvDkpVyzDpuOeQPiTfX+gp0M63zG8Gs/2 kLuA== 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=/gFRB+hAQA0cGPCvSBja+2xdFZOixPnxHszPhshqLtU=; fh=GH5Q+RtWzBCNH9E515TvTIpLJh2pWY/kifiV2Cu7nrY=; b=LDT5A2BxhrXgzRtY7prQAV/7WvJAfD+OheMAwOySKp1vFQQj+22R5EkgfVXeC+EWEu WONQbk7HlyIGASx6BL3Ct+VyvISCoCdWC5X44z6DiIHJdwIbhYoi4YGj37WB/Nl6y85H xazCgR5Xmll5llZ6Zs67iZ+RZLsfpMOsCj2GtD1tXJIEBLwi6O8yKnqRUTar5upZdbMi uzGuaEPTafFv/qoZpgGE9VkSbiwXByHch0Gk80cu9FichnBJj/3VlnU80L+T8hiGZv+A OOn4A0QjQeJNDi4ApPVkCHGY/51oEJkEmm0gs9g4rCf9/V8LmoWDFxIXZCWkuEQF71HV nIZA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AU/55esw"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-79f190d8543si461173885a.599.2024.07.10.07.17.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jul 2024 07:17:28 -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="AU/55esw"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRY73-000472-TZ; Wed, 10 Jul 2024 10:16:05 -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 1sRY6J-0000az-Lr for qemu-devel@nongnu.org; Wed, 10 Jul 2024 10:15:25 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRY6A-00040y-I1 for qemu-devel@nongnu.org; Wed, 10 Jul 2024 10:15:17 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4266f344091so17264415e9.0 for ; Wed, 10 Jul 2024 07:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720620908; x=1721225708; 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=/gFRB+hAQA0cGPCvSBja+2xdFZOixPnxHszPhshqLtU=; b=AU/55esw4Ppl7nxlbKx3ZFJSQXKMmNiMDtWxZW7GhvEMYijYJesNM1/j/uL32v3pRO aii7oHAKiNQnYe8WNoe/nh5wIrkz4c+WaD7bVYD8+09svjb3P2ZNwAkvZexJ2aPILNkI MWTregUEI/FurPiNQC1kfQbxNHtQ7vcRcJa7o3aY4s6lqoOQNj61fDMhLWsFggtIKfJy t5pw+6DeisAykZCLQddmNjCNvcRBbOzG2tz23tDoF4y8qNMbp9jONlHDI1VcdCIbES6P 37nGX5bralsjGpgF7A7UuWvdQd4YF+ipJdIbFutyZktnsfTX7AbF9v8TkOKn7KPibOBH qx0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720620908; x=1721225708; 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=/gFRB+hAQA0cGPCvSBja+2xdFZOixPnxHszPhshqLtU=; b=HpYas9Ke+t981/Yu+jp0Cz8+cUxk5sctyxtYYp/FyRFtHoMSl2rwFzwXuo9E5kEQTK lB+aT7Jg7PrkmgCAnaJA75axVyRFswUXeAy6cz60B4m75W0vSvyqw/bA6HRDzVlyvQ0B bqTl46tz6S4dU3i2VPkV/4lVAXct/y+9G1eY+HuDnRPsFk3NdkuYSq6sCKJxAeXPfgPg M+V9/75Ib3qmMq1pHdIpzG+8McLi2EIs+oXNlNV7V+T5EdMcUmIR74Ypv4jNM40ay5LH rjvtGbDVdvLncK42FJKc+3+mML/8I0D5EwmhZzrSOnSHWqzn1eJlreJm8qQ+oStT8m77 kcew== X-Gm-Message-State: AOJu0YyoR1SeTGEE5o99vcJNdqQ6Y2b4Mol+cXYL+PakGcteOBi5KPk+ 70UFu+jAnWn1IZsNVSHPHbNcPOmSIqPpM3pchaDo5uynf08wdBKR2hjpo8TDDeX0qqIcVKxjudP B X-Received: by 2002:a05:600c:257:b0:426:6308:e2f0 with SMTP id 5b1f17b1804b1-426707f8fbamr33784475e9.26.1720620908457; Wed, 10 Jul 2024 07:15:08 -0700 (PDT) Received: from m1x-phil.lan ([176.176.167.117]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4279731a60dsm9464315e9.40.2024.07.10.07.15.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 10 Jul 2024 07:15:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Steven Lee , Andrew Jeffery , Francisco Iglesias , Sai Pavan Boddu , Luc Michel , qemu-arm@nongnu.org, qemu-block@nongnu.org, Troy Lee , Jamin Lin , Peter Maydell , Joel Stanley , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E . Iglesias" , =?utf-8?q?C=C3=A9dric_Le_Goa?= =?utf-8?q?ter?= Subject: [PATCH v48 09/12] hw/sd/sdcard: Add eMMC 'boot-size' property Date: Wed, 10 Jul 2024 16:14:05 +0200 Message-ID: <20240710141408.69275-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240710141408.69275-1-philmd@linaro.org> References: <20240710141408.69275-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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 QOM property. By default, do not use any size. The board is responsible to set the boot size property. Signed-off-by: Philippe Mathieu-Daudé --- 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 e6f1cc2066..57a9eb91d0 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 mmc_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-size", SDState, boot_part_size, 0), DEFINE_PROP_END_OF_LIST() };