问题
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