From patchwork Wed Feb 7 04:24:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10204629 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2E5C5602D8 for ; Wed, 7 Feb 2018 04:33:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46B8C28D88 for ; Wed, 7 Feb 2018 04:33:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B90A28D90; Wed, 7 Feb 2018 04:33:37 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A45C028D88 for ; Wed, 7 Feb 2018 04:33:36 +0000 (UTC) Received: from localhost ([::1]:46992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejHQN-0007qD-M4 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Feb 2018 23:33:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejHIN-0000Jr-J3 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 23:25:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ejHIM-0003HM-GQ for qemu-devel@nongnu.org; Tue, 06 Feb 2018 23:25:19 -0500 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:33820) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ejHIJ-0003AZ-1w; Tue, 06 Feb 2018 23:25:15 -0500 Received: by mail-pl0-x244.google.com with SMTP id q17so2753559pll.1; Tue, 06 Feb 2018 20:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V0HdqB9TK/uPRcNnioHY6FtyI0Njmraqs4s1UalljE0=; b=qKjbpI6E99ISBpyN21UNQc8gbu9U+9OkvPIdDnCmYUk5s6ryUeRDJWE8jmpcBQz2Os QfLRpBbRo8DtPQjC25AcwQr0yETYILoGUVuD6tvPmVGHT86Mpz/UNI52BjdPj+x4/EQE s+jcmB2aCXsiESEp/CXA+AJSX+toaWPq0zsGmURmpgq3ZoVFemzDVnCO0gxRMdSvWCJ5 AWFh9tbe649r4pX5cyUn09Q9GpxM8NSDkBpMOAQhuHXsJY1UzF2m1TjXV7jQ2k0ivF9g xqDgcEHiAGp/P6qlgPR0bksqrlQSJHv9m7Q+RerO8ffWmvBCAW2dFgjZIB5hH8uWE0DD IKQg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=V0HdqB9TK/uPRcNnioHY6FtyI0Njmraqs4s1UalljE0=; b=LyQZpKZQvbaWBmcgpWds6O1/eCHsiWUmCQfmZvZWcDTuXT2WeoeRks4ZKEAE25zi8k hg7PqD3UFA3WZPOzyUNniUQMg6t79Lkk14st5kUMffPOPPu1wDbDOkcrJ/ALQ35cZ9MJ H345Az2hmsFGvPcAvB919C3/b5XxhB8OOI2smJ5l0HyGMOWpawdwBfYwNvl7bHwPIEq1 v1uwb7MMsbASUp7xMEfzRxmrWR6sLTCYO2QM+4Y2NCXABtzrwIpBYy5nbXtTy6hNXBc+ fPmk/5aDaHi43HjIjh2C6Gs0oGEIEhoLajdDo12jLbhho3QLqvFDyGCJq5Pasmpel4fs rjVQ== X-Gm-Message-State: APf1xPAJd2WMEdb2qz1jGvuPsCU6/APm4ftnNgSo4L6VPJlbbphLEibp 6p2nPwjaA9EjgSU+2nAqG1nMdnkz X-Google-Smtp-Source: AH8x227IgMNWlPatmC/Uhnwrod2P2eTzE1SIMRuOC2vqHY3bBd/LL62ddleHCzGRkPmBqkk4ofvl0Q== X-Received: by 2002:a17:902:9003:: with SMTP id a3-v6mr4689485plp.338.1517977513866; Tue, 06 Feb 2018 20:25:13 -0800 (PST) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id x8sm1076095pfk.123.2018.02.06.20.25.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Feb 2018 20:25:13 -0800 (PST) From: Andrey Smirnov To: qemu-arm@nongnu.org Date: Tue, 6 Feb 2018 20:24:31 -0800 Message-Id: <20180207042438.15422-8-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180207042438.15422-1-andrew.smirnov@gmail.com> References: <20180207042438.15422-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::244 Subject: [Qemu-devel] [PATCH v5 07/14] 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: , Cc: Peter Maydell , "Michael S . Tsirkin" , Andrey Smirnov , Jason Wang , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, yurovsky@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- hw/timer/imx_gpt.c | 25 +++++++++++++++++++++++++ include/hw/timer/imx_gpt.h | 1 + 2 files changed, 26 insertions(+) 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) 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