From patchwork Fri Jan 22 02:45:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 571453 X-Patchwork-Delegate: sjg@chromium.org 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 BADE31402DE for ; Fri, 22 Jan 2016 14:01:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=Tpzo7AcP; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3CB6CA74E3; Fri, 22 Jan 2016 04:01:30 +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 PMQOJeHtH6T6; Fri, 22 Jan 2016 04:01:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5DB9DA751C; Fri, 22 Jan 2016 03:54:37 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F76C4BAE7 for ; Fri, 22 Jan 2016 03:46:22 +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 v47_bQ3gEKnJ for ; Fri, 22 Jan 2016 03:46:22 +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 mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) by theia.denx.de (Postfix) with ESMTPS id 152BE4BB39 for ; Fri, 22 Jan 2016 03:45:37 +0100 (CET) Received: by mail-ob0-f179.google.com with SMTP id yo10so26985250obb.2 for ; Thu, 21 Jan 2016 18:45:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=f/hX4uDHLYX67+uzJHC3wloDvDLWC8RUdc8/3iqJJ0U=; b=Tpzo7AcPq8Uap+LdesgwfHIXTK1AFEPyDay/Mvjy7Px8xkg264dVbRdghU4Ey74h7C 58nOMfXeLGFpsT0q20MC41SUiD49mXCKgSv3D99bHk9SS1iV3wQMts7cFecC7Q5q9I0o 02FwdL8I/LRWb9Gb3Sb/pJJa9uC7GEzT2ykqFwYXWIjVzVfC/BjLpxlJjGy5Qm35AVpa 8aSQCX0vlH1WmVRT4xdmtHIOSDGglEORJj1695pBgCZSU27ICP7NBdGen97qbsP/kQEL lXoZZw5pwFqj4nskwwtffoSELibWdJTnsWlF2ZXAg2XAzlDkL7bVfunUvO06stMehlnn P4pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=f/hX4uDHLYX67+uzJHC3wloDvDLWC8RUdc8/3iqJJ0U=; b=mZwGwK9KNaSFZc+33Ty2mFln1PHIt/C8uaZKyUu7nJkTb/7XBX/RD5bWkJJ1nKde6j sEIr034Y9XUdBXoELH48CwITJbEypVlQaKCefGFfeooYlPTGasnt9IaBtptvr5yXjQmG qU64Nhrt55bRACMQXjHSeh6VPeOf6tnigFPxtndGLyRnAJT7SqW/0R+bQFrJLnfMvL4j Z6gSdUNJ3YDSnzZ1Mukysxlz59PlBN+UcPN4NaBADZDCqVjI8RWQtuDaB0BD8Qz1YSzH lzyBTjpjheMINEf/l1OkxvKHpvy5AzraknuBZawgO19Tw/oCTqfnU+f1LumNRuyKbswC RYAQ== X-Gm-Message-State: AG10YORs/cCkMBlqE4sR4kj5/R7EsTpKeOJIBOXxYZ7XaVDgP3E2IhoepoU10KrGuhtZmjeU X-Received: by 10.60.155.97 with SMTP id vv1mr478640oeb.60.1453430736406; Thu, 21 Jan 2016 18:45:36 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id i7sm2066770oej.16.2016.01.21.18.45.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jan 2016 18:45:35 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 6ADD32219E2; Thu, 21 Jan 2016 19:45:30 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Thu, 21 Jan 2016 19:45:07 -0700 Message-Id: <1453430725-4641-20-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1453430725-4641-1-git-send-email-sjg@chromium.org> References: <1453430725-4641-1-git-send-email-sjg@chromium.org> Cc: Tom Cubie , Jeffy Chen Subject: [U-Boot] [PATCH v2 19/37] rockchip: Add a simple 'clock' command X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Add a command that displays the PLLs and their current rate. Signed-off-by: Simon Glass --- Changes in v2: None arch/arm/mach-rockchip/board.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c index 380aa91..133d663 100644 --- a/arch/arm/mach-rockchip/board.c +++ b/arch/arm/mach-rockchip/board.c @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -49,3 +50,26 @@ void enable_caches(void) void lowlevel_init(void) { } + +static int do_clock(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) +{ + struct udevice *dev; + + for (uclass_first_device(UCLASS_CLK, &dev); + dev; + uclass_next_device(&dev)) { + ulong rate; + + rate = clk_get_rate(dev); + printf("%s: %lu\n", dev->name, rate); + } + + return 0; +} + +U_BOOT_CMD( + clock, 2, 1, do_clock, + "display information about clocks", + "" +);