From patchwork Fri Nov 3 08:30:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 117873 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3287151qgn; Fri, 3 Nov 2017 03:35:41 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QWCC8S6PWkMbru5iQ11i6Jg4TrqR/2M9wkjob2ux9nIN6wo/mcTKaEjVzlsRP+3YocPIdl X-Received: by 10.80.169.21 with SMTP id l21mr7961489edc.126.1509705340953; Fri, 03 Nov 2017 03:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509705340; cv=none; d=google.com; s=arc-20160816; b=uHzCSo1jEoY6dWECVDeT23OOb6s6nzoVomlZALHQhQn2x4mHS+hsoALJ6u/ZS64FC4 UxdN3qr2st0TFYxSBimQ3Z7ZM9+Ld98NY+97WhCnWOFjfsk7477gFduAP8jVMO2Dn6oD /ZMJ+DX3t/067Mk+UWlnuTGGiJ1Bxfb6RYzuQKHg8vyrtjvrDrWh++3X2IiL2JvHPoFV BMXa4wPfFAsnDWLsEyEZ1ecBDZ2dazZUFzohsJI8Es3jcCwzdCYYXVO7rUB6M+qYTrVv 5oAiecbwowKXqEF4q+g+Q9UrW76kcS3vW6e0n0mPG8HQNwYiT7goOGy1HGnyYKgiaSse OwTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:cms-type:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=jFhB//lV2c+e+BHr0ogRn78XCaUhh2r2hNMvub0rAF0=; b=Endpv3qFBMf/fgJNesPAbyL8IptTgDiSe/EQn8PjfdAsB3s/YRR1HBHY67fwZzJXkM HSG1YYuwcuNwKxL5mflZ5Y8sp4kqTBOb00oul+drCdQQsFg0G+cw97PZ5Y8c9iPaaWcj vuX2Ncfy6nVxlXC8xu1T5ZBVNrf4U3YuxmX1AyPcznTr712nJUAA6Q+6QMVZ4GGzTmbY 0Ql9CxDu26LqpMZpmHrUPBsY25Z+l8SZ90WaCDDoMj+jOKCIfUSdcdv4BMTdcIZb3eqQ 9YE4sIV0luiKH5I+EcHjAllnpxdhatEauyIEOXMnIlwGYwSRknHYXZkENVAnBOgeRUuo f7Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=CMp/WOd0; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r58si4112170edd.139.2017.11.03.03.35.40; Fri, 03 Nov 2017 03:35:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=CMp/WOd0; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: by lists.denx.de (Postfix, from userid 105) id 766DAC21DE6; Fri, 3 Nov 2017 10:34:21 +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=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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 239D9C21E14; Fri, 3 Nov 2017 10:33:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B6361C21C51; Fri, 3 Nov 2017 08:31:22 +0000 (UTC) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lists.denx.de (Postfix) with ESMTPS id C7696C21C45 for ; Fri, 3 Nov 2017 08:31:21 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20171103083118euoutp01ae8a1f7ace62db28c9e3acf240491d02~zhjjbrL4_0168301683euoutp012; Fri, 3 Nov 2017 08:31:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20171103083118euoutp01ae8a1f7ace62db28c9e3acf240491d02~zhjjbrL4_0168301683euoutp012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1509697878; bh=m692t7bwKp37JRpCgQDecwg3Pn2D2Nz4AkQCo5xDwdQ=; h=From:To:Cc:Subject:Date:References:From; b=CMp/WOd08zJoc5Qw8UVtsSRs+t+n9yG1xN5cfq/w0CCFpii7NFCDeoIu5Huj5uCE+ mAYB6U8A0L/sE8eC73PZYT9U+6wlfEffQ5Oqzx4fp01fcCGk8a9e6s1ivV+/f/olAN rFVvVoxvGoF0FpxPByf6OUG59RKEGo0/LgqcEQ7Q= Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171103083118eucas1p212e7b92c93c15431767802d57244deb2~zhjiwPnc41991919919eucas1p2_; Fri, 3 Nov 2017 08:31:18 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 89.4C.12907.5592CF95; Fri, 3 Nov 2017 08:31:17 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20171103083117eucas1p23f9842ec3707ebc6774026803575de6d~zhjiAJ2sY1090610906eucas1p2z; Fri, 3 Nov 2017 08:31:17 +0000 (GMT) X-AuditID: cbfec7f1-f793a6d00000326b-14-59fc2955536f Received: from eusync2.samsung.com ( [203.254.199.212]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 94.A3.20118.5592CF95; Fri, 3 Nov 2017 08:31:17 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OYU004W62BZMF70@eusync2.samsung.com>; Fri, 03 Nov 2017 08:31:17 +0000 (GMT) From: Marek Szyprowski To: u-boot@lists.denx.de Date: Fri, 03 Nov 2017 09:30:30 +0100 Message-id: <20171103083030.31723-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.14.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPIsWRmVeSWpSXmKPExsWy7djP87qhmn8iDX5OMbXYOGM9q8WNX22s FufPb2C3WHvkLrvF272d7A6sHptWdbJ5nL2zg9Gjb8sqxgDmKC6blNSczLLUIn27BK6MBTdf sxVMUK2YN+0pawPjbrkuRk4OCQETibs/e9ghbDGJC/fWs3UxcnEICSxllJg+vZcJwvnMKHHi 2mpWmI5fV/9CJZYxSiy5dosZwmlgkri+fDfYLDYBQ4mut11sILaIgITEr/6rjCBFzAI7GCUO HDzIDJIQFnCTOPK6jwnEZhFQlXi6djtYnFfAVuLb97WMEOvkJd4vuA/WLCFwl1Vi82GIIgkB F4mPdw6yQdjCEq+Ob4H6Qkbi8uRuFgi7n1GiqVUbwp7BKHHuLS+EbS1x+PhFsH+YBfgkJm2b DjSTAyjOK9HRJgRR4iHxe81KJgjbUaL/xwGwe4QEYiXm/pnGNoFRagEjwypGkdTS4tz01GIj veLE3OLSvHS95PzcTYzAaDv97/jHHYzvT1gdYhTgYFTi4d0w4XekEGtiWXFl7iFGCQ5mJRHe xzFAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4ry2UW2RQgLpiSWp2ampBalFMFkmDk6pBsaEVNmi V/c77IPelJ6T8j8+WYGXzW/5ymc5j7783nDwkbz5hp2PK8p1InZM91sUGSO9YPOGO3anInU6 AgUE4891f7/8/NZd5XwrqY1amutC+Z+/m+T9dQNHqeXhveLNMmXfdZkOXVljccjz1pc37lrX dge83lZvtujqm+df/PVC5y3/wLFwsvESJZbijERDLeai4kQABrCubLICAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJJMWRmVeSWpSXmKPExsVy+t/xK7qhmn8iDY6fFLLYOGM9q8WNX22s FufPb2C3WHvkLrvF272d7A6sHptWdbJ5nL2zg9Gjb8sqxgDmKC6blNSczLLUIn27BK6MBTdf sxVMUK2YN+0pawPjbrkuRk4OCQETiV9X/zJB2GISF+6tZ+ti5OIQEljCKPFh4ykWCKeJSeLM my8sIFVsAoYSXW+72EBsEQEJiV/9VxlBipgFdjBK/J3UzAiSEBZwkzjyug9sLIuAqsTTtduZ QWxeAVuJb9/XMkKsk5d4v+A+4wRG7gWMDKsYRVJLi3PTc4uN9IoTc4tL89L1kvNzNzECA2Db sZ9bdjB2vQs+xCjAwajEw8sx+XekEGtiWXFl7iFGCQ5mJRHexzFAId6UxMqq1KL8+KLSnNTi Q4zSHCxK4ry9e1ZHCgmkJ5akZqemFqQWwWSZODilGhgnWk640KrwcoGoUsxetqK6L9vf58uY yu++p7t4tvL896ue3n7slOF4Z3fptRkn2Q803jZc/eCICt+qk/PmLWy3XZtsLbNGvXzX0o87 5uw4qtP9RWbzsX3G1zdumx6ftVptgR2Dxo2dikpFslXrd3FLbsuZPJlzk5PSuUfzJc0evkkK elPOuP6YnRJLcUaioRZzUXEiAA69coP8AQAA X-CMS-MailID: 20171103083117eucas1p23f9842ec3707ebc6774026803575de6d X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171103083117eucas1p23f9842ec3707ebc6774026803575de6d X-RootMTR: 20171103083117eucas1p23f9842ec3707ebc6774026803575de6d References: X-Mailman-Approved-At: Fri, 03 Nov 2017 10:33:23 +0000 Cc: Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Marek Szyprowski Subject: [U-Boot] [PATCH] ARM: Samsung: Add Exynos5422-based Odroid HC1 support 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" Odroid HC1 board is based on Odroid XU4 board, but it has no HDMI, no eMMC, no build-in USB3.0 hub, no extension port pins, and no GPIO button. USB3.0 ports are used for build-in JMicron USB to SATA bridge and Gigabit R8152 ethernet chips. HC1 uses only passive cooling. This patch also updates Odroid's ADCmax array and reduces ADC tolerance to 1% to ensure that XU4 and HC1 revisions are properly detected. I've tested this with XU3, XU3-lite, XU4 and HC1 boards. In case of my test boards I got following values from ADC register: 372, 370, 1281 and 1313. Signed-off-by: Marek Szyprowski Tested-by: Krzysztof Kozlowski Tested-by: Krzysztof Kozlowski --- board/samsung/common/exynos5-dt-types.c | 27 ++++++++++++++++++++------- board/samsung/common/exynos5-dt.c | 4 ++-- configs/odroid-xu3_defconfig | 2 +- include/samsung/exynos5-dt-types.h | 2 ++ 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/board/samsung/common/exynos5-dt-types.c b/board/samsung/common/exynos5-dt-types.c index 48fd1f7d966..03d3a3112a1 100644 --- a/board/samsung/common/exynos5-dt-types.c +++ b/board/samsung/common/exynos5-dt-types.c @@ -25,17 +25,22 @@ static const struct udevice_id board_ids[] = { }; /** - * Odroix XU3/4 board revisions: + * Odroix XU3/XU4/HC1 board revisions (from HC1_MAIN_REV0.1_20170630.pdf): * Rev ADCmax Board * 0.1 0 XU3 0.1 - * 0.2 410 XU3 0.2 | XU3L - no DISPLAYPORT (probe I2C0:0x40 / INA231) - * 0.3 1408 XU4 0.1 - * Use +10 % for ADC value tolerance. + * 0.2 372 XU3 0.2 | XU3L - no DISPLAYPORT (probe I2C0:0x40 / INA231) + * 0.3 1280 XU4 0.1 + * 0.4 739 XU4 0.2 + * 0.5 1016 XU4+Air0.1 (Passive cooling) + * 0.6 1308 XU4S 0.1 (HC1) + * Use +1% for ADC value tolerance in the array below, the code loops until + * the measured ADC value is lower than then ADCmax from the array. */ struct odroid_rev_info odroid_info[] = { { EXYNOS5_BOARD_ODROID_XU3_REV01, 1, 10, "xu3" }, - { EXYNOS5_BOARD_ODROID_XU3_REV02, 2, 410, "xu3" }, - { EXYNOS5_BOARD_ODROID_XU4_REV01, 1, 1408, "xu4" }, + { EXYNOS5_BOARD_ODROID_XU3_REV02, 2, 375, "xu3" }, + { EXYNOS5_BOARD_ODROID_XU4_REV01, 1, 1293, "xu4" }, + { EXYNOS5_BOARD_ODROID_HC1_REV01, 1, 1321, "hc1" }, { EXYNOS5_BOARD_ODROID_UNKNOWN, 0, 4095, "unknown" }, }; @@ -61,7 +66,7 @@ static int odroid_get_board_type(void) goto rev_default; for (i = 0; i < ARRAY_SIZE(odroid_info); i++) { - /* ADC tolerance: +20 % */ + /* ADC tolerance: +1% */ if (adcval < odroid_info[i].adc_val) return odroid_info[i].board_type; } @@ -132,6 +137,14 @@ bool board_is_odroidxu4(void) return false; } +bool board_is_odroidhc1(void) +{ + if (gd->board_type == EXYNOS5_BOARD_ODROID_HC1_REV01) + return true; + + return false; +} + bool board_is_generic(void) { if (gd->board_type == EXYNOS5_BOARD_GENERIC) diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c index 0d17f30712c..a4eb3514051 100644 --- a/board/samsung/common/exynos5-dt.c +++ b/board/samsung/common/exynos5-dt.c @@ -176,7 +176,7 @@ char *get_dfu_alt_system(char *interface, char *devstr) { char *info = "Not supported!"; - if (board_is_odroidxu4()) + if (board_is_odroidxu4() || board_is_odroidhc1()) return info; return env_get("dfu_alt_system"); @@ -189,7 +189,7 @@ char *get_dfu_alt_boot(char *interface, char *devstr) char *alt_boot; int dev_num; - if (board_is_odroidxu4()) + if (board_is_odroidxu4() || board_is_odroidhc1()) return info; dev_num = simple_strtoul(devstr, NULL, 10); diff --git a/configs/odroid-xu3_defconfig b/configs/odroid-xu3_defconfig index 76b1d35b2aa..976c06a29d3 100644 --- a/configs/odroid-xu3_defconfig +++ b/configs/odroid-xu3_defconfig @@ -1,7 +1,7 @@ CONFIG_ARM=y CONFIG_ARCH_EXYNOS=y CONFIG_ARCH_EXYNOS5=y -CONFIG_IDENT_STRING=" for ODROID-XU3" +CONFIG_IDENT_STRING=" for ODROID-XU3/XU4/HC1" CONFIG_DEFAULT_DEVICE_TREE="exynos5422-odroidxu3" CONFIG_DISTRO_DEFAULTS=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set diff --git a/include/samsung/exynos5-dt-types.h b/include/samsung/exynos5-dt-types.h index 479e2e793dc..8e11af30d18 100644 --- a/include/samsung/exynos5-dt-types.h +++ b/include/samsung/exynos5-dt-types.h @@ -8,6 +8,7 @@ enum { EXYNOS5_BOARD_ODROID_XU3_REV01, EXYNOS5_BOARD_ODROID_XU3_REV02, EXYNOS5_BOARD_ODROID_XU4_REV01, + EXYNOS5_BOARD_ODROID_HC1_REV01, EXYNOS5_BOARD_ODROID_UNKNOWN, EXYNOS5_BOARD_COUNT, @@ -23,5 +24,6 @@ struct odroid_rev_info { bool board_is_generic(void); bool board_is_odroidxu3(void); bool board_is_odroidxu4(void); +bool board_is_odroidhc1(void); #endif