From patchwork Thu Apr 21 11:18:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 564344 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp366471map; Thu, 21 Apr 2022 04:59:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3VHgfbZOKevThK602yXqZchBw16np233tzYiyYD67BYM6xVbIRL2/7H/WapCa2hjGMCbe X-Received: by 2002:a05:622a:15d0:b0:2f1:f883:f697 with SMTP id d16-20020a05622a15d000b002f1f883f697mr15445396qty.106.1650542366554; Thu, 21 Apr 2022 04:59:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650542366; cv=none; d=google.com; s=arc-20160816; b=ydzpZEZX5llVwUAPNX8C+HB9K80g5sYYR1YxQ9/8v8I1+x3RO142kExS9P4O6uMA9E SoohFzuxJvSIM9CM+iwzjOS39xrVhhAODYLMjj8My0Bn3e9rbYHmd8YTvkPWJy5AlBVI NAMI5EDBOv1QZlF/J49RTdrWxqCB/1gsNvi7g8HRV10jH7a1i8t2u5b0hhnhrDr2e5jT WcxYyiIIqqx29H7oDT54UzQpyQdArrJ5ZUtCP2psFioJ86FZr6rLl9jddT6Brybur1Jh xQN12pctusQPtaHVl2zY+SbpYSHVOdC9ymNMTURJSF7DjQqtUaJ+qgTKMPLaNOmzvb6q xQrg== 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:to:from :dkim-signature; bh=VUeeNu4fbGv2sc/gKkaaAIAzl6d3eREzjCssGM3/Sx0=; b=Sw+XgquoAOEEO+vCBoXccxKec5HisJeG3IRyETef752OsIzRhYjXr1v5Ks3oxdmyJ8 CFWarGcKDOIwmY5rd9aBzSuXQ6Mqd2o++7M4lvMGHhgU/B5eciScVV/CO/m9MOtqwxHc g8ehLgkcKQzc5y3kMaS+wKQsQG/pHeD9KwR1McWwaWeiYnqU6VbGLa8omSzgUkfQaDAK /YLG8Ce2kmKHc7Pk5HD+j5/KJ6Nyalwewynr52nUWV0emaJAv8XcpILaP8TRCiTdjFRg K/xlq3Iy7A1+XPLHhvI6ZrdAhp9Zs4Pc7oVctAVBT5ZTBOCJFQPPY+vHUBAfe8eyeyV3 9b8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LLRSaHt2; 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 c11-20020ac85a8b000000b002ebccf4adabsi1311061qtc.481.2022.04.21.04.59.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Apr 2022 04:59:26 -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=LLRSaHt2; 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]:53796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhVT3-0005NE-6U for patch@linaro.org; Thu, 21 Apr 2022 07:59:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhUqX-0003NT-7S for qemu-devel@nongnu.org; Thu, 21 Apr 2022 07:19:37 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:44913) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhUqR-0003ZF-QB for qemu-devel@nongnu.org; Thu, 21 Apr 2022 07:19:35 -0400 Received: by mail-wr1-x436.google.com with SMTP id b19so6177557wrh.11 for ; Thu, 21 Apr 2022 04:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=VUeeNu4fbGv2sc/gKkaaAIAzl6d3eREzjCssGM3/Sx0=; b=LLRSaHt2MTUvjCW0k5r/i0vM56a2nM8UmXvsN1nlemxtwLbmsTt5LiiiNpsTJSmMGB g7rhw9goVmWM9PtBHaZY9fpExD0I6SSsybl+RaPpT/DkO8NmU0b9PslPqIzjeORtTCsW qKOWac3VpdhgSeqtcR2FpVsEtY8akNihOl0INLSEOnbPgPCByCuu+YJUuktOXRwb5YpP +2pnj3+yfU5X8RgpB3VPEf6gJaHbiCCiaJ4BE0sPWy3ipVRzP90kvcIEtZKYhtDh4z+b ycrZXgQRyN7EzPhHn76wFa1Y3ATVkIYD1Ds4/M0gTgWQdufGnbTI5tZsv9PB8Td6fKqg HYvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VUeeNu4fbGv2sc/gKkaaAIAzl6d3eREzjCssGM3/Sx0=; b=beNwGHQwUrWVzlZtnJhL0y6vJUlz5+eVA93t1xN084lQ6DHZXO+N2LfIl+kiZQ2KBG Gzc5n5ktxhHBvG98TWW0ibSFQOf/X8V8jMWYeXtTowkhAAh02WxwbAmBf5RSc2NF0tI0 M3uYqd+gv89FNvwCg1hOZas27j6KvqwM2DjRvX9WOiIEJ746ab/Qmx4Ayb7pdvOuLryl Zg6Y7SMggdD7Kcy3M+NO21WfGEIZ9wClDICAeHPwtAs1XUm7Ejihkx81EZuGp9VcZtKl Hk1WnXvsvExXQH1ou8NdRhy96Dm/LwoLqQJNE1pQo7xZqYUYFKjwo0cEapAcbBDHOwGw sB7g== X-Gm-Message-State: AOAM531RGeUkQjJGHG/+V92gj1dPWq5g5CMgWy1mekB7lXUYogYpb1SA Av/3OGaW7sSwtxUQkF47RAEtOJ4q6ODx2w== X-Received: by 2002:a5d:4a81:0:b0:207:9abe:2908 with SMTP id o1-20020a5d4a81000000b002079abe2908mr18820062wrq.341.1650539959284; Thu, 21 Apr 2022 04:19:19 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id e4-20020a5d6d04000000b0020a8bbbb72bsm2597694wrq.97.2022.04.21.04.19.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 04:19:18 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 31/31] hw/arm: Use bit fields for NPCM7XX PWRON STRAPs Date: Thu, 21 Apr 2022 12:18:46 +0100 Message-Id: <20220421111846.2011565-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421111846.2011565-1-peter.maydell@linaro.org> References: <20220421111846.2011565-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.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, T_SCC_BODY_TEXT_LINE=-0.01 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" From: Hao Wu This patch uses the defined fields to describe PWRON STRAPs for better readability. Signed-off-by: Hao Wu Reviewed-by: Patrick Venture Message-id: 20220411165842.3912945-3-wuhaotsh@google.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/arm/npcm7xx_boards.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c index 0678a56156f..6bc6f5d2fe2 100644 --- a/hw/arm/npcm7xx_boards.c +++ b/hw/arm/npcm7xx_boards.c @@ -30,11 +30,25 @@ #include "sysemu/sysemu.h" #include "sysemu/block-backend.h" -#define NPCM750_EVB_POWER_ON_STRAPS 0x00001ff7 -#define QUANTA_GSJ_POWER_ON_STRAPS 0x00001fff -#define QUANTA_GBS_POWER_ON_STRAPS 0x000017ff -#define KUDO_BMC_POWER_ON_STRAPS 0x00001fff -#define MORI_BMC_POWER_ON_STRAPS 0x00001fff +#define NPCM7XX_POWER_ON_STRAPS_DEFAULT ( \ + NPCM7XX_PWRON_STRAP_SPI0F18 | \ + NPCM7XX_PWRON_STRAP_SFAB | \ + NPCM7XX_PWRON_STRAP_BSPA | \ + NPCM7XX_PWRON_STRAP_FUP(FUP_NORM_UART2) | \ + NPCM7XX_PWRON_STRAP_SECEN | \ + NPCM7XX_PWRON_STRAP_HIZ | \ + NPCM7XX_PWRON_STRAP_ECC | \ + NPCM7XX_PWRON_STRAP_RESERVE1 | \ + NPCM7XX_PWRON_STRAP_J2EN | \ + NPCM7XX_PWRON_STRAP_CKFRQ(CKFRQ_DEFAULT)) + +#define NPCM750_EVB_POWER_ON_STRAPS ( \ + NPCM7XX_POWER_ON_STRAPS_DEFAULT & ~NPCM7XX_PWRON_STRAP_J2EN) +#define QUANTA_GSJ_POWER_ON_STRAPS NPCM7XX_POWER_ON_STRAPS_DEFAULT +#define QUANTA_GBS_POWER_ON_STRAPS ( \ + NPCM7XX_POWER_ON_STRAPS_DEFAULT & ~NPCM7XX_PWRON_STRAP_SFAB) +#define KUDO_BMC_POWER_ON_STRAPS NPCM7XX_POWER_ON_STRAPS_DEFAULT +#define MORI_BMC_POWER_ON_STRAPS NPCM7XX_POWER_ON_STRAPS_DEFAULT static const char npcm7xx_default_bootrom[] = "npcm7xx_bootrom.bin";