From patchwork Wed Mar 6 09:23:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 1052202 X-Patchwork-Delegate: promsoft@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="z0UGEBE1"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44DpGR45Zwz9s4Y for ; Wed, 6 Mar 2019 20:23:27 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 24534C21DB6; Wed, 6 Mar 2019 09:23:25 +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=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 D8DC2C21D72; Wed, 6 Mar 2019 09:23:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 81459C21D72; Wed, 6 Mar 2019 09:23:20 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by lists.denx.de (Postfix) with ESMTPS id 20ED6C21C2C for ; Wed, 6 Mar 2019 09:23:20 +0000 (UTC) Received: from PC-kkoz.proceq.com (unknown [213.160.61.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 73E9F2064A; Wed, 6 Mar 2019 09:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551864198; bh=+lB13JUv0IJQ/jn9tbz6ph4tMEN40DJ2JZJ/VONG4Uc=; h=From:To:Cc:Subject:Date:From; b=z0UGEBE1+VmChgeIKaTjq6SWbi+zyEylRimj+HILRMbrvsNFoWIiPMEXheKq1rJbL sXnWKe8tCvGZaHnRiwv/B7E6PMVC3BPImtmB55/TRbsqyjRCddGORU6+LgYlh/xByp LyF9KDGzMreUxETD3UjIPKw1PGrTZUsG43O/svww= From: Krzysztof Kozlowski To: Jaehoon Chung , Krzysztof Kozlowski , Minkyu Kang , Seung-Woo Kim , u-boot@lists.denx.de Date: Wed, 6 Mar 2019 10:23:09 +0100 Message-Id: <1551864189-9546-1-git-send-email-krzk@kernel.org> X-Mailer: git-send-email 2.7.4 Cc: Marek Szyprowski Subject: [U-Boot] [PATCH] arm: exynos: odroid: Fix build if BOARD_TYPES are not set 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" CONFIG_BOARD_TYPES is necessary for Odroid X/X2/U3 boards to detect proper revision. However building should succeed even without it. While moving code around, document also the reference clock selection. This fixes the build error without CONFIG_BOARD_TYPES: board/samsung/odroid/odroid.c: In function 'board_usb_init': board/samsung/odroid/odroid.c:473:8: error: 'gd_t' {aka 'volatile struct global_data'} has no member named 'board_type' if (gd->board_type == ODROID_TYPE_U3) ^~ Signed-off-by: Krzysztof Kozlowski --- board/samsung/odroid/odroid.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c index 552333fe869d..b11d99223346 100644 --- a/board/samsung/odroid/odroid.c +++ b/board/samsung/odroid/odroid.c @@ -462,18 +462,33 @@ struct dwc2_plat_otg_data s5pc210_otg_data = { #if defined(CONFIG_USB_GADGET) || defined(CONFIG_CMD_USB) +static void set_usb3503_ref_clk(void) +{ +#ifdef CONFIG_BOARD_TYPES + /* + * gpx3-0 chooses primary (low) or secondary (high) reference clock + * frequencies table. The choice of clock is done through hard-wired + * REF_SEL pins. + * The Odroid Us have reference clock at 24 MHz (00 entry from secondary + * table) and Odroid Xs have it at 26 MHz (01 entry from primary table). + */ + if (gd->board_type == ODROID_TYPE_U3) + gpio_direction_output(EXYNOS4X12_GPIO_X30, 0); + else + gpio_direction_output(EXYNOS4X12_GPIO_X30, 1); +#else + /* Choose Odroid Xs frequency without board types */ + gpio_direction_output(EXYNOS4X12_GPIO_X30, 1); +#endif /* CONFIG_BOARD_TYPES */ +} + int board_usb_init(int index, enum usb_init_type init) { #ifdef CONFIG_CMD_USB struct udevice *dev; int ret; - /* Set Ref freq 0 => 24MHz, 1 => 26MHz*/ - /* Odroid Us have it at 24MHz, Odroid Xs at 26MHz */ - if (gd->board_type == ODROID_TYPE_U3) - gpio_direction_output(EXYNOS4X12_GPIO_X30, 0); - else - gpio_direction_output(EXYNOS4X12_GPIO_X30, 1); + set_usb3503_ref_clk(); /* Disconnect, Reset, Connect */ gpio_direction_output(EXYNOS4X12_GPIO_X34, 0);