Linux: device tree to acpi driver

孤者浪人 提交于 2021-02-11 15:28:56

问题


I need help on this, my driver already work on device tree mode, and I want support acpi mode for it, I'm stuck on create partitions:

Device Tree:

&spi0 {
status = "ok";

flash: n25q256a@0 {
status = "ok";
cell-index = <0>;
#address-cells = <1>;
#size-cells = <1>;
    compatible = "n25q256a";
    reg = <0>;
    spi-max-frequency = <15000000>;
    spi-cpha;
    spi-cpol;

    partition@0x00000000 {
        label = "Boot loader";
        reg = <0x00000000 0x01000000>;
    };
    partition@0x01000000 {
            label = "n25q256a-test";
            reg = <0x01000000 0x01000000>;
    };
    partition@0x01100000 {
            label = "n25q256a-data";
            reg = <0x01100000 0x00f00000>;
    };
  };
};

Below is acpi table:

        Device (N25P){      
            Name (_ADR, 1)
            Name (_CID, "N25Q256A")
            Name (_CRS, ResourceTemplate (){
                SPISerialBus(
                    0,          //Slave select CS0 (_ADR)
                    PolarityLow,        //Polarity of CS0 output(_DPL)
                    FourWireMode,       //(_MOD)
                    8,          //8-bit frame(_LEN)
                    ControllerInitiated,    //(_SLV)
                    15000000,       //Speed Hz (_SPE)
                    ClockPolarityHigh,  //(_POL)
                    ClockPhaseSecond,   //(_PHA)
                    "\\_SB.AHBC.SPI0",          //Controller
                )

            })
        //============ Partitons =========
        }

回答1:


X86 supports ACPI Model, where as ARM, POWERPC supports dts, if you are trying to use your driver for x86, then where exactly you are trying to load this ACPI table ??. From driver perspective similar to "of_match_table" for dts, there will be "acpi_match_table" for ACPI Model



来源:https://stackoverflow.com/questions/31875450/linux-device-tree-to-acpi-driver

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!