From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754390AbcGFOLy (ORCPT ); Wed, 6 Jul 2016 10:11:54 -0400 Received: from mail2.asahi-net.or.jp ([202.224.39.198]:9661 "EHLO mail2.asahi-net.or.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753605AbcGFOLw (ORCPT ); Wed, 6 Jul 2016 10:11:52 -0400 Date: Wed, 06 Jul 2016 23:11:44 +0900 Message-ID: <874m82n9en.wl-ysato@users.sourceforge.jp> From: Yoshinori Sato To: Rich Felker Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 04/22] sh: Use P1SEGADDR In-Reply-To: <20160704014852.GO15995@brightrain.aerifal.cx> References: <1467564402-2649-1-git-send-email-ysato@users.sourceforge.jp> <1467564402-2649-5-git-send-email-ysato@users.sourceforge.jp> <20160704014852.GO15995@brightrain.aerifal.cx> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.5 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 04 Jul 2016 10:48:52 +0900, Rich Felker wrote: > > On Mon, Jul 04, 2016 at 01:46:24AM +0900, Yoshinori Sato wrote: > > FDT address is P1SEG. So not virtual address. > > > > Signed-off-by: Yoshinori Sato > > --- > > arch/sh/kernel/setup.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c > > index 86f2792..8e3b099 100644 > > --- a/arch/sh/kernel/setup.c > > +++ b/arch/sh/kernel/setup.c > > @@ -254,7 +254,7 @@ void __ref sh_fdt_init(phys_addr_t dt_phys) > > #ifdef CONFIG_USE_BUILTIN_DTB > > dt_virt = __dtb_start; > > #else > > - dt_virt = phys_to_virt(dt_phys); > > + dt_virt = (void *)P1SEGADDR(dt_phys); > > #endif > > > > if (!dt_virt || !early_init_dt_scan(dt_virt)) { > > -- > > I don't think this change is correct, and I'm not sure what the > motivation is. It certainly can't work with !CONFIG_29BIT, and likely > can't work on nommu either (it won't work on J2). Maybe we have > different ideas about the sort of physical address the boot loader is > expected to pass; I would expect it to be something that, when passed > to phys_to_virt, yields an address the kernel can use to access the > memory. This does not necessarily mean it's MMU-mapped memory; it > could be (and in practice will be, I think) an address in the P1 > segment obtained by adding PAGE_OFFSET (see asm/page.h). > > Rich Hmm... It's better to pass a virtual address in bootloader. -- Yoshinori Sato