From patchwork Fri Aug 3 19:58:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 953371 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QTtJvJft"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41hyYq2WgGz9s89 for ; Sat, 4 Aug 2018 05:59:43 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id: References:In-Reply-To:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=TKDg0iH1baniLxA/rPRVqvHxlOPXr02cetev/7Ebbn0=; b=QTtJvJftj/r6qb8JeSXSz6t9g5 eqoreW0b4vCZDiymtrEddgvQTHpAFnx69KWPEZOsqCAzysp6XYA0p/VkyL9uqHHqBDpZeQbg2FFSt yJXHrCmTbaBq1hrnCfyvcYEoxhKcGrR5jRCbbxpQ4itFaLmmr7LWJUzZpI+bSjacHgTj9vMyeDB/B 3M0WXKhXEz/Fsx4FkqjXlCz7f3RlqEKrxJxhir6fGjnqwSVkQfQ6cj5mcMh1bnMzPjyDn7VHpd3ZW xBgOQLz7eZkXYJ431q0Kq1q3BrOj5+QMUoFyBo9xhF6QzTrclxb8wUwyxV9m8USUAoY8S3zrlSq2a tFmJWUlQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1flgEa-0006nk-JX; Fri, 03 Aug 2018 19:59:36 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1flgEX-0006bD-3W for linux-um@lists.infradead.org; Fri, 03 Aug 2018 19:59:34 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w73Jx5Iw186745 for ; Fri, 3 Aug 2018 15:59:10 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2kmt6sfp89-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 03 Aug 2018 15:59:10 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 3 Aug 2018 20:59:08 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 3 Aug 2018 20:59:05 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w73Jx4QH35389588 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 3 Aug 2018 19:59:04 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7D0A111C058; Fri, 3 Aug 2018 22:59:13 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5B24511C04A; Fri, 3 Aug 2018 22:59:11 +0100 (BST) Received: from rapoport-lnx (unknown [9.148.204.91]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 3 Aug 2018 22:59:11 +0100 (BST) Received: by rapoport-lnx (sSMTP sendmail emulation); Fri, 03 Aug 2018 22:59:01 +0300 From: Mike Rapoport To: Andrew Morton Subject: [PATCH 3/7] nios2: use generic early_init_dt_add_memory_arch Date: Fri, 3 Aug 2018 22:58:46 +0300 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com> References: <1533326330-31677-1-git-send-email-rppt@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18080319-4275-0000-0000-000002A367C7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080319-4276-0000-0000-000037AB8714 Message-Id: <1533326330-31677-4-git-send-email-rppt@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-08-03_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=881 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808030216 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180803_125933_264424_FA2B11F2 X-CRM114-Status: GOOD ( 19.98 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [148.163.158.5 listed in list.dnswl.org] X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mike Rapoport , linux-hexagon@vger.kernel.org, linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Michal Hocko , linux-mm@kvack.org, nios2-dev@lists.rocketboards.org, Richard Weinberger , Ley Foon Tan , Richard Kuo , Guan Xuetao MIME-Version: 1.0 Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org All we have to do is to enable memblock, the generic FDT code will take care of the rest. Signed-off-by: Mike Rapoport Acked-by: Ley Foon Tan --- 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;