From patchwork Mon Jul 1 10:02:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajeshwari Shinde X-Patchwork-Id: 18192 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 788BB25E04 for ; Mon, 1 Jul 2013 10:01:18 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bv4sf4785393qab.10 for ; Mon, 01 Jul 2013 03:01:18 -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=AFXp+qBm6r/oaztkN1TmYtoFN06mEuOWbYn7si44V5g=; b=Upvkj63Mo0Uh2hrVHPTN78xP/psO5z51xQAkyJAMwaiR9t0/SLj7LQDQG2Ki8ls3s2 XEGIQ1Uy30vRkWfMNx8w06aNIXunmB18dDwu71sCJ2qJ6SlB6BqW2KeTr5dkR2BQmxDy FIDz+9bNaG3qCJ8olos+lSRvIssZM4MJ3PNt/zNFV11o2+L7g8vsfnJagj3sXEYAgtp+ 0179WUD8cFHaIymofiC9Wh4n7QwArfr7gSpVbExNF3Yxa9R7CWrmfULATldAddQHx8T0 zF5N+QsOXCHZ+wyQPlo4wxjiSmRnwi8toMteRjzw22WJ+gIasJaQmNSQ7ojZRlILNZFh hxXg== X-Received: by 10.236.230.72 with SMTP id i68mr14137840yhq.23.1372672878206; Mon, 01 Jul 2013 03:01:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.72.233 with SMTP id g9ls2094782qev.84.gmail; Mon, 01 Jul 2013 03:01:18 -0700 (PDT) X-Received: by 10.220.77.74 with SMTP id f10mr9101256vck.1.1372672846106; Mon, 01 Jul 2013 03:00:46 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id ra6si4633855vec.46.2013.07.01.03.00.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Jul 2013 03:00:46 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id jw11so3531572veb.4 for ; Mon, 01 Jul 2013 03:00:46 -0700 (PDT) X-Received: by 10.58.251.144 with SMTP id zk16mr9122819vec.37.1372672846014; Mon, 01 Jul 2013 03:00:46 -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 yu8csp274259veb; Mon, 1 Jul 2013 03:00:45 -0700 (PDT) X-Received: by 10.68.202.41 with SMTP id kf9mr23209886pbc.80.1372672844957; Mon, 01 Jul 2013 03:00:44 -0700 (PDT) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id tw4si10708046pbc.241.2013.07.01.03.00.44 for ; Mon, 01 Jul 2013 03:00:44 -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; Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MP900CC354P58A0@mailout2.samsung.com> for patches@linaro.org; Mon, 01 Jul 2013 19:00:44 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id B6.0F.29708.C4351D15; Mon, 01 Jul 2013 19:00:44 +0900 (KST) X-AuditID: cbfee690-b7f6f6d00000740c-ff-51d1534c728d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 46.01.28381.B4351D15; Mon, 01 Jul 2013 19:00:44 +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 <0MP9006XU54ZGCO0@mmp1.samsung.com>; Mon, 01 Jul 2013 19:00:43 +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 V2] EXYNOS4210: Configure GPIO for uart Date: Mon, 01 Jul 2013 15:32:05 +0530 Message-id: <1372672926-32614-4-git-send-email-rajeshwari.s@samsung.com> X-Mailer: git-send-email 1.7.4.4 In-reply-to: <1372672926-32614-1-git-send-email-rajeshwari.s@samsung.com> References: <1372672926-32614-1-git-send-email-rajeshwari.s@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsWyRsSkWtcn+GKgwYd9nBYdR1oYLaYc/sJi serwBnaLb1u2MVocfLiA2WL5643sFm/3drI7sHvMbrjI4rFgU6nHnWt72DzO3tnB6NG3ZRVj AGsUl01Kak5mWWqRvl0CV8azdX9ZCvq0Kw6u/8DcwLhRuYuRk0NCwETiy/JGJghbTOLCvfVs XYxcHEICSxklzkzdxdzFyAFWdPGHHER8EaPEvA272SGciUwSKx80sIF0swkYSWw9OY0RxBYR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vSmJlVWpR fnxRaU5q8SHGZKCrJjJLiSbnAyM8ryTe0NjE3NTY1NLEwsTMkjRhJXHeA63WgUIC6Yklqdmp qQWpRTBbmDg4pRoYLaLn3Pgf2B4mIVPS27Po19XmvYLT0iXVVMJ33Gl85aMqzhl5QXDimfZl bF/V7aIPz+4xzpTR7Lb/r532mj361WuzzmVML5SvnH2eWCvM9++3y7Vg9ltx8qb1lzhjpGMv N9e9FDOMkjkhqjy7+Yhi5vsOnyllfu9tHnXJLd0i6vZf2dBKPE2JpTgj0VCLuag4EQDBaxUE 5gIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQmqdlaxO0oFv+orEmn+zXZaGWLQfo+EvfN3z9JuJ2MOkdHaa5jrqIE/YNLwaUHRv8rm6L67 X-Original-Sender: rajeshwari.s@samsung.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.173 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 --- Chnages in V2: - 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