神棍地海棠 发表于 2022-11-7 10:08

全志芯片Tina Linux 修改 UART 引脚、UART端口

场景一:同样使用UART0,需要从PF2、PF4改到PE2、PE4
[*]修改sys_config.fex(BOOT0与Uboot的串口)
sys_config.fex 的路径是 device/config/chips/t113/configs/evb1/sys_config.fex 中的 uart_debug_port修改前:uart_debug_port = 0uart_debug_tx   = port:PF02<font color="rgb(232, 191, 106)"><3></font><font color="rgb(232, 191, 106)"><1></font><font color="rgb(232, 191, 106)"><default></font><font color="rgb(232, 191, 106)"><default></font>uart_debug_rx   = port:PF04<font color="rgb(232, 191, 106)"><3></font><font color="rgb(232, 191, 106)"><1></font><font color="rgb(232, 191, 106)"><default></font><font color="rgb(232, 191, 106)"><default></font>
修改后uart_debug_port = 0uart_debug_tx   = port:PE02<font color="rgb(232, 191, 106)"><6></font><font color="rgb(232, 191, 106)"><1></font><font color="rgb(232, 191, 106)"><default></font><font color="rgb(232, 191, 106)"><default></font>uart_debug_rx   = port:PE03<font color="rgb(232, 191, 106)"><6></font><font color="rgb(232, 191, 106)"><1></font><font color="rgb(232, 191, 106)"><default></font><font color="rgb(232, 191, 106)"><default></font>
其中<3>改为<6> 是查阅数据手册中 PE2、PE3 的UART0是 Function6 得知的

[*]port:PE02    <font color="rgb(232, 191, 106)"><6></font><font color="rgb(232, 191, 106)"><1></font><font color="rgb(232, 191, 106)"><default></font><font color="rgb(232, 191, 106)"><default></font>      ^   ^       PE2脚引脚功能6(查阅datasheet得知)
修改设备树(Linux使用的串口输出)
路径:device/config/chips/t113/configs/evb1/board.dts修改前<font color="rgb(109, 156, 190)">uart0_pins_a:</font> uart0_pins<a href="home.php?mod=space&uid=2514928" target="_blank">@0</a> {<font color="rgb(165, 194, 97)">/* For EVB1 board */</font>      pins = <font color="rgb(165, 194, 97)">"PF2"</font>, <font color="rgb(165, 194, 97)">"PF4"</font>;      function = <font color="rgb(165, 194, 97)">"uart0"</font>;      drive-strength = <<font color="rgb(165, 194, 97)">10</font>>;      allwinner,muxsel = <<font color="rgb(165, 194, 97)">3</font>>;      bias-pull-up;};<font color="rgb(109, 156, 190)">uart0_pins_b:</font> uart0_pins<a href="home.php?mod=space&uid=2514798" target="_blank">@1</a> {<font color="rgb(165, 194, 97)">/* For EVB1 board */</font>      pins = <font color="rgb(165, 194, 97)">"PF2"</font>, <font color="rgb(165, 194, 97)">"PF4"</font>;      function = <font color="rgb(165, 194, 97)">"gpio_in"</font>;};
修改后<font color="rgb(109, 156, 190)">uart0_pins_a:</font> uart0_pins@0 {<font color="rgb(165, 194, 97)">/* For EVB1 board */</font>      pins = <font color="rgb(165, 194, 97)">"PE2"</font>, <font color="rgb(165, 194, 97)">"PE3"</font>;      function = <font color="rgb(165, 194, 97)">"uart0"</font>;      drive-strength = <<font color="rgb(165, 194, 97)">10</font>>;      allwinner,muxsel = <<font color="rgb(165, 194, 97)">6</font>>;      bias-pull-up;};<font color="rgb(109, 156, 190)">uart0_pins_b:</font> uart0_pins@1 {<font color="rgb(165, 194, 97)">/* For EVB1 board */</font>      pins = <font color="rgb(165, 194, 97)">"PE2"</font>, <font color="rgb(165, 194, 97)">"PE3"</font>;      function = <font color="rgb(165, 194, 97)">"gpio_in"</font>;};

豌豆爹 发表于 2022-11-7 15:53

使用代码框来敲代码把

豌豆爹 发表于 2022-11-7 15:54

整个代码显得一团糟

e_007 发表于 2022-11-8 17:13

本帖最后由 e_007 于 2022-11-8 18:19 编辑

....
页: [1]
查看完整版本: 全志芯片Tina Linux 修改 UART 引脚、UART端口