PCI parse MEM/IO range in _CRS in ACPI table
来源:互联网 发布:傲剑金蛇数据 编辑:程序博客网 时间:2024/05/17 23:50
PCI parse MEM/IO range in _CRS in ACPI table
-v0.1 2016.12.27 Sherlock init
Linux PCI code parses MEM/IO range, which are described in _CRS method in ACPI
DSDT table. This document tries to share an analysis about this part of code.
pci_acpi_scan_root(struct acpi_pci_root *root) --> root_ops->prepare_resources = pci_acpi_root_prepare_resources --> acpi_pci_root_create ... --> ops->prepare_resources(info) ...pci_acpi_root_prepare_resources --> acpi_pci_probe_root_resources(ci) ... /* this is the key function */ --> acpi_dev_get_resources .../* will analyze acpi_dev_get_resources below */acpi_dev_get_resources(device, list, acpi_dev_filter_resource_type_cb, (void *)flags); --> c.list = list; c.preproc = preproc; /* acpi_dev_filter_resource_type_cb */ c.preproc_data = preproc_data; /* (void *)flags */ c.count = 0; c.error = 0; /* * will parse _CRS method for above device, acpi_walk_resources is defined * in drivers/acpi/acpica/rsxface.c * * acpi_dev_process_resource will be called for every resources in _CRS, * it parses a resource and adds it into the list in c.list. * * this means e.g. if there are 3 MEM/IO range, acpi_dev_process_resource * will be called three times. */ --> acpi_walk_resources(adev->handle, METHOD_NAME__CRS, acpi_dev_process_resource, &c);/* details of acpi_dev_process_resource */static acpi_status acpi_dev_process_resource(struct acpi_resource *ares, void *context) /* filter the resource type to some kinds */ --> c->preproc(ares, c->preproc_data) ... /* * still do not know the difference of below two functions, prefetchable * attribute will be parsed in acpi_decode_space function. */ --> acpi_dev_resource_memory(ares, res) --> acpi_dev_resource_address_space(ares, &win) --> acpi_decode_space --> if (addr->info.mem.caching == ACPI_PREFETCHABLE_MEMORY) ... /* add resource to list */ --> acpi_dev_new_resource_entry(&win, c) --> resource_list_add_tail(rentry, c->list);
Some ideas about PCI prefetch window and memory type/attribute of AMRv8[1]
PCI prefetch and memory type/attribute has no relationship with each other,
as PCI prefetch is an attribute in PCI domain, and memory type/attribute is for
ARM bus domain. Further more, ATU(address translate unit: translate a CPU address
to PCI address) only translate address, do nothing about prefetch support.
Generally, when we get cpu physical address(PA) for a BAR, PCI device driver will
use ioremap(or other ioremap_*) to get a VA. memory type/attribute will be set
to MMU in ioremap kind of functions to support memory operations in ARM bus domain.
For ECAM, we use below work flow to get VA of ECAM, we can see nGnRE will be
set for ECAM memory type/attribute.
/* will ioremap ECAM in below ioremap using nGnRE */pci_acpi_scan_root --> pci_acpi_scan_root --> pci_ecam_create --> cfg->win = ioremap
Reference:
[1] ARM Cortex-A Series Programmer’s Guide for ARMv8-A(13: Memory Ordering)
- PCI parse MEM/IO range in _CRS in ACPI table
- PCI MSI parse in ACPI
- PCI SMMU parse in ACPI
- PCIe INTx parse in ACPI
- acpi 表传递过来的_CRS
- parse in programming
- pci acpi note 2
- python for in range
- ip in ip-range
- Range Update and Range Queries in BIT
- ACPI & PCI 学习笔记 1
- invalid range in character class
- Ruby Range in Boolean expressions
- how to Register for Notification in ACPI | 如何注册一个ACPI 通知
- Temp Table in Oracle
- Delegates in table view
- Table in WPF
- ALTER TABLE in SQLite
- Fragment.setArguments()的初衷。
- Kettle安装部署
- Unity3D手游开发日记(1) - 移动平台实时阴影方案
- JDK、SDK、NDK、ADT 、ANT名词解释
- 17 - 01 - 16 计算机网络(06)(虚拟局域网)
- PCI parse MEM/IO range in _CRS in ACPI table
- JAVA_weB中的一些配置
- 数据结构实训之学生信息管理系统
- Java中分割字符串
- 54. Spiral Matrix
- CSS继承性及层叠性
- 1004. Counting Leaves (30)
- Spark1.3从创建到提交:5)Executor启动源码分析
- STL源码剖析——list容器的排序算法sort()