We take the high-pass IPQ4019 chip as an example to illustrate
Step1 the situation of Iomem_resource in/proc/iomem
[[Email protected]:~]# Cat/proc/iomem
060f8800-060f88ff:qscratch_base
The 078AF000-078AF1FF:MSM_SERIAL_HSL//step1 78af000 is the physical address of the serial port on the SOC. See the device information below
078b5000-078b55ff:spi_qsd
....
88000000-8fffffff:system RAM//This is the physical address of the memory.
Step2 from the/sys information about device registration
[Email protected]:d evices]# pwd
/sys/bus/platform/devices
[[email protected]:d evices]# ls
....
60F8800.USB2 pmu.4
78af000.serialqca,scm_restart_reason.5//Step 2 This 78af000 is from the device tree.
78b5000.spi qcom,sps.2
Step 3 Learn about the serial port information in the device tree source file
See: Qca/src/linux/arch/arm/boot/dts/qcom-ipq40xx.dtsi 734
[Email protected] {
compatible = "qcom,msm-uartdm-v1.4", "QCOM,MSM-UARTDM";
Reg = <0x78af000 0x200>; Reg represents the address space for this device. You can use this address to access the device's registers, and so on.
Interrupts = <0 107 0>;
Status = "Disabled";
clocks = <&GCC Gcc_blsp1_uart1_apps_clk>
<&GCC gcc_blsp1_ahb_clk>;
Clock-names = "core", "Iface";
};
Step4 Serial port driver is how to enter the registration of Iomem_reserouce
Msm_serial_hs_lite.c
Msm_hsl_request_port function
{
Request_mem_region ()//register the resources with the iomem_reserouce. And check if this resource is being used by someone else.
Resource = Platform_get_resource (Pdev, Ioresource_mem, 0); Get IO resources from plateform devices
Uport->membase = Ioremap (uport->mapbase,//use Ioremap to map again.
Resource_size (Resource));
}
In a Linux system, Iomem_resource information is exported to/proc/iomem.