From patchwork Fri Jan 10 16:01:56 2025 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: 856256 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp302071wrc; Fri, 10 Jan 2025 08:03:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUZmWSw5igGqJIFuvJKD79b7vx67kMIBtaW/mZCatyJxhHQTy4+rr5hPKWRmMEoZdagQBavRA==@linaro.org X-Google-Smtp-Source: AGHT+IHgiGdHlCslywXHmZcClAJzPzIegH7UcQOairhleshISYzZzsRDYkF7pjwNzXCgI3aH+lqX X-Received: by 2002:ac2:4c56:0:b0:542:8cf5:a3a3 with SMTP id 2adb3069b0e04-5428cf5a5ccmr2554739e87.5.1736525026035; Fri, 10 Jan 2025 08:03:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736525025; cv=none; d=google.com; s=arc-20240605; b=bhP+swCsOpKXe8/KxGGwXe4SIwvbB7Gn1Is1kbO6rAYUwUI6sYkcMjBOw41D2heMml hFeXeDwvNlgAd4gP5fDrHFG5CXp/C87zvGA15GBew7dv2pRj7axfy7UM/w+d8sXoDVaL GKUJ5VEtNWkqx+wRHMVk+peHsw7dfe15cA9PB0K5suRLXh6A8JEnY4SrwBHyiP9+DTYb h3AzC4BlWv2rcJ1fAVNatgxVPR+rmNrxLxva3dTLHrHnju3gFM48IXe3akXW/YVg2kw5 SvNdaF4cEvy2YB55MYEgHSZn0mw5VqmEm9GiX64leaKLv5n801SqiSeYOjVCrn3M4FUz gUsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=8OLaY6F/9sCWhpY75SuT5qJrpcYslGi6JHoV5OFmEC4=; fh=Uq4CCH4qgIScoA1ZlzK6h1LD8Rw6xac8JtYTs6G5zlc=; b=EsTc3wQhub6MsayRl4erfD6/rxEZortzkntAN5KfsWBW726YUMVuI40WBE6QITmnQf Twqq+orVLGIoCbOyIxVEhBcvGtev8x/jfHhSGym7IInFg1jwNc0BXrIG8jK6GYTqhrBf igWRL13RFM3yfUesDNwqX6cn5aE3ue+fIFA87UJMepq8n2rtNR5qNpYaBObCEimasQi0 OSAqK/Hld3tL+ug7R68lvfk+rtdIONdFv4vJVXWFJwXqA2P4kebJ0GBcbqlurxKi0ZU+ bHk+N7KU7DzUlw9wW2gDzshJgIvudqKLQULKHUDm/NxiLve7y/XZEUPb0MUvcHZ+HBmr 5vXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T+FAA+ny; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 2adb3069b0e04-5428be3eb65si1425177e87.28.2025.01.10.08.03.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 08:03:45 -0800 (PST) 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=T+FAA+ny; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWHTh-0007VS-14; Fri, 10 Jan 2025 11:03:18 -0500 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 1tWHSl-0007EV-Cx for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:19 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWHSg-0004BC-9C for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:16 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-436202dd730so16584775e9.2 for ; Fri, 10 Jan 2025 08:02:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736524931; x=1737129731; 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=8OLaY6F/9sCWhpY75SuT5qJrpcYslGi6JHoV5OFmEC4=; b=T+FAA+nyOKwyshWmmtkrvFF1xwpqpnkjsmAHRpOoq/Aoj5rTl+VhR7dbtBW1nlzejQ s8CCyxsYIeVC7dZyr/YQEaVvW5sm5uCDIaRkNcLpzdfXytToRPNj2FVEvxyl8JqGMQ6O Pc9E/fMQZtLrtoUpzgxJQk0aSOefNktYJCzmeoEOMzLpFy893NOhTOCJrLfkMRap1VDM geRTJyqH822K/H5tkeXr7lbQJ7Lg0lWBiiQs62Cc4jZ55kZIm27YmZ4RqZK5DOfWtf7Z hACn6F2L61UvW6eMmG98XpFKxvjPsNDB5/jYNUNSc/4wP2Sbk6Q8r2KbhrxAxJZ49tEB H1/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736524931; x=1737129731; 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=8OLaY6F/9sCWhpY75SuT5qJrpcYslGi6JHoV5OFmEC4=; b=wFh3mEEgVTEy3VO4hBsEV5H0dJQNidEsSHBTCo4/Msu4E7xavUGd1480u7pip0BZfk Kon8YAqy+wAFc1v504eXOhjP2CqA0N29CNHM+9MzV/K6pAHiW+ZEuaVgYHpY/j2ycPb3 N7It5Nruz5PbxP72COGs/aw0NJx0qzjmkABoEEkDpV8vRYpPWkVn8yIAfg0if7QzKEWZ u4HP7rSzarB2w+JcLH3TILUO0eWNfX5/FAfIh6JAWRjVF5Zpfm1dx7xkHky7uF8I6aiv PbKZo5SY1xDs6547rbg4dDWnMrNjUAJMfa9A0sDzQ63G61AI+uXKerWrdKP0QQU69T0a b/rw== X-Gm-Message-State: AOJu0YxgbNFaeHjGH+pkXxdd1uo9EiCtcp39j9KmLOOSRGKfA6vN5XB7 sicJ0Dj79T6JHewwmXhzEejCXX/Ytqu0muEoAukQjsroP2F6DQ9ETnmsrma+fenjiagFH1cr7m+ uflg= X-Gm-Gg: ASbGncvnPI2KpSf2/fh52A1516JUemlMu+yYLwVWqlFG9ET36pGYIknHJATKksab07L jVWV4uFYuwtadU71jv+5qWshXyQhgUQj5g7Rrx8yV2/mVzMPc5lI5tsRfkGmd9evAIjNQPo5Vju sVNFxQTL8v4Cu+Oy12RfYPZrB5SUV3MvpM0qNGCXPdxzzaCnsoZ0oi8mV/SyblhehLaJQ2GFNiC pcescMrWXJp13lZRhXOFcehyKEZ4e44ujUUANW2aQBn/lsY94ABpEXhDLVzbYtV9tDvXSWGz4Wu Sj4J+gXhN9h+ML5xepYQ6hlcvpih410= X-Received: by 2002:a05:600c:45c3:b0:436:aaf:7eb9 with SMTP id 5b1f17b1804b1-436e26f4ae1mr102177955e9.20.1736524930526; Fri, 10 Jan 2025 08:02:10 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e384054sm4880929f8f.36.2025.01.10.08.02.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 08:02:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/9] hw/arm/stellaris: Link each board schematic Date: Fri, 10 Jan 2025 17:01:56 +0100 Message-ID: <20250110160204.74997-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110160204.74997-1-philmd@linaro.org> References: <20250110160204.74997-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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=unavailable 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 Board schematic is useful to corroborate GPIOs/IRQs wiring. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/stellaris.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 1bba96df14e..9b414ff9069 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1379,6 +1379,10 @@ static void lm3s6965evb_init(MachineState *machine) stellaris_init(machine, &stellaris_boards[1]); } +/* + * Stellaris LM3S811 Evaluation Board Schematics: + * http://www.ti.com/lit/ug/symlink/spmu030.pdf + */ static void lm3s811evb_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -1395,6 +1399,10 @@ static const TypeInfo lm3s811evb_type = { .class_init = lm3s811evb_class_init, }; +/* + * Stellaris: LM3S6965 Evaluation Board Schematics: + * http://www.ti.com/lit/ug/symlink/spmu029.pdf + */ static void lm3s6965evb_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); From patchwork Fri Jan 10 16:01:57 2025 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: 856261 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp303380wrc; Fri, 10 Jan 2025 08:05:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU4kHC5MYYEe6bHn/dSCy7FGmsOSuLY1pGq2v1QqzvsR2GH60SHAhfFLVYMlTW6UflRHYphBA==@linaro.org X-Google-Smtp-Source: AGHT+IFT9hc027iyYfHwqupEHIJ6Qt+NxWmKIzHl0QRt1IhoMoyGMek/aKaq/TkLLVYKthYs9X9D X-Received: by 2002:a05:600c:4511:b0:434:fe3c:c67c with SMTP id 5b1f17b1804b1-436e26e51eemr92940265e9.26.1736525130469; Fri, 10 Jan 2025 08:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736525130; cv=none; d=google.com; s=arc-20240605; b=BHCJDwu+cn9nV43Dv+u7KWj/4sUG8ZVhG+/sWoA6igXrkvi+8lDnzJ67x378hpKWfn A8WdjUVZYSoTrAinFgAdDPv4BMiv97qryrAHkL+txdgjn8tlXJw4gos3KRBEw8PXdVS6 NLeyNz9ZHamTp9M5zfe4LRF0UGKwOfSbCGe01wfHAWkcX8X+iT9aqbM8HwPLnK9MfU3E O2p/uRERosEqmuIrzEmj/SjMI+Gr3P5JKvM8e+sRfaV0GQFqD9duh4GReHaBDdtN9a/m nQQur78slmQ6EaRLbVUTNTXQPB07mzEjzk+0E+6i5VaWUxA+uPeZupKaZVoSyuOaBNQ8 wO3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=+1SHV4ouwmWCxa4hls/VEliYDrrRoOnyygtn8mgw1kM=; fh=Uq4CCH4qgIScoA1ZlzK6h1LD8Rw6xac8JtYTs6G5zlc=; b=cVSiYwcA2vpc8FdCBz4M/bvAOmrHlr0wj0z62aZFKe/9xBZbvz7hvaC5zUqCEkCK9F spuyraTIObl8RU6lpT0j8/v9mn2qhX57sB7kpEZvXwLsRjUeqK8o83cxTsM4TfG1jvY8 tLw/Yhhbe50sm4BZ+vLRGRvIpef/ZwZcZEqzDCLLwdSSEp4d/QEWuyDCzH0TtcvY1uPN cG059J7AJAbYp/1APs1gyM3p1ueyFrphoDsecK3EPA5h9S79IpslGWheeaVmjvX6fN+I cUODwpbG1sjWRJE52FEMiDgRMWLVKiBCQGT0gAMSjWCuP+cpEHG0sS1Q6fzJbNHwzWXT QdvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YCW5VyiD; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 5b1f17b1804b1-436ea3b2df4si26950975e9.40.2025.01.10.08.05.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 08:05:30 -0800 (PST) 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=YCW5VyiD; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWHTo-0007gi-DQ; Fri, 10 Jan 2025 11:03:24 -0500 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 1tWHSq-0007GB-3W for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:26 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWHSl-0004C9-5L for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:21 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-436345cc17bso17025165e9.0 for ; Fri, 10 Jan 2025 08:02:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736524935; x=1737129735; 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=+1SHV4ouwmWCxa4hls/VEliYDrrRoOnyygtn8mgw1kM=; b=YCW5VyiDAxjhZbB1P6jmdgoxRqXchg1SqeLkZLeiikLr9RIxth2PgjYd3Nqi+6skwn pUS6ZA9WZD06I1Ku3+actb+fwPPZep+b5mBC5QYR9kOmGUGSIvmJF4Dh8fIOt2710Cbd u1Z57J2694spJhLJnXwyvth7Tm0GSSb8QpgFNz63agok4JOqpynyZHLGoMxfEqfWVqYC 5+rLOjNCV9i6h+GqgdKxumRwKHYO5y+Hu2Gi6/JgEkzPAxCPIHkbyRaoIzSmLJLqKwgT bLSGNMPzT/bz4zokIkfYmMOmJwwAhpDlftvdN/sizW3L7KmVPA0yMi/2wPaEBZyLoXdD /4qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736524935; x=1737129735; 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=+1SHV4ouwmWCxa4hls/VEliYDrrRoOnyygtn8mgw1kM=; b=KB8ESEzDYAalAr8B6wwlYOo8eoKOIqOKnTmOeH9Z1hJOnabmpPKhGbZPT3ZxpahgtK iKJYe1iA1/OCRs0M8vnfJOruBNzF/vSG7eS63WAjw1y4HRCSmQKC3nHbELnjyBRpeWYf dd6mEHPtm/JmWfW2CaesKBqE4wCoYJdlR76dzv/AVuYfYG/Qn7sfEMo5oaCOHKDJ0h85 V23UQXj3I9AbVo386sJQqaCvNLFTgNPZjH6GE4guSgvOH0LInNqSkzb9SYDM8/7iqxxD zfkMmPBteQv2wuq6KceqMnjALb76BEuZrpXsPmWjcqsJzuiUY6W4ogy+wYJ5K6zbDsjK Dp9A== X-Gm-Message-State: AOJu0Yzo32gyASCXJqFPSbl1nRt1tTSWP4UFtW5f054NKsYZF/BMdxQS 4dGjTmwoAXgarsMUn+XMC2QmTk84LkhM4BSHHNTuyfnkBAI7jp+v922O/ccmq64DWjkf/Nga+p+ oFCs= X-Gm-Gg: ASbGncvhBH9lxRq5QFltYHhe+qyf5Xpw/9k4veWthY5nqAXMrWWsMsy3mmAJIYcxBgx 955133eGKRTzsJ/VUztx76o8SmigBz3/sWqVXIpC/58Q4uqcaql5kpAXWjdywMkMhilCeVhjnkz euI+SFn+2MoaopEd8FXYRWl8TMzv6wVIeNHBaApuBYvjgFEJxsUIHszS4Nc7gIjJysYaQlYrASh cYmwBD7ZY6y17qimwVHRzo02pvG5Qz3B1Fab58LISy7uQht3LwfD3B6KQtTJ6bH4p4Sqazbra08 Au/u983c1ZsjaBIUqRxFfBLbkU2KcXM= X-Received: by 2002:a05:600c:3b0c:b0:434:fbda:1f36 with SMTP id 5b1f17b1804b1-436e26e51a0mr99968965e9.20.1736524935062; Fri, 10 Jan 2025 08:02:15 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e37d69sm55675815e9.30.2025.01.10.08.02.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 08:02:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/9] hw/arm/stellaris: Constify read-only arrays Date: Fri, 10 Jan 2025 17:01:57 +0100 Message-ID: <20250110160204.74997-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110160204.74997-1-philmd@linaro.org> References: <20250110160204.74997-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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=unavailable 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 Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/stellaris.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 9b414ff9069..7c9e7e6c15b 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -101,7 +101,7 @@ static void ssys_update(ssys_state *s) qemu_set_irq(s->irq, (s->int_status & s->int_mask) != 0); } -static uint32_t pllcfg_sandstorm[16] = { +static const uint32_t pllcfg_sandstorm[16] = { 0x31c0, /* 1 Mhz */ 0x1ae0, /* 1.8432 Mhz */ 0x18c0, /* 2 Mhz */ @@ -120,7 +120,7 @@ static uint32_t pllcfg_sandstorm[16] = { 0x585b /* 8.192 Mhz */ }; -static uint32_t pllcfg_fury[16] = { +static const uint32_t pllcfg_fury[16] = { 0x3200, /* 1 Mhz */ 0x1b20, /* 1.8432 Mhz */ 0x1900, /* 2 Mhz */ @@ -964,7 +964,7 @@ static void stellaris_adc_init(Object *obj) } /* Board init. */ -static stellaris_board_info stellaris_boards[] = { +static const stellaris_board_info stellaris_boards[] = { { "LM3S811EVB", 0, 0x0032000e, From patchwork Fri Jan 10 16:01:58 2025 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: 856265 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp304083wrc; Fri, 10 Jan 2025 08:06:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWgJizWhPlwJXIotPDst5j0URt3zwdN3uvV20bclgyMgPYhNVH5DGkH5XPdy8YWx+Dv/Pj2LQ==@linaro.org X-Google-Smtp-Source: AGHT+IE3LyKzaeWKrSeEh8Yxx9cqYWuocugaHzNlEaWr/ySE9WAs8NpI4sB85bEGfLUWV+IrdIZq X-Received: by 2002:a5d:5f52:0:b0:385:e8b0:df13 with SMTP id ffacd0b85a97d-38a87308ab0mr10624572f8f.40.1736525188137; Fri, 10 Jan 2025 08:06:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736525188; cv=none; d=google.com; s=arc-20240605; b=j+hfKysMDRgtkBgec054AsOB0RHGqSpPF1hYu+9ArGMvvCgz1Tp4RYKMt0/C7IALnx fwLwRnn2ZXvTKlof1n8d9pKDsL7eNGJR8VvPiMMyeqYZNrkFTc59FzktgYfOAADT5cFG Bzwq72qMv7jWZgxtYlSMVIn0YwvptkDdhl2mf1SalEzgQR9FVUPXGPwDrDOSRPvdygcn Z/GRU5WdaFQRUNkPmOO34eHAFCchwuDsbecypscdpJkbi0+tvoKOJZubsjC+JTk39RKd E5cqd/ZuSlyhRrQiA+8NDmeesJw/g/yWrHRbu2rZco7eqSUE6L2AyoxzeOHHLi7NBY3p hEKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=f63ecg0nif+jK+DGCLVe+u7mEjni/luwZDTHSRxVLnk=; fh=Uq4CCH4qgIScoA1ZlzK6h1LD8Rw6xac8JtYTs6G5zlc=; b=dE1QSE1B3C7HOfuS/3Y9jJ9eM87lRiOtUTtaKRD8/JUyE+aFc4wBllhVxODi+p9ezO gZzM/YnvYQ5J8CPpTUtH4gWHhfvTTWLp4ujIs5AgDYQbxqi1m+xzVNT9u1ugpuA3hD11 3clz+mWIfSm4LHTigCwSqX9hF71/AGz3QdUy5P+seVd/w6kT4GWZeOab8DFuTvznAAf3 PqG5d4AOdCCr/RE+vU8BZiAncn3w9Pi1mDQ/tDv7No/GrIz/o1dZtVbrsLdOSez8/18V zVQWRZJHOhZmP0B84OJpNQD53hzFmOhZ+jVDKc5dCstcDqxlwQ9OMCPHFIl7anJ+H9Nu +dkA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="K6NlI/3L"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ffacd0b85a97d-38a8e4dd588si2668146f8f.700.2025.01.10.08.06.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 08:06:27 -0800 (PST) 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="K6NlI/3L"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWHTp-0007ie-CT; Fri, 10 Jan 2025 11:03:25 -0500 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 1tWHSt-0007GS-UV for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:29 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWHSo-0004DD-MY for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:25 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-43621d27adeso16641315e9.2 for ; Fri, 10 Jan 2025 08:02:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736524940; x=1737129740; 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=f63ecg0nif+jK+DGCLVe+u7mEjni/luwZDTHSRxVLnk=; b=K6NlI/3LfsFjXpj7n1dvjxw9nJ0wR6RQ6h1cmakTekEknBKEBgY2mG9wX9rrN9AKaF BhgQd+o5lY6j/YuTpyKopSTBpfEwN/ZOiB942Yq+Xow0goFaM3w/eY2wHXC1L5aNbxZa JQDQ8gZVOu8mQO/MxiuBKQnJsgFiS02EVLtYUmQLSlKKIuCqnf/bNIFSKmYYSQICvqPs YhKoq4ky/odDjektYA4KZBneeP+E8YJxyO4xBLOcH0j4vaJfxvkW2+HWWjjHFiCLBChB mRq9MmNRIB2zvPBd66qk5kmqZTQa+WDPbxaFCybDIV5sy8mKwL6MXFlLq8tk8WZsCkGi sa1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736524940; x=1737129740; 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=f63ecg0nif+jK+DGCLVe+u7mEjni/luwZDTHSRxVLnk=; b=qVAElYiYMhaNHeCrUcGi+NcA9ZpWZYXLRTsPVdX5+FrGp22ZdvwxiULGRKSvxcKcv0 na92yroUeHSx5MEFE2MgkWuCS1E+hw0WrKyJg3QpG03/0jrV7U+u+E/UL+b/gYw7zHUA /UnJcDXdGs4htxTmgGfORfOtsAlLUA5NUQreMJUF/kkvGURjoyBQmjtEQteE/hVEQR1s 47WrLx6LfF8vaJN1Aewvc1DxmRA7TKnM7m0FqGwTnvH/NbFvXf90rV2x4R+EsczepPZ0 7Vfems46pwxv9Z88SbKTAOB4TpC8Iqp4rCWPWlIyT4KPiSwbTEfVBTmO4S9krt6GcQHZ h8Zg== X-Gm-Message-State: AOJu0YyDvLbNyjM8momJ9dnCgB7T9D6O1i4VAYFFjk4gq7xgEopXx6Nx Uzt786Xm8sNb5YB5k+RrD3r2rAHtHOHLmPZEDdrp9ckWjVx+DoWpn/e83njpcVYyeYFHmBkbvAd cSJY= X-Gm-Gg: ASbGncsL4TJBj1WCZgXTa1WldOYpQBRGhAbFq5YxAmqT9E0L1FjhwP0QvPB9ea/IiH+ reiTVpCSacKTnnAlhozLL7QlLQAAQNNe7FcW5Ymb8HP0oytiRZ1mHhabHBAmoD6x69m5mC/no06 cab3VY/XougsQDMVhHXu3HgSWrQHj+6v7FpO4JdeZehmfEoeBiUQGZ+zrMtTbxAvS5C/onlXMQN E1S7d9bXl5jZANuPcSJY/PpJELTLMpk72gH4REQrun7BxxUmIbZoVa3wdstaqz3q+hBxZMOHqq2 S+EfjmthYFV0NGNU/rbUhZVOmsuyvLo= X-Received: by 2002:a05:600c:3b02:b0:434:f5c0:328d with SMTP id 5b1f17b1804b1-436e26d971emr94638765e9.23.1736524939809; Fri, 10 Jan 2025 08:02:19 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da63eesm90389005e9.3.2025.01.10.08.02.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 08:02:19 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/9] hw/arm/stellaris: Remove incorrect unimplemented i2c-0 at 0x40002000 Date: Fri, 10 Jan 2025 17:01:58 +0100 Message-ID: <20250110160204.74997-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110160204.74997-1-philmd@linaro.org> References: <20250110160204.74997-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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=unavailable 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 There is nothing mapped at 0x40002000. I2C#0 is already mapped at 0x40021000. Remove the invalid mapping added in commits aecfbbc97a2 & 394c8bbfb7a. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/stellaris.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 7c9e7e6c15b..254f7a234bf 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1001,7 +1001,6 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) * http://www.ti.com/lit/ds/symlink/lm3s6965.pdf * * 40000000 wdtimer - * 40002000 i2c (unimplemented) * 40004000 GPIO * 40005000 GPIO * 40006000 GPIO @@ -1356,7 +1355,6 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) /* Add dummy regions for the devices we don't implement yet, * so guest accesses don't cause unlogged crashes. */ - create_unimplemented_device("i2c-0", 0x40002000, 0x1000); create_unimplemented_device("i2c-2", 0x40021000, 0x1000); create_unimplemented_device("PWM", 0x40028000, 0x1000); create_unimplemented_device("QEI-0", 0x4002c000, 0x1000); From patchwork Fri Jan 10 16:01:59 2025 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: 856263 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp303602wrc; Fri, 10 Jan 2025 08:05:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWmTkQjUyUSF4tB4dys2TdrtjIRmgt9rJI9XD/AzC01ZMwzlasuFA25nSabCN5Gx3yaOMGPaw==@linaro.org X-Google-Smtp-Source: AGHT+IHbX1zrD2xd7gFu7tngaWs4puE3pHoa2kkjeWiHBqS/HcRZFAdjR1zjdeuRG6C1t0rhZVa0 X-Received: by 2002:a05:620a:4005:b0:7b6:ebb8:14e8 with SMTP id af79cd13be357-7bcd975d903mr1542204685a.29.1736525150681; Fri, 10 Jan 2025 08:05:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736525150; cv=none; d=google.com; s=arc-20240605; b=Q2ZKdYUUUTb0JNH+CMINPmglZ3g+juaBndeWdd4AI1HAKTPAC+TNo/IAnGNW8SJO0Y aSULiPbOPnI0Vg5/ExVq5SHaP26evndT1Hnf3rN6je9YqkEvYelriFLL3ny2rgNg+mqP 9DI2Np2cKo4B5omcvgWifnDoD4gozVngCPkeXSQu6jtw8VHFA1D2s8fSD+t8UqTwN1L9 r+g16QZ3etU7zdVuZ/Z64kQrZA/d1kuoZU5xUcGWxuj+whX0PeY9CZaCN2uY0PsxOUIA Pn6OhfneuP1Cy/xmadE9hiGWzdSMBuGLZ7F5UCXxgCY7Gsqgu2mJwAm4Kuz1tvROCs7u y+6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=jNnZwPGg9I7cmBuNCb0r/kiY7/oGOFV7SpkVL4fmHdY=; fh=Uq4CCH4qgIScoA1ZlzK6h1LD8Rw6xac8JtYTs6G5zlc=; b=JQLsabBcGSRf4kl2Mu/OHrtCaccf0C9OQIIWkaFUh44U1CmxRMKOQE0NCQybJHLJbq h0aEVVELLvoxnHtIFqKuoQ2VNmTa4kKZ8+n3CVkmvK+Cg1kX6FyUMBivG3E79Y5ar+X8 aRNMpM1pAp8oJCeAr6hjTzLH4mlUQNJvLZEqwkqJbvXduBL0XXPZRSJZ8KTml3netvSy PAzw9cU52gjHOw3+NaMdwKmme4fXbq0rDFBrl0M1JLyHR7VsMIgHLrUPXY5J/4ip0Sag MXFbDbD9vLd63NMdahq3co+p9fEGSqC2oFYIZLgHCM+Cwgt4xQr77xOPlt9v3aO4U5o1 JrGQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YVGt4BFV; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a1e0cc1a2514c-8623b3dcca7si829588241.128.2025.01.10.08.05.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 08:05:50 -0800 (PST) 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=YVGt4BFV; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWHTq-0007js-H5; Fri, 10 Jan 2025 11:03:26 -0500 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 1tWHSx-0007HV-92 for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:32 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWHSt-0004FE-Ni for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:29 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4368a293339so25797995e9.3 for ; Fri, 10 Jan 2025 08:02:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736524945; x=1737129745; 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=jNnZwPGg9I7cmBuNCb0r/kiY7/oGOFV7SpkVL4fmHdY=; b=YVGt4BFVhvuYPrg9itQb0GUOvcULsk9PmsRaoo0JpjhYCmFyqFTRKKJSadbof25nHI ecxHx5RiQHY3Imu7hBXDRi2Lbr9TUY7NKgX9+ZHf2Y3M682STr9g6KBSwhEMUXeI6qUW vJ8/KNtXsDSxkcp/WBT7ZpD6iJh1Pt5r6fqnHNeUP9D8yBwbLgm3OmAbJq2F1rqT+iYr ywLNfbqz6K1tD4ry6zGTdnIJ+AgDK+eJoDNYXaXzlDdGRxAPrPuRhxXLhXEYpOrgxlHL kT3z37Tsqdx1r/RYH2jDn5xJrIb/f6d//r8++ebFUrJGWWECoQeUunZo58hqCDJ9KuRW buRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736524945; x=1737129745; 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=jNnZwPGg9I7cmBuNCb0r/kiY7/oGOFV7SpkVL4fmHdY=; b=kPK/i0JQhvpbsLAJzDHWo+aSTsSbQYn0jfzQtNNSVZyLnOWoB3ibjbFsSrjWDVRYYb H/F2NdEqUzPK5s2xqjwVLY+7vbPmtLqk4H11COe9/Sj74hpRuJboBBj5MRVttNmpfURX QK4xU7ebdbvFD1GNEKWRRpTKtVcu/6VzrT1HsxU34F09nfx7JpmcOIL3FIHNO9Q7k9qZ 7J70mGN3XxYkzNqygKCQG/gfL6cOvpxF0Sg6lKhIdnc4xPPX3AVe4Tx0sDBQ4XgNospl H1h4a+eK4gBFR4GANWCmwnsSAc+ovYNZOZDRtvCWS2K+QpsU9JIx+PwndVIVnMvkj2Ix C1Zg== X-Gm-Message-State: AOJu0YyX10O130xwtYZ68K/cqV0gcvn93fHbpD1RpfgVFVSAidVpQ2N6 4gLfG4gle7wI8MBuT8j7hUyYwYp5MXcAc9q+l7bk5xFOGKFMOMsBJ12vjllNpL2MO2xm647W2Uv Qjuk= X-Gm-Gg: ASbGnctTQhcARQawaRqbkscbgtufsMARN6ldQyw+oexc8dC6QEPe0oFUMfK2bap/NJe rsucZMAFX9RH5L3iqFsahi+pNi1UvwG/BwhJ0yEUt/Nsxzqaq3EV6YVgIZVQP+S4tpRTqhClTPp ZLeKmRWmJiRf6Tl8KrtNM6kVUCG/z89MdsNmufHWEgJ8H9Pi/r+HzPnSLjrpnfu86YbSMBCFv/T TpY/SYU79OGSd+tIUtBUzEdt7nB9nILWY3hruWqZ8f3xXi+Kpdlj0PiPKEqMEAVw03rXNCyOIwe tiBGIwjozN+bvUQk7CIZHQAH4BefS7o= X-Received: by 2002:a05:600c:1d0c:b0:434:ff25:19a0 with SMTP id 5b1f17b1804b1-436e2706f7emr92076505e9.21.1736524944309; Fri, 10 Jan 2025 08:02:24 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e03f62sm55756165e9.22.2025.01.10.08.02.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 08:02:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/9] hw/arm/stellaris: Replace magic numbers by definitions Date: Fri, 10 Jan 2025 17:01:59 +0100 Message-ID: <20250110160204.74997-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110160204.74997-1-philmd@linaro.org> References: <20250110160204.74997-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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=unavailable 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 Add definitions for the number of controllers. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/stellaris.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 254f7a234bf..b4c3412c490 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -49,6 +49,11 @@ #define NUM_IRQ_LINES 64 #define NUM_PRIO_BITS 3 +#define NUM_GPIO 7 +#define NUM_UART 4 +#define NUM_GPTM 4 +#define NUM_I2C 2 + typedef const struct { const char *name; uint32_t did0; @@ -989,12 +994,12 @@ static const stellaris_board_info stellaris_boards[] = { static void stellaris_init(MachineState *ms, stellaris_board_info *board) { - static const int uart_irq[] = {5, 6, 33, 34}; - static const int timer_irq[] = {19, 21, 23, 35}; - static const uint32_t gpio_addr[7] = + static const int uart_irq[NUM_UART] = {5, 6, 33, 34}; + static const int timer_irq[NUM_GPTM] = {19, 21, 23, 35}; + static const uint32_t gpio_addr[NUM_GPIO] = { 0x40004000, 0x40005000, 0x40006000, 0x40007000, 0x40024000, 0x40025000, 0x40026000}; - static const int gpio_irq[7] = {0, 1, 2, 3, 4, 30, 31}; + static const int gpio_irq[NUM_GPIO] = {0, 1, 2, 3, 4, 30, 31}; /* Memory map of SoC devices, from * Stellaris LM3S6965 Microcontroller Data Sheet (rev I) @@ -1030,9 +1035,9 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) */ Object *soc_container; - DeviceState *gpio_dev[7], *nvic; - qemu_irq gpio_in[7][8]; - qemu_irq gpio_out[7][8]; + DeviceState *gpio_dev[NUM_GPIO], *nvic; + qemu_irq gpio_in[NUM_GPIO][8]; + qemu_irq gpio_out[NUM_GPIO][8]; qemu_irq adc; int sram_size; int flash_size; @@ -1123,7 +1128,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) } else { adc = NULL; } - for (i = 0; i < 4; i++) { + for (i = 0; i < NUM_GPTM; i++) { if (board->dc2 & (0x10000 << i)) { SysBusDevice *sbd; @@ -1157,7 +1162,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) } - for (i = 0; i < 7; i++) { + for (i = 0; i < NUM_GPIO; i++) { if (board->dc4 & (1 << i)) { gpio_dev[i] = sysbus_create_simple("pl061_luminary", gpio_addr[i], qdev_get_gpio_in(nvic, @@ -1178,7 +1183,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) } } - for (i = 0; i < 4; i++) { + for (i = 0; i < NUM_UART; i++) { if (board->dc2 & (1 << i)) { SysBusDevice *sbd; From patchwork Fri Jan 10 16:02:00 2025 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: 856260 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp302960wrc; Fri, 10 Jan 2025 08:04:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVhSh09T94W3CvenqOfQwwU5n8UO3a4wq2o6hKqNSIPeUyxXmD1es1QBvPQudfnxzmirkJUwA==@linaro.org X-Google-Smtp-Source: AGHT+IEhCTzNnAaJA77mKezxsyhaqtF4497Hvj8nzv5S7w4wYj763+tyk4a0jZTJW2aktnwkOkz1 X-Received: by 2002:a05:620a:404b:b0:7b6:eab3:cdd4 with SMTP id af79cd13be357-7bcd97705fcmr1760290885a.50.1736525095554; Fri, 10 Jan 2025 08:04:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736525095; cv=none; d=google.com; s=arc-20240605; b=ON9crSTX8qLIwvAR6bsO9lhEV7ZusVabgHlPTzeiTHLSPGhJ4NCPx3S1i6xUz7QiD2 Td4kSpcUzPc9Jwex/YvXgBvjmTOJsh7Gi1felMAk1JjYGz3I0SHociG5N2pIJ/UXuJdR 1O9Fy678D+eksyRF6aDAEmCOIhCyQn5pyJW8sJ3q+U8jt8PA5dwVo1gEL9J9FqIJA7tU nYyM9c1UwsUKdvVY1E/T3T9bNDaM8eGkF3n8R+HajEBvDIw/mamlDtsAxHyt57ib1i2D QEsbsFeKsp++Uunc5+z/0+qahZcwY5+zlWNBuRc1sJ5np3PyGwDCSFXWSPU0FJiZUvqc HzTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=9qvogJW6MPYSZINAUIbPGEHr3cB+ZObTGCx80VbT3Tk=; fh=Uq4CCH4qgIScoA1ZlzK6h1LD8Rw6xac8JtYTs6G5zlc=; b=KhinWXCBO6Lhr8/qaNw2+OkixsCrFaNI2lUIQIBJtx6zjgZb/L7GSU71CW1hxmd+Oz H6v1t3xKf0AnRbDzytR3faHAju0ncpqT/z/aOILIwypwGLxTHyt87j7cVuGkuowUN4Vv VBO2TioMHEuAC1gKXnF2uELDN3u4hXj4sNN4HCm4x8HQtLYbfj8GIUyFBO7UE69rPifK S4/hnSzSYws81R2vcbGpu0pPc1UjkW2OBK1qKlYcGKvy6nHEWOMDbnsVBqKggdw3y5w1 DwUkq4yBOwiiH8lFUaop+4D8S7cAoH78FBvfR1w95rnZsiUwxCS3pyX6r0/gQ3FFByV6 mcYw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NnhSJ4EF; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce322b32fsi419523385a.55.2025.01.10.08.04.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 08:04:55 -0800 (PST) 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=NnhSJ4EF; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWHTn-0007ej-Be; Fri, 10 Jan 2025 11:03:23 -0500 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 1tWHT7-0007Jz-EC for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:49 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWHT1-0004Gt-PE for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:39 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385ef8b64b3so1996825f8f.0 for ; Fri, 10 Jan 2025 08:02:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736524953; x=1737129753; 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=9qvogJW6MPYSZINAUIbPGEHr3cB+ZObTGCx80VbT3Tk=; b=NnhSJ4EFig71wywsBS1snCL2T8O6j3sCtHsLAs2zPd44Q/3imGPzQqIUEvyYdwwsty snsrffJ54wIkptJn+l2Qp6mY+thQysj6yBDt0o3F7tgd80PnU6PnEUuFh6yo3ZP+0prh IAWf9TCHcUGAZpzT2HR3JIMK+OWoDbGlFP5LOdp7WoA/Hmu5ohNnz5wYEoqUy5BJpWp2 YvIJe4HZ8MHcr1OEf0yjHuGNDXaYKaMMlqi7tOwza4XSjlBaCgRi+9mmgtcoITgbKEW6 JZGPvBMbdqqwb7xYeTLqnGOwR8MVEHneyVe8ImwPvXcUyiIYRj9Vm5D0j5vp3d0YK+eY mvxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736524953; x=1737129753; 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=9qvogJW6MPYSZINAUIbPGEHr3cB+ZObTGCx80VbT3Tk=; b=SfWWY9T5F0jEz6awJk3ocb6uwk/iqhAi0bmm4m37WM3tach9VnxsfXFqFEtAfKhLka RkFG8Ry+i1IxcyulhGw4ny4uAzV7TUTkFu24jMscJqhI0IY1vk2dmeAIC1SpMVx5oP8r y6AZXDBdQPWcXU82wZUg03+St9aXaxC0vYvV77122rdMhSYPea0t0D6eO5bNSIC0Ygr1 y+wk1qU2c6ySqmn7wyeqNNQpp9aP1BboKnHD0XbQwq92ERxKl9IJMNAegOJGiGpJpMMy FTOJ0cf8+O4HcgKJqa+YaP3WUbeNrltHCYeDfcP+nOTenDld1OOUyxf9g4xgoffYjCMn BEkw== X-Gm-Message-State: AOJu0YwPKXd3/ohZlcpk+FfqY+8m8fdoEUpzaDIjVP0poHtN3wvud8sO gedAh844hUNpf0+fieY6IKV36s/XywXWZZPTrzI1SvijDD1q9jVOP0YwqH0Fl7PwnTFrl0w643x p3IM= X-Gm-Gg: ASbGnctb6S3PriyP+1IHY/6fQxxiP1jDa1/UjqCeW6nn+O2AYm4k9STlYJ9bKCXtfFn 9EHmqOm+TrIxou0UjIhb9r0IPRSAUqxpPUtzvTQaTqnsv+34fmoBhWBfl1AUHhJZIKWc9l0vsD2 RH7hKiMuCNeqxeubCzO/2gbpscamJegcOSfKJ7du5bYmYg9fUf4jjgZ14Rkndsyua9ysDU1JK62 +5b2p+z6qkUchwuSYayIVxDUophMAsR03Ch8jv+i9rHiaXUm7Zv7PNP87uixIVMStQ4AjI4TxaX Jw/ncpdtdaqvDW/2U7Y85gDe8EDi7Bs= X-Received: by 2002:a5d:5f44:0:b0:385:fa33:29ed with SMTP id ffacd0b85a97d-38a8730fa63mr9349216f8f.47.1736524949045; Fri, 10 Jan 2025 08:02:29 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da66e6sm91520325e9.4.2025.01.10.08.02.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 08:02:28 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 5/9] hw/arm/stellaris: Use DEVCAP macro to access DeviceCapability registers Date: Fri, 10 Jan 2025 17:02:00 +0100 Message-ID: <20250110160204.74997-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110160204.74997-1-philmd@linaro.org> References: <20250110160204.74997-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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 Add definitions (DCx_periph) for the DeviceCapability bits, replace direct bitmask checks with the DEV_CAP() macro, which use the extract/deposit API. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/stellaris.c | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index b4c3412c490..64e6797553a 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -8,6 +8,7 @@ */ #include "qemu/osdep.h" +#include "qemu/bitops.h" #include "qapi/error.h" #include "hw/core/split-irq.h" #include "hw/sysbus.h" @@ -54,6 +55,26 @@ #define NUM_GPTM 4 #define NUM_I2C 2 +/* + * See Stellaris Data Sheet chapter 5.2.5 "System Control", + * Register 13 .. 17: Device Capabilities 0 .. 4 (DC0 .. DC4). + */ +#define DC1_WDT 3 +#define DC1_HIB 6 +#define DC1_MPU 7 +#define DC1_ADC 16 +#define DC1_PWM 20 +#define DC2_UART(n) (n) +#define DC2_SSI 4 +#define DC2_QEI(n) (8 + n) +#define DC2_I2C(n) (12 + 2 * n) +#define DC2_GPTM(n) (16 + n) +#define DC2_COMP(n) (24 + n) +#define DC4_GPIO(n) (n) +#define DC4_EMAC 28 + +#define DEV_CAP(_dc, _cap) extract32(board->dc##_dc, DC##_dc##_##_cap, 1) + typedef const struct { const char *name; uint32_t did0; @@ -1117,7 +1138,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) sysbus_mmio_map(SYS_BUS_DEVICE(ssys_dev), 0, 0x400fe000); sysbus_connect_irq(SYS_BUS_DEVICE(ssys_dev), 0, qdev_get_gpio_in(nvic, 28)); - if (board->dc1 & (1 << 16)) { + if (DEV_CAP(1, ADC)) { dev = sysbus_create_varargs(TYPE_STELLARIS_ADC, 0x40038000, qdev_get_gpio_in(nvic, 14), qdev_get_gpio_in(nvic, 15), @@ -1129,7 +1150,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) adc = NULL; } for (i = 0; i < NUM_GPTM; i++) { - if (board->dc2 & (0x10000 << i)) { + if (DEV_CAP(2, GPTM(i))) { SysBusDevice *sbd; dev = qdev_new(TYPE_STELLARIS_GPTM); @@ -1146,7 +1167,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) } } - if (board->dc1 & (1 << 3)) { /* watchdog present */ + if (DEV_CAP(1, WDT)) { dev = qdev_new(TYPE_LUMINARY_WATCHDOG); object_property_add_child(soc_container, "wdg", OBJECT(dev)); qdev_connect_clock_in(dev, "WDOGCLK", @@ -1163,7 +1184,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) for (i = 0; i < NUM_GPIO; i++) { - if (board->dc4 & (1 << i)) { + if (DEV_CAP(4, GPIO(i))) { gpio_dev[i] = sysbus_create_simple("pl061_luminary", gpio_addr[i], qdev_get_gpio_in(nvic, gpio_irq[i])); @@ -1174,7 +1195,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) } } - if (board->dc2 & (1 << 12)) { + if (DEV_CAP(2, I2C(0))) { dev = sysbus_create_simple(TYPE_STELLARIS_I2C, 0x40020000, qdev_get_gpio_in(nvic, 8)); i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c"); @@ -1184,7 +1205,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) } for (i = 0; i < NUM_UART; i++) { - if (board->dc2 & (1 << i)) { + if (DEV_CAP(2, UART(i))) { SysBusDevice *sbd; dev = qdev_new("pl011_luminary"); @@ -1196,7 +1217,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(nvic, uart_irq[i])); } } - if (board->dc2 & (1 << 4)) { + if (DEV_CAP(2, SSI)) { dev = sysbus_create_simple("pl022", 0x40008000, qdev_get_gpio_in(nvic, 7)); if (board->peripherals & BP_OLED_SSI) { @@ -1305,7 +1326,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) qemu_irq_raise(gpio_out[GPIO_D][0]); } } - if (board->dc4 & (1 << 28)) { + if (DEV_CAP(4, EMAC)) { DeviceState *enet; enet = qdev_new("stellaris_enet"); From patchwork Fri Jan 10 16:02:01 2025 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: 856259 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp302645wrc; Fri, 10 Jan 2025 08:04:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWR4e89t60cSutGpN9mo9j55HyG41CCoEhXlzFX8miZdXfqtarBa1AoAX8ldI2H+qSA3uhH2Q==@linaro.org X-Google-Smtp-Source: AGHT+IHbBaLqmWdG0gbsK6o4liLyTzOFSccUH/3EF0Eg1cC47BONrNqv89Bf+KDDB47Rqr7illq8 X-Received: by 2002:a05:651c:b0f:b0:302:4115:18b with SMTP id 38308e7fff4ca-305f4525446mr34176821fa.1.1736525073693; Fri, 10 Jan 2025 08:04:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736525073; cv=none; d=google.com; s=arc-20240605; b=kOCP4GKszM2tam3jpwJGB39I5n6n2Tl1L4sn92Dhsdplx2i5dziZyq9nXv6Snw8mL2 KIftHEaLcTbicmHYRsFHmBHGkfHcVENqiW5K+Q4gtmOx18bCv37jqsL+iwOidP26sJWC 48ix4VdT5dy0vcC1NcJBxcTH0dA8gKI9knzICAc5epL0jYDbIeAyLcrxdIjMRRzdvX3H H8a3mepILOfsjlvoSfgMzH1eOr391bKuYJdnJpFmm12CymgZeeg8SooZUIv+DAbReGCm ImtjgqqpewCQZXKDrrC5BQTT5IzrjJnU6be1/C7+ii/KURyUND9SXD96dLUP9MDpg5AM rLQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=11iHBCaGxzy1H3GllyQ3szfgtatw8IIZSrsd+4vXp4U=; fh=Uq4CCH4qgIScoA1ZlzK6h1LD8Rw6xac8JtYTs6G5zlc=; b=Od1OfsCUDIheh+g0QDzp7p6m4coh6amIn1IvAIbU5+1Vi8cU5NXxcCjO4veFAzYHMm Zb4yGiCspL7OCeoq+MrnU/sf3I3Vk8oAbXViWDVKy9zoaCKwPpmIFjIn5oaSFxZpY+rn UUH7PsG/8grIKFWy4aRg75km1LhiM5q4n3yfju3+T/ffZecKD9J4uqJeZvMRubeEZgd3 GQIjsDTQxKAViNx0lgMCiDQbvl+7/nS9+2HIVTxAJtaFcRZVOpmkiOLsKb/kC0tOUHA3 imnac0R3637xWxPC9rjYX8uJYw7LzZ1/K8T63F6WKyMjNpfOC2JEhHlu+j2GGkLz/A0x l5kw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NkvdhhWM; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 38308e7fff4ca-305ff198a0csi12563731fa.136.2025.01.10.08.04.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 08:04:33 -0800 (PST) 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=NkvdhhWM; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWHTo-0007i3-TP; Fri, 10 Jan 2025 11:03:24 -0500 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 1tWHT9-0007KA-50 for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:49 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWHT2-0004Gv-32 for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:40 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3862a921123so1455898f8f.3 for ; Fri, 10 Jan 2025 08:02:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736524954; x=1737129754; 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=11iHBCaGxzy1H3GllyQ3szfgtatw8IIZSrsd+4vXp4U=; b=NkvdhhWM97FlZ0SiKA3u++Pj6W6O/NWm0zAysZfRm+6NGAhHlvbZDeokZ2tC0P1vp9 x8umtUCV9vyM5GuHyNeiVxibQ3VkLs3nqba1nlzudTeZnzSLmARocCHBwEUliTTrhiLl u5jbkOZz6q14VZUnld0J5rdZdK2oE9/ZtD8b85pPraFsgiEh2L59ysSGPOXbUHvCqKl1 IRI6zk4JUW8BVLxIY8OzdReZCffma2RfX1ywHXniA9a1nC5ZrpxU0PEl7GozRIRYtcCl cGDtRdK2Lceu03kR7tlgoRmptJfq8feKF0m5KG+cLXTMiAzOtqdKUsH321pLgi400DXj I07A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736524954; x=1737129754; 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=11iHBCaGxzy1H3GllyQ3szfgtatw8IIZSrsd+4vXp4U=; b=UeRmp9W+GnUUfzC4spxcwnQEdmy4l0SOu/1Kbze+2xcmV139wqgtC87kEA610zzt16 7pkgzk+5qh9zqZQKxLBFhnwfQqJ3mfPOPnMU+tiwkUdYI21usEK3j/clwk1T/2YCCjE4 er0/PdCSIKdnJuh8E9x8HFh+1kiRZAJUI1gEvdJrQ0Vc3S385z1DfMW7GX5Xyj00Q1zY 2wcLND9wRHSBRfAkEdvwO4pknD4vyWtkEz0H40KVzOiW/rOokp8e0toM3Pfauh9HEfHq wfvqIvXIXa4CSWboAAoNJFi4l53Oc1DnkUs+V5NzhL5yZyp9ftwotPJ0tcGHzlKkgcK0 J8FQ== X-Gm-Message-State: AOJu0YwCSZjKbDzTvG4+InxqjoPsv365m/F0ArFdjc6QbsmFsovExUZB mispTMyRilu+m99W1jjLJpzgsH9zr37x97nF/2L6jlPERUzMAo8mvB0AvL0qTIMpLVhlsBYSKnW 3RRA= X-Gm-Gg: ASbGncvWVlTUjXkEiEzDqHOvQRQj02Qh3DjJEaB4zhzFJqh8/l7g1jY5SfW+467ys4i DrpoWyQ4NVDA30/xEesEkrHwyynJhAXkPIASt+56qlhpg/gh94UP6Rac+Fqn4wA03HBpx+Tahvq QwuA+UHUI909cG0Q9RkVqufglXtp4bodbhj6o92IYBCA+ZhEv07tO65AkdWf+tA6DgxaRBDLb++ sxWdzMA8gn/za4YosVVcQ40nCyC2BXMwtXqqTFx6Vr5iYnXbFH0AY1rDRg/S46l7MgAhlZKW1Q+ uy3Co5FQC5XKASkp2Zw0xvSyvekJ7y4= X-Received: by 2002:a05:6000:1847:b0:386:3825:2c3b with SMTP id ffacd0b85a97d-38a87304672mr9420072f8f.18.1736524953527; Fri, 10 Jan 2025 08:02:33 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1967sm4765917f8f.86.2025.01.10.08.02.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 08:02:33 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 6/9] hw/arm/stellaris: Map both I2C controllers Date: Fri, 10 Jan 2025 17:02:01 +0100 Message-ID: <20250110160204.74997-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110160204.74997-1-philmd@linaro.org> References: <20250110160204.74997-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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=unavailable 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 There are 2 I2C controllers, map them both, removing the unimplemented one. Keep the OLED controller on the first I2C bus. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/stellaris.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 64e6797553a..655bf85e89e 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1021,6 +1021,8 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) { 0x40004000, 0x40005000, 0x40006000, 0x40007000, 0x40024000, 0x40025000, 0x40026000}; static const int gpio_irq[NUM_GPIO] = {0, 1, 2, 3, 4, 30, 31}; + static const uint32_t i2c_addr[NUM_I2C] = {0x40020000, 0x40021000}; + static const int i2c_irq[NUM_I2C] = {8, 37}; /* Memory map of SoC devices, from * Stellaris LM3S6965 Microcontroller Data Sheet (rev I) @@ -1062,7 +1064,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) qemu_irq adc; int sram_size; int flash_size; - I2CBus *i2c; + DeviceState *i2c_dev[NUM_I2C]; DeviceState *dev; DeviceState *ssys_dev; int i; @@ -1195,14 +1197,18 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) } } - if (DEV_CAP(2, I2C(0))) { - dev = sysbus_create_simple(TYPE_STELLARIS_I2C, 0x40020000, - qdev_get_gpio_in(nvic, 8)); - i2c = (I2CBus *)qdev_get_child_bus(dev, "i2c"); - if (board->peripherals & BP_OLED_I2C) { - i2c_slave_create_simple(i2c, "ssd0303", 0x3d); + for (i = 0; i < NUM_I2C; i++) { + if (DEV_CAP(2, I2C(i))) { + i2c_dev[i] = sysbus_create_simple(TYPE_STELLARIS_I2C, i2c_addr[i], + qdev_get_gpio_in(nvic, + i2c_irq[i])); } } + if (board->peripherals & BP_OLED_I2C) { + I2CBus *bus = (I2CBus *)qdev_get_child_bus(i2c_dev[0], "i2c"); + + i2c_slave_create_simple(bus, "ssd0303", 0x3d); + } for (i = 0; i < NUM_UART; i++) { if (DEV_CAP(2, UART(i))) { @@ -1381,7 +1387,6 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) /* Add dummy regions for the devices we don't implement yet, * so guest accesses don't cause unlogged crashes. */ - create_unimplemented_device("i2c-2", 0x40021000, 0x1000); create_unimplemented_device("PWM", 0x40028000, 0x1000); create_unimplemented_device("QEI-0", 0x4002c000, 0x1000); create_unimplemented_device("QEI-1", 0x4002d000, 0x1000); From patchwork Fri Jan 10 16:02:02 2025 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: 856262 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp303539wrc; Fri, 10 Jan 2025 08:05:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVNw660/UfXyvIE6FIhnG4BwHbhSXkoZwoZhlBoU+280v2pxZrnsjT9f9ISexv2K7VLeN7TtQ==@linaro.org X-Google-Smtp-Source: AGHT+IGvnz68A9WjknN6bXVZ8OPHWy7fOWrNZ6YArOriKHjzBMvTXu+rMcil4gC+7DYfS9SCqpeX X-Received: by 2002:a05:620a:1a0b:b0:7b6:f110:43d5 with SMTP id af79cd13be357-7bcd973a036mr1665237085a.18.1736525143676; Fri, 10 Jan 2025 08:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736525143; cv=none; d=google.com; s=arc-20240605; b=i7wX642B88EYYrUb2FX/rb5CxVwDNTOX1UP4yNXpVTu8a8fkmukvDyEW8i4zwCHwK2 mSU1a2IH1ntG7+Vg0I/tt3M9/ubL1lHMTxd8YzwQEKqn8ddqJMiaPrQcyyLBvpNsJRHJ 73iWBo2qV4k6u09GK+2s8S0u2Z8gbX0FqVg72B7T62d/kMX5QidXPoGsFqGXW/BT5ndo 9lnjtyrLKu7F8ooN2i3BhWVdauO5YX9m/1zIgZNNW0wkAwHF7YVNpr8OLhHyI3Tl67FW ixi4RdPd+frga1SvJVsEilIsWHNY8k7JgznVegi+uJ2gJtG74E6kkKiZacUU0R2CFTw5 AhlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=DdLTUyiJZXg+Jy7eGhrfWWJqUYAsXZouUvxtiAwdX4U=; fh=Uq4CCH4qgIScoA1ZlzK6h1LD8Rw6xac8JtYTs6G5zlc=; b=b/GZbg+kI0On/J0Vb/I0qrkwD0CKJGpTk357I71dY0hyrNKloCd/Pbpbh5iH2lmF3e ZvbkNp3hR68XzLSzRyxVpELqcfM1v+DrUmkldP2Ifv0Fnna0X1W3SjEBThmuZn1FucfN t/kgPyu3ongSNdot/UYGR0JLcY2Qx5IPi9npWvPhqDT6AguQ8M8LlGjPR3V2DXHZWf30 ZotwyMFSVTyn8zdiwCF6tt8ebUiDCJ05lYKvBJS8aMUZl3hFsiiXfv6Aw3r+lEmWhPQ6 EUm9y+jPfHQtKlbNlxDE2wuypzIubMqniCtrh7knoQ4FpLCmyHool4AuXtsIJUwk5wK2 cy+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nOVySbNn; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7bce34fcab8si429606085a.416.2025.01.10.08.05.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 08:05:43 -0800 (PST) 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=nOVySbNn; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWHTq-0007jO-3F; Fri, 10 Jan 2025 11:03:26 -0500 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 1tWHTC-0007Kj-CU for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:49 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWHT6-0004Hr-Bb for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:42 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43675b1155bso25823215e9.2 for ; Fri, 10 Jan 2025 08:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736524958; x=1737129758; 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=DdLTUyiJZXg+Jy7eGhrfWWJqUYAsXZouUvxtiAwdX4U=; b=nOVySbNnyTBgoPClvI3NoUgqfmIzyVf8l2JywQ5d7VQQHLKEIVLN3cIUiXloHqH59Y Y/QGHTaofs17yVSEEJF4uwC2U1oHRgQQa8SwwkNqdfNudsIaQxYzSKx+KuCeNtI66NKB D3wrpEfLQKaZMIWw4dAGVldL/8F+t+Cr4BgC06mkhDdy49ik5/wuoSxnC/9t/WWcZ0CG T1r6yKkDieh+fTai+BTtpVJaTbvEGlBy3jDjnvbJf69ulCcaJMxqvXA3t31Ndi293k+B tVXhB4jKSD2lEJvH8G/lAPVCwBdeVW+wgLw1ZSGFbPJ4PS9nzXU+sAF7h6reYLCKplwn 4ftg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736524958; x=1737129758; 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=DdLTUyiJZXg+Jy7eGhrfWWJqUYAsXZouUvxtiAwdX4U=; b=j+3f+TEPjuWfmmzK79HsWlfPGs7tQ9elkv1HeG4KsMfyD41jVPavloJQpNmOSyXbB4 64WLzpkh9XfHGnWKCiACjtNvIXEyye5rmkCNGxtuCe5u+0A/nysaEa9gysgZeME2vEt8 MtK3ClmQZl+U5OiAc0zUnoK2/kyK1ISOpxEnY9HGTLbvQqOtkO8cBmWWF+3fGQ2nXDAz WMHgVmh1EaDhxlThA2yIgg0rp72t9pj12WjWDzbBhjmhX5lYqlVsEhinOGIZ1fsHOahg Gmf2+gIzb9QD0OWe1xhuzs1QnclSKl40w0tLRkaZ3UBjjO/Xy84JnOdxJsaCzFx30rj1 Ngzw== X-Gm-Message-State: AOJu0YyWsEC0/DVdo8O6YrabVzLXJNgyhElDQQEB+yc4Z4a4jr9zRRmd fPZoBuJJTRIOlkn+eVPRFrsT7go05I64m4ELHhrOtJAVWMfI6tF6u8Q+bGHyKPV1jBTaUXcL43p DPYQ= X-Gm-Gg: ASbGncv76Mn3CHXne2uK4jWybYUerKZiZdGrlONkMeiyLviCQvykUL3//lVARNzRL06 cOITroTv7nMzsPZLa5HD0CG7c7JJWgjPB3qa5wgj5O5C9iTf+hTdkCDyy7eDA7rVwEthnz2PUGn pKGVaYWUYkgWuLX+IQSesNWfBVNrQdR63NbyXALIoTsHMbAjX9NHoYpJWtAom1NTkzU/lqSrWrA hpAmnrIShdbRwgWsKvgXQx8I5eWejUKUPZrIXPsDsNBE3rpq0qgDcxnns5bB5X1Kc7aecpTGq8T IopSN6/UnuLiYZkK2LcrgAoCfkfpWds= X-Received: by 2002:a05:600c:3b88:b0:435:192:63fb with SMTP id 5b1f17b1804b1-436e2686662mr101223575e9.3.1736524958131; Fri, 10 Jan 2025 08:02:38 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2dc08bbsm89879665e9.12.2025.01.10.08.02.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 08:02:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 7/9] hw/arm/stellaris: Only create MPU when available Date: Fri, 10 Jan 2025 17:02:02 +0100 Message-ID: <20250110160204.74997-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110160204.74997-1-philmd@linaro.org> References: <20250110160204.74997-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/stellaris.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index 655bf85e89e..d87587225c2 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1128,6 +1128,9 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) qdev_prop_set_uint8(nvic, "num-prio-bits", NUM_PRIO_BITS); qdev_prop_set_string(nvic, "cpu-type", ms->cpu_type); qdev_prop_set_bit(nvic, "enable-bitband", true); + if (!DEV_CAP(1, MPU)) { + qdev_prop_set_uint32(nvic, "mpu-ns-regions", 0); /* Disable MPU */ + } qdev_connect_clock_in(nvic, "cpuclk", qdev_get_clock_out(ssys_dev, "SYSCLK")); /* This SoC does not connect the systick reference clock */ From patchwork Fri Jan 10 16:02:03 2025 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: 856264 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp304058wrc; Fri, 10 Jan 2025 08:06:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXx8uCEJrKef44MrOBN1z2YCrjTt3W8XWAK0VaVfccmdSuVq3GL/mpjZXJ1NCfCxtKZjXyyIg==@linaro.org X-Google-Smtp-Source: AGHT+IFUzqh82KOPcypqDfmMlWgYhAtKhZpKCBa3OQ3jp6inHSEtlXbrEh81RL7+8/thya3uONMf X-Received: by 2002:ac8:5903:0:b0:466:77d0:5941 with SMTP id d75a77b69052e-46c70fd484dmr165001051cf.10.1736525185969; Fri, 10 Jan 2025 08:06:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736525185; cv=none; d=google.com; s=arc-20240605; b=jL1BCNiDgQGiL6OdImShq1fLCtCu++cQGHe4yvJ2SWQHx1OxncQBjSgXnzr5BoXVRV /w79a3PEr4nesedIRDLauM11PM76k21DGT16C4DX8mPTUr6o745uc5j6kSYyj979Eic2 ogrVbQjLs0HGCHgbycitAN+RWKTNJUJYe41D8r3i9EYuCXbQWLBQSotcpKEt9GhoZQ6D jG77siGLcUKkkrIt1wC86kET/GRg9nF2Wy+3PRsd1kO5gLy7Ow/Cpk+ff2luDQ//LCzJ ux0BX1Bq0N2JzzcruoL0Kb/5G3nRlNF95NarLeGYwgzBiUlSrJQrj3nQXTW9sxdH6MSU npQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=7A9IXq/spVXRimdeXf09n3U9AxOdbCQvvzQ3zUBrjYg=; fh=Uq4CCH4qgIScoA1ZlzK6h1LD8Rw6xac8JtYTs6G5zlc=; b=cHu7IZjxSXLj7E+sHizDEHo6ZGYRwIFiYeCsL++bYGSwslwK8c0+fmfDpPCO5t/+aJ +Oz2STLkLteNT1j+WRbST+zH433oRvBmiZf3ONqFqKL0zEYvwx3QHMk4d6oj5/rwjWZR dQcI23n7iKy6DJqi+cx8WHzZNOw2jDslMmmQFvFfcMDPs1qzGIGwDerQo6x1IkRjDJtG CY7HstDdYrT92hC5k1s06Dj33JbymOe9aPuRok1Dv4dCUkKHEJWtijptTGKRmWzKrhub ffFDn14UI7NmRtZ0x1fMjRMAY+neVH+Ag6vBvDdVtBbUuciZB4GJv1ExpZZqjE10rNJf w5Sw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NrvxBTpI; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46c873e4c07si23978111cf.241.2025.01.10.08.06.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 08:06:25 -0800 (PST) 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=NrvxBTpI; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWHTr-0007m1-UI; Fri, 10 Jan 2025 11:03:27 -0500 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 1tWHTG-0007LR-VV for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:52 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWHTC-0004J7-5q for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:48 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-436202dd730so16589995e9.2 for ; Fri, 10 Jan 2025 08:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736524963; x=1737129763; 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=7A9IXq/spVXRimdeXf09n3U9AxOdbCQvvzQ3zUBrjYg=; b=NrvxBTpIYecmEp+OC5FxLT1oIMagjrbHBH9hjuUQoSnMyW70GfOJKuzw/R2UmwU07k YJ2p+V8e/rFsWNrB+sQuY0jje090jnkByFJw9+0KxTBUwpYQk5bZPS61N8t9UKoYfRKk FQ9reIGvN6z4BxgOQALGFxu2h5Hft9w2kQyGhYRZJgJoMcnRJklvsxdHH3zx/Zu9uxMY up2d8MHXVABEtfJeM4m54nbRDyZNcVN2dJqfWCcLXJaYqLLLUnjySE+4vPuUDn7+OSKz gBastfbd2YV+7vBCj1EEk2H6UZuRpa8Sl2CiT4VvVhdG9HHPkUtBmhfYNrKYGHW+F9Rr uiGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736524963; x=1737129763; 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=7A9IXq/spVXRimdeXf09n3U9AxOdbCQvvzQ3zUBrjYg=; b=krsPARw093K5AvT1CPGcpzjjbiOpNJI493clO4oGGu9lsJNnVQeBBtXwSBgtf82fog kqPFGdB8ab0UiNIs2jdm+1OJfpfvLKUr8Z8i+QGdde7wHScThOh0eAYfWAw7cy9UIKzd YWQR+nzw1pkIXdm1Qwvkzm4LQHiLKxr0l+EtQdaqvAHbwSv7kWdUBY/3sk/c5lvtywrA 38iWzFhJXQDW5uq72i+3QjyX2KYZ4PnHhjHrnrTYmQ5jCkgFOImL1PDV3YOUW5h6tC4/ hbDLzpp5RpMedZDAaPzTjzvprv7pwBZkkzd3RcaEKkKTNbMufC4zeW6uO2V2bo0uoDUc ODxA== X-Gm-Message-State: AOJu0YxcQxZUZYC3HvqU7d7Se4k1tLdMqZkvon6Kope2LpOeJB8A8OxE fJrQ0O6kDytTcfdyJx4Kr2TCm1fQW8QFs7eEk3PNelWj/VU8Kq3G1GfApLrhgwetpiFaxbv8MXt TP2Q= X-Gm-Gg: ASbGncv2g964JwyCm/gsYs875F2jI3pURaGDsRsyV51ssNu2exxvqpqFmRNVJNaPJGF wuBKwTAlaRdHKmnxlvM353DxMpbHgfnztaYf9Pgmyi4is3s/wuNXFUFJmqvATc3J/ZIBR82Ocq8 ZuNkN7mAzKqRhXEPlmPks+C8no1TNSO+cwz2hsVu6YrCYD+6yIisHjrQqff7jy976hQkbzF/WCC qFZ/61RU1VdDSN2G/otjwIcI7l6UsFG2lKi5e/m/SGh2FX2pTQZVQVVGyIGh59Y7H1Qy0nylqRV Me/ipwJY+vKbwC5s4ciuSpg6fy2PIno= X-Received: by 2002:a05:6000:4714:b0:374:c4e2:3ca7 with SMTP id ffacd0b85a97d-38a872f673cmr10174513f8f.5.1736524962661; Fri, 10 Jan 2025 08:02:42 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38397csm4794123f8f.24.2025.01.10.08.02.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 08:02:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 8/9] hw/arm/stellaris: Only map existing devices as unimplemented Date: Fri, 10 Jan 2025 17:02:03 +0100 Message-ID: <20250110160204.74997-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110160204.74997-1-philmd@linaro.org> References: <20250110160204.74997-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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 Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/stellaris.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index d87587225c2..c89522332e2 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -1390,11 +1390,21 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) /* Add dummy regions for the devices we don't implement yet, * so guest accesses don't cause unlogged crashes. */ - create_unimplemented_device("PWM", 0x40028000, 0x1000); - create_unimplemented_device("QEI-0", 0x4002c000, 0x1000); - create_unimplemented_device("QEI-1", 0x4002d000, 0x1000); - create_unimplemented_device("analogue-comparator", 0x4003c000, 0x1000); - create_unimplemented_device("hibernation", 0x400fc000, 0x1000); + if (DEV_CAP(1, PWM)) { + create_unimplemented_device("PWM", 0x40028000, 0x1000); + } + if (DEV_CAP(2, QEI(0))) { + create_unimplemented_device("QEI-0", 0x4002c000, 0x1000); + } + if (DEV_CAP(2, QEI(0))) { + create_unimplemented_device("QEI-1", 0x4002d000, 0x1000); + } + if (DEV_CAP(2, COMP(0))) { + create_unimplemented_device("analogue-comparator", 0x4003c000, 0x1000); + } + if (DEV_CAP(1, HIB)) { + create_unimplemented_device("hibernation", 0x400fc000, 0x1000); + } create_unimplemented_device("flash-control", 0x400fd000, 0x1000); armv7m_load_kernel(ARM_CPU(first_cpu), ms->kernel_filename, 0, flash_size); From patchwork Fri Jan 10 16:02:04 2025 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: 856258 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:385:e875:8a9e with SMTP id k28csp302638wrc; Fri, 10 Jan 2025 08:04:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXnp6CZN2XSk/BWZqjZwrn8NWnlXQ1gV2pg3D1UExOVGod+qDLrGaxYzzZL4F9S1mpMruIYWA==@linaro.org X-Google-Smtp-Source: AGHT+IHVYsj95SDoJvMqVmoxmF9VP/9pOtobFnPO9OPWmwdQCg3FoUoR8XPA97l+YsnlSbuxh15i X-Received: by 2002:a05:6122:30a9:b0:516:2d4e:4493 with SMTP id 71dfb90a1353d-51c6c43aafemr9853123e0c.1.1736525073457; Fri, 10 Jan 2025 08:04:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736525073; cv=none; d=google.com; s=arc-20240605; b=fLWplW5OZlrNcpIa8tp+BOwlnsDjHqOPMVzKuLIXRXRGy3StnH2z9EazwOMHysJOrs D+Chcv1sq8BssjIsUTibVRAVjks2yTrWRV/ZPlG8S0pOe1oRAj3UVUoubnSK0rvKApYG P3fNwyVn3MoqaTxC1yFNg78XUIlkEjDt+A18BaNO2iCqtKiw3x4J7GlLrWta9ym7oebM Mn1AFc6GsQxCUIox2X36vgDmibP7ZRhLY6figX7J45qF6aY9C9DxBdt1f73yFPuzRBnp pH8LHM5aK1D0doTY2yg9P/2R+xfBBLZCsDFUuevK2IK5Byc1vR/+1O0eB+vas2QCDSGG pyVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=jNENegiBgeAyoUJg+Zncnjnk99h1QRf7b0Ia8CM8ZQ4=; fh=Uq4CCH4qgIScoA1ZlzK6h1LD8Rw6xac8JtYTs6G5zlc=; b=KnmmnaVsHbwQidKI64EdFfszEPBSpqf3I/cuiV6qQUhcog+3GbUU9cxpYBNeEjCKiI ynV92HLOaVd53wgNF8mwfLHhFdVmyuHpwCzXvY/a5EblVCsm00ERKxEI9FXlGmp2wFPI HPZnFDmivMFWzAAPXF502tKXh+Nam/H1CG2TGXcNUuSLO8ktWumhgWVtyd8GL+sP8xBJ 6JMlpnyP1d9j82AgGKrmAxme/OCycXyEg8oI1/tEb3VegnMzTpvN+ta4gtn9lbmUKARu 7HOIHQL9ZVTrH7NIAPP1+8TAd2KhE1rtn6zQYgNPmlkokDf4z32/gIzAtNtzho6vmbE0 woyg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SQQ7wfyl; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-51c7fd82f3dsi1732375e0c.163.2025.01.10.08.04.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Jan 2025 08:04:33 -0800 (PST) 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=SQQ7wfyl; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tWHTo-0007hD-Ox; Fri, 10 Jan 2025 11:03:24 -0500 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 1tWHTM-0007O4-DW for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:58 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tWHTG-0004Jp-4f for qemu-devel@nongnu.org; Fri, 10 Jan 2025 11:02:53 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4362f61757fso22097255e9.2 for ; Fri, 10 Jan 2025 08:02:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736524967; x=1737129767; 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=jNENegiBgeAyoUJg+Zncnjnk99h1QRf7b0Ia8CM8ZQ4=; b=SQQ7wfylJnaz8sjkErBRn+ygz+rmuOFXhr6fy+JbqyS8zeWz3M1DlmnS5gAFydfMbl 5aMBmQlMEMk9g9LTSHX6q6Y0KiADMGSEnZkrqE4rcbBb/EQdtvjsLWJnK7tKjS5QRLlP yzGw8ol8MjdK+LW5QtNUcZ2DXmojs4RmKhgp8jLomUivbEOu/W+PDBSfQuUPFl5YN88s D6t0qwiEjKvdswK0zDLFQUioH45oJPrimc9lw+ybJoD3abDe5/wQ8xES9y6cFsxpD/of 1QhMlp9u5AboWlpPuTw+v7zQCkfsGTfLNqLGK44U4Il9PcphceP3TkV4C7FwPtkI6k7K Pxig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736524967; x=1737129767; 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=jNENegiBgeAyoUJg+Zncnjnk99h1QRf7b0Ia8CM8ZQ4=; b=sIERS+zjv0cgwRL+t0SuXRG7wWhxrzV1lZVhjgocW8xl9R6XHk5BBWAReQQ71XU2UR jK/UzXu1x+C89dMaIXv1sdQat4z35xtp7HHrWBCFvRyRaZ5+Q2qvVVkecFORyh8LAq/7 kdcbE0+QOMVT0h3uuU7DCAv9pIdpDCL+O2Y788u9Yu2nmCOQolxRxDPiKbTQgrL43Dai Cx2EF8m5Fkxkhf/MEody4vIe04NKKYbrF67SOq3HLGXlE8WZ+5UPAF8JfNTqtgMiVtZT fLaqvsHQNx7urFIycqOZQcnrh5CKyYHI3UwP23SnPD0Naj5isYgxY2IUmZGu/qLaDNvR 6e6g== X-Gm-Message-State: AOJu0YwcZ7d1u28dmvCSp8e9HJn8cDvgmlG3yRPTsVJXmQgc0WGdfPON SDyzy4Fag4XvPPaYL3V/ESHHPuBeGic+8cULUM40K6o5QhqkPn7zfnTC14Fox2jQvR34suB4PeA xLns= X-Gm-Gg: ASbGncski94FT6W1AkJKbaHDtPzsGtIEO/IVav8SQxAIslJl4F+Dd1Vu/ftPwk5Uq4X VFWmG90RhBl5eHmINEJAI7C5BusgAPSHxtgEt2RSxmHUccuxzrNXNSopAcVhUSjQtZ12YHOkYjO FF/xO+cSM6fJpkkvljTUeQf2ZYGornUShjHGtGyZtKCScAC6OjWz46bLPoYy/0Zb/pR1N4cLmzv xSuAfETDL43KIOOJ9V04qt8XwAkswnNBarwkdHJLjmsGfR9Hmj05pd5fBU9aiwrRezwQ6KGCUmH GdZevG3kkgfvlm1Wy9fRWFNIezDlNHc= X-Received: by 2002:a05:600c:524f:b0:435:d22:9c9e with SMTP id 5b1f17b1804b1-436e26d0cf9mr98975045e9.19.1736524967313; Fri, 10 Jan 2025 08:02:47 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2dc0babsm90587775e9.14.2025.01.10.08.02.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 Jan 2025 08:02:46 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 9/9] hw/arm/stellaris: Wire GPTM[#n] output to ADC input #n Date: Fri, 10 Jan 2025 17:02:04 +0100 Message-ID: <20250110160204.74997-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250110160204.74997-1-philmd@linaro.org> References: <20250110160204.74997-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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=unavailable 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 The ADC model is very simple, and only consider the 4 GPTM IRQs as trigger. Currently they are all wired to the same input IRQ. This is a QDev design mistake. We could use a OR_IRQ, but the ADC actually really has one input for each GPTM, so have the ADC create 4 inputs and wire each GPTM output to them. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/stellaris.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index c89522332e2..446d6595a6d 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -701,8 +701,16 @@ static void stellaris_i2c_init(Object *obj) sysbus_init_mmio(sbd, &s->iomem); } -/* Analogue to Digital Converter. This is only partially implemented, - enough for applications that use a combined ADC and timer tick. */ +/* + * Analogue to Digital Converter. + * + * Each of the 4 trigger inputs has a MUX for 5 inputs + * (see Stellaris Data Sheet Figure 11-1: "ADC Module Block Diagram"). + * + * This model only consider the GPTM inputs, thus MUX is not implemented. + */ + +#define STELLARIS_ADC_TRIGGERS 4 #define STELLARIS_ADC_EM_CONTROLLER 0 #define STELLARIS_ADC_EM_COMP 1 @@ -986,7 +994,7 @@ static void stellaris_adc_init(Object *obj) memory_region_init_io(&s->iomem, obj, &stellaris_adc_ops, s, "adc", 0x1000); sysbus_init_mmio(sbd, &s->iomem); - qdev_init_gpio_in(dev, stellaris_adc_trigger, 1); + qdev_init_gpio_in(dev, stellaris_adc_trigger, STELLARIS_ADC_TRIGGERS); } /* Board init. */ @@ -1061,7 +1069,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) DeviceState *gpio_dev[NUM_GPIO], *nvic; qemu_irq gpio_in[NUM_GPIO][8]; qemu_irq gpio_out[NUM_GPIO][8]; - qemu_irq adc; + DeviceState *adc; int sram_size; int flash_size; DeviceState *i2c_dev[NUM_I2C]; @@ -1144,15 +1152,12 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) sysbus_connect_irq(SYS_BUS_DEVICE(ssys_dev), 0, qdev_get_gpio_in(nvic, 28)); if (DEV_CAP(1, ADC)) { - dev = sysbus_create_varargs(TYPE_STELLARIS_ADC, 0x40038000, + adc = sysbus_create_varargs(TYPE_STELLARIS_ADC, 0x40038000, qdev_get_gpio_in(nvic, 14), qdev_get_gpio_in(nvic, 15), qdev_get_gpio_in(nvic, 16), qdev_get_gpio_in(nvic, 17), NULL); - adc = qdev_get_gpio_in(dev, 0); - } else { - adc = NULL; } for (i = 0; i < NUM_GPTM; i++) { if (DEV_CAP(2, GPTM(i))) { @@ -1166,9 +1171,12 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board) sysbus_realize_and_unref(sbd, &error_fatal); sysbus_mmio_map(sbd, 0, 0x40030000 + i * 0x1000); sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(nvic, timer_irq[i])); + /* TODO: This is incorrect, but we get away with it because the ADC output is only ever pulsed. */ - qdev_connect_gpio_out(dev, 0, adc); + if (adc) { + qdev_connect_gpio_out(dev, 0, qdev_get_gpio_in(adc, i)); + } } }