From patchwork Wed Nov 7 15:04:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 150409 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5279648ljp; Wed, 7 Nov 2018 07:08:02 -0800 (PST) X-Google-Smtp-Source: AJdET5diYFHF0l6XcMx1GSI2AkQ6qbs5XZtZFe7KGCXb9xBc/1kfDZwYT3HZ3lt62N+5uoHQPX6H X-Received: by 2002:a17:906:4204:: with SMTP id z4-v6mr394857ejk.13.1541603282605; Wed, 07 Nov 2018 07:08:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541603282; cv=none; d=google.com; s=arc-20160816; b=Hdl6IJkXT5Mi7YHAMKJ16GncZZmzqIW/dMI39dnxc5642hPuJsCZEX0EMC3UVREwyD r+rKgkze3VUgmBCkIICRMGJhns2L2BR+/GcLnXcx7FNoVfO6P3E5PGscaZdZymfDaIsq 4qGWz+s2NwyVKlbqbAX+iC3i87AcgLy8qqEtxBVOJOOVedStaHrsfxUDb70xNAO4WNRZ M85lxAPiK6v+LanvZX+u0WTUVSqiqp8KWC/ACJSw3ZdBLyaDhF6f1+VDiX5mpy8+qS17 lrmF6whMQH/PKDRpY1R+onqNaq6Zra72+iK3sqY3Bd9h5zyiz0vV9gbcNgYKdWfP7j97 L53Q== 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:in-reply-to :message-id:date:to:from:dkim-signature:dkim-filter; bh=mu5C7ijmbqBkIcnK24xlnnQH+ip65rTZcixvi0MbnGg=; b=LwxlhB4x7rMrHDgjHC4QUy7aDBS64gBM+gLL6OKTOfy14g+VG/DCT5keTWM16DyNau 4HX3yiW0FeOjpqfuWgPjdDpeOnFUIyROmai4uQDxhi/FGAl/OE+CvsCEFaNGHUTGXRop i3rbIKyxwsF15vRmH65iecXU3U41TaTXnC7J3SaBjw80Y+th2xoNaDBwOIGbkH7Dm8lA nloyQEjjjW0A3zAu9vFWtdetRrRfum1YzhmVWW+Y+hXBopJ2DEaFJSUH4QqXdpF9Rjxs uwxwMGduAHVRqGqflSxbjDJkTqo1DCkLm+GK66C5poKl8SB54KXFE8HJI4GcK+QNH+/M F1Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=OAsDUt+v; 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 u19-v6si544589edb.182.2018.11.07.07.08.02; Wed, 07 Nov 2018 07:08:02 -0800 (PST) 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=OAsDUt+v; 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 309BBC224F1; Wed, 7 Nov 2018 15:05:54 +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=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 3CF6CC22509; Wed, 7 Nov 2018 15:05:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BA46FC224F1; Wed, 7 Nov 2018 15:04:56 +0000 (UTC) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lists.denx.de (Postfix) with ESMTPS id E8D3CC224FF for ; Wed, 7 Nov 2018 15:04:55 +0000 (UTC) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181107150455euoutp0234348b7b440eb3eb392413726e593515~k39kEUrzJ0644106441euoutp02H; Wed, 7 Nov 2018 15:04:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181107150455euoutp0234348b7b440eb3eb392413726e593515~k39kEUrzJ0644106441euoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1541603095; bh=CckjrqGGMmH2TkbhMUkpcTlBNV4lWRk2KPbYpzQidzw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=OAsDUt+vzyFQLqhI0vVrTDiselMgP++z5+pGWhB+NplZhb3RnnpGWb6SPku3/9kXW /s+0PDZ5xZp3mpR4tL9RnTkykOdIRmVluwqssLuXJ8SOlv0XLqqlQtWw0PDJ423Q39 n0AWQRyQLqN0Yu5chnVIwkBft+Qsy0+Y2exkm0d0= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181107150455eucas1p1c44f4519b3e1fdbc0ce9239d903938d8~k39jpHofP2707727077eucas1p1u; Wed, 7 Nov 2018 15:04:55 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 32.EB.04806.61FF2EB5; Wed, 7 Nov 2018 15:04:54 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181107150454eucas1p244fc84b33de1710ab982e7571357890b~k39i-zmyX2612626126eucas1p2A; Wed, 7 Nov 2018 15:04:54 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-f6-5be2ff161af9 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3E.35.04128.61FF2EB5; Wed, 7 Nov 2018 15:04:54 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PHT00JSSWJZXN80@eusync1.samsung.com>; Wed, 07 Nov 2018 15:04:54 +0000 (GMT) From: Marek Szyprowski To: u-boot@lists.denx.de Date: Wed, 07 Nov 2018 16:04:41 +0100 Message-id: <20181107150441.23383-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181107150105.23165-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRmVeSWpSXmKPExsWy7djP87pi/x9FG3Q+sLL4tPAEq8XGGetZ LW78amO1eP7uMpPF2iN32S06jrQwWrzd28nuwO7x4eg1No95s06weJy9s4PRo2/LKsYAligu m5TUnMyy1CJ9uwSujObjzWwFLewVt6e+Zm1g/MbaxcjJISFgInHpzUL2LkYuDiGBFYwSK6b1 MUI4nxklVs7qYoGpanzXzQKRWMYocfvkVSingUmi5dUMZpAqNgFDia63XWwgtoiAhMSv/qtg o5gFWpgkpp1fAFYkLBArseT4dKAEBweLgKrE5sXxIGFeAVuJowtfQW2Tl1i94QBYOaeAnUR3 z2SwZRICP1klVi27B1XkIrHsxgo2CFtY4tXxLewQtozE5cndUA3NjBLtM2axQzg9jBJb5+yA 6rCWOHz8IjgImAX4JCZtm84McpGEAK9ER5sQRImHxOWfZ5gh3pzIKDHz1TmmCYySCxgZVjGK p5YW56anFhvnpZbrFSfmFpfmpesl5+duYgRG3+l/x7/uYNz3J+kQowAHoxIP74WtD6OFWBPL iitzDzFKcDArifD2rn4ULcSbklhZlVqUH19UmpNafIhRmoNFSZy3muFBtJBAemJJanZqakFq EUyWiYNTqoFRPPZu0rRXCt0/t6UmXy1wnhiZULJZ6PKq1eJz3Wo/dep/fiA8IfdNAotRdNCG lo1+6ksz7xzmVJM6vsL2NI9YiciKWtvvm/LOCmYxmixU1LjIrSfc5uU7/VLyxXWtM+VeRxd3 uF6zPbbFep2cgJ6m9KLl71dPmbouwGVaJ9eELS//L2bd93KCEktxRqKhFnNRcSIAU/4BHLoC AAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42I5/e/4ZV2x/4+iDZZ1C1p8WniC1WLjjPWs Fjd+tbFaPH93mcli7ZG77BYdR1oYLd7u7WR3YPf4cPQam8e8WSdYPM7e2cHo0bdlFWMASxSX TUpqTmZZapG+XQJXRvPxZraCFvaK21NfszYwfmPtYuTkkBAwkWh8180CYgsJLGGUWHzVv4uR C8huYpJoXHOOGSTBJmAo0fW2iw3EFhGQkPjVf5URpIhZoI1J4vX6BWAJYYFYiSXHpwMlODhY BFQlNi+OBwnzCthKHF34igVimbzE6g0HwGZyCthJdPdMhlpsK/Hw6nnGCYw8CxgZVjGKpJYW 56bnFhvpFSfmFpfmpesl5+duYgSGzLZjP7fsYOx6F3yIUYCDUYmHV2PHw2gh1sSy4srcQ4wS HMxKIry9qx9FC/GmJFZWpRblxxeV5qQWH2KU5mBREuc9b1AZJSSQnliSmp2aWpBaBJNl4uCU amAMjhOxl5vHxW81++qfjoKg2ORqpluH7gSV8E+vPmf3/YLSLzVjdZW9RyR4GhtMnx3xzJBU zFOyCE2+OPN/7kWDw8GK67wXaP67rZF5TfPHgqRE6d5n8xuq5RfM8b5azPkyL2e5YLdCjTJv 5+/ustyDegyHw/XuNdZv+v432U7E3WTy9Kfy6UosxRmJhlrMRcWJALx1mF8VAgAA X-CMS-MailID: 20181107150454eucas1p244fc84b33de1710ab982e7571357890b X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181107150454eucas1p244fc84b33de1710ab982e7571357890b References: <20181107150105.23165-1-m.szyprowski@samsung.com> Cc: Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [U-Boot] [PATCH 7/9] arm: armv8: add support for boards with broken/unset counter frequency 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" Some boards use legacy firmware which doesn't properly configure ARM architected timer registers. This patch adds a workaround to use the defined COUNTER_FREQUENCY instead of reading its value from the timer registers. Signed-off-by: Marek Szyprowski --- arch/arm/cpu/armv8/generic_timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c index c1706dcec1..5ac62a0a32 100644 --- a/arch/arm/cpu/armv8/generic_timer.c +++ b/arch/arm/cpu/armv8/generic_timer.c @@ -15,9 +15,13 @@ DECLARE_GLOBAL_DATA_PTR; */ unsigned long get_tbclk(void) { +#ifndef COUNTER_FREQUENCY unsigned long cntfrq; asm volatile("mrs %0, cntfrq_el0" : "=r" (cntfrq)); return cntfrq; +#else + return COUNTER_FREQUENCY; +#endif } #ifdef CONFIG_SYS_FSL_ERRATUM_A008585