News:

Re-organized the forum to more cleanly delineate the development section, as the end user support side appears to have taken a life of its own!

Author Topic: 2.6  (Read 19710 times)

  • No avatar
  • *****
July 03, 2011, 12:31:16 am
I have 2.6 working, just finishing up romfs and drivers.
I'll upload a zip of my files later.

Its a bit tight on 8M devices though.

Code: [Select]
Executing image 7 ...
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.38.2 (root@t60loz) (gcc version 4.2.4) #4 Sat Jul 2 15:23:01 CST 2011
CPU: Nuvoton-nuc700 [41807000] revision 0 (ARMv4T), cr=00000000
CPU: VIVT data cache, VIVT instruction cache
Machine: NUC745EVB
CPU type 0x00000745 is NUC745
The GPIO_CFG4 is 0x55555,  not equal to 0x155555, maybe using by boot!
The GPIO_CFG5 is 0x15555555,  not equal to 0x0, maybe using by boot!
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 2032
Kernel command line: root=/dev/ram0 console=ttyS0,115200n8 rdinit=/bin/init  mem=8M
PID hash table entries: 32 (order: -5, 128 bytes)
Dentry cache hash table entries: 1024 (order: 0, 4096 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 8MB = 8MB total
Memory: 5776k/5776k available, 2416k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0x00000000 - 0x00001000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0x00000000 - 0xffffffff   (4095 MB)
    lowmem  : 0x00000000 - 0x00800000   (   8 MB)
    modules : 0x00000000 - 0x00800000   (   8 MB)
      .init : 0x00008000 - 0x0001e000   (  88 kB)
      .text : 0x0001e000 - 0x001ff000   (1924 kB)
      .data : 0x00200000 - 0x002158a0   (  87 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:31
Console: colour dummy device 80x30
Calibrating delay loop... 39.42 BogoMIPS (lpj=197120)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 16
io scheduler noop registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xfff80000 (irq = 9) is a 16550
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
nuc700-ohci nuc700-ohci: NUC700 OHCI
nuc700-ohci nuc700-ohci: new USB bus registered, assigned bus number 1
nuc700-ohci nuc700-ohci: irq 15, io mem 0xfff05000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: NUC700 OHCI
usb usb1: Manufacturer: Linux 2.6.38.2 ohci_hcd
usb usb1: SerialNumber: ohci_hcd
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
Linux video capture interface: v2.00
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v1.0.0)
TCP cubic registered
NET: Registered protocol family 17
« Last Edit: July 16, 2011, 02:33:15 am by admin »

  • No avatar
  • *****
July 03, 2011, 03:12:00 am
As I have 16M ram and 4M flash, thinking of this for layout.

0x000000 - 0x020000 - bootloader and boot_info
0x020000 - 0x220000 - Kernel (2M)
0x220000 - 0x320000 - ROMFS (1M)
0x320000 - 0x330000 - Data Partion for settings
0x330000 - 0x400000 - WebUI

Add 0x7F to above for physical location in flash.

Thoughts?

eg

Code: [Select]
static struct mtd_partition nuc745_flash_partitions[] = {
        [0] =
        {
                .name   =       "Linux Kernel Partition (2M)",
                .size   =       0x200000,  /*2M Kernel */
                .offset =       0x020000,  /*Starts at 0x7F020000 */
        },
        [1] =
        {
                .name   =       "ROMFS Partition (1M)",
                .size   =       0x100000,  /*ROMFS 1M */
                .offset =       0x220000,  /*Starts at 0x7F2200000 */
        },

        [2] =
        {
                .name   =       "Data Partition (64KB)",
                .size   =       0x10000,  /*Data Partition */
                .offset =       0x320000,  /*Starts at 0x7F3200000 */
        },
        [3] =
        {
                .name   =       "WebUI Partition (the rest)",
                .size   =       0xD0000,   /*WebUI */
                .offset =       0x330000,  /*Starts at 0x7F3300000 */
        }
};


« Last Edit: July 03, 2011, 05:05:53 am by admin »

  • No avatar
  • *****
July 03, 2011, 10:48:24 am
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.38.2-OPENIPCAM (root@t60loz) (gcc version 4.2.4) #23 Sun Jul 3 17:24:44 CST 2011
CPU: Nuvoton-nuc700 [41807000] revision 0 (ARMv4T), cr=00000000
CPU: VIVT data cache, VIVT instruction cache
Machine: NUC745EVB
CPU type 0x00000745 is NUC745
The GPIO_CFG4 is 0x55555,  not equal to 0x155555, maybe using by boot!
The GPIO_CFG5 is 0x15555555,  not equal to 0x0, maybe using by boot!
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4064
Kernel command line: console=ttyS0,115200n8 mem=16M root=/dev/ram0 rdinit=/bin/init
PID hash table entries: 64 (order: -4, 256 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 16MB = 16MB total
Memory: 13680k/13680k available, 2704k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0x00000000 - 0x00001000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0x00000000 - 0xffffffff   (4095 MB)
    lowmem  : 0x00000000 - 0x01000000   (  16 MB)
    modules : 0x00000000 - 0x01000000   (  16 MB)
      .init : 0x00008000 - 0x0001f000   (  92 kB)
      .text : 0x0001f000 - 0x00235000   (2136 kB)
      .data : 0x00236000 - 0x0024bda0   (  88 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:31
Console: colour dummy device 80x30
Calibrating delay loop... 39.42 BogoMIPS (lpj=197120)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Advanced Linux Sound Architecture Driver Version 1.0.23.
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 26
io scheduler noop registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xfff80000 (irq = 9) is a 16550
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
physmap platform flash device: 00400000 at ff000000
physmap-flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000001 Chip ID 0x001a00
Amd/Fujitsu Extended Query Table at 0x0040
  Amd/Fujitsu Extended Query version 1.3.
Using buffer write method
number of CFI chips: 1
cmdlinepart partition parsing not available
RedBoot partition parsing not available
Using physmap partition information
Creating 4 MTD partitions on "physmap-flash":
0x000000020000-0x000000220000 : "Linux Kernel Partition (2M)"
mtd: Giving out device 0 to Linux Kernel Partition (2M)
0x000000220000-0x000000320000 : "ROMFS Partition (1M)"
mtd: Giving out device 1 to ROMFS Partition (1M)
0x000000320000-0x000000330000 : "Data Partition (64KB)"
mtd: Giving out device 2 to Data Partition (64KB)
0x000000330000-0x000000400000 : "WebUI Partition"
mtd: Giving out device 3 to WebUI Partition
Unhandled fault: vector exception (0x000) at 0x00000000
Internal error: : 0 [#1]
last sysfs file:
CPU: 0    Not tainted  (2.6.38.2-OPENIPCAM #23)
pc : [<00017564>]    lr : [<00008354>]    psr: 60000013
sp : 00c27f80  ip : 00c27fa0  fp : 00c27f9c
r10: 00017540  r9 : 00000000  r8 : 00000000
r7 : 00000013  r6 : 00034084  r5 : 0001afcc  r4 : 00243658
r3 : 01000000  r2 : 00c26000  r1 : 00295200  r0 : 00017540
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Process swapper (pid: 1, stack limit = 0x00c26270)
Stack: (0x00c27f80 to 0x00c28000)
7f80: 00c27f9c 0001af60 0001afcc 00034084 00c27fdc 00c27fa0 00008354 00017550
7fa0: 00000000 00000000 0000001f 0023c34c 00034084 0001af60 0001afcc 00034084
7fc0: 00000013 00000000 00000000 00000000 00c27ff4 00c27fe0 00008820 0000829c
7fe0: 00000000 00008780 00000000 00c27ff8 00034084 00008790 aaaaaaaa aaaaaaaa
Backtrace:
Function entered at [<00017540>] from [<00008354>]
 r6:00034084 r5:0001afcc r4:0001af60
Function entered at [<0000828c>] from [<00008820>]
Function entered at [<00008780>] from [<00034084>]
 r5:00008780 r4:00000000
Code: e5943004 e3530000 1a00000a e5943008 (e5932008)
---[ end trace a36701b4b0d7ec3a ]---
Kernel panic - not syncing: Attempted to kill init!
Backtrace:
Function entered at [<000294d8>] from [<00029970>]
 r6:0023bdec r5:00c24000 r4:0023bdec
Function entered at [<00029958>] from [<00030fd0>]
Function entered at [<00030f74>] from [<000340e4>]
 r3:60000013 r2:00c27db0 r1:00c240e8 r0:0020fb58
Function entered at [<00034084>] from [<000297d8>]
Function entered at [<000295e0>] from [<000298e0>]
Function entered at [<00029888>] from [<0001f2d8>]
Function entered at [<0001f248>] from [<000257e0>]
Exception stack(0x00c27f38 to 0x00c27f80)
7f20:                                                       00017540 00295200
7f40: 00c26000 01000000 00243658 0001afcc 00034084 00000013 00000000 00000000
7f60: 00017540 00c27f9c 00c27fa0 00c27f80 00008354 00017564 60000013 ffffffff
 r8:e5932008 r7:05000000 r6:00034084 r5:00c27f6c r4:ffffffff
Function entered at [<00017540>] from [<00008354>]
 r6:00034084 r5:0001afcc r4:0001af60
Function entered at [<0000828c>] from [<00008820>]
Function entered at [<00008780>] from [<00034084>]
 r5:00008780 r4:00000000

  • *****
July 03, 2011, 11:34:55 am
Congratulations. This is quite an accomplishment.

I see that you have a good bit of debugging on. Any idea of required space once you turn the debugging off?

You mention "16M ram and 4M flash". Is this in a camera or a standalone system? Namely, what specific device are you using?

  • No avatar
  • *****
July 03, 2011, 01:47:28 pm
Right now debugging is on to see why the MTD partitioning is crapping out - getting there on that though.
I guess a good night sleep, and i'll wake up with the answer.

right now its dying on the mapp->size =  PAGE_ALIGN (ntohl(*((unsigned long *)(mapp> phys+8))); assignment
so need to debug why.  really really close though.


I have 2 devices for testing, one has 8M / 4M flash, another 16M / 4M flash.  I also have a semi broken 8M /2M one that I need to solder some resistors onto.  However, its looking very good for 2.6 on the 16M models.
These are all ipcam's.

I don't have a dev device other than those.  The actual boards used for development are different but similar enough to use.
Eg - we don't have SD card, we don't have 64M ram etc etc, or LCD...



  • No avatar
  • *****
July 06, 2011, 09:39:31 pm
Progress -

Code: [Select]
bootloader > run 1
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.38.2-OPENIPCAM (root@t60loz) (gcc version 4.2.4) #45 Thu Jul 7 09:16:55 CST 2011
CPU: Nuvoton-nuc700 [41807000] revision 0 (ARMv4T), cr=00000000
CPU: VIVT data cache, VIVT instruction cache
Machine: NUC745EVB
CPU type 0x00000745 is NUC745
The GPIO_CFG4 is 0x55555,  not equal to 0x155555, maybe using by boot!
The GPIO_CFG5 is 0x15555555,  not equal to 0x0, maybe using by boot!
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 3810
Kernel command line: console=ttyS0,115200n8 mem=15M root=/dev/mtdblock1
PID hash table entries: 64 (order: -4, 256 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 15MB = 15MB total
Memory: 12656k/12656k available, 2704k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0x00000000 - 0x00001000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0x00000000 - 0xffffffff   (4095 MB)
    lowmem  : 0x00000000 - 0x00f00000   (  15 MB)
    modules : 0x00000000 - 0x01000000   (  16 MB)
      .init : 0x00008000 - 0x0001f000   (  92 kB)
      .text : 0x0001f000 - 0x00235000   (2136 kB)
      .data : 0x00236000 - 0x0024bde0   (  88 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:31
Console: colour dummy device 80x30
Calibrating delay loop... 39.42 BogoMIPS (lpj=197120)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Advanced Linux Sound Architecture Driver Version 1.0.23.
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 24
io scheduler noop registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xfff80000 (irq = 9) is a 16550
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
physmap platform flash device: 00400000 at 7f000000
physmap-flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000001 Chip ID 0x001a00
Amd/Fujitsu Extended Query Table at 0x0040
  Amd/Fujitsu Extended Query version 1.3.
Using buffer write method
number of CFI chips: 1
cmdlinepart partition parsing not available
RedBoot partition parsing not available
Using physmap partition information
Creating 4 MTD partitions on "physmap-flash":
0x000000020000-0x000000220000 : "Linux Kernel Partition (2M)"
mtd: Giving out device 0 to Linux Kernel Partition (2M)
0x000000220000-0x000000320000 : "ROMFS Partition (1M)"
mtd: Giving out device 1 to ROMFS Partition (1M)
0x000000320000-0x000000330000 : "Data Partition (64KB)"
mtd: Giving out device 2 to Data Partition (64KB)
0x000000330000-0x000000400000 : "WebUI Partition"
mtd: Giving out device 3 to WebUI Partition


Pre Map
mtd map->phys: f00000
mtd post mapp->size alignment
uclinux[mtd]: RAM probe address=0xf00000 size=0xf01b0000

0x15 0x5a 0x34 0x12 0x31 0x66 0x73 0x2d


mtd mapp->phys:f00000
Creating 1 MTD partitions on "RAM":
0x000000000000-0x0000f01b0000 : "ROMfs"
mtd: Giving out device 4 to ROMfs
Generic platform RAM MTD, (c) 2004 Simtec Electronics
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
nuc700-ohci nuc700-ohci: NUC700 OHCI
nuc700-ohci nuc700-ohci: new USB bus registered, assigned bus number 1
nuc700-ohci nuc700-ohci: irq 15, io mem 0xfff05000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: NUC700 OHCI
usb usb1: Manufacturer: Linux 2.6.38.2-OPENIPCAM ohci_hcd
usb usb1: SerialNumber: ohci_hcd
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
Linux video capture interface: v2.00
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v1.0.0)
ALSA device list:
  No soundcards found.
TCP cubic registered
NET: Registered protocol family 17
mtdblock_open
ok
mtdblock_release
ok
mtdblock_open
ok
mtdblock_release
ok
mtdblock_open
ok
mtdblock_release
ok
mtdblock_open
ok
mtdblock_release
ok
MTDSB: lookup_bdev() returned 0
MTDSB: New superblock for device 1 ("ROMFS Partition (1M)")
VFS: Mounted root (romfs filesystem) readonly on device 31:1.

 ;D


Just need to sort out my init code, and i have an OS.
« Last Edit: July 06, 2011, 09:48:42 pm by admin »

  • No avatar
  • *****
July 06, 2011, 09:58:29 pm
Freeing init memory: 92K
usb 1-1: new full speed USB device using nuc700-ohci and address 2
mount: Mounting none on /proc/bus/usb failed: No such file or directory
usb 1-1: New USB device found, idVendor=1d0f, idProduct=1801
usb 1-1: New USB device strings: Mfr=16, Product=96, SerialNumber=0
usb 1-1: Product: USB2.0_Camera
usb 1-1: Manufacturer: PixArt Imaging Inc.
uvcvideo: Found UVC 1.00 device USB2.0_Camera (1d0f:1801)
input: USB2.0_Camera as /devices/platform/nuc700-ohci/usb1/1-1/1-1:1.0/input/input0

          ____ _  _
         /  __| ||_|                 
    _   _| |  | | _ ____  _   _  _  _
   | | | | |  | || |  _ \| | | |\ \/ /
   | |_| | |__| || | | | | |_| |/    \
   |  ___\____|_||_|_| |_|\____|\_/\_/
   | |
   |_|


nuc700-emc nuc700-emc: eth0 is OPENED
#



  • No avatar
  • *****
July 16, 2011, 01:14:36 am
As I haven't been as prolific updating progress recently I thought I'd update on progress.
Currently I'm extremely close to basic functionality on 2.6 kernel with drivers for all of the hardware I've seen built into my kernel.

This means that we can have a single kernel for all hardware.

In order to achieve this though, I have had to make some sacrifices.

2.6 Support will only be available initially on 16M ram devices, with 4M flash.
Unfortunately kernel size with drivers is quite large, and its just not feasible to fit on a 2M device.
I can make specific 2M firmware with a subset of drivers if there is a need though, but its going to be quite tight.

Minimum hardware spec for initial release will be 16M ram, 4M flash.

If your bootloader says: "Memory Size is 0x1000000 Bytes, Flash Size is 0x400000 Bytes", then you will have a compatible unit.


Currently the kernel sits at between 1.6M size.  I've been trying to reduce this, but the wifi drivers for certain cards (RT27xx I'm looking at you!) are particularly large.

I've also had to reorganize the flash layout somewhat due to size considerations, so you'll pretty much need a blank camera flash to test.

I'll need some volunteers soon too, so I can test driver support for hardware I don't have.

Assuming you have a blank flash (delete everything except the BOOT INFO), my layout is below.
I've also explained WHY I chose this layout, as decisions had to be made on how much to allocate to what..
This is not set in stone yet, but looks optimal after playing around with different layouts.


BOOT INFO (Image 0) -
no changes, as I don't use it.

LINUX KERNEL (Image 1) Bootloader flags -acx.  Max Size - 2M
This starts at 0x7F020000 in flash memory (as this is the first safe free post bootloader block location).
Boots from 0x8000 in memory. (Read the NUC745 chip notes for why there).
I don't see the need to use high numbering for our images, makes more sense for 1..2..3..4...
The kernel executes from RAM, and is set Active, is Compressed, and eXecutes from RAM  ( -acx )

ROMFS (Image 2) Bootloader flags -cf.  Max size - 1M
I've reserved 2M space for the Kernel, so we start the ROMFS at 0x7F220000.
I've also set the Kernel to use 15M of physical memory as opposed to the full 16M so we can use 1M for a ramfs (RAM Filesystem).  A RAMFS is similar to ROMFS, except its read / write. 
I tell the bootloader to put the romfs in starting from 0x00D00000 (which points at the 15M-16M area in ram).
I've also told the kernel how to handle this partition via my mtd_struct setup in my kernel.
The astute may notice that our R(A/O)MFS can only be 1M size now.  Thats fine, as we can use secondary partitions for our WEBUI and other data, just like the factory default firmware does.


DATA (Image 3) No Bootloader flags, as we use mtd_flash to write directly.   Max Size - 64KB
Currently not used in my kernel / romfs setup.
I've allocated 0x7F320000 - 0x7F330000 for any data I need to save.   
While I could set the ROMFS to use JFFS2, I am concerned that our Flash memory may not like continued writes, so I'm playing it safe.

WEBUI (Image 4) Bootloader flags -f.  Max Size - 960KB
WebUI sits at 0x7F330000 - 0x7F400000, using up the rest of the flash.
I deliberately put this after the DATA partition in case I accidentally tried to update the WebUI over the Data, as I have been prone to do that in the past during testing.
I plan to redo the WebUI completely using CSS and no iFrames. 
I also plan on Porting that backward to the Factory Firmware as I do have clients interested in a rewrite. 

If anyone is interested in customized firmware for their particular needs, get in touch with me, as I have already done a few projects for people related to camera firmware.

My flash looks like this in my test device:

bootloader> ls -al                                                                                     
Image: 0 name:BOOT INFO base:0x7F010000 size:0x00000038 exec:0x7F010000 -af                             
Image: 1 name:linux base:0x7F020000 size:0x00198D80 exec:0x00008000 -acx                                 
Image: 2 name:romfs base:0x7F220000 size:0x00084000 exec:0x00D00000 -cf
Image: 4 name:webui base:0x7F330000 size:0x00000038 exec:0x7F330000 -f


A testing 2.6 Kernel and ROMFS are here  - http://www.openipcam.com/files/OPENIPCAM26/

I STRONGLY NOTE that this is still in testing, so only try on "broken" or spare units for now.

Lawrence.
« Last Edit: July 16, 2011, 01:59:22 am by admin »

  • No avatar
  • *****
July 16, 2011, 01:32:45 am
Testing

Note that the kernel will ONLY work on a 16M flash / 4M unit currently, so please make sure your bootloader says "Memory Size is 0x1000000 Bytes, Flash Size is 0x400000 Bytes" (or better) before trying.



On a working camera (non-invasive)

If you would like to see if the kernel boots on your device, you can do it in a safe way by following the below.  Please paste the kernel boot log you receive here so I can see if its ok on your device.


Code: [Select]
Enter Bootloader
mx 0x8000
(Upload the zImage compressed kernel using XModem)
g 0x8000

This should look like this:

Code: [Select]
bootloader> mx 0x8000
Waiting for download
Press Ctrl-X to cancel
....................
bootloader> g 0x8000
Uncompressing Linux... done, booting the kernel.
Linux version 2.6.38.2-OPENIPCAM (root@t60loz) (gcc version 4.2.4) #45 Thu Jul 7 09:16:55 CST 2011
CPU: Nuvoton-nuc700 [41807000] revision 0 (ARMv4T), cr=00000000
CPU: VIVT data cache, VIVT instruction cache
...


Testing - !!Destructive / Invasive to existing Firmware!!
ONLY TEST on a Spare  or unusable camera with working flash, or on a device you know how to restore to factory defaults.


Code: [Select]
bootloader>  del -all
bootloader>  fx 1 linux 0x7F020000 0x8000 -acx
(upload zImage file)
bootloader>  fx 2 romfs 0x7F220000 0xD00000 -cf
(upload ROMS file)

bootloader> boot]bootloader>  del -all
bootloader>  fx 1 linux 0x7F020000 0x8000 -acx
(upload zImage file)
bootloader>  fx 2 romfs 0x7F220000 0xD00000 -cf
(upload ROMS file)

bootloader> boot

Note that I have uploaded a ROMFS (the french one) to the test folder, not a RAMFS, feel free to build your own RAMFS if you want one.  Once I reach a better stage of completion I'll start providing actual RAMFS for testing.

« Last Edit: July 16, 2011, 01:35:52 am by admin »

  • *****
July 16, 2011, 11:19:47 am
No Joy with a Wansview NC-541w that appears to match your hardware requirements:
Memory Size is 0x1000000 Bytes, Flash Size is 0x400000 Bytes

-------
bootloader > mx 0x8000 (I loaded zImage.txt)
Waiting for download
Press Ctrl-x to cancel ...
CCCCCCCCCC
Download successed!

bootloader > g 0x8000
-------

No response! Camera went into never-never land.

  • No avatar
  • *****
July 17, 2011, 01:25:59 am
I should test first, huh ;)

I got Uncompressing Linux...

then no boot
Hmm.

(Although the real firmware works).

Will have a thought about why, as it should work from ram..

Adventurous People will have to try by erasing the flash then.

August 28, 2011, 04:12:40 pm
Hi Lawrence,

thanks for the valuable information you provide on your blog, in this forum and of course the Wiki. I rolled my own 2.6 kernel for my FOSCAM FI8904W, based on the nuc700 kernel by Wan ZongShun and the nuc745 configuration. So far it boots fine most of the time (sometimes it just hangs after the "Uncompressing Linux... done" line). The GSPCA webcam driver finds the camera just fine, but I could not get WLAN to work. It seems that the driver (VT6656) is properly loaded, but the Wifi device does not appear on the USB. With the stock firmware, it works just fine. Have you been able to get Wifi running on your 2.6 kernel?

Here's my boot log:
Code: [Select]
Linux version 2.6.38.2-on+ (robert@devVM) (gcc version 4.2.4) #102 Sun Aug 28 19:28:09 CEST 2011
CPU: Nuvoton-nuc700 [41807000] revision 0 (ARMv4T), cr=00000000
CPU: VIVT data cache, VIVT instruction cache
Machine: NUC745EVB
CPU type 0x00000745 is NUC745
The GPIO_CFG2 is 0x55555,  not equal to 0x0, maybe using by boot!
The GPIO_CFG4 is 0x55555,  not equal to 0x155555, maybe using by boot!
The GPIO_CFG5 is 0x15555555,  not equal to 0x0, maybe using by boot!
Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 3810
Kernel command line: console=ttyS0,115200n8 rdinit=/bin/init mem=15M
PID hash table entries: 64 (order: -4, 256 bytes)
Dentry cache hash table entries: 2048 (order: 1, 8192 bytes)
Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
Memory: 15MB = 15MB total
Memory: 11256k/11256k available, 4104k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0x00000000 - 0x00001000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0x00000000 - 0xffffffff   (4095 MB)
    lowmem  : 0x00000000 - 0x00f00000   (  15 MB)
    modules : 0x00000000 - 0x00f00000   (  15 MB)
      .init : 0x00008000 - 0x00131000   (1188 kB)
      .text : 0x00131000 - 0x00392000   (2436 kB)
      .data : 0x00392000 - 0x003aa3c0   (  97 kB)
SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:31
Console: colour dummy device 80x30
Calibrating delay loop... 39.42 BogoMIPS (lpj=197120)
pid_max: default: 4096 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 512 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 512 bind 512)
TCP reno registered
NET: Registered protocol family 1
cfg80211: Calling CRDA to update world regulatory domain
NetWinder Floating Point Emulator V0.97 (double precision)
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 21
io scheduler noop registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xfff80000 (irq = 9) is a 16550
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
physmap platform flash device: 00400000 at 7f000000
cmdlinepart partition parsing not available
RedBoot partition parsing not available
Using physmap partition information
Creating 1 MTD partitions on "physmap-flash":
0x0000000e0000-0x0000001e0000 : "Rootfs Partition (1M)"
mtd: Giving out device 0 to Rootfs Partition (1M)
uclinux[mtd]: RAM probe address=0xf00000 size=0xaaa2b000
Creating 1 MTD partitions on "RAM":
0x000000000000-0x0000aaa2b000 : "ROMfs"
mtd: Giving out device 1 to ROMfs
Generic platform RAM MTD, (c) 2004 Simtec Electronics
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
nuc700-ohci nuc700-ohci: NUC700 OHCI
nuc700-ohci nuc700-ohci: new USB bus registered, assigned bus number 1
nuc700-ohci nuc700-ohci: irq 15, io mem 0xfff05000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: NUC700 OHCI
usb usb1: Manufacturer: Linux 2.6.38.2-on+ ohci_hcd
usb usb1: SerialNumber: ohci_hcd
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
Linux video capture interface: v2.00
gspca: v2.12.0 registered
usbcore: registered new interface driver zc3xx
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v1.0.0)
VIA Networking Wireless LAN USB Driver 1.19_12
usbcore: registered new interface driver vt6656
TCP cubic registered
NET: Registered protocol family 17
Freeing init memory: 1188K
Shell invoked to run file: /bin/init
Command: echo starting..........
starting..........
Command: mount -t proc proc /proc
Command: echo 1024 >/proc/sys/vm/min_free_kbytes
1024 >/proc/sys/vm/min_free_kbytes
Command: ifconfig eth0 down
Command: ifconfig eth0 hw ether 48:54:e8:00:00:00
Command: ifconfig eth0 10.38.50.222 netmask 255.255.255.0
nuc700-emc nuc700-emc: eth0 is OPENED
Command: /bin/busybox sh


BusyBox v1.10.2-uc0 (2011-08usb 1-1: new full speed USB device using nuc700-ohci and address 2
-28 19:27:40 CEST) built-in shell (msh)
Enter 'help' for a list of built-in commands.

# usb 1-1: New USB device found, idVendor=0ac8, idProduct=303b
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1: Product: PC Camera

Cheers,
  Robert

  • No avatar
  • *****
August 29, 2011, 03:51:37 am
Yes, I have.
For wifi, you also need the wifi extensions though, did you compile those in?

Haven't got  a machine setup with me to check at the moment though.  Check my linux / romfs see if it see's on yours.




August 30, 2011, 09:25:30 pm
I tried to boot your kernel from RAM, but it crashes right away, printing lots of whitespaces, even before "Uncompressing Linux" appears. I attached my kernel config. Maybe you can post yours, so we can compare and I might be able to find the missing Wifi pieces. The extensions are enabled, btw... and I think I should be seeing a USB debug message as USB Verbose Debugging is on.

August 31, 2011, 04:42:56 pm
Tried flashing your image, this time I get:

Code: [Select]
bootloader > ls
Image: 0 name:BOOT INFO base:0x7F010000 size:0x00000038 exec:0x7F010000 -af
Image: 1 name:linux base:0x7F020000 size:0x001CA078 exec:0x00008000 -acx
Image: 2 name:romfs base:0x7F220000 size:0x000B8400 exec:0x00D00000 -cf

bootloader > boot

Rebooting the system ...



W90P745 Boot Loader [ Version 1.1 $Revision: 1 $ ] Rebuilt on May 11 2010
Memory Size is 0x1000000 Bytes, Flash Size is 0x400000 Bytes
Board designed by Winbond
Hardware support provided at Winbond
Copyright (c) Winbond Limited 2001 - 2006. All rights reserved.
Boot Loader Configuration:

        MAC Address         : 00:60:6E:93:96:79
        IP Address          : 0.0.0.0
        DHCP Client         : Enabled
        CACHE               : Enabled
        BL buffer base      : 0x00300000
        BL buffer size      : 0x00100000
        Baud Rate           : -1
        USB Interface       : Disabled
        Serial Number       : 0xFFFFFFFF


For help on the available commands type 'h'

Press ESC to enter debug mode ......
Cache enabled!
Processing image 1 ...
Executing image 1 ...


ERROR: Prefetch Abort @ pc=0x00000010