From patchwork Fri Nov 23 19:53:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10696327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B8AA5A4 for ; Fri, 23 Nov 2018 19:53:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1673C286DF for ; Fri, 23 Nov 2018 19:53:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 071DD28745; Fri, 23 Nov 2018 19:53:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8CABC286DF for ; Fri, 23 Nov 2018 19:53:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=2h+DimANsrd/f6xteQ4yvKVHEpVlmTyC88sf5fpKLw4=; b=WQP5Lupq8TVGK2 aLxJtSnQsiXmmjwovajuVwOZv/R7UcMJc0A+Snh5V5Q5Ka2OTzWZLI6aQ8W4HsiPVeckVuf25fBPc hgrew019CaNgmzDSTUgxze1G2iy4sboOTx72nWcy9c5c8VfoYYTC2wWPH48cZ+xX1auIY5O4NgPiJ hp8naQ0LlD+x8jZZRCFORiuOVw1QGkvdcZZ9+BXl4uO6u7llR+ldPtAVlC12+ADbeAGdpZuOJsPpF umPr7rJQlcTUuFuZcP8j/dLcmpQFxN6oFpZP2tg4ISMNZv8uil7TDH6VKvncv5D7sSzzjzxpa5evv AqonWdhiT7SaavEfBmYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gQHWE-0007iH-NJ; Fri, 23 Nov 2018 19:53:38 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gQHWB-0007dl-Qy; Fri, 23 Nov 2018 19:53:37 +0000 Received: by mail-wr1-x441.google.com with SMTP id p4so13344614wrt.7; Fri, 23 Nov 2018 11:53:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gODjD0eo2vQeoQYeMF+uNMs3RYPbO6A3EDKJq3DZPzM=; b=g9roArnjyLDZnVtDT+iM5K2jdtVfMnF0AoRQaob0IWCk9+CBYfKKBQ350OBJWqhWg/ NhHkecY7KOP8lU3mSqEwGEuF+SEX9fUlh7J4+HaBVTazWqpGWZKl7d+moxIGw06cDFkJ 63BEcJQwWzYH739j55CyZMp2lDRrgXJh542RfN6u8wE8sBw4bRQVfivXAp+hegT+34nM pFK9yAIOaUFMdTLMAwkdV9AOVKQpRE497ZmocA7/iEZew2omsaJGZeLnIFMQ7G2RLjdW QnzyDJmX1XJgGAfIs9YYQGaBSFeOKMWh838tqw7karlgDl7l7My/gUXrWmh9z/tb0JtQ W0VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gODjD0eo2vQeoQYeMF+uNMs3RYPbO6A3EDKJq3DZPzM=; b=OEtEcSsR+v8i1gx3ujE063Dqc1irP9nsNhqKqF8ZScYEWODFWRDpX/wmuf0wnZnf9A RCt3sIwAAocn7TH9lueZasIgbXa7ELltzaku/WS8Lt1Rhj6m7x6R4O7V2XJnmr2WcNqu RLWSvUBopi5vdOu1XpOWgTPlfJYgjSvUFBmhY+k3fZ4XBREuXnEzgD4CqJrjPePzJYj8 s0bTa9a7XCreWavdwF2HFIuyA/qrf6XIfvtsUsq+mDOzHdHRfSPMfczNqaH1sFjAAyrE 7zcxDkoxRw7+D5YWzWbxiLdVXqM6Jyf5JQU0RgcOyLsIpEi8U+/Cszogg6XsJPdTDVEw vrrg== X-Gm-Message-State: AA+aEWbuLCSYaZXzev+prH9sFGNsNaCnVo25qyVB0xd5qRb2xor3BmiL cO/kxQwkoNPogkOA6HhB2dk= X-Google-Smtp-Source: AFSGD/XVZY/Gy1e/DGbb/PS1SHQXZH+yaf5RkhGvgF5Hhgzxsi9uHfXzFj1yb7mwPsDNghXB15wfXg== X-Received: by 2002:adf:f449:: with SMTP id f9mr15627412wrp.40.1543002803973; Fri, 23 Nov 2018 11:53:23 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD732F500597D16A631573221.dip0.t-ipconnect.de. [2003:dc:d732:f500:597d:16a6:3157:3221]) by smtp.googlemail.com with ESMTPSA id g198sm11495337wmd.23.2018.11.23.11.53.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 11:53:23 -0800 (PST) From: Martin Blumenstingl To: carlo@caione.org, khilman@baylibre.com, linux-amlogic@lists.infradead.org Subject: [PATCH 0/6] 32-bit Meson: add the ARM TWD and Global Timers Date: Fri, 23 Nov 2018 20:53:05 +0100 Message-Id: <20181123195311.4578-1-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181123_115335_920000_BC0B4488 X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The 32-bit Meson SoCs use Cortex-A9 or Cortex-A5 cores. These come with the ARM TWD ("Timer Watchdog") which contains a timer and a watchdog as well as the ARM Global Timer. This enables the corresponding configs for the 32-bit Meson target. Additionally this adds and enables the ARM TWD timer. The Global Timer is added but currently disabled because it's clock input is the PERIPH clock which is derived from the CPU clock. Thus the rate of the PERIPH clock will change when changing the CPU frequency. Unfortunately the Global Timer driver doesn't handle clocks with changing rates yet (unlike the TWD timer), thus we keep it disabled for now. The whole series is inspired by an almost 3 year old patch from Carlo: [0] Dependencies: - I build this on top of my other series "ARM: dts: meson: add the timer interrupts and clocks" from [1] - CLKID_PERIPH requires updated clock driver headers. Neil provided a tag which includes the updated headers: [2] - There is no runtime dependency on the PERIPH clock as we don't have CPU frequency scaling support enabled yet. In case the TWD timer driver can't find the clock it falls back to auto-detecting the clock rate at boot time. This is safe as long as we don't have .dts patches in place which allow changing the CPU clock rate. Once we enable CPU frequency scaling support for the PERIPH clock becomes mandatory so the TWD timer driver knows about changes to the PERIPH clock (which is derived from the CPU clock). [0] https://patchwork.kernel.org/patch/7797581/ [1] https://patchwork.kernel.org/cover/10687005/ [2] http://lists.infradead.org/pipermail/linux-amlogic/2018-November/009136.html Martin Blumenstingl (6): ARM: meson: select HAVE_ARM_TWD and ARM_GLOBAL_TIMER ARM: dts: meson: group the Cortex-A5 / Cortex-A9 peripherals ARM: dts: meson8: add the ARM TWD timer ARM: dts: meson8: add the Cortex-A9 global timer ARM: dts: meson8b: add the ARM TWD timer ARM: dts: meson8b: add the Cortex-A5 global timer arch/arm/boot/dts/meson.dtsi | 24 ++++++++++++++++-------- arch/arm/boot/dts/meson8.dtsi | 32 +++++++++++++++++++++++++++----- arch/arm/boot/dts/meson8b.dtsi | 32 +++++++++++++++++++++++++++----- arch/arm/mach-meson/Kconfig | 2 ++ 4 files changed, 72 insertions(+), 18 deletions(-)