Microzed issues: Difference between revisions

From ElphelWiki
Jump to navigation Jump to search
Oleg (talk | contribs)
No edit summary
Oleg (talk | contribs)
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
==List==
==List==
* <b style='color:green'>[SOLVED]</b> UART
===<b style='color:green'>[CLEARED]</b> UART===
<font size='2'>
<font size='2'>
  <b>Description:</b>
  <b>Description:</b>
Line 8: Line 8:
     sometimes the timeout register is set correctly
     sometimes the timeout register is set correctly
  <b>Possible reason:</b>
  <b>Possible reason:</b>
     In driver .startup and .termios conflict? Race Reset?
     In driver .startup and .termios conflict? Racing Resets or reset takes time?
  <b>Solution:</b>
  <b>Solution:</b>
     Added a delay after reset - some other functions in the driver also have it - some not. Luck?
     Added a delay after reset - some other functions in the driver also have it - some not. Luck?
Line 26: Line 26:
           * Clear the RX disable and TX disable bits and then set the TX enable
           * Clear the RX disable and TX disable bits and then set the TX enable
           * bit and RX enable bit to enable the transmitter and receiver.</i>
           * bit and RX enable bit to enable the transmitter and receiver.</i>
<b>Links:</b>
    * https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Uart-timeout-problem/td-p/432016
    * http://www.makelinux.net/ldd3/chp-7-sect-3
</font>


</font>
===<b style='color:green'>[CLEARED]</b> SSH terminal===
* SSH terminal
<font size='2'>
<font size='2'>
  <b>Description:</b>
  <b>Description:</b>
     Freezes, lags but remembers all typed symbols
     Freezes, lags but remembers all typed symbols
  <b>Possible reason:</b>
  <b>Possible reason:</b>
     UART problem?
     Devices with identical MACs in LAN
</font>
</font>
* RTC
===RTC===
<font size='2'>
<font size='2'>
    Too many messages when rtc is missing
  <b>Description:</b>
  <b>Description:</b>
    Not an issue
     3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log
     3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log
  <b>Possible reason:</b>
  <b>Possible reason:</b>
     driver
     a. Microzed doesn't have a real-time clock (rtc)
    b. Reported by /etc/init.d/hwclock.sh - not the driver
</font>
 
===U-boot Falcon mode (boot from SPL directly to OS avoiding full u-boot)===
<font size='2'>
<b>Description:</b>
    Try
<b>Possible reason:</b>
   
===U-boot spl reads u-boot-dtb.img 2 times===
<font size='2'>
<b>Description:</b>
    Not an issue - prints "reading u-boot-dtb.img" 2 times. "Very Annoying","Every microsecond counts"!
<b>Possible reason:</b>
    <b>u-boot/common/spl/spl_fat.c:</b>
        <i>int spl_load_image_fat(block_dev_desc_t *block_dev,
        int partition,
        const char *filename)
        {
        int err;
        struct image_header *header;
       
        err = spl_register_fat_device(block_dev, partition);
        if (err)
        goto end;
       
        header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
        sizeof(struct image_header));
       
        err = <b>file_fat_read</b>(filename, header, sizeof(struct image_header));
        if (err <= 0)
        goto end;
       
        spl_parse_image_header(header);
       
        err = <b>file_fat_read</b>(filename, (u8 *)spl_image.load_addr, 0);
       
        end:
        #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
        if (err <= 0)
        printf("%s: error reading image %s, err - %d\n",
              __func__, filename, err);
        #endif
       
        return (err <= 0);
        }</i>
 
</font>
</font>


==Useful pages==
==Useful pages==
* https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Uart-timeout-problem/td-p/432016
* http://processors.wiki.ti.com/index.php/Enabling_Stack_Dumping_in_Linux_Kernel
* http://processors.wiki.ti.com/index.php/Enabling_Stack_Dumping_in_Linux_Kernel
* https://lists.yoctoproject.org/pipermail/poky/2015-February/010037.html
* https://lists.yoctoproject.org/pipermail/poky/2015-February/010037.html - change hostname in poky
* http://www.makelinux.net/ldd3/chp-7-sect-3
* http://www.makelinux.net/ldd3/chp-7-sect-3
* http://www.denx.de/wiki/pub/U-Boot/MiniSummitELCE2013/2013-ELCE-U-Boot-Falcon-Boot.pdf

Latest revision as of 22:35, 23 February 2016

List

[CLEARED] UART

Description:
    UART register contents: timeout=0 rxfifo_level=56, should be timeout=10 rxfifo_level=56
    minicom prints 56 symbols at a time when rxfifo reaches its level.
    remembers all typed symbols
    sometimes the timeout register is set correctly
Possible reason:
    In driver .startup and .termios conflict? Racing Resets or reset takes time?
Solution:
    Added a delay after reset - some other functions in the driver also have it - some not. Luck?
Patch:
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index f214c7f..164e32d 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -704,6 +704,9 @@ static void cdns_uart_set_termios(struct uart_port *port,
        ctrl_reg |= CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST;
        cdns_uart_writel(ctrl_reg, CDNS_UART_CR_OFFSET);
 
+       while (cdns_uart_readl(CDNS_UART_CR_OFFSET) &
+                       (CDNS_UART_CR_TXRST | CDNS_UART_CR_RXRST))
+               cpu_relax();
        /*
         * Clear the RX disable and TX disable bits and then set the TX enable
         * bit and RX enable bit to enable the transmitter and receiver.
Links:
    * https://forums.xilinx.com/t5/Zynq-All-Programmable-SoC/Zynq-Uart-timeout-problem/td-p/432016
    * http://www.makelinux.net/ldd3/chp-7-sect-3

[CLEARED] SSH terminal

Description:
    Freezes, lags but remembers all typed symbols
Possible reason:
    Devices with identical MACs in LAN

RTC

Description:
    Not an issue
    3x"hwclock: can't open '/dev/misc/rtc': No such file or directory" in boot log
Possible reason:
    a. Microzed doesn't have a real-time clock (rtc)
    b. Reported by /etc/init.d/hwclock.sh - not the driver

U-boot Falcon mode (boot from SPL directly to OS avoiding full u-boot)

Description:
    Try
Possible reason:
    

U-boot spl reads u-boot-dtb.img 2 times

Description:
    Not an issue - prints "reading u-boot-dtb.img" 2 times. "Very Annoying","Every microsecond counts"!
Possible reason:
    u-boot/common/spl/spl_fat.c:
        int spl_load_image_fat(block_dev_desc_t *block_dev,
        						int partition,
        						const char *filename)
        {
        	int err;
        	struct image_header *header;
        	
        	err = spl_register_fat_device(block_dev, partition);
        	if (err)
        		goto end;
        
        	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
        						sizeof(struct image_header));
        
        	err = file_fat_read(filename, header, sizeof(struct image_header));
        	if (err <= 0)
        		goto end;
        
        	spl_parse_image_header(header);
        
        	err = file_fat_read(filename, (u8 *)spl_image.load_addr, 0);
        
        end:
        #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
        	if (err <= 0)
        		printf("%s: error reading image %s, err - %d\n",
        		       __func__, filename, err);
        #endif
        
        	return (err <= 0);
        }

Useful pages