From patchwork Fri Jan 5 13:50:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 856047 X-Patchwork-Delegate: marek.vasut@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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="aKXbt2IN"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zCmKM0Qnjz9ryr for ; Sat, 6 Jan 2018 00:51:01 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 996B5C21EA5; Fri, 5 Jan 2018 13:50:56 +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 28181C21DA6; Fri, 5 Jan 2018 13:50:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C52A3C21DA2; Fri, 5 Jan 2018 13:50:52 +0000 (UTC) Received: from fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16]) by lists.denx.de (Postfix) with ESMTPS id 17C77C21DA2 for ; Fri, 5 Jan 2018 13:50:51 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w05Dojjr023474; Fri, 5 Jan 2018 07:50:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1515160245; bh=/9eAFCdgOQUvuGJr9jyb5fkIPOw0pMDDt7r1SE1z8KI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=aKXbt2INQjmJiR9munf/pLjIJTznmNbAoakulGvPcNOZkaY6cQfnM1dsDWNZvTQIG JeS3eL8BQsuTXFb22L3JfUhZiATfMDU1gn3TSXQS6x37vSVHuusb2ocHA3ZYGRJIGj 30eowLF8xo4OpFfQ4bsUJApKqNtkLmzjxDwrNpn4= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w05Doj23026462; Fri, 5 Jan 2018 07:50:45 -0600 Received: from DFLE112.ent.ti.com (10.64.6.33) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Fri, 5 Jan 2018 07:50:45 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE112.ent.ti.com (10.64.6.33) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Fri, 5 Jan 2018 07:50:45 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w05Doinw023949; Fri, 5 Jan 2018 07:50:44 -0600 From: Jean-Jacques Hiblot To: , Date: Fri, 5 Jan 2018 14:50:38 +0100 Message-ID: <1515160243-19815-2-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515160243-19815-1-git-send-email-jjhiblot@ti.com> References: <1515160243-19815-1-git-send-email-jjhiblot@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v1 1/6] board: ti: dra7xx-evm: turn on USB clocks in late init stage 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For USB ports that use the Driver Model, turn on the clocks during the late init stage. Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Tom Rini --- board/ti/dra7xx/evm.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index 6bcfa48..7f363b6 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -643,6 +643,19 @@ int dram_init_banksize(void) return 0; } +#if CONFIG_IS_ENABLED(DM_USB) && CONFIG_IS_ENABLED(OF_CONTROL) +static int device_okay(const char *path) +{ + int node; + + node = fdt_path_offset(gd->fdt_blob, path); + if (node < 0) + return 0; + + return fdtdec_get_is_enabled(gd->fdt_blob, node); +} +#endif + int board_late_init(void) { #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG @@ -680,6 +693,12 @@ int board_late_init(void) if (board_is_dra71x_evm()) palmas_i2c_write_u8(LP873X_I2C_SLAVE_ADDR, 0x9, 0x7); #endif +#if CONFIG_IS_ENABLED(DM_USB) && CONFIG_IS_ENABLED(OF_CONTROL) + if (device_okay("/ocp/omap_dwc3_1@48880000")) + enable_usb_clocks(0); + if (device_okay("/ocp/omap_dwc3_2@488c0000")) + enable_usb_clocks(1); +#endif return 0; }