Month: December 2012

Reference Manual for SSD1933 and SSD1935

I can’t believe when opened my email today and saw the SSD1935 reference manual sent by Solomon Systech (in fact this is the SSD1933 but this processor is just the SSD1933 with more integrated memory). Now this is a really complete manual with more than 1000 pages.

Because there is not confidential warning on it I decide to share it here:
https://www.4shared.com/office/UJ1FSp4l/SSD1933_RM_r1p4.html

Using this manual will be possible to create device driver to this processor and add open source support to VStarCAM H6837WI.

LEGO and the open source BrickOS

It is not easy to any company to see your device hacked, they probably fell violated inside.

But this is a different case, LEGO saw open source as an opportunity and used it to improve their product.

I hope more companies start to think this way and use open source to improve themselves.

Sources:

http://www.digitaltrends.com/computing/lego-goes-open-source/

http://www.davidsudjiman.info/2006/02/13/how-should-lego-protect-its-trademark-operating-system-and-applications/

Created patch to add ssd1935 support on linux kernel 2.6.24

I created a patch to simplify adding support to SSD1935 on Linux kernel.

Then instead of downloading many files from my github you just need to download this small patch:

https://www.4shared.com/archive/F8UtHqnz/patch_kernel_2624_solomon_ssd1.html

You can apply it over linux kernel 2.6.24 this way:

$ tar xvf patch_kernel_2.6.24_solomon_ssd1935.tar.gz
$ cd linux-2.6.24
$ patch -p1 < ../kernel_2.6.24_solomon_ssd1935.patch

Very easy!

Mapping Flash partition from command line

Yesterday we saw how to map the NOR flash of VStarcam H6837WI camera.

Now we need to create the partitions to it.

We know from original linux kernel log it has 5 partitions:

[ 0.870000] Creating 5 MTD partitions on "NOR flash on ipcam":
[ 0.870000] 0x000000000000-0x000000030000 : "ARMboot"
[ 0.880000] 0x000000030000-0x0000001a0000 : "Kernel"
[ 0.890000] 0x0000001a0000-0x0000005a0000 : "RootFS"
[ 0.900000] 0x0000005a0000-0x0000007f0000 : "IpcamFS"
[ 0.910000] 0x0000007f0000-0x000000800000 : "param"

Then I need to pass this mtdparts to Linux kernel command line:

mtdparts=physmap-flash.0:192k(ARMboot)ro,1472k(Kernel),4096k(RootFS),2368k(IpcamFS),-(param)

This is my complete bootargs line:

bootargs=mtdparts=physmap-flash.0:192k(ARMboot)ro,1472k(Kernel),4096k(RootFS),2368k(IpcamFS),-(param) mem=20M console=ttyS0,115200n8 init=/sbin/init root=/dev/mtdblock2

Excellent, it can boots to camera Linux file system:

$ bootm

 Starting kernel ...

Uncompressing Linux............................................................................................. done, booting the kern
el.
[    0.000000] Linux version 2.6.24ssl (alan@aureo) (gcc version 3.4.6) #1 PREEMPT Sat Dec 15 16:13:03 BRST 2012
[    0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
[    0.000000] Machine: Solomon Magus Accio P1
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] CPU0: D VIVT write-back cache
[    0.000000] CPU0: I cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
[    0.000000] CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
[    0.000000] Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 5080
[    0.000000] Kernel command line: mtdparts=physmap-flash.0:192k(ARMboot)ro,1472k(Kernel),4096k(RootFS),2368k(IpcamFS),-(param) mem=20
M console=ttyS0,115200n8 init=/sbin/init root=/dev/mtdblock2
[    0.000000] intc: init info - ver=1,0
[    0.000000] gpio: init info - ver=1,0 
[    0.000000] clock: init info - ver=1,0 
[    0.000000] MAGUS Clocks : ARM-240.000 MHz, HCLK-120.000 MHz, PCLK-60.000 MHz, PERCLK1-60.000 MHz, PERCLK2-24.000 MHz
[    0.000000] PID hash table entries: 128 (order: 7, 512 bytes)
[    0.000000] Console: colour dummy device 80x30
[    0.000000] console [ttyS0] enabled
[    0.010000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.020000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.030000] Memory: 20MB = 20MB total
[    0.040000] Memory: 17280KB available (2680K code, 219K data, 72K init)
[    0.270000] Mount-cache hash table entries: 512
[    0.270000] CPU: Testing write buffer coherency: ok
[    0.290000] net_namespace: 64 bytes
[    0.300000] NET: Registered protocol family 16
[    0.330000] dma: init info - ver 1.0 fifosize=128, 8 channels
[    0.330000] MAGUS cpu freq change driver v1.0
[    0.340000] 
[    0.340000] cpufreq: magus_set_target: request for target_freq = 240000 KHz
[    0.350000] cpufreq: magus_set_target: cur_pll_out = 240000 KHz, cur_arm_freq = 240000 KHz
[    0.380000] SCSI subsystem initialized
[    0.390000] usbcore: registered new interface driver usbfs
[    0.400000] usbcore: registered new interface driver hub
[    0.400000] usbcore: registered new device driver usb
[    0.470000] NET: Registered protocol family 2
[    0.570000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.580000] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.590000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.590000] TCP: Hash tables configured (established 1024 bind 1024)
[    0.600000] TCP reno registered
[    0.630000] Power Management for MAGUS. V0.1.1
[    0.630000] NetWinder Floating Point Emulator V0.97 (extended precision)
[    0.650000] JFFS2 version 2.2. (NAND) �© 2001-2006 Red Hat, Inc.
[    0.660000] io scheduler noop registered
[    0.660000] io scheduler deadline registered (default)
[    0.690000] Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
[    0.700000] ttyS0: autoconf (0x0000, 0xf000300c): uart: id=7000041
[    0.700000] type=16550A
[    0.710000] serial8250: ttyS0 at MMIO 0x0 (irq = 16) is a 16550A
[    0.710000] ttyS1: autoconf (0x0000, 0xf000400c): uart: id=7000041
[    0.720000] type=16550A
[    0.720000] serial8250: ttyS1 at MMIO 0x0 (irq = 17) is a 16550A
[    0.730000] Driver 'sd' needs updating - please use bus_type methods
[    0.740000] Driver 'sr' needs updating - please use bus_type methods
[    0.750000] physmap platform flash device: 00800000 at 10000000
[    0.760000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
[    0.770000]  Amd/Fujitsu Extended Query Table at 0x0040
[    0.770000] number of CFI chips: 1
[    0.770000] cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
[    0.780000] 5 cmdlinepart partitions found on MTD device physmap-flash.0
[    0.790000] Creating 5 MTD partitions on "physmap-flash.0":
[    0.800000] 0x00000000-0x00030000 : "ARMboot"
[    0.800000] 0x00030000-0x001a0000 : "Kernel"
[    0.810000] 0x001a0000-0x005a0000 : "RootFS"
[    0.820000] 0x005a0000-0x007f0000 : "IpcamFS"
[    0.830000] 0x007f0000-0x00800000 : "param"
[    0.840000] spi: init info - ver=1.0 fifo=16 slaves=5 master=1
[    0.850000] spi: init info - ver=1.0 fifo=16 slaves=5 master=1
[    0.970000] ehci ehci: ssl ehci
[    0.970000] ehci ehci: new USB bus registered, assigned bus number 1
[    0.980000] ehci ehci: irq 14, io mem 0x08403000
[    1.000000] ehci ehci: USB 0.0 started, EHCI 1.00, driver 10 Dec 2004
[    1.010000] usb usb1: configuration #1 chosen from 1 choice
[    1.010000] hub 1-0:1.0: USB hub found
[    1.020000] hub 1-0:1.0: 1 port detected
[    1.130000] usb usb1: Product: ssl ehci
[    1.130000] usb usb1: Manufacturer: Linux 2.6.24ssl ssl ehci
[    1.140000] usb usb1: SerialNumber: ssl_ehci
[    1.140000] Initializing USB Mass Storage driver...
[    1.370000] CI reset done
[    1.430000] usb 1-1: new high speed USB device using ehci and address 2
[    1.550000] CI reset done
[    1.660000] usb 1-1: configuration #1 chosen from 1 choice
[    1.680000] usb 1-1: Product: 802.11 n WLAN
[    1.680000] usb 1-1: Manufacturer: Ralink
[    1.690000] usb 1-1: SerialNumber: 1.0
[    1.690000] usbcore: registered new interface driver usb-storage
[    1.700000] USB Mass Storage support registered.
[    1.710000] usbcore: registered new interface driver libusual
[    1.710000] i2c /dev entries driver
[    1.720000] i2c: init info - ver=1,0
[    1.730000] 
[    1.730000] cpufreq: magus_set_target: request for target_freq = 240000 KHz
[    1.740000] cpufreq: magus_set_target: cur_pll_out = 240000 KHz, cur_arm_freq = 240000 KHz
[    1.750000] TCP cubic registered
[    1.750000] NET: Registered protocol family 1
[    1.760000] NET: Registered protocol family 17
[    1.770000] VFS: Can't find an ext2 filesystem on dev mtdblock2.
[    1.780000] VFS: Mounted root (cramfs filesystem) readonly.
[    1.790000] Freeing init memory: 72K
/usr/bin/sdupdate: error while loading shared libraries: libgpioctrl.so: cannot open shared object file: No such file or directory
[    4.240000] jffs2: Too few erase blocks (1)
mount: mounting /dev/mtdblock4 on /mnt failed: Invalid argument
/etc/init.d/rcS: line 132: /mnt/init/ipcam.sh: not found
/ #                                                       

Adding NOR Flash support on H6837WI

The VStarCAM H6837WI uses a NOR Flash to store file system, this is a Spansion S29GL064N chip.

Unfortunately the original kernel source code released by TEAC (and developed by Solomon Systech) uses NAND instead of NOR flash.

This is the kernel log message of vstarcam h6837wi linux:

[ 0.830000] SPAN-NOR:0x00800000 at 0x10000000
[ 0.830000] nor flash cfi probe
[ 0.830000] NOR flash on ipcam: Found 1 x16 devices at 0x0 in 16-bit bank
[ 0.840000] Amd/Fujitsu Extended Query Table at 0x0040
[ 0.850000] number of CFI chips: 1
[ 0.850000] cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.

Then I started search for Linux support to Spansion S29GL064N and found these patches:
http://comments.gmane.org/gmane.linux.drivers.mtd/21085

After applying these patches I selected these configs:

CONFIG_MTD_CFI=y
CONFIG_MTD_JEDECPROBE=y
CONFIG_MTD_GEN_PROBE=y
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
CONFIG_MTD_CFI_AMDSTD=y
CONFIG_MTD_CFI_UTIL=y

But it still not working.

Then I still reading more about NOR flash support on Linux and found these articles:
http://www.righthandtech.com/embedded-linux-managing-memory.php
http://www.compulab.co.il/workspace/mediawiki/index.php5/CM-X270:_Linux:_MTD_drivers

Hmm, I need to define physical base address for my NOR flash chip. In fact NOR subsystem is not smart as NAND flash subsystem, it cannot discover where is in whole system memory.

So, I setup this information using as base above log from original Linux kernel:

CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PHYSMAP_START=0x10000000
CONFIG_MTD_PHYSMAP_LEN=0x800000
CONFIG_MTD_PHYSMAP_BANKWIDTH=2

And now I got NOR flash chip detected:

[    0.760000] physmap platform flash device: 00800000 at 10000000
[    0.770000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
[    0.770000]  Amd/Fujitsu Extended Query Table at 0x0040
[    0.780000] Using buffer write method
[    0.780000] number of CFI chips: 1
[    0.790000] cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
[    0.790000] RedBoot partition parsing not available
[    0.800000] mtd: Giving out device 0 to physmap-flash.0

Next step will be setting partition layout as on original camera’s linux kernel.

Stay tuned!