linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory
@ 2009-10-16 23:23 myuboot
  2009-10-16 23:41 ` myuboot
  2009-10-16 23:50 ` David Daney
  0 siblings, 2 replies; 27+ messages in thread
From: myuboot @ 2009-10-16 23:23 UTC (permalink / raw)
  To: linux-kernel

I am trying to use buildroot 2009.08 to compile kernel 2.6.31 for mips,
but it fails to error -" war.h can't be found". I used the same
buildroot to build kernel version 2.6.29 with no problem. 

Please give me some suggestion on how to fix this issue. The file 
./arch/mips/include/asm/war.h is there with no problem. Thanks a lot.

cp
/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/bin/mkimage
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/u-boot-tools
mkdir -p
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root/boot
mv
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/localversion*
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root/boot
mv: cannot stat
`/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/localversion*':
No such file or directory
make:
[/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/.depend_done]
Error 1 (ignored)
/usr/bin/make -j1 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=mips
INSTALL_MOD_PATH=/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root
CROSS_COMPILE=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/bin/mips-linux-uclibc-
LDFLAGS="-L/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/lib
-L/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/lib
--sysroot=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/"
LZMA="/home/root123/sources/buildroot-2009.08-k/toolchain_build_mips/bin/lzma"
PATH=/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/u-boot-tools:/home/root123/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/stuff/bitbake/bin
-C
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31
prepare
make[1]: Entering directory
`/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31'
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-mips
  CC      arch/mips/kernel/asm-offsets.s
In file included from
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/bitops.h:24,
                 from include/linux/bitops.h:17,
                 from include/linux/kernel.h:15,
                 from include/linux/sched.h:52,
                 from arch/mips/kernel/asm-offsets.c:13:
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:12:17:
error: war.h: No such file or directory
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:82:2:
error: #error Check setting of R4600_V1_INDEX_ICACHEOP_WAR for your
platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:112:2:
error: #error Check setting of R4600_V1_HIT_CACHEOP_WAR for your
platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:128:2:
error: #error Check setting of R4600_V2_HIT_CACHEOP_WAR for your
platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:141:2:
error: #error Check setting of R5432_CP0_INTERRUPT_WAR foryour platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:155:2:
error: #error Check setting of BCM1250_M3_WAR for your platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:162:2:
error: #error Check setting of SIBYTE_1956_WAR for your platform
/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:178:2:
error: #error Check setting of MIPS4K_ICACHE_REFILL_WAR for your
platform

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory
  2009-10-16 23:23 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory myuboot
@ 2009-10-16 23:41 ` myuboot
  2009-10-16 23:50 ` David Daney
  1 sibling, 0 replies; 27+ messages in thread
From: myuboot @ 2009-10-16 23:41 UTC (permalink / raw)
  To: linux-kernel

Sorry, I need to take the question back. I found war.h is a file I need
to created for my board. I forgot to copy it over. So no problem any
more.thanks.

On Fri, 16 Oct 2009 18:23 -0500, myuboot@fastmail.fm wrote:
> I am trying to use buildroot 2009.08 to compile kernel 2.6.31 for mips,
> but it fails to error -" war.h can't be found". I used the same
> buildroot to build kernel version 2.6.29 with no problem. 
> 
> Please give me some suggestion on how to fix this issue. The file 
> ./arch/mips/include/asm/war.h is there with no problem. Thanks a lot.
> 
> cp
> /home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/bin/mkimage
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/u-boot-tools
> mkdir -p
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root/boot
> mv
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/localversion*
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root/boot
> mv: cannot stat
> `/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/localversion*':
> No such file or directory
> make:
> [/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/.depend_done]
> Error 1 (ignored)
> /usr/bin/make -j1 HOSTCC="/usr/bin/gcc" HOSTCFLAGS="" ARCH=mips
> INSTALL_MOD_PATH=/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/root
> CROSS_COMPILE=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/bin/mips-linux-uclibc-
> LDFLAGS="-L/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/lib
> -L/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/usr/lib
> --sysroot=/home/root123/sources/buildroot-2009.08-k/build_mips/staging_dir/"
> LZMA="/home/root123/sources/buildroot-2009.08-k/toolchain_build_mips/bin/lzma"
> PATH=/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/u-boot-tools:/home/root123/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/stuff/bitbake/bin
> -C
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31
> prepare
> make[1]: Entering directory
> `/home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31'
>   CHK     include/linux/version.h
>   CHK     include/linux/utsrelease.h
>   SYMLINK include/asm -> include/asm-mips
>   CC      arch/mips/kernel/asm-offsets.s
> In file included from
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/bitops.h:24,
>                  from include/linux/bitops.h:17,
>                  from include/linux/kernel.h:15,
>                  from include/linux/sched.h:52,
>                  from arch/mips/kernel/asm-offsets.c:13:
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:12:17:
> error: war.h: No such file or directory
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:82:2:
> error: #error Check setting of R4600_V1_INDEX_ICACHEOP_WAR for your
> platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:112:2:
> error: #error Check setting of R4600_V1_HIT_CACHEOP_WAR for your
> platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:128:2:
> error: #error Check setting of R4600_V2_HIT_CACHEOP_WAR for your
> platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:141:2:
> error: #error Check setting of R5432_CP0_INTERRUPT_WAR foryour platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:155:2:
> error: #error Check setting of BCM1250_M3_WAR for your platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:162:2:
> error: #error Check setting of SIBYTE_1956_WAR for your platform
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/war.h:178:2:
> error: #error Check setting of MIPS4K_ICACHE_REFILL_WAR for your
> platform

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory
  2009-10-16 23:23 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory myuboot
  2009-10-16 23:41 ` myuboot
@ 2009-10-16 23:50 ` David Daney
  2009-10-19 23:49   ` myuboot
                     ` (3 more replies)
  1 sibling, 4 replies; 27+ messages in thread
From: David Daney @ 2009-10-16 23:50 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

mips-linux questions will get more attention if you send them to 
linux-mips@linux-mips.org.


myuboot@fastmail.fm wrote:
> I am trying to use buildroot 2009.08 to compile kernel 2.6.31 for mips,
> but it fails to error -" war.h can't be found". I used the same
> buildroot to build kernel version 2.6.29 with no problem. 
> 
> Please give me some suggestion on how to fix this issue. The file 
> ./arch/mips/include/asm/war.h is there with no problem. Thanks a lot.
> 
[...]
>   CC      arch/mips/kernel/asm-offsets.s
> In file included from
> /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/bitops.h:24,
>                  from include/linux/bitops.h:17,
>                  from include/linux/kernel.h:15,
>                  from include/linux/sched.h:52,
>                  from arch/mips/kernel/asm-offsets.c:13:

What does your .config look like?

Also try make V=1 so we can see the exact compiler command line that the 
build process is generating.

David Daney

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory
  2009-10-16 23:50 ` David Daney
@ 2009-10-19 23:49   ` myuboot
  2009-10-19 23:56   ` serial port 8250 messed up after coverting from little endian to big endian on kernel 2.6.31 myuboot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 27+ messages in thread
From: myuboot @ 2009-10-19 23:49 UTC (permalink / raw)
  To: David Daney; +Cc: linux-kernel, linux-mips

Thanks. This issue is fixed now. In 2.6.31 the directory
include/asm-mips  is moved as arch/mips/include/asm/. I need to change
my Makefile accordingly.

On Fri, 16 Oct 2009 16:50 -0700, "David Daney"
<ddaney@caviumnetworks.com> wrote:
> mips-linux questions will get more attention if you send them to 
> linux-mips@linux-mips.org.
> 
> 
> myuboot@fastmail.fm wrote:
> > I am trying to use buildroot 2009.08 to compile kernel 2.6.31 for mips,
> > but it fails to error -" war.h can't be found". I used the same
> > buildroot to build kernel version 2.6.29 with no problem. 
> > 
> > Please give me some suggestion on how to fix this issue. The file 
> > ./arch/mips/include/asm/war.h is there with no problem. Thanks a lot.
> > 
> [...]
> >   CC      arch/mips/kernel/asm-offsets.s
> > In file included from
> > /home/root123/sources/buildroot-2009.08-k/project_build_mips/f1/linux-2.6.31/arch/mips/include/asm/bitops.h:24,
> >                  from include/linux/bitops.h:17,
> >                  from include/linux/kernel.h:15,
> >                  from include/linux/sched.h:52,
> >                  from arch/mips/kernel/asm-offsets.c:13:
> 
> What does your .config look like?
> 
> Also try make V=1 so we can see the exact compiler command line that the 
> build process is generating.
> 
> David Daney

^ permalink raw reply	[flat|nested] 27+ messages in thread

* serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-16 23:50 ` David Daney
  2009-10-19 23:49   ` myuboot
@ 2009-10-19 23:56   ` myuboot
  2009-10-20  6:17     ` Florian Fainelli
  2009-11-11  0:22   ` Kernel panic - not syncing: Attempted to kill init! myuboot
  2010-01-19 19:51   ` loadable kernel module link failure - endianness incompatible with that of the selected emulation myuboot
  3 siblings, 1 reply; 27+ messages in thread
From: myuboot @ 2009-10-19 23:56 UTC (permalink / raw)
  To: linux-kernel, linux-mips

I am trying to bringup a MIPS32 board using 2.6.31. It is working in
little endian mode. After changing the board's hardware from little
endian to bit endian, the serial port print messed up. It prints now
something like - "àààààààààààààààà" on the screen. When I trace the
execution, I can see the string the kernel is trying print is correct -
"Linux version 2.6.31 ..." and etc.

I guess it means the initialization of the serial port is not properly
done. But I am not sure where I should check for the problem. The serial
port device I am using is 8250. Please give me some advise.

Thanks. 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-19 23:56   ` serial port 8250 messed up after coverting from little endian to big endian on kernel 2.6.31 myuboot
@ 2009-10-20  6:17     ` Florian Fainelli
  2009-10-20 15:52       ` myuboot
  2009-10-27 20:40       ` myuboot
  0 siblings, 2 replies; 27+ messages in thread
From: Florian Fainelli @ 2009-10-20  6:17 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

[-- Attachment #1: Type: Text/Plain, Size: 1116 bytes --]

Hi,

Le mardi 20 octobre 2009 01:56:04, myuboot@fastmail.fm a écrit :
> I am trying to bringup a MIPS32 board using 2.6.31. It is working in
> little endian mode. After changing the board's hardware from little
> endian to bit endian, the serial port print messed up. It prints now
> something like - "àààààààààààààààà" on the screen. When I trace the
> execution, I can see the string the kernel is trying print is correct -
> "Linux version 2.6.31 ..." and etc.
> 
> I guess it means the initialization of the serial port is not properly
> done. But I am not sure where I should check for the problem. The serial
> port device I am using is 8250. Please give me some advise.

If the same initialization routine used to work in little-endian, check how 
you actually write and read characters from the UART FIFO and especially if 
your hardware requires you to do word or byte access to these registers.

You can have a look at AR7, which has the same code working for Little and Big 
Endian modes in arch/mips/ar7/prom.c lines 272 to the end of the file. It also 
uses a 8250-compatible UART.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-20  6:17     ` Florian Fainelli
@ 2009-10-20 15:52       ` myuboot
  2009-10-27 20:40       ` myuboot
  1 sibling, 0 replies; 27+ messages in thread
From: myuboot @ 2009-10-20 15:52 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: linux-kernel, linux-mips

I happen to use the same code from ar7. So this part
serial_int/serial_out should be fine?

#define PORT(offset) (KSEG1ADDR(MY_MIPSBOARD_REGS_UART0 + (offset * 4)))
static inline unsigned int serial_in(int offset)
{
        return readl((void *)PORT(offset));
}

static inline void serial_out(int offset, int value)
{
        writel(value, (void *)PORT(offset));
}

Thanks. 



On Tue, 20 Oct 2009 08:17 +0200, "Florian Fainelli"
<florian@openwrt.org> wrote:
> Hi,
> 
> Le mardi 20 octobre 2009 01:56:04, myuboot@fastmail.fm a écrit :
> > I am trying to bringup a MIPS32 board using 2.6.31. It is working in
> > little endian mode. After changing the board's hardware from little
> > endian to bit endian, the serial port print messed up. It prints now
> > something like - "àààààààààààààààà" on the screen. When I trace the
> > execution, I can see the string the kernel is trying print is correct -
> > "Linux version 2.6.31 ..." and etc.
> > 
> > I guess it means the initialization of the serial port is not properly
> > done. But I am not sure where I should check for the problem. The serial
> > port device I am using is 8250. Please give me some advise.
> 
> If the same initialization routine used to work in little-endian, check
> how 
> you actually write and read characters from the UART FIFO and especially
> if 
> your hardware requires you to do word or byte access to these registers.
> 
> You can have a look at AR7, which has the same code working for Little
> and Big 
> Endian modes in arch/mips/ar7/prom.c lines 272 to the end of the file. It
> also 
> uses a 8250-compatible UART.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-20  6:17     ` Florian Fainelli
  2009-10-20 15:52       ` myuboot
@ 2009-10-27 20:40       ` myuboot
  2009-10-28  8:35         ` Shmulik Ladkani
  1 sibling, 1 reply; 27+ messages in thread
From: myuboot @ 2009-10-27 20:40 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: linux-kernel, linux-mips

Thanks, Florian. I found the cause of the problem. My board is 32 bit
based, so each serial port register is 32bit even only 8 bit is used. So
when the board is switched endianess, I need to change the address
offset to access the same registers.
For example, original RHR register address is 0x8001000 with little
endian mode. With big endian, I need to access it as 0x8001003.

On Tue, 20 Oct 2009 08:17 +0200, "Florian Fainelli"
<florian@openwrt.org> wrote:
> Hi,
> 
> Le mardi 20 octobre 2009 01:56:04, myuboot@fastmail.fm a écrit :
> > I am trying to bringup a MIPS32 board using 2.6.31. It is working in
> > little endian mode. After changing the board's hardware from little
> > endian to bit endian, the serial port print messed up. It prints now
> > something like - "àààààààààààààààà" on the screen. When I trace the
> > execution, I can see the string the kernel is trying print is correct -
> > "Linux version 2.6.31 ..." and etc.
> > 
> > I guess it means the initialization of the serial port is not properly
> > done. But I am not sure where I should check for the problem. The serial
> > port device I am using is 8250. Please give me some advise.
> 
> If the same initialization routine used to work in little-endian, check
> how 
> you actually write and read characters from the UART FIFO and especially
> if 
> your hardware requires you to do word or byte access to these registers.
> 
> You can have a look at AR7, which has the same code working for Little
> and Big 
> Endian modes in arch/mips/ar7/prom.c lines 272 to the end of the file. It
> also 
> uses a 8250-compatible UART.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-27 20:40       ` myuboot
@ 2009-10-28  8:35         ` Shmulik Ladkani
  2009-10-28 11:04           ` Sergei Shtylyov
  2009-12-04  1:52           ` PIR OFFSET for AR7 myuboot
  0 siblings, 2 replies; 27+ messages in thread
From: Shmulik Ladkani @ 2009-10-28  8:35 UTC (permalink / raw)
  To: myuboot; +Cc: Florian Fainelli, linux-kernel, linux-mips, shmulik

On Tue, 27 Oct 2009 15:40:13 -0500 myuboot@fastmail.fm wrote:
> Thanks, Florian. I found the cause of the problem. My board is 32 bit
> based, so each serial port register is 32bit even only 8 bit is used. So
> when the board is switched endianess, I need to change the address
> offset to access the same registers.
> For example, original RHR register address is 0x8001000 with little
> endian mode. With big endian, I need to access it as 0x8001003.

I assume your uart_port's iotype is defined as UPIO_MEM32.
UPIO_MEM32 makes 8250 access serial registers using readl/writel (which might
be a problem for big-endian), while UPIO_MEM makes 8250 access the registers
using readb/writeb.
Maybe you should try UPIO_MEM (assuming hardware allows byte access).

-- 
Shmulik Ladkani		Jungo Ltd.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-28  8:35         ` Shmulik Ladkani
@ 2009-10-28 11:04           ` Sergei Shtylyov
  2009-10-28 19:36             ` myuboot
  2009-12-04  1:52           ` PIR OFFSET for AR7 myuboot
  1 sibling, 1 reply; 27+ messages in thread
From: Sergei Shtylyov @ 2009-10-28 11:04 UTC (permalink / raw)
  To: Shmulik Ladkani
  Cc: myuboot, Florian Fainelli, linux-kernel, linux-mips, shmulik

Hello.

Shmulik Ladkani wrote:

>> Thanks, Florian. I found the cause of the problem. My board is 32 bit
>> based, so each serial port register is 32bit even only 8 bit is used. So
>> when the board is switched endianess, I need to change the address
>> offset to access the same registers.
>> For example, original RHR register address is 0x8001000 with little
>> endian mode. With big endian, I need to access it as 0x8001003.
>>     
>
> I assume your uart_port's iotype is defined as UPIO_MEM32.
>   

   He wouldn't have to add 3 to the register addresses then.

> UPIO_MEM32 makes 8250 access serial registers using readl/writel (which might
> be a problem for big-endian), while UPIO_MEM makes 8250 access the registers
> using readb/writeb.
>   

   Both may be a problem for big endian.

> Maybe you should try UPIO_MEM (assuming hardware allows byte access).

   Contrarywise, I think he now has UPIO_MEM and needs to try UPIO_MEM32.

WBR, Sergei



^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-28 11:04           ` Sergei Shtylyov
@ 2009-10-28 19:36             ` myuboot
  2009-10-29  8:26               ` Shmulik Ladkani
  0 siblings, 1 reply; 27+ messages in thread
From: myuboot @ 2009-10-28 19:36 UTC (permalink / raw)
  To: Sergei Shtylyov, Shmulik Ladkani
  Cc: Florian Fainelli, linux-kernel, linux-mips, shmulik

Sergei, Shmulik,

Thanks a lot for your suggestions. I was using UPIO_MEM since I was not
aware of the difference between UPIO_MEM and UPIO_MEM32. 

I just tried UPIO_MEM32 without adding a offset of 3. But the result is
bad - after the kernel initializes the serial console, the console print
out messes up. The early printk is fine because the u-boot initialises
the serial port fine. 

How I tried UPIO_MEM32 is in platform.c changing the iotype to
UPIO_MEM32 in the uart_port structure and passing the structure to
early_serial_setup. What I did is  the same as in
arch/mips/ar7/platform.c.

In 8250.c I removed the offset I added to mem_serial_out and
mem_serial_in. 
Did I miss anything? Thanks again for your help.

On Wed, 28 Oct 2009 14:04 +0300, "Sergei Shtylyov"
<sshtylyov@ru.mvista.com> wrote:
> Hello.
> 
> Shmulik Ladkani wrote:
> 
> >> Thanks, Florian. I found the cause of the problem. My board is 32 bit
> >> based, so each serial port register is 32bit even only 8 bit is used. So
> >> when the board is switched endianess, I need to change the address
> >> offset to access the same registers.
> >> For example, original RHR register address is 0x8001000 with little
> >> endian mode. With big endian, I need to access it as 0x8001003.
> >>     
> >
> > I assume your uart_port's iotype is defined as UPIO_MEM32.
> >   
> 
>    He wouldn't have to add 3 to the register addresses then.
> 
> > UPIO_MEM32 makes 8250 access serial registers using readl/writel (which might
> > be a problem for big-endian), while UPIO_MEM makes 8250 access the registers
> > using readb/writeb.
> >   
> 
>    Both may be a problem for big endian.
> 
> > Maybe you should try UPIO_MEM (assuming hardware allows byte access).
> 
>    Contrarywise, I think he now has UPIO_MEM and needs to try UPIO_MEM32.
> 
> WBR, Sergei
> 
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-28 19:36             ` myuboot
@ 2009-10-29  8:26               ` Shmulik Ladkani
  2009-11-02 23:54                 ` myuboot
  0 siblings, 1 reply; 27+ messages in thread
From: Shmulik Ladkani @ 2009-10-29  8:26 UTC (permalink / raw)
  To: myuboot
  Cc: Sergei Shtylyov, Florian Fainelli, linux-kernel, linux-mips, shmulik

On Wed, 28 Oct 2009 14:36:15 -0500 myuboot@fastmail.fm wrote:
> I just tried UPIO_MEM32 without adding a offset of 3. But the result is
> bad - after the kernel initializes the serial console, the console print
> out messes up. The early printk is fine because the u-boot initialises
> the serial port fine. 
> 
> Did I miss anything? Thanks again for your help.

I guess you did fine with UPIO_MEM32.

Keeping the UPIO_MEM32 approach, I suggest also to fiddle Y/N with
CONFIG_SWAP_IO_SPACE (might be that you have it set to Y while you don't
really need it, or vice versa).
This is since 'readl' uses 'ioswabl' for (potential) byte-swapping of the read
value. Take a look at asm/io.h and mangle-port.h.

Most important, read your hardware documentation to determine correct access
to the memory mapped serial registers.

-- 
Shmulik Ladkani		Jungo Ltd.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: serial port 8250 messed up after coverting from little endian to big endian on kernel  2.6.31
  2009-10-29  8:26               ` Shmulik Ladkani
@ 2009-11-02 23:54                 ` myuboot
  0 siblings, 0 replies; 27+ messages in thread
From: myuboot @ 2009-11-02 23:54 UTC (permalink / raw)
  To: Shmulik Ladkani
  Cc: Sergei Shtylyov, Florian Fainelli, linux-kernel, linux-mips, shmulik

The CONFIG_SWAP_IO_SPACE was set to Y, but I don't even see it using
xconfig or menuconfig. So I set it manually to n into .config file and
then did a compile - I am using buildroot. But somehow the value always
comes back to y after I type in command "make". The kernel image still
messes up the console after the console is handovered from early printk
to really ttyS01.

Thanks. 

On Thu, 29 Oct 2009 10:26 +0200, "Shmulik Ladkani"
<jungoshmulik@gmail.com> wrote:
> On Wed, 28 Oct 2009 14:36:15 -0500 myuboot@fastmail.fm wrote:
> > I just tried UPIO_MEM32 without adding a offset of 3. But the result is
> > bad - after the kernel initializes the serial console, the console print
> > out messes up. The early printk is fine because the u-boot initialises
> > the serial port fine. 
> > 
> > Did I miss anything? Thanks again for your help.
> 
> I guess you did fine with UPIO_MEM32.
> 
> Keeping the UPIO_MEM32 approach, I suggest also to fiddle Y/N with
> CONFIG_SWAP_IO_SPACE (might be that you have it set to Y while you don't
> really need it, or vice versa).
> This is since 'readl' uses 'ioswabl' for (potential) byte-swapping of the
> read
> value. Take a look at asm/io.h and mangle-port.h.
> 
> Most important, read your hardware documentation to determine correct
> access
> to the memory mapped serial registers.
> 
> -- 
> Shmulik Ladkani         Jungo Ltd.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Kernel panic - not syncing: Attempted to kill init!
  2009-10-16 23:50 ` David Daney
  2009-10-19 23:49   ` myuboot
  2009-10-19 23:56   ` serial port 8250 messed up after coverting from little endian to big endian on kernel 2.6.31 myuboot
@ 2009-11-11  0:22   ` myuboot
  2009-11-11  7:45     ` Gaye Abdoulaye Walsimou
  2010-01-19 19:51   ` loadable kernel module link failure - endianness incompatible with that of the selected emulation myuboot
  3 siblings, 1 reply; 27+ messages in thread
From: myuboot @ 2009-11-11  0:22 UTC (permalink / raw)
  To: linux-kernel, linux-mips

Hi, 

I got the following error trying to bring up the /sbin/init with Kernel
2.6.31 using cramfs filesystem on a MIPS 32 board:

[    1.160000] VFS: Mounted root (cramfs filesystem) readonly on device
31:2.
[    1.171000] Freeing unused kernel memory: 116k freed
[    1.223000] Kernel panic - not syncing: Attempted to kill init!
[    1.229000] Rebooting in 3 seconds..

Using BDI I know the kernel panic happens as soon as
run_init_process("/sbin/init") in init_post() is called. The filesystem
itself seems to be ok, because I can use 'ls' command under u-boot to
see /sbin/init is a symbolic link to busybox. Also the kernel seems to
like the filesystem and can mount the filesystem.  I have for checked
for similar questions for this error, so I tried replacing /sbin/init
with a hello world program, but the result is exactly the same. It seems
neither hello-world or /sbin/init got executed. 

At this point, I don't know how to debug this issue. Any suggestion on
how to debug this issue will be greatly appreciated.

Andrew

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2009-11-11  0:22   ` Kernel panic - not syncing: Attempted to kill init! myuboot
@ 2009-11-11  7:45     ` Gaye Abdoulaye Walsimou
  2009-11-11 15:48       ` myuboot
  2009-11-17  0:21       ` problem bring up initramfs and busybox myuboot
  0 siblings, 2 replies; 27+ messages in thread
From: Gaye Abdoulaye Walsimou @ 2009-11-11  7:45 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

myuboot@fastmail.fm wrote:
> Hi, 
>
> I got the following error trying to bring up the /sbin/init with Kernel
> 2.6.31 using cramfs filesystem on a MIPS 32 board:
>   

Just to be sure does:
$file vmlinux
$file busybox
give the same result?

Regards

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Kernel panic - not syncing: Attempted to kill init!
  2009-11-11  7:45     ` Gaye Abdoulaye Walsimou
@ 2009-11-11 15:48       ` myuboot
  2009-11-17  0:21       ` problem bring up initramfs and busybox myuboot
  1 sibling, 0 replies; 27+ messages in thread
From: myuboot @ 2009-11-11 15:48 UTC (permalink / raw)
  To: Gaye Abdoulaye Walsimou; +Cc: linux-kernel, linux-mips


On Wed, 11 Nov 2009 08:45 +0100, "Gaye Abdoulaye Walsimou"
<walsimou@walsimou.com> wrote:
> myuboot@fastmail.fm wrote:
> > Hi, 
> >
> > I got the following error trying to bring up the /sbin/init with Kernel
> > 2.6.31 using cramfs filesystem on a MIPS 32 board:
> >   
> 
> Just to be sure does:
> $file vmlinux
> $file busybox
> give the same result?
> 
> Regards
The file result looks ok. The readelf result looks fine too.

file linux-2.6.31/vmlinux root/bin/busybox
linux-2.6.31/vmlinux: ELF 32-bit MSB executable, MIPS, MIPS32 version 1
(SYSV), statically linked, not stripped
root/bin/busybox:     setuid ELF 32-bit MSB executable, MIPS, MIPS32
version 1 (SYSV), dynamically linked (uses shared libs), stripped

Thanks, Andrew

^ permalink raw reply	[flat|nested] 27+ messages in thread

* problem bring up initramfs and busybox
  2009-11-11  7:45     ` Gaye Abdoulaye Walsimou
  2009-11-11 15:48       ` myuboot
@ 2009-11-17  0:21       ` myuboot
  2009-11-17  9:33         ` Ralf Baechle
  1 sibling, 1 reply; 27+ messages in thread
From: myuboot @ 2009-11-17  0:21 UTC (permalink / raw)
  To: linux-kernel, linux-mips

I have been struggling to bring up a MIPS 32 board with busybox with or
without initramfs.
The kernel stucks there without the shell coming up.

[    1.153000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[    1.161000] ip_tables: (C) 2000-2006 Netfilter Core Team
[    1.167000] TCP cubic registered
[    1.170000] NET: Registered protocol family 17
[   25.971000] Freeing unused kernel memory: 1032k freed
[   39.969000] Algorithmics/MIPS FPU Emulator v1.5


What I tried here is to use initramfs with statically linked busybox.
The initramfs seems to be up, and runs the commands in the /init one by
one, and then it goes to a inifite loop in r4k_wait at
arch/mips/kernel/genex.S.

The following is the execution sequense when it runs /init. Can anyone
give me some idea what is wrong?

Thanks, Andrew


Breakpoint 2, do_execve (filename=0x9780a000 "/bin/sh", argv=0x4f73a4,
envp=0x4f73ac, regs=0x97997f30) at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/sbin/switch_root",
argv=0x4f7450, envp=0x4f7464, regs=0x97819f30) at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/usr/sbin/switch_root",
argv=0x4f7450, envp=0x4f7464, regs=0x97819f30) at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/bin/switch_root",
argv=0x4f7450, envp=0x4f7464, regs=0x97819f30) at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/usr/bin/switch_root",
argv=0x4f7450, envp=0x4f7464, regs=0x97819f30) at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.
^C
Program received signal SIGSTOP, Stopped (signal).
r4k_wait () at arch/mips/kernel/genex.S:147
147             jr      ra

-- And here is the content of /init script - 
#!/bin/busybox sh

# Mount the /proc and /sys filesystems.
mount -t proc none /proc
mount -t sysfs none /sys

mdev -s
/bin/sh

# Do your stuff here.
echo "This script mounts rootfs and boots it up, nothing more!"

# Mount the root filesystem.
mount -o ro /dev/mtdblock4 /mnt/root

# Clean up.
umount /proc
umount /sys

# Boot the real thing.
exec switch_root /mnt/root /sbin/init

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17  0:21       ` problem bring up initramfs and busybox myuboot
@ 2009-11-17  9:33         ` Ralf Baechle
  2009-11-17 17:39           ` myuboot
  0 siblings, 1 reply; 27+ messages in thread
From: Ralf Baechle @ 2009-11-17  9:33 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

On Mon, Nov 16, 2009 at 06:21:21PM -0600, myuboot@fastmail.fm wrote:

> I have been struggling to bring up a MIPS 32 board with busybox with or
> without initramfs.
> The kernel stucks there without the shell coming up.
> 
> [    1.153000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
> [    1.161000] ip_tables: (C) 2000-2006 Netfilter Core Team
> [    1.167000] TCP cubic registered
> [    1.170000] NET: Registered protocol family 17
> [   25.971000] Freeing unused kernel memory: 1032k freed
> [   39.969000] Algorithmics/MIPS FPU Emulator v1.5
> 
> 
> What I tried here is to use initramfs with statically linked busybox.
> The initramfs seems to be up, and runs the commands in the /init one by
> one, and then it goes to a inifite loop in r4k_wait at
> arch/mips/kernel/genex.S.

r4k_wait is called by the idle loop.  Which means the kernel has no process
to run so runs the idle loop.  This might be because there is no other
process left running or because all processes are waiting for I/O for
example.  So it's not uncommon that even busy systems ocasionally briefly
run the idle loop.  In other words, seeing the processor executing
r4k_wait does not necessarily mean something went wrong.  In this case -
also along with the other information you've provieded it's not obvious
what has gone wrong.

  Ralf

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17  9:33         ` Ralf Baechle
@ 2009-11-17 17:39           ` myuboot
  2009-11-17 17:48             ` Florian Fainelli
  0 siblings, 1 reply; 27+ messages in thread
From: myuboot @ 2009-11-17 17:39 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-kernel, linux-mips



On Tue, 17 Nov 2009 10:33 +0100, "Ralf Baechle" <ralf@linux-mips.org>
wrote:
> On Mon, Nov 16, 2009 at 06:21:21PM -0600, myuboot@fastmail.fm wrote:
> 
> > I have been struggling to bring up a MIPS 32 board with busybox with or
> > without initramfs.
> > The kernel stucks there without the shell coming up.
> > 
> > [    1.153000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
> > [    1.161000] ip_tables: (C) 2000-2006 Netfilter Core Team
> > [    1.167000] TCP cubic registered
> > [    1.170000] NET: Registered protocol family 17
> > [   25.971000] Freeing unused kernel memory: 1032k freed
> > [   39.969000] Algorithmics/MIPS FPU Emulator v1.5
> > 
> > 
> > What I tried here is to use initramfs with statically linked busybox.
> > The initramfs seems to be up, and runs the commands in the /init one by
> > one, and then it goes to a inifite loop in r4k_wait at
> > arch/mips/kernel/genex.S.
> 
> r4k_wait is called by the idle loop.  Which means the kernel has no
> process
> to run so runs the idle loop.  This might be because there is no other
> process left running or because all processes are waiting for I/O for
> example.  So it's not uncommon that even busy systems ocasionally briefly
> run the idle loop.  In other words, seeing the processor executing
> r4k_wait does not necessarily mean something went wrong.  In this case -
> also along with the other information you've provieded it's not obvious
> what has gone wrong.
> 
>   Ralf

According to an email from Kevin, I added a symbolic link from
switch_root to busybox. The switch_root seems to be found now based on
the execution sequence, but I got the following error - "Kernel panic -
not syncing: Attempted to kill init!". This is the same error when I
tried to start the shell without initramfs. Something must be wrong, but
I can't quite figure out.

[    9.250000] Freeing unused kernel memory: 1032k freed
[   10.463000] Algorithmics/MIPS FPU Emulator v1.5
[   41.695000] Kernel panic - not syncing: Attempted to kill init!
[   41.701000] Rebooting in 3 seconds.

Thanks for your help. Andrew

(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
envp=0x943dd230, regs=0x97819e30)
    at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/sbin/switch_root",
argv=0x4f7450, envp=0x4f7464, regs=0x97819f30)
    at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17 17:39           ` myuboot
@ 2009-11-17 17:48             ` Florian Fainelli
  2009-11-17 21:09               ` myuboot
  0 siblings, 1 reply; 27+ messages in thread
From: Florian Fainelli @ 2009-11-17 17:48 UTC (permalink / raw)
  To: myuboot; +Cc: Ralf Baechle, linux-kernel, linux-mips

Hi,

On Tuesday 17 November 2009 18:39:40 myuboot@fastmail.fm wrote:
> On Tue, 17 Nov 2009 10:33 +0100, "Ralf Baechle" <ralf@linux-mips.org>
> 
> wrote:
> > On Mon, Nov 16, 2009 at 06:21:21PM -0600, myuboot@fastmail.fm wrote:
> > > I have been struggling to bring up a MIPS 32 board with busybox with or
> > > without initramfs.
> > > The kernel stucks there without the shell coming up.
> > >
> > > [    1.153000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
> > > [    1.161000] ip_tables: (C) 2000-2006 Netfilter Core Team
> > > [    1.167000] TCP cubic registered
> > > [    1.170000] NET: Registered protocol family 17
> > > [   25.971000] Freeing unused kernel memory: 1032k freed
> > > [   39.969000] Algorithmics/MIPS FPU Emulator v1.5
> > >
> > >
> > > What I tried here is to use initramfs with statically linked busybox.
> > > The initramfs seems to be up, and runs the commands in the /init one by
> > > one, and then it goes to a inifite loop in r4k_wait at
> > > arch/mips/kernel/genex.S.
> >
> > r4k_wait is called by the idle loop.  Which means the kernel has no
> > process
> > to run so runs the idle loop.  This might be because there is no other
> > process left running or because all processes are waiting for I/O for
> > example.  So it's not uncommon that even busy systems ocasionally briefly
> > run the idle loop.  In other words, seeing the processor executing
> > r4k_wait does not necessarily mean something went wrong.  In this case -
> > also along with the other information you've provieded it's not obvious
> > what has gone wrong.
> >
> >   Ralf
> 
> According to an email from Kevin, I added a symbolic link from
> switch_root to busybox. The switch_root seems to be found now based on
> the execution sequence, but I got the following error - "Kernel panic -
> not syncing: Attempted to kill init!". This is the same error when I
> tried to start the shell without initramfs. Something must be wrong, but
> I can't quite figure out.
> 
> [    9.250000] Freeing unused kernel memory: 1032k freed
> [   10.463000] Algorithmics/MIPS FPU Emulator v1.5
> [   41.695000] Kernel panic - not syncing: Attempted to kill init!
> [   41.701000] Rebooting in 3 seconds.
> 
> Thanks for your help. Andrew
> 
> (gdb) c
> Continuing.
> 
> Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
> envp=0x943dd230, regs=0x97819e30)
>     at fs/exec.c:1293
> 1293            retval = unshare_files(&displaced);
> (gdb) c
> Continuing.
> 
> Breakpoint 2, do_execve (filename=0x9780a000 "/sbin/switch_root",
> argv=0x4f7450, envp=0x4f7464, regs=0x97819f30)
>     at fs/exec.c:1293
> 1293            retval = unshare_files(&displaced);
> (gdb) c
> Continuing.

If you happen to use uClibc and gcc-4.4.0 or superior, make sure that you have 
that patch applied to uClibc: http://www.mail-
archive.com/uclibc@uclibc.org/msg04483.html
--
WBR, Florian

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: problem bring up initramfs and busybox
  2009-11-17 17:48             ` Florian Fainelli
@ 2009-11-17 21:09               ` myuboot
  0 siblings, 0 replies; 27+ messages in thread
From: myuboot @ 2009-11-17 21:09 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: Ralf Baechle, linux-kernel, linux-mips



On Tue, 17 Nov 2009 18:48 +0100, "Florian Fainelli"
<florian@openwrt.org> wrote:
> Hi,
> 
> On Tuesday 17 November 2009 18:39:40 myuboot@fastmail.fm wrote:
> > On Tue, 17 Nov 2009 10:33 +0100, "Ralf Baechle" <ralf@linux-mips.org>
> > 
> > wrote:
> > > On Mon, Nov 16, 2009 at 06:21:21PM -0600, myuboot@fastmail.fm wrote:
> > > > I have been struggling to bring up a MIPS 32 board with busybox with or
> > > > without initramfs.
> > > > The kernel stucks there without the shell coming up.
> > > >
> > > > [    1.153000] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
> > > > [    1.161000] ip_tables: (C) 2000-2006 Netfilter Core Team
> > > > [    1.167000] TCP cubic registered
> > > > [    1.170000] NET: Registered protocol family 17
> > > > [   25.971000] Freeing unused kernel memory: 1032k freed
> > > > [   39.969000] Algorithmics/MIPS FPU Emulator v1.5
> > > >
> > > >
> > > > What I tried here is to use initramfs with statically linked busybox.
> > > > The initramfs seems to be up, and runs the commands in the /init one by
> > > > one, and then it goes to a inifite loop in r4k_wait at
> > > > arch/mips/kernel/genex.S.
> > >
> > > r4k_wait is called by the idle loop.  Which means the kernel has no
> > > process
> > > to run so runs the idle loop.  This might be because there is no other
> > > process left running or because all processes are waiting for I/O for
> > > example.  So it's not uncommon that even busy systems ocasionally briefly
> > > run the idle loop.  In other words, seeing the processor executing
> > > r4k_wait does not necessarily mean something went wrong.  In this case -
> > > also along with the other information you've provieded it's not obvious
> > > what has gone wrong.
> > >
> > >   Ralf
> > 
> > According to an email from Kevin, I added a symbolic link from
> > switch_root to busybox. The switch_root seems to be found now based on
> > the execution sequence, but I got the following error - "Kernel panic -
> > not syncing: Attempted to kill init!". This is the same error when I
> > tried to start the shell without initramfs. Something must be wrong, but
> > I can't quite figure out.
> > 
> > [    9.250000] Freeing unused kernel memory: 1032k freed
> > [   10.463000] Algorithmics/MIPS FPU Emulator v1.5
> > [   41.695000] Kernel panic - not syncing: Attempted to kill init!
> > [   41.701000] Rebooting in 3 seconds.
> > 
> > Thanks for your help. Andrew
> > 
> > (gdb) c
> > Continuing.
> > 
> > Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
> > envp=0x943dd230, regs=0x97819e30)
> >     at fs/exec.c:1293
> > 1293            retval = unshare_files(&displaced);
> > (gdb) c
> > Continuing.
> > 
> > Breakpoint 2, do_execve (filename=0x9780a000 "/sbin/switch_root",
> > argv=0x4f7450, envp=0x4f7464, regs=0x97819f30)
> >     at fs/exec.c:1293
> > 1293            retval = unshare_files(&displaced);
> > (gdb) c
> > Continuing.
> 
> If you happen to use uClibc and gcc-4.4.0 or superior, make sure that you
> have 
> that patch applied to uClibc: http://www.mail-
> archive.com/uclibc@uclibc.org/msg04483.html
> --
> WBR, Florian

Yes, I am using uClibc and gcc-4.4.1. So I went ahead and applied the
patch on
./toolchain_build_mips/uClibc-0.9.30.1/libc/sysdeps/linux/mips/bits/syscalls.h.
After that I touched ./toolchain_build_mips/uClibc-0.9.30.1/.configured
and rerun make. But the result is the same - "Kernel panic - not
syncing: Attempted to kill init!". Any of your suggestions will be
welcome. I have tried various things such as changes in init script or
using hello_world as the init, but the result is very similar. Thanks a
lot. Andrew

Breakpoint 1, init_post () at init/main.c:839
839             async_synchronize_full();
(gdb) enable 2
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/init", argv=0x943dd2bc,
envp=0x943dd230, regs=0x97819e30)
    at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.

Breakpoint 2, do_execve (filename=0x9780a000 "/sbin/busybox",
argv=0x4f7478, envp=0x4f748c, regs=0x97819f30)
    at fs/exec.c:1293
1293            retval = unshare_files(&displaced);
(gdb) c
Continuing.
^C
Program received signal SIGSTOP, Stopped (signal).
r4k_wait () at arch/mips/kernel/genex.S:147
147             jr      ra
Current language:  auto; currently asm

^ permalink raw reply	[flat|nested] 27+ messages in thread

* PIR OFFSET for AR7
  2009-10-28  8:35         ` Shmulik Ladkani
  2009-10-28 11:04           ` Sergei Shtylyov
@ 2009-12-04  1:52           ` myuboot
  2009-12-04 16:03             ` Thomas Bogendoerfer
  1 sibling, 1 reply; 27+ messages in thread
From: myuboot @ 2009-12-04  1:52 UTC (permalink / raw)
  To: linux-kernel, linux-mips

Hi, What is the use of PIR register for AR7 board in file
arch/mips/ar7/irq.c? If I understand it right, PIR is used to define the
polarity of the interrupts. It seems to me that it needs to initialized?

Best regards, Andrew

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: PIR OFFSET for AR7
  2009-12-04  1:52           ` PIR OFFSET for AR7 myuboot
@ 2009-12-04 16:03             ` Thomas Bogendoerfer
  2009-12-04 17:30               ` myuboot
  0 siblings, 1 reply; 27+ messages in thread
From: Thomas Bogendoerfer @ 2009-12-04 16:03 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

On Thu, Dec 03, 2009 at 07:52:30PM -0600, myuboot@fastmail.fm wrote:
> Hi, What is the use of PIR register for AR7 board in file
> arch/mips/ar7/irq.c?

it gives back the channel and line of the pending interrupt with the
highest priority.

> If I understand it right, PIR is used to define the
> polarity of the interrupts. It seems to me that it needs to initialized?

no, it's a read only register. Why do you think it has something to do
with interrupt polarity ?

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessary a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: PIR OFFSET for AR7
  2009-12-04 16:03             ` Thomas Bogendoerfer
@ 2009-12-04 17:30               ` myuboot
  0 siblings, 0 replies; 27+ messages in thread
From: myuboot @ 2009-12-04 17:30 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-kernel, linux-mips

Thomas,

Sorry, you are right. I mistook PM_OFFSET for PIR_OFFSET.

Thanks, Andrew
On Fri, 04 Dec 2009 17:03 +0100, "Thomas Bogendoerfer"
<tsbogend@alpha.franken.de> wrote:
> On Thu, Dec 03, 2009 at 07:52:30PM -0600, myuboot@fastmail.fm wrote:
> > Hi, What is the use of PIR register for AR7 board in file
> > arch/mips/ar7/irq.c?
> 
> it gives back the channel and line of the pending interrupt with the
> highest priority.
> 
> > If I understand it right, PIR is used to define the
> > polarity of the interrupts. It seems to me that it needs to initialized?
> 
> no, it's a read only register. Why do you think it has something to do
> with interrupt polarity ?
> 
> Thomas.
> 
> -- 
> Crap can work. Given enough thrust pigs will fly, but it's not necessary
> a
> good idea.                                                [ RFC1925, 2.3
> ]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* loadable kernel module link failure -  endianness incompatible with that of the selected emulation
  2009-10-16 23:50 ` David Daney
                     ` (2 preceding siblings ...)
  2009-11-11  0:22   ` Kernel panic - not syncing: Attempted to kill init! myuboot
@ 2010-01-19 19:51   ` myuboot
  2010-01-19 23:47     ` David Daney
  3 siblings, 1 reply; 27+ messages in thread
From: myuboot @ 2010-01-19 19:51 UTC (permalink / raw)
  To: linux-kernel, linux-mips

I got a link error when compiling 2 loadable kernel modules -
"endianness incompatible with that of the selected emulation". 

But both kernel and the kernel modules of error are in big endian. I
don't know what I should check or fix. Any suggestions? I checked the
endianess of the kernel by checking the elf header of vmlinux file, is
that the right way to do it?

Below are the error info and the readelf output, showing both the kernel
and a kernel module are in big endian.
Thanks for your help. Andrew

1) error log 
make -C /home/root123/sources/kernel/linux
CROSS_COMPILE=""/home/root123/sources/gcc3.4.3-be"/bin/mips-linux-"
M=/home/root123/sources/sdk/platform/src/linux/mxp/src modules    

  LD [M]  /home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o
/home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
/home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
compiled for a big endian system and target is little endian
/home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
/home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
endianness incompatible with that of the selected emulation
/home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld: failed to merge
target specific data of file
/home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o
make[13]: ***
[/home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o] Error 1

2) kernel is in big endian
readelf -h vmlinux
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           MIPS R3000
  Version:                           0x1
  Entry point address:               0x941aa000
  Start of program headers:          52 (bytes into file)
  Start of section headers:          1720624 (bytes into file)
  Flags:                             0x50001001, noreorder, o32, mips32
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         1
  Size of section headers:           40 (bytes)
  Number of section headers:         27
  Section header string table index: 24


3) kernel module is big endian.
readelf -h mmxpcore.o
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              REL (Relocatable file)
  Machine:                           MIPS R3000
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          81024 (bytes into file)
  Flags:                             0x10001001, noreorder, o32, mips2
  Size of this header:               52 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           40 (bytes)
  Number of section headers:         34
  Section header string table index: 31


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: loadable kernel module link failure -  endianness incompatible with that of the selected emulation
  2010-01-19 19:51   ` loadable kernel module link failure - endianness incompatible with that of the selected emulation myuboot
@ 2010-01-19 23:47     ` David Daney
  2010-01-20 16:10       ` myuboot
  0 siblings, 1 reply; 27+ messages in thread
From: David Daney @ 2010-01-19 23:47 UTC (permalink / raw)
  To: myuboot; +Cc: linux-kernel, linux-mips

myuboot@fastmail.fm wrote:
> I got a link error when compiling 2 loadable kernel modules -
> "endianness incompatible with that of the selected emulation". 
> 
> But both kernel and the kernel modules of error are in big endian. I
> don't know what I should check or fix. Any suggestions? I checked the
> endianess of the kernel by checking the elf header of vmlinux file, is
> that the right way to do it?
> 
> Below are the error info and the readelf output, showing both the kernel
> and a kernel module are in big endian.
> Thanks for your help. Andrew
> 
> 1) error log 
> make -C /home/root123/sources/kernel/linux
> CROSS_COMPILE=""/home/root123/sources/gcc3.4.3-be"/bin/mips-linux-"
> M=/home/root123/sources/sdk/platform/src/linux/mxp/src modules    
> 
>   LD [M]  /home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o
> /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
> /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
> compiled for a big endian system and target is little endian
> /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
> /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
> endianness incompatible with that of the selected emulation
> /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld: failed to merge
> target specific data of file
> /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o
> make[13]: ***
> [/home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o] Error 1
> 

Looks like a toolchain bug/configuration-problem.  Hard to tell though 
as you didn't pass 'V=1' on the make invocation line.

David Daney

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: loadable kernel module link failure -  endianness incompatible with that of the selected emulation
  2010-01-19 23:47     ` David Daney
@ 2010-01-20 16:10       ` myuboot
  0 siblings, 0 replies; 27+ messages in thread
From: myuboot @ 2010-01-20 16:10 UTC (permalink / raw)
  To: David Daney; +Cc: linux-kernel, linux-mips



On Tue, 19 Jan 2010 15:47 -0800, "David Daney"
<ddaney@caviumnetworks.com> wrote:
> myuboot@fastmail.fm wrote:
> > I got a link error when compiling 2 loadable kernel modules -
> > "endianness incompatible with that of the selected emulation". 
> > 
> > But both kernel and the kernel modules of error are in big endian. I
> > don't know what I should check or fix. Any suggestions? I checked the
> > endianess of the kernel by checking the elf header of vmlinux file, is
> > that the right way to do it?
> > 
> > Below are the error info and the readelf output, showing both the kernel
> > and a kernel module are in big endian.
> > Thanks for your help. Andrew
> > 
> > 1) error log 
> > make -C /home/root123/sources/kernel/linux
> > CROSS_COMPILE=""/home/root123/sources/gcc3.4.3-be"/bin/mips-linux-"
> > M=/home/root123/sources/sdk/platform/src/linux/mxp/src modules    
> > 
> >   LD [M]  /home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o
> > /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
> > /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
> > compiled for a big endian system and target is little endian
> > /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld:
> > /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o:
> > endianness incompatible with that of the selected emulation
> > /home/root123/sources/gcc3.4.3-be/bin/mips-linux-ld: failed to merge
> > target specific data of file
> > /home/root123/sources/sdk/platform/src/linux/mxp/src/mmxpcore.o
> > make[13]: ***
> > [/home/root123/sources/sdk/platform/src/linux/mxp/src/mxpmod.o] Error 1
> > 
> 
> Looks like a toolchain bug/configuration-problem.  Hard to tell though 
> as you didn't pass 'V=1' on the make invocation line.
> 
> David Daney
With the V=1 option suggested, I found the culprit is this "-m
elf32ltsmip". It is working now.

Thanks. Andrew

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2010-01-20 16:10 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-16 23:23 2.6.31 kernel for mips compile failure - war.h:12:17: error: war.h: No such file or directory myuboot
2009-10-16 23:41 ` myuboot
2009-10-16 23:50 ` David Daney
2009-10-19 23:49   ` myuboot
2009-10-19 23:56   ` serial port 8250 messed up after coverting from little endian to big endian on kernel 2.6.31 myuboot
2009-10-20  6:17     ` Florian Fainelli
2009-10-20 15:52       ` myuboot
2009-10-27 20:40       ` myuboot
2009-10-28  8:35         ` Shmulik Ladkani
2009-10-28 11:04           ` Sergei Shtylyov
2009-10-28 19:36             ` myuboot
2009-10-29  8:26               ` Shmulik Ladkani
2009-11-02 23:54                 ` myuboot
2009-12-04  1:52           ` PIR OFFSET for AR7 myuboot
2009-12-04 16:03             ` Thomas Bogendoerfer
2009-12-04 17:30               ` myuboot
2009-11-11  0:22   ` Kernel panic - not syncing: Attempted to kill init! myuboot
2009-11-11  7:45     ` Gaye Abdoulaye Walsimou
2009-11-11 15:48       ` myuboot
2009-11-17  0:21       ` problem bring up initramfs and busybox myuboot
2009-11-17  9:33         ` Ralf Baechle
2009-11-17 17:39           ` myuboot
2009-11-17 17:48             ` Florian Fainelli
2009-11-17 21:09               ` myuboot
2010-01-19 19:51   ` loadable kernel module link failure - endianness incompatible with that of the selected emulation myuboot
2010-01-19 23:47     ` David Daney
2010-01-20 16:10       ` myuboot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).