This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

使用官方sdk,内核下设备树执行不正确的问题



使用官方sdk,版本am437x-evm-linux-sdk-src-03.02.00.05。

硬件根据am437x-gp-evm设计,有部分修改。

移植过程中发现无论怎么改../dts文件夹下的设备树文件,Linux下外设没有任何变化,

怀疑uboot阶段虽然加载了.dtb文件但是内核并没有按加载的设备树执行。

做了个实验,验证:使用其他外设不同的板卡的uboot,加载内核现在板子的内核和设备树,内核初始化的时候外设与uboot里的一致(比如多了很多设备节点)。

证明了uboot虽然加载了设备树,但是Linux初始化的时候没有按.dtb文件执行。

请问有可能是哪个环节有问题了么,还是uboot下有些宏定义需要手动打开。

下面是uboot加载设备树时的打印

Running uenvcmd ...
** Bad device 0:2 0x82000000 **
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
4119048 bytes read in 501 ms (7.8 MiB/s)
46472 bytes read in 56 ms (809.6 KiB/s)
Kernel image @ 0x82000000 [ 0x000000 - 0x3eda08 ]
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8fff1000, end 8ffff587 ... OK

Starting kernel ...

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 3.12.10-ti2013.12.01 (jenkins@sdit-build02) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 Mon Jun 9 09:55:20 CDT 2014
[ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: Generic AM43 (Flattened Device Tree), model: TI AM437x gp EVM
[ 0.000000] cma: CMA: reserved 24 MiB at ae000000
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] AM437x ES1.0 (sgx neon )
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 259856
[ 0.000000] Kernel command line: console=ttyO0,115200n8 omapfb.mode=display0:480x272MR-32@60 tou

  • 请问是否有在uEnv.txt里修改dtb?
    http://processors.wiki.ti.com/index.php/How_to_Change_dtb_File

  • 不对,device tree 在 uboot和kernel 是两个独立的步骤,

    请问你修改了kernel 的device tree 的哪个地方那个文件呢?

  • 谢谢,问题找到了。

    之前用的其他家的开发板,虽然uboot版本是2013.10,但是从tf卡启动时文件一直加载的是uboot镜像目录下的内核和设备树,

    我自己做的板子,用ti官方的sdk,应该把内核放到根文件系统/boot下。

  • 请教另外问题

    目前使用官方sdk,版本am437x-evm-linux-sdk-src-03.02.00.05,内核版本是4.4.32,在添加qspi和spi设备,qspi只作为存储flash不用来做根文件系统,

    TI官方有一个qspi的用户手册,但是我发现是针对4.9版本以上的,照做是发现menuconfig配置在下面的选项出不同。

    我修改了dts文件,物理引脚如注释

    qspi_pins_default: qspi_pins_default {
    pinctrl-single,pins = <
    0x210 ( PIN_INPUT | MUX_MODE3 ) /* (Y18) cam0_data2.qspi_clk */
    0x214 ( PIN_OUTPUT | MUX_MODE3 ) /* (AA18) cam0_data3.qspi_csn */
    0x218 ( PIN_INPUT | MUX_MODE3 ) /* (AE19) cam0_data4.qspi_d0 */
    0x21c ( PIN_INPUT | MUX_MODE3 ) /* (AD19) cam0_data5.qspi_d1 */
    0x220 ( PIN_INPUT | MUX_MODE3 ) /* (AE20) cam0_data6.qspi_d2 */
    0x224 ( PIN_INPUT | MUX_MODE3 ) /* (AD20) cam0_data7.qspi_d3 */
    >;
    };

    &qspi {
    status = "okay";
    pinctrl-names = "default", "sleep";
    pinctrl-0 = <&qspi_pins_default>;
    pinctrl-1 = <&qspi_pins_sleep>;

    spi-max-frequency = <48000000>;
    m25p80@0 {
    compatible = "mx66l51235l";
    spi-max-frequency = <48000000>;
    reg = <0>;
    spi-cpol;
    spi-cpha;
    spi-tx-bus-width = <1>;
    spi-rx-bus-width = <4>;
    #address-cells = <1>;
    #size-cells = <1>;

    };
    };

    启动后/sys/bus/spi/drivers下有m25p80驱动,但/dev/下并没有spi设备,不知道问题出在哪个环节。