From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: socfpga: Enable DM_I2C
Date: Fri, 18 Mar 2016 12:20:16 +0100 [thread overview]
Message-ID: <56EBE470.7040505@denx.de> (raw)
In-Reply-To: <1458287735-22908-1-git-send-email-sr@denx.de>
On 03/18/2016 08:55 AM, Stefan Roese wrote:
> The designware I2C driver now supports DM. So lets use it and enable
> DM_I2C for this platform per default.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> ---
> arch/arm/Kconfig | 1 +
> arch/arm/dts/socfpga.dtsi | 4 ++++
> include/configs/socfpga_common.h | 16 ----------------
> 3 files changed, 5 insertions(+), 16 deletions(-)
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index e5f57ef..98c1f10 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -516,6 +516,7 @@ config ARCH_SOCFPGA
> select DM
> select DM_SPI_FLASH
> select DM_SPI
> + select DM_I2C
>
> config TARGET_CM_T43
> bool "Support cm_t43"
> diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
> index 8588221..fe55722 100644
> --- a/arch/arm/dts/socfpga.dtsi
> +++ b/arch/arm/dts/socfpga.dtsi
> @@ -23,6 +23,10 @@
> spi0 = &qspi;
> spi1 = &spi0;
> spi2 = &spi1;
> + i2c0 = &i2c0;
> + i2c1 = &i2c1;
> + i2c2 = &i2c2;
> + i2c3 = &i2c3;
Something tells me that you should be super-careful here, because some
socfpga boards actually do use i2c. But just adding the aliases here
without actually enabling the i2c via DT now will cause breakage.
One way to solve it is to enable all four buses in socfpga-cyclone5.dtsi
but that's not something I find very appealing. The other is to keep the
patch this way and wait until someone complains his i2c is not working.
What do you think ?
> };
>
> cpus {
> diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
> index cd48c9e..58e4827 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -177,23 +177,7 @@
> /*
> * I2C support
> */
> -#define CONFIG_SYS_I2C
> #define CONFIG_SYS_I2C_DW
> -#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
> -#define CONFIG_SYS_I2C_SPEED1 100000
> -#define CONFIG_SYS_I2C_SPEED2 100000
> -#define CONFIG_SYS_I2C_SPEED3 100000
> -/* Address of device when used as slave */
> -#define CONFIG_SYS_I2C_SLAVE 0x02
> -#define CONFIG_SYS_I2C_SLAVE1 0x02
> -#define CONFIG_SYS_I2C_SLAVE2 0x02
> -#define CONFIG_SYS_I2C_SLAVE3 0x02
> #ifndef __ASSEMBLY__
> /* Clock supplied to I2C controller in unit of MHz */
> unsigned int cm_get_l4_sp_clk_hz(void);
>
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2016-03-18 11:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-18 7:55 [U-Boot] [PATCH] arm: socfpga: Enable DM_I2C Stefan Roese
2016-03-18 11:20 ` Marek Vasut [this message]
2016-03-18 12:16 ` Stefan Roese
2016-03-18 12:19 ` 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=56EBE470.7040505@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox