From patchwork Thu Jun 21 22:39:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 932977 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41Bc9b0Lm1z9rxs for ; Fri, 22 Jun 2018 08:40:49 +1000 (AEST) Received: from localhost ([::1]:57895 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW8Fy-0000W2-44 for incoming@patchwork.ozlabs.org; Thu, 21 Jun 2018 18:40:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW8FK-0000Vr-WD for qemu-devel@nongnu.org; Thu, 21 Jun 2018 18:40:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW8FH-0001ql-Pz for qemu-devel@nongnu.org; Thu, 21 Jun 2018 18:40:07 -0400 Received: from 16.mo6.mail-out.ovh.net ([87.98.139.208]:33934) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fW8FH-0001qT-IC for qemu-devel@nongnu.org; Thu, 21 Jun 2018 18:40:03 -0400 Received: from player696.ha.ovh.net (unknown [10.109.122.75]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id 5CB9D165A67 for ; Fri, 22 Jun 2018 00:40:01 +0200 (CEST) Received: from zorba.kaod.org (LFbn-TOU-1-49-10.w86-201.abo.wanadoo.fr [86.201.141.10]) (Authenticated sender: clg@kaod.org) by player696.ha.ovh.net (Postfix) with ESMTPSA id 2C75D3C007D; Fri, 22 Jun 2018 00:39:51 +0200 (CEST) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: qemu-devel@nongnu.org Date: Fri, 22 Jun 2018 00:39:43 +0200 Message-Id: <20180621223946.20738-1-clg@kaod.org> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 X-Ovh-Tracer-Id: 2972375754196618048 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtiedrtdehgdduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 87.98.139.208 Subject: [Qemu-devel] [PATCH 0/3] aspeed: introduce the APB clock settings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , Peter Maydell , qemu-arm@nongnu.org, Joel Stanley , =?utf-8?q?C=C3=A9dric_Le_Goater?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Hello, The Aspeed SoC clocks are driven by an input source clock which can have different frequencies : 24MHz or 25MHz, and also, on the Aspeed AST2400 SoC, 48MHz. The H-PLL (CPU) clock is defined from a calculation using parameters in the H-PLL Parameter register or from a predefined set of frequencies if the setting is strapped by hardware (Aspeed AST2400 SoC). The other clocks of the SoC are then defined from the H-PLL using dividers. We first introduce the APB clock because it drives the timer model. This fixes a slowdown issue on the palmetto machine (AST2400) when running Linux. The latest Linux versions take into account more precisely the SoC settings for the clocks and the APB freq is set to 48MHz but modeled at 24MHz by QEMU. Thanks, C. Cédric Le Goater (3): aspeed/scu: introduce clock frequencies aspeed: initialize the SCU controller first aspeed/timer: use the APB frequency from the SCU include/hw/misc/aspeed_scu.h | 70 ++++++++++++++++++++++++-- include/hw/timer/aspeed_timer.h | 4 ++ hw/arm/aspeed_soc.c | 42 ++++++++-------- hw/misc/aspeed_scu.c | 106 ++++++++++++++++++++++++++++++++++++++++ hw/timer/aspeed_timer.c | 19 +++++-- 5 files changed, 213 insertions(+), 28 deletions(-)