From patchwork Mon Jun 3 09:53:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 2651601 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 015D23FC23 for ; Mon, 3 Jun 2013 09:55:16 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjRTN-0005oE-Me; Mon, 03 Jun 2013 09:54:42 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjRT8-0002ch-EB; Mon, 03 Jun 2013 09:54:26 +0000 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UjRT5-0002b0-1u for linux-arm-kernel@lists.infradead.org; Mon, 03 Jun 2013 09:54:23 +0000 Received: by mail-wi0-f171.google.com with SMTP id hq7so2480992wib.4 for ; Mon, 03 Jun 2013 02:54:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:subject:date:message-id:x-mailer:content-type :x-gm-message-state; bh=rPzH2OIpw44qsH+Fze/69f6tKUmGvmgt/2wAaccSBTI=; b=LH1bJCqmIkVUThfhHvOUehz+rOlcLoAb9S/IWwMvI2gxz1USJoEIKHNCb6Ex0ZUCGS Io50xLPDDCg/F6InuA/iD59A4QGXVqN8GtfdwuhOUSo/7zaYeGYaJ3jW4xPkbo2RD9sT Y+TrnXSOfZmhcDvfS+XNo2H6wJ5HZO/LUgdAVbGfD4/QbifHA0w7rckWKY+DXfUs3amc lmjPmXLzsmpdericWHUmtpADJOsqPQWZnNlyWBy/mgIchD0AdT2GRaaWMeOhq426mnl/ cPVqYLwzgrGs2kAWZgrRYMgAgnzXbrxnCbIBQWP0PO+EQ4RIu/W7uhcmdYyaglDLhMGR KaKQ== X-Received: by 10.180.90.43 with SMTP id bt11mr11590553wib.30.1370253240614; Mon, 03 Jun 2013 02:54:00 -0700 (PDT) Received: from localhost (nat-63.starnet.cz. [178.255.168.63]) by mx.google.com with ESMTPSA id cw8sm22198333wib.7.2013.06.03.02.53.58 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 03 Jun 2013 02:53:59 -0700 (PDT) From: Michal Simek To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] zynq: Not to rewrite jump code when starting address is 0x0 Date: Mon, 3 Jun 2013 11:53:52 +0200 Message-Id: <7f0e7852622e72e0e3cb9ccec0b6409b8e32e530.1370253191.git.michal.simek@xilinx.com> X-Mailer: git-send-email 1.8.2.3 X-Gm-Message-State: ALoCoQleh5CUB32bK9YLBysamOtUeluBhe2OkyEveBRMBl0y12eEGiw8DuFyPDTcZv4N/v9u2VDc X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130603_055423_222233_BC58C396 X-CRM114-Status: GOOD ( 14.71 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 T_TVD_MIME_NO_HEADERS BODY: T_TVD_MIME_NO_HEADERS 0.7 MIME_HEADER_CTYPE_ONLY 'Content-Type' found without required MIME headers 0.0 T_MIME_NO_TEXT No (properly identified) text body parts X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This configuration is used by remoteproc. Signed-off-by: Michal Simek --- arch/arm/mach-zynq/platsmp.c | 52 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) -- 1.8.2.3 diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c index 5fc167e..023f225 100644 --- a/arch/arm/mach-zynq/platsmp.c +++ b/arch/arm/mach-zynq/platsmp.c @@ -53,34 +53,34 @@ int __cpuinit zynq_cpun_start(u32 address, int cpu) &zynq_secondary_trampoline; zynq_slcr_cpu_stop(cpu); - - if (__pa(PAGE_OFFSET)) { - zero = ioremap(0, trampoline_code_size); - if (!zero) { - pr_warn("BOOTUP jump vectors not accessible\n"); - return -1; + if (address) { + if (__pa(PAGE_OFFSET)) { + zero = ioremap(0, trampoline_code_size); + if (!zero) { + pr_warn("BOOTUP jump vectors not accessible\n"); + return -1; + } + } else { + zero = (__force u8 __iomem *)PAGE_OFFSET; } - } else { - zero = (__force u8 __iomem *)PAGE_OFFSET; - } - - /* - * This is elegant way how to jump to any address - * 0x0: Load address at 0x8 to r0 - * 0x4: Jump by mov instruction - * 0x8: Jumping address - */ - memcpy((__force void *)zero, &zynq_secondary_trampoline, - trampoline_size); - writel(address, zero + trampoline_size); - - flush_cache_all(); - outer_flush_range(0, trampoline_code_size); - smp_wmb(); - - if (__pa(PAGE_OFFSET)) - iounmap(zero); + /* + * This is elegant way how to jump to any address + * 0x0: Load address at 0x8 to r0 + * 0x4: Jump by mov instruction + * 0x8: Jumping address + */ + memcpy((__force void *)zero, &zynq_secondary_trampoline, + trampoline_size); + writel(address, zero + trampoline_size); + + flush_cache_all(); + outer_flush_range(0, trampoline_code_size); + smp_wmb(); + + if (__pa(PAGE_OFFSET)) + iounmap(zero); + } zynq_slcr_cpu_start(cpu); return 0;