From patchwork Fri Nov 16 14:54:55 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: 998986 X-Patchwork-Delegate: lukma@denx.de 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=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="e7ItnXA4"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42xLv658Dsz9s47 for ; Sat, 17 Nov 2018 01:57:54 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 633E2C22509; Fri, 16 Nov 2018 14:57:04 +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 17E2BC22527; Fri, 16 Nov 2018 14:55:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E26A2C22529; Fri, 16 Nov 2018 14:55:18 +0000 (UTC) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lists.denx.de (Postfix) with ESMTPS id EF9F4C22306 for ; Fri, 16 Nov 2018 14:55:13 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id wAGEtAIA098707; Fri, 16 Nov 2018 08:55:10 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1542380110; bh=UOfTaip81oJZnH33Y89IW9kGsVqopJVjMv8JZ+f37Z0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=e7ItnXA4HpFFU6wLd6C0+/eLaHMVCvKl+ioeOZXUSl1ztQJD9Avb7QlxQ9a0quxBd nldV8rmMs4Z9WWQhIYJLY38g4TQguigC3nWYOglxnr9pmFIr93Y4vhjjpKchzUV2bO gWbXwZ8ykqk0n1oNZCOCf38RoYETVWMT+Wzmch0E= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wAGEtA9j008525 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 16 Nov 2018 08:55:10 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 16 Nov 2018 08:55:10 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Fri, 16 Nov 2018 08:55:10 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wAGEt9qq022240; Fri, 16 Nov 2018 08:55:10 -0600 From: Jean-Jacques Hiblot To: , , Date: Fri, 16 Nov 2018 15:54:55 +0100 Message-ID: <1542380100-6071-7-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542380100-6071-1-git-send-email-jjhiblot@ti.com> References: <1542380100-6071-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 v7 06/11] board; ti: am57xx: turn on USB clocks 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" From: Vignesh R Enable USB clocks in late init stage to support ports under DM_USB. Signed-off-by: Vignesh R Signed-off-by: Jean-Jacques Hiblot --- Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: - am57xx boards: when DM_USB is used, turn on the required USB clocks board/ti/am57xx/board.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index 177a324..8c24d17 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -675,6 +675,19 @@ out: return; } +#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) { setup_board_eeprom_env(); @@ -714,6 +727,12 @@ int board_late_init(void) board_ti_set_ethaddr(2); #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; }