From patchwork Thu Sep 11 12:58:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 37252 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AD58020454 for ; Thu, 11 Sep 2014 13:00:30 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wp18sf95704769obc.9 for ; Thu, 11 Sep 2014 06:00:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:from:to:date:in-reply-to :references:organization:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=w1VH3s+P2L8LYaProPoVxngCF4ZYgLXKtkVvCYBrk6I=; b=dHO/OPb2TgJiieuUbO8/s2Nloq1RrqngAyeAB+oVQo9rL6AvEXNGFh6+WcsCAhFMhK 5zzjslsgZ7zJ424DZMh9bYa4dCyLYMJfj6h2q0tG+XlvExK8+YPxWDZRV0kH1V78pvyl MnYfdSTr4PNlj37Hkrq6Q7BwK/Uqy+NfPjyZneJOfHXLorF6lLpL+6KxeWBMgummACAG 7VyEV6EpWfmu0Mwa2QCl293R4F3bfyMp8hDEHaSRQFDFjgcCPPvGvbKtT0CmnZl4tCA4 IIwJY73csfYN8HxwEQW2Q9ysyybOJyilbFq/kq4sxB9HNNQ/f/75wK2qmvMEOfhX7Ccr rXRA== X-Gm-Message-State: ALoCoQmzxIVlgTYNqmFUAio0EavML3los3+cZAQCCGD/qJhN4XBCg5cEfWcnF+7MbvfmJRWpNhij X-Received: by 10.183.3.4 with SMTP id bs4mr334511obd.47.1410440430148; Thu, 11 Sep 2014 06:00:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.180 with SMTP id f49ls127582qgf.39.gmail; Thu, 11 Sep 2014 06:00:30 -0700 (PDT) X-Received: by 10.220.169.2 with SMTP id w2mr418311vcy.33.1410440430023; Thu, 11 Sep 2014 06:00:30 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id f2si289518vdf.74.2014.09.11.06.00.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 06:00:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id le20so6147210vcb.27 for ; Thu, 11 Sep 2014 06:00:29 -0700 (PDT) X-Received: by 10.52.120.51 with SMTP id kz19mr51816vdb.95.1410440429939; Thu, 11 Sep 2014 06:00:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp587391vcb; Thu, 11 Sep 2014 06:00:29 -0700 (PDT) X-Received: by 10.140.41.114 with SMTP id y105mr1190873qgy.1.1410440429306; Thu, 11 Sep 2014 06:00:29 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id e8si919140qcz.23.2014.09.11.06.00.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Sep 2014 06:00:27 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XS3x6-0002uW-6D; Thu, 11 Sep 2014 12:58:20 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XS3x4-0002uI-Ku for xen-devel@lists.xen.org; Thu, 11 Sep 2014 12:58:18 +0000 Received: from [85.158.137.68:37459] by server-13.bemta-3.messagelabs.com id 6D/2D-01569-96C91145; Thu, 11 Sep 2014 12:58:17 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1410440295!13797961!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4531 invoked from network); 11 Sep 2014 12:58:17 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 11 Sep 2014 12:58:17 -0000 X-IronPort-AV: E=Sophos;i="5.04,505,1406592000"; d="scan'208";a="171348200" Message-ID: <1410440292.25388.19.camel@kazak.uk.xensource.com> From: Ian Campbell To: Suriyan Ramasami Date: Thu, 11 Sep 2014 13:58:12 +0100 In-Reply-To: References: <1409871443-15641-1-git-send-email-suriyan.r@gmail.com> <1410171636.10156.148.camel@kazak.uk.xensource.com> <5410CF05.9070403@linaro.org> <5410F4D5.9000503@linaro.org> Organization: Citrix Systems, Inc. X-Mailer: Evolution 3.12.2-1+b1 MIME-Version: 1.0 X-DLP: MIA2 Cc: keir@xen.org, Julien Grall , Tim Deegan , "xen-devel@lists.xen.org" , Jan Beulich , ian.jackson@citrix.com, Julien Grall Subject: Re: [Xen-devel] [XEN/ARM PATCH v6 1/1] Add OdroidXU board (Exynos 5410) X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: On Wed, 2014-09-10 at 20:35 -0700, Suriyan Ramasami wrote: > On Wed, Sep 10, 2014 at 6:03 PM, Julien Grall wrote: > > Hi Suriyan, > > > > On 10/09/14 17:51, Suriyan Ramasami wrote: > >> > >> On Wed, Sep 10, 2014 at 3:21 PM, Julien Grall > >> wrote: > >>> > >>> On 08/09/14 10:26, Suriyan Ramasami wrote: > >>>> > >>>> > >>>> As can be seen, the secondary CPUs check _hotplug_addr for a non zero > >>>> value on first being powered on, or after woken up from a wfe. This > >>>> _hotplug_addr happens to be at offset +0x1c from NS_RAM_BASE. > >>>> Linux mainline too has this hardcoded +0x1c. > >>> > >>> > >>> > >>> You half read the Linux code... This offset is only add when there is a > >>> secure firmware (detected by "samsung,secure-firmware" node in the device > >>> tree). > >>> > >>> On the Arndale the node doesn't exist. > >>> > >> Thanks for digging there Julien. Previously, I must have gone through > >> the linux code with only exynos5410 in mind. Nonetheless, looks like I > >> have left out the code which handles the arndale and possibly 5420 and > >> the 5800 (if they do not have "samsung,secure-firmware" defined). But > >> on the other hand, I do see arndale-octa has the "secure-firmware" > >> entry which is a 5420 (so does the 5800). This adds to the confusion. > >> This is from looking at the linux-3.16.y source. > >> > >> Nonetheless, I think to handle arndale for now, I should add the > >> "samsung,secure-firmware" logic in the code which will then use > >> sysram_base_addr instead without any offset. > >> > >> So, how do I go about this? Should I roll out another patch with these > >> cumulative changes and also add the BUG_ON change? > > > > > > I think you could avoid to check the "samsung,secure-firmware" logic by only > > replicate arch/arm/mach-exynos/platsmp.c to Xen. > > > > Hi Julien, > I think "samsung,secure-firmware" is what differentiates the code > path in platsmp.c, from what I can tell. Correct me if I am wrong, > please. This is from the smp_init's perspective in XEN. > > The code in linux is: > /* > * Try to set boot address using firmware first > * and fall back to boot register if it fails. > */ > ret = call_firmware_op(set_cpu_boot_addr, phys_cpu, boot_addr); > if (ret && ret != -ENOSYS) > goto fail; > if (ret == -ENOSYS) { > void __iomem *boot_reg = cpu_boot_reg(phys_cpu); > > if (IS_ERR(boot_reg)) { > ret = PTR_ERR(boot_reg); > goto fail; > } > __raw_writel(boot_addr, cpu_boot_reg(phys_cpu)); > } > > call_firmware_op(set_cpu_boot_addr, ...) will return -ENOSYS (which > then uses the alternative code path of using cpu_boot_reg(), which > uses sysram_base_addr), only if register_firmware_ops() is not called > with &exynos_firmware_ops, as per the code in mach-exynos/firmware.c. > Furthermore, it is not registered in exynos_firmware_init() only if > "samsung,secure-firmware" is not found in the DT. > > I am just wondering, if you had something else in mind which can be > achieved without depending on "samsung,secure-firmware". Please let me > know the alternative. I think what you suggest sounds plausible. For me the following fixes boot on my arndale (I mistakenly thought that it worked earlier but I was testing the wrong thing). If the presence of samsung,secure-firmware is the way to distinguish the two cases then lets go that way. Since arndale is used in automated tests I'm inclined towards applying this patch until a solution is found to detect the Odroid case. Ian. -----8<-------------- >From 24f74cbb981689b37d6bf83978c628a9fbabe246 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 11 Sep 2014 13:55:08 +0100 Subject: [PATCH] xen: arm: fix boot on arndale. The differences between Arndale and the Odoid-XU are more interesting than first though, which results in 0bf8ddecb4df "xen/arm: Add support for the Odroid-XU board." breaking boot on arndale. Revert back to arndale compatible behaviour while we sort this out. Specifically we must (counterintuitively) use the regular (!ns) sysram and the correct offset is 0x0 and 0x1c. Signed-off-by: Ian Campbell Reviewed-by: Julien Grall --- xen/arch/arm/platforms/exynos5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/platforms/exynos5.c b/xen/arch/arm/platforms/exynos5.c index bc9ae15..22a38f0 100644 --- a/xen/arch/arm/platforms/exynos5.c +++ b/xen/arch/arm/platforms/exynos5.c @@ -99,7 +99,7 @@ static int __init exynos5_smp_init(void) u64 size; int rc; - node = dt_find_compatible_node(NULL, NULL, "samsung,exynos4210-sysram-ns"); + node = dt_find_compatible_node(NULL, NULL, "samsung,exynos4210-sysram"); if ( !node ) { dprintk(XENLOG_ERR, "samsung,exynos4210-sysram-ns missing in DT\n"); @@ -125,7 +125,7 @@ static int __init exynos5_smp_init(void) printk("Set SYSRAM to %"PRIpaddr" (%p)\n", __pa(init_secondary), init_secondary); - writel(__pa(init_secondary), sysram + 0x1c); + writel(__pa(init_secondary), sysram); iounmap(sysram);