Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1813089ybz; Sun, 26 Apr 2020 04:53:56 -0700 (PDT) X-Google-Smtp-Source: APiQypLCe9oqZakrRze7fUHoq9GAV2f5Ehu7jugKcnQW2hs2CTtXVkQX5P/zcHo4H3rDANDml25I X-Received: by 2002:a17:906:7717:: with SMTP id q23mr15380334ejm.38.1587902035748; Sun, 26 Apr 2020 04:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587902035; cv=none; d=google.com; s=arc-20160816; b=0TQZIo7jyW1YvRQpV1uZXWglMGjWncNKr3o3O4jP4LMS2I6YKBoZAzC0BDnDDOg5e3 Kcsyz4SaW72Z6itL2d+N/frjW9imTIMnf8JoZsjEVihTA2jQcNVO2j7PZPkSLoIw5nfk 07epGDbg5sx9dDVaSeXksWEY15bqYguSZH8exBt+nuHaPK7hHRmayI1yEjagqckrSgAG 4RtTKG2wWRMrvcoXMc3nr94ai8V/MfsMqY0lNq5FdQpleG+9ESjHgCIej35DybZOiHDm ixoDU7k+dOyU1KKRqSLAOUu/6+x3rNaO4h34cwO1SdjHic7ELVFasS8mg3k6ILLCpxOK 4tzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sxHEWzzqq/udh0f82jJClfo1pZF/pKBHXCyKtvA4nJ8=; b=cxsc6aCdCLc6kdPa4nm/aM3vtLA5WqkwF9tJvzqOhvfj5CTFE9r49dMf1xDxIx/uKh IXptrEHlgqsGziWp+5w/nDf/gndU0y4g+9AuwHcgxu9Od68kxm9vkfkIX++V1GAlslTa BxunoaV2ZNKRvzpqW/3F+nv7YKazWyTroiKw0HYlKx7QQ7Pq42YhdaAwohmg9WUqnLKz Sx0y7O3VkDWkFjtaLmmZ3HvUX7X0Rm96QohtCxnZp8AZ0uIxsgSYX78QBRMhUireEvN5 B+Zwt+QqwkgVCOqfi4pQ9SLhe6EFL3RH8UivALSe6m6ZiskOQ1IopZLWkh6kQVaPIpxl RP/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=nq2CSnz9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t13si6192070eds.358.2020.04.26.04.53.33; Sun, 26 Apr 2020 04:53:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@flygoat.com header.s=vultr header.b=nq2CSnz9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726307AbgDZLup (ORCPT + 99 others); Sun, 26 Apr 2020 07:50:45 -0400 Received: from vultr.net.flygoat.com ([149.28.68.211]:59902 "EHLO vultr.net.flygoat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbgDZLup (ORCPT ); Sun, 26 Apr 2020 07:50:45 -0400 Received: from localhost.localdomain (unknown [IPv6:2001:da8:20f:4430:250:56ff:fe9a:7470]) by vultr.net.flygoat.com (Postfix) with ESMTPSA id 0925920CE5; Sun, 26 Apr 2020 11:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=flygoat.com; s=vultr; t=1587901844; bh=JH5fmaVAU3zVjpRZJe3S98l22Af+YjDXkuSE9/t9KHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nq2CSnz9kzmXuDisFD3lv+o6xbKbvM5qsWLOTHxUqlSVbcVga3JA5BWa90lENTLX5 0NNMV0r4glJaZwe6HfhvoJmANWGj7mkMxYd/BVxNTTG5aRqgcJyW5/PnM65YZo8/AD girea5tWjHOO8+WrvZN8O6nxPlzubhy/LQy7zFrXBcOx4VBKegCfQnP1yY1U+lVy3d tmj4G6COah4gLB21nb0kNUBONrKXn3yJfhsh2vYnnMyikH+jgDHWtvzqqM1XUGkHyh BSWrtY0fkbYhtw53WuBPTZg6aynxb833bt+/t+LWWRNMMm8UuwZtk9HVh5lBY4zTO8 ftWbszQZBm4MQ== From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: Jiaxun Yang , Thomas Bogendoerfer , Huacai Chen , Paul Burton , Thomas Gleixner , Stephen Kitt , Nick Desaulniers , Serge Semin , Anshuman Khandual , Geert Uytterhoeven , Andrew Morton , Daniel Silsby , Mike Rapoport , Paul Cercueil , Mark Tomlinson , Greg Kroah-Hartman , Allison Randal , Tiezhu Yang , John Garry , Wei Xu , linux-kernel@vger.kernel.org Subject: [PATCH 3/4] lib: logic_pio: Introduce MMIO_LOWER_RESERVED Date: Sun, 26 Apr 2020 19:47:36 +0800 Message-Id: <20200426114806.1176629-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.26.0.rc2 In-Reply-To: <20200426114806.1176629-1-jiaxun.yang@flygoat.com> References: <20200426114806.1176629-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org That would allow platforms reserve some lower address in PIO MMIO range to deal with legacy drivers with hardcoded I/O ports that can't be managed by logic_pio. Signed-off-by: Jiaxun Yang --- lib/logic_pio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/logic_pio.c b/lib/logic_pio.c index f511a99bb389..57fff1cb7063 100644 --- a/lib/logic_pio.c +++ b/lib/logic_pio.c @@ -20,6 +20,10 @@ static LIST_HEAD(io_range_list); static DEFINE_MUTEX(io_range_mutex); +#ifndef MMIO_LOWER_RESERVED +#define MMIO_LOWER_RESERVED 0 +#endif + /* Consider a kernel general helper for this */ #define in_range(b, first, len) ((b) >= (first) && (b) < (first) + (len)) @@ -36,7 +40,7 @@ int logic_pio_register_range(struct logic_pio_hwaddr *new_range) struct logic_pio_hwaddr *range; resource_size_t start; resource_size_t end; - resource_size_t mmio_end = 0; + resource_size_t mmio_end = MMIO_LOWER_RESERVED; resource_size_t iio_sz = MMIO_UPPER_LIMIT; int ret = 0; -- 2.26.0.rc2