Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12620 Discussions

about cfi-flash for DE2 board....

Altera_Forum
Honored Contributor II
2,836 Views

hi hippo 

 

my cif-flash addr is 0x0800000. 

Dose i need to change my cfi-flash addr mapping MTD partition of altera.c ? 

 

Thx !
0 Kudos
32 Replies
Altera_Forum
Honored Contributor II
254 Views

hi hippo 

 

I already add "init=/init" in kernel command line that meet the same problem ,again. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif  

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

uClinux/Nios II 

Altera Nios II support © 2004 Microtronix Datacom Ltd. 

Built 1 zonelists 

Kernel command line: root=/dev/mtdblock0 rootfstype=jffs2 init=/init 

PID hash table entries: 64 (order: 6, 1024 bytes) 

Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) 

Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) 

Memory available: 6768k/8192k RAM, 0k/0k ROM (1185k kernel code, 144k data) 

Mount-cache hash table entries: 512 

SCSI subsystem initialized 

usbcore: registered new driver usbfs 

usbcore: registered new driver hub 

JFFS2 version 2.2. (NAND) © 2001-2003 Red Hat, Inc. 

io scheduler noop registered 

io scheduler deadline registered (default) 

Serial: JTAG UART driver $Revision: 1.4 $ 

ttyJ0 at MMIO 0x80481120 (irq = 1) is a jtag_uart 

Altera NDK flash (AMD): Found 1 x16 devices at 0x0 in 8-bit bank 

Amd/Fujitsu Extended Query Table at 0x0040 

number of CFI chips: 1 

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. 

cmdlinepart partition parsing not available 

RedBoot partition parsing not available 

Using Altera NDK partition definition 

Creating 1 MTD partitions on "Altera NDK flash (AMD)": 

0x00000000-0x00400000 : "jffs2" 

usbmon: debugfs is not available 

driver isp1362-hcd, 2005-04-04 

isp1362-hcd isp1362-hcd: ISP1362 Host Controller 

isp1362_hc_reset: 

isp1362-hcd isp1362-hcd: new USB bus registered, assigned bus number 1 

isp1362-hcd isp1362-hcd: irq 4, io mem 0x804810d0 

isp1362_hc_start: 

isp1362-hcd isp1362-hcd: ISP1362 Memory usage: 

isp1362-hcd isp1362-hcd: ISTL:    2 *  256:      512 @ $0000:$0100 

isp1362-hcd isp1362-hcd: INTL: 16 * ( 64+8):  1152 @ $0200 

isp1362-hcd isp1362-hcd: ATL : 32 * ( 64+8):  2304 @ $0680 

isp1362-hcd isp1362-hcd: USED/FREE: 3968    128 

usb usb1: configuration# 1 chosen from 1 choice 

hub 1-0:1.0: USB hub found 

hub 1-0:1.0: 2 ports detected 

ISP1362 Host Controller, irq 4 

Initializing USB Mass Storage driver... 

usbcore: registered new driver usb-storage 

USB Mass Storage support registered. 

VFS: Mounted root (jffs2 filesystem) readonly. 

Freeing unused kernel memory: 44k freed (0x938000 - 0x942000) 

Warning: unable to open an initial console. 

Failed to execute /init.  Attempting defaults... 

Kernel panic - not syncing: No init found.  Try passing init= option to kernel[/b] 

--- Quote End ---  

 

 

Thx in advance !
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

the "init= " is not needed. 

 

Try initramfs again, and mount the jffs2 to /mnt 

Check if you have /mnt/init, which is sym-link. 

if you do not have it, copy it again. 

 

mount -t jffs2 /dev/mtdblock0 /mnt 

cd /mnt 

ls -l 

cp -a /init . 

cd / 

umount /mnt 

 

Config kernel command line "root=/dev/mtdblock0 rw rootfstype=jffs2"
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

 

--- Quote Start ---  

originally posted by hippo@Jun 1 2006, 08:39 AM 

the "init= " is not needed. 

 

try initramfs again, and mount the jffs2 to /mnt 

check if you have /mnt/init, which is sym-link. 

if you do not have it, copy it again. 

 

mount -t jffs2 /dev/mtdblock0 /mnt 

cd /mnt 

ls -l 

cp -a /init . 

cd / 

umount /mnt 

config kernel command line "root=/dev/mtdblock0 rw rootfstype=jffs2" 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15764) 

--- quote end ---  

 

--- Quote End ---  

 

 

hi hippo 

 

I can find "init" in mnt dir on uclinux. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

BusyBox v1.1.1-pre0 (2006.04.20-12:52+0000) Built-in shell (msh) 

Enter &#39;help&#39; for a list of built-in commands. 

# mount -t jffs2 /dev/mtdblock0 /mnt# cd /mnt# ls -l 

lrwxrwxrwx    1 root  root        10 Nov 29 17:02 init -> /sbin/init 

# cd /# umount /mnt# [/b] 

--- Quote End ---  

 

 

Why i disable initramfs patch to empty that can not boot kernel successfully for every time ? 

and how to do that next step ? 

 

Thx !!!!!!!!!!
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

It looks like your jffs2 contains only the init link, but where are other dirs?

0 Kudos
Altera_Forum
Honored Contributor II
254 Views

 

--- Quote Start ---  

originally posted by hippo@Jun 1 2006, 08:10 PM 

it looks like your jffs2 contains only the init link, but where are other dirs? 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15779) 

--- quote end ---  

 

--- Quote End ---  

 

 

hi hippo 

 

sorry , i forgot to copy some dirs to mnt dir on uclinux. 

1.i use initramfs and kernel command line is "root=/dev/mtdblock0 rw rootfstype=jiffs2". 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

# mount -t jffs2 /dev/mtdblock0 /mnt# cd /mnt# ls# mkdir proc sys var tmp mnt# cp -a /init /etc /dev /bin /sbin /lib /usr /root /home .# ls 

bin   etc   init  mnt   root  sys   usr 

dev   home  lib   proc  sbin  tmp   var# pwd 

/mnt# umount /mnt 

umount: Couldn&#39;t umount /mnt: Inappropriate ioctl for device# cd  /# umount /mnt# [/b] 

--- Quote End ---  

 

 

2. i don&#39;t use initramfs and prebuild some dir in /rootfs/mnt dir . such as /proc /bin /home ... 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

uClinux/Nios II 

Altera Nios II support © 2004 Microtronix Datacom Ltd. 

Built 1 zonelists 

Kernel command line: root=/dev/mtdblock0 rw rootfstype=jiffs2 init=/initPID hash table entries: 64 (order: 6, 1024 bytes) 

Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) 

Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) 

Memory available: 6768k/8192k RAM, 0k/0k ROM (1185k kernel code, 144k data) 

Mount-cache hash table entries: 512 

SCSI subsystem initialized 

usbcore: registered new driver usbfs 

usbcore: registered new driver hub 

JFFS2 version 2.2. (NAND) © 2001-2003 Red Hat, Inc. 

io scheduler noop registered 

io scheduler deadline registered (default) 

Serial: JTAG UART driver $Revision: 1.4 $ 

ttyJ0 at MMIO 0x80481120 (irq = 1) is a jtag_uart 

Altera NDK flash (AMD): Found 1 x16 devices at 0x0 in 8-bit bank 

Amd/Fujitsu Extended Query Table at 0x0040 

number of CFI chips: 1 

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. 

cmdlinepart partition parsing not available 

RedBoot partition parsing not available 

Using Altera NDK partition definition 

Creating 1 MTD partitions on "Altera NDK flash (AMD)": 

0x00000000-0x00400000 : "jffs2" 

usbmon: debugfs is not available 

driver isp1362-hcd, 2005-04-04 

isp1362-hcd isp1362-hcd: ISP1362 Host Controller 

isp1362_hc_reset: 

isp1362-hcd isp1362-hcd: new USB bus registered, assigned bus number 1 

isp1362-hcd isp1362-hcd: irq 4, io mem 0x804810d0 

isp1362_hc_start: 

isp1362-hcd isp1362-hcd: ISP1362 Memory usage: 

isp1362-hcd isp1362-hcd: ISTL:    2 *  256:      512 @ $0000:$0100 

isp1362-hcd isp1362-hcd: INTL: 16 * ( 64+8):  1152 @ $0200 

isp1362-hcd isp1362-hcd: ATL : 32 * ( 64+8):  2304 @ $0680 

isp1362-hcd isp1362-hcd: USED/FREE: 3968    128 

usb usb1: configuration# 1 chosen from 1 choice 

hub 1-0:1.0: USB hub found 

hub 1-0:1.0: 2 ports detected 

ISP1362 Host Controller, irq 4 

Initializing USB Mass Storage driver... 

usbcore: registered new driver usb-storage 

USB Mass Storage support registered. 

VFS: Cannot open root device "mtdblock0" or unknown-block(31,0) 

Please append a correct "root=" boot option 

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,0)[/b] 

--- Quote End ---  

 

How to do that next step ? 

 

Thx !
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

Kernel command line: root=/dev/mtdblock0 rw rootfstype=jiffs2 init=/init[/b] 

--- Quote End ---  

 

You have a typo, it should be jffs2 .
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

hi hippo 

 

I don&#39;t use initramfs and not find init from booting messages.now 

 

when i use initramfs that can execute command on linux, and can mount mtdblock to /mnt dir. but no init in /mnt dir 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

uClinux/Nios II 

Altera Nios II support © 2004 Microtronix Datacom Ltd. 

Built 1 zonelists 

Kernel command line: root=/dev/mtdblock0 rw rootfstype=jffs2 init=/init 

PID hash table entries: 64 (order: 6, 1024 bytes) 

Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) 

Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) 

Memory available: 6768k/8192k RAM, 0k/0k ROM (1185k kernel code, 144k data) 

Mount-cache hash table entries: 512 

SCSI subsystem initialized 

usbcore: registered new driver usbfs 

usbcore: registered new driver hub 

JFFS2 version 2.2. (NAND) © 2001-2003 Red Hat, Inc. 

io scheduler noop registered 

io scheduler deadline registered (default) 

Serial: JTAG UART driver $Revision: 1.4 $ 

ttyJ0 at MMIO 0x80481120 (irq = 1) is a jtag_uart 

Altera NDK flash (AMD): Found 1 x16 devices at 0x0 in 8-bit bank 

Amd/Fujitsu Extended Query Table at 0x0040 

number of CFI chips: 1 

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. 

cmdlinepart partition parsing not available 

RedBoot partition parsing not available 

Using Altera NDK partition definition 

Creating 1 MTD partitions on "Altera NDK flash (AMD)": 

0x00000000-0x00400000 : "jffs2" 

usbmon: debugfs is not available 

driver isp1362-hcd, 2005-04-04 

isp1362-hcd isp1362-hcd: ISP1362 Host Controller 

isp1362_hc_reset: 

isp1362-hcd isp1362-hcd: new USB bus registered, assigned bus number 1 

isp1362-hcd isp1362-hcd: irq 4, io mem 0x804810d0 

isp1362_hc_start: 

isp1362-hcd isp1362-hcd: ISP1362 Memory usage: 

isp1362-hcd isp1362-hcd: ISTL:    2 *  256:      512 @ $0000:$0100 

isp1362-hcd isp1362-hcd: INTL: 16 * ( 64+8):  1152 @ $0200 

isp1362-hcd isp1362-hcd: ATL : 32 * ( 64+8):  2304 @ $0680 

isp1362-hcd isp1362-hcd: USED/FREE: 3968    128 

usb usb1: configuration# 1 chosen from 1 choice 

hub 1-0:1.0: USB hub found 

hub 1-0:1.0: 2 ports detected 

ISP1362 Host Controller, irq 4 

Initializing USB Mass Storage driver... 

usbcore: registered new driver usb-storage 

USB Mass Storage support registered. 

VFS: Mounted root (jffs2 filesystem). 

Freeing unused kernel memory: 44k freed (0x938000 - 0x942000) 

Warning: unable to open an initial console. 

Failed to execute /init.  Attempting defaults... 

Kernel panic - not syncing: No init found.  Try passing init= option to kernel.[/b] 

--- Quote End ---  

 

 

When i don&#39;t use initramfs why can not find init from boot messages ? 

 

THx !
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

The key point is that you need a full rootfs on you jffs2 drive. 

One way to do it is using mkfs.jffs2 on your Linux host. But we use another approach here, we copy them from initramfs. 

 

When you use initramfs, you should not have root=/dev/mtdblock0 in the kernel command string. try "cat /proc/mounts" . 

 

When you use jffs2 for root, you should not use initramfs. 

You don&#39;t need the "init=/init" in kernel command string. 

Just "root=/dev/mtdblock0 rw rootfs=jffs2" should be enough. 

 

Now check again if you have the proper rootfs in the jffs2 drive. 

boot with initramfs, 

mount the jffs2 drive, and "ls -l" to get its content.
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

 

--- Quote Start ---  

originally posted by hippo@Jun 2 2006, 06:09 AM 

the key point is that you need a full rootfs on you jffs2 drive. 

one way to do it is using mkfs.jffs2 on your linux host. but we use another approach here, we copy them from initramfs. 

 

when you use initramfs, you should not have root=/dev/mtdblock0 in the kernel command string. try "cat /proc/mounts" . 

 

when you use jffs2 for root, you should not use initramfs. 

you don&#39;t need the "init=/init" in kernel command string. 

just "root=/dev/mtdblock0 rw rootfs=jffs2" should be enough. 

 

now check again if you have the proper rootfs in the jffs2 drive. 

boot with initramfs, 

mount the jffs2 drive, and "ls -l" to get its content. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15796) 

--- quote end ---  

 

--- Quote End ---  

 

 

hi hippo 

 

Thank u ! 

 

When i mount mtdblock0 to /mnt dir that can see some dir in there. 

 

1. I use initramfs and no kernel command string 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

# mount -t jffs2 /dev/mtdblock0 /mnt# cd /mnt# ls -l 

drwxr-xr-x    2 500      500          0 Nov 29 17:00 bin 

drwxr-xr-x    6 root  root            0 Nov 29 17:00 dev 

drwxr-xr-x    4 500      500          0 Nov 29 17:00 etc 

drwxr-xr-x    3 500      500          0 Nov 29 17:00 home 

lrwxrwxrwx    1 root  root        10 Nov 29 17:02 init -> /sbin/init 

drwxr-xr-x    2 500      500          0 Nov 29 17:00 lib 

drwxr-xr-x    2 root  root            0 Nov 29 17:01 mnt 

drwxr-xr-x    2 500      500          0 Nov 29 17:00 opt 

drwxr-xr-x    2 root  root            0 Nov 29 17:01 proc 

drwxr-xr-x    2 500      500          0 Nov 29 17:00 root 

drwxr-xr-x    2 500      500          0 Nov 29 17:00 sbin 

drwxr-xr-x    2 root  root            0 Nov 29 17:01 sys 

drwxr-xr-x    2 root  root            0 Nov 29 17:01 tmp 

drwxr-xr-x    2 root  root            0 Nov 29 17:01 var# cd /# umount /mnt# [/b] 

--- Quote End ---  

 

 

2. I don&#39;t use initramfs and have "root=/dev/mtdblock0 rw rootfs=jffs2" kernel command string 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

uClinux/Nios II 

Altera Nios II support © 2004 Microtronix Datacom Ltd. 

Built 1 zonelists 

Kernel command line: root=/dev/mtdblock0 rw rootfs=jffs2 

PID hash table entries: 64 (order: 6, 1024 bytes) 

Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) 

Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) 

Memory available: 6768k/8192k RAM, 0k/0k ROM (1185k kernel code, 144k data) 

Mount-cache hash table entries: 512 

SCSI subsystem initialized 

usbcore: registered new driver usbfs 

usbcore: registered new driver hub 

JFFS2 version 2.2. (NAND) © 2001-2003 Red Hat, Inc. 

io scheduler noop registered 

io scheduler deadline registered (default) 

Serial: JTAG UART driver $Revision: 1.4 $ 

ttyJ0 at MMIO 0x80481120 (irq = 1) is a jtag_uart 

Altera NDK flash (AMD): Found 1 x16 devices at 0x0 in 8-bit bank 

Amd/Fujitsu Extended Query Table at 0x0040 

number of CFI chips: 1 

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. 

cmdlinepart partition parsing not available 

RedBoot partition parsing not available 

Using Altera NDK partition definition 

Creating 1 MTD partitions on "Altera NDK flash (AMD)": 

0x00000000-0x00400000 : "jffs2" 

usbmon: debugfs is not available 

driver isp1362-hcd, 2005-04-04 

isp1362-hcd isp1362-hcd: ISP1362 Host Controller 

isp1362_hc_reset: 

isp1362-hcd isp1362-hcd: new USB bus registered, assigned bus number 1 

isp1362-hcd isp1362-hcd: irq 4, io mem 0x804810d0 

isp1362_hc_start: 

isp1362-hcd isp1362-hcd: ISP1362 Memory usage: 

isp1362-hcd isp1362-hcd: ISTL:    2 *  256:      512 @ $0000:$0100 

isp1362-hcd isp1362-hcd: INTL: 16 * ( 64+8):  1152 @ $0200 

isp1362-hcd isp1362-hcd: ATL : 32 * ( 64+8):  2304 @ $0680 

isp1362-hcd isp1362-hcd: USED/FREE: 3968    128 

usb usb1: configuration# 1 chosen from 1 choice 

hub 1-0:1.0: USB hub found 

hub 1-0:1.0: 2 ports detected 

ISP1362 Host Controller, irq 4 

Initializing USB Mass Storage driver... 

usbcore: registered new driver usb-storage 

USB Mass Storage support registered. 

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,0)[/b] 

--- Quote End ---  

 

 

finally , I can&#39;t boot the kernel ....... http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif  

 

Why ? 

 

Thx !
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

One minor problem in your rootfs, the uid/gid of bin etc... is 500/500, which is incorrect. 

 

If your user id and group id on Linux are not 500, change these to your id instead. This will be used to map user file/dir ownership to root in initramfs. 

 

General setup --> (for new kernels) 

OR 

Device Drivers --> Block devices --> (for 2.6.11-uc0) 

(500) User ID to map to 0 (user root) 

(500) Group ID to map to 0 (group root) 

 

Add a dir /root to jffs2. 

 

Then rebuild the kernel. And make the jffs2 rootfs data again.
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

hi hippo 

 

I have mkdir a /root dir in jffs on uclinux that can see some dirs in root dir. 

Is it right that you said ? 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

BusyBox v1.1.1-pre0 (2006.04.20-12:52+0000) Built-in shell (msh) 

Enter &#39;help&#39; for a list of built-in commands. 

# mount -t jffs2 /dev/mtdblock0 /mnt# cd /mnt# ls -l 

drwxr-xr-x 15 root  root            0 Nov 29 17:04 root# cd /mnt/root# ls -l 

drwxr-xr-x    6 root  root            0 Nov 29 17:00 dev 

drwxr-xr-x    4 root  root            0 Nov 29 17:00 etc 

drwxr-xr-x    3 root  root            0 Nov 29 17:00 home 

lrwxrwxrwx    1 root  root        10 Nov 29 17:04 init -> /sbin/init 

drwxr-xr-x    2 root  root            0 Nov 29 17:00 lib 

drwxr-xr-x    2 root  root            0 Nov 29 17:03 mnt 

drwxr-xr-x    2 root  root            0 Nov 29 17:00 opt 

drwxr-xr-x    2 root  root            0 Nov 29 17:03 proc 

drwxr-xr-x    2 root  root            0 Nov 29 17:00 root 

drwxr-xr-x    2 root  root            0 Nov 29 17:00 sbin 

drwxr-xr-x    2 root  root            0 Nov 29 17:03 sys 

drwxr-xr-x    2 root  root            0 Nov 29 17:03 tmp 

drwxr-xr-x    5 root  root            0 Nov 29 17:00 usr 

drwxr-xr-x    2 root  root            0 Nov 29 17:03 var# cd /# umount /mnt# [/b] 

--- Quote End ---  

 

 

How to do that next step ? 

 

Thx !
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

Sorry, you have /mnt/root already (it was my mistake). 

Please rebuild your /mnt root fs, not under /mnt/root . 

And try rebuild the kernel with root jffs2.
0 Kudos
Reply