]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
debug uart working somewhat
authorDuje Mihanović <duje.mihanovic@skole.hr>
Wed, 18 Dec 2024 20:54:11 +0000 (21:54 +0100)
committerDuje Mihanović <duje.mihanovic@skole.hr>
Wed, 18 Dec 2024 20:54:11 +0000 (21:54 +0100)
arch/arm/dts/pxa1908.dtsi
board/samsung/coreprimevelte/coreprimevelte.c
common/board_f.c
configs/coreprimevelte_defconfig
drivers/serial/ns16550.c
drivers/serial/serial-uclass.c

index 8db497864636e7d6d15932bd84de90efc7518900..bb19cae30d79aa43860e7d20163ed468997d1386 100644 (file)
                        ranges = <0 0 0xd4000000 0x200000>;
 
                        uart0: serial@17000 {
-                               compatible = "mrvl,mmp-uart", "intel,xscale-uart", "ns16550";
+                               compatible = "ns16550";
                                reg = <0x17000 0x1000>;
-                               interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
                                clock-frequency = <14745600>;
                                reg-shift = <2>;
                        };
 
                        uart1: serial@18000 {
-                               compatible = "mrvl,mmp-uart", "intel,xscale-uart", "ns16550";
+                               compatible = "ns16550";
                                reg = <0x18000 0x1000>;
-                               interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
                                clock-frequency = <14745600>;
                                reg-shift = <2>;
                        };
                        };
 
                        uart2: serial@36000 {
-                               compatible = "mrvl,mmp-uart", "intel,xscale-uart", "ns16550";
+                               compatible = "ns16550";
                                reg = <0x36000 0x1000>;
-                               interrupts = <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
                                clock-frequency = <117000000>;
                                reg-shift = <2>;
                        };
index 7c970e606c4b510a94932221bd811d14ffc53fc1..b095dd098609abfab230841cbf48a5466588e1f2 100644 (file)
@@ -2,25 +2,30 @@
 #include <fdtdec.h>
 #include <asm/io.h>
 
-int board_init(void)
+void lowlevel_init(void)
 {
+#ifdef CONFIG_DEBUG_UART
        debug_uart_init();
-       printascii("Reached board_init()\n");
+       printascii("Reached lowlevel_init()\n");
+#endif /* CONFIG_DEBUG_UART */
 
        u32 tmp = readl(0xd4015064);
        if ((tmp >> 16) != 0x319)
-               return -1;
+               return;
 
        writel(tmp | 1, 0xd4015064);
        writel(3, 0xd4101000);
+}
 
-       return 0;
+int board_init(void)
+{
+       puts("Reached board_init()\n");
 }
 
 int dram_init(void)
 {
        if (fdtdec_setup_mem_size_base() != 0)
-               printascii("fdtdec_setup_mem_size_base() has failed\n");
+               puts("fdtdec_setup_mem_size_base() has failed\n");
 
        return 0;
 }
index 12454677166f7e9730c5dfb82ab89eda9cab4c2e..0fbb8c4f73bee99e2fccff3b6c279fe3b40c3fb0 100644 (file)
@@ -930,11 +930,11 @@ static const init_fnc_t init_sequence_f[] = {
 #endif
        env_init,               /* initialize environment */
        init_baud_rate,         /* initialze baudrate settings */
-       green,
        serial_init,            /* serial communications setup */
-       blue,
+       green,
        console_init_f,         /* stage 1 init of console */
        display_options,        /* say that we are here */
+       blue,
        display_text_info,      /* show debugging info if required */
        checkcpu,
 #if defined(CONFIG_SYSRESET)
index 798f459fa46f054fcde74efe2803ffd1e7aca0b2..fc3e9264a7012f5f232c9ba3a5bfd939a3529ec3 100644 (file)
@@ -15,13 +15,14 @@ CONFIG_ARMV8_PSCI=y
 CONFIG_DEBUG_UART=y
 CONFIG_LOCALVERSION="pxa1908"
 CONFIG_FIT=y
+CONFIG_LOGLEVEL=8
 CONFIG_LOG=y
 CONFIG_OF_CONTROL=y
+CONFIG_OF_EMBED=y
 CONFIG_NO_NET=y
 CONFIG_CLK=y
 CONFIG_CPU=y
 CONFIG_CPU_ARMV8=y
-CONFIG_SERIAL_SEARCH_ALL=y
 CONFIG_DEBUG_UART_SHIFT=2
 CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_DEBUG_UART_SKIP_INIT=y
index 7772c2e9f1653c4e0b4e39e2f181c499d6450efd..46f0931931565b77feb7b4b4c8227bb616317f6d 100644 (file)
@@ -321,19 +321,21 @@ int ns16550_tstc(struct ns16550 *com_port)
 
 static inline void _debug_uart_init(void)
 {
-       struct ns16550 *com_port = (struct ns16550 *)CONFIG_VAL(DEBUG_UART_BASE);
-       int baud_divisor;
+       //struct ns16550 *com_port = (struct ns16550 *)CONFIG_VAL(DEBUG_UART_BASE);
+       //int baud_divisor;
 
        /* Wait until tx buffer is empty */
+       /*
        while (!(serial_din(&com_port->lsr) & UART_LSR_TEMT))
                ;
-
+       */
        /*
         * We copy the code from above because it is already horribly messy.
         * Trying to refactor to nicely remove the duplication doesn't seem
         * feasible. The better fix is to move all users of this driver to
         * driver model.
         */
+       /*
        baud_divisor = ns16550_calc_divisor(com_port, CONFIG_DEBUG_UART_CLOCK,
                                            CONFIG_BAUDRATE);
        serial_dout(&com_port->ier, CFG_SYS_NS16550_IER);
@@ -344,6 +346,7 @@ static inline void _debug_uart_init(void)
        serial_dout(&com_port->dll, baud_divisor & 0xff);
        serial_dout(&com_port->dlm, (baud_divisor >> 8) & 0xff);
        serial_dout(&com_port->lcr, UART_LCRVAL);
+       */
 }
 
 static inline int NS16550_read_baud_divisor(struct ns16550 *com_port)
index 6d27b530859879dcba0a46a28c6deeee95358e97..69b29dee8447f1d0b0b7dcf528e942148101ef0f 100644 (file)
@@ -195,8 +195,6 @@ int serial_init(void)
 #if CONFIG_IS_ENABLED(SERIAL_PRESENT)
        serial_find_console_or_panic();
        gd->flags |= GD_FLG_SERIAL_READY;
-       for (int *i = (int *) 0x17200000; i < 0x17177000 + 0x177000; i++)
-               *i = 0xffffff00;
 
        if (IS_ENABLED(CONFIG_OF_SERIAL_BAUD)) {
                int ret = 0;
@@ -217,6 +215,8 @@ int serial_init(void)
                }
        }
        serial_setbrg();
+
+       serial_puts("serial_init done\n");
 #endif
 
        return 0;