From patchwork Thu Jul 19 11:40:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 10146 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id BC80523E3D for ; Thu, 19 Jul 2012 11:34:56 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 8DB1DA18007 for ; Thu, 19 Jul 2012 11:34:56 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so2825053yen.11 for ; Thu, 19 Jul 2012 04:34:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:x-gm-message-state; bh=ifTmMVRaukX5zw6N2bGzSm/RrcKpMTH29y7SudfTEPM=; b=o9JEEdIHdfZgm/aOZYSP9pIZo7oFqxsz+RdPo7oCWnWczDuK0KZzvI75H0+1htgLDB VWN2akTXwUO/WiwhA8uhNN8MlcznSJY1rjKFHF8tBRP1lQfsxttDj6On0udy1m26jmkd EkbyrHfoR+FViztcasjF09PcN38hsV2AT0CllyJu9bADNb7D6bGkUAXBr9KgAjeitYn5 pkylJHZp63xjBJ5VSCuj19OrtHkhvtmbA1DT5ZXu2RSRJ6HNzZxzDdDOlXvbKPwYLUQX bTA1f0Sluvk3IrH4Q22yZGxdAEv5j64G35rxzHlkcysmLguZiKf8dAbGeNSIaQvHoQKH 7BXw== Received: by 10.50.57.167 with SMTP id j7mr4826228igq.53.1342697696179; Thu, 19 Jul 2012 04:34:56 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.153.7 with SMTP id i7csp9654ibw; Thu, 19 Jul 2012 04:34:55 -0700 (PDT) Received: by 10.66.73.69 with SMTP id j5mr3256120pav.8.1342697695464; Thu, 19 Jul 2012 04:34:55 -0700 (PDT) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id ot3si3937204pbc.41.2012.07.19.04.34.55; Thu, 19 Jul 2012 04:34:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.25 as permitted sender) client-ip=203.254.224.25; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.25 as permitted sender) smtp.mail=rajeshwari.s@samsung.com Received: from epcpsbgm2.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7E00J85O5XZU60@mailout2.samsung.com>; Thu, 19 Jul 2012 20:34:54 +0900 (KST) X-AuditID: cbfee61b-b7f566d000005c8a-8e-5007f0de43dc Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 39.B6.23690.ED0F7005; Thu, 19 Jul 2012 20:34:54 +0900 (KST) Received: from rajeshwari-linux.sisodomain.com ([107.108.215.115]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M7E00GKSO532160@mmp2.samsung.com>; Thu, 19 Jul 2012 20:34:54 +0900 (KST) From: Rajeshwari Shinde To: u-boot@lists.denx.de Cc: patches@linaro.org, alim.akhtar@samsung.com, sjg@chromium.org, hs@denx.de, mk7.kang@samsung.com, chander.kashyap@linaro.org, jy0922.shim@samsung.com, jh80.chung@samsung.com Subject: [PATCH 8/8 V6] CONFIG: SMDK5250: I2C: Enable I2C Date: Thu, 19 Jul 2012 17:10:01 +0530 Message-id: <1342698001-27683-9-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1342698001-27683-1-git-send-email-rajeshwari.s@samsung.com> References: <1342698001-27683-1-git-send-email-rajeshwari.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrOJMWRmVeSWpSXmKPExsVy+t9jQd17H9gDDFZt47F4uP4mi8WUw19Y HJg87lzbwxbAGMVlk5Kak1mWWqRvl8CV0fhzB3PBWqGKRdN6mRoY3/J1MXJwSAiYSLxZrtzF yAlkiklcuLeeDcQWEpjOKHFgi3QXIxeQPZFJ4tLrKSwgCTYBI4mtJ6cxgtgiAhISv/qvMoIU MQtsYZQ4/uoiWLewgKXE6oldYA0sAqoSe848B4vzCnhIvLi8jxFim4LEsalfWUFsTgFPid69 99ghNntIHGlezTiBkXcBI8MqRtHUguSC4qT0XCO94sTc4tK8dL3k/NxNjGDvP5PewbiqweIQ owAHoxIPb4c+e4AQa2JZcWXuIUYJDmYlEd5t94FCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeU28 v/oLCaQnlqRmp6YWpBbBZJk4OKUaGOev+r+N8WTZpaDjrVp9250nv1916nzBW6lsRg4X9raT HybpyOjWSDClZzTaTDAs7F6c9uDq8RXT+4X7xFWPz2ZcKRLG9tk+4JXq9MQdAtPWVrA5Z756 arsnUdQ7WfXjvgOPdzHxOP3TvuainfQ92tKiYU2TFJObm/7rDayVvm+yOD7L/F9ipsRSnJFo qMVcVJwIAA3gpmz6AQAA X-TM-AS-MML: No X-Gm-Message-State: ALoCoQmw1hi24ZA8UG6IAwvA880ywlwrZKoLAsof7ieJ02hHMP47omT13ypq0babvTeXIcfOzVNc This enables I2C support on smdk5250. Pinmux setting moved to board file to avoid repeated setting of gpio lines. Signed-off-by: Alim Akhtar Signed-off-by: Doug Anderson Signed-off-by: Rajeshwari Shinde Acked-by: Simon Glass Acked-by: Simon Glass --- Changes in V2: - None Changes in V3: - None Changes in V4: - None Changes in V5: - Pinmux setting of gpio lines moved to board_early_init_f. Chnages in V6: - EXYNOS_I2C_SPACING moved to cpu.h - board_i2c_init compiled only when CONFIG_DRIVER_S3C24X0_I2C is defined. board/samsung/smdk5250/smdk5250.c | 28 +++++++++++++++++++++++++++- include/configs/smdk5250.h | 8 ++++++++ 2 files changed, 35 insertions(+), 1 deletions(-) diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c index b593325..12e6e66 100644 --- a/board/samsung/smdk5250/smdk5250.c +++ b/board/samsung/smdk5250/smdk5250.c @@ -172,9 +172,35 @@ static int board_uart_init(void) return 0; } +#ifdef CONFIG_DRIVER_S3C24X0_I2C +static int board_i2c_init(void) +{ + int i, err; + + for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) { + err = exynos_pinmux_config((PERIPH_ID_I2C0 + i), + PINMUX_FLAG_NONE); + if (err) { + debug("I2C%d not configured\n", (PERIPH_ID_I2C0 + i)); + return err; + } + } + return 0; +} +#endif + #ifdef CONFIG_BOARD_EARLY_INIT_F int board_early_init_f(void) { - return board_uart_init(); + int err; + err = board_uart_init(); + if (err) { + debug("UART init failed\n"); + return err; + } +#ifdef CONFIG_DRIVER_S3C24X0_I2C + err = board_i2c_init(); +#endif + return err; } #endif diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h index c0eaaf8..65dfe9f 100644 --- a/include/configs/smdk5250.h +++ b/include/configs/smdk5250.h @@ -198,6 +198,14 @@ #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000) +/* I2C */ +#define CONFIG_HARD_I2C +#define CONFIG_CMD_I2C +#define CONFIG_SYS_I2C_SPEED 100000 /* 100 Kbps */ +#define CONFIG_DRIVER_S3C24X0_I2C +#define CONFIG_I2C_MULTI_BUS +#define CONFIG_MAX_I2C_NUM 8 + /* Ethernet Controllor Driver */ #ifdef CONFIG_CMD_NET #define CONFIG_SMC911X