From patchwork Thu Apr 30 11:51:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 185890 Delivered-To: patch@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp1995516ilf; Thu, 30 Apr 2020 04:54:08 -0700 (PDT) X-Google-Smtp-Source: APiQypLZoK62sME5ZBs3r7GzBbvFkPMUhtP21MUR+SbQEtnq4tgR7YdVXyPEbt74vhuh03niEnWK X-Received: by 2002:a37:ac08:: with SMTP id e8mr2938172qkm.439.1588247648448; Thu, 30 Apr 2020 04:54:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588247648; cv=none; d=google.com; s=arc-20160816; b=jwUSD7F0bd06ufqDFMKIiHqOyhWusel1ZSTcrtdgRmk7OVFIhFvVeAppBRrGRsTOuY wReSWlZRiiyhwqVsXFoH+Z1FxbqN/JPMZXL2vkQYEbsyei1IWYe6L7u1tVF2EVl38hyk f2SE/ldGRXeL7PCEAw5AVGQjx+m+/2ikoWkk1CrKoi7yoGsRuGwkbtr/FDzZ3lOSBOsl kF8Kg8WLNt3Wl2tfAVxKJAJHrnW+VjnB4cad+v7xYPYKLxOKn6HTmWeh4c0CfERfazff hWSFTb9K2byVQt1DJueaCnO8ISEMEXJx2FB4HXLjL24VG4our13lcWdr1FI1Zw+Ajqy6 nY6g== 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=LRt+lYSZxICWhOZXCGhxNCm7v8wo6m7PPTzVoY8b3a0=; b=dwFQaTi2MwkElawj70yHDxBIk/D0bipSxEUUTCCkD7VUsZLQ3AIUopWOzb60gQEoRv qFPCgWef6zr1HCY/Arz3J0IG7vHNZp6RMfaDH/pjH9wxgguJhBPojnu7lHnw+wwxpHuE p1XGP4XxPVxmkOwYwc20tmDAPzna47vKAqXu2zX3aQn4aPCSfQ0JsPhR/mQZtprW80wP Cpm+hcyUEpqeni/t6NZG96UL6ihLVBwzACzmEk2LEjKeVtmU6gSUcp6o0APWdK+ET+26 E4Q2kQ0CcZXpeU0qdAgI6iUWk91teQI0NJ1TUmskZwBTEoeoOicHHAm5ReFfI0nv+3Ci onyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Q/mZ1ygE"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::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. [2001:470:142::17]) by mx.google.com with ESMTPS id l25si1303281qtc.210.2020.04.30.04.54.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Apr 2020 04:54:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) client-ip=2001:470:142::17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Q/mZ1ygE"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::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]:39230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU7lX-00065Z-Ua for patch@linaro.org; Thu, 30 Apr 2020 07:54:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33658) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jU7jK-0002X7-Si for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:51:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jU7jJ-0000Ij-UC for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:51:50 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:34399) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU7jJ-0000DL-GC for qemu-devel@nongnu.org; Thu, 30 Apr 2020 07:51:49 -0400 Received: by mail-wr1-x435.google.com with SMTP id j1so6545601wrt.1 for ; Thu, 30 Apr 2020 04:51:48 -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=LRt+lYSZxICWhOZXCGhxNCm7v8wo6m7PPTzVoY8b3a0=; b=Q/mZ1ygEfsJcFYtfk8Rb6ns5vCKF7xqY11Uq4q2uL23rmKeVi93hgQRZpQeM1kJ03U VIg2cO97UkM8PRijFuAeEZ7DCiCV1ral3XglmVvIGslWpEhdaoN8bP+vaPFjPyWnyiAP DB4dZaW7CnabmlytA4H3scZ8J6lLEl23yCZxa8klMGb6pMHyooOBB3bE86cp5aY/Nh9x aRVLXVj+MEl85c+fDaOvaknm3+CJg2Gdg0o8x+Cb3cGfS0nAwYTklJuFJBwVyW6qLiFI 5497vV4NLQVBrhuMeku0n1/pdW3ebQuHKJQs9qK+NR5zWQrdf4ji1jWCcrykXQy1de/D Sqqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LRt+lYSZxICWhOZXCGhxNCm7v8wo6m7PPTzVoY8b3a0=; b=iqp4EqR/l4klRf9kNHA7gs+ATpqHuWjTWuc9pn8ONoZBRR1AW3aQHpJp6eFW7FHTIt M9tvpZmEZT46cqRkxP2ZWLY+9vnodr+irk0mUBU4Yziau9azYP4DFEhGff5TJ1fLKN3Z gNoIk3nogabdtT2EqYZI1qbPVPYDdpHogbreRdOgAMLzk2GsSnfYi1RB/5cZIXH5Fy+x gVeyk4SrWHV7g8Mz8DU02HfXQE3O7tv4JQZeT2lC2Y1PsDosFPmwybkS5T1H8pVRrR2Y QE9AmpsDpZcfpOyKgfibS8aPqAwMWbx2T6r4rxWCfGwE1RQ6giAqFyjHOe6bAU9mcupQ LZMg== X-Gm-Message-State: AGi0PuYHOIgwXg8sZnI6YOFcw8WTgXNGdiXg+nWFUOpd4wIfv9nMh7Nh uJxwXsM0QH5sjDC1m2Lc2HMuSJd/N/DwsQ== X-Received: by 2002:a5d:4cc2:: with SMTP id c2mr3643097wrt.130.1588247507744; Thu, 30 Apr 2020 04:51:47 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j22sm491518wre.84.2020.04.30.04.51.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 04:51:47 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 03/31] nrf51: Fix last GPIO CNF address Date: Thu, 30 Apr 2020 12:51:14 +0100 Message-Id: <20200430115142.13430-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430115142.13430-1-peter.maydell@linaro.org> References: <20200430115142.13430-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::435 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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: Cameron Esfahani NRF51_GPIO_REG_CNF_END doesn't actually refer to the start of the last valid CNF register: it's referring to the last byte of the last valid CNF register. This hasn't been a problem up to now, as current implementation in memory.c turns an unaligned 4-byte read from 0x77f to a single byte read and the qtest only looks at the least-significant byte of the register. But when running with patches which fix unaligned accesses in memory.c, the qtest breaks. Considering NRF51 doesn't support unaligned accesses, the simplest fix is to actually set NRF51_GPIO_REG_CNF_END to the start of the last valid CNF register: 0x77c. Now, qtests work with or without the unaligned access patches. Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Reviewed-by: Joel Stanley Signed-off-by: Cameron Esfahani Message-id: 51b427f06838622da783d38ba56e3630d6d85c60.1586925392.git.dirty@apple.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- include/hw/gpio/nrf51_gpio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/include/hw/gpio/nrf51_gpio.h b/include/hw/gpio/nrf51_gpio.h index 337ee534bbc..1d62bbc9285 100644 --- a/include/hw/gpio/nrf51_gpio.h +++ b/include/hw/gpio/nrf51_gpio.h @@ -42,7 +42,7 @@ #define NRF51_GPIO_REG_DIRSET 0x518 #define NRF51_GPIO_REG_DIRCLR 0x51C #define NRF51_GPIO_REG_CNF_START 0x700 -#define NRF51_GPIO_REG_CNF_END 0x77F +#define NRF51_GPIO_REG_CNF_END 0x77C #define NRF51_GPIO_PULLDOWN 1 #define NRF51_GPIO_PULLUP 3