In a Linux system, Iomem_resource information is exported to/proc/iomem.

Source: Internet
Author: User


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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.