Advertisement
Guest User

Untitled

a guest
May 15th, 2014
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. --- a/arch/arm/include/asm/arch-sunxi/gpio.h
  2. +++ b/arch/arm/include/asm/arch-sunxi/gpio.h
  3. @@ -123,6 +123,8 @@ enum sunxi_gpio_number {
  4. #define SUN7I_GPA0_GMAC 5
  5.  
  6. #define SUNXI_GPB0_TWI0 2
  7. +#define SUNXI_GPB0_TWI1 2
  8. +#define SUNXI_GPB0_TWI2 2
  9.  
  10. #define SUN4I_GPB22_UART0_TX 2
  11. #define SUN4I_GPB23_UART0_RX 2
  12. --- a/arch/arm/include/asm/arch-sunxi/i2c.h
  13. +++ b/arch/arm/include/asm/arch-sunxi/i2c.h
  14. @@ -8,7 +8,7 @@
  15.  
  16. #include <asm/arch/cpu.h>
  17.  
  18. -#define CONFIG_I2C_MVTWSI_BASE SUNXI_TWI0_BASE
  19. +#define CONFIG_I2C_MVTWSI_BASE SUNXI_TWI1_BASE
  20. /* This is abp0-clk on sun4i/5i/7i / abp1-clk on sun6i/sun8i which is 24MHz */
  21. #define CONFIG_SYS_TCLK 24000000
  22.  
  23. --- a/board/sunxi/board.c
  24. +++ b/board/sunxi/board.c
  25. @@ -129,8 +129,8 @@ int board_mmc_init(bd_t *bis)
  26.  
  27. void i2c_init_board(void)
  28. {
  29. - sunxi_gpio_set_cfgpin(SUNXI_GPB(0), SUNXI_GPB0_TWI0);
  30. - sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUNXI_GPB0_TWI0);
  31. + sunxi_gpio_set_cfgpin(SUNXI_GPB(18), SUNXI_GPB0_TWI1);
  32. + sunxi_gpio_set_cfgpin(SUNXI_GPB(19), SUNXI_GPB0_TWI1);
  33. clock_twi_onoff(0, 1);
  34. }
  35.  
  36. --- a/include/configs/sunxi-common.h
  37. +++ b/include/configs/sunxi-common.h
  38. @@ -320,8 +320,8 @@
  39. /* No CONFIG_SYS_I2C as we use the non converted mvtwsi driver */
  40. #define CONFIG_HARD_I2C
  41. #define CONFIG_SYS_I2C_SUNXI
  42. -#define CONFIG_SYS_I2C_SPEED 400000
  43. -#define CONFIG_SYS_I2C_SLAVE 0x7f
  44. +#define CONFIG_SYS_I2C_SPEED 100000
  45. +#define CONFIG_SYS_I2C_SLAVE 0x50
  46. #define CONFIG_CMD_I2C
  47.  
  48. /* Watchdog */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement