Received: by 2002:a05:6512:204:0:0:0:0 with SMTP id a4csp1283684lfo; Sun, 6 Mar 2022 23:20:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPYo7Omr9zT6E1pUbkRAWliYNKcHuWOc5t5MWdAxqjQDpROHuQDHH0musUZPbbewRLFiKM X-Received: by 2002:a05:620a:2a10:b0:67b:eac:96b5 with SMTP id o16-20020a05620a2a1000b0067b0eac96b5mr4017878qkp.452.1646637600385; Sun, 06 Mar 2022 23:20:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646637600; cv=none; d=google.com; s=arc-20160816; b=k11TfH//nw49ss+4p1DduuifNlWbrbEKteNhpuS1huMuko+cHvkdusmB+24LY3N3P8 Czl0D8p3KdQ42RhV2AZLCp+cy1dBQYAqd+w0/0WuMCt9Si2uOEyFEllVW56Cy/JuFEHb 7OPSJalTe3kfOBcmhF2xgEzGAUiZzZ5GWSu1DzUslwtnIKhhcxUnEevbWZaqviOZR+3+ eXo5LbHzS43hwAu/rp0MU2idOxIwHdOJnGknRkOwx5ckcPuPf0SAi2EyDAOgUYvMGM1O Z51gBygZy2KQThVJaBELFcDgG+COmA4CwdOG8ujvOn+Qd/eIS/vpilmMdqF9Oh74vSgt twHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from; bh=0nO2yBaIIB1UE/uPpEJIz47eK1cNZ3ofqEpb9nXpV5k=; b=ZGLkKHimwpqVKMSsnS1Txmqp9V8GOIojqLI3TfibQd94ZqIuDAMMg2SRPT3RMC2jsO 81HGccgYGv0Wab97Z5J0B1ax5k7MyAI0Xuk9OKHt4EzzqsuxvBKEo+KdY0kQjgtugoBY GSFAoqFQp3s5kbpJIEbfaYM5g/DU5EAXolkKghcIHTgHHjsafQA5RJYJnwuoK3cvZ75L xzpji+jmEpIDPW3KeoJpMYWQWR08UPW7UHJ3ve7xJ13xGNpfjzQeNi3kfFpjH3JuD/UY oItqbfo8gjdkfmg0qyPGB4BBAujGPKk7rtxpW4tWWT6ibZxqqY2QVgjOc9gnhU5U+z8J 22DA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=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 m8-20020a05622a118800b002ddd9f33ed2si4940706qtk.21.2022.03.06.23.20.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 06 Mar 2022 23:20:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=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-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:54120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nR7ex-0003Wr-36 for alex.bennee@linaro.org; Mon, 07 Mar 2022 02:19:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nR7eP-0003IV-ES; Mon, 07 Mar 2022 02:19:25 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:32564 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nR7eN-00038o-42; Mon, 07 Mar 2022 02:19:25 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 2276fvAE007425; Mon, 7 Mar 2022 07:19:05 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 3end0q8kvr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 07 Mar 2022 07:19:04 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2277IY9B032420; Mon, 7 Mar 2022 07:19:03 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04ams.nl.ibm.com with ESMTP id 3emk62j84c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 07 Mar 2022 07:19:02 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2277J0qA54985196 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 7 Mar 2022 07:19:00 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 99A84A405B; Mon, 7 Mar 2022 07:19:00 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4E06BA4040; Mon, 7 Mar 2022 07:19:00 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Mon, 7 Mar 2022 07:19:00 +0000 (GMT) Received: from yukon.ibmuc.com (unknown [9.171.76.59]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id 78FCE2201D3; Mon, 7 Mar 2022 08:18:59 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 2/6] aspeed: Rework aspeed_board_init_flashes() interface Date: Mon, 7 Mar 2022 08:18:52 +0100 Message-Id: <20220307071856.1410731-3-clg@kaod.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220307071856.1410731-1-clg@kaod.org> References: <20220307071856.1410731-1-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: GCfJPlbXRyN2La5q0XFSBC0NyNSDbWed X-Proofpoint-GUID: GCfJPlbXRyN2La5q0XFSBC0NyNSDbWed X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-07_01,2022-03-04_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 clxscore=1034 impostorscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=829 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203070041 Received-SPF: softfail client-ip=148.163.158.5; envelope-from=clg@kaod.org; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.187, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , Peter Maydell , Alistair Francis , Joel Stanley , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: MaL/KngbOEUb Currently, the allocation of the flash devices uses the number of slave selects configured in the SoC realize routine. It is simpler to use directly the number of FMC devices defined in the machine class and 1 for spi devices (which is what the SoC does in the back of the machine). Signed-off-by: C=C3=A9dric Le Goater --- hw/arm/aspeed.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 02918a594d24..be24508a9854 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -276,9 +276,8 @@ static void write_boot_rom(DriveInfo *dinfo, hwaddr a= ddr, size_t rom_size, rom_add_blob_fixed("aspeed.boot_rom", storage, rom_size, addr); } =20 -static void aspeed_board_init_flashes(AspeedSMCState *s, - const char *flashtype, - int unit0) +static void aspeed_board_init_flashes(AspeedSMCState *s, const char *fla= shtype, + int count, int unit0) { int i; =20 @@ -286,7 +285,7 @@ static void aspeed_board_init_flashes(AspeedSMCState = *s, return; } =20 - for (i =3D 0; i < s->num_cs; ++i) { + for (i =3D 0; i < count; ++i) { DriveInfo *dinfo =3D drive_get(IF_MTD, 0, unit0 + i); qemu_irq cs_line; DeviceState *dev; @@ -382,10 +381,10 @@ static void aspeed_machine_init(MachineState *machi= ne) =20 aspeed_board_init_flashes(&bmc->soc.fmc, bmc->fmc_model ? bmc->fmc_model : amc->fmc= _model, - 0); + amc->num_cs, 0); aspeed_board_init_flashes(&bmc->soc.spi[0], bmc->spi_model ? bmc->spi_model : amc->spi= _model, - bmc->soc.fmc.num_cs); + 1, amc->num_cs); =20 /* Install first FMC flash content as a boot rom. */ if (drive0) { --=20 2.34.1