From patchwork Fri Feb 9 11:03:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 127778 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp496284ljc; Fri, 9 Feb 2018 03:04:12 -0800 (PST) X-Google-Smtp-Source: AH8x227fxEhNevmljTO62kwao/DvaQBL9rm8lHWxBoKQ2fuLn+FZjFBKBzK2EvwEOXYFN/X4lJnW X-Received: by 10.37.43.136 with SMTP id r130mr1356742ybr.153.1518174252217; Fri, 09 Feb 2018 03:04:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518174252; cv=none; d=google.com; s=arc-20160816; b=SoRGQsoNM1VEi59VR4PV9OT0Vgu1GgKXPWCcU/QtcdSQQCW297UV4cOogbBypVtYc/ 9/8yrIke5RoMJm4ISP2JoUSDC2FGUtQZITiJbL7bRw0YQaW84+MDeN+J4SkdDcGX6DpD NtiS7T26Zwgc5eCR/PBumeEO/r+h+TrMfRETf/a1EOqS0Zm+qrpe4eb7ckBwhHJmhM/O FeoHijd+h3TPVtG9fR3cTyUo5t98tSKIWZYgJ4pGlFWo5kY3/FA9f0FIkCHfjF3WZBP1 O+cTqjKYewtO4So8nt8s7ONofv7fMBEtQ2enZKwYgyoPGI31Y+hzSPAW3Aq0JCmkINSC K93g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=A/YHF4Eapa88hK94zo5VNs4p9JRYuQOwNCO4Ys75t9Q=; b=ORz8QaQmSG4ngzSrWTSc702FH1oPJ+DtdG0dQGEbMB2a934Mv0NAbSAc60nzl7TxfQ bTetWWwRCR3cI88+d9D+kvIH9XCrxYri2mkO0PAhl4jNNjOKd9bWLWNkeGHiWBZ7SYi3 p8QkguycENQ8grDC9L9cpNcbGFs4ICAVPg5KX1B8oT10OFR/o/sJyhW3jRYxqcGqwxbp 1JCZdt9qnHkLb91x1RAocKicW5AAAXX2gTJ+7RcjBoAx1H9Oxet1yzMeb+CZJJ25xid0 hTk/91dV0Lr3YDGA2mghk+jwlwmMVEBP2gJ/VfyCmiv7GocMtZPl75AhUcRgQ95/elAo cbqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m63si354690yba.711.2018.02.09.03.04.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 09 Feb 2018 03:04:12 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ek6TT-000184-Cm for patch@linaro.org; Fri, 09 Feb 2018 06:04:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ek6Sp-00011m-Tn for qemu-devel@nongnu.org; Fri, 09 Feb 2018 06:03:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ek6So-0001yL-R0 for qemu-devel@nongnu.org; Fri, 09 Feb 2018 06:03:31 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:46254) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ek6So-0001td-G9 for qemu-devel@nongnu.org; Fri, 09 Feb 2018 06:03:30 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1ek6Sn-0002cP-Dm for qemu-devel@nongnu.org; Fri, 09 Feb 2018 11:03:29 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 9 Feb 2018 11:03:03 +0000 Message-Id: <20180209110314.11766-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209110314.11766-1-peter.maydell@linaro.org> References: <20180209110314.11766-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 19/30] i.MX: Add i.MX7 GPT variant 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Andrey Smirnov Add minimal code needed to allow upstream Linux guest to boot. Cc: Peter Maydell Cc: Jason Wang Cc: Philippe Mathieu-Daudé Cc: Marcel Apfelbaum Cc: Michael S. Tsirkin Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Cc: yurovsky@gmail.com Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Andrey Smirnov Signed-off-by: Peter Maydell --- include/hw/timer/imx_gpt.h | 1 + hw/timer/imx_gpt.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) -- 2.16.1 diff --git a/include/hw/timer/imx_gpt.h b/include/hw/timer/imx_gpt.h index eac59b2a70..20ccb327c4 100644 --- a/include/hw/timer/imx_gpt.h +++ b/include/hw/timer/imx_gpt.h @@ -77,6 +77,7 @@ #define TYPE_IMX25_GPT "imx25.gpt" #define TYPE_IMX31_GPT "imx31.gpt" #define TYPE_IMX6_GPT "imx6.gpt" +#define TYPE_IMX7_GPT "imx7.gpt" #define TYPE_IMX_GPT TYPE_IMX25_GPT diff --git a/hw/timer/imx_gpt.c b/hw/timer/imx_gpt.c index 4b9b54bf2e..65e4ee6bcf 100644 --- a/hw/timer/imx_gpt.c +++ b/hw/timer/imx_gpt.c @@ -113,6 +113,17 @@ static const IMXClk imx6_gpt_clocks[] = { CLK_HIGH, /* 111 reference clock */ }; +static const IMXClk imx7_gpt_clocks[] = { + CLK_NONE, /* 000 No clock source */ + CLK_IPG, /* 001 ipg_clk, 532MHz*/ + CLK_IPG_HIGH, /* 010 ipg_clk_highfreq */ + CLK_EXT, /* 011 External clock */ + CLK_32k, /* 100 ipg_clk_32k */ + CLK_HIGH, /* 101 reference clock */ + CLK_NONE, /* 110 not defined */ + CLK_NONE, /* 111 not defined */ +}; + static void imx_gpt_set_freq(IMXGPTState *s) { uint32_t clksrc = extract32(s->cr, GPT_CR_CLKSRC_SHIFT, 3); @@ -512,6 +523,13 @@ static void imx6_gpt_init(Object *obj) s->clocks = imx6_gpt_clocks; } +static void imx7_gpt_init(Object *obj) +{ + IMXGPTState *s = IMX_GPT(obj); + + s->clocks = imx7_gpt_clocks; +} + static const TypeInfo imx25_gpt_info = { .name = TYPE_IMX25_GPT, .parent = TYPE_SYS_BUS_DEVICE, @@ -532,11 +550,18 @@ static const TypeInfo imx6_gpt_info = { .instance_init = imx6_gpt_init, }; +static const TypeInfo imx7_gpt_info = { + .name = TYPE_IMX7_GPT, + .parent = TYPE_IMX25_GPT, + .instance_init = imx7_gpt_init, +}; + static void imx_gpt_register_types(void) { type_register_static(&imx25_gpt_info); type_register_static(&imx31_gpt_info); type_register_static(&imx6_gpt_info); + type_register_static(&imx7_gpt_info); } type_init(imx_gpt_register_types)