From patchwork Mon Aug 5 12:12:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijay Kilari X-Patchwork-Id: 2838653 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 06A8C9F479 for ; Mon, 5 Aug 2013 12:12:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBFFB2015B for ; Mon, 5 Aug 2013 12:12:48 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94FFB20149 for ; Mon, 5 Aug 2013 12:12:47 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6JeW-0007TG-9n; Mon, 05 Aug 2013 12:12:44 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6JeU-0000te-5d; Mon, 05 Aug 2013 12:12:42 +0000 Received: from mail-oa0-x231.google.com ([2607:f8b0:4003:c02::231]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6JeR-0000tL-Dw for linux-arm-kernel@lists.infradead.org; Mon, 05 Aug 2013 12:12:40 +0000 Received: by mail-oa0-f49.google.com with SMTP id n10so5830784oag.8 for ; Mon, 05 Aug 2013 05:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=HvT/Cz/wunY2e7l0vZLUgmzUVF5DrR9LfDlVvZ29cH4=; b=dk5ZRnYkTGpMkCC0bJoL6/rOR1VjdtbjcEyXHi7cBMnMu8bwXqIxwa2zxDSZWqIApA xuO1YL/RpR1uY8dzJNKaoqpcyJm1UuGwQtm5Iv9oyylziKLWo4Byzd/1FoyDRRrVM5J+ 32cGZLPKvH8aOd8UOHmfBnszVwSKJxadAQnmeIcYhRW1uceZMpQ5+TDdgCWlxLqRNUli HgD5ISvhr0gb3GLSFu0Wk9qFyg6aQJ3irWsgdeSQi9BOIxMMCe/U9EC3WAywXrb3i1G6 0Cq5PJ9ui/d7dpbfYw0nd/jt8naerszxOTMStw6J5FEpC7lq/8lXLtNRDIO7XX2DgX3x Yhuw== MIME-Version: 1.0 X-Received: by 10.50.47.46 with SMTP id a14mr1036433ign.46.1375704737628; Mon, 05 Aug 2013 05:12:17 -0700 (PDT) Received: by 10.64.48.101 with HTTP; Mon, 5 Aug 2013 05:12:17 -0700 (PDT) Date: Mon, 5 Aug 2013 17:42:17 +0530 Message-ID: Subject: Kexec: BE kernel on ARM VE TC2 From: Vijay Kilari To: "linux-arm-kernel@lists.infradead.org" , "linux@arm.linux.org.uk" , Will Deacon , Russell King , Stephen Warren , Ben Dooks X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130805_081239_508307_F9C298A8 X-CRM114-Status: UNSURE ( 9.74 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Will, I am trying to make kexec work on BE kernel on ARM VE TC2. First, to make KEXEC work with SMP on ARM VE TC2 board, I set nr_cpus=2 (i.e boot only A15's) this works with LE kernel. However, I made below changes to make KEXEC work for BE kernel. my question is: why delay is required for board to reboot with kexec?. Is it platform issue?. KEXEC_CONTROL_PAGE_SIZE); @@ -165,6 +176,6 @@ void machine_kexec(struct kimage *image) if (kexec_reinit) kexec_reinit(); - + mdelay(500); soft_restart(reboot_code_buffer_phys); } Thanks & Regards Vijay diff --git a/arch/arm/kernel /machine_kexec.c b/arch/arm/kernel/machine_kexec.c index 4fb074c..0fb0ff9 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c @@ -123,6 +123,18 @@ void machine_crash_shutdown(struct pt_regs *regs) printk(KERN_INFO "Loading crashdump kernel...\n"); } +static void byte_copy_relocate_kernel(void *dst, const void *src, int size) +{ + char *d, *s; + d = (char *) dst; + s = (char *) src; + while (size > 0) + { + *d++ = *s++; + size--; + } +} + /* * Function pointer to optional machine-specific reinitialization */ @@ -155,9 +167,8 @@ void machine_kexec(struct kimage *image) /* copy our kernel relocation code to the control code page */ - memcpy(reboot_code_buffer, - relocate_new_kernel, relocate_new_kernel_size); - + byte_copy_relocate_kernel(reboot_code_buffer, + relocate_new_kernel, relocate_new_kernel_size); flush_icache_range((unsigned long) reboot_code_buffer, (unsigned long) reboot_code_buffer +