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 49495C433F5 for ; Wed, 4 May 2022 09:02:18 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nmAtX-0002VH-PD; Wed, 04 May 2022 05:02:03 -0400 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.94.2) (envelope-from ) id 1nmAtU-0002Uk-Ct for kernelnewbies@kernelnewbies.org; Wed, 04 May 2022 05:02:01 -0400 Received: from unknown (HELO send001-relay.gov-dooray.com) (211.180.235.152) by 129.254.9.16 with ESMTP; 4 May 2022 18:01:51 +0900 X-Original-SENDERIP: 211.180.235.152 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 send001-relay.gov-dooray.com with SMTP id ced8f1fc627240ff; Wed, 04 May 2022 18:01:51 +0900 DKIM-Signature: a=rsa-sha256; b=FynxWQvxWaMhImEEckf1vSVmiJbe2XCTbxX21QISrjLyPkv7+z4JhNZ3EMvTTc9BN3UDUyobx8 sIGnmq/gFTb/2sU8AB/M8aer1noNiNY9Dmh40x9qDj6SNriaWl7aR5oD8hR4oMJUU6h7eJmxP8T1 ZYPLO0DZ54BiSOOR5dVkWbsvDHKNJlcrMzvMKs33VYkmgkyXIoiCMUM8Vaowgg2CACW/6qYREs5B 8WFYnTfqqN0Trd2NxEuJg8hzyDixwtmgV/as67wXNaY60WoaLd37EL2NiftR+Bnj9VYvq9zyWOCP InYuC9RXuhycDXirEsX4qPrs4AsGybWmsfUrpaHg==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=OIQE7RvIvNpTdzMjBsiZrgRbseKeXbyBZWRpVmXXhVc=; 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 0bcbad49627240ff; Wed, 04 May 2022 18:01:51 +0900 From: "Chan Kim" To: Subject: How is 'ranges' property of pci node of a device tree determined? Date: Wed, 4 May 2022 18:01:49 +0900 Message-ID: <069901d85f95$9774f520$c65edf60$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdhflJprvE5/PlThQ8WMehL0wko6mA== Content-Language: ko 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 all, I was reading https://elinux.org/Device_Tree_Usage#Ranges_.28Address_Translation.29 and have a question (I have read it in the past). In the device tree node for the PCI bridge, there is "ranges" property and this is to show the address mapping between PCI address and CPU physical address. And this seems to be the relationship between BARs and the CPU physical address and this is usually determined and set by the firmware before linux boots by filling in the BARs and setting the PCI bridge's address translation logic appropriately. So does this mean this pci node in the device tree is filled (or modified) by the firmware(BIOS) during initialization and passed to the OS? (I guess so). I know how the BIOS or firmware detects the address ranges's type (memory or IO, cachable, and size) from the initial BAR registers and fills them. I'd appreciate it if someone could confirm this. (and the dma-ranges property seems to be the relationship between PCI address and the host side memory address) Thank you! Chan Kim _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies