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!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s