kernel compilation

dragilla
Hello again :)

luke@dragilla:~/Desktop/moje/mini2440/linux-2.6.38.8$ make ARCH=arm
CROSS_COMPILE=arm-none-linux-gnueabi-
...
  CC      arch/arm/kernel/fiq.o
arch/arm/kernel/fiq.c: In function 'set_fiq_handler':
arch/arm/kernel/fiq.c:87: error: dereferencing pointer to incomplete type
arch/arm/kernel/fiq.c:87: error: dereferencing pointer to incomplete type
arch/arm/kernel/fiq.c:89: error: dereferencing pointer to incomplete type
arch/arm/kernel/fiq.c:89: error: dereferencing pointer to incomplete type
make[1]: *** [arch/arm/kernel/fiq.o] Error 1
make: *** [arch/arm/kernel] Error 2
luke@dragilla:~/Desktop/moje/mini2440/linux-2.6.38.8$

This is how it looks like
80:void set_fiq_handler(void *start, unsigned int length)
81:{
82:#if defined(CONFIG_CPU_USE_DOMAINS)
83:        memcpy((void *)0xffff001c, start, length);
84:#else
85:        memcpy(vectors_page + 0x1c, start, length);
86:#endif
87:        flush_icache_range(0xffff001c, 0xffff001c + length);
88:        if (!vectors_high())
89:                flush_icache_range(0x1c, 0x1c + length);
90:}

Any ideas?

dragilla
Anyone? Juergen - it's your kernel :)
Seems like some config option is missing as this error often appears when
some .h file is not icnluded. I'm digging my way to this knowledge but It's
really deep :/

antifish
which toolchain are you using?

dragilla
Toolchain is the one from the tutorial (code sourcery or something).
I'm pretty sure It's something with the kernel... It has xenomai 2.6.0
adeos-ipipe applied...
Now I found out that this patch modifies the lines reported by the
compiler. But how do I fix this? :/

dragilla
Response from xenomai developers:
Indeed, we need the definition of struct task_struct in
asm/cacheflush.h, the following patch should help:
http://git.xenomai.org/?p=ipipe-gch.git;a=commitdiff;h=ca2793e18d538d07a...

A new patch will be out soon.

dragilla
This solved the problem - kernel compiles.

serg_io
Does it work ?

dragilla
It does boot and show login prompt and let me login, but...
It prints out constantly:

...
mtd->read(0x654 bytes from 0x8179ac) returned ECC error
mtd->read(0x11f bytes from 0x81a000) returned ECC error
mtd->read(0x455 bytes from 0x819800) returned ECC error
...

For ever - it makes working impossible as I can't see what I'm writing and
the output.

Don't know what's wrong...
I edited the arch/arm/mach-s3c2440/mach-mini2440.c file to match my
partitions...

dragilla
I have CONFIG_MTD_PARTITIONS and CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED off
in this kernel. I'll try to turn it on as it was on in 2.6.35.9.

dragilla
Nope, that's not it. I'm open to suggestions :)

dragilla
The ECC errors start appearing when it mount the root partition.

This is what the kernel prints at boot:

S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c24xx-nand s3c2440-nand: Tacls=1, 9ns Twrph0=3 29ns, Twrph1=2 19ns
s3c24xx-nand s3c2440-nand: NAND hardware ECC
s3c24xx-nand s3c2440-nand: Using flash based BBT
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd3 (Samsung NAND 1GiB 3,3V
8-bit)
Creating 4 MTD partitions on "nand":
0x000000000000-0x000000040000 : "u-boot"
0x000000040000-0x000000060000 : "u-boot_env"
0x000000060000-0x000000560000 : "kernel"
0x000000560000-0x000040000000 : "rootfs"
s3c24xx-nand s3c2440-nand: clock idle support enabled

Seems ok. But then hell rises :(
I of course scrubbed the nand before flashing... 

I run out of ideas... could seem this kernel simply has a broken nand
driver but on the other hand this kernel is used by PTXdist.

Juergen, was it tested on the 1GB nand mini2440?

Juergen Beisert
Can you tell me the correct type of the NAND device? With "1GB" what do you
mean: 1 GiB (giga byte) or 1 GB (giga bit)?

I have here one Mini2440 with a K9F1G08 (= 1 GB (giga bit) = 256 MiB) and
one with K9F1208 (= 512 MB = 64 MiB) to test.

dragilla
Reading the chip inscription:
Samsung 125
K9K8G08U0B

From Samsung datasheet:
Offered in 1G x 8bit, the K9K8G08U0B is a 8G-bit NAND Flash Memory with
spare 256M-bit.

Juergen Beisert
The K9K8G08U0A is on my list of supported NAND devices. The K9K8G08U0B
seems a few years younger. But from their datasheets I see no difference in
their internal data. Both seems of SLC type and are using simple ECC.
Sorry, no idea what's wrong with your flash.

dragilla
Any hints on where to look for kernel code responsible for this?
Or maybe it is a configuration issue after all?

dragilla
I have an option to change my board to a 64MB version. If I can't manage to
fix this problem during the weekend I might us it ;)

Juergen Beisert
Did you mix software and hardware ECC? In the kernel config its possible to
use software ECC (maybe also in the bootloader). As the S3C2440 CPU has a
hardware unit to calculate the ECC, you should use hardware ECC *always*.
Also in the bootloader if you intend to change NAND content from the
bootloader.
NAND is a fixed component, so all software components in the system must
use the exact same settings, and *always*!

dragilla
CONFIG_MTD_NAND_ECC=y

this setting?
I had it also turned on in the 2.6.35.9 kernel and it worked.

dragilla
There is of course CONFIG_MTD_NAND_S3C2410_HWECC=y
But I see no software ECC setting.

Juergen Beisert
Software ECC is used, when CONFIG_MTD_NAND_S3C2410_HWECC is _not_ 'y'.

dragilla
I stripped the kernel of all the mods I made (tweking conf, xenomai).
I took fresh new 2.6.38.8 kernel and patched it with all you patches.
Then I took your suggested cfg: kernelconfig-2.6.38.
And I get tons of:
...
mtd->read(0x44c bytes from 0x3723b4) returned ECC error
mtd->read(0x44 bytes from 0x3723b4) returned ECC error
mtd->read(0x380 bytes from 0x372480) returned ECC error
...

But if I wait long enough it stops. The system is working... only it prints
out these comments every time it reads form mtd.

I guess you're not planning on finding a fix for that anytime soon?

regards,

Juergen Beisert
How should I do that? I have no way to reproduce your case (lack of 1 GiB
NAND)

dragilla
Theoretically we could do it together I suppose. I would be happy to help.
You can improve your product and I can have a working linux on my mini :)
Just tell me what to do if you think it's possible.

dragilla
Ok. I sent back my board. I'm getting a 64MB version. Never needed a bigger
one anyway :)