Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1762700imm; Thu, 2 Aug 2018 00:07:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd15/ei+1WNdqlpExMxXQnA88/qZUyi+sbf1ALdKsV28+I8tu/QyeDKS9pUJY81dFcoYKar X-Received: by 2002:a63:2263:: with SMTP id t35-v6mr1492952pgm.272.1533193657105; Thu, 02 Aug 2018 00:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533193657; cv=none; d=google.com; s=arc-20160816; b=pKBBnn71wsgECLF742JjUxapZpO5obSOYVM//jLnj7KgVuuXEbUL+XRCo1L60CmU/m q7lMxbGK2f7ZYNbL5AGMtcX/rs4Pdf9J6fsJG8gAfxhnsX1ZHHmt3RP/mZa3L0HyfO06 qExrg2BJGz7Ip/93KTnDy/a9c0VXZpvBiH1u3Aq9uTUE69NZ0oUDjBx18S1/JsXOiX7i BMw/hrZTAZFiQCAcL5Nvx6JE1i4LxFd10Afwv4NscwH3yPDX8zrpCfKlHcWf2RWmf2qa Yi565o9EckHONer2xj9R3BN5EWts/CD8EgD4woLY36oqL9wYthWpUG0QuiFha5G+HvMp Od1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=qzNflDFYf0r2r5nheJoY6LPw2lyHN5jHHwRwlb3A6Fc=; b=PF4go+VpurPu8SzLO75mrflrbaXhFPz6AEagsVJ96uV1KPkwYO0Q+emyJay+PYC7u7 od+p1ln+AMsZJPNnwLDiMKbYGTmYHgL+3pVOYSnnvpAhmuUby8hC+omlk/nGxy+3IIf1 WYrF/ZWIAT1GeEJ4fXe6A6/XcY90Z/wg5sjOgMcC9oWcN+sObYn+1+NahWAMn8/t2XrV +YLdSUJpYbv0mz7Ddx5UkD6FDg8SvoIVeKbaKR6QAisHBaC5Me3Vxp2cyN4Ovb95h/KF gWe6HR1sag9wNk8IKCEOWu0AGdkHKtkpg5InmxqpdrrfnCF9ysA1VILnFuXpvFOCzrZm Dvkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 80-v6si1400837pgf.604.2018.08.02.00.07.23; Thu, 02 Aug 2018 00:07:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729764AbeHBI4J convert rfc822-to-8bit (ORCPT + 99 others); Thu, 2 Aug 2018 04:56:09 -0400 Received: from mga04.intel.com ([192.55.52.120]:56504 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726141AbeHBI4J (ORCPT ); Thu, 2 Aug 2018 04:56:09 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2018 00:06:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,434,1526367600"; d="scan'208";a="78047251" Received: from lftan-mobl.gar.corp.intel.com (HELO ubuntu) ([10.226.250.45]) by orsmga001.jf.intel.com with SMTP; 02 Aug 2018 00:06:21 -0700 Received: by ubuntu (sSMTP sendmail emulation); Thu, 02 Aug 2018 15:06:20 +0800 Message-ID: <1533193580.23760.1.camel@intel.com> Subject: Re: [PATCH 2/3] nios2: use generic early_init_dt_add_memory_arch From: Ley Foon Tan To: Mike Rapoport , Ley Foon Tan Cc: Rob Herring , Frank Rowand , Michal Hocko , nios2-dev@lists.rocketboards.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Thu, 02 Aug 2018 15:06:20 +0800 In-Reply-To: <1530710295-10774-3-git-send-email-rppt@linux.vnet.ibm.com> References: <1530710295-10774-1-git-send-email-rppt@linux.vnet.ibm.com> <1530710295-10774-3-git-send-email-rppt@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Evolution 3.18.5.2-0ubuntu3.1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-07-04 at 16:18 +0300, Mike Rapoport wrote: > All we have to do is to enable memblock, the generic FDT code will > take > care of the rest. > > Signed-off-by: Mike Rapoport > --- >  arch/nios2/Kconfig        |  1 + >  arch/nios2/kernel/prom.c  | 10 ---------- >  arch/nios2/kernel/setup.c |  2 ++ >  3 files changed, 3 insertions(+), 10 deletions(-) > > diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig > index 3d4ec88..5db8fa1 100644 > --- a/arch/nios2/Kconfig > +++ b/arch/nios2/Kconfig > @@ -19,6 +19,7 @@ config NIOS2 >         select SPARSE_IRQ >         select USB_ARCH_HAS_HCD if USB_SUPPORT >         select CPU_NO_EFFICIENT_FFS > +       select HAVE_MEMBLOCK > >  config GENERIC_CSUM >         def_bool y > diff --git a/arch/nios2/kernel/prom.c b/arch/nios2/kernel/prom.c > index 8d7446a..ba96a49 100644 > --- a/arch/nios2/kernel/prom.c > +++ b/arch/nios2/kernel/prom.c > @@ -32,16 +32,6 @@ > >  #include > > -void __init early_init_dt_add_memory_arch(u64 base, u64 size) > -{ > -       u64 kernel_start = (u64)virt_to_phys(_text); > - > -       if (!memory_size && > -           (kernel_start >= base) && (kernel_start < (base + size))) > -               memory_size = size; > - > -} > - >  int __init early_init_dt_reserve_memory_arch(phys_addr_t base, > phys_addr_t size, >                                              bool nomap) >  { > diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c > index 926a02b..0946840 100644 > --- a/arch/nios2/kernel/setup.c > +++ b/arch/nios2/kernel/setup.c > @@ -17,6 +17,7 @@ >  #include >  #include >  #include > +#include >  #include >  #include >  #include > @@ -147,6 +148,7 @@ void __init setup_arch(char **cmdline_p) > >         console_verbose(); > > +       memory_size = memblock_phys_mem_size(); >         memory_start = PAGE_ALIGN((unsigned long)__pa(_end)); >         memory_end = (unsigned long) CONFIG_NIOS2_MEM_BASE + > memory_size; > > -- Acked-by: Ley Foon Tan