x86: conga-qeval20-qa3: Add SMBus support and SMSC2513 config code
PATCH 1/1 x86: conga-qeval20-qa3: Add SMBus support and SMSC2513 config code
This patch includes the following changes:
- Remove Designware I2C support from dts as its not used
- Configure SMBus PADs in dts
- Enable I2C commands and I2C support
- Configure SMSC2513 USB hub via SMBus upon startup
- Move environment location to match Minnowmax example
- Enhancement of the default environment
--- arch/x86/dts/conga-qeval20-qa3-e3845.dts | 18 ++++++---- .../conga-qeval20-qa3-e3845/conga-qeval20-qa3.c | 40 ++++++++++++++++++++++ ...conga-qeval20-qa3-e3845-internal-uart_defconfig | 3 ++ configs/conga-qeval20-qa3-e3845_defconfig | 3 ++ include/configs/conga-qeval20-qa3-e3845.h | 12 ++++--- 5 files changed, 64 insertions(+), 12 deletions(-)
arch/x86/dts/conga-qeval20-qa3-e3845.dts +11 -7
@@ -46,6 +46,17 @@ pad-offset = <0x3a0>; mode-func = <1>; }; + + /* Add SMBus PAD configuration */ + smbus_clk at 0 { + pad-offset = <0x580>; + mode-func = <1>; + }; + + smbus_data at 0 { + pad-offset = <0x5a0>; + mode-func = <1>; + }; }; chosen {
@@ -244,13 +255,6 @@ fsp,lpss-sio-enable-pci-mode; fsp,enable-dma0; fsp,enable-dma1; - fsp,enable-i2c0; - fsp,enable-i2c1; - fsp,enable-i2c2; - fsp,enable-i2c3; - fsp,enable-i2c4; - fsp,enable-i2c5; - fsp,enable-i2c6; fsp,enable-pwm0; fsp,enable-pwm1; fsp,igd-dvmt50-pre-alloc = <2>;
board/congatec/conga-qeval20-qa3-e3845/conga-qeval20-qa3.c +40 -0
@@ -5,6 +5,7 @@*/ #include <common.h> +#include <i2c.h> #include <winbond_w83627.h> #include <asm/gpio.h> #include <asm/ibmpc.h>
@@ -31,3 +32,42 @@ int arch_early_init_r(void) {return 0 ; } + +int board_late_init (void ) +{ +struct udevice *dev; +u8 buf[8 ]; +int ret; + +/* Configure SMSC USB2513 USB Hub: 7bit address 0x2c */ + ret =i2c_get_chip_for_busnum (0 ,0x2c ,1 , &dev); +if (ret) { +printf ("Cannot find USB2513: %d\n" , ret); +return 0 ; + } + +/* +* The first access to the USB Hub fails sometimes, so lets read +* a dummy byte to be sure here +*/ +dm_i2c_read (dev,0x00 , buf,1 ); + +/* +* The SMSC hub is not visible on the I2C bus after the first +* configuration at power-up. The following code deliberately +* does not report upon failure of these I2C write calls. +*/ + buf[0 ] =0x93 ; +dm_i2c_write (dev,0x06 , buf,1 ); + + buf[0 ] =0xaa ; +dm_i2c_write (dev,0xf8 , buf,1 ); + + buf[0 ] =0x0f ; +dm_i2c_write (dev,0xfa , buf,1 ); + + buf[0 ] =0x01 ; +dm_i2c_write (dev,0xff , buf,1 ); + +return 0 ; +}
configs/conga-qeval20-qa3-e3845-internal-uart_defconfig +3 -0
@@ -1,4 +1,5 @@ CONFIG_X86=y +CONFIG_DM_I2C=y CONFIG_VENDOR_CONGATEC=y CONFIG_TARGET_CONGA_QEVAL20_QA3_E3845=y CONFIG_DEFAULT_DEVICE_TREE="conga-qeval20-qa3-e3845"
@@ -22,6 +23,7 @@ CONFIG_CMD_CPU=y CONFIG_CMD_MMC=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y +CONFIG_CMD_I2C=y CONFIG_CMD_USB=y CONFIG_CMD_GPIO=y # CONFIG_CMD_SETEXPR is not set
@@ -39,6 +41,7 @@ CONFIG_OF_CONTROL=y CONFIG_REGMAP=y CONFIG_SYSCON=y CONFIG_CPU=y +CONFIG_SYS_I2C_INTEL=y CONFIG_WINBOND_W83627=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_GIGADEVICE=y
configs/conga-qeval20-qa3-e3845_defconfig +3 -0
@@ -1,4 +1,5 @@ CONFIG_X86=y +CONFIG_DM_I2C=y CONFIG_VENDOR_CONGATEC=y CONFIG_TARGET_CONGA_QEVAL20_QA3_E3845=y CONFIG_DEFAULT_DEVICE_TREE="conga-qeval20-qa3-e3845"
@@ -21,6 +22,7 @@ CONFIG_CMD_CPU=y CONFIG_CMD_MMC=y CONFIG_CMD_SF=y CONFIG_CMD_SPI=y +CONFIG_CMD_I2C=y CONFIG_CMD_USB=y CONFIG_CMD_GPIO=y # CONFIG_CMD_SETEXPR is not set
@@ -38,6 +40,7 @@ CONFIG_OF_CONTROL=y CONFIG_REGMAP=y CONFIG_SYSCON=y CONFIG_CPU=y +CONFIG_SYS_I2C_INTEL=y CONFIG_WINBOND_W83627=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_GIGADEVICE=y
include/configs/conga-qeval20-qa3-e3845.h +7 -5
@@ -15,6 +15,7 @@#define CONFIG_SYS_MONITOR_LEN (1 << 20)#define CONFIG_BOARD_EARLY_INIT_F +#define CONFIG_BOARD_LATE_INIT #define CONFIG_ARCH_EARLY_INIT_R #define CONFIG_ARCH_MISC_INIT
@@ -41,23 +42,24 @@#define CONFIG_CMD_BMP #define CONFIG_ENV_SECT_SIZE 0x1000 -#define CONFIG_ENV_OFFSET 0x007fe000 +#define CONFIG_ENV_OFFSET 0x006ef000#undef CONFIG_BOOTARGS#undef CONFIG_BOOTCOMMAND#define CONFIG_BOOTARGS \ - "root=/dev/sda1 ro quiet" + "root=/dev/sda2 ro quiet"#define CONFIG_BOOTCOMMAND \ - "load scsi 0:1 03000000 /boot/vmlinuz-4.2.0-26-generic;" \ - "load scsi 0:1 04000000 /boot/initrd.img-4.2.0-26-generic;" \ + "load scsi 0:2 03000000 /boot/vmlinuz-${kernel-ver}-generic;" \ + "load scsi 0:2 04000000 /boot/initrd.img-${kernel-ver}-generic;" \ "run boot"#undef CONFIG_EXTRA_ENV_SETTINGS#define CONFIG_EXTRA_ENV_SETTINGS \ + "kernel-ver=4.4.0-22\0" \ "boot=zboot 03000000 0 04000000 ${filesize}\0" \ "upd_uboot=tftp 100000 conga/u-boot.rom;" \ - "sf probe;sf update 100000 0 7fe000\0" + "sf probe;sf update 100000 0 800000;saveenv\0"#define CONFIG_PREBOOT
Signature · 1 line
2.9.0
PATCH 1/1 x86: conga-qeval20-qa3: Add SMBus support and SMSC2513 config code
Quoted 12 lines · Stefan Roese
This patch includes the following changes:
- Remove Designware I2C support from dts as its not used
- Configure SMBus PADs in dts
- Enable I2C commands and I2C support
- Configure SMSC2513 USB hub via SMBus upon startup
- Move environment location to match Minnowmax example
- Enhancement of the default environmentSigned-off-by Stefan Roese <[email protected]>Cc Bin Meng <[email protected]>Cc Simon Glass <[email protected]>
Quoted 8 lines
--- arch/x86/dts/conga-qeval20-qa3-e3845.dts | 18 ++++++---- .../conga-qeval20-qa3-e3845/conga-qeval20-qa3.c | 40 ++++++++++++++++++++++ ...conga-qeval20-qa3-e3845-internal-uart_defconfig | 3 ++ configs/conga-qeval20-qa3-e3845_defconfig | 3 ++ include/configs/conga-qeval20-qa3-e3845.h | 12 ++++--- 5 files changed, 64 insertions(+), 12 deletions(-)
PATCH 1/1 x86: conga-qeval20-qa3: Add SMBus support and SMSC2513 config code
Quoted 22 lines · Bin Meng
Quoted 12 lines · Stefan Roese
This patch includes the following changes:
- Remove Designware I2C support from dts as its not used
- Configure SMBus PADs in dts
- Enable I2C commands and I2C support
- Configure SMSC2513 USB hub via SMBus upon startup
- Move environment location to match Minnowmax example
- Enhancement of the default environmentSigned-off-by Stefan Roese <[email protected]>Cc Bin Meng <[email protected]>Cc Simon Glass <[email protected]>Quoted 8 lines
--- arch/x86/dts/conga-qeval20-qa3-e3845.dts | 18 ++++++---- .../conga-qeval20-qa3-e3845/conga-qeval20-qa3.c | 40 ++++++++++++++++++++++ ...conga-qeval20-qa3-e3845-internal-uart_defconfig | 3 ++ configs/conga-qeval20-qa3-e3845_defconfig | 3 ++ include/configs/conga-qeval20-qa3-e3845.h | 12 ++++--- 5 files changed, 64 insertions(+), 12 deletions(-)
Quoted 1 line
Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!