Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932080Ab3JGQhE (ORCPT ); Mon, 7 Oct 2013 12:37:04 -0400 Received: from mail-gg0-f171.google.com ([209.85.161.171]:39997 "EHLO mail-gg0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755582Ab3JGQgu (ORCPT ); Mon, 7 Oct 2013 12:36:50 -0400 X-Greylist: delayed 419 seconds by postgrey-1.27 at vger.kernel.org; Mon, 07 Oct 2013 12:36:50 EDT From: Rob Herring To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Grant Likely , Rob Herring , Jonas Bonn , linux@openrisc.net Subject: [PATCH v2 05/29] openrisc: use unflatten_and_copy_device_tree Date: Mon, 7 Oct 2013 11:29:13 -0500 Message-Id: <1381163377-21044-6-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1381163377-21044-1-git-send-email-robherring2@gmail.com> References: <1381163377-21044-1-git-send-email-robherring2@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2044 Lines: 66 From: Rob Herring Use the common unflatten_and_copy_device_tree to copy the built-in FDT out of init section. This moves the copy later in the boot, but there do not appear to be any references to strings in the FDT before the copy. Signed-off-by: Rob Herring Cc: Jonas Bonn Cc: linux@lists.openrisc.net --- arch/openrisc/kernel/prom.c | 13 ------------- arch/openrisc/kernel/setup.c | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/arch/openrisc/kernel/prom.c b/arch/openrisc/kernel/prom.c index bf3fd05..3b94972 100644 --- a/arch/openrisc/kernel/prom.c +++ b/arch/openrisc/kernel/prom.c @@ -55,8 +55,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) void __init early_init_devtree(void *params) { - void *alloc; - /* Setup flat device-tree pointer */ initial_boot_params = params; @@ -72,17 +70,6 @@ void __init early_init_devtree(void *params) of_scan_flat_dt(early_init_dt_scan_memory, NULL); memblock_allow_resize(); - - /* We must copy the flattend device tree from init memory to regular - * memory because the device tree references the strings in it - * directly. - */ - - alloc = __va(memblock_alloc(initial_boot_params->totalsize, PAGE_SIZE)); - - memcpy(alloc, initial_boot_params, initial_boot_params->totalsize); - - initial_boot_params = alloc; } #ifdef CONFIG_BLK_DEV_INITRD diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index 719c5c8..09a769b 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -283,7 +283,7 @@ void __init setup_arch(char **cmdline_p) { unsigned long max_low_pfn; - unflatten_device_tree(); + unflatten_and_copy_device_tree(); setup_cpuinfo(); -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/