2.10 Trouble Reports

Incorrect AXIS 82 kernel configuration

Problem: Incorrect MTD FLASH configuration in AXIS 82 kernelconfig-2.6 is causing the rootfs mounting to fail.

Solution: Apply the patch below:

--- configure-files/devboard/products/devboard_82/kernelconfig-2.6	2007-08-16 14:56:52.000000000 +0200
+++ kernelconfig-2.6	2007-08-16 15:20:20.000000000 +0200
@@ -452,17 +452,22 @@ CONFIG_MTD_BLOCK=y
 CONFIG_MTD_CFI=y
 CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
 CONFIG_MTD_MAP_BANK_WIDTH_2=y
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
 # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
 # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
 # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
 CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I2 is not set
 # CONFIG_MTD_CFI_I4 is not set
 # CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_OTP is not set
 # CONFIG_MTD_CFI_INTELEXT is not set
 CONFIG_MTD_CFI_AMDSTD=y
 # CONFIG_MTD_CFI_STAA is not set

Save the patch in a file, e.g. patch_file. Apply the patch from the root of your tree:

patch -p 0 < patch_file

Note The file being patched is configure-files/devboard/products/devboard_82/kernelconfig-2.6
while the kernelconfig-2.6 used when compiling the kernel is located in the root of your tree.
Make sure kernelconfig-2.6 is identical to configure-files/devboard/products/devboard_82/kernelconfig-2.6.
If not, copy configure-files/devboard/products/devboard_82/kernelconfig-2.6 to the root of your tree
before rebuilding the kernel.

rebuild the kernel:

make -C packages/os/linux-2.6 install

and build a new image:

make images

Jesper Bengtsson 2008/05/29 09:39


CRIS V32 Ethernet driver update

Problem:

  • Transmissions sometimes times out and isn't restarted.
  • The data path of the Ethernet driver, particularly the receive path, can lead to significant performance drops, to the extent where the system completely locks-up.

Solution:

  • Timed out transmissions is restarted.
  • The Ethernet driver is now using NAPI, a more scalable receive API for Linux network devices.

You can find the patch here.

Jesper Bengtsson 2007/09/10 09:26


ETRAX 100LX USB driver update

Problem:

  • It's not possible to perform a port reset on an enabled root hub port.

Solution:

  • Disable the port before resetting it.

You can find the patch here.


CRISV32 serial port driver update

Problem: Three signals (DTR, CD and RI) is inverted in the serial port driver.

Solution: Apply the patch below:

--- os/linux-2.6/drivers/serial/crisv32.c	5 Jan 2007 08:59:53 -0000	1.78
+++ os/linux-2.6/drivers/serial/crisv32.c	8 Jan 2008 08:59:06 -0000
@@ -783,11 +783,14 @@ static unsigned int serial_cris_get_mctr
 	ret = 0;
         if (crisv32_serial_get_rts(up))
 		ret |= TIOCM_RTS;
-	if (crisv32_io_rd(&up->dtr_pin))
+	/* DTR is active low */
+	if (!crisv32_io_rd(&up->dtr_pin))
 		ret |= TIOCM_DTR;
-	if (crisv32_io_rd(&up->cd_pin))
+	/* CD is active low */
+	if (!crisv32_io_rd(&up->cd_pin))
 		ret |= TIOCM_CD;
-	if (crisv32_io_rd(&up->ri_pin))
+	/* RI is active low */
+	if (!crisv32_io_rd(&up->ri_pin))
 		ret |= TIOCM_RI;
 	if (!crisv32_io_rd(&up->dsr_pin))
 		ret |= TIOCM_DSR;
@@ -801,9 +804,12 @@ static void serial_cris_set_mctrl(struct
 	struct uart_cris_port *up = (struct uart_cris_port *)port;
 
 	crisv32_serial_set_rts(up, mctrl & TIOCM_RTS ? 1 : 0);
-	crisv32_io_set(&up->dtr_pin, mctrl & TIOCM_DTR ? 1 : 0);
-	crisv32_io_set(&up->ri_pin, mctrl & TIOCM_RNG ? 1 : 0);
-	crisv32_io_set(&up->cd_pin, mctrl & TIOCM_CD ? 1 : 0);
+	/* DTR is active low */
+	crisv32_io_set(&up->dtr_pin, mctrl & TIOCM_DTR ? 0 : 1);
+	/* RI is active low */
+	crisv32_io_set(&up->ri_pin, mctrl & TIOCM_RNG ? 0 : 1);
+	/* CD is active low */
+	crisv32_io_set(&up->cd_pin, mctrl & TIOCM_CD ? 0 : 1);
 }
 
 static void serial_cris_break_ctl(struct uart_port *port, int break_state)

Save the patch in a file, e.g. patch_file. Apply the patch from the root of your tree:

patch -p 0 < patch_file

rebuild the kernel:

make -C packages/os/linux-2.6 install

and build a new image:

make images

Jesper Bengtsson 2008/01/09 13:04


Build system not fully posix compliant

Problem: The AXIS build system is using a number of shell-scripts and some of the shell-scripts included in the 2.10 soft.dist. isn't fully POSIX-compliant, i.e. the scripts use functionality/notations outside the POSIX-standard. This means that the system shell executing the scripts must handle functionality/notations outside the POSIX-standard.

bash is a shell accepting the 2.10 scripts while dash is a shell that is strictly POSIX-compliant. Ubuntu and Kubuntu is, by default, using dash as system shell. This does often give problems with the AXIS build system.

If the system shell is posix compliant, e.g. dash, the build system will fail with a message like:

Makefile:30: *** missing separator. Stop.

Solution: Change the system shell to a non-posix compliant shell, e.g. bash:

  • Change the system shell to a non POSIX-compliant shell, e.g. bash.
    • cd /bin
    • rm sh 1)
    • ln -s bash sh 2)
  • Reboot the system.

Jan van de Kamer has a very nice description of how he installed Ubuntu, the 2.10 SDK, GDB, gcc-cris and a lot more on his blog.

Jesper Bengtsson 2008/10/04


CRISV10 serial port driver update

Problem: The TIOCMGET ioctl doesn't work in the serial port driver.

Solution: Apply the patch below:

Index: os/linux-2.6/drivers/serial/crisv10.c
===================================================================
RCS file: /usr/local/cvs/linux/os/linux-2.6/drivers/serial/crisv10.c,v
retrieving revision 1.21
diff -b -u -p -r1.21 crisv10.c
--- os/linux-2.6/drivers/serial/crisv10.c       9 Jan 2007 09:30:54 -0000      1.21
+++ os/linux-2.6/drivers/serial/crisv10.c       30 May 2008 10:18:24 -0000
@@ -801,10 +801,10 @@ static struct e100_serial rs_table[] = {
          .dma_out_irq_description = "serial 2 dma tr",
 #else
          .dma_out_enabled = 0,
-         .dma_in_nbr = UINT_MAX,
-         .dma_in_irq_nbr = 0,
-         .dma_in_irq_flags = 0,
-         .dma_in_irq_description = NULL,
+         .dma_out_nbr = UINT_MAX,
+         .dma_out_irq_nbr = 0,
+         .dma_out_irq_flags = 0,
+         .dma_out_irq_description = NULL,
 #endif
 #ifdef CONFIG_ETRAX_SERIAL_PORT2_DMA3_IN
          .dma_in_enabled = 1,
@@ -3437,7 +3437,6 @@ change_speed(struct e100_serial *info)
                                DBAUD(printk("using external baudrate: %lu\n", CONFIG_ETRAX_EXTERN_PB6CLK_FREQ/8));
                                info->baud = CONFIG_ETRAX_EXTERN_PB6CLK_FREQ/8;
                        }
-               }
 #endif
                else
                {
@@ -3988,44 +3987,6 @@ char *get_control_state_str(int MLines, 
 }
 #endif
 
-static int
-get_modem_info(struct e100_serial * info, unsigned int *value)
-{
-       unsigned int result;
-       /* Polarity isn't verified */
-#if 0 /*def SERIAL_DEBUG_IO  */
-
-       printk("get_modem_info: RTS: %i DTR: %i CD: %i RI: %i DSR: %i CTS: %i\n",
-              E100_RTS_GET(info),
-              E100_DTR_GET(info),
-              E100_CD_GET(info),
-              E100_RI_GET(info),
-              E100_DSR_GET(info),
-              E100_CTS_GET(info));
-#endif
-
-       result =
-               (!E100_RTS_GET(info) ? TIOCM_RTS : 0)
-               | (!E100_DTR_GET(info) ? TIOCM_DTR : 0)
-               | (!E100_RI_GET(info) ? TIOCM_RNG : 0)
-               | (!E100_DSR_GET(info) ? TIOCM_DSR : 0)
-               | (!E100_CD_GET(info) ? TIOCM_CAR : 0)
-               | (!E100_CTS_GET(info) ? TIOCM_CTS : 0);
-
-#ifdef SERIAL_DEBUG_IO
-       printk("e100ser: modem state: %i 0x%08X\n", result, result);
-       {
-               char s[100];
-
-               get_control_state_str(result, s);
-               printk("state: %s\n", s);
-       }
-#endif
-       if (copy_to_user(value, &result, sizeof(int)))
-               return -EFAULT;
-       return 0;
-}
-
 static void
 rs_break(struct tty_struct *tty, int break_state)
 {
@@ -4082,6 +4043,34 @@ rs_tiocmset(struct tty_struct *tty, stru
 }
 
 static int
+rs_tiocmget(struct tty_struct *tty, struct file *file)
+{
+       struct e100_serial * info = (struct e100_serial *)tty->driver_data;
+       unsigned int result;
+
+       result =
+               (!E100_RTS_GET(info) ? TIOCM_RTS : 0)
+               | (!E100_DTR_GET(info) ? TIOCM_DTR : 0)
+               | (!E100_RI_GET(info) ? TIOCM_RNG : 0)
+               | (!E100_DSR_GET(info) ? TIOCM_DSR : 0)
+               | (!E100_CD_GET(info) ? TIOCM_CAR : 0)
+               | (!E100_CTS_GET(info) ? TIOCM_CTS : 0);
+
+#ifdef SERIAL_DEBUG_IO
+       printk("ser%i: modem state: %i 0x%08X\n", info->line, result, result);
+       {
+               char s[100];
+
+               get_control_state_str(result, s);
+               printk("state: %s\n", s);
+       }
+#endif
+       return result;
+
+}
+
+
+static int
 rs_ioctl(struct tty_struct *tty, struct file * file,
         unsigned int cmd, unsigned long arg)
 {
@@ -4095,8 +4084,6 @@ rs_ioctl(struct tty_struct *tty, struct 
        }
 
        switch (cmd) {
-               case TIOCMGET:
-                       return get_modem_info(info, (unsigned int *) arg);
                case TIOCGSERIAL:
                        return get_serial_info(info,
                                               (struct serial_struct *) arg);
@@ -4819,6 +4806,7 @@ static const struct tty_operations rs_op
        .send_xchar = rs_send_xchar,
        .wait_until_sent = rs_wait_until_sent,
        .read_proc = rs_read_proc,
+       .tiocmget = rs_tiocmget,
        .tiocmset = rs_tiocmset
 };
 

Save the patch in a file, e.g. patch_file. Apply the patch from the root of your tree:

patch -p 0 < patch_file

rebuild the kernel:

make -C packages/os/linux-2.6 install

and build a new image:

make images

Jesper Bengtsson 2008/05/30 11:31

FTP upgrade fails

Problem: The target firmware upgrade via FTP (and HTTP) fails with:

 .
 .
 Error: script failed.
 The system upgrade failed.
 .
 .

You will get this problem if you build a kernel without the ETRAX GPIO driver (CONFIG_ETRAX_GPIO). This driver is used to control the status LED (if available) on the target. The preflashupgrade script, used when upgrading the target firmware, fails if it can't control the status LED.

Solution: Apply the patch below:

Index: apps/flash/preflashupgrade
===================================================================
RCS file: /usr/local/cvs/linux/apps/flash/preflashupgrade,v
retrieving revision 1.31
diff -b -u -p -r1.31 preflashupgrade
--- apps/flash/preflashupgrade	5 Mar 2007 11:04:12 -0000	1.31
+++ apps/flash/preflashupgrade	3 Dec 2008 10:24:30 -0000
@@ -307,7 +307,7 @@ done
 
 # set_led may start processes in the background and they must not inherit our
 # stdout since the flash application waits for it to be closed.
-set_led flash_loading > /dev/console
+set_led flash_loading > /dev/console || :
 
 # Exit with status 0 even if filesystems were not successfully unmounted so
 # that upgrade can proceed anyway (it may be enough memory available).

Save the patch in a file, e.g. patch_file. Apply the patch from the root of your tree:

patch -p 0 < patch_file

reinstall the patched preflashupgrade script:

make -C apps/flash install

and build a new image:

make images

Jesper Bengtsson 2008/12/03 11:46

sumversion.c fails to build after upgrading to Fedora 10

Problem: After upgrading to Fedora 10 it's not possible to build the 2.6.19 kernel. It fails with:

  HOSTCC  scripts/mod/sumversion.o
scripts/mod/sumversion.c: In function 'get_src_version':
scripts/mod/sumversion.c:384: error: 'PATH_MAX' undeclared (first use in this function)
scripts/mod/sumversion.c:384: error: (Each undeclared identifier is reported only once
scripts/mod/sumversion.c:384: error: for each function it appears in.)
scripts/mod/sumversion.c:384: warning: unused variable 'filelist'
make[5]: *** [scripts/mod/sumversion.o] Error 1
make[4]: *** [scripts/mod] Error 2
make[3]: *** [scripts] Error 2
make[3]: Leaving directory `/home/jesper/pmt_dev/R2_10-fox832/os/linux-2.6'
make[2]: *** [zImage] Error 2
make[2]: Leaving directory `/home/jesper/pmt_dev/R2_10-fox832/packages/os/linux-2.6'
make[1]: *** [do-install-recurse] Error 1
make[1]: Leaving directory `/home/jesper/pmt_dev/R2_10-fox832'
make: *** [everything] Error 2

The same problem has occurred on Debian Lenny as well.

Solution: Apply the patch below:

diff -b -u -p -r1.1.1.6 sumversion.c
--- os/linux-2.6/scripts/mod/sumversion.c       25 Jun 2006 12:58:28 -0000     1.1.1.6
+++ os/linux-2.6/scripts/mod/sumversion.c       20 Mar 2009 10:08:11 -0000
@@ -7,6 +7,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <string.h>
+#include <limits.h>
 #include "modpost.h"
 
 /*

Jesper Bengtsson 2009/03/20 11:09

1) , 2) You must have root-privileges
 
2.10_trouble_reports.txt · Last modified: 2009/03/20 11:10 by jesper
 
All text is available under the terms of the GNU Free Documentation License (see Copyrights for details).