Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1633346pxb; Fri, 18 Feb 2022 11:54:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfih82c8SbPhX0jd4Ma8V7+W6RpL/4zcAPFFXsuHE0/ZJDfi0c8t5f8ra+MWk5qeWr5f4y X-Received: by 2002:a17:907:20d2:b0:6b5:1bad:89f2 with SMTP id qq18-20020a17090720d200b006b51bad89f2mr7445849ejb.331.1645214043634; Fri, 18 Feb 2022 11:54:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645214043; cv=none; d=google.com; s=arc-20160816; b=MCqyh/nIt9kUHBKhsiVxYORfSUw1NXQbP7sNQNtTK312VR9FHzwQ3kp7GM3WLPhsro 4cMRjPAQOA0jH/Fs6wzV9mNksz9hsxJJTSMvUas8PW3p165Ff7RTTscfn9c7j5egIIyp xVosgzQsX9oYSlOFGhoscMq98WQdj5/3IpABGdUIh+GjNjxM0atIh8APyRgo1OwR/Vfr YllmCIeUhczDznW+kZSI+I0xegypx/cl/LV7kpmmpRRepI+6Guk2WdxPMUorrpf5WTWJ mh+d99xY2T+gT6nQRdpuInToc4q97KUj2ve5vgPNxRETwWVBcxmxiiTaf7CivL9z7L9q Ql8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6DBaI+P9EqH9fd9QLZxnBnpM37Fed9sWGaXbPIsiW94=; b=o7OtgEl+EmRXE6lQlkp5EIB0looMvJNVLqA2ryRG/JpVGHrzcnUBToYrER5DLZrfA9 8AeUEwBVujZLQvmB4cOzP7OzY3H2Gwysgq8mfxkAeYtwmuXfNWM51G+m+eEJfvue0W3f OsGthVo2AYgPWgnesK5dNAM/9d1OugBYL/4969NKU906Xk28Vjuh/Y8DRY6Z3uW4BkyU OJVTkaR1/p49ia3jei6G1riWs6iHw57kpQFprFvqBJgptNEcERx1swYb/SyyR3+alnhW Du9ej1UAnBL7ei2o+WEcCieMGDkDLC+1jvN7mMy0oXLvBqdaq7H/L7FS09pcU3Jtl7kS N9zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F9UlKsli; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ee45si6664438edb.38.2022.02.18.11.53.41; Fri, 18 Feb 2022 11:54:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F9UlKsli; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238534AbiBRR1M (ORCPT + 99 others); Fri, 18 Feb 2022 12:27:12 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238539AbiBRR1I (ORCPT ); Fri, 18 Feb 2022 12:27:08 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F75BFD24; Fri, 18 Feb 2022 09:26:49 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 13B6C61FDA; Fri, 18 Feb 2022 17:26:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C8E3C340E9; Fri, 18 Feb 2022 17:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645205208; bh=+CsiT9aObl7pRKrN4X1EFOMytJanhfZAOxH4JPRCsTo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F9UlKsliY/spNXDMb9Kj4P4u/GB/CpjBzHNbnKjEW/u/ubgMEzvjrQlrTumw7Ru95 eof51FLbxL8TH6iTBka0XtevRpu1JOGtf9y2waX4StQ+7rDbtOSBTze9BYG+oeolNk bH8Bl+LybFkNpCs54CPMQlWomqAd09kwobHreRMMYZ2muOGVJJphuzVpIIHwY1ysnN 4QCAcibihVYvnA5b0lLN9osvPNHoINiH8VBHovWRBsCxjmGLyyfxKDIEIr2rM6CwgO r2gjt3dnSK7YNuuiG5Kpz6oKkqDy4xhqSd5TPqRO4ux2hIW0ghbyUmu0uVu4JaaYic aizOFdzUp63GQ== Received: by pali.im (Postfix) id A0DE32BAE; Fri, 18 Feb 2022 18:26:45 +0100 (CET) Date: Fri, 18 Feb 2022 18:26:45 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Arnd Bergmann Cc: Gregory Clement , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Marek =?utf-8?B?QmVow7pu?= , Linux ARM , DTML , Linux Kernel Mailing List Subject: Re: [PATCH] arm64: dts: marvell: armada-37xx: Increase PCIe IO size from 64 KiB to 1 MiB Message-ID: <20220218172645.rfp3526mp3zp4yzm@pali> References: <20220113170755.11856-1-pali@kernel.org> <20220218165530.j62nafuofe342sfi@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 18 February 2022 18:19:57 Arnd Bergmann wrote: > On Fri, Feb 18, 2022 at 5:55 PM Pali Rohár wrote: > > On Friday 18 February 2022 17:43:04 Arnd Bergmann wrote: > > > On Thu, Jan 13, 2022 at 6:07 PM Pali Rohár wrote: > > > > > > > > Commit 514ef1e62d65 ("arm64: dts: marvell: armada-37xx: Extend PCIe MEM > > > > space") increased size of PCIe MEM to 127 MiB, which is the maximal > > > > possible size for allocated 128 MiB PCIe window. PCIe IO size in that > > > > commit was unchanged. > > > > > > > > Armada 3720 PCIe controller supports 32-bit IO space mapping so it is > > > > possible to assign more than 64 KiB if address space for IO. > > > > > > > > Currently controller has assigned 127 MiB + 64 KiB memory and therefore > > > > there is 960 KiB of unused memory. So assign it to IO space by increasing > > > > IO window from 64 KiB to 1 MiB. > > > > > > > > DTS file armada-3720-turris-mox.dts already uses whole 128 MiB space, so > > > > only update comment about 32-bit IO space mapping. > > > > > > > > Signed-off-by: Pali Rohár > > > > Fixes: 514ef1e62d65 ("arm64: dts: marvell: armada-37xx: Extend PCIe MEM space") > > > > > > I just saw this is the fixes pull request, and it seems very odd. Does this > > > fix an actual bug? > > > > Do you mean this patch or commit 514ef1e62d65? > > This one. 514ef1e62d65 looks fine. Well, this patch just increase size of IO window, nothing more. What what is wrong with this patch if is just moves end of the window? > > > Note that Linux normally doesn't map more than 64KB > > > of I/O space per PCI domain, so it should not make a difference to us. > > > > Last time I looked into ARM code, it can allocate more than 64 kB for IO. > > > > > > Also, note that having a high bus address for the I/O space (0xefff0000, > > > as as the CPU physical address here) means that a lot of the older > > > devices that actually require I/O space won't work, because they need a > > > low bus address in the first few KB. > > > > > > Is this mapping a requirement from a broken bootloader, or can you change > > > the mapping of the I/O port window in the physical space to the usual > > > bus address 0? > > > > At physical address 0x0 it is not possible as at this address is mapped > > DDR. > > I meant bus address 0, not CPU physical address 0 of course. We don't > care where in physical space the I/O window is. Currently all mapping between CPU and PCIe is 1:1. There are registers for adding remapping, but nobody played with it yet. And it needs to be done again in TF-A (or probably in U-Boot could be too). > > ARM Trusted-Firmware sets PCIe space to range [0xe8000000-0xf0000000]. > > This (default) configuration is specified in DTS file. Which parts of > > this range is used for IO and which MEM is up to the a3720 PCIe kernel > > driver and currently it configures it based on how sub-ranges are > > specified in DT. > > > > In some cases (e.g. when board has 4 GB of RAM), TF-A relocates this > > PCIe range to different location (otherwise it cannot activate more than > > 2 GB of RAM) and U-Boot during loading of kernel DTB file, is patching > > it. > > > > It could be possible to change TF-A code to move PCIe space to different > > location (from [0xe8000000-0xf0000000]) but not to 0x0. But changing it > > means to move other parts and invent mapping in which most of RAM can be > > mapped to... > > Can't you change the mapping to have a bus address that is different > the physical address? > > Arnd That could be possible, need to investigate... but I think it would be done in bootloader and then by patching DTB file on the fly.