From patchwork Tue Sep 26 09:37:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Awais Masood X-Patchwork-Id: 9971581 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 975C060365 for ; Tue, 26 Sep 2017 09:41:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7820C28EFA for ; Tue, 26 Sep 2017 09:41:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7383328F2E; Tue, 26 Sep 2017 09:41:02 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D64328EC1 for ; Tue, 26 Sep 2017 09:40:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwmJI-0004dn-Kn; Tue, 26 Sep 2017 09:37:48 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dwmJG-0004dV-SZ for xen-devel@lists.xenproject.org; Tue, 26 Sep 2017 09:37:47 +0000 Received: from [85.158.143.35] by server-7.bemta-6.messagelabs.com id 7A/40-03610-AEF1AC95; Tue, 26 Sep 2017 09:37:46 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRWlGSWpSXmKPExsXiVRukrftS/lS kwbTdchbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8b3k3eZC+5KVfy9s465gbFFrIuRi0NIYDqj xJxThxlBHBaBRlaJzwe+sYA4EgL9rBJ/dlwCcjiBnCyJ+8vnsXYxcgDZaRIdUxQgwpUSl38sZ gexhQQ0JE40PWeFmPqLUWJV2xw2kASbgI7EvP1PGEFsEQEliXurJjOB2MwCMxglbp1NArGFBT wkpt58xggyn0VAVaJlvQ9ImFfAXeJ9+2qoE+Qkbp7rZAaxOYHKF/YeZILY28IocaCxegKj4AJ GhlWMGsWpRWWpRbrGhnpJRZnpGSW5iZk5uoYGZnq5qcXFiempOYlJxXrJ+bmbGIEBxwAEOxib FgUeYpTkYFIS5VWUOxUpxJeUn1KZkVicEV9UmpNafIhRhoNDSYI3AyQnWJSanlqRlpkDDH2Yt AQHj5IIry1Imre4IDG3ODMdInWK0Zhj355bf5g4Om7e/cMkxJKXn5cqJc57EKRUAKQ0ozQPbh AsJi8xykoJ8zICnSbEU5BalJtZgir/ilGcg1FJmDcKZApPZl4J3L5XQKcwAZ3SO/UEyCkliQg pqQbGjVdefpgndMNo6cTty44ce7i4a299+coV6xSUnE7uj58dcs/JPuN72Y+0Psa34nMN0kyW 3Vvw2KZO4b3VrZrYB9avD0eFFjEn1xYvnlS5rSbs1eov6idEps3l07qz45Rwgg5Hd4bwQ2uW1 L0HLtv4nbpZNS/hcHhiFnus81r9eUempTxodz/ipsRSnJFoqMVcVJwIAApbcQzEAgAA X-Env-Sender: awais.masood@softrove.com X-Msg-Ref: server-3.tower-21.messagelabs.com!1506418665!81155528!1 X-Originating-IP: [74.125.82.43] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 51340 invoked from network); 26 Sep 2017 09:37:45 -0000 Received: from mail-wm0-f43.google.com (HELO mail-wm0-f43.google.com) (74.125.82.43) by server-3.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 26 Sep 2017 09:37:45 -0000 Received: by mail-wm0-f43.google.com with SMTP id m72so5776873wmc.1 for ; Tue, 26 Sep 2017 02:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vadion-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N6N65hM1t1IMrH7CI61iHWdvRFix/KMRErKEXk/8Ki0=; b=Pm99URBxCsSEwfz16p8sP/1bDClHIumAdNpXBUpsga1/ztlIoNoN3SLNBPNa/tyNbz 6Pm1ahr3CunfU43Mdl+sqFVZVcTT3S1By0ECEYgKaRLFPkAUukVIFUbZiwkEpN0bJDhT lJALhiY/a00mvjWiZEr23TUvTfCVzQsRPH7ehrlDG9KkmO07h/d0ps3AbuDCOJC12Gh1 KmOJNh+X4+mVgeI/eI+iJ7HD7gTIVJXEMMyjJ0JyQznjvpCFI3Xvh5SU2G/Iwkfg1emz +WJk65HcOcqQqPTB71JZAjMkFnBtr4tBn8Gxt+Xi2I4znKGMnk01rtB8xgmFiM27W9dl rzqg== 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; bh=N6N65hM1t1IMrH7CI61iHWdvRFix/KMRErKEXk/8Ki0=; b=eZyKrFYh50Ok4ud4oOCFmQrt58pCF0atk4GcbFvFD6TiSDEwyFnEASB/bDuDm6vjtw i/Hs8fLy2k4xyw5EyhoTY/0tx+/b4TVSiL+9+ftU8/3tWpFwMVBoQ6aRBILaoJZRudDU 3BJXI0D0GzkHqGqBPqEbl0b+xtffJWnWD8sLWfT54a237Y5HjK/M2F98QxLP22XIyjOF hQxBkDBnECaKuM5atOM2MONHSgbnwBS7kxO7BU6uxYcv6/Ex4Fq11mQ2nJ8BIzzAkHTc KR0S79lGxFbVwALNFfCq2P4z6FeH1eC5iUmIhfFfyeayGmol2vd/rYJFDJTEflEJK4Uh SFZg== X-Gm-Message-State: AHPjjUj0jJL5FlCFhKlC3fBDyChIaKyiRaSHxByC15BtwPRvAUOXu9S/ bpKlP/o8PtkUFDnQgRBxNBz0FE8d X-Google-Smtp-Source: AOwi7QD2GQeyiQfl6Y7C2zVFf6o5LLdhtNG45gr/IZ6yuY5HKzZ+Nt2mIYaR0fbGXRyUqRzV7NIjvw== X-Received: by 10.28.145.72 with SMTP id t69mr2651900wmd.113.1506418664985; Tue, 26 Sep 2017 02:37:44 -0700 (PDT) Received: from localhost.localdomain ([182.185.220.184]) by smtp.gmail.com with ESMTPSA id 55sm16043279wrw.60.2017.09.26.02.37.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Sep 2017 02:37:44 -0700 (PDT) From: Awais Masood To: xen-devel@lists.xenproject.org Date: Tue, 26 Sep 2017 14:37:13 +0500 Message-Id: <1506418634-20366-2-git-send-email-awais.masood@vadion.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506418634-20366-1-git-send-email-awais.masood@vadion.com> References: <1505828334-29109-1-git-send-email-awais.masood@vadion.com> <1506418634-20366-1-git-send-email-awais.masood@vadion.com> Cc: Julien Grall , Stefano Stabellini , xen-devel@lists.xen.org, Awais Masood Subject: [Xen-devel] [PATCH v2 1/2] xen/arm64: Add Support for Allwinner H5 (sun50i) X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support for Allwinner H5/sun50i SoC. Makefile updated to enable ARM64 compilation for sunxi.c. sunxi.c updates include: - Addition of H5/sun50i dt compatibility string. - Handling of different Watchdog timer base addresses on sun7i and sun50i. Tested on Orange Pi PC2 Signed-off-by: Awais Masood --- Changes since v1: - Improved patch description --- xen/arch/arm/platforms/Makefile | 1 + xen/arch/arm/platforms/sunxi.c | 40 +++++++++++++++++++++++++++++++--------- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile index 49fa683..722897a 100644 --- a/xen/arch/arm/platforms/Makefile +++ b/xen/arch/arm/platforms/Makefile @@ -6,5 +6,6 @@ obj-$(CONFIG_ARM_32) += omap5.o obj-$(CONFIG_ARM_32) += rcar2.o obj-$(CONFIG_ARM_64) += seattle.o obj-$(CONFIG_ARM_32) += sunxi.o +obj-$(CONFIG_ARM_64) += sunxi.o obj-$(CONFIG_ARM_64) += xgene-storm.o obj-$(CONFIG_ARM_64) += xilinx-zynqmp.o diff --git a/xen/arch/arm/platforms/sunxi.c b/xen/arch/arm/platforms/sunxi.c index 0ba7b3d..06d62e7 100644 --- a/xen/arch/arm/platforms/sunxi.c +++ b/xen/arch/arm/platforms/sunxi.c @@ -22,18 +22,18 @@ #include /* Watchdog constants: */ -#define SUNXI_WDT_BASE 0x01c20c90 +#define SUNXI_WDT_A20_BASE 0x01c20c90 +#define SUNXI_WDT_H5_BASE 0x01c20cA0 #define SUNXI_WDT_MODE 0x04 -#define SUNXI_WDT_MODEADDR (SUNXI_WDT_BASE + SUNXI_WDT_MODE) #define SUNXI_WDT_MODE_EN (1 << 0) #define SUNXI_WDT_MODE_RST_EN (1 << 1) -static void sunxi_reset(void) +static void sunxi_reset(u32 base) { void __iomem *wdt; - wdt = ioremap_nocache(SUNXI_WDT_MODEADDR & PAGE_MASK, PAGE_SIZE); + wdt = ioremap_nocache((base + SUNXI_WDT_MODE) & PAGE_MASK, PAGE_SIZE); if ( !wdt ) { dprintk(XENLOG_ERR, "Unable to map watchdog register!\n"); @@ -42,19 +42,35 @@ static void sunxi_reset(void) /* Enable watchdog to trigger a reset after 500 ms: */ writel(SUNXI_WDT_MODE_EN | SUNXI_WDT_MODE_RST_EN, - wdt + (SUNXI_WDT_MODEADDR & ~PAGE_MASK)); + wdt + ((base + SUNXI_WDT_MODE) & ~PAGE_MASK)); iounmap(wdt); for (;;) wfi(); } -static const char * const sunxi_dt_compat[] __initconst = +static void sunxi_a20_reset(void) +{ + sunxi_reset(SUNXI_WDT_A20_BASE); +} + +static void sunxi_h5_reset(void) +{ + sunxi_reset(SUNXI_WDT_H5_BASE); +} + +static const char * const sunxi_dt_allwinner_a20_compat[] __initconst = { "allwinner,sun7i-a20", NULL }; +static const char * const sunxi_dt_allwinner_h5_compat[] __initconst = +{ + "allwinner,sun50i-h5", + NULL +}; + static const struct dt_device_match sunxi_blacklist_dev[] __initconst = { /* @@ -65,10 +81,16 @@ static const struct dt_device_match sunxi_blacklist_dev[] __initconst = { /* sentinel */ }, }; -PLATFORM_START(sunxi, "Allwinner A20") - .compatible = sunxi_dt_compat, +PLATFORM_START(sunxia20, "Allwinner A20") + .compatible = sunxi_dt_allwinner_a20_compat, + .blacklist_dev = sunxi_blacklist_dev, + .reset = sunxi_a20_reset, +PLATFORM_END + +PLATFORM_START(sunxih5, "Allwinner H5") + .compatible = sunxi_dt_allwinner_h5_compat, .blacklist_dev = sunxi_blacklist_dev, - .reset = sunxi_reset, + .reset = sunxi_h5_reset, PLATFORM_END /*