From patchwork Tue Apr 23 19:36:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Goldschmidt X-Patchwork-Id: 1089692 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cIXy32nJ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44pYcp1m2Tz9s7T for ; Wed, 24 Apr 2019 05:37:30 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id ECEDFC21C2C; Tue, 23 Apr 2019 19:37:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 067FEC21DFB; Tue, 23 Apr 2019 19:37:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E47F5C21DD9; Tue, 23 Apr 2019 19:37:06 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by lists.denx.de (Postfix) with ESMTPS id 9AD49C21C2F for ; Tue, 23 Apr 2019 19:37:04 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id y197so1575604wmd.0 for ; Tue, 23 Apr 2019 12:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Vitv0T3QaerPR14Ait57AEkiTPaiMYbbU7zEybGx7uI=; b=cIXy32nJBEIQUxwV9LZC39fuw/pdisDBaBTVIxFpN7eq0JIVZ/u8Qm1xQZwAzeNirR SZau2sLmWM4e1+tKLGE2iC+vsK8GHgqTkucaEChSp7rp1irm85C89XFcR9A1hRRJWm62 ej5jw9oqSpzNj/4E4qlpnh+yoYbQ05x8mT2vzn7uoLSgg22IWGafBmMnvqlNleYTnb9C NgJsjaCBXELRA55Q7tsogNcrE8MVCyRJu6VXBwFnPkdkqlyV+SIWh3ohixs5D7LPzHI6 zOZ0TlrCpsPB2LlgAvML3ap8lkeSbfjaz6IopOtsQnHMKfbyDTu2tz6JSuVvQyDsWUQP 9AcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Vitv0T3QaerPR14Ait57AEkiTPaiMYbbU7zEybGx7uI=; b=ej3NPXqqPErcInlsc1mP0CGEXURg81o9RsXG4khZ1eSBD8DGXq60Zq/jvgR//34L87 chR53fad1+Ne1XTeyaslcyLrCfVgJaxyXyH6+2XlqBq0ZfifdFK2lAgdiseNqAAhoxl5 NCQL2JWTJuPBQEfTZg70xhCpzBGnuH6rOmpI/6OhXvgRLu1FnHPFByHQLWEhspG5wb60 yNSHu5DBt3d+kJxqS61qls3IvgFgYudnpu53X8XtJG7naYo86u3TO1TVpAhQRAlZhO3T 54zwlLCSXM95+E0/Ze+v6PO1Ym9BHuEOlpF0i2igIXmH9UI8Sjae4kR2b3f0W9s8sC+Q 9dbA== X-Gm-Message-State: APjAAAU9Qn2ugKiuH5GWBh7dHtD+Kcg00U220+S4uIj01A9vTtacZ40p MfYWFp6JBIgyIBHm3SwBhcg= X-Google-Smtp-Source: APXvYqzbGLf6nJ8UA/rfU+Ybu5kREt8p2eMBQYjcl5dlEw+Xb3Rte4z/zUV6a5wSw1ZG6Eb+qbIIdg== X-Received: by 2002:a1c:9ad6:: with SMTP id c205mr3525155wme.46.1556048224272; Tue, 23 Apr 2019 12:37:04 -0700 (PDT) Received: from ubuntu.home ([2a02:8071:6a3:700:8d0c:38e:2fbd:ec3d]) by smtp.gmail.com with ESMTPSA id u10sm15706763wml.32.2019.04.23.12.37.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 12:37:03 -0700 (PDT) From: Simon Goldschmidt To: Marek Vasut , u-boot@lists.denx.de Date: Tue, 23 Apr 2019 21:36:54 +0200 Message-Id: <20190423193658.31556-2-simon.k.r.goldschmidt@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190423193658.31556-1-simon.k.r.goldschmidt@gmail.com> References: <20190423193658.31556-1-simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee , Tom Rini , Stefan Roese Subject: [U-Boot] [PATCH v4 1/4] arm: socfpga: move vining_fpga to DM_I2C X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" All socfpga boards except for vining_fpga use DM_I2C. Enable DM_I2C for this board and set the EEPROM defines via Kconfig (enabling CONFIG_I2C_EEPROM from MISC). Signed-off-by: Simon Goldschmidt --- Changes in v4: - fix DM_I2C case: don't call i2c_set_bus_num() since this is done in cmd/eeprom already Changes in v3: None Changes in v2: - added (this) patch to move socfpga_vining to DM_I2C board/samtec/vining_fpga/socfpga.c | 9 +-------- configs/socfpga_vining_fpga_defconfig | 8 +++++++- include/configs/socfpga_common.h | 26 -------------------------- include/configs/socfpga_vining_fpga.h | 9 --------- 4 files changed, 8 insertions(+), 44 deletions(-) diff --git a/board/samtec/vining_fpga/socfpga.c b/board/samtec/vining_fpga/socfpga.c index d99aac6828..efc8ddf162 100644 --- a/board/samtec/vining_fpga/socfpga.c +++ b/board/samtec/vining_fpga/socfpga.c @@ -52,14 +52,7 @@ int misc_init_r(void) u32 serial; int ret; - /* EEPROM is at bus 0. */ - ret = i2c_set_bus_num(0); - if (ret) { - puts("Cannot select EEPROM I2C bus.\n"); - return 0; - } - - /* EEPROM is at address 0x50. */ + /* EEPROM is at address 0x50 (at bus CONFIG_SYS_EEPROM_BUS_NUM). */ ret = eeprom_read(0x50, 0, data, sizeof(data)); if (ret) { puts("Cannot read I2C EEPROM.\n"); diff --git a/configs/socfpga_vining_fpga_defconfig b/configs/socfpga_vining_fpga_defconfig index 7b47b111b7..4a7f775337 100644 --- a/configs/socfpga_vining_fpga_defconfig +++ b/configs/socfpga_vining_fpga_defconfig @@ -16,8 +16,8 @@ CONFIG_VERSION_VARIABLE=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_SPL_SPI_LOAD=y CONFIG_CMD_ASKENV=y -CONFIG_CMD_GREPENV=y CONFIG_CMD_EEPROM=y +CONFIG_CMD_GREPENV=y CONFIG_CMD_DFU=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y @@ -44,6 +44,7 @@ CONFIG_DFU_RAM=y CONFIG_DFU_SF=y CONFIG_DM_GPIO=y CONFIG_DWAPB_GPIO=y +CONFIG_DM_I2C=y CONFIG_LED_STATUS=y CONFIG_LED_STATUS_GPIO=y CONFIG_LED_STATUS0=y @@ -55,6 +56,11 @@ CONFIG_LED_STATUS_BIT2=54 CONFIG_LED_STATUS3=y CONFIG_LED_STATUS_BIT3=65 CONFIG_LED_STATUS_CMD=y +CONFIG_MISC=y +CONFIG_I2C_EEPROM=y +CONFIG_SYS_I2C_EEPROM_ADDR=0x50 +CONFIG_SYS_EEPROM_PAGE_WRITE_BITS=3 +CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=70 CONFIG_DM_MMC=y CONFIG_MMC_DW=y CONFIG_MTD_DEVICE=y diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h index a501b5209f..a65fc804e3 100644 --- a/include/configs/socfpga_common.h +++ b/include/configs/socfpga_common.h @@ -149,32 +149,6 @@ #define CONFIG_SYS_NAND_DATA_BASE SOCFPGA_NANDDATA_ADDRESS #endif -/* - * I2C support - */ -#ifndef CONFIG_DM_I2C -#define CONFIG_SYS_I2C -#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 -#endif /* CONFIG_DM_I2C */ - /* * QSPI support */ diff --git a/include/configs/socfpga_vining_fpga.h b/include/configs/socfpga_vining_fpga.h index 5517ed722d..0e547a1295 100644 --- a/include/configs/socfpga_vining_fpga.h +++ b/include/configs/socfpga_vining_fpga.h @@ -16,15 +16,6 @@ #define CONFIG_LOADADDR 0x01000000 #define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR -/* I2C EEPROM */ -#ifdef CONFIG_CMD_EEPROM -#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 -#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 -#define CONFIG_SYS_I2C_EEPROM_BUS 0 -#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 -#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 70 -#endif - /* * Status LEDs: * 0 ... Top Green