From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: socfpga: Add I2C support to SoCFPGA
Date: Mon, 20 Oct 2014 16:46:52 +0200 [thread overview]
Message-ID: <201410201646.52990.marex@denx.de> (raw)
In-Reply-To: <1413787548-25438-1-git-send-email-sr@denx.de>
On Monday, October 20, 2014 at 08:45:48 AM, Stefan Roese wrote:
Hi all,
> This patch adds I2C support for the SoCFPGA. Using the designware I2C
> controller driver. It supports all 4 I2C busses on the SoCFPGA.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Vince Briders <vbridger@altera.com>
> Cc: Chin Liang See <clsee@altera.com>
> Cc: Dinh Nguyen <dinguyen@altera.com>
+CC Heiko, the I2C custodian.
> ---
> include/configs/socfpga_common.h | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/include/configs/socfpga_common.h
> b/include/configs/socfpga_common.h index 49504dc..ba1e072 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -157,6 +157,28 @@
> #define CONFIG_BAUDRATE 115200
>
> /*
> + * I2C support
> + */
> +#define CONFIG_HARD_I2C
> +#define CONFIG_DW_I2C
> +#define CONFIG_I2C_MULTI_BUS
I presume this should be converted to CONFIG_SYS_I2C framework instead of using
this I2C multibus horror, no?
> +#define CONFIG_SYS_I2C_BUS_MAX 4
> +#define CONFIG_SYS_I2C_BASE SOCFPGA_I2C0_ADDRESS
> +#define CONFIG_SYS_I2C_BASE1 SOCFPGA_I2C1_ADDRESS
> +#define CONFIG_SYS_I2C_BASE2 SOCFPGA_I2C2_ADDRESS
> +#define CONFIG_SYS_I2C_BASE3 SOCFPGA_I2C3_ADDRESS
> +/* using standard mode which the speed up to 100Kb/s */
> +#define CONFIG_SYS_I2C_SPEED 100000
> +/* address of device when used as slave */
> +#define CONFIG_SYS_I2C_SLAVE 0x02
> +#ifndef __ASSEMBLY__
> +/* clock supplied to I2C controller in unit of MHz */
> +unsigned int cm_get_l4_sp_clk_hz(void);
Include clock_manager.h instead maybe ?
> +#define IC_CLK (cm_get_l4_sp_clk_hz() / 1000000)
> +#endif
> +#define CONFIG_CMD_I2C
> +
> +/*
> * U-Boot environment
> */
> #define CONFIG_SYS_CONSOLE_IS_IN_ENV
Best regards,
Marek Vasut
next prev parent reply other threads:[~2014-10-20 14:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 6:45 [U-Boot] [PATCH] arm: socfpga: Add I2C support to SoCFPGA Stefan Roese
2014-10-20 14:46 ` Marek Vasut [this message]
2014-10-21 6:44 ` Heiko Schocher
2014-10-23 7:55 ` Stefan Roese
2014-10-23 8:47 ` Marek Vasut
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=201410201646.52990.marex@denx.de \
--to=marex@denx.de \
--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.