首页 > 其他分享 >荣品-RK3128修改SD卡启动,UART0打印调试信息

荣品-RK3128修改SD卡启动,UART0打印调试信息

时间:2022-09-06 13:23:04浏览次数:59  
标签:status rk3128 荣品 boot RK3128 调试信息 dts arch arm

修改的内容如下

diff --git a/kernel/arch/arm/boot/dts/rp-rk3128.dts b/kernel/arch/arm/boot/dts/rp-rk3128.dts
index be9ad811d..e0272b350 100755
--- a/kernel/arch/arm/boot/dts/rp-rk3128.dts
+++ b/kernel/arch/arm/boot/dts/rp-rk3128.dts
@@ -49,16 +49,16 @@
 // #include "rp-lcd-mipi-5.5-720-1280-v2.dtsi"
 // #include "rp-lcd-mipi-5-720-1280.dtsi"
 // #include "rp-lcd-mipi-7-1024-600.dtsi"
-#include "rp-lcd-mipi-8-800-1280.dtsi"
+//#include "rp-lcd-mipi-8-800-1280.dtsi"
 // #include "rp-lcd-mipi-10-800-1280.dtsi"
-// #include "rp-lcd-hdmi.dtsi"
+#include "rp-lcd-hdmi.dtsi"


 / {
        model = "rpdzkj rp3128 base on Rockchip RK3128";
        compatible = "rockchip,rk3128";
        chosen {
-               bootargs = "earlycon=uart8250,mmio32,0x20068000 earlyprintk console=ttyFIQ0 rw root=PARTUUID=614e0000-0000 rootwait";
+               bootargs = "earlycon=uart8250,mmio32,0x20060000 earlyprintk console=ttyFIQ0 rw root=PARTUUID=614e0000-0000 rootwait";
        };

        cpuinfo {
@@ -69,10 +69,11 @@

        fiq-debugger {
                compatible = "rockchip,fiq-debugger";
-               rockchip,serial-id = <2>;
+               rockchip,serial-id = <0>;
                rockchip,signal-irq = <159>;
                rockchip,wake-irq = <0>;
                /* If enable uart uses irq instead of fiq */
+               pinctrl-0 = <&uart0_xfer>;
                rockchip,irq-mode-enable = <1>;
                rockchip,baudrate = <115200>;  /* Only 115200 and 1500000 */
                interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_LOW>;
@@ -275,7 +276,7 @@
                pinctrl-0 = <&uart0_rts>;
                pinctrl-1 = <&uart0_rts_gpio>;
                BT,power_gpio = <&gpio3 RK_PC5 GPIO_ACTIVE_HIGH>;
-               status = "okay";
+               status = "disabled";
        };

        clkin_gmac: external-gmac-clock {
@@ -393,7 +394,7 @@
        num-slots = <1>;
        pinctrl-names = "default";
        pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
-       status = "okay";
+       status = "disabled";
 };

 &gmac {
@@ -738,7 +739,7 @@
     /*  */
     pinctrl-names = "default";
     pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
-       status = "disabled";
+       status = "okay";
 };

 &sdio {
@@ -767,7 +768,7 @@
 &uart0{
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_xfer &uart0_cts>;
-       status = "okay";
+       status = "disabled";
 };

 &u2phy {
@@ -856,3 +857,15 @@
     status = "okay";
 };

+
+&uart0 {
+    status = "disabled";
+};
+
+&uart2 {
+    status = "disabled";
+};
+
+
+
+
diff --git a/u-boot/arch/arm/dts/rk3128-evb.dts b/u-boot/arch/arm/dts/rk3128-evb.dts
index 89973553c..04bd7d5f7 100644
--- a/u-boot/arch/arm/dts/rk3128-evb.dts
+++ b/u-boot/arch/arm/dts/rk3128-evb.dts
@@ -68,10 +68,14 @@
        status = "okay";
 };

-&uart2 {
+&uart0 {
        status = "okay";
 };

+&uart2 {
+       status = "disabled";
+};
+
 &usb_host_ehci {
        status = "okay";
 };
@@ -87,7 +91,7 @@

 &emmc {
        fifo-mode;
-       status = "okay";
+       status = "disabled";
 };

 &i2c0 {
diff --git a/u-boot/arch/arm/dts/rk3128-u-boot.dtsi b/u-boot/arch/arm/dts/rk3128-u-boot.dtsi
index fb5f1f7f0..5b722f3a4 100644
--- a/u-boot/arch/arm/dts/rk3128-u-boot.dtsi
+++ b/u-boot/arch/arm/dts/rk3128-u-boot.dtsi
@@ -6,12 +6,12 @@

 / {
        aliases {
-               mmc0 = &emmc;
+               mmc0 = &sdmmc;
                mmc1 = &sdmmc;
        };

        chosen {
-               stdout-path = &uart2;
+               stdout-path = &uart0;
        };
 };

@@ -24,7 +24,7 @@
        status = "okay";
 };

-&emmc {
+&sdmmc {
        u-boot,dm-pre-reloc;
        status = "okay";
 };
@@ -37,6 +37,11 @@
        u-boot,dm-pre-reloc;
 };

+&uart0 {
+       clock-frequency = <24000000>;
+       u-boot,dm-pre-reloc;
+};
+
 &uart1 {
        clock-frequency = <24000000>;
        u-boot,dm-pre-reloc;
@@ -60,4 +65,4 @@
 &usb_otg {
        u-boot,dm-pre-reloc;
        status = "okay";
-};
\ No newline at end of file
+};
diff --git a/u-boot/arch/arm/dts/rk3128.dtsi b/u-boot/arch/arm/dts/rk3128.dtsi
index 928310aec..201a5742a 100644
--- a/u-boot/arch/arm/dts/rk3128.dtsi
+++ b/u-boot/arch/arm/dts/rk3128.dtsi
@@ -32,7 +32,7 @@
                serial0 = &uart0;
                serial1 = &uart1;
                serial2 = &uart2;
-               mmc0 = &emmc;
+               mmc0 = &sdmmc;
                mmc1 = &sdmmc;
        };

diff --git a/u-boot/arch/arm/mach-rockchip/rk3128/rk3128.c b/u-boot/arch/arm/mach-rockchip/rk3128/rk3128.c
index 30b21e7d9..432c27f56 100644
--- a/u-boot/arch/arm/mach-rockchip/rk3128/rk3128.c
+++ b/u-boot/arch/arm/mach-rockchip/rk3128/rk3128.c
@@ -64,8 +64,8 @@ void board_debug_uart_init(void)
                GPIO1C2_UART2_RX        = 2,
        };

-       rk_clrsetreg(&grf->gpio1c_iomux,
+       rk_clrsetreg(&grf->gpio2d_iomux,
                     GPIO1C2_MASK, GPIO1C2_UART2_TX << GPIO1C2_SHIFT);
-       rk_clrsetreg(&grf->gpio1c_iomux,
+       rk_clrsetreg(&grf->gpio2d_iomux,
                     GPIO1C3_MASK, GPIO1C2_UART2_RX << GPIO1C3_SHIFT);
 }
(END)

注意点

  • kernel中打开调试串口需要关闭对应的uartx串口
  • u-boot中调试串口需要打开uartx
  • SD卡和uart2的引脚是共用的,需要关闭uart2串口
  • 修改后可以通过fdisk -l看到SD卡,但是df -h 还是看不到SD卡的分区,需要輸入mkfs.ext2 /dev/block/by-name/userdata手动格式化,reboot之后可以看到挂载成功。如下图:

标签:status,rk3128,荣品,boot,RK3128,调试信息,dts,arch,arm
From: https://www.cnblogs.com/mhhman123/p/16661417.html

相关文章