From patchwork Mon Jun 12 22:34:53 2023 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: 691631 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp131833wru; Mon, 12 Jun 2023 15:35:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ZL+OUaO8EFd4iKZ0TdO2KNEuiVa/vHvi57zLOrmKEPNLt0hJy3V0ZVu/LWOjN7Bl40X84 X-Received: by 2002:ad4:5cc9:0:b0:625:aa49:ea00 with SMTP id iu9-20020ad45cc9000000b00625aa49ea00mr17565560qvb.29.1686609330856; Mon, 12 Jun 2023 15:35:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686609330; cv=none; d=google.com; s=arc-20160816; b=drwVL48yD0KlEqtksHW07m12NIt00eVT5PWbRfCAyDV9ebF68CZUejpr3CrAT8xavg moOclgOlODOb0L3Nz6gwVCOF/pf3OtyHMjcYLv0r8wiA1ReU7WHsKeASYy/vzJNtJav5 4mlS7WeJ7jLl8bwregRJNvOrYoinAj7WntxkPakABl1DJDcJVpqwcCRPV0XHnA0kUEGu QVM734c+0CTM8IQ+oTWjUEb64IvAnI3HVc81qyJxgwzG6ueLlUDPe1027v1gsMAPKx9p JJxHe2M6U93GqfxOyc6ESQgwswrssSgvXO6DrCh2qsO+WSKQvPtyMXp54iZp7NwunZVY FIUQ== 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:cc:to :from:dkim-signature; bh=vwHTwHQQJpeSodzqVHQU7tn+HPBO9TSgo8F/afQtA38=; b=kVKEozuNUB+knCkYuZtCAAvgx1xZQopbANf7r2YewIWPh/IFHtfJhuhXbouMG3u0G3 v5TruD1T1HsGJ7LHASKKn9hEBkdXeAdWFNj5+qZnmAEoa1pJBlvNcMJ+oAB+aOrS+EYL UGH4tU6qOki25fFXJhXrJZYdjNqbizw9RozWK9zqTCWkf8d1/gWa7PMlgkucDPeo4zyX juu4jIWsKa1z/o65FwrwiP2JzFKjOXRWNPSxVfkj/Wx3UyCMpoB4a70WX62UuFRixGyX UP2fSeNm7CoTD3CoQM+6scNdI4dSjiExf2u8Qs1ZrI7ztJIt/TyPjHwpzm0DAcdTO3x7 S5AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cjaMbxtT; 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 r3-20020ad45763000000b006237f66138bsi6980475qvx.487.2023.06.12.15.35.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Jun 2023 15:35:30 -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=cjaMbxtT; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8q7z-0001bU-Dw; Mon, 12 Jun 2023 18:35:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8q7u-0001ar-R7 for qemu-devel@nongnu.org; Mon, 12 Jun 2023 18:35:07 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q8q7s-0007ob-SP for qemu-devel@nongnu.org; Mon, 12 Jun 2023 18:35:06 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-97881a996a0so864433366b.0 for ; Mon, 12 Jun 2023 15:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686609303; x=1689201303; 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=vwHTwHQQJpeSodzqVHQU7tn+HPBO9TSgo8F/afQtA38=; b=cjaMbxtT7ggFoMo0DHFOuOWXAs+J1FPPl5bi5cySGNGzb/wHZ+7lT0BYu9AgwDU/aA 8oMug5f2bN02/0W0jSVQY1QLR+zS3lEfHJnTwmdJxLf+PqF/r+lAiQdJxce8a6m94qt+ HOSiP8CVMOyDNRSsfPlla2DQIyfeo0MOxFCFZTtibfwlx29i0L0W0C7yWVwo32qeNyFB nOmxX2gKD0zt8DrWRWehACNekPk+jcm9rKkMXX0wAiMNMeKvBE1GgRWnAqunY6q6CLYc 6W1Irp3l+7M/uCwe7CCaT26oMjMZlHsgY2X6jF+n20bhULhf6Iqdi2sH2XlIrcioI3go qfeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686609303; x=1689201303; 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=vwHTwHQQJpeSodzqVHQU7tn+HPBO9TSgo8F/afQtA38=; b=bGfm+hvWcuaY5Cxb7JtcF0P5IRZzdK9QLqNvWw5h10riarzn081yenDWCZekXSlCuv cAxnh8kS6KBUwB0U0KafblSzedAteVdLyczkCPkcuZgB8lO/UBHyXHI3QYqByA7ebt1v AHRAGN/nA6reBskc6+cIl/TrSu/cCpNHo5SmVjcHtItcMipfg8uPIR2f1RkK15ZfBm8I XqZKzoAU/jNDLCtXFotSE0I6oaKh/8GV9N3uRqqdUSeSm1lrAErUJl34WSUcCFS3laNh yPs7Ki+E8FW9kkToEcbsy+VhOZAEgLkBa/6oHw6gKQoAcXsACXRxrjh0bpPHizaZ2Kwp YoKg== X-Gm-Message-State: AC+VfDxsM2F+GA9TUplq3HBvymgVcVBaRu5yyF+L/MJwxf7PdVWtOqbQ 9ywrdM5sqxv/KCDFjwYWDV0RCpitESYNVgvR8VuiEg== X-Received: by 2002:a17:907:3f21:b0:969:93f2:259a with SMTP id hq33-20020a1709073f2100b0096993f2259amr11415961ejc.73.1686609303104; Mon, 12 Jun 2023 15:35:03 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id f10-20020a170906824a00b00971433ed5fesm5737208ejx.184.2023.06.12.15.35.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 12 Jun 2023 15:35:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Sergey Kambalin , qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v3 1/4] hw/arm/raspi: Import Linux raspi definitions as 'raspberrypi-fw-defs.h' Date: Tue, 13 Jun 2023 00:34:53 +0200 Message-Id: <20230612223456.33824-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230612223456.33824-1-philmd@linaro.org> References: <20230612223456.33824-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=philmd@linaro.org; helo=mail-ej1-x634.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, UPPERCASE_50_75=0.008 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Sergey Kambalin Signed-off-by: Sergey Kambalin Message-Id: <20230531155258.8361-1-sergey.kambalin@auriga.com> [PMD: Split from bigger patch: 1/4] Signed-off-by: Philippe Mathieu-Daudé Acked-by: Richard Henderson --- include/hw/misc/raspberrypi-fw-defs.h | 163 ++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 include/hw/misc/raspberrypi-fw-defs.h diff --git a/include/hw/misc/raspberrypi-fw-defs.h b/include/hw/misc/raspberrypi-fw-defs.h new file mode 100644 index 0000000000..4551fe7450 --- /dev/null +++ b/include/hw/misc/raspberrypi-fw-defs.h @@ -0,0 +1,163 @@ +/* + * Raspberry Pi firmware definitions + * + * Copyright (C) 2022 Auriga LLC, based on Linux kernel + * `include/soc/bcm2835/raspberrypi-firmware.h` (Copyright © 2015 Broadcom) + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef INCLUDE_HW_MISC_RASPBERRYPI_FW_DEFS_H_ +#define INCLUDE_HW_MISC_RASPBERRYPI_FW_DEFS_H_ + +#include "qemu/osdep.h" + +enum rpi_firmware_property_tag { + RPI_FWREQ_PROPERTY_END = 0, + RPI_FWREQ_GET_FIRMWARE_REVISION = 0x00000001, + RPI_FWREQ_GET_FIRMWARE_VARIANT = 0x00000002, + RPI_FWREQ_GET_FIRMWARE_HASH = 0x00000003, + + RPI_FWREQ_SET_CURSOR_INFO = 0x00008010, + RPI_FWREQ_SET_CURSOR_STATE = 0x00008011, + + RPI_FWREQ_GET_BOARD_MODEL = 0x00010001, + RPI_FWREQ_GET_BOARD_REVISION = 0x00010002, + RPI_FWREQ_GET_BOARD_MAC_ADDRESS = 0x00010003, + RPI_FWREQ_GET_BOARD_SERIAL = 0x00010004, + RPI_FWREQ_GET_ARM_MEMORY = 0x00010005, + RPI_FWREQ_GET_VC_MEMORY = 0x00010006, + RPI_FWREQ_GET_CLOCKS = 0x00010007, + RPI_FWREQ_GET_POWER_STATE = 0x00020001, + RPI_FWREQ_GET_TIMING = 0x00020002, + RPI_FWREQ_SET_POWER_STATE = 0x00028001, + RPI_FWREQ_GET_CLOCK_STATE = 0x00030001, + RPI_FWREQ_GET_CLOCK_RATE = 0x00030002, + RPI_FWREQ_GET_VOLTAGE = 0x00030003, + RPI_FWREQ_GET_MAX_CLOCK_RATE = 0x00030004, + RPI_FWREQ_GET_MAX_VOLTAGE = 0x00030005, + RPI_FWREQ_GET_TEMPERATURE = 0x00030006, + RPI_FWREQ_GET_MIN_CLOCK_RATE = 0x00030007, + RPI_FWREQ_GET_MIN_VOLTAGE = 0x00030008, + RPI_FWREQ_GET_TURBO = 0x00030009, + RPI_FWREQ_GET_MAX_TEMPERATURE = 0x0003000a, + RPI_FWREQ_GET_STC = 0x0003000b, + RPI_FWREQ_ALLOCATE_MEMORY = 0x0003000c, + RPI_FWREQ_LOCK_MEMORY = 0x0003000d, + RPI_FWREQ_UNLOCK_MEMORY = 0x0003000e, + RPI_FWREQ_RELEASE_MEMORY = 0x0003000f, + RPI_FWREQ_EXECUTE_CODE = 0x00030010, + RPI_FWREQ_EXECUTE_QPU = 0x00030011, + RPI_FWREQ_SET_ENABLE_QPU = 0x00030012, + RPI_FWREQ_GET_DISPMANX_RESOURCE_MEM_HANDLE = 0x00030014, + RPI_FWREQ_GET_EDID_BLOCK = 0x00030020, + RPI_FWREQ_GET_CUSTOMER_OTP = 0x00030021, + RPI_FWREQ_GET_EDID_BLOCK_DISPLAY = 0x00030023, + RPI_FWREQ_GET_DOMAIN_STATE = 0x00030030, + RPI_FWREQ_GET_THROTTLED = 0x00030046, + RPI_FWREQ_GET_CLOCK_MEASURED = 0x00030047, + RPI_FWREQ_NOTIFY_REBOOT = 0x00030048, + RPI_FWREQ_SET_CLOCK_STATE = 0x00038001, + RPI_FWREQ_SET_CLOCK_RATE = 0x00038002, + RPI_FWREQ_SET_VOLTAGE = 0x00038003, + RPI_FWREQ_SET_MAX_CLOCK_RATE = 0x00038004, + RPI_FWREQ_SET_MIN_CLOCK_RATE = 0x00038007, + RPI_FWREQ_SET_TURBO = 0x00038009, + RPI_FWREQ_SET_CUSTOMER_OTP = 0x00038021, + RPI_FWREQ_SET_DOMAIN_STATE = 0x00038030, + RPI_FWREQ_GET_GPIO_STATE = 0x00030041, + RPI_FWREQ_SET_GPIO_STATE = 0x00038041, + RPI_FWREQ_SET_SDHOST_CLOCK = 0x00038042, + RPI_FWREQ_GET_GPIO_CONFIG = 0x00030043, + RPI_FWREQ_SET_GPIO_CONFIG = 0x00038043, + RPI_FWREQ_GET_PERIPH_REG = 0x00030045, + RPI_FWREQ_SET_PERIPH_REG = 0x00038045, + RPI_FWREQ_GET_POE_HAT_VAL = 0x00030049, + RPI_FWREQ_SET_POE_HAT_VAL = 0x00038049, + RPI_FWREQ_SET_POE_HAT_VAL_OLD = 0x00030050, + RPI_FWREQ_NOTIFY_XHCI_RESET = 0x00030058, + RPI_FWREQ_GET_REBOOT_FLAGS = 0x00030064, + RPI_FWREQ_SET_REBOOT_FLAGS = 0x00038064, + RPI_FWREQ_NOTIFY_DISPLAY_DONE = 0x00030066, + + /* Dispmanx TAGS */ + RPI_FWREQ_FRAMEBUFFER_ALLOCATE = 0x00040001, + RPI_FWREQ_FRAMEBUFFER_BLANK = 0x00040002, + RPI_FWREQ_FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT = 0x00040003, + RPI_FWREQ_FRAMEBUFFER_GET_VIRTUAL_WIDTH_HEIGHT = 0x00040004, + RPI_FWREQ_FRAMEBUFFER_GET_DEPTH = 0x00040005, + RPI_FWREQ_FRAMEBUFFER_GET_PIXEL_ORDER = 0x00040006, + RPI_FWREQ_FRAMEBUFFER_GET_ALPHA_MODE = 0x00040007, + RPI_FWREQ_FRAMEBUFFER_GET_PITCH = 0x00040008, + RPI_FWREQ_FRAMEBUFFER_GET_VIRTUAL_OFFSET = 0x00040009, + RPI_FWREQ_FRAMEBUFFER_GET_OVERSCAN = 0x0004000a, + RPI_FWREQ_FRAMEBUFFER_GET_PALETTE = 0x0004000b, + RPI_FWREQ_FRAMEBUFFER_GET_LAYER = 0x0004000c, + RPI_FWREQ_FRAMEBUFFER_GET_TRANSFORM = 0x0004000d, + RPI_FWREQ_FRAMEBUFFER_GET_VSYNC = 0x0004000e, + RPI_FWREQ_FRAMEBUFFER_GET_TOUCHBUF = 0x0004000f, + RPI_FWREQ_FRAMEBUFFER_GET_GPIOVIRTBUF = 0x00040010, + RPI_FWREQ_FRAMEBUFFER_RELEASE = 0x00048001, + RPI_FWREQ_FRAMEBUFFER_GET_DISPLAY_ID = 0x00040016, + RPI_FWREQ_FRAMEBUFFER_SET_DISPLAY_NUM = 0x00048013, + RPI_FWREQ_FRAMEBUFFER_GET_NUM_DISPLAYS = 0x00040013, + RPI_FWREQ_FRAMEBUFFER_GET_DISPLAY_SETTINGS = 0x00040014, + RPI_FWREQ_FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT = 0x00044003, + RPI_FWREQ_FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT = 0x00044004, + RPI_FWREQ_FRAMEBUFFER_TEST_DEPTH = 0x00044005, + RPI_FWREQ_FRAMEBUFFER_TEST_PIXEL_ORDER = 0x00044006, + RPI_FWREQ_FRAMEBUFFER_TEST_ALPHA_MODE = 0x00044007, + RPI_FWREQ_FRAMEBUFFER_TEST_VIRTUAL_OFFSET = 0x00044009, + RPI_FWREQ_FRAMEBUFFER_TEST_OVERSCAN = 0x0004400a, + RPI_FWREQ_FRAMEBUFFER_TEST_PALETTE = 0x0004400b, + RPI_FWREQ_FRAMEBUFFER_TEST_LAYER = 0x0004400c, + RPI_FWREQ_FRAMEBUFFER_TEST_TRANSFORM = 0x0004400d, + RPI_FWREQ_FRAMEBUFFER_TEST_VSYNC = 0x0004400e, + RPI_FWREQ_FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT = 0x00048003, + RPI_FWREQ_FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT = 0x00048004, + RPI_FWREQ_FRAMEBUFFER_SET_DEPTH = 0x00048005, + RPI_FWREQ_FRAMEBUFFER_SET_PIXEL_ORDER = 0x00048006, + RPI_FWREQ_FRAMEBUFFER_SET_ALPHA_MODE = 0x00048007, + RPI_FWREQ_FRAMEBUFFER_SET_PITCH = 0x00048008, + RPI_FWREQ_FRAMEBUFFER_SET_VIRTUAL_OFFSET = 0x00048009, + RPI_FWREQ_FRAMEBUFFER_SET_OVERSCAN = 0x0004800a, + RPI_FWREQ_FRAMEBUFFER_SET_PALETTE = 0x0004800b, + + RPI_FWREQ_FRAMEBUFFER_SET_TOUCHBUF = 0x0004801f, + RPI_FWREQ_FRAMEBUFFER_SET_GPIOVIRTBUF = 0x00048020, + RPI_FWREQ_FRAMEBUFFER_SET_VSYNC = 0x0004800e, + RPI_FWREQ_FRAMEBUFFER_SET_LAYER = 0x0004800c, + RPI_FWREQ_FRAMEBUFFER_SET_TRANSFORM = 0x0004800d, + RPI_FWREQ_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, + + RPI_FWREQ_VCHIQ_INIT = 0x00048010, + + RPI_FWREQ_SET_PLANE = 0x00048015, + RPI_FWREQ_GET_DISPLAY_TIMING = 0x00040017, + RPI_FWREQ_SET_TIMING = 0x00048017, + RPI_FWREQ_GET_DISPLAY_CFG = 0x00040018, + RPI_FWREQ_SET_DISPLAY_POWER = 0x00048019, + RPI_FWREQ_GET_COMMAND_LINE = 0x00050001, + RPI_FWREQ_GET_DMA_CHANNELS = 0x00060001, +}; + +enum rpi_firmware_clk_id { + RPI_FIRMWARE_EMMC_CLK_ID = 1, + RPI_FIRMWARE_UART_CLK_ID, + RPI_FIRMWARE_ARM_CLK_ID, + RPI_FIRMWARE_CORE_CLK_ID, + RPI_FIRMWARE_V3D_CLK_ID, + RPI_FIRMWARE_H264_CLK_ID, + RPI_FIRMWARE_ISP_CLK_ID, + RPI_FIRMWARE_SDRAM_CLK_ID, + RPI_FIRMWARE_PIXEL_CLK_ID, + RPI_FIRMWARE_PWM_CLK_ID, + RPI_FIRMWARE_HEVC_CLK_ID, + RPI_FIRMWARE_EMMC2_CLK_ID, + RPI_FIRMWARE_M2MC_CLK_ID, + RPI_FIRMWARE_PIXEL_BVB_CLK_ID, + RPI_FIRMWARE_VEC_CLK_ID, + RPI_FIRMWARE_NUM_CLK_ID, +}; + +#endif /* INCLUDE_HW_MISC_RASPBERRYPI_FW_DEFS_H_ */ From patchwork Mon Jun 12 22:34:54 2023 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: 691635 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp132096wru; Mon, 12 Jun 2023 15:36:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ42HlpiMkGgYlwip1M0lkSNjmN7ls8Cw2rp6lqSczLXmuIunHscrnjo358g6UDM1ZJrd3/H X-Received: by 2002:ac8:59d4:0:b0:3f8:7b6d:5f88 with SMTP id f20-20020ac859d4000000b003f87b6d5f88mr13653956qtf.39.1686609380505; Mon, 12 Jun 2023 15:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686609380; cv=none; d=google.com; s=arc-20160816; b=D9iXSyFzsOHtMocY4mNIFqUBz/WH7LfEeRjvj3f5X4IybhqtoLmrahSGGt2zAH4EoX mVPH9Islohd8/gg7ojivW7/ADwk5xyVkxlrx1+iAOwvDflF2FDIzEi3EzUGaED6MwVRx IUm3kbV0sOMxJ1NKLJxEr6LMQElP6G1XiDpq24FRueYhYxBLd+WJ65GL4tCVGiCJXmJm FQ4zbAnazHte8fbVilxehjBUkUnZPsg7uCDM+UfMidWt3Vm1wTns2EQYb7GEe7Rq3avU OC/2mqCVyL/lW20BVbPmIiNhAH33tbZrtAQ2rTn9mEVhdw7C/jOP4uoH1hMQ7C0Eemzr SxJQ== 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:cc:to :from:dkim-signature; bh=vgLyKz9BCFYWpYlkXL1B5ecjS40jUV0mgb/FFd9TOhc=; b=RKH3WXwWv4NJO0QFTdtZbaEiX53yNPDqVbfBG36XOuR8jUbnrwxNUnvVx/Lz6f7/AI Hpi+wAJsxf93ftlqN0k/wZx11GnD2k1maGhV7vhgU7wizMPlYKYBc32A33+oVa0KP5J2 INSB+BOV8dptluSt6pTF8y7fR6qPc94HY/lAJbM2nwSyOjV/a9z7aAt81EjMBkm63Eb0 0a2eWr4OXMH+QqNe4PH9PsinRgEFrRY7d3NYx8W5WAfrRgCTcj7VZ7oCL5xWzMDz1UmD b+olVrnSFBOhYoFn8Vj/JE6YD7lOtzc4RHV0WxFF2qg+fY+05WSYI8jYREWpT/dAbI3O 4mjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M1a8xQiL; 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 k17-20020ac85fd1000000b003f9c7779039si6939374qta.415.2023.06.12.15.36.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Jun 2023 15:36:20 -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=M1a8xQiL; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8q84-0001cn-M1; Mon, 12 Jun 2023 18:35:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8q80-0001c7-M2 for qemu-devel@nongnu.org; Mon, 12 Jun 2023 18:35:15 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q8q7y-0007pQ-BM for qemu-devel@nongnu.org; Mon, 12 Jun 2023 18:35:12 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f642a24568so5829930e87.2 for ; Mon, 12 Jun 2023 15:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686609307; x=1689201307; 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=vgLyKz9BCFYWpYlkXL1B5ecjS40jUV0mgb/FFd9TOhc=; b=M1a8xQiLJv+kZDdxHPXbuVRgKVgjyyOjbcQ/YYf9ZzPc1k99S20jOSmA5lM5eQtGip 0KCOdMPz6jTr4VtDMuM46WgycQCETfNam0uBn4x1ChTEkY6dTZpl7CeVADlfn4uPMibk gQ/l9irRyjpV5Y6GmANQ7XILPIPvsSD7SFICejDSR8PzM+b5b8oo6sy5sUMkgmt4BjNW wrrOX9KTU/UyeN7XIvyFjXftbuncQWSiEsBVUiHl0XNi+0L2ykW8lxnoXHlKtHR8VU4o Xys0eiZO+BeCFhW19KXkmOfYNhg2u8dHVkhVbz3s+qT0YCgYQTtxe7Wa9RyDZ3v10zfK hZqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686609307; x=1689201307; 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=vgLyKz9BCFYWpYlkXL1B5ecjS40jUV0mgb/FFd9TOhc=; b=g9Qc4DcRf6Q2edohPzhXGRABPpH12frDEZUikx2HLP1shO9Nv+GK++lug0lVJrgJBP 7FUxpVL+XF8+7623vJucRC1BU2tiv5S/6ZgcxvDxJIGvNuWfeEoDo39m41JY5ea3wwY9 0QWqtyUZ3lMGab9LiPN3XVl+shVLllgqVvdtvbfCahOTmRimE9pwM52/1ZA9o6Rm0amq +oLQb3uEGWeMn+Q1QmYDxcnNeiFxTg6sjwbZj414r8jtOqHlNmwMIpdrKt0KT1EKBlaB mW92okLZ0kSXEPyPmb/6K4A5VwdeWz9KhWMF/szSfMasDjgooOq2koMOiy7B5huQ5j2e lHCQ== X-Gm-Message-State: AC+VfDxUlFhI+beRlo7gZG/H4UL0fkMl0Ev6xcAKc+/1DKDd10XOG/Mh Nn5GEB9iyRuGv21doboUaTvyOTn4OwirtE3Czi0S7w== X-Received: by 2002:ac2:4db4:0:b0:4f3:789c:8bcf with SMTP id h20-20020ac24db4000000b004f3789c8bcfmr4687321lfe.4.1686609307402; Mon, 12 Jun 2023 15:35:07 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id q24-20020aa7d458000000b00518286f5837sm3476840edr.58.2023.06.12.15.35.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 12 Jun 2023 15:35:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Sergey Kambalin , qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v3 2/4] hw/misc/bcm2835_property: Use 'raspberrypi-fw-defs.h' definitions Date: Tue, 13 Jun 2023 00:34:54 +0200 Message-Id: <20230612223456.33824-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230612223456.33824-1-philmd@linaro.org> References: <20230612223456.33824-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=philmd@linaro.org; helo=mail-lf1-x134.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=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 From: Sergey Kambalin Replace magic property values by a proper definition, removing redundant comments. Signed-off-by: Sergey Kambalin Message-Id: <20230531155258.8361-1-sergey.kambalin@auriga.com> [PMD: Split from bigger patch: 2/4] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/misc/bcm2835_property.c | 101 +++++++++++++++++++------------------ 1 file changed, 51 insertions(+), 50 deletions(-) diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 251b3d865d..7d398a6f75 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -12,6 +12,7 @@ #include "migration/vmstate.h" #include "hw/irq.h" #include "hw/misc/bcm2835_mbox_defs.h" +#include "hw/misc/raspberrypi-fw-defs.h" #include "sysemu/dma.h" #include "qemu/log.h" #include "qemu/module.h" @@ -51,48 +52,48 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) /* @(value + 8) : Request/response indicator */ resplen = 0; switch (tag) { - case 0x00000000: /* End tag */ + case RPI_FWREQ_PROPERTY_END: break; - case 0x00000001: /* Get firmware revision */ + case RPI_FWREQ_GET_FIRMWARE_REVISION: stl_le_phys(&s->dma_as, value + 12, 346337); resplen = 4; break; - case 0x00010001: /* Get board model */ + case RPI_FWREQ_GET_BOARD_MODEL: qemu_log_mask(LOG_UNIMP, "bcm2835_property: 0x%08x get board model NYI\n", tag); resplen = 4; break; - case 0x00010002: /* Get board revision */ + case RPI_FWREQ_GET_BOARD_REVISION: stl_le_phys(&s->dma_as, value + 12, s->board_rev); resplen = 4; break; - case 0x00010003: /* Get board MAC address */ + case RPI_FWREQ_GET_BOARD_MAC_ADDRESS: resplen = sizeof(s->macaddr.a); dma_memory_write(&s->dma_as, value + 12, s->macaddr.a, resplen, MEMTXATTRS_UNSPECIFIED); break; - case 0x00010004: /* Get board serial */ + case RPI_FWREQ_GET_BOARD_SERIAL: qemu_log_mask(LOG_UNIMP, "bcm2835_property: 0x%08x get board serial NYI\n", tag); resplen = 8; break; - case 0x00010005: /* Get ARM memory */ + case RPI_FWREQ_GET_ARM_MEMORY: /* base */ stl_le_phys(&s->dma_as, value + 12, 0); /* size */ stl_le_phys(&s->dma_as, value + 16, s->fbdev->vcram_base); resplen = 8; break; - case 0x00010006: /* Get VC memory */ + case RPI_FWREQ_GET_VC_MEMORY: /* base */ stl_le_phys(&s->dma_as, value + 12, s->fbdev->vcram_base); /* size */ stl_le_phys(&s->dma_as, value + 16, s->fbdev->vcram_size); resplen = 8; break; - case 0x00028001: /* Set power state */ + case RPI_FWREQ_SET_POWER_STATE: /* Assume that whatever device they asked for exists, * and we'll just claim we set it to the desired state */ @@ -103,26 +104,26 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) /* Clocks */ - case 0x00030001: /* Get clock state */ + case RPI_FWREQ_GET_CLOCK_STATE: stl_le_phys(&s->dma_as, value + 16, 0x1); resplen = 8; break; - case 0x00038001: /* Set clock state */ + case RPI_FWREQ_SET_CLOCK_STATE: qemu_log_mask(LOG_UNIMP, "bcm2835_property: 0x%08x set clock state NYI\n", tag); resplen = 8; break; - case 0x00030002: /* Get clock rate */ - case 0x00030004: /* Get max clock rate */ - case 0x00030007: /* Get min clock rate */ + case RPI_FWREQ_GET_CLOCK_RATE: + case RPI_FWREQ_GET_MAX_CLOCK_RATE: + case RPI_FWREQ_GET_MIN_CLOCK_RATE: switch (ldl_le_phys(&s->dma_as, value + 12)) { - case 1: /* EMMC */ + case RPI_FIRMWARE_EMMC_CLK_ID: stl_le_phys(&s->dma_as, value + 16, 50000000); break; - case 2: /* UART */ + case RPI_FIRMWARE_UART_CLK_ID: stl_le_phys(&s->dma_as, value + 16, 3000000); break; default: @@ -132,9 +133,9 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) resplen = 8; break; - case 0x00038002: /* Set clock rate */ - case 0x00038004: /* Set max clock rate */ - case 0x00038007: /* Set min clock rate */ + case RPI_FWREQ_SET_CLOCK_RATE: + case RPI_FWREQ_SET_MAX_CLOCK_RATE: + case RPI_FWREQ_SET_MIN_CLOCK_RATE: qemu_log_mask(LOG_UNIMP, "bcm2835_property: 0x%08x set clock rate NYI\n", tag); @@ -143,121 +144,121 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) /* Temperature */ - case 0x00030006: /* Get temperature */ + case RPI_FWREQ_GET_TEMPERATURE: stl_le_phys(&s->dma_as, value + 16, 25000); resplen = 8; break; - case 0x0003000A: /* Get max temperature */ + case RPI_FWREQ_GET_MAX_TEMPERATURE: stl_le_phys(&s->dma_as, value + 16, 99000); resplen = 8; break; /* Frame buffer */ - case 0x00040001: /* Allocate buffer */ + case RPI_FWREQ_FRAMEBUFFER_ALLOCATE: stl_le_phys(&s->dma_as, value + 12, fbconfig.base); stl_le_phys(&s->dma_as, value + 16, bcm2835_fb_get_size(&fbconfig)); resplen = 8; break; - case 0x00048001: /* Release buffer */ + case RPI_FWREQ_FRAMEBUFFER_RELEASE: resplen = 0; break; - case 0x00040002: /* Blank screen */ + case RPI_FWREQ_FRAMEBUFFER_BLANK: resplen = 4; break; - case 0x00044003: /* Test physical display width/height */ - case 0x00044004: /* Test virtual display width/height */ + case RPI_FWREQ_FRAMEBUFFER_TEST_PHYSICAL_WIDTH_HEIGHT: + case RPI_FWREQ_FRAMEBUFFER_TEST_VIRTUAL_WIDTH_HEIGHT: resplen = 8; break; - case 0x00048003: /* Set physical display width/height */ + case RPI_FWREQ_FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT: fbconfig.xres = ldl_le_phys(&s->dma_as, value + 12); fbconfig.yres = ldl_le_phys(&s->dma_as, value + 16); bcm2835_fb_validate_config(&fbconfig); fbconfig_updated = true; /* fall through */ - case 0x00040003: /* Get physical display width/height */ + case RPI_FWREQ_FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT: stl_le_phys(&s->dma_as, value + 12, fbconfig.xres); stl_le_phys(&s->dma_as, value + 16, fbconfig.yres); resplen = 8; break; - case 0x00048004: /* Set virtual display width/height */ + case RPI_FWREQ_FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT: fbconfig.xres_virtual = ldl_le_phys(&s->dma_as, value + 12); fbconfig.yres_virtual = ldl_le_phys(&s->dma_as, value + 16); bcm2835_fb_validate_config(&fbconfig); fbconfig_updated = true; /* fall through */ - case 0x00040004: /* Get virtual display width/height */ + case RPI_FWREQ_FRAMEBUFFER_GET_VIRTUAL_WIDTH_HEIGHT: stl_le_phys(&s->dma_as, value + 12, fbconfig.xres_virtual); stl_le_phys(&s->dma_as, value + 16, fbconfig.yres_virtual); resplen = 8; break; - case 0x00044005: /* Test depth */ + case RPI_FWREQ_FRAMEBUFFER_TEST_DEPTH: resplen = 4; break; - case 0x00048005: /* Set depth */ + case RPI_FWREQ_FRAMEBUFFER_SET_DEPTH: fbconfig.bpp = ldl_le_phys(&s->dma_as, value + 12); bcm2835_fb_validate_config(&fbconfig); fbconfig_updated = true; /* fall through */ - case 0x00040005: /* Get depth */ + case RPI_FWREQ_FRAMEBUFFER_GET_DEPTH: stl_le_phys(&s->dma_as, value + 12, fbconfig.bpp); resplen = 4; break; - case 0x00044006: /* Test pixel order */ + case RPI_FWREQ_FRAMEBUFFER_TEST_PIXEL_ORDER: resplen = 4; break; - case 0x00048006: /* Set pixel order */ + case RPI_FWREQ_FRAMEBUFFER_SET_PIXEL_ORDER: fbconfig.pixo = ldl_le_phys(&s->dma_as, value + 12); bcm2835_fb_validate_config(&fbconfig); fbconfig_updated = true; /* fall through */ - case 0x00040006: /* Get pixel order */ + case RPI_FWREQ_FRAMEBUFFER_GET_PIXEL_ORDER: stl_le_phys(&s->dma_as, value + 12, fbconfig.pixo); resplen = 4; break; - case 0x00044007: /* Test pixel alpha */ + case RPI_FWREQ_FRAMEBUFFER_TEST_ALPHA_MODE: resplen = 4; break; - case 0x00048007: /* Set alpha */ + case RPI_FWREQ_FRAMEBUFFER_SET_ALPHA_MODE: fbconfig.alpha = ldl_le_phys(&s->dma_as, value + 12); bcm2835_fb_validate_config(&fbconfig); fbconfig_updated = true; /* fall through */ - case 0x00040007: /* Get alpha */ + case RPI_FWREQ_FRAMEBUFFER_GET_ALPHA_MODE: stl_le_phys(&s->dma_as, value + 12, fbconfig.alpha); resplen = 4; break; - case 0x00040008: /* Get pitch */ + case RPI_FWREQ_FRAMEBUFFER_GET_PITCH: stl_le_phys(&s->dma_as, value + 12, bcm2835_fb_get_pitch(&fbconfig)); resplen = 4; break; - case 0x00044009: /* Test virtual offset */ + case RPI_FWREQ_FRAMEBUFFER_TEST_VIRTUAL_OFFSET: resplen = 8; break; - case 0x00048009: /* Set virtual offset */ + case RPI_FWREQ_FRAMEBUFFER_SET_VIRTUAL_OFFSET: fbconfig.xoffset = ldl_le_phys(&s->dma_as, value + 12); fbconfig.yoffset = ldl_le_phys(&s->dma_as, value + 16); bcm2835_fb_validate_config(&fbconfig); fbconfig_updated = true; /* fall through */ - case 0x00040009: /* Get virtual offset */ + case RPI_FWREQ_FRAMEBUFFER_GET_VIRTUAL_OFFSET: stl_le_phys(&s->dma_as, value + 12, fbconfig.xoffset); stl_le_phys(&s->dma_as, value + 16, fbconfig.yoffset); resplen = 8; break; - case 0x0004000a: /* Get/Test/Set overscan */ - case 0x0004400a: - case 0x0004800a: + case RPI_FWREQ_FRAMEBUFFER_GET_OVERSCAN: + case RPI_FWREQ_FRAMEBUFFER_TEST_OVERSCAN: + case RPI_FWREQ_FRAMEBUFFER_SET_OVERSCAN: stl_le_phys(&s->dma_as, value + 12, 0); stl_le_phys(&s->dma_as, value + 16, 0); stl_le_phys(&s->dma_as, value + 20, 0); stl_le_phys(&s->dma_as, value + 24, 0); resplen = 16; break; - case 0x0004800b: /* Set palette */ + case RPI_FWREQ_FRAMEBUFFER_SET_PALETTE: offset = ldl_le_phys(&s->dma_as, value + 12); length = ldl_le_phys(&s->dma_as, value + 16); n = 0; @@ -270,18 +271,18 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) stl_le_phys(&s->dma_as, value + 12, 0); resplen = 4; break; - case 0x00040013: /* Get number of displays */ + case RPI_FWREQ_FRAMEBUFFER_GET_NUM_DISPLAYS: stl_le_phys(&s->dma_as, value + 12, 1); resplen = 4; break; - case 0x00060001: /* Get DMA channels */ + case RPI_FWREQ_GET_DMA_CHANNELS: /* channels 2-5 */ stl_le_phys(&s->dma_as, value + 12, 0x003C); resplen = 4; break; - case 0x00050001: /* Get command line */ + case RPI_FWREQ_GET_COMMAND_LINE: /* * We follow the firmware behaviour: no NUL terminator is * written to the buffer, and if the buffer is too short From patchwork Mon Jun 12 22:34:55 2023 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: 691634 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp132047wru; Mon, 12 Jun 2023 15:36:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ivuxp7pWkPe22fEN+ZRMMsA6BTxJW1r3LnqCTRWbRfGFQsdbON2DcWe19yzYPraYxlwL4 X-Received: by 2002:a05:620a:4249:b0:75b:23a1:8336 with SMTP id w9-20020a05620a424900b0075b23a18336mr11063534qko.49.1686609372062; Mon, 12 Jun 2023 15:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686609372; cv=none; d=google.com; s=arc-20160816; b=wYRDEkM8bYqYxI/POewB0hbDlGi0v8eunWx1MsvlS5+QRIA3Bn/UYY2ueaRcmyN2nU 5yLY/FhaaFd7+9x/MLD6oAmS2hX/8RvaOQDmUF5FFvDd5wKk2ubAU5C32xfTbc1McHXv 5v8NJ6V/EbXdj/iarV0sV3N/WzbnMoZqTTWtjYgheOjk0sNN94vKcwq3kzSeiwOD5ScV WSfLwCuA6ql5cdx//+nvk8DYR45cTrOHnimDr+0A4lXqz/Bk5rosAGOVEaf0AA5eAYdv tvf22GbCl7exR2ZEJDGup7068Sx919vUVwfYSm5Yd+tneFpVmLo6ytafnoZBldhiAvlU F3yg== 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:cc:to :from:dkim-signature; bh=acR2Pn0tGnoCbeXDQipgDu1pq2FuVznnGrfx1Nr5E24=; b=Uc7SzI8OI9m9uCI9sIsdRqYIW4OAWodr+sDOPzHXgj/83qxNqpI47RrACI7G3FHtht z+DDSlEHmaBAvlRFiD5uSXZgHFMW1lSQJrubE6K7rPg7A04YLX1lqzQRAP9LebQyy6V6 3o2n9Bx13XiUAFr7Iy4fxcTjNOuEIw8ipi8zkrWVrxHHpoCxF5kDf1GOHYdo46cPNoH3 viP9n4Qpbtl4AmWDFmPJAAmvQJ2nUrn/P80HubUafMI2z2oggUqmuGcSrlkFuTryWXaF M/K7zyv/8Pzi/G8nqRF9rIqOlvqMD78PMiRQ2K8N4GOL4DMd824tg8ru/D2CuTz+O3Sr hOeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wobFW+0e; 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 n15-20020ae9c30f000000b0075775842e8bsi6367882qkg.432.2023.06.12.15.36.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Jun 2023 15:36:12 -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=wobFW+0e; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8q86-0001df-9o; Mon, 12 Jun 2023 18:35:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8q84-0001d2-Vc for qemu-devel@nongnu.org; Mon, 12 Jun 2023 18:35:16 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q8q82-0007qT-Rj for qemu-devel@nongnu.org; Mon, 12 Jun 2023 18:35:16 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5149b63151aso8186368a12.3 for ; Mon, 12 Jun 2023 15:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686609312; x=1689201312; 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=acR2Pn0tGnoCbeXDQipgDu1pq2FuVznnGrfx1Nr5E24=; b=wobFW+0eSCmRsA8i92SfreZPVOUQxUL+ZJ7Y0RJmxWOowQJxrhA2UwXUEzjpdUNxDn aNd/Mk0fyqoeoyejUmDQTuHjmUE4+P5r1FnZyD5FEqd35H5BVB7kxYKiHEEO6yWMQdrW bI3wNhAlLQjiwchBhAMR5nxjpg0ZXcKvbaJTy0ImrsnUxjO6u5iIN5oXHe2r1z/D9zDt 4IJm5tL8HKNpBFUb8ZSzijvybCiym3xRR4NzaL9PgHtyT4HSwfh76A3p7+AFdD8IUGo9 Xqd5pouxnLaIQd+gcCXjwW27TiWKD+QpeRw/wNRUrJF7cUmHPoV3maRluCC4A1Y2l9Z4 m1uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686609312; x=1689201312; 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=acR2Pn0tGnoCbeXDQipgDu1pq2FuVznnGrfx1Nr5E24=; b=NHFQkd8i4oSnwzAi/VO4oZCdc5r1WolPMvtyte/GnrtQlA6RxW6pfpN4hmbBBn8a9g LhoeT8hjmpL1pQpD0zZYNNxf1YK1rcwHnPv0YhCAHm8KH1r6ce4lZw0S+rgo5yB/udF8 HpLkEXHfmTSXT8iY8PnXpT48PVGlpp2daUl+qJNDfEz/xSu6WeoyOl4aIJnEBdQX9VnE 76xQijacBxuwx8PctOVpl+JPD7VLxhKxK3L2S4ZJ9Sj5T063P6R3h2l4kYDxPeV0GOYd uVFyyKQJRo2SoBP92SZZWYMfbO1UEEEVRZhqJMVOaIRwB2DncnTjG/qhs/S9j1FiCWmc EOOg== X-Gm-Message-State: AC+VfDzaSldu1/kuWcF6FB6ZxnfpzK3W6DAH2+Y/nu3JXm+EFId/BoUl RItVUGTfSdnG8eUh6LSU4YGYHHa5vw+Nqwl6z3uRZQ== X-Received: by 2002:a17:906:d542:b0:94f:36a0:da45 with SMTP id cr2-20020a170906d54200b0094f36a0da45mr12688507ejc.29.1686609312623; Mon, 12 Jun 2023 15:35:12 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id gt26-20020a170906f21a00b009600ce4fb53sm5771155ejb.37.2023.06.12.15.35.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 12 Jun 2023 15:35:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Sergey Kambalin , qemu-arm@nongnu.org, Peter Maydell Subject: [RFC PATCH v3 3/4] hw/misc/bcm2835_property: Replace magic frequency values by definitions Date: Tue, 13 Jun 2023 00:34:55 +0200 Message-Id: <20230612223456.33824-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230612223456.33824-1-philmd@linaro.org> References: <20230612223456.33824-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=philmd@linaro.org; helo=mail-ed1-x531.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=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 From: Sergey Kambalin Signed-off-by: Sergey Kambalin Message-Id: <20230531155258.8361-1-sergey.kambalin@auriga.com> [PMD: Split from bigger patch: 4/4] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- FIXME: RPI_FIRMWARE_DEFAULT_CLK_RATE is raspi1-specific... Good enough for now? --- include/hw/arm/raspi_platform.h | 5 +++++ hw/misc/bcm2835_property.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/hw/arm/raspi_platform.h b/include/hw/arm/raspi_platform.h index 4a56dd4b89..83f2588fc5 100644 --- a/include/hw/arm/raspi_platform.h +++ b/include/hw/arm/raspi_platform.h @@ -170,4 +170,9 @@ #define INTERRUPT_ILLEGAL_TYPE0 6 #define INTERRUPT_ILLEGAL_TYPE1 7 +/* Clock rates */ +#define RPI_FIRMWARE_EMMC_CLK_RATE 50000000 +#define RPI_FIRMWARE_UART_CLK_RATE 3000000 +#define RPI_FIRMWARE_DEFAULT_CLK_RATE 700000000 + #endif diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 7d398a6f75..2e4fe969bf 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -17,6 +17,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "trace.h" +#include "hw/arm/raspi_platform.h" /* https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface */ @@ -121,13 +122,14 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) case RPI_FWREQ_GET_MIN_CLOCK_RATE: switch (ldl_le_phys(&s->dma_as, value + 12)) { case RPI_FIRMWARE_EMMC_CLK_ID: - stl_le_phys(&s->dma_as, value + 16, 50000000); + stl_le_phys(&s->dma_as, value + 16, RPI_FIRMWARE_EMMC_CLK_RATE); break; case RPI_FIRMWARE_UART_CLK_ID: - stl_le_phys(&s->dma_as, value + 16, 3000000); + stl_le_phys(&s->dma_as, value + 16, RPI_FIRMWARE_UART_CLK_RATE); break; default: - stl_le_phys(&s->dma_as, value + 16, 700000000); + stl_le_phys(&s->dma_as, value + 16, + RPI_FIRMWARE_DEFAULT_CLK_RATE); break; } resplen = 8; From patchwork Mon Jun 12 22:34:56 2023 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: 691633 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp132026wru; Mon, 12 Jun 2023 15:36:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4KdukDJ77wZPFvCt5f63ijSpzhdVgLaUMIPl9CBMhOqgiUgZfGChcJ0zQBfUBSPsrkz8UD X-Received: by 2002:a05:6214:230b:b0:626:2f1b:b41a with SMTP id gc11-20020a056214230b00b006262f1bb41amr12381113qvb.49.1686609367589; Mon, 12 Jun 2023 15:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686609367; cv=none; d=google.com; s=arc-20160816; b=lTgRZd5ZCLfv28ooldewZmqBFtUE8hwOq/Zq6Acp+baTyohONL7Z9G5X25dVR5QG4J F1GCHxU8Ai3kUtSeGKnYdwtpfltx3tG3QrQKHzLz0x3dcoQUGqNaAOlyEj2lnIxIAAah tXs07KvZsv1Qt6ekXJZ7EHoYCmOKDHgqlaq7AwDR3TkYZk/SUUhp6A6USsgHUcKMgrnk WoFLVYIIQNxWutCYh6wRJlfOuiKgmZHjn/oV+0WFHMDj+U2j3P4/WvAA1cpW3YVUjusU U9qeGJd0FPBADQztjUz8yfhZGPF6WCfTx5IsvwCeUB1IW+2IMdDkPyLOuij8o/wqx6Fq AeXw== 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:cc:to :from:dkim-signature; bh=qu0YkZGL/goBV8MNatIwrKy50fK2dB6nGF+E/AAnJcw=; b=ZLmnHg7Ic3OZ9l8JRdYuflOPHoOGgrNXeb3brW2SN2Vf4KYiRQcXDFRtEcFOZhxumg idCJDMiNbcY0rgF+t23kg9aV46M4Oov3cZ2pWUrrmM9JmlGKHFsBKINmC5NAJrwU5TaX 0LMPRrA4i30BE1K6aJerBCVMsa+OABcl++xnwYa3kZ1UGxoQnqvgiEWSwsh3otyl1rT7 +/eurORU7oNQFLh0ogeejnHsDvFPHUQW1BFxm5NzkRTEBA5rQBnJmHvtd06yu36q2ZFL vl1FbjB46zDjvPJZ0aqxIODn26wnB5neFsUfJMyk176GEMOpYrLSuReK0+QKAOcMdBhU POFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ohccGuMz; 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 z2-20020ae9c102000000b0075d22c1892dsi6596116qki.662.2023.06.12.15.36.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Jun 2023 15:36:07 -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=ohccGuMz; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8q8A-0001el-4S; Mon, 12 Jun 2023 18:35:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8q88-0001e3-2Y for qemu-devel@nongnu.org; Mon, 12 Jun 2023 18:35:20 -0400 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q8q86-0007rX-I9 for qemu-devel@nongnu.org; Mon, 12 Jun 2023 18:35:19 -0400 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-51478f6106cso8471451a12.1 for ; Mon, 12 Jun 2023 15:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686609317; x=1689201317; 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=qu0YkZGL/goBV8MNatIwrKy50fK2dB6nGF+E/AAnJcw=; b=ohccGuMzFzrNl9EFwbE5JDyln4H5edIrf2w3BmuLRfV2Ri7GTzBjZ8vxJEDU7wIOrf OqxSfqxU9nOIM0P6Qz+lvNF9FjRktJwRnAY/UdyIVmbNPxunJ6zbqKG+Fh9mb3tLyFU+ njlaOn2vm48okCkw8Vvn2YaJM4xyvxaSLZ3dEemLiftAxsWkube0dZDvDH5GmErslmlz 1TEMMeKkmeBpyDALN1P4rfYEF7EjrC1Q9ggHsCVy6mbaGS9SR8bZbYNTIRQb7sQbQXxE Qhz0kLSsabEYKV2dx5lnegK8oUOJ7qpUHoiBmJiYAt+5YrjzDK/X3QdXD9W+TMpJHzKw Lwfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686609317; x=1689201317; 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=qu0YkZGL/goBV8MNatIwrKy50fK2dB6nGF+E/AAnJcw=; b=fKo7JsJseSdZrl7O7vCBKvzuhEuUx1sGeUe5yFXnOzKEENpo3+b2vvmI8sw6SIogFo v9KrTOV7Uj3D51j49Ft2qoJ1n1+BreC/nelXBbnpXVCBU35nQNHlajSxQAkBqdyOsMW3 Osck4sYa5Otzp793cDF2wKH5a0H3RLn6ml1ySjf1l5si1J/4XwcF6F8cZCIu2wL/eefv 94jZ2kE8+AWksj/qjUogI7ziY5d0po2g/dYxhvpMHik9qdyo7476V5vsLHrGCaYw2yFC GVSBCUhhuFySZf1DfEmCwrfBMCtRH6hyAd7etFcMur6SVUnNHdqX1E6QOMNexUZcLzN8 qdXA== X-Gm-Message-State: AC+VfDwkYWwW2ysNimYqqqLn6JJobCoKzeA8KZlTJ/uDTTsLTLCU7gIm 87860rz4aTDBc4MkwCfOePtOqe1SYJGtN7T2kbG30w== X-Received: by 2002:a17:907:320b:b0:96a:3e7:b592 with SMTP id xg11-20020a170907320b00b0096a03e7b592mr8758313ejb.25.1686609316954; Mon, 12 Jun 2023 15:35:16 -0700 (PDT) Received: from localhost.localdomain ([185.140.244.249]) by smtp.gmail.com with ESMTPSA id u22-20020a170906069600b0097461a7ebdcsm5753892ejb.82.2023.06.12.15.35.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 12 Jun 2023 15:35:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Sergey Kambalin , qemu-arm@nongnu.org, Peter Maydell Subject: [RFC PATCH v3 4/4] hw/misc/bcm2835_property: Handle CORE_CLK_ID firmware property Date: Tue, 13 Jun 2023 00:34:56 +0200 Message-Id: <20230612223456.33824-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230612223456.33824-1-philmd@linaro.org> References: <20230612223456.33824-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.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=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 From: Sergey Kambalin Signed-off-by: Sergey Kambalin Message-Id: <20230531155258.8361-1-sergey.kambalin@auriga.com> [PMD: Split from bigger patch: 3/4] Signed-off-by: Philippe Mathieu-Daudé --- TOCHECK: seems raspi3-specific freq. Use a per-soc freq? Good enough for now? --- include/hw/arm/raspi_platform.h | 1 + hw/misc/bcm2835_property.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/hw/arm/raspi_platform.h b/include/hw/arm/raspi_platform.h index 83f2588fc5..92a317950a 100644 --- a/include/hw/arm/raspi_platform.h +++ b/include/hw/arm/raspi_platform.h @@ -173,6 +173,7 @@ /* Clock rates */ #define RPI_FIRMWARE_EMMC_CLK_RATE 50000000 #define RPI_FIRMWARE_UART_CLK_RATE 3000000 +#define RPI_FIRMWARE_CORE_CLK_RATE 350000000 #define RPI_FIRMWARE_DEFAULT_CLK_RATE 700000000 #endif diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index 2e4fe969bf..4ed9faa54a 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -127,6 +127,9 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) case RPI_FIRMWARE_UART_CLK_ID: stl_le_phys(&s->dma_as, value + 16, RPI_FIRMWARE_UART_CLK_RATE); break; + case RPI_FIRMWARE_CORE_CLK_ID: + stl_le_phys(&s->dma_as, value + 16, RPI_FIRMWARE_CORE_CLK_RATE); + break; default: stl_le_phys(&s->dma_as, value + 16, RPI_FIRMWARE_DEFAULT_CLK_RATE);