All of lore.kernel.org
 help / color / mirror / Atom feed
From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 3/9] kmp204x: I2C deblocking support
Date: Fri, 31 Jan 2014 09:41:59 -0800	[thread overview]
Message-ID: <52EBE067.5000001@freescale.com> (raw)
In-Reply-To: <1391172372-29210-1-git-send-email-valentin.longchamp@keymile.com>

On 01/31/2014 04:46 AM, Valentin Longchamp wrote:
> From: Rainer Boschung <rainer.boschung@keymile.com>
> 
> This patch adds support for using some GPIOs that are connected to the
> I2C bus to force the bus lines state and perform some bus deblocking
> sequences.
> 
> The KM common deblocking algorithm from board/keymile/common/common.c is
> used. The GPIO lines used for deblocking the I2C bus are some external
> GPIOs provided by the QRIO CPLD:
>   - SCL = GPIOA_20
>   - SDA = GPIOA_21
> 
> The QRIO GPIOs act in an open-drain-like manner, for 0 the line is
> driven low and for 1 the GPIO is set as input and the line gets
> pulled-up.
> 
> Signed-off-by: Rainer Boschung <rainer.boschung@keymile.com>
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> 
> ---
> 
> Changes in v3:
> - rewrite the commit message and and the comments for more clarity
> - fix the GPIO numbers that where not correct
> 
> Changes in v2: None
> 
>  board/keymile/kmp204x/kmp204x.c     | 53 ++++++++++++++++++++++++++++++++++---
>  include/configs/km/kmp204x-common.h | 10 +++++++
>  2 files changed, 60 insertions(+), 3 deletions(-)
> 
> diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c
> index bbb2453..726d26e 100644
> --- a/board/keymile/kmp204x/kmp204x.c
> +++ b/board/keymile/kmp204x/kmp204x.c
> @@ -33,12 +33,51 @@ int checkboard(void)
>  	return 0;
>  }
>  
> -/* TODO: implement the I2C deblocking function */
> -int i2c_make_abort(void)
> +/* I2C deblocking uses the algorithm defined in board/keymile/common/common.c
> + * 2 dedicated QRIO GPIOs externally pull the SCL and SDA lines
> + * For I2C only the low state is activly driven and high state is pulled-up
> + * by a resistor. Therefore the deblock GPIOs are used
> + *  -> as an active output to drive a low state
> + *  -> as an open-drain input to have a pulled-up high state
> + */
> +
> +/* QRIO GPIOs used for deblocking */
> +#define DEBLOCK_PORT1	GPIO_A
> +#define DEBLOCK_SCL1	20
> +#define DEBLOCK_SDA1	21

You changed these macros but didn't change those below. This causes compiling
errors. Please fix it and compile before sending v4.

> +
> +/* By default deblock GPIOs are floating */
> +static void i2c_deblock_gpio_cfg(void)
> +{
> +	/* set I2C bus 1 deblocking GPIOs input, but 0 value for open drain */
> +	qrio_gpio_direction_input(DBLK_PORT1, DBLK_SCL1);
> +	qrio_gpio_direction_input(DBLK_PORT1, DBLK_SDA1);
> +
> +	qrio_set_gpio(DBLK_PORT1, DBLK_SCL1, 0);
> +	qrio_set_gpio(DBLK_PORT1, DBLK_SDA1, 0);
> +}


York

  reply	other threads:[~2014-01-31 17:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-27 10:49 [U-Boot] [PATCH v2 0/9] Further support for the kmp204x architecture Valentin Longchamp
2014-01-27 10:49 ` [U-Boot] [PATCH v2 1/9] kmp204x: support for QRIO1 bootcounter Valentin Longchamp
2014-02-03 20:22   ` York Sun
2014-01-27 10:49 ` [U-Boot] [PATCH v2 2/9] kmp204x: introduce QRIO GPIO functions Valentin Longchamp
2014-02-03 20:23   ` York Sun
2014-01-27 10:49 ` [U-Boot] [PATCH v2 3/9] kmp204x: I2C deblocking for I2C-bus1 added Valentin Longchamp
2014-01-30  2:30   ` York Sun
2014-01-30  7:32     ` Valentin Longchamp
2014-01-30  9:17       ` Boschung, Rainer
2014-01-30 17:40         ` York Sun
2014-01-31 12:46   ` [U-Boot] [PATCH v3 3/9] kmp204x: I2C deblocking support Valentin Longchamp
2014-01-31 17:41     ` York Sun [this message]
2014-02-03  7:45       ` [U-Boot] [PATCH v4 " Valentin Longchamp
2014-02-03 20:26         ` York Sun
2014-01-27 10:49 ` [U-Boot] [PATCH v2 4/9] kmp204x: implement workaround for A-006559 Valentin Longchamp
2014-02-03 20:23   ` York Sun
2014-01-27 10:49 ` [U-Boot] [PATCH v2 5/9] kmp204x: add support for the kmcoge4 board Valentin Longchamp
2014-02-03 20:23   ` York Sun
2014-01-27 10:49 ` [U-Boot] [PATCH v2 6/9] kmp204x: update I2C field of RCW Valentin Longchamp
2014-02-03 20:24   ` York Sun
2014-01-27 10:49 ` [U-Boot] [PATCH v2 7/9] KM: add the KM_UBI_PART_BOOT_OPTS #define Valentin Longchamp
2014-02-03 20:24   ` York Sun
2014-01-27 10:49 ` [U-Boot] [PATCH v2 8/9] kmp204x: enable support for SPANSION SPI NOR Valentin Longchamp
2014-02-03 20:25   ` York Sun
2014-01-27 10:49 ` [U-Boot] [PATCH v2 9/9] kmp204x: initial support for PCIe FPGA configuration Valentin Longchamp
2014-02-03 20:25   ` York Sun

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=52EBE067.5000001@freescale.com \
    --to=yorksun@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.