From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Date: Sun, 12 Jun 2016 11:29:42 +0000 Subject: Re: [PATCH v2 01/17] sh: Add sh-specific early_init_dt_reserve_memory_arch Message-Id: List-Id: References: <1465714475-24111-1-git-send-email-ysato@users.sourceforge.jp> <1465714475-24111-2-git-send-email-ysato@users.sourceforge.jp> In-Reply-To: <1465714475-24111-2-git-send-email-ysato@users.sourceforge.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Yoshinori Sato , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org On 6/12/2016 9:54 AM, Yoshinori Sato wrote: > sh used P1 address space in early device tree. > So need convert P1 to physical address before reserve memory. > > Signed-off-by: Yoshinori Sato > --- > arch/sh/boards/of-generic.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c > index 57d45dc..fe2d917 100644 > --- a/arch/sh/boards/of-generic.c > +++ b/arch/sh/boards/of-generic.c [...] > @@ -203,3 +204,14 @@ static int __init sh_of_device_init(void) > return 0; > } > arch_initcall_sync(sh_of_device_init); > + > +int __init early_init_dt_reserve_memory_arch(phys_addr_t base, > + phys_addr_t size, bool nomap) > +{ > + if (nomap) > + return memblock_remove(base, size); > + > + if (base >= P1SEG) > + base = base & ~P1SEG; base &= ~P1SEG; > + return memblock_reserve(base, size); > +} MBR, Sergei From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753506AbcFLL3p (ORCPT ); Sun, 12 Jun 2016 07:29:45 -0400 Received: from mail-lf0-f51.google.com ([209.85.215.51]:34099 "EHLO mail-lf0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751843AbcFLL3n (ORCPT ); Sun, 12 Jun 2016 07:29:43 -0400 Subject: Re: [PATCH v2 01/17] sh: Add sh-specific early_init_dt_reserve_memory_arch To: Yoshinori Sato , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org References: <1465714475-24111-1-git-send-email-ysato@users.sourceforge.jp> <1465714475-24111-2-git-send-email-ysato@users.sourceforge.jp> From: Sergei Shtylyov Message-ID: Date: Sun, 12 Jun 2016 14:29:42 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1465714475-24111-2-git-send-email-ysato@users.sourceforge.jp> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/12/2016 9:54 AM, Yoshinori Sato wrote: > sh used P1 address space in early device tree. > So need convert P1 to physical address before reserve memory. > > Signed-off-by: Yoshinori Sato > --- > arch/sh/boards/of-generic.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c > index 57d45dc..fe2d917 100644 > --- a/arch/sh/boards/of-generic.c > +++ b/arch/sh/boards/of-generic.c [...] > @@ -203,3 +204,14 @@ static int __init sh_of_device_init(void) > return 0; > } > arch_initcall_sync(sh_of_device_init); > + > +int __init early_init_dt_reserve_memory_arch(phys_addr_t base, > + phys_addr_t size, bool nomap) > +{ > + if (nomap) > + return memblock_remove(base, size); > + > + if (base >= P1SEG) > + base = base & ~P1SEG; base &= ~P1SEG; > + return memblock_reserve(base, size); > +} MBR, Sergei