From patchwork Fri Oct 31 08:41:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyungwon Hwang X-Patchwork-Id: 405242 X-Patchwork-Delegate: promsoft@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id DD5BB14007F for ; Fri, 31 Oct 2014 19:48:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 44DF44BC7E; Fri, 31 Oct 2014 09:48:07 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FbGvax2X4LU0; Fri, 31 Oct 2014 09:48:07 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 715B24BC63; Fri, 31 Oct 2014 09:47:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F2E854BC34 for ; Fri, 31 Oct 2014 09:41:19 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LeyjNchiXuEu for ; Fri, 31 Oct 2014 09:41:19 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by theia.denx.de (Postfix) with ESMTPS id 8DBB64BC33 for ; Fri, 31 Oct 2014 09:41:17 +0100 (CET) Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEA00J8UW4L0Q30@mailout4.samsung.com> for u-boot@lists.denx.de; Fri, 31 Oct 2014 17:41:09 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.112]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 79.AC.19034.52B43545; Fri, 31 Oct 2014 17:41:09 +0900 (KST) X-AuditID: cbfee691-f79b86d000004a5a-b3-54534b2561ac Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 92.FC.20081.52B43545; Fri, 31 Oct 2014 17:41:09 +0900 (KST) Received: from localhost.localdomain ([10.88.98.185]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NEA00M1VW4HNTD0@mmp2.samsung.com>; Fri, 31 Oct 2014 17:41:09 +0900 (KST) From: Hyungwon Hwang To: mk7.kang@samsung.com, l.majewski@samsung.com, u-boot@lists.denx.de Date: Fri, 31 Oct 2014 17:41:01 +0900 Message-id: <1414744862-30332-2-git-send-email-human.hwang@samsung.com> X-Mailer: git-send-email 1.8.3.2 In-reply-to: <1414744862-30332-1-git-send-email-human.hwang@samsung.com> References: <1414744862-30332-1-git-send-email-human.hwang@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDLMWRmVeSWpSXmKPExsWyRsSkQFfVOzjE4P5xKYulM/pYLd483Mxo 0XGkhdHi7d5OdgcWj7N3djB69G1ZxRjAFMVlk5Kak1mWWqRvl8CVMeVlI2PBetmK2fvvMTUw Nkl2MXJwSAiYSCzYZdrFyAlkiklcuLeerYuRi0NIYCmjxMzDs9khEiYSP5acZwWxhQSmM0rM 3sgNUdTKJLFm9mlGkASbgJ7Egms/wBpEBNwkpm+bARZnFtCRuH5zCzOILSxgLfHw1h02kMUs AqoSW/bIgoR5BdwlVk1rY4LYpSCx7MtasHJOAQ+J9r/dbBB73SX2P9rADrJXQuA9m8TLj0/A EiwCA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3 BlgXhs6J0vimHuog9O7J8VUeNXM7dhS+iXj73uZKgXLWF5azLefeiu8ViHjz8MalLvn06HhH tU/s77f8uK1gF7j08ZJzbG1Tf57YmD951u4dT7fLXe0wP5l5XvPelllzw9R6IoznvC7K0mz8 nK3EUpyRaKjFXFScCADzjIJymgIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Fri, 31 Oct 2014 09:47:44 +0100 Cc: Hyungwon Hwang Subject: [U-Boot] [PATCH 2/3] Exynos5800: Add support for Exynos5800 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The gpios of Exynos5800 are different from that of Exynos5420. This patch adds the gpio information and table of Exynos5800. Change-Id: Ic609973ab531e2b6ee9a68cfec0b6b9571f203a8 Signed-off-by: Hyungwon Hwang --- arch/arm/include/asm/arch-exynos/gpio.h | 31 +++++++++++++++++++++++++++++-- drivers/gpio/s5p_gpio.c | 4 +++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/arch/arm/include/asm/arch-exynos/gpio.h b/arch/arm/include/asm/arch-exynos/gpio.h index 431ae3a..8f82ef0 100644 --- a/arch/arm/include/asm/arch-exynos/gpio.h +++ b/arch/arm/include/asm/arch-exynos/gpio.h @@ -1368,11 +1368,21 @@ static struct gpio_info exynos5420_gpio_data[EXYNOS5420_GPIO_NUM_PARTS] = { { EXYNOS5420_GPIO_PART5_BASE, EXYNOS5420_GPIO_MAX_PORT }, }; +#define EXYNOS5800_GPIO_NUM_PARTS 4 +static struct gpio_info exynos5800_gpio_data[EXYNOS5800_GPIO_NUM_PARTS] = { + { EXYNOS5420_GPIO_PART1_BASE, EXYNOS5420_GPIO_MAX_PORT_PART_1 }, + { EXYNOS5420_GPIO_PART2_BASE, EXYNOS5420_GPIO_MAX_PORT_PART_2 }, + { EXYNOS5420_GPIO_PART3_BASE, EXYNOS5420_GPIO_MAX_PORT_PART_3 }, + { EXYNOS5420_GPIO_PART4_BASE, EXYNOS5420_GPIO_MAX_PORT_PART_4 }, +}; + static inline struct gpio_info *get_gpio_data(void) { if (cpu_is_exynos5()) { - if (proid_is_exynos5420() || proid_is_exynos5800()) + if (proid_is_exynos5420()) return exynos5420_gpio_data; + else if (proid_is_exynos5800()) + return exynos5800_gpio_data; else return exynos5_gpio_data; } else if (cpu_is_exynos4()) { @@ -1388,8 +1398,10 @@ static inline struct gpio_info *get_gpio_data(void) static inline unsigned int get_bank_num(void) { if (cpu_is_exynos5()) { - if (proid_is_exynos5420() || proid_is_exynos5800()) + if (proid_is_exynos5420()) return EXYNOS5420_GPIO_NUM_PARTS; + if (proid_is_exynos5800()) + return EXYNOS5800_GPIO_NUM_PARTS; else return EXYNOS5_GPIO_NUM_PARTS; } else if (cpu_is_exynos4()) { @@ -1493,6 +1505,21 @@ static const struct gpio_name_num_table exynos5420_gpio_table[] = { { 0 } }; +static const struct gpio_name_num_table exynos5800_gpio_table[] = { + GPIO_ENTRY('x', EXYNOS5420_GPIO_X00, EXYNOS5420_GPIO_C00, 0), + GPIO_ENTRY('c', EXYNOS5420_GPIO_C00, EXYNOS5420_GPIO_D10, 0), + GPIO_ENTRY('d', EXYNOS5420_GPIO_D10, EXYNOS5420_GPIO_Y00, 0), + GPIO_ENTRY('y', EXYNOS5420_GPIO_Y00, EXYNOS5420_GPIO_E00, 0), + GPIO_ENTRY('e', EXYNOS5420_GPIO_E00, EXYNOS5420_GPIO_F00, 0), + GPIO_ENTRY('f', EXYNOS5420_GPIO_F00, EXYNOS5420_GPIO_G00, 0), + GPIO_ENTRY('g', EXYNOS5420_GPIO_G00, EXYNOS5420_GPIO_J40, 0), + GPIO_ENTRY('j', EXYNOS5420_GPIO_J40, EXYNOS5420_GPIO_A00, 0), + GPIO_ENTRY('a', EXYNOS5420_GPIO_A00, EXYNOS5420_GPIO_B00, 0), + GPIO_ENTRY('b', EXYNOS5420_GPIO_B00, EXYNOS5420_GPIO_H00, 0), + GPIO_ENTRY('h', EXYNOS5420_GPIO_H00, EXYNOS5420_GPIO_Z0, 0), + { 0 } +}; + void gpio_cfg_pin(int gpio, int cfg); void gpio_set_pull(int gpio, int mode); void gpio_set_drv(int gpio, int mode); diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c index bcf44eb..bed7cd7 100644 --- a/drivers/gpio/s5p_gpio.c +++ b/drivers/gpio/s5p_gpio.c @@ -57,11 +57,13 @@ static inline int s5p_name_to_gpio(const char *name) */ #if defined(CONFIG_EXYNOS4) || defined(CONFIG_EXYNOS5) if (cpu_is_exynos5()) { - if (proid_is_exynos5420() || proid_is_exynos5800()) { + if (proid_is_exynos5420()) { tabp = exynos5420_gpio_table; irregular_bank_name = 'y'; irregular_set_number = '7'; irregular_bank_base = EXYNOS5420_GPIO_Y70; + } else if (proid_is_exynos5800()) { + tabp = exynos5800_gpio_table; } else { tabp = exynos5_gpio_table; irregular_bank_name = 'c';