[PATCH 08/11] hw/pci-host/astro: Add comment about Astro version numbers

Helge Deller posted 11 patches 2 days, 3 hours ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Helge Deller <deller@gmx.de>
[PATCH 08/11] hw/pci-host/astro: Add comment about Astro version numbers
Posted by Helge Deller 2 days, 3 hours ago
From: Helge Deller <deller@gmx.de>

Signed-off-by: Helge Deller <deller@gmx.de>
---
 hw/pci-host/astro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c
index 8c61c696bd..776267e150 100644
--- a/hw/pci-host/astro.c
+++ b/hw/pci-host/astro.c
@@ -738,7 +738,7 @@ static MemTxResult astro_chip_read_with_attrs(void *opaque, hwaddr addr,
     switch ((addr >> 3) << 3) {
     /* R2I registers */
     case 0x0000:        /* ID */
-        val = (0x01 << 3) | 0x01ULL;
+        val = (0x01 << 3) | 0x01ULL; /* 0=Astro 1.0, 9=Astro 2.1, 2=Astro 3.0 */
         break;
     case 0x0008:        /* IOC_CTRL */
         val = s->ioc_ctrl;
-- 
2.53.0
Re: [PATCH 08/11] hw/pci-host/astro: Add comment about Astro version numbers
Posted by Philippe Mathieu-Daudé 2 days, 3 hours ago
On 30/3/26 23:18, Helge Deller wrote:
> From: Helge Deller <deller@gmx.de>
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
>   hw/pci-host/astro.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c
> index 8c61c696bd..776267e150 100644
> --- a/hw/pci-host/astro.c
> +++ b/hw/pci-host/astro.c
> @@ -738,7 +738,7 @@ static MemTxResult astro_chip_read_with_attrs(void *opaque, hwaddr addr,
>       switch ((addr >> 3) << 3) {
>       /* R2I registers */
>       case 0x0000:        /* ID */
> -        val = (0x01 << 3) | 0x01ULL;
> +        val = (0x01 << 3) | 0x01ULL; /* 0=Astro 1.0, 9=Astro 2.1, 2=Astro 3.0 */

Using enum:

enum { ID_ASTRO_1_0 = 0, ID_ASTRO_2_1 = 9, ID_ASTRO_3_0 = 2 };

             val = ID_ASTRO_2_1;

>           break;
>       case 0x0008:        /* IOC_CTRL */
>           val = s->ioc_ctrl;
Re: [PATCH 08/11] hw/pci-host/astro: Add comment about Astro version numbers
Posted by Helge Deller 1 day, 8 hours ago
On 3/30/26 23:54, Philippe Mathieu-Daudé wrote:
> On 30/3/26 23:18, Helge Deller wrote:
>> From: Helge Deller <deller@gmx.de>
>>
>> Signed-off-by: Helge Deller <deller@gmx.de>
>> ---
>>   hw/pci-host/astro.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c
>> index 8c61c696bd..776267e150 100644
>> --- a/hw/pci-host/astro.c
>> +++ b/hw/pci-host/astro.c
>> @@ -738,7 +738,7 @@ static MemTxResult astro_chip_read_with_attrs(void *opaque, hwaddr addr,
>>       switch ((addr >> 3) << 3) {
>>       /* R2I registers */
>>       case 0x0000:        /* ID */
>> -        val = (0x01 << 3) | 0x01ULL;
>> +        val = (0x01 << 3) | 0x01ULL; /* 0=Astro 1.0, 9=Astro 2.1, 2=Astro 3.0 */
> 
> Using enum:
> 
> enum { ID_ASTRO_1_0 = 0, ID_ASTRO_2_1 = 9, ID_ASTRO_3_0 = 2 };
> 
>              val = ID_ASTRO_2_1;

Good idea.
I've fixed it up and queued this patch for post qemu-v11.

Thanks!
Helge


>>           break;
>>       case 0x0008:        /* IOC_CTRL */
>>           val = s->ioc_ctrl;
>