From: Stefan Berger <stefanb@linux.ibm.com>
To: "Cédric Le Goater" <clg@kaod.org>, qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, ninad@linux.ibm.com, joel@jms.id.au,
andrew@aj.id.au
Subject: Re: [PATCH 1/3] qtest: Add functions for accessing devices on Aspeed I2C controller
Date: Tue, 28 Mar 2023 08:26:16 -0400 [thread overview]
Message-ID: <ac889ea5-b335-ba77-46b6-6b91966e4da6@linux.ibm.com> (raw)
In-Reply-To: <0368d6a6-5f66-9758-6977-818128d928b5@kaod.org>
On 3/28/23 02:39, Cédric Le Goater wrote:
> On 3/27/23 22:24, Stefan Berger wrote:
>> Add read and write functions for accessing registers of I2C devices
>> connected to the Aspeed I2C controller.
>>
>> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
>
> Reviewed-by: Cédric Le Goater <clg@kaod.org>
>
> [... ]
>
>> +#ifndef QTEST_ASPEED_H
>> +#define QTEST_ASPEED_H
>> +
>> +#include <stdint.h>
>> +
>> +#define AST2600_ASPEED_I2C_BASE_ADDR 0x1e78a000
>> +
>> +static inline uint32_t ast2600_aspeed_i2c_calc_dev_addr(uint8_t bus_num)
>
> I think you could simplify the name ast2600_aspeed_i2c_calc_dev_addr()
> to aspeed_i2c_calc_bus_addr() and add a comment saying it implements only
> the AST2600 I2C controller. I don't think we will need the others.
What are 'the others'?
>
>> +{
>> + return AST2600_ASPEED_I2C_BASE_ADDR + 0x80 + bus_num * 0x80;
>> +}
>
> The formula is :
>
> return soc_base + (soc_i2c_offset + bus_num) * soc_i2c_reg_size;
That's what I thought:
return soc_base + soc_i2c_offset + (bus_num * soc_i2c_reg_size);
I will keep it as it is, though.
Stefan
>
> May be turn it that way in case you respin. This is minor.
>
> Thanks,
>
> C.
>
next prev parent reply other threads:[~2023-03-28 12:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 20:24 [PATCH 0/3] qtests: tpm: Add test cases for TPM TIS I2C device emulation Stefan Berger
2023-03-27 20:24 ` [PATCH 1/3] qtest: Add functions for accessing devices on Aspeed I2C controller Stefan Berger
2023-03-28 6:39 ` Cédric Le Goater
2023-03-28 12:26 ` Stefan Berger [this message]
2023-03-28 13:10 ` Cédric Le Goater
2023-03-28 13:26 ` Ninad Palsule
2023-03-27 20:24 ` [PATCH 2/3] qtest: Move tpm_util_tis_transmit() into tpm-tis-utils.c and rename it Stefan Berger
2023-03-28 13:31 ` Ninad Palsule
2023-03-27 20:24 ` [PATCH 3/3] qtest: Add a test case for TPM TIS I2C connected to Aspeed I2C controller Stefan Berger
2023-03-28 6:44 ` Cédric Le Goater
2023-03-28 9:17 ` Cédric Le Goater
2023-03-28 11:31 ` Stefan Berger
2023-03-28 11:52 ` Cédric Le Goater
2023-03-28 14:10 ` Ninad Palsule
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=ac889ea5-b335-ba77-46b6-6b91966e4da6@linux.ibm.com \
--to=stefanb@linux.ibm.com \
--cc=andrew@aj.id.au \
--cc=clg@kaod.org \
--cc=joel@jms.id.au \
--cc=marcandre.lureau@redhat.com \
--cc=ninad@linux.ibm.com \
--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).