[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Petalinux, BusyBox and rx



Hi Lancer,

Have you selected the "ROM" model in the kernel configuration (Processor Type and Featuers -> Memory Model)?

This should default to leaving the filesystem in flash. If you look at drivers/mtd/maps/mb_auto.c - you can see the handling required in an MTD mapping driver for the CONFIG_MODEL_ROM option. Basically:

#ifdef CONFIG_MODEL_RAM
        romfs_loc = &_ebss;
#endif
#ifdef CONFIG_MODEL_ROM
        romfs_loc = &__bss_lma;
#endif

We should also fold this change into the generic uclinux.c mapping driver - I will add a ticket to cover this for a future peatlinux release.

Regards,

John

Lancer Evo wrote:
Hi.
I've some trouble with uClinux on Spartan 3 (only 1 MB RAM and no flash...).
With an image.bin of 704 KB (with only the necessary option enabled)
the response is:

Kernel panic: VFS: Unable to mount root fs on 1f:00

As written in this article:
http://www.ucdot.org/article.pl?sid=03/01/11/1049210&mode=thread

I've modded the /drivers/mtd/maps/uclinux.c and /init/do_mounts.c code:

do_mounts.c
[...]
static int __init root_dev_setup(char *line)
{
    int i;
    char ch;

    ROOT_DEV = name_to_kdev_t(line);
    memset (root_device_name, 0, sizeof root_device_name);
    if (strncmp (line, "/dev/", 5) == 0) line += 5;
    for (i = 0; i < sizeof root_device_name - 1; ++i)
    {
        ch = line[i];
        if ( isspace (ch) || (ch == ',') || (ch == '\0') ) break;
        root_device_name[i] = ch;
    }
    return 1;
}

/*
MODDED CODE START
*/

// declare the root addr kernel cmdline option
unsigned long root_addr= 0;

static int __init root_add_setup(char *line)
{
       root_addr = simple_strtol(line,NULL,0);
       printk(" set up root_addr as 0x%x\n",root_addr);
       return 1;

}
__setup("rootaddr=", root_add_setup); //psw

/*
MODDED CODE END
*/


__setup("root=", root_dev_setup);

static char * __initdata root_mount_data;
static int __init root_data_setup(char *str)
{
    root_mount_data = str;
    return 1;
}

static char * __initdata root_fs_names;
static int __init fs_names_setup(char *str)
{
    root_fs_names = str;
    return 1;
}

[...]

uclinux.c
[...]
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
#include <asm/io.h>

/****************************************************************************/

/*
MODDED CODE START
*/

extern long root_addr;

/*
MODDED CODE END
*/

__u8 uclinux_read8(struct map_info *map, unsigned long ofs)
{
    return(*((__u8 *) (map->map_priv_1 + ofs)));
}

[...]

/****************************************************************************/

int __init uclinux_mtd_init(void)
{
/*
MODDED CODE START
*/

    int use_root_addr = 0;

       if ( root_addr != 0 ) {
         if (strncmp((char *) root_addr, "-rom1fs-", 8) == 0) {
           printk(" RA found a possible rootfs at 0x%x\n",root_addr);
           use_root_addr = 1
         } else {
           printk(" RA no rootfs at 0x%x\n",root_addr);
         }
       }

       if (strncmp((char *) &_flashstart, "-rom1fs-", 8) == 0) {
         printk(" FS found a possible rootfs at 0x%x\n",&_flashstart);
       } else {
         printk(" FS no rootfs at 0x%x\n",&_flashstart);
       }

/*
MODDED CODE END
*/
    struct mtd_info *mtd;
    struct map_info *mapp;
    extern char _ebss;

    mapp = &uclinux_ram_map;
    mapp->map_priv_2 = (unsigned long) &_ebss;
    mapp->size = PAGE_ALIGN(ntohl(*((unsigned long *)((&_ebss) + 8))));
    mapp->buswidth = 4;

    printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n",
               (int) mapp->map_priv_2, (int) mapp->size);

    mapp->map_priv_1 = (unsigned long)
        ioremap_nocache(mapp->map_priv_2, mapp->size);

    if (mapp->map_priv_1 == 0) {
        printk("uclinux[mtd]: ioremap_nocache() failed\n");
        return(-EIO);
    }

    mtd = do_map_probe("map_ram", mapp);
    if (!mtd) {
        printk("uclinux[mtd]: failed to find a mapping?\n");
        iounmap((void *) mapp->map_priv_1);
        return(-ENXIO);
    }

[...]

But now make process ends with error:

binfmt_flat.c: In function `decompress_exec':
binfmt_flat.c:294: warning: label `out' defined but not used
binfmt_flat.c: In function `calc_v5_reloc':
binfmt_flat.c:384: warning: unused variable `usptr'
binfmt_flat.c:385: warning: unused variable `offset'
binfmt_flat.c:385: warning: unused variable `opcode'
rm -f fs.o
mb-ld   -r -o fs.o open.o read_write.o devices.o file_table.o buffer.o
super.o block_dev.o char_dev.o stat.o exec.o pipe.o namei.o fcntl.o
ioctl.o readdir.o select.o fifo.o locks.o dcache.o inode.o attr.o
bad_inode.o file.o iobuf.o dnotify.o filesystems.o namespace.o
seq_file.o xattr.o quota.o binfmt_script.o binfmt_flat.o proc/proc.o
partitions/partitions.o ramfs/ramfs.o
make[3]: Leaving directory `/usr/src/uClinux-dist/linux-2.4.x/fs'
make[2]: Leaving directory `/usr/src/uClinux-dist/linux-2.4.x/fs'
make[1]: Leaving directory `/usr/src/uClinux-dist/linux-2.4.x'
make: *** [linux] Error 1

How to solve this "Kernel panic" error?

Thanks

Regards

Lancer
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/



___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/