am3352 项目记录

来源:互联网 发布:数据魔方在哪里订购 编辑:程序博客网 时间:2024/06/14 17:59

项目基于am3352的芯片开发,遇到一些问题:

一. Phy芯片
项目使用LAN8720 Phy芯片,在启动后无法正常运行。
解决方式:dts里面需要指明,该Phy芯片的时钟来源,需添加以下代码:

&phy_sel {    rmii-clock-ext;};

即说明该Phy芯片是使用外部时钟源,否则不能正常运行。

二. usb
电路原理图连接方式不同导致USB无法正常识别:
我采用的是host模式,因此需要将VBUS接+5V,DRVVBUS可以不接,以下为官方设计文档说明:
这里写图片描述

三. OSC0时钟源
该时钟源需要在U-Boot里面指定具体值。因板子变化,而晶振值未进行相应修改,出现一系列的无法理解的问题。
问题如下:
1. device descriptor read/64 error -71 (-71为协议错误)
这里写图片描述

2.在xshell里黏贴时候,会造成乱码,删除文字速度过快会导致乱码。

四.MMC电源
因换了板子后,使用的PMU变更,因此需要重新修改dts.
在dts里面MMC的设备需要指定提供的电源,否则将无法识别(原因不明).

&mmc1 {    status = "okay";    vmmc-supply = <&vmmcsd_fixed>;    bus-width = <4>;    pinctrl-names = "default", "sleep";    pinctrl-0 = <&mmc1_pins_default>;};

如上面所示,vmmc-supply使用的是非PMU提供的电源,为外接固定电源,原先的为PMU提供的电源,导致无法识别MMC设备。
vmmcsd_fixed如下:

vmmcsd_fixed: fixedregulator@0 {    compatible = "regulator-fixed";    regulator-name = "vmmcsd_fixed";    regulator-min-microvolt = <3300000>;    regulator-max-microvolt = <3300000>;    regulator-boot-on;};

五.led
需要led指示灯,dts的bindings文档里面解释的比较清晰了,再做下简单记录。
mmc0_led为常亮等,sys_led为闪烁灯。

mmc0_led {    compatible = "gpio-leds";    label = "green:keep";    led1{        gpios = <&gpio3 19 GPIO_ACTIVE_HIGH>;        default-state = "on";    };};
sys_led {        compatible = "gpio-leds";        label = "red:heartbeat";        led1{            gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;            linux,default-trigger = "heartbeat";            default-state = "on";        };   };

bindings 文档解释:

  • linux,default-trigger : This parameter, if present, is a
    string defining the trigger assigned to the LED. Current triggers are:
    “backlight” - LED will act as a back-light, controlled by the framebuffer
    system
    “default-on” - LED will turn on (but for leds-gpio see “default-state”
    property in Documentation/devicetree/bindings/gpio/led.txt)
    “heartbeat” - LED “double” flashes at a load average based rate
    “ide-disk” - LED indicates disk activity
    “timer” - LED flashes at a fixed, configurable rate

六.SPI通用设备
内核编译时候将这个编译进去.
这里写图片描述
compatible 使用 compatible = “rohm,dh2228fv”;

&spi0 {    status = "okay";    pinctrl-names = "default";    pinctrl-0 = <&spi0_pins>;    spidev@0 {        compatible = "rohm,dh2228fv";        spi-max-frequency=<10000000>;        reg = <0>;    };};

系统上电后直接可以使用spidev1.0 设备节点.