From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Joel Stanley" <joel@jms.id.au>,
"Cédric Le Goater" <clg@kaod.org>,
"Peter Maydell" <peter.maydell@linaro.org>
Cc: Andrew Jeffery <andrew@aj.id.au>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/2] aspeed/scu: Implement chip ID register
Date: Tue, 21 Jan 2020 09:52:35 +0100 [thread overview]
Message-ID: <d20e112d-edf9-d8d8-fa6c-e93aac4dcec3@redhat.com> (raw)
In-Reply-To: <20200121013302.43839-3-joel@jms.id.au>
On 1/21/20 2:33 AM, Joel Stanley wrote:
> This returns a fixed but non-zero value for the chip id.
>
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
> hw/misc/aspeed_scu.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
> index 7108cad8c6a7..19d1780a40da 100644
> --- a/hw/misc/aspeed_scu.c
> +++ b/hw/misc/aspeed_scu.c
> @@ -77,6 +77,8 @@
> #define CPU2_BASE_SEG4 TO_REG(0x110)
> #define CPU2_BASE_SEG5 TO_REG(0x114)
> #define CPU2_CACHE_CTRL TO_REG(0x118)
> +#define CHIP_ID0 TO_REG(0x150)
> +#define CHIP_ID1 TO_REG(0x154)
> #define UART_HPLL_CLK TO_REG(0x160)
> #define PCIE_CTRL TO_REG(0x180)
> #define BMC_MMIO_CTRL TO_REG(0x184)
> @@ -115,6 +117,8 @@
> #define AST2600_HW_STRAP2_PROT TO_REG(0x518)
> #define AST2600_RNG_CTRL TO_REG(0x524)
> #define AST2600_RNG_DATA TO_REG(0x540)
> +#define AST2600_CHIP_ID0 TO_REG(0x5B0)
> +#define AST2600_CHIP_ID1 TO_REG(0x5B4)
>
> #define AST2600_CLK TO_REG(0x40)
>
> @@ -182,6 +186,8 @@ static const uint32_t ast2500_a1_resets[ASPEED_SCU_NR_REGS] = {
> [CPU2_BASE_SEG1] = 0x80000000U,
> [CPU2_BASE_SEG4] = 0x1E600000U,
> [CPU2_BASE_SEG5] = 0xC0000000U,
> + [CHIP_ID0] = 0x1234ABCDU,
> + [CHIP_ID1] = 0x88884444U,
> [UART_HPLL_CLK] = 0x00001903U,
> [PCIE_CTRL] = 0x0000007BU,
> [BMC_DEV_ID] = 0x00002402U
> @@ -307,6 +313,8 @@ static void aspeed_ast2500_scu_write(void *opaque, hwaddr offset,
> case RNG_DATA:
> case FREE_CNTR4:
> case FREE_CNTR4_EXT:
> + case CHIP_ID0:
> + case CHIP_ID1:
> qemu_log_mask(LOG_GUEST_ERROR,
> "%s: Write to read-only offset 0x%" HWADDR_PRIx "\n",
> __func__, offset);
> @@ -620,6 +628,8 @@ static void aspeed_ast2600_scu_write(void *opaque, hwaddr offset,
> case AST2600_RNG_DATA:
> case AST2600_SILICON_REV:
> case AST2600_SILICON_REV2:
> + case AST2600_CHIP_ID0:
> + case AST2600_CHIP_ID1:
> /* Add read only registers here */
> qemu_log_mask(LOG_GUEST_ERROR,
> "%s: Write to read-only offset 0x%" HWADDR_PRIx "\n",
> @@ -648,6 +658,9 @@ static const uint32_t ast2600_a0_resets[ASPEED_AST2600_SCU_NR_REGS] = {
> [AST2600_CLK_STOP_CTRL2] = 0xFFF0FFF0,
> [AST2600_SDRAM_HANDSHAKE] = 0x00000040, /* SoC completed DRAM init */
> [AST2600_HPLL_PARAM] = 0x1000405F,
> + [AST2600_CHIP_ID0] = 0x1234ABCD,
> + [AST2600_CHIP_ID1] = 0x88884444,
Since this doesn't match the datasheet, can you add a comment /*
Arbitrary non-zero value */?
With it:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> +
> };
>
> static void aspeed_ast2600_scu_reset(DeviceState *dev)
>
next prev parent reply other threads:[~2020-01-21 8:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-21 1:33 [PATCH 0/2] aspeed/scu: Implement chip id register Joel Stanley
2020-01-21 1:33 ` [PATCH 1/2] aspeed/scu: Create separate write callbacks Joel Stanley
2020-01-21 4:20 ` Andrew Jeffery
2020-01-21 7:23 ` Cédric Le Goater
2020-01-21 8:50 ` Philippe Mathieu-Daudé
2020-01-21 1:33 ` [PATCH 2/2] aspeed/scu: Implement chip ID register Joel Stanley
2020-01-21 4:23 ` Andrew Jeffery
2020-01-21 7:23 ` Cédric Le Goater
2020-01-21 8:52 ` Philippe Mathieu-Daudé [this message]
2020-01-21 7:23 ` [PATCH 0/2] aspeed/scu: Implement chip id register Cédric Le Goater
2020-02-17 9:29 ` Cédric Le Goater
2020-02-17 10:24 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d20e112d-edf9-d8d8-fa6c-e93aac4dcec3@redhat.com \
--to=philmd@redhat.com \
--cc=andrew@aj.id.au \
--cc=clg@kaod.org \
--cc=joel@jms.id.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).