* [U-Boot] [PATCH v2] arm: socfpga: Add I2C support to SoCFPGA
@ 2014-10-30 8:33 Stefan Roese
2014-10-30 8:39 ` Heiko Schocher
2014-10-30 9:31 ` Marek Vasut
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Roese @ 2014-10-30 8:33 UTC (permalink / raw)
To: u-boot
This patch adds I2C support for the SoCFPGA. Using the designware I2C
controller driver. It supports all 4 I2C busses on the SoCFPGA.
The designware I2C driver has now been converted to the
CONFIG_SYS_I2C framework. So lets enable it on SoCFPGA.
Tested on SoCrates.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Chin Liang See <clsee@altera.com>
Cc: Dinh Nguyen <dinguyen@altera.com>
Cc: Vince Bridgers <vbridger@altera.com>
Cc: Pavel Machek <pavel@denx.de>
Cc: Heiko Schocher <hs@denx.de>
---
v2:
- The designware I2C driver now has been converted to the
CONFIG_SYS_I2C framework. Use the correct defines to enable it.
include/configs/socfpga_common.h | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 83a1bcd..f7b314d 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -141,6 +141,33 @@
#define CONFIG_SYS_MMC_MAX_BLK_COUNT 256 /* FIXME -- SPL only? */
#endif
+ /*
+ * 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);
+#define IC_CLK (cm_get_l4_sp_clk_hz() / 1000000)
+#endif
+#define CONFIG_CMD_I2C
+
/*
* Serial Driver
*/
--
2.1.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] arm: socfpga: Add I2C support to SoCFPGA
2014-10-30 8:33 [U-Boot] [PATCH v2] arm: socfpga: Add I2C support to SoCFPGA Stefan Roese
@ 2014-10-30 8:39 ` Heiko Schocher
2014-10-30 9:31 ` Marek Vasut
1 sibling, 0 replies; 3+ messages in thread
From: Heiko Schocher @ 2014-10-30 8:39 UTC (permalink / raw)
To: u-boot
Hello Stefan,
Am 30.10.2014 09:33, schrieb Stefan Roese:
> This patch adds I2C support for the SoCFPGA. Using the designware I2C
> controller driver. It supports all 4 I2C busses on the SoCFPGA.
>
> The designware I2C driver has now been converted to the
> CONFIG_SYS_I2C framework. So lets enable it on SoCFPGA.
>
> Tested on SoCrates.
>
> Signed-off-by: Stefan Roese<sr@denx.de>
> Cc: Marek Vasut<marex@denx.de>
> Cc: Chin Liang See<clsee@altera.com>
> Cc: Dinh Nguyen<dinguyen@altera.com>
> Cc: Vince Bridgers<vbridger@altera.com>
> Cc: Pavel Machek<pavel@denx.de>
> Cc: Heiko Schocher<hs@denx.de>
> ---
> v2:
> - The designware I2C driver now has been converted to the
> CONFIG_SYS_I2C framework. Use the correct defines to enable it.
>
> include/configs/socfpga_common.h | 27 +++++++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
As the socfpga custodian should pick up this patch, I only Ack
this patch:
Acked-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
>
> diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
> index 83a1bcd..f7b314d 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -141,6 +141,33 @@
> #define CONFIG_SYS_MMC_MAX_BLK_COUNT 256 /* FIXME -- SPL only? */
> #endif
>
> + /*
> + * 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);
> +#define IC_CLK (cm_get_l4_sp_clk_hz() / 1000000)
> +#endif
> +#define CONFIG_CMD_I2C
> +
> /*
> * Serial Driver
> */
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH v2] arm: socfpga: Add I2C support to SoCFPGA
2014-10-30 8:33 [U-Boot] [PATCH v2] arm: socfpga: Add I2C support to SoCFPGA Stefan Roese
2014-10-30 8:39 ` Heiko Schocher
@ 2014-10-30 9:31 ` Marek Vasut
1 sibling, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2014-10-30 9:31 UTC (permalink / raw)
To: u-boot
On Thursday, October 30, 2014 at 09:33:13 AM, Stefan Roese wrote:
> This patch adds I2C support for the SoCFPGA. Using the designware I2C
> controller driver. It supports all 4 I2C busses on the SoCFPGA.
>
> The designware I2C driver has now been converted to the
> CONFIG_SYS_I2C framework. So lets enable it on SoCFPGA.
>
> Tested on SoCrates.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Chin Liang See <clsee@altera.com>
> Cc: Dinh Nguyen <dinguyen@altera.com>
> Cc: Vince Bridgers <vbridger@altera.com>
> Cc: Pavel Machek <pavel@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
Applied, thanks!
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-30 9:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-30 8:33 [U-Boot] [PATCH v2] arm: socfpga: Add I2C support to SoCFPGA Stefan Roese
2014-10-30 8:39 ` Heiko Schocher
2014-10-30 9:31 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox