From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90AE1C4332F for ; Mon, 21 Nov 2022 13:16:07 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.96) (envelope-from ) id 1ox6eJ-00059V-2t; Mon, 21 Nov 2022 08:15:47 -0500 Received: from mscreen.etri.re.kr ([129.254.9.16]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (Exim 4.96) (envelope-from ) id 1ox6eG-00051P-11 for kernelnewbies@kernelnewbies.org; Mon, 21 Nov 2022 08:15:44 -0500 Received: from unknown (HELO send002-relay.gov-dooray.com) (211.180.235.153) by 129.254.9.16 with ESMTP; 21 Nov 2022 22:15:35 +0900 X-Original-SENDERIP: 211.180.235.153 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: kernelnewbies@kernelnewbies.org Received: from [10.162.225.106] (HELO smtp001-imp.gov-dooray.com) ([10.162.225.106]) by send002-relay.gov-dooray.com with SMTP id a20de1e7637b79f7; Mon, 21 Nov 2022 22:15:35 +0900 DKIM-Signature: a=rsa-sha256; b=d49tSFnmVnV1Bhj7GfIEHGwW9LqVHO65F2f+KYzL3V9+buRKRtLmkMhG3XVEOHyngsEgy6r1n4 oKRMAMgP7vUbkGKMf44mOLmSRgqTclJwZP9BL7FM+WB/lUPSnAK8AbtK72ZDeVJ9nADhvNrCpDnL mleUidD2vUQkXYpUdIqSZllt37G8kKikg0PVVYfH9/ISXWHE2aC7ksvqy4FD37SfzgWhzFhNq3M1 M/+orK/zBvXSjRm26TTVkS1avswhiKZDPJ+RgiCYaqn2IvF/C6gQoqSCmGTIS/FRVEgmVQry+aCQ NnLKnRm0anrp+ZlANGjJuLtCGX+YQt07pQwb9cww==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=QyCtb3zTM+NWjUCAzqehLZPgXF0Vq/r6jXwzNceLO2Q=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp001-imp.gov-dooray.com with SMTP id 3e051760637b79f7; Mon, 21 Nov 2022 22:15:35 +0900 From: "Chan Kim" To: Subject: What does OS do with the 'ranges' property in PCI RC node in the device tree? Date: Mon, 21 Nov 2022 22:15:34 +0900 Message-ID: <013d01d8fdab$56bbc1d0$04334570$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: ko Thread-Index: Adj9q1JPX8RTpcnHRoGOJ7+MwBDmQA== X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hello linux experts, I read https://elinux.org/Device_Tree_Usage, and it says about the "ranges" property in the PCIe Root Complex node, "The above ranges define how the CPU see the PCI memory, and helps the CPU to set up the right memory windows and write the right parameters into various PCI device registers. This is sometimes referred to as outbound memory." I know the 'ranges' property shows how the PCI devices's addresses are mapped to host CPU's addresses. The PCI devices are identified by the bus/device/function pair and the address is indicated the config/IO/memory32/memory64 types and start and length in the PCI bus. I understand that the BIOS or bootloader initializes PCI RC and does the enumeration and assigns the BAR registers so that the device's resources are mapped in host CPU's address space. And I guess the bootloader fixes the device tree (or ACPI table) by filling in the 'ranges' property. Is it correct? My another question is, what does the OS do with this 'ranges' information in the device tree? Of course the PCI device's driver uses BAR to get the physical address (seen from the host CPU) and by ioremap, it can access the devices memory and registers using virtual address. In the above link it says "The above ranges define how the CPU see the PCI memory, and helps the CPU to set up the right memory windows and write the right parameters into various PCI device registers. This is sometimes referred to as outbound memory." What does it mean? Does the OS do something with this 'ranges' value? I'll appreciated if someone could explain it to me. Thank you! Chan Kim _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies