Linux:设备树到acpi驱动程序

时间:2015-08-07 10:23:14

标签: tree device dts acpi

我需要帮助,我的驱动程序已经在设备树模式下工作,我想要支持acpi模式,我坚持创建分区:

设备树:

&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>;
    };
  };
};

以下是acpi表:

        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 个答案:

答案 0 :(得分:0)

X86支持ACPI模型,其中作为ARM,POWERPC支持dts,如果你试图将你的驱动程序用于x86,那么你究竟在哪里尝试加载这个ACPI表?从驱动程序角度来看,类似于dts的“of_match_table”,ACPI模型将有“acpi_match_table”