以首次调测为例,操作步骤如下。
su - root
cd /opt
tar -xzvf Ascend310B-source.tar.gz
cd Ascend310B-source
例如用户整机的boardid为33150,故dts文件名称为“hi1910B-asic-M150-B33.dts”。
cd product
文件内容如下。
spi0@82020000 { compatible = "hisilicon,udrv_spi"; #address-cells = <1>; #size-cells = <0>; num-cs = <1>; /* 支持cs片选个数量 */ bus-num = <0>; /* spi控制器id */ clk-freq = <150000000>; /* 时钟频率 */ reg = <0x0 0x82020000 0 0x10000>; interrupts = <0x0 161 0x4>; cs@0 { compatible = "rohm,dh2228fv"; reg = <0>; /* cs片选id */ spi-max-frequency = <25000000>; }; }; spi1@82030000 { compatible = "hisilicon,udrv_spi"; #address-cells = <1>; #size-cells = <0>; num-cs = <1>; /* 支持cs片选个数量 */ bus-num = <1>; /* spi控制器id */ clk-freq = <150000000>; /* 时钟频率 */ reg = <0x0 0x82030000 0 0x10000>; interrupts = <0x0 162 0x4>; cs@0 { compatible = "rohm,dh2228fv"; reg = <0>; /* cs片选id */ spi-max-frequency = <25000000>; }; }; spi3@3001B0000 { compatible = "hisilicon,udrv_spi"; #address-cells = <1>; #size-cells = <0>; num-cs = <1>; /* 支持cs片选个数量 */ bus-num = <3>; /* spi控制器id */ clk-freq = <150000000>; /* 时钟频率 */ reg = <0x3 0x1B0000 0 0x10000>; interrupts = <0x0 251 0x4>; // To enable the SPI function, uncomment the following two lines and comment the pinctrl configuration of the I2C 0 1 // pinctrl-names = "default"; // pinctrl-0 = <&iomg000_pmx_func &iomg001_pmx_func &iomg002_pmx_func &iomg003_pmx_func>; cs@0 { compatible = "rohm,dh2228fv"; reg = <0>; /* cs片选id */ spi-max-frequency = <25000000>; }; };
spi0@82020000 { compatible = "hisilicon,udrv_spi"; #address-cells = <1>; #size-cells = <0>; num-cs = <1>; /* 支持cs片选个数量 */ bus-num = <0>; /* spi控制器id */ clk-freq = <150000000>; /* 时钟频率 */ reg = <0x0 0x82020000 0 0x10000>; interrupts = <0x0 161 0x4>; cs@0 { compatible = "rohm,dh2228fv"; reg = <0>; /* cs片选id */ spi-max-frequency = <25000000>; }; };
/include/ "product/hi1910B-spi-Mxxx-Bxx.dtsi"
示例:
/include/ "product/hi1910B-spi-M150-B33.dtsi"