diff mbox

[3/5] i2c: Log the engine clock frequency at boot

Message ID 20170424044544.23810-3-benh@kernel.crashing.org
State Accepted
Headers show

Commit Message

Benjamin Herrenschmidt April 24, 2017, 4:45 a.m. UTC
Since it's a non-trivial derivation from HDAT values,
it's useful to log it for diagnostics.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 hw/p8-i2c.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Oliver O'Halloran April 27, 2017, 8:49 a.m. UTC | #1
Reviewed-by: Oliver O'Halloran <oohall@gmail.com>

On Mon, Apr 24, 2017 at 2:45 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> Since it's a non-trivial derivation from HDAT values,
> it's useful to log it for diagnostics.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  hw/p8-i2c.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/hw/p8-i2c.c b/hw/p8-i2c.c
> index 52520dd..bfbc31d 100644
> --- a/hw/p8-i2c.c
> +++ b/hw/p8-i2c.c
> @@ -186,6 +186,7 @@ enum p8_i2c_master_type {
>  struct p8_i2c_master {
>         struct lock             lock;           /* Lock to guard the members */
>         enum p8_i2c_master_type type;           /* P8 vs. Centaur */
> +       uint64_t                start_time;     /* Request start time */
>         uint64_t                poll_interval;  /* Polling interval  */
>         uint64_t                byte_timeout;   /* Timeout per byte */
>         uint64_t                xscom_base;     /* xscom base of i2cm */
> @@ -1485,8 +1486,8 @@ static void p8_i2c_init_one(struct dt_node *i2cm, enum p8_i2c_master_type type)
>         init_timer(&master->recovery, p8_i2c_recover, master);
>         init_timer(&master->sensor_cache, p8_i2c_enable_scache, master);
>
> -       prlog(PR_INFO, "I2C: Chip %08x Eng. %d\n",
> -             master->chip_id, master->engine_id);
> +       prlog(PR_INFO, "I2C: Chip %08x Eng. %d Clock %d Mhz\n",
> +             master->chip_id, master->engine_id, lb_freq / 1000000);
>
>         /* Disable OCC cache during inits */
>         if (master->type == I2C_CENTAUR) {
> --
> 2.9.3
>
> _______________________________________________
> Skiboot mailing list
> Skiboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
diff mbox

Patch

diff --git a/hw/p8-i2c.c b/hw/p8-i2c.c
index 52520dd..bfbc31d 100644
--- a/hw/p8-i2c.c
+++ b/hw/p8-i2c.c
@@ -186,6 +186,7 @@  enum p8_i2c_master_type {
 struct p8_i2c_master {
 	struct lock		lock;		/* Lock to guard the members */
 	enum p8_i2c_master_type	type;		/* P8 vs. Centaur */
+	uint64_t		start_time;	/* Request start time */
 	uint64_t		poll_interval;	/* Polling interval  */
 	uint64_t		byte_timeout;	/* Timeout per byte */
 	uint64_t		xscom_base;	/* xscom base of i2cm */
@@ -1485,8 +1486,8 @@  static void p8_i2c_init_one(struct dt_node *i2cm, enum p8_i2c_master_type type)
 	init_timer(&master->recovery, p8_i2c_recover, master);
 	init_timer(&master->sensor_cache, p8_i2c_enable_scache, master);
 
-	prlog(PR_INFO, "I2C: Chip %08x Eng. %d\n",
-	      master->chip_id, master->engine_id);
+	prlog(PR_INFO, "I2C: Chip %08x Eng. %d Clock %d Mhz\n",
+	      master->chip_id, master->engine_id, lb_freq / 1000000);
 
 	/* Disable OCC cache during inits */
 	if (master->type == I2C_CENTAUR) {