> On Thu, 04 Sep 2008 12:57:03 -0400, <[EMAIL PROTECTED]> wrote: > >> Hello, >> >> I am trying to build an uClinux image (with a 2.6 kernel) for a 5272 >> ucdimm (Arcturus) board. The ucdimm bootloader is uCbootloader. >> I am using the 20080811 version of the uClinux distribution. >> As a first step, i'd like boot an uClinux image with a romfs rootfs >> appended to the kernel binary. >> The image compilation went off very well. >> But uCbootloader fail to run the linux kernel after jumping to the >> 0x00020000 address. >> On the other hand, an image builded with a 2.4 linux kernel start >> nicely... >> As a difference between the 2.4 and 2.6 uclinux sources, i can see that >> the romvec section have been removed from the kernel binary... >> If i manage to build a 2.6 kernel by restoring the romvec section, the >> resulting image boot and run finely... >> I have the feeling i have done something wrong :) >> Any advice is welcome. > May I ask how you have changed the code? We don't use romvec for 2.6.21 > but > haven't verified this with the latest release.
Of course... "ugly" changes are joined to this mail :) If you have a reliable 2.6.21 kernel without romvec section... the point is that i probably have missed the real problem. Please, let me know your kernel configuration. It seems to me that without the romvec section, the ucbootloader kernel support is broken (for exemple the userspace printbenv based on ucbootloader syscall). Simon
uc5272-linux26.config
Description: Binary data
# HG changeset patch
# User Simon Guinot <[EMAIL PROTECTED]>
# Date 1220658953 0
# Node ID 622e1ae88d63003ae92e617bbedd9daef40c983b
# Parent 32706cd564bfd387e7a5a819fe59b42f2aca70e6
patch queue: uCbootloader.patch
diff -r 32706cd564bf -r 622e1ae88d63 linux-2.6.x/arch/m68knommu/kernel/vmlinux.lds.S
--- a/linux-2.6.x/arch/m68knommu/kernel/vmlinux.lds.S Fri Sep 05 23:54:17 2008 +0000
+++ b/linux-2.6.x/arch/m68knommu/kernel/vmlinux.lds.S Fri Sep 05 23:55:53 2008 +0000
@@ -34,12 +34,20 @@
#define DATA_ADDR
#endif
+#if defined(CONFIG_MTD_UCBOOTSTRAP_PARTS)
+#define BVEC_SIZE 0x00000400
+#endif
OUTPUT_ARCH(m68k)
ENTRY(_start)
MEMORY {
- ram : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
+#if defined(CONFIG_MTD_UCBOOTSTRAP_PARTS)
+ bvec : ORIGIN = RAM_START, LENGTH = BVEC_SIZE
+ ram : ORIGIN = RAM_START+BVEC_SIZE, LENGTH = RAM_LENGTH-BVEC_SIZE
+#else
+ ram : ORIGIN = RAM_START, LENGTH = RAM_LENGTH
+#endif
#ifdef ROM_START
romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH
rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH
@@ -58,6 +66,10 @@ SECTIONS {
*(.data.initvect)
} > romvec
#endif
+
+ .romvec : {
+ _romvec = .;
+ } > bvec
.text : {
_text = .;
diff -r 32706cd564bf -r 622e1ae88d63 linux-2.6.x/arch/m68knommu/platform/5272/config.c
--- a/linux-2.6.x/arch/m68knommu/platform/5272/config.c Fri Sep 05 23:54:17 2008 +0000
+++ b/linux-2.6.x/arch/m68knommu/platform/5272/config.c Fri Sep 05 23:55:53 2008 +0000
@@ -89,6 +89,21 @@ static void __init m5272_uarts_init(void
m5272_uart_init_line(line, m5272_uart_platform[line].irq);
}
+static void __init m5272_fec_init(void)
+{
+ volatile u32 v;
+
+ /* Enable the lines for the FEC */
+ v = readl(MCF_MBAR + MCFSIM_PBCNT);
+ v = (v & ~0xffff0000) | 0x55550000;
+ writel(v, MCF_MBAR + MCFSIM_PBCNT);
+
+ /* Active PHY interrupt on INT6 */
+ v = readl(MCF_MBAR + MCFSIM_PACNT);
+ v = (v & 0x3fffffff) | 0x40000000;
+ writel(v, MCF_MBAR + MCFSIM_PACNT);
+}
+
/***************************************************************************/
void mcf_disableall(void)
@@ -155,6 +170,7 @@ static int __init init_BSP(void)
static int __init init_BSP(void)
{
m5272_uarts_init();
+ m5272_fec_init();
platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices));
return 0;
}
diff -r 32706cd564bf -r 622e1ae88d63 linux-2.6.x/arch/m68knommu/platform/coldfire/vectors.c
--- a/linux-2.6.x/arch/m68knommu/platform/coldfire/vectors.c Fri Sep 05 23:54:17 2008 +0000
+++ b/linux-2.6.x/arch/m68knommu/platform/coldfire/vectors.c Fri Sep 05 23:55:53 2008 +0000
@@ -50,6 +50,25 @@ asmlinkage void system_call(void);
asmlinkage void system_call(void);
asmlinkage void inthandler(void);
+#if defined(CONFIG_MTD_UCBOOTSTRAP_PARTS)
+asm (
+ "\t.global _start, __ramend\n\t"
+ ".section .romvec\n"
+"e_vectors:\n\t"
+ ".long _ramend-4, _start, buserr, trap, trap, trap, trap, trap\n\t"
+ ".long trap, trap, trap, trap, trap, trap, trap, trap\n\t"
+ ".long trap, trap, trap, trap, trap, trap, trap, trap\n\t"
+ ".long inthandler, inthandler, inthandler, inthandler\n\t"
+ ".long inthandler, inthandler, inthandler, inthandler\n\t"
+ /* TRAP #0-15 */
+ ".long system_call, trap, trap, trap, trap, trap, trap, trap\n\t"
+ ".long trap, trap, trap, trap, trap, trap, trap, trap\n\t"
+ ".long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t"
+ ".text\n"
+"ignore: rte\n"
+);
+#endif
+
void __init init_vectors(void)
{
int i;
@@ -62,8 +81,15 @@ void __init init_vectors(void)
*/
for (i = 3; (i <= 23); i++)
_ramvec[i] = trap;
- for (i = 33; (i <= 63); i++)
- _ramvec[i] = trap;
+#if !defined(CONFIG_MTD_UCBOOTSTRAP_PARTS)
+ for (i = 33; (i <= 63); i++)
+ _ramvec[i] = trap;
+#else /* defined(CONFIG_MTD_UCBOOTSTRAP_PARTS) */
+ _ramvec[33] = trap;
+ /* skip trap #2; this is used as the uCbootloader callback */
+ for (i = 35; (i <= 63); i++)
+ _ramvec[i] = trap;
+#endif
for (i = 24; (i <= 31); i++)
_ramvec[i] = inthandler;
for (i = 64; (i < 255); i++)
diff -r 32706cd564bf -r 622e1ae88d63 linux-2.6.x/drivers/mtd/maps/Kconfig
--- a/linux-2.6.x/drivers/mtd/maps/Kconfig Fri Sep 05 23:54:17 2008 +0000
+++ b/linux-2.6.x/drivers/mtd/maps/Kconfig Fri Sep 05 23:55:53 2008 +0000
@@ -730,7 +730,7 @@ config MTD_ALTERA
config MTD_UCBOOTSTRAP
tristate "CFI Flash device mapped on uCbootloader Board"
- depends on MTD_CFI && UCBOOTSTRAP
+ depends on MTD_CFI && MTD_UCBOOTSTRAP_PARTS
help
This enables access to the Flash ROM chips on devices with the uCbootloader.
Say 'Y' if you are building a kernel for such a board._______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
