diff options
author | Chin Liang See <clsee@altera.com> | 2015-02-25 17:29:13 +0800 |
---|---|---|
committer | Alan Tull <atull@opensource.altera.com> | 2015-02-26 15:28:47 -0600 |
commit | b816b9860dfda837bb948f5e8ceb62c5e76aeccb (patch) | |
tree | d215f420de67435c679e4da4985f97593811d3bc | |
parent | 6a1bfe586b7c50d9e348a2c66c6367fea0eb5356 (diff) | |
download | u-boot-socfpga-b816b9860dfda837bb948f5e8ceb62c5e76aeccb.tar.gz |
FogBugz #270904-78: Enable the I2C in U-Boot
This enables I2C support on the Arria10 devkit.
Signed-off-by: Chin Liang See <clsee@altera.com>
Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
-rwxr-xr-x | arch/arm/include/asm/arch-socfpga_arria10/hardware.h | 2 | ||||
-rwxr-xr-x | board/altera/socfpga_arria10/pll_config.h | 1 | ||||
-rwxr-xr-x | include/configs/socfpga_arria10.h | 15 |
3 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-socfpga_arria10/hardware.h b/arch/arm/include/asm/arch-socfpga_arria10/hardware.h index ee2f245911..4c724e9ad6 100755 --- a/arch/arm/include/asm/arch-socfpga_arria10/hardware.h +++ b/arch/arm/include/asm/arch-socfpga_arria10/hardware.h @@ -53,6 +53,8 @@ #define SOCFPGA_PINMUX_FPGA_INTERFACE_ADDRESS (0xffd07400) #define SOCFPGA_MPUSCU_ADDRESS (0xffffc000) #define SOCFPGA_MPUL2_ADDRESS (0xfffff000) +#define SOCFPGA_I2C0_ADDRESS (0xffc02200) +#define SOCFPGA_I2C1_ADDRESS (0xffc02300) #endif /***************** TEST_AT_ASIMOV *****************/ #define SOCFPGA_ECC_OCRAM_ADDRESS (0xff8c3000) diff --git a/board/altera/socfpga_arria10/pll_config.h b/board/altera/socfpga_arria10/pll_config.h index 6f57f43144..23fbf0a482 100755 --- a/board/altera/socfpga_arria10/pll_config.h +++ b/board/altera/socfpga_arria10/pll_config.h @@ -135,6 +135,7 @@ #define CONFIG_HPS_CLK_QSPI_HZ CONFIG_HPS_CLK_L4_MAIN_HZ #define CONFIG_HPS_CLK_SPIM_HZ CONFIG_HPS_CLK_L4_MAIN_HZ #define CONFIG_HPS_CLK_UART_HZ CONFIG_HPS_CLK_L4_SP_HZ +#define CONFIG_HPS_CLK_I2C_HZ CONFIG_HPS_CLK_L4_SP_HZ #endif /* _PRELOADER_PLL_CONFIG_H_ */ diff --git a/include/configs/socfpga_arria10.h b/include/configs/socfpga_arria10.h index e7cbbd3688..04ef7b5da6 100755 --- a/include/configs/socfpga_arria10.h +++ b/include/configs/socfpga_arria10.h @@ -576,4 +576,19 @@ #define CONFIG_SYS_GENERIC_BOARD + +/* + * I2C support + */ +#define CONFIG_HARD_I2C +#define CONFIG_DW_I2C +#define CONFIG_SYS_I2C_BASE SOCFPGA_I2C1_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) +/* clock supplied to I2C controller in unit of MHz */ +#define IC_CLK (CONFIG_HPS_CLK_I2C_HZ / 1000000) +#define CONFIG_CMD_I2C + #endif /* __CONFIG_H */ |