全志科技
直播中

李秀珍

7年用户 974经验值
私信 关注
[问答]

怎样通过uboot去修改sdc的频率以及以太网的delay参数呢

  • 有时候经常需要临时调整部份设备树的属性配置,例如sdc的频率,以太网的delay参数。如果每次都源码修改后编译烧写,比较费时,所以uboot提供了临时修改的方法。
    注:uboot修改都是单次启动有效,重启无效。
    => fdt print /soc/sdmmc@4021000
    sdmmc@4021000 {
            compatible = "allwinner,sunxi-mmc-v5p3x";
            device_type = "sdc1";
            reg = <0x00000000 0x04021000 0x00000000 0x00001000>;
            interrupts = <0x00000000 0x00000029 0x00000004>;
            clocks = <0x0000000c 0x00000002 0x00000005 0x00000002 0x0000003a 0x00000002 0x0000003d>;
            clock-names = "osc24m", "pll_periph", "mmc", "ahb";
            resets = <0x00000002 0x00000010>;
            reset-names = "rst";
            pinctrl-names = "default", "sleep";
            pinctrl-0 = <0x00000022>;
            pinctrl-1 = <0x00000023>;
            max-frequency = <0x08f0d180>;
            bus-width = <0x00000004>;
            cap-sd-highspeed;
            no-mmc;
            keep-power-in-suspend;
            sunxi-dly-52M-ddr4 = <0x00000001 0x00000000 0x00000000 0x00000000 0x00000002>;
            sunxi-dly-104M = <0x00000001 0x00000000 0x00000000 0x00000000 0x00000001>;
            sunxi-dly-208M = <0x00000001 0x00000000 0x00000000 0x00000000 0x00000001>;
            status = "okay";
            no-sd;
            cap-sdio-irq;
            ignore-pm-notify;
            ctl-spec-caps = <0x00000008>;
    };
    修改sdc的最大支持频率
  • 25M
  • fdt set /soc/sdmmc@04021000 max-frequency <0x017d7840>
  • 50M
  • fdt set /soc/sdmmc@04021000 max-frequency <0x02faf080>
  • 100M
  • fdt set /soc/sdmmc@04021000 max-frequency <0x05f5e100>
  • 120M
  • fdt set /soc/sdmmc@04021000 max-frequency <0x07270e00>
  • 150M
  • fdt set /soc/sdmmc@04021000 max-frequency <0x08f0d180>
  • 修改相位
    fdt set /soc/sdmmc@04021000 sunxi-dly-208M <0x00000001 0x00000000 0x00000000 0x00000000 0x00000000 0x00000001>
  • 2.修改以太网的属性
    打印当前以太网的配置
  • => fdt print /soc/eth@4500000
  • eth@4500000 {
  •         compatible = "allwinner,sunxi-gmac";
  •         reg = <0x00000000 0x04500000 0x00000000 0x00010000 0x00000000 0x03000030 0x00000000 0x00000004>;
  •         interrupts = <0x00000000 0x0000002e 0x00000004>;
  •         interrupt-names = "gmacirq";
  •         clocks = <0x00000002 0x00000050 0x00000002 0x0000004f>;
  •         clock-names = "gmac", "ephy";
  •         resets = <0x00000002 0x00000020>;
  •         device_type = "gmac0";
  •         gmac-power0;
  •         gmac-power1;
  •         gmac-power2;
  •         status = "okay";
  •         phy-mode = "rgmii";
  •         use_ephy25m = <0x00000001>;
  •         pinctrl-0 = <0x00000019>;
  •         pinctrl-1 = <0x0000001a>;
  •         pinctrl-names = "default", "sleep";
  •         tx-delay = <0x00000003>;
  •         rx-delay = <0x00000005>;
  • };

  • 修改delay 参数
    fdt set /soc/eth@4500000 rx-delay  <0x0000000a>
  • :这里只是简单介绍uboot的命令,具体设备属性的解释就不展开说明了。

回帖(1)

李代三

2021-12-29 11:10:33
解决办法
uboot常用命令
fdt



=> fdt -h
fdt - flattened device tree utility commands


Usage:
fdt addr [-c]   []   - Set the [control] fdt location to
fdt apply                     - Apply overlay to the DT
fdt boardsetup                      - Do board-specific set up
fdt move    - Copy the fdt to and make it active
fdt resize []            - Resize fdt to size + padding to 4k addr + some optional if needed
fdt print   []          - Recursive print starting at
fdt list    []          - Print one level starting at
fdt get value    - Get and store in
fdt get name    - Get name of node and store in
fdt get addr     - Get start address of and store in
fdt get size []  - Get size of [] or num nodes and store in
fdt set    []    - Set [to ]
fdt mknode             - Create a new node after
fdt rm      []          - Delete the node or
fdt header                          - Display header info
fdt bootcpu                     - Set boot cpuid
fdt memory             - Add/Update memory node
fdt rsvmem print                    - Show current mem reserves
fdt rsvmem add         - Add a mem reserve
fdt rsvmem delete            - Delete a mem reserves
fdt chosen [ ]          - Add/update the /chosen branch in the tree
                                      / - initrd start/end addr


printenv:打印环境变量
setenv:设置环境变量
saveenv:保存设置的环境变量
md:显示内存区的内容
mm:修改内存
cmp:比较两块内存
举报

更多回帖

发帖
×
20
完善资料,
赚取积分