From patchwork Tue Jul 2 13:12:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 18244 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E1E292391D for ; Tue, 2 Jul 2013 13:11:23 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id b12sf8788933yha.4 for ; Tue, 02 Jul 2013 06:11:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:x-auditid:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-brightmail-tracker:x-brightmail-tracker :dlp-filter:x-mtr:x-cfilter-loop:x-gm-message-state :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe; bh=iwHb2mSn6xy0QX9UoB74Uj+nj9cKdwZ5MtOWvdSOFXQ=; b=Ox91hO4bDJpZuXRA+dKaGYNGR5huksqz5P/MQ53R8bfEESLsbODEmJPWycIX64OrSG F4N6hWEGj+5tsLtitGOr7xRdbMLZ4zh6NRoTap9iDwAMqWnIdiDiQdohkUNeBrQdjRth 2UVGbnZOyYCyYwvkEdZNmhAGEwrLnO8Ij5MxN5uYXK2GwbjVSDDOXK6lTqbAhqcX94GS RJQ6IN7PPTGjb/VhvPzOVjOslWqfeZLRK7ZZxU8m2EHSHXGLmkzjLLLfJIt648C/677T Higzhob7B/MK5BOHd6eX4x04evvuUYFIvf87vw7a3pgmJd0nOcSlGFIIwr3QH27VB4+x 7Zdg== X-Received: by 10.236.148.101 with SMTP id u65mr17750797yhj.47.1372770683680; Tue, 02 Jul 2013 06:11:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.137 with SMTP id l9ls2691278qev.0.gmail; Tue, 02 Jul 2013 06:11:23 -0700 (PDT) X-Received: by 10.58.118.70 with SMTP id kk6mr11362549veb.1.1372770683549; Tue, 02 Jul 2013 06:11:23 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id b1si5961685vcz.58.2013.07.02.06.11.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Jul 2013 06:11:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id id13so2760137vcb.13 for ; Tue, 02 Jul 2013 06:11:23 -0700 (PDT) X-Received: by 10.220.17.206 with SMTP id t14mr7837193vca.15.1372770683452; Tue, 02 Jul 2013 06:11:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp10278veb; Tue, 2 Jul 2013 06:11:22 -0700 (PDT) X-Received: by 10.66.254.135 with SMTP id ai7mr29252345pad.185.1372770682309; Tue, 02 Jul 2013 06:11:22 -0700 (PDT) Received: from mailout4.samsung.com (mailout4.samsung.com. [203.254.224.34]) by mx.google.com with ESMTP id p6si4337552paa.47.2013.07.02.06.11.21 for ; Tue, 02 Jul 2013 06:11:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of rajeshwari.s@samsung.com designates 203.254.224.34 as permitted sender) client-ip=203.254.224.34; Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MPB00DY18MTH860@mailout4.samsung.com> for patches@linaro.org; Tue, 02 Jul 2013 22:11:20 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.122]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 66.AF.08825.871D2D15; Tue, 02 Jul 2013 22:11:20 +0900 (KST) X-AuditID: cbfee68e-b7f276d000002279-41-51d2d1781dd8 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A6.FA.21068.871D2D15; Tue, 02 Jul 2013 22:11:20 +0900 (KST) Received: from rajeshwari-linux.sisodomain.com ([107.108.215.115]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MPB00KIE8MK2K80@mmp1.samsung.com>; Tue, 02 Jul 2013 22:11:20 +0900 (KST) From: Rajeshwari Shinde To: u-boot@lists.denx.de Cc: patches@linaro.org, sjg@chromium.org, mk7.kang@samsung.com, u-boot-review@google.com, prashanth.g@samsung.com, sreekumar.c@samsung.com Subject: [PATCH 3/4 V3] EXYNOS4210: Configure GPIO for uart Date: Tue, 02 Jul 2013 18:42:40 +0530 Message-id: <1372770761-5561-4-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1372770761-5561-1-git-send-email-rajeshwari.s@samsung.com> References: <1372770761-5561-1-git-send-email-rajeshwari.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGLMWRmVeSWpSXmKPExsWyRsSkSrfi4qVAg97NhhYdR1oYLaYc/sJi serwBnaLb1u2MVocfLiA2WL5643sFm/3drI7sHvMbrjI4rFgU6nHnWt72DzO3tnB6NG3ZRVj AGsUl01Kak5mWWqRvl0CV8apL5+YC5ZrV+w4OoulgfGQchcjB4eEgInElD9GXYycQKaYxIV7 69m6GLk4hASWMkpsvfWcESJhIrH02k6oxCJGiSebb7FCOBOZJJaumgJWxSZgJLH15DQwW0RA QuJX/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FMSK6tSi/Lj i0pzUosPMSYDHTWRWUo0OR8Y43kl8YbGJuamxqaWJhYmZpakCSuJ8x5stQ4UEkhPLEnNTk0t SC2C2cLEwSnVwLhW6MziJQ9in5VkL16nkePsriGhmJydd/5D4HaBOqcHnyptrL2/sl1/bXGV 4f1EfYF5Tr0ur+dxr5W7qSN5zEgk5YnS6QNeLUYy/ya8uSVvsvhd65P2UwLGEhY312+0+fJ5 +tIdJ9Ve+3Y+Xtu0W9r+OcOr6poDgeXRqsX3QiX2rjbPLzrdW6DEUpyRaKjFXFScCACT0ABd 5wIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQmWJKqd627kuJTw531G4LCEM/vOHliHExgb2+kDX+aU/HMBT9Fa452hynXlG/elS9n40P8o X-Original-Sender: rajeshwari.s@samsung.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch configures the gpio values for UART on Origen and SMDKV310 using pinmux Signed-off-by: Rajeshwari Shinde Acked-by: Simon Glass --- Changes in V2: - None Changes in V3: - None arch/arm/cpu/armv7/exynos/pinmux.c | 40 +++++++++++++++++++++++++++++++ board/samsung/origen/origen.c | 46 ++++++++++++++++++++++++++++++++++++ board/samsung/smdkv310/smdkv310.c | 46 ++++++++++++++++++++++++++++++++++++ include/configs/origen.h | 1 + include/configs/smdkv310.h | 1 + 5 files changed, 134 insertions(+), 0 deletions(-) diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c b/arch/arm/cpu/armv7/exynos/pinmux.c index bd499b4..2042062 100644 --- a/arch/arm/cpu/armv7/exynos/pinmux.c +++ b/arch/arm/cpu/armv7/exynos/pinmux.c @@ -408,9 +408,49 @@ static int exynos4_mmc_config(int peripheral, int flags) return 0; } +static void exynos4_uart_config(int peripheral) +{ + struct exynos4_gpio_part1 *gpio1 = + (struct exynos4_gpio_part1 *)samsung_get_base_gpio_part1(); + struct s5p_gpio_bank *bank; + int i, start, count; + + switch (peripheral) { + case PERIPH_ID_UART0: + bank = &gpio1->a0; + start = 0; + count = 4; + break; + case PERIPH_ID_UART1: + bank = &gpio1->a0; + start = 4; + count = 4; + break; + case PERIPH_ID_UART2: + bank = &gpio1->a1; + start = 0; + count = 4; + break; + case PERIPH_ID_UART3: + bank = &gpio1->a1; + start = 4; + count = 2; + break; + } + for (i = start; i < start + count; i++) { + s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE); + s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2)); + } +} static int exynos4_pinmux_config(int peripheral, int flags) { switch (peripheral) { + case PERIPH_ID_UART0: + case PERIPH_ID_UART1: + case PERIPH_ID_UART2: + case PERIPH_ID_UART3: + exynos4_uart_config(peripheral); + break; case PERIPH_ID_I2C0: case PERIPH_ID_I2C1: case PERIPH_ID_I2C2: diff --git a/board/samsung/origen/origen.c b/board/samsung/origen/origen.c index 638e7b1..b7dbb91 100644 --- a/board/samsung/origen/origen.c +++ b/board/samsung/origen/origen.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include DECLARE_GLOBAL_DATA_PTR; struct exynos4_gpio_part1 *gpio1; @@ -39,6 +41,50 @@ int board_init(void) return 0; } +static int board_uart_init(void) +{ + int err; + + err = exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE); + if (err) { + debug("UART0 not configured\n"); + return err; + } + + err = exynos_pinmux_config(PERIPH_ID_UART1, PINMUX_FLAG_NONE); + if (err) { + debug("UART1 not configured\n"); + return err; + } + + err = exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE); + if (err) { + debug("UART2 not configured\n"); + return err; + } + + err = exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE); + if (err) { + debug("UART3 not configured\n"); + return err; + } + + return 0; +} + +#ifdef CONFIG_BOARD_EARLY_INIT_F +int board_early_init_f(void) +{ + int err; + err = board_uart_init(); + if (err) { + debug("UART init failed\n"); + return err; + } + return err; +} +#endif + int dram_init(void) { gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE) diff --git a/board/samsung/smdkv310/smdkv310.c b/board/samsung/smdkv310/smdkv310.c index 81ac8f6..015b920 100644 --- a/board/samsung/smdkv310/smdkv310.c +++ b/board/samsung/smdkv310/smdkv310.c @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -137,3 +139,47 @@ int board_mmc_init(bd_t *bis) return err; } #endif + +static int board_uart_init(void) +{ + int err; + + err = exynos_pinmux_config(PERIPH_ID_UART0, PINMUX_FLAG_NONE); + if (err) { + debug("UART0 not configured\n"); + return err; + } + + err = exynos_pinmux_config(PERIPH_ID_UART1, PINMUX_FLAG_NONE); + if (err) { + debug("UART1 not configured\n"); + return err; + } + + err = exynos_pinmux_config(PERIPH_ID_UART2, PINMUX_FLAG_NONE); + if (err) { + debug("UART2 not configured\n"); + return err; + } + + err = exynos_pinmux_config(PERIPH_ID_UART3, PINMUX_FLAG_NONE); + if (err) { + debug("UART3 not configured\n"); + return err; + } + + return 0; +} + +#ifdef CONFIG_BOARD_EARLY_INIT_F +int board_early_init_f(void) +{ + int err; + err = board_uart_init(); + if (err) { + debug("UART init failed\n"); + return err; + } + return err; +} +#endif diff --git a/include/configs/origen.h b/include/configs/origen.h index e179911..f71a463 100644 --- a/include/configs/origen.h +++ b/include/configs/origen.h @@ -36,6 +36,7 @@ #define CONFIG_ARCH_CPU_INIT #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO +#define CONFIG_BOARD_EARLY_INIT_F /* Keep L2 Cache Disabled */ #define CONFIG_L2_OFF 1 diff --git a/include/configs/smdkv310.h b/include/configs/smdkv310.h index 5e43066..db78127 100644 --- a/include/configs/smdkv310.h +++ b/include/configs/smdkv310.h @@ -36,6 +36,7 @@ #define CONFIG_ARCH_CPU_INIT #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO +#define CONFIG_BOARD_EARLY_INIT_F /* Mach Type */ #define CONFIG_MACH_TYPE MACH_TYPE_SMDKV310