From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721197909; cv=none; d=zohomail.com; s=zohoarc; b=E6WMRQDM+H9qOWDerBnMiGaX70KeTgSimr43W5jyI2n43xAbbMT0uUip3v0MOuHTaAz7A8FnymSvXnI7Vy+FgcKr1blE90OOp16fcZglWu6NhsLe6Emp+EwW6ButbFYWnOvT70MlEhz6cSMsNebhOZpSJs5H8dpi33b52IaWE1A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721197909; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WV5KxT7XX3IKOEI3W8/ZDwlY05sqrwN2WarQtnyg3WQ=; b=k/imVlmyeAJaDJ3RZ8nwRWM2kFSAriJFl2w3IBBnrdUGqfHOkbmMTpd1s917jLkjL6QTjrYYG1mHG/4HHcI9YHTVa0GmRVrkTN1373DFR7O5nec0egP7qdRv7J0tNpPpahNByeqClHAnOL3M5R7trv2qIOziQs6BuFCeFRWjSgY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721197909152258.7050982179278; Tue, 16 Jul 2024 23:31:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTyBj-0005mT-VS; Wed, 17 Jul 2024 02:30:55 -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 1sTyBg-0005c3-5B for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:30:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTyBd-0002wx-Ll for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:30:50 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-19-Qe6eEInzNJG30ypD0hiPbg-1; Wed, 17 Jul 2024 02:30:42 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ECCD8195608B; Wed, 17 Jul 2024 06:30:39 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.88]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0C32B19560B2; Wed, 17 Jul 2024 06:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721197848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WV5KxT7XX3IKOEI3W8/ZDwlY05sqrwN2WarQtnyg3WQ=; b=WEnd+JBElUN3EuPoBWjMDggQc52jSpuVjCqIesSJuWfxn8I5KcyKxhs3viOa07biMCWBu3 kvblCiewI1hHpafcfhbL4Ramvz27ortohb0CHS2wPKBARwSXuCeoH2WZ5R+dHg4OKISRbf g/nuzKEooCs4CLjknnDVWJxxWTh4ow4= X-MC-Unique: Qe6eEInzNJG30ypD0hiPbg-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Andrew Jeffery , Joel Stanley , Steven Lee , Troy Lee , Jamin Lin , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v2 1/8] aspeed: Change type of eMMC device Date: Wed, 17 Jul 2024 08:30:15 +0200 Message-ID: <20240717063022.549849-2-clg@redhat.com> In-Reply-To: <20240717063022.549849-1-clg@redhat.com> References: <20240717063022.549849-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721197909906116600 From: C=C3=A9dric Le Goater The QEMU device model representing the eMMC device of the machine is currently created with type SD_CARD. Change the type to EMMC now that it is available. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/aspeed.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 53a4f665d0d0..105b990233fa 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -327,14 +327,14 @@ void aspeed_board_init_flashes(AspeedSMCState *s, con= st char *flashtype, } } =20 -static void sdhci_attach_drive(SDHCIState *sdhci, DriveInfo *dinfo) +static void sdhci_attach_drive(SDHCIState *sdhci, DriveInfo *dinfo, bool e= mmc) { DeviceState *card; =20 if (!dinfo) { return; } - card =3D qdev_new(TYPE_SD_CARD); + card =3D qdev_new(emmc ? TYPE_EMMC : TYPE_SD_CARD); qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), &error_fatal); qdev_realize_and_unref(card, @@ -436,12 +436,13 @@ static void aspeed_machine_init(MachineState *machine) =20 for (i =3D 0; i < bmc->soc->sdhci.num_slots; i++) { sdhci_attach_drive(&bmc->soc->sdhci.slots[i], - drive_get(IF_SD, 0, i)); + drive_get(IF_SD, 0, i), false); } =20 if (bmc->soc->emmc.num_slots) { sdhci_attach_drive(&bmc->soc->emmc.slots[0], - drive_get(IF_SD, 0, bmc->soc->sdhci.num_slots)); + drive_get(IF_SD, 0, bmc->soc->sdhci.num_slots), + true); } =20 if (!bmc->mmio_exec) { --=20 2.45.2 From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721198007; cv=none; d=zohomail.com; s=zohoarc; b=XWPg9+An95+0OQa0RM7UMGjE0E5xYjq/j4phZ8Zfyh2C57dG5U7vxRInlQM/z9K6X6j3CR+1XahIsNHYiTULa7mp+9otAFuQCCzQV7ij+7lQAAplKzcHZrBzek5Uho0OMWZQDYmvR1++69hWKzuz+MFZrwjBg5mCSLDTSNMbJDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721198007; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0QZoUUVcnKJ2D/VFCs+20/ZqOIheN3b4TVFT74qsvEQ=; b=bJrLE7I3aePiHTLMP6cRgq94zW8oQBI8KRd4kAN4PFhDamcBQqawZ26TfL41SU/0ysZbGkik6gzwK7mGDCHkz+pud3hNdWZn/fR03CyYsQ46lMdW2UBZiefAMtCdlpPUj9eCk0hUA2H6gDTMC4jEZ+5/5GqqUUbzC5lYPqS6Z04= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721198007035235.27592040052673; Tue, 16 Jul 2024 23:33:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTyBo-0006A0-Ft; Wed, 17 Jul 2024 02:31:00 -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 1sTyBj-0005oy-8p for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:30:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTyBh-0002xs-QH for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:30:55 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-269-ooB9s5v6Oe625-IdIzcnwQ-1; Wed, 17 Jul 2024 02:30:46 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5DC6A1955D4A; Wed, 17 Jul 2024 06:30:44 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.88]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1CF941955F65; Wed, 17 Jul 2024 06:30:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721197852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0QZoUUVcnKJ2D/VFCs+20/ZqOIheN3b4TVFT74qsvEQ=; b=dhUTbzQm8J93O5dylyiDVq82U99vOB1NsmexLwMMX0d5QEyVU85KtCcaNLGkPTWuAqM4sa s4FuQtcmJhibDNUoSUGXBGB4/EDMkQO0GGYNoY49dk+X6olwCuYtiJ/V7gjTX9gduhXJBt p8uDGTDYkoBcikhLNpj64CxdTCE+TJQ= X-MC-Unique: ooB9s5v6Oe625-IdIzcnwQ-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Andrew Jeffery , Joel Stanley , Steven Lee , Troy Lee , Jamin Lin , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v2 2/8] aspeed: Load eMMC first boot area as a boot rom Date: Wed, 17 Jul 2024 08:30:16 +0200 Message-ID: <20240717063022.549849-3-clg@redhat.com> In-Reply-To: <20240717063022.549849-1-clg@redhat.com> References: <20240717063022.549849-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721198008279116600 From: C=C3=A9dric Le Goater The first boot area partition (64K) of the eMMC device should contain an initial boot loader (u-boot SPL). Load it as a ROM only if an eMMC device is available to boot from but no flash device is. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/aspeed.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 105b990233fa..756deb91efd1 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -364,6 +364,7 @@ static void aspeed_machine_init(MachineState *machine) AspeedMachineClass *amc =3D ASPEED_MACHINE_GET_CLASS(machine); AspeedSoCClass *sc; int i; + DriveInfo *emmc0 =3D NULL; =20 bmc->soc =3D ASPEED_SOC(object_new(amc->soc_name)); object_property_add_child(OBJECT(machine), "soc", OBJECT(bmc->soc)); @@ -440,9 +441,8 @@ static void aspeed_machine_init(MachineState *machine) } =20 if (bmc->soc->emmc.num_slots) { - sdhci_attach_drive(&bmc->soc->emmc.slots[0], - drive_get(IF_SD, 0, bmc->soc->sdhci.num_slots), - true); + emmc0 =3D drive_get(IF_SD, 0, bmc->soc->sdhci.num_slots); + sdhci_attach_drive(&bmc->soc->emmc.slots[0], emmc0, true); } =20 if (!bmc->mmio_exec) { @@ -452,6 +452,8 @@ static void aspeed_machine_init(MachineState *machine) if (fmc0) { uint64_t rom_size =3D memory_region_size(&bmc->soc->spi_boot); aspeed_install_boot_rom(bmc, fmc0, rom_size); + } else if (emmc0) { + aspeed_install_boot_rom(bmc, blk_by_legacy_dinfo(emmc0), 64 * = KiB); } } =20 --=20 2.45.2 From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721197882; cv=none; d=zohomail.com; s=zohoarc; b=EJUOmQjjY8uvYqgCRCYeaxHTHSwu3oYzgAdpj905FbrHoiJcxynIgQTn0Jy318hlPP58tivS2p58qcy8xnKOTc9MRc2VaM36x9iXFJ8BJUBXju3S0pX8lI5SvXjamhqr+rj+H1ox+iprwSb8agq2TvX3v3AQDgDUxL1m2NBlAa0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721197882; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=INwSMjTLEh4jgAFahlwen+M5AHhr/1WenMun+GLHgaY=; b=YMR9NY0Hs8YF1oJP3X3JZlUgheq5vZpi/WbPcXhzdwfocK9Dxk+r0Xj9MboUsHhRDR9k30lztzqcfj6cio7DGPRgcAHmLvtoRwlejL82OazVFoNoXZ2lAypGgRx4l/dXGxhw2PEI5voHSsDjIw6S22Al/Io/a8gCapCHbI7q49I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721197882096607.4288518241568; Tue, 16 Jul 2024 23:31:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTyBy-0006tb-RK; Wed, 17 Jul 2024 02:31:10 -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 1sTyBw-0006hJ-CB for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTyBu-0002z0-4j for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:08 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-192-Ax-0UwrOMiOHSh-LXK9O5A-1; Wed, 17 Jul 2024 02:30:54 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 20AD21955F0D; Wed, 17 Jul 2024 06:30:53 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.88]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BB48A1955F6B; Wed, 17 Jul 2024 06:30:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721197864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=INwSMjTLEh4jgAFahlwen+M5AHhr/1WenMun+GLHgaY=; b=f0ShZvbCZhFbISQPrhQoxlpWALsyCL1NfC5poeJW4PZmW22lxAedbNotKFNzh2pLCdtaoI 9kflpqwXHQrp56APMIEKRekLLDeYUNzYaQtKojiWhmlzp26s62D72Mhz17llrUFtTq7+Jz UMmQ13+yHoq0sgzM1NB/niMw4iNUtrw= X-MC-Unique: Ax-0UwrOMiOHSh-LXK9O5A-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Andrew Jeffery , Joel Stanley , Steven Lee , Troy Lee , Jamin Lin , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v2 3/8] aspeed/scu: Add boot-from-eMMC HW strapping bit for AST2600 SoC Date: Wed, 17 Jul 2024 08:30:17 +0200 Message-ID: <20240717063022.549849-4-clg@redhat.com> In-Reply-To: <20240717063022.549849-1-clg@redhat.com> References: <20240717063022.549849-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721197883994116600 From: C=C3=A9dric Le Goater Bit SCU500[2] of the AST2600 controls the boot device of the SoC. Future changes will configure this bit to boot from eMMC disk images specially built for this purpose. Signed-off-by: Joel Stanley Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Tested-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/misc/aspeed_scu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h index 58db28db45aa..356be95e4585 100644 --- a/include/hw/misc/aspeed_scu.h +++ b/include/hw/misc/aspeed_scu.h @@ -349,6 +349,10 @@ uint32_t aspeed_scu_get_apb_freq(AspeedSCUState *s); #define SCU_AST2600_H_PLL_BYPASS_EN (0x1 << 24) #define SCU_AST2600_H_PLL_OFF (0x1 << 23) =20 +/* STRAP1 SCU500 */ +#define SCU_AST2600_HW_STRAP_BOOT_SRC_EMMC (0x1 << 2) +#define SCU_AST2600_HW_STRAP_BOOT_SRC_SPI (0x0 << 2) + /* * SCU310 Clock Selection Register Set 4 (for Aspeed AST1030 SOC) * --=20 2.45.2 From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721197914; cv=none; d=zohomail.com; s=zohoarc; b=MkdTDJmpIQgRi9myDvmQm6ZW+xZKPbS/dg7UepVFhMzRcU30ANQYEMryBpKrOGwngsat/drx/HX8gT0pEBe+Uo/WHHFVr88phe9cu2sMg3z5yrJUh3zLBMRGdjgoWjSez3SQDy8p75sCVKNewB1f2F32pyRpASa2MPncw7VbpdI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721197914; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bRmL0OYaoeGHe5hCmTex3w/LL9vR1msP0rIYrY1NERE=; b=aqDleDQHcu8lK/yHGZMrBn9xkd5cZ+TDW46xqdyiruPzInc4hN3S1NFHxBzLD2x1jjguGnbszSXHkjDMmXaGt0O1Cq1x8J784PijXoe8RO5r9g4MDmOhaVKndDTaq3QBXC1wTMYSC+tE93nF7UXeuy9N8tMXHFTMBaAgxbxnUws= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721197914474779.7829079966036; Tue, 16 Jul 2024 23:31:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTyBw-0006n0-QP; Wed, 17 Jul 2024 02:31:08 -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 1sTyBv-0006bb-61 for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTyBt-0002ys-Je for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:06 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-kTTV2iIjNmihFa32piaE9A-1; Wed, 17 Jul 2024 02:30:59 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9A40C19560B6; Wed, 17 Jul 2024 06:30:57 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.88]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 63E3319560B2; Wed, 17 Jul 2024 06:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721197864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bRmL0OYaoeGHe5hCmTex3w/LL9vR1msP0rIYrY1NERE=; b=a+TfStcjmugY754djoifR1gF494i0IT9PJlTQGZiGqfwT7mXaf+fdOlyvptymqdZMFzkF7 QyhSPngdpeGWQDhM5OtaUDxhM0PoGBJBMKOU+Ll2wxVDxVDRAbDj5sDLbz4olwlGD8zXxY Iw4jXZIF4hRirHPtFTNvClIzOw6vQ1E= X-MC-Unique: kTTV2iIjNmihFa32piaE9A-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Andrew Jeffery , Joel Stanley , Steven Lee , Troy Lee , Jamin Lin , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v2 4/8] aspeed: Introduce a AspeedSoCClass 'boot_from_emmc' handler Date: Wed, 17 Jul 2024 08:30:18 +0200 Message-ID: <20240717063022.549849-5-clg@redhat.com> In-Reply-To: <20240717063022.549849-1-clg@redhat.com> References: <20240717063022.549849-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721197915939116600 From: C=C3=A9dric Le Goater Report support on the AST2600 SoC if the boot-from-eMMC HW strapping bit is set at the board level. AST2700 also has support but it is not yet ready in QEMU and others SoCs do not have support, so return false always for these. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Tested-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/arm/aspeed_soc.h | 1 + hw/arm/aspeed_ast2600.c | 8 ++++++++ hw/arm/aspeed_soc_common.c | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index 849ba37f9524..624d489e0d63 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -164,6 +164,7 @@ struct AspeedSoCClass { const hwaddr *memmap; uint32_t num_cpus; qemu_irq (*get_irq)(AspeedSoCState *s, int dev); + bool (*boot_from_emmc)(AspeedSoCState *s); }; =20 const char *aspeed_soc_cpu_type(AspeedSoCClass *sc); diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index 31713de74a5f..be3eb70cdd77 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -646,6 +646,13 @@ static void aspeed_soc_ast2600_realize(DeviceState *de= v, Error **errp) } } =20 +static bool aspeed_soc_ast2600_boot_from_emmc(AspeedSoCState *s) +{ + uint32_t hw_strap1 =3D object_property_get_uint(OBJECT(&s->scu), + "hw-strap1", &error_abor= t); + return !!(hw_strap1 & SCU_AST2600_HW_STRAP_BOOT_SRC_EMMC); +} + static void aspeed_soc_ast2600_class_init(ObjectClass *oc, void *data) { static const char * const valid_cpu_types[] =3D { @@ -673,6 +680,7 @@ static void aspeed_soc_ast2600_class_init(ObjectClass *= oc, void *data) sc->memmap =3D aspeed_soc_ast2600_memmap; sc->num_cpus =3D 2; sc->get_irq =3D aspeed_soc_ast2600_get_irq; + sc->boot_from_emmc =3D aspeed_soc_ast2600_boot_from_emmc; } =20 static const TypeInfo aspeed_soc_ast2600_types[] =3D { diff --git a/hw/arm/aspeed_soc_common.c b/hw/arm/aspeed_soc_common.c index 1e8f2558fdc2..05551461aea0 100644 --- a/hw/arm/aspeed_soc_common.c +++ b/hw/arm/aspeed_soc_common.c @@ -134,6 +134,11 @@ static void aspeed_soc_realize(DeviceState *dev, Error= **errp) } } =20 +static bool aspeed_soc_boot_from_emmc(AspeedSoCState *s) +{ + return false; +} + static Property aspeed_soc_properties[] =3D { DEFINE_PROP_LINK("dram", AspeedSoCState, dram_mr, TYPE_MEMORY_REGION, MemoryRegion *), @@ -145,9 +150,11 @@ static Property aspeed_soc_properties[] =3D { static void aspeed_soc_class_init(ObjectClass *oc, void *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); + AspeedSoCClass *sc =3D ASPEED_SOC_CLASS(oc); =20 dc->realize =3D aspeed_soc_realize; device_class_set_props(dc, aspeed_soc_properties); + sc->boot_from_emmc =3D aspeed_soc_boot_from_emmc; } =20 static const TypeInfo aspeed_soc_types[] =3D { --=20 2.45.2 From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721197993; cv=none; d=zohomail.com; s=zohoarc; b=VDh96R7B329rPHROUaWYYp7ilFgFnIH/2Leh5uBYGKTicG4PQM/8+GxkhitPAcI6Eej7w2lYO4EahEHMe+EKLPlvvTYblUoRDQSz7cEMM0IyChnOOsB2aeQCAGk9hcr4viDFX9JMb3KcWyoNTqrx00QKZL/hrchIx9O3IK2VUxU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721197993; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tg878PEggQ9yjP8hwvC2hflD3G9fDs60xIb0uRWaszE=; b=lz9+fWcB9qBzlY4Qi4RIm5/mR+gfA1R6f085PL5Ck1idYnYAY5KoejrSi7C20oPWJroqxzSQu0GSVTvOlf/+DbMFBznSzPpUSOsUYn24RcUqcpMZasBrA+di1v/7bvpj39udCVsz+HMXdhb65kODGaMRxBiLEjxhvWv2XjKi2DU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721197993501160.14967910581868; Tue, 16 Jul 2024 23:33:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTyC1-0007JR-PI; Wed, 17 Jul 2024 02:31:13 -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 1sTyC0-000797-BV for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTyBy-00031G-Hl for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:12 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-387-mw6U6T1XOF2aY5gZCE7FXA-1; Wed, 17 Jul 2024 02:31:02 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B4DD019560B6; Wed, 17 Jul 2024 06:31:00 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.88]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0092F19560B2; Wed, 17 Jul 2024 06:30:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721197869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tg878PEggQ9yjP8hwvC2hflD3G9fDs60xIb0uRWaszE=; b=SSf3v7rXpQetKATst6ab8ta/JksW6f0b/bexKhimBvWH02yD8YhwUQNw/l+8bwubzmqFzI Zd+QFN+pkpWLR8w1X2FiYFRj4ALiOzQNqUO/PurtL782cJHyTooFXIZFt3Q5y2QE034VXQ kGRI3Mn4bkx7hZ45s1A3BSJEpdV1m9c= X-MC-Unique: mw6U6T1XOF2aY5gZCE7FXA-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Andrew Jeffery , Joel Stanley , Steven Lee , Troy Lee , Jamin Lin , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v2 5/8] aspeed: Tune eMMC device properties to reflect HW strapping Date: Wed, 17 Jul 2024 08:30:19 +0200 Message-ID: <20240717063022.549849-6-clg@redhat.com> In-Reply-To: <20240717063022.549849-1-clg@redhat.com> References: <20240717063022.549849-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721197994308116600 From: C=C3=A9dric Le Goater When the boot-from-eMMC HW strapping bit is set, use the 'boot-config' property to set the boot config register to boot from the first boot area partition of the eMMC device. Also set the boot partition size of the device. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/aspeed.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 756deb91efd1..bc4ca1754213 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -327,7 +327,8 @@ void aspeed_board_init_flashes(AspeedSMCState *s, const= char *flashtype, } } =20 -static void sdhci_attach_drive(SDHCIState *sdhci, DriveInfo *dinfo, bool e= mmc) +static void sdhci_attach_drive(SDHCIState *sdhci, DriveInfo *dinfo, bool e= mmc, + bool boot_emmc) { DeviceState *card; =20 @@ -335,6 +336,11 @@ static void sdhci_attach_drive(SDHCIState *sdhci, Driv= eInfo *dinfo, bool emmc) return; } card =3D qdev_new(emmc ? TYPE_EMMC : TYPE_SD_CARD); + if (emmc) { + qdev_prop_set_uint64(card, "boot-partition-size", 1 * MiB); + qdev_prop_set_uint8(card, "boot-config", + boot_emmc ? 0x1 << 3 : 0x0); + } qdev_prop_set_drive_err(card, "drive", blk_by_legacy_dinfo(dinfo), &error_fatal); qdev_realize_and_unref(card, @@ -365,6 +371,7 @@ static void aspeed_machine_init(MachineState *machine) AspeedSoCClass *sc; int i; DriveInfo *emmc0 =3D NULL; + bool boot_emmc; =20 bmc->soc =3D ASPEED_SOC(object_new(amc->soc_name)); object_property_add_child(OBJECT(machine), "soc", OBJECT(bmc->soc)); @@ -437,19 +444,21 @@ static void aspeed_machine_init(MachineState *machine) =20 for (i =3D 0; i < bmc->soc->sdhci.num_slots; i++) { sdhci_attach_drive(&bmc->soc->sdhci.slots[i], - drive_get(IF_SD, 0, i), false); + drive_get(IF_SD, 0, i), false, false); } =20 + boot_emmc =3D sc->boot_from_emmc(bmc->soc); + if (bmc->soc->emmc.num_slots) { emmc0 =3D drive_get(IF_SD, 0, bmc->soc->sdhci.num_slots); - sdhci_attach_drive(&bmc->soc->emmc.slots[0], emmc0, true); + sdhci_attach_drive(&bmc->soc->emmc.slots[0], emmc0, true, boot_emm= c); } =20 if (!bmc->mmio_exec) { DeviceState *dev =3D ssi_get_cs(bmc->soc->fmc.spi, 0); BlockBackend *fmc0 =3D dev ? m25p80_get_blk(dev) : NULL; =20 - if (fmc0) { + if (fmc0 && !boot_emmc) { uint64_t rom_size =3D memory_region_size(&bmc->soc->spi_boot); aspeed_install_boot_rom(bmc, fmc0, rom_size); } else if (emmc0) { --=20 2.45.2 From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721198018; cv=none; d=zohomail.com; s=zohoarc; b=aOxMCuOklXPtpVbVTItGsvuJ6QqFJlv1tXVJnLoXqirMwTnExzmDHOM3kKQHeGPcnkiScJXLP87nao+CoTwJUlf23R80we3rkJuEFSRYnOQRMNjBzNKzm7jXBdVMEyabWfC1ZK+DS7jGYSCwVkNmR4JALBOYUgeTaArpct9Q58E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721198018; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qOexB7WyGxqggp5qNy9755iGleCM0mUr9kIsaPy50JQ=; b=ZMybLh2O8E5hHK1pZcHPZu3qm808JnxCeYEGhC4VKSKjCgmr5d9j/1oF1W4vYQrFqBJ5sTOkW4VWXthiajNH0Uts3wbTj+876tE+kG2mwdlcwhbk68enG1t9ipDGb67HAhnR82gXjKtC/vTcHaBiLkX42YBN1mym2Slw2eJng7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721198018447827.4368247535582; Tue, 16 Jul 2024 23:33:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTyC3-0007Vx-3x; Wed, 17 Jul 2024 02:31:15 -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 1sTyC1-0007Im-JS for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTyBz-00031Y-GX for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:13 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-2jPDjp8pPEOkwvNFTvkI3A-1; Wed, 17 Jul 2024 02:31:05 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 285471955D45; Wed, 17 Jul 2024 06:31:04 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.88]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1F6141955F65; Wed, 17 Jul 2024 06:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721197870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qOexB7WyGxqggp5qNy9755iGleCM0mUr9kIsaPy50JQ=; b=bcIFeXE2eNPwjaxsyIed+hKStdfkcwhjUbSTQDqcI0T6JwHC0O1aSPAkEvUWTc2Rpwhs8i 1jVXNDTlo55d9+Z+ccW57l2KNKW6kpAPzV565e5u8XjeXoZMcgX+czCVWUvJl2mbOCSahJ +joVY54dMu6slfQJwL3Vh76w0+jqLbo= X-MC-Unique: 2jPDjp8pPEOkwvNFTvkI3A-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Andrew Jeffery , Joel Stanley , Steven Lee , Troy Lee , Jamin Lin , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v2 6/8] aspeed: Add boot-from-eMMC HW strapping bit to rainier-bmc machine Date: Wed, 17 Jul 2024 08:30:20 +0200 Message-ID: <20240717063022.549849-7-clg@redhat.com> In-Reply-To: <20240717063022.549849-1-clg@redhat.com> References: <20240717063022.549849-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721198020352116600 From: C=C3=A9dric Le Goater This value is taken from a running Rainier machine. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index bc4ca1754213..a8f5c14ae535 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -189,7 +189,7 @@ struct AspeedMachineState { #define TACOMA_BMC_HW_STRAP2 0x00000040 =20 /* Rainier hardware value: (QEMU prototype) */ -#define RAINIER_BMC_HW_STRAP1 0x00422016 +#define RAINIER_BMC_HW_STRAP1 (0x00422016 | SCU_AST2600_HW_STRAP_BOOT_SRC_= EMMC) #define RAINIER_BMC_HW_STRAP2 0x80000848 =20 /* Fuji hardware value */ --=20 2.45.2 From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721197899; cv=none; d=zohomail.com; s=zohoarc; b=UqZuoTZaYTb1UbSmgvo5Xqq8MqMGy6lpP461Y0TI/N+2Bonm/Ks6oDiUljeesZOG2IKgiaWNGazHMHnAooVWRXcfdnYaLVrfbtQkLKuRYJqyoB3H2Oe0mSyGsLRnhr58+ixuBFs04gOVTvvt68PJhGLbdRuy3KD1kHAB13iisgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721197899; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9clbyjDOn00YOAzPCTfJCWH3c4J9HrQVmDKgoi/2IAI=; b=nIK+xZd8WNMjHPj5cTqwH7CbXkbIYaQ3+rI4ifSZKKI2FKfjF2QTVL/oLAXEue9Wu6wOuElnvRhI91K5OFMc58OEVFUqXs7P+xabWq2CW2MYuA0Z0KowkaYgSB1ZR493n27M5TeAjfdq1CDZO4ZNZDPr3SyTuALMXDBVBY/OH34= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721197899246903.6017999242458; Tue, 16 Jul 2024 23:31:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTyCF-0000YT-Lm; Wed, 17 Jul 2024 02:31:27 -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 1sTyCD-0000QE-HW for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTyCC-00033Z-1l for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:25 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-551-UWncD72ZOu2GpoMvZZQpMg-1; Wed, 17 Jul 2024 02:31:09 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 70D0C19560B0; Wed, 17 Jul 2024 06:31:07 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.88]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4DC4F1955F68; Wed, 17 Jul 2024 06:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721197882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9clbyjDOn00YOAzPCTfJCWH3c4J9HrQVmDKgoi/2IAI=; b=IZB5EnYs4ToazuXP2QfLOx7pbNXhvL7a8BbGBf77K5AVv/OZQgvtbajAHIwHerh3JfAss5 VDSRJGO6bM+AA7LA6nxRmtbE/3m47trTb1jfilwuWwIhANLDLhOQeiUlcwjj0jHIff0DfA 236KZ8f4wy0IlB+hxQBe/8/SFTPquEI= X-MC-Unique: UWncD72ZOu2GpoMvZZQpMg-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Andrew Jeffery , Joel Stanley , Steven Lee , Troy Lee , Jamin Lin , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v2 7/8] aspeed: Introduce a 'hw_strap1' machine attribute Date: Wed, 17 Jul 2024 08:30:21 +0200 Message-ID: <20240717063022.549849-8-clg@redhat.com> In-Reply-To: <20240717063022.549849-1-clg@redhat.com> References: <20240717063022.549849-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721197899919116600 From: C=C3=A9dric Le Goater To change default behavior of a machine and boot from eMMC, future changes will add a machine option to let the user configure the boot-from-eMMC HW strapping bit. Add a new machine attribute first. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/aspeed.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index a8f5c14ae535..9939559f6dd0 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -46,6 +46,7 @@ struct AspeedMachineState { uint32_t uart_chosen; char *fmc_model; char *spi_model; + uint32_t hw_strap1; }; =20 /* On 32-bit hosts, lower RAM to 1G because of the 2047 MB limit */ @@ -393,7 +394,7 @@ static void aspeed_machine_init(MachineState *machine) } } =20 - object_property_set_int(OBJECT(bmc->soc), "hw-strap1", amc->hw_strap1, + object_property_set_int(OBJECT(bmc->soc), "hw-strap1", bmc->hw_strap1, &error_abort); object_property_set_int(OBJECT(bmc->soc), "hw-strap2", amc->hw_strap2, &error_abort); @@ -1077,7 +1078,10 @@ static void aspeed_set_mmio_exec(Object *obj, bool v= alue, Error **errp) =20 static void aspeed_machine_instance_init(Object *obj) { + AspeedMachineClass *amc =3D ASPEED_MACHINE_GET_CLASS(obj); + ASPEED_MACHINE(obj)->mmio_exec =3D false; + ASPEED_MACHINE(obj)->hw_strap1 =3D amc->hw_strap1; } =20 static char *aspeed_get_fmc_model(Object *obj, Error **errp) --=20 2.45.2 From nobody Mon Sep 16 19:10:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1721197971; cv=none; d=zohomail.com; s=zohoarc; b=ZKK8j0bWTxlKjQ5y3xS78sqrHb4B9ma9rldFdFMqFyNAkvnkyL0ail/MaSYTxYFYZDPIfSmqT8Ms210MnVRjjeJp2fYDFxIBonPS5/mtbUb5q+/S3vjtgJXQx+fQL4LN6QV5/MbWRqTYWQFjcaXiWB+0ghtrynACJWZh7uQAozg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721197971; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=t7SchGpbHIGXvEUC0Jr//SmRY8gjbq3nFK63X4vHCrs=; b=IdF2VPDH7WvjE3MGFGaNiy3nINie5xsB8T0O8vSNNSqwoC/t71jV17hmD8rPmi+zq35iWKHl4WF3Dg0J5RnkMwi9AIXzECqwBxt63WCqziC0PqZ1eMweiKqbrXUSklFHurV4K+wgttpkYVqxYIqOwxajt0G8rW87IT/bYhJ0yxo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721197971908319.0163157709725; Tue, 16 Jul 2024 23:32:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sTyC7-00085D-T1; Wed, 17 Jul 2024 02:31:19 -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 1sTyC5-0007kp-7e for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sTyC3-00032V-H5 for qemu-devel@nongnu.org; Wed, 17 Jul 2024 02:31:16 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-226-RxEGbl_dNFi2QCZmb4ljDQ-1; Wed, 17 Jul 2024 02:31:12 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9563E1956095; Wed, 17 Jul 2024 06:31:10 +0000 (UTC) Received: from corto.redhat.com (unknown [10.39.192.88]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B21D219560B2; Wed, 17 Jul 2024 06:31:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1721197874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t7SchGpbHIGXvEUC0Jr//SmRY8gjbq3nFK63X4vHCrs=; b=UfqpMHkLnS/+uriSmauubIS/zN6cX4wFDq0Iwu5bDcbe7vizblZiiR1memnERvXplDi7Fg 3p9gJe15VdOEekOqVwTOmBYqB2KkeOuhT86J02ggzjHlha/nGo/6btE5X2z8hXN0wtU/TQ 4lu3rVJ7mG/rwLUVIfahHLFcGLnvYj0= X-MC-Unique: RxEGbl_dNFi2QCZmb4ljDQ-1 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: Andrew Jeffery , Joel Stanley , Steven Lee , Troy Lee , Jamin Lin , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v2 8/8] aspeed: Introduce a 'boot-emmc' machine option Date: Wed, 17 Jul 2024 08:30:22 +0200 Message-ID: <20240717063022.549849-9-clg@redhat.com> In-Reply-To: <20240717063022.549849-1-clg@redhat.com> References: <20240717063022.549849-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1721197972427116600 From: C=C3=A9dric Le Goater The default behavior of some Aspeed machines is to boot from the eMMC device, like the rainier-bmc. Others like ast2600-evb could also boot from eMMC if the HW strapping boot-from-eMMC bit was set. Add a property to set or unset this bit. This is useful to test boot images. For now, only activate this property on the ast2600-evb and rainier-bmc machines for which eMMC images are available or can be built. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Andrew Jeffery Tested-by: Andrew Jeffery Tested-by: Philippe Mathieu-Daud=C3=A9 --- docs/system/arm/aspeed.rst | 2 ++ hw/arm/aspeed.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/docs/system/arm/aspeed.rst b/docs/system/arm/aspeed.rst index cd9559e3e291..6733ffd2b941 100644 --- a/docs/system/arm/aspeed.rst +++ b/docs/system/arm/aspeed.rst @@ -123,6 +123,8 @@ To boot the machine from the flash image, use an MTD dr= ive : =20 Options specific to Aspeed machines are : =20 + * ``boot-emmc`` to set or unset boot from eMMC (AST2600). + * ``execute-in-place`` which emulates the boot from the CE0 flash device by using the FMC controller to load the instructions, and not simply from RAM. This takes a little longer. diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 9939559f6dd0..5cdef873a5fc 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -1178,6 +1178,34 @@ static void aspeed_machine_class_init_cpus_defaults(= MachineClass *mc) mc->valid_cpu_types =3D sc->valid_cpu_types; } =20 +static bool aspeed_machine_ast2600_get_boot_from_emmc(Object *obj, Error *= *errp) +{ + AspeedMachineState *bmc =3D ASPEED_MACHINE(obj); + + return !!(bmc->hw_strap1 & SCU_AST2600_HW_STRAP_BOOT_SRC_EMMC); +} + +static void aspeed_machine_ast2600_set_boot_from_emmc(Object *obj, bool va= lue, + Error **errp) +{ + AspeedMachineState *bmc =3D ASPEED_MACHINE(obj); + + if (value) { + bmc->hw_strap1 |=3D SCU_AST2600_HW_STRAP_BOOT_SRC_EMMC; + } else { + bmc->hw_strap1 &=3D ~SCU_AST2600_HW_STRAP_BOOT_SRC_EMMC; + } +} + +static void aspeed_machine_ast2600_class_emmc_init(ObjectClass *oc) +{ + object_class_property_add_bool(oc, "boot-emmc", + aspeed_machine_ast2600_get_boot_from_em= mc, + aspeed_machine_ast2600_set_boot_from_em= mc); + object_class_property_set_description(oc, "boot-emmc", + "Set or unset boot from EMMC"); +} + static void aspeed_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); @@ -1377,6 +1405,7 @@ static void aspeed_machine_ast2600_evb_class_init(Obj= ectClass *oc, void *data) amc->i2c_init =3D ast2600_evb_i2c_init; mc->default_ram_size =3D 1 * GiB; aspeed_machine_class_init_cpus_defaults(mc); + aspeed_machine_ast2600_class_emmc_init(oc); }; =20 static void aspeed_machine_tacoma_class_init(ObjectClass *oc, void *data) @@ -1449,6 +1478,7 @@ static void aspeed_machine_rainier_class_init(ObjectC= lass *oc, void *data) amc->i2c_init =3D rainier_bmc_i2c_init; mc->default_ram_size =3D 1 * GiB; aspeed_machine_class_init_cpus_defaults(mc); + aspeed_machine_ast2600_class_emmc_init(oc); }; =20 #define FUJI_BMC_RAM_SIZE ASPEED_RAM_SIZE(2 * GiB) --=20 2.45.2