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: 10555467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A21B13AC for ; Fri, 3 Aug 2018 19:59:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 084C42C165 for ; Fri, 3 Aug 2018 19:59:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF4CD2C245; Fri, 3 Aug 2018 19:59:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A65B2C1DE for ; Fri, 3 Aug 2018 19:59:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7916A6B0007; Fri, 3 Aug 2018 15:59:12 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 741D86B0008; Fri, 3 Aug 2018 15:59:12 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6094F6B000A; Fri, 3 Aug 2018 15:59:12 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi0-f69.google.com (mail-oi0-f69.google.com [209.85.218.69]) by kanga.kvack.org (Postfix) with ESMTP id 368D96B0007 for ; Fri, 3 Aug 2018 15:59:12 -0400 (EDT) Received: by mail-oi0-f69.google.com with SMTP id j189-v6so5559395oih.11 for ; Fri, 03 Aug 2018 12:59:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:in-reply-to:references:message-id; bh=oKGwGTmaFvvkhJrj3GYMPQQvSbRfN00IUEp+oz3MTpo=; b=XYRD4eXQqpvDhM0ZMvRVZ5a98E7pqQ2g+eJWnb1LlrW3IlRqriIXkDCXf3p/QqQ9OI K0bHOplhxe6CJXWaj4dJeBtZrs1UMPEFwM/EAaklWIgSdSf/IJNhVY6AqJ8ZvIN2bgA4 NU0KZgCKRHTiTZ1Zz/jG0j8QwlHF6GK1TlhuUPC/8tDlK4xqTUB5YYmowjmqpli2zCvp RfNYpSPpo6z9TM68fUB2WEIbssTzGvCNZ8iZu0RHZtQ0JnFuEy+fHOMrYbWb59nbWJrX weuU4CKN56Qxki+din5mDWvqX6iEyTWC6j/9EeMt170V/ZH0uuYCa6ZWW/JmTgMCntD9 lojA== X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AOUpUlF0d2kime872T6FnacC9NxAC4uKszwkFB0LCaGYJ6wpTTmOCGaO r+7kdHPO8F/8rShoXzqzAiEEwtaXWXLBaZmmLuVsDkFxyu1kHwCAr1V6AhvmRA262RVfsYWU8sK oAzGf7Z4gH7/PrhtWcinUz8SYikEFhIaE3Lkj/o1aEYlkuZwtRhfqoLT74UzAYks= X-Received: by 2002:aca:b9c2:: with SMTP id j185-v6mr4377566oif.212.1533326351962; Fri, 03 Aug 2018 12:59:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpflmbZkiJkW6pev2bAyGFl15MPLZppOpSHeA+n/J1EJod39Pd2cav60vrNa+cDkJGE+LYZd X-Received: by 2002:aca:b9c2:: with SMTP id j185-v6mr4377503oif.212.1533326350850; Fri, 03 Aug 2018 12:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533326350; cv=none; d=google.com; s=arc-20160816; b=qh040AN3kMdB4U3QVhZl0ba3+CBLV2JO71ZQc5oIrYCUqdnv7NgMP2vMNphAei32JN zRg7NFHe3ClsVXoIDiUN7r1LB4V1TspmFZRMP+C0MXXYPcRlgBQsrg8OGfT+j8pzDMBa zDx5+3kOjDK8o1KEe4QxhykGKliHLibtPiN7RT9gwM7X9EL+aQNBx3ACcxCH4bfVjrUp PcKhFKWWTleHwi7ro3ioVSxkrFRyFFiYcejcUl7eYGQLEd2YF0krGnHXsosxX9Tg21yv ukq3aM2q+kQWsHdkUQ336B3T9DoGGbE58cbpma4jyOo7ebE80QN66HWFXmOyaPoL1yhy edLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=oKGwGTmaFvvkhJrj3GYMPQQvSbRfN00IUEp+oz3MTpo=; b=j3zegMG37Fv+8V2ruxMBgLCpPE7knltr4CAGuWK81Ydhnr9uwBmXgAA2gCr5Krzz/A 9fg6Rw8MAoFvbYxCSGCuIKN/DtL9KtiHWK1foI9NFh3VKCFyZVtDbJPO04rZHFjU28rV 6eVL3WOjl0CCz4HGwr5bSThN7C+nlOGRAPLvH1j68tQmFOPq6gkq+/IZ4nbhJakoobBo E4kyV2tbksWAJ0n7TnoDScTfxdAzUlNxUwuYLYiM33aKKq5SilSYwEzLoBonjG4PgZVP e+mW/G3sSIq5BjjC8H7UHUbv6ejgiMYiqpnaPjdPdAES4i0rZ7HAX4OFOykit9V3nyUn eSWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com. [148.163.158.5]) by mx.google.com with ESMTPS id x16-v6si3579000oie.224.2018.08.03.12.59.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Aug 2018 12:59:10 -0700 (PDT) Received-SPF: neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) client-ip=148.163.158.5; Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of rppt@linux.vnet.ibm.com) smtp.mailfrom=rppt@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w73Jx5v9026213 for ; Fri, 3 Aug 2018 15:59:10 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kmuj3mmfw-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 03 Aug 2018 15:59:09 -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 Cc: Richard Kuo , Ley Foon Tan , Richard Weinberger , Guan Xuetao , Michal Hocko , linux-hexagon@vger.kernel.org, nios2-dev@lists.rocketboards.org, linux-um@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport 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=886 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808030216 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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;