am3352 项目记录

项目基于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 设备节点.

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值