Forum Discussion
Altera_Forum
Honored Contributor
20 years agoHi Scott,
I fixed my NiosII uClinux and the MTD partitions boot as below: uClinux/Nios II Altera Nios II support © 2004 Microtronix Datacom Ltd. Built 1 zonelists Kernel command line: root=/dev/mtdblock0 ro PID hash table entries: 256 (order: 8, 4096 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory available: 30720k/32768k RAM, 0k/0k ROM (1416k kernel code, 298k data) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) NET: Registered protocol family 16 NIOS serial driver version 0.0 ttyS0 (irq = 4) is a builtin NIOS UART io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize smc_probe: 85000 Khz Nios SMSC LAN91C111 Driver (v2.1), (Linux Kernel 2.6) eth0: SMC91C11xFD(rev:1) at 0x82210300 IRQ:6 MEMSIZE:8192b NOWAIT:0 ADDR: 00:07:ed:0f:63:08 smc_probe: 85000 Khz Nios Altera NDK flash (AMD): Found 1 x16 devices at 0x0 in 8-bit bank Amd/Fujitsu Extended Query Table at 0x0040 Altera NDK flash (AMD): CFI does not contain boot bank location. Assuming top. 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 4 MTD partitions on "Altera NDK flash (AMD)": 0x00200000-0x00600000 : "romfs/jffs2" 0x00000000-0x00200000 : "loader/kernel" 0x00600000-0x00700000 : "User configuration" 0x00700000-0x00800000 : "safe configuration" NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP established hash table entries: 2048 (order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash tables configured (established 2048 bind 2048) NET: Registered protocol family 1 NET: Registered protocol family 17 VFS: Mounted root (romfs filesystem) readonly. Freeing unused kernel memory: 60k freed (0x418c000 - 0x419a000) expand: from=/ramfs.img to=/dev/ram0 expand: from=/ramfs.img to=/dev/ram1 eth0:PHY 100BaseT eth0:PHY Half Duplex /etc/issue www.microtronix.com June 2005 Welcome to Linux on the Nios II Nios2 login: root Password: # cat /proc/devices Character devices: 1 mem 2 pty 3 ttyp 4 ttyS 5 /dev/tty 5 /dev/console 5 /dev/ptmx 10 misc 90 mtd 128 ptm 136 pts Block devices: 1 ramdisk 31 mtdblock# cat /proc/mtd dev: size erasesize name mtd0: 00400000 00010000 "romfs/jffs2" mtd1: 00200000 00010000 "loader/kernel" mtd2: 00100000 00010000 "User configuration" mtd3: 00100000 00010000 "safe configuration"# mknod /var/mtd0 c 90 0# mknod /var/mtd1 c 90 1# mknod /var/mtd2 c 90 2# mknod /var/mtd3 c 90 3# ls -la /var drwxr-xr-x 3 root root 1024 Nov 30 00:03 . drwxr-xr-x 1 root root 32 Jan 1 1970 .. drwxr-xr-x 2 root root 12288 Oct 8 1998 lost+found crw-r--r-- 1 root root 90, 0 Nov 30 00:02 mtd0 crw-r--r-- 1 root root 90, 1 Nov 30 00:02 mtd1 crw-r--r-- 1 root root 90, 2 Nov 30 00:03 mtd2 crw-r--r-- 1 root root 90, 3 Nov 30 00:03 mtd3 1. I make 4 MTD character devices on /var for character mode direct access FLASH using open, ioctl, read. This method is correct or not? int fd; fd = open ("/dev/mtd0", O_RDWR); etc. 2. >(2) Create a device table file and use the -D, --devtable option to mkfs.jffs2 Could you explain the -D, --devtable option and how to use? Thanks, Best Regards,