[PATCH v1 02/10] hw/i2c/aspeed_i2c: Increase I2C device register size to 0xA0

Jamin Lin posted 10 patches 2 days, 21 hours ago
Maintainers: "Cédric Le Goater" <clg@kaod.org>, Peter Maydell <peter.maydell@linaro.org>, Steven Lee <steven_lee@aspeedtech.com>, Troy Lee <leetroy@gmail.com>, Jamin Lin <jamin_lin@aspeedtech.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH v1 02/10] hw/i2c/aspeed_i2c: Increase I2C device register size to 0xA0
Posted by Jamin Lin 2 days, 21 hours ago
According to the AST2700 A1 datasheet, the register space for each I2C
device instance has been expanded from 0x80 bytes to 0xA0 bytes.

Update the AST2700 I2C controller configuration to reflect the new
register layout by increasing the per-device register size to 0xA0
and adjusting the register gap size accordingly.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
 hw/i2c/aspeed_i2c.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
index cf3a003978..e1682c9bdd 100644
--- a/hw/i2c/aspeed_i2c.c
+++ b/hw/i2c/aspeed_i2c.c
@@ -1206,37 +1206,37 @@ static void aspeed_i2c_instance_init(Object *obj)
  *
  * Address Definitions (AST2700)
  *   0x000 ... 0x0FF: Global Register
- *   0x100 ... 0x17F: Device 0
+ *   0x100 ... 0x19F: Device 0
  *   0x1A0 ... 0x1BF: Device 0 buffer
- *   0x200 ... 0x27F: Device 1
+ *   0x200 ... 0x29F: Device 1
  *   0x2A0 ... 0x2BF: Device 1 buffer
- *   0x300 ... 0x37F: Device 2
+ *   0x300 ... 0x39F: Device 2
  *   0x3A0 ... 0x3BF: Device 2 buffer
- *   0x400 ... 0x47F: Device 3
+ *   0x400 ... 0x49F: Device 3
  *   0x4A0 ... 0x4BF: Device 3 buffer
- *   0x500 ... 0x57F: Device 4
+ *   0x500 ... 0x59F: Device 4
  *   0x5A0 ... 0x5BF: Device 4 buffer
- *   0x600 ... 0x67F: Device 5
+ *   0x600 ... 0x69F: Device 5
  *   0x6A0 ... 0x6BF: Device 5 buffer
- *   0x700 ... 0x77F: Device 6
+ *   0x700 ... 0x79F: Device 6
  *   0x7A0 ... 0x7BF: Device 6 buffer
- *   0x800 ... 0x87F: Device 7
+ *   0x800 ... 0x89F: Device 7
  *   0x8A0 ... 0x8BF: Device 7 buffer
- *   0x900 ... 0x97F: Device 8
+ *   0x900 ... 0x99F: Device 8
  *   0x9A0 ... 0x9BF: Device 8 buffer
- *   0xA00 ... 0xA7F: Device 9
+ *   0xA00 ... 0xA9F: Device 9
  *   0xAA0 ... 0xABF: Device 9 buffer
- *   0xB00 ... 0xB7F: Device 10
+ *   0xB00 ... 0xB9F: Device 10
  *   0xBA0 ... 0xBBF: Device 10 buffer
- *   0xC00 ... 0xC7F: Device 11
+ *   0xC00 ... 0xC9F: Device 11
  *   0xCA0 ... 0xCBF: Device 11 buffer
- *   0xD00 ... 0xD7F: Device 12
+ *   0xD00 ... 0xD9F: Device 12
  *   0xDA0 ... 0xDBF: Device 12 buffer
- *   0xE00 ... 0xE7F: Device 13
+ *   0xE00 ... 0xE9F: Device 13
  *   0xEA0 ... 0xEBF: Device 13 buffer
- *   0xF00 ... 0xF7F: Device 14
+ *   0xF00 ... 0xF9F: Device 14
  *   0xFA0 ... 0xFBF: Device 14 buffer
- *   0x1000 ... 0x107F: Device 15
+ *   0x1000 ... 0x109F: Device 15
  *   0x10A0 ... 0x10BF: Device 15 buffer
  */
 static void aspeed_i2c_realize(DeviceState *dev, Error **errp)
@@ -1670,8 +1670,8 @@ static void aspeed_2700_i2c_class_init(ObjectClass *klass, const void *data)
     dc->desc = "ASPEED 2700 I2C Controller";
 
     aic->num_busses = 16;
-    aic->reg_size = 0x80;
-    aic->reg_gap_size = 0x80;
+    aic->reg_size = 0xa0;
+    aic->reg_gap_size = 0x60;
     aic->gap = -1; /* no gap */
     aic->bus_get_irq = aspeed_2600_i2c_bus_get_irq;
     aic->pool_size = 0x20;
-- 
2.43.0
Re: [PATCH v1 02/10] hw/i2c/aspeed_i2c: Increase I2C device register size to 0xA0
Posted by Cédric Le Goater 2 days, 17 hours ago
On 2/6/26 06:33, Jamin Lin wrote:
> According to the AST2700 A1 datasheet, the register space for each I2C
> device instance has been expanded from 0x80 bytes to 0xA0 bytes.

Was that change introduced with the A1 ? or A0 ?

Thanks,

C.


> Update the AST2700 I2C controller configuration to reflect the new
> register layout by increasing the per-device register size to 0xA0
> and adjusting the register gap size accordingly.
> 
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
>   hw/i2c/aspeed_i2c.c | 36 ++++++++++++++++++------------------
>   1 file changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c
> index cf3a003978..e1682c9bdd 100644
> --- a/hw/i2c/aspeed_i2c.c
> +++ b/hw/i2c/aspeed_i2c.c
> @@ -1206,37 +1206,37 @@ static void aspeed_i2c_instance_init(Object *obj)
>    *
>    * Address Definitions (AST2700)
>    *   0x000 ... 0x0FF: Global Register
> - *   0x100 ... 0x17F: Device 0
> + *   0x100 ... 0x19F: Device 0
>    *   0x1A0 ... 0x1BF: Device 0 buffer
> - *   0x200 ... 0x27F: Device 1
> + *   0x200 ... 0x29F: Device 1
>    *   0x2A0 ... 0x2BF: Device 1 buffer
> - *   0x300 ... 0x37F: Device 2
> + *   0x300 ... 0x39F: Device 2
>    *   0x3A0 ... 0x3BF: Device 2 buffer
> - *   0x400 ... 0x47F: Device 3
> + *   0x400 ... 0x49F: Device 3
>    *   0x4A0 ... 0x4BF: Device 3 buffer
> - *   0x500 ... 0x57F: Device 4
> + *   0x500 ... 0x59F: Device 4
>    *   0x5A0 ... 0x5BF: Device 4 buffer
> - *   0x600 ... 0x67F: Device 5
> + *   0x600 ... 0x69F: Device 5
>    *   0x6A0 ... 0x6BF: Device 5 buffer
> - *   0x700 ... 0x77F: Device 6
> + *   0x700 ... 0x79F: Device 6
>    *   0x7A0 ... 0x7BF: Device 6 buffer
> - *   0x800 ... 0x87F: Device 7
> + *   0x800 ... 0x89F: Device 7
>    *   0x8A0 ... 0x8BF: Device 7 buffer
> - *   0x900 ... 0x97F: Device 8
> + *   0x900 ... 0x99F: Device 8
>    *   0x9A0 ... 0x9BF: Device 8 buffer
> - *   0xA00 ... 0xA7F: Device 9
> + *   0xA00 ... 0xA9F: Device 9
>    *   0xAA0 ... 0xABF: Device 9 buffer
> - *   0xB00 ... 0xB7F: Device 10
> + *   0xB00 ... 0xB9F: Device 10
>    *   0xBA0 ... 0xBBF: Device 10 buffer
> - *   0xC00 ... 0xC7F: Device 11
> + *   0xC00 ... 0xC9F: Device 11
>    *   0xCA0 ... 0xCBF: Device 11 buffer
> - *   0xD00 ... 0xD7F: Device 12
> + *   0xD00 ... 0xD9F: Device 12
>    *   0xDA0 ... 0xDBF: Device 12 buffer
> - *   0xE00 ... 0xE7F: Device 13
> + *   0xE00 ... 0xE9F: Device 13
>    *   0xEA0 ... 0xEBF: Device 13 buffer
> - *   0xF00 ... 0xF7F: Device 14
> + *   0xF00 ... 0xF9F: Device 14
>    *   0xFA0 ... 0xFBF: Device 14 buffer
> - *   0x1000 ... 0x107F: Device 15
> + *   0x1000 ... 0x109F: Device 15
>    *   0x10A0 ... 0x10BF: Device 15 buffer
>    */
>   static void aspeed_i2c_realize(DeviceState *dev, Error **errp)
> @@ -1670,8 +1670,8 @@ static void aspeed_2700_i2c_class_init(ObjectClass *klass, const void *data)
>       dc->desc = "ASPEED 2700 I2C Controller";
>   
>       aic->num_busses = 16;
> -    aic->reg_size = 0x80;
> -    aic->reg_gap_size = 0x80;
> +    aic->reg_size = 0xa0;
> +    aic->reg_gap_size = 0x60;
>       aic->gap = -1; /* no gap */
>       aic->bus_get_irq = aspeed_2600_i2c_bus_get_irq;
>       aic->pool_size = 0x20;
RE: [PATCH v1 02/10] hw/i2c/aspeed_i2c: Increase I2C device register size to 0xA0
Posted by Jamin Lin 53 minutes ago
Hi Cédric

> Subject: Re: [PATCH v1 02/10] hw/i2c/aspeed_i2c: Increase I2C device register
> size to 0xA0
> 
> On 2/6/26 06:33, Jamin Lin wrote:
> > According to the AST2700 A1 datasheet, the register space for each I2C
> > device instance has been expanded from 0x80 bytes to 0xA0 bytes.
> 
> Was that change introduced with the A1 ? or A0 ?
> 

The change was introduced in A1.
Both A1 and A2 use the same device register size of 0xA0.

Thanks,
Jamin

> Thanks,
> 
> C.
> 
> 
> > Update the AST2700 I2C controller configuration to reflect the new
> > register layout by increasing the per-device register size to 0xA0 and
> > adjusting the register gap size accordingly.
> >
> > Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> > ---
> >   hw/i2c/aspeed_i2c.c | 36 ++++++++++++++++++------------------
> >   1 file changed, 18 insertions(+), 18 deletions(-)
> >
> > diff --git a/hw/i2c/aspeed_i2c.c b/hw/i2c/aspeed_i2c.c index
> > cf3a003978..e1682c9bdd 100644
> > --- a/hw/i2c/aspeed_i2c.c
> > +++ b/hw/i2c/aspeed_i2c.c
> > @@ -1206,37 +1206,37 @@ static void aspeed_i2c_instance_init(Object
> *obj)
> >    *
> >    * Address Definitions (AST2700)
> >    *   0x000 ... 0x0FF: Global Register
> > - *   0x100 ... 0x17F: Device 0
> > + *   0x100 ... 0x19F: Device 0
> >    *   0x1A0 ... 0x1BF: Device 0 buffer
> > - *   0x200 ... 0x27F: Device 1
> > + *   0x200 ... 0x29F: Device 1
> >    *   0x2A0 ... 0x2BF: Device 1 buffer
> > - *   0x300 ... 0x37F: Device 2
> > + *   0x300 ... 0x39F: Device 2
> >    *   0x3A0 ... 0x3BF: Device 2 buffer
> > - *   0x400 ... 0x47F: Device 3
> > + *   0x400 ... 0x49F: Device 3
> >    *   0x4A0 ... 0x4BF: Device 3 buffer
> > - *   0x500 ... 0x57F: Device 4
> > + *   0x500 ... 0x59F: Device 4
> >    *   0x5A0 ... 0x5BF: Device 4 buffer
> > - *   0x600 ... 0x67F: Device 5
> > + *   0x600 ... 0x69F: Device 5
> >    *   0x6A0 ... 0x6BF: Device 5 buffer
> > - *   0x700 ... 0x77F: Device 6
> > + *   0x700 ... 0x79F: Device 6
> >    *   0x7A0 ... 0x7BF: Device 6 buffer
> > - *   0x800 ... 0x87F: Device 7
> > + *   0x800 ... 0x89F: Device 7
> >    *   0x8A0 ... 0x8BF: Device 7 buffer
> > - *   0x900 ... 0x97F: Device 8
> > + *   0x900 ... 0x99F: Device 8
> >    *   0x9A0 ... 0x9BF: Device 8 buffer
> > - *   0xA00 ... 0xA7F: Device 9
> > + *   0xA00 ... 0xA9F: Device 9
> >    *   0xAA0 ... 0xABF: Device 9 buffer
> > - *   0xB00 ... 0xB7F: Device 10
> > + *   0xB00 ... 0xB9F: Device 10
> >    *   0xBA0 ... 0xBBF: Device 10 buffer
> > - *   0xC00 ... 0xC7F: Device 11
> > + *   0xC00 ... 0xC9F: Device 11
> >    *   0xCA0 ... 0xCBF: Device 11 buffer
> > - *   0xD00 ... 0xD7F: Device 12
> > + *   0xD00 ... 0xD9F: Device 12
> >    *   0xDA0 ... 0xDBF: Device 12 buffer
> > - *   0xE00 ... 0xE7F: Device 13
> > + *   0xE00 ... 0xE9F: Device 13
> >    *   0xEA0 ... 0xEBF: Device 13 buffer
> > - *   0xF00 ... 0xF7F: Device 14
> > + *   0xF00 ... 0xF9F: Device 14
> >    *   0xFA0 ... 0xFBF: Device 14 buffer
> > - *   0x1000 ... 0x107F: Device 15
> > + *   0x1000 ... 0x109F: Device 15
> >    *   0x10A0 ... 0x10BF: Device 15 buffer
> >    */
> >   static void aspeed_i2c_realize(DeviceState *dev, Error **errp) @@
> > -1670,8 +1670,8 @@ static void aspeed_2700_i2c_class_init(ObjectClass
> *klass, const void *data)
> >       dc->desc = "ASPEED 2700 I2C Controller";
> >
> >       aic->num_busses = 16;
> > -    aic->reg_size = 0x80;
> > -    aic->reg_gap_size = 0x80;
> > +    aic->reg_size = 0xa0;
> > +    aic->reg_gap_size = 0x60;
> >       aic->gap = -1; /* no gap */
> >       aic->bus_get_irq = aspeed_2600_i2c_bus_get_irq;
> >       aic->pool_size = 0x20;