Author Topic: Pimp Your Zaurus: 1gbyte Nand Flash Upgrade  (Read 19342 times)

ranma

  • Newbie
  • *
  • Posts: 5
    • View Profile
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« on: June 15, 2008, 07:59:48 am »
Hi all!

I recently looked into how the NAND is hooked up on the Zaurus (my C750):

Code: [Select]
          TP6
            TP5
          TP4
---------   TP3
|Xilinx | TP2
|CPLD   |   TP1
|       |
---------

TP1 => CE0
TP2 => CE1! (unused?)
TP3 => /WP
TP4 => /WE
TP5 => ALE
TP6 => CLE

I also found two nicely compatible 8GBit TSOP48 Toshiba Flash Chips in a CNMemory 2GByte CF Card.

So I soldered one of the 8GBit chips on top of the already existing 512MBit chip (all signals except CE are shared).
Soldering was a bitch though (pins did almost, but not quite reach the pins below), but with lots of solder, cursing, solderwick and patience
I eventually had all relevant pins connected.
Since the Linux kernel unfortunately always enables/disables both CE signals I couldn't simply use the CE1 signal from the CPLD, but for now
(first tests) I hooked up CE to the Cathode of the Green EMail-LED (which is normally always off and the transistor acts as an inverter, so
'on' == low, exactly what I need) and a 10k pull-up.

The system boots fine and a hacked up 'fiddle with CEs and read IDs' kernel module finds both Chips just fine:
Code: [Select]
Trying to read id from Flash on CE0
Got maker=98 device=76
Trying to read id from Flash on CE1|GreenLED
Got maker=98 device=d3

According to drivers/mtd/nand/nand_ids.c maker 0x98 is 'Toshiba', device 0x76 is a 'NAND 64MiB 3,3V 8-bit' and
device 0xd3 is the shiny new 'NAND 1GiB 3,3V 8-bit' (Yay!).

This should actually already exercise all control signals, so the only remaining task is to modify the built-in sharp_sl nand driver to properly support two chips.

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #1 on: June 15, 2008, 01:01:42 pm »
Very nice! Now how about 1GB RAM? That would REALLY make my day!
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

ranma

  • Newbie
  • *
  • Posts: 5
    • View Profile
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #2 on: June 15, 2008, 01:48:17 pm »
Quote from: Capn_Fish
Very nice! Now how about 1GB RAM? That would REALLY make my day!

I'm not sure the pxa would support that (and haven't looked into the datasheet).

BTW, unit striptease:

Before mod:
[img]http://uguu.de/~ranma/S6004377s.jpg\" border=\"0\" class=\"linked-image\" /]

After mod:
[img]http://uguu.de/~ranma/S6004398s.jpg\" border=\"0\" class=\"linked-image\" /]

Better view of the flash stack:
[img]http://uguu.de/~ranma/S6004389s.jpg\" border=\"0\" class=\"linked-image\" /]

the_oak

  • Sr. Member
  • ****
  • Posts: 426
    • View Profile
    • http://
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #3 on: June 16, 2008, 09:23:07 am »
Wow!  Really nice mod. Is hacking the NAND driver a trivial matter (asking because from what I hear, Sharp did not release source files). Is hacking the driver the only thing that needs to be done to have the Zaurus see and use the new NAND storage as ROM?  Would love to see a screenshot of System Properties showing all that internal memory.

If you pre-tin the new memory chip leads, would that extend them enough to make soldering less risky?
SL-6000L running Sharp 1.12 rom, (SOLD)
Fujitsu U820 with Windows 7
White Intel MacBook

stupkid

  • Hero Member
  • *****
  • Posts: 578
    • View Profile
    • http://
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #4 on: June 16, 2008, 11:00:49 am »
I thought long ago someone was stating that 128MB RAM was possible with the Z.

Zaurus SL-C3200 pdaXii13v2 5.5 / Ambicom WC1100C-CF / Socket Bluetooth Rev G


OpenMoko FreeRunner - Running Tweaked OM2008.x Image

ranma

  • Newbie
  • *
  • Posts: 5
    • View Profile
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #5 on: June 16, 2008, 04:34:32 pm »
Quote from: the_oak
Wow!  Really nice mod. Is hacking the NAND driver a trivial matter (asking because from what I hear, Sharp did not release source files). Is hacking the driver the only thing that needs to be done to have the Zaurus see and use the new NAND storage as ROM?  Would love to see a screenshot of System Properties showing all that internal memory.

The nand driver is included in the sharp source tree (or in the cacko source tree, for that matter).
Hacking the driver shouldn't be too difficult, I hope to find the time to do that the coming weekend.
The hacked driver would expose the NAND as just another mtd partition, which can then be formatted using JFFS2.
Using a FS not specifically designed for flash would also be possible, but a big "don't do that" since ther is no wear-leveling.
Unfortunately JFFS2 does not perform well with big filesystem sizes, maybe I'll try YAFFS instead.

Quote
If you pre-tin the new memory chip leads, would that extend them enough to make soldering less risky?

Maybe.
I think applying flux to the old chip leads may also help a lot.

Interesting tidbits:
dd if=/dev/mtdblock of=/dev/null clocks in at about 2MB/s (on the 64MB flash)
This corresponds nicely to a benchmark I did on the PIO reads from the CPLD, however if I use the pxa dma engine I can read at >10MB/s.

Hooking up the chip-enable to the green led is just a temporary measure, I'm thinking of hooking it up using a transistor, with the base connected to CE0 using a resistor,
the emitter connected to CE1 an the collector connected to CE (while also leaving the pull-up in place).

This should act so that a low-level on CE1 gets only passed on to CE if CE0 is high-level and so works around the 'Sharp Kernel turns on/off both CE0 and CE1'.

the_oak

  • Sr. Member
  • ****
  • Posts: 426
    • View Profile
    • http://
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #6 on: June 16, 2008, 11:25:41 pm »
Quote from: stupkid
I thought long ago someone was stating that 128MB RAM was possible with the Z.

I think it was Speculatrix who (unsuccessfully) tried that. Brave soul. It would have been a success but the chip cracked, or something like that.
SL-6000L running Sharp 1.12 rom, (SOLD)
Fujitsu U820 with Windows 7
White Intel MacBook

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #7 on: June 17, 2008, 02:23:31 am »
The RAM upgrade is hard simply because it's in a BGA package which needs hot-air rework equipment and no fear. I seem to recall Maslovsky had a few done.
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #8 on: June 22, 2008, 05:53:59 pm »
Quote from: the_oak
Quote from: stupkid
I thought long ago someone was stating that 128MB RAM was possible with the Z.

I think it was Speculatrix who (unsuccessfully) tried that. Brave soul. It would have been a success but the chip cracked, or something like that.

no, I was trying to fit a bluetooth module inside my sl-6000, turned out I had the wrong type of module - there are many variants of Mitsumi devices. in the process of reassembling it I was squeezing the USB wifi module on and snapped a RAM chip. I tried to find someone who could do BGA "surgery" to remove the bust ram chip and fit a new one, and possibly populate the empty slots for more memory too.

that zaurus is still b0rked - the person capable of BGA surgery was unavailable and the RAM chips are very hard/impossible to find.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #9 on: June 22, 2008, 05:54:54 pm »
Quote from: pelrun
The RAM upgrade is hard simply because it's in a BGA package which needs hot-air rework equipment and no fear. I seem to recall Maslovsky had a few done.

yes, Anton Mas. had a friend who can do BGA, but I think that friend has changed job and no longer has access to the specialised equipment.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

the_oak

  • Sr. Member
  • ****
  • Posts: 426
    • View Profile
    • http://
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #10 on: July 01, 2008, 10:29:38 pm »
Quote from: speculatrix
Quote from: the_oak
Quote from: stupkid
I thought long ago someone was stating that 128MB RAM was possible with the Z.

I think it was Speculatrix who (unsuccessfully) tried that. Brave soul. It would have been a success but the chip cracked, or something like that.

no, I was trying to fit a bluetooth module inside my sl-6000, turned out I had the wrong type of module - there are many variants of Mitsumi devices. in the process of reassembling it I was squeezing the USB wifi module on and snapped a RAM chip. I tried to find someone who could do BGA "surgery" to remove the bust ram chip and fit a new one, and possibly populate the empty slots for more memory too.

that zaurus is still b0rked - the person capable of BGA surgery was unavailable and the RAM chips are very hard/impossible to find.

Speculatrix:
Did you happen to notice this thread:

https://www.oesf.org/forum/index.php?showtopic=25886

Maybe a cheap motherboard to replace borked one. Been a while since that ad, but I just now remembered seeing it.
SL-6000L running Sharp 1.12 rom, (SOLD)
Fujitsu U820 with Windows 7
White Intel MacBook

speculatrix

  • Administrator
  • Hero Member
  • *****
  • Posts: 3707
    • View Profile
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #11 on: July 02, 2008, 06:02:44 am »
Quote from: the_oak
Quote from: speculatrix
no, I was trying to fit a bluetooth module inside my sl-6000... snapped a RAM chip

Speculatrix:
Did you happen to notice this thread:

https://www.oesf.org/forum/index.php?showtopic=25886

Maybe a cheap motherboard to replace borked one. Been a while since that ad, but I just now remembered seeing it.

thanks, but I did buy a b0rked 6000, a guy dropped it off the roof of his house (I've never found out why he was up there with his Z!), the screen broke but the motherboard survived! I've still got problems with its LCD connector, it needs refixing. Also my batteries are shot. I recently bought a Dlink DSM-G600 wifi hard drive thing which I intend to fit in the car and use the Z as a media player using samba over wifi.
Gemini 4G/Wi-Fi owner, formerly zaurus C3100 and 860 owner; also owner of an HTC Doubleshot, a Zaurus-like phone.

ranma

  • Newbie
  • *
  • Posts: 5
    • View Profile
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #12 on: July 12, 2008, 06:21:49 pm »
Quote from: ranma
The nand driver is included in the sharp source tree (or in the cacko source tree, for that matter).
Hacking the driver shouldn't be too difficult, I hope to find the time to do that the coming weekend.
The hacked driver would expose the NAND as just another mtd partition, which can then be formatted using JFFS2.
Using a FS not specifically designed for flash would also be possible, but a big "don't do that" since ther is no wear-leveling.
Unfortunately JFFS2 does not perform well with big filesystem sizes, maybe I'll try YAFFS instead.

Well, it took a bit longer than expected, but it is basically working now.
I can mount jffs2 and read/write to the partition.
I get occasional crc errors though (probably because I commented out the write verification code, that is not converted yet).
For testing I only used 128MB instead of the full size:

Code: [Select]
bash-3.00# df  
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/root                32768     32664       104 100% /
/dev/ram1                  108        29        79  27% /dev
/dev/loop0               26368     26368         0 100% /usr
/dev/mtdblock3           25600     21660      3940  85% /home
none                     10240        24     10216   0% /dev/shm
/dev/mtdblock4          131072     30020    101052  23% /usr/mnt.rom/cf
bash-3.00# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 006d0000 00020000 "Filesystem"
mtd1: 00700000 00004000 "smf"
mtd2: 02000000 00004000 "root"
mtd3: 01900000 00004000 "home"
mtd4: 08000000 00040000 "NAND flash partition 0"
mtd5: 20000000 00040000 "NAND flash partition 1"


Quote
Interesting tidbits:
dd if=/dev/mtdblock of=/dev/null clocks in at about 2MB/s (on the 64MB flash)
This corresponds nicely to a benchmark I did on the PIO reads from the CPLD, however if I use the pxa dma engine I can read at >10MB/s.

Well, slight problem with trying to use dma: Apparently I overread the part where the docs state that byte-reads are only allowed for on-chip peripherals
and all external reads have to be 8-byte aligned.
Unfortunately the data register is not 8-byte aligned and only byte-readable.

Aligned dma copies from/to the w100 framebuffer seem to work fine though (didn't get much testing though).

the_oak

  • Sr. Member
  • ****
  • Posts: 426
    • View Profile
    • http://
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #13 on: July 13, 2008, 09:28:16 am »
Keep up the good work. We'll be waiting to hear of future developments.
SL-6000L running Sharp 1.12 rom, (SOLD)
Fujitsu U820 with Windows 7
White Intel MacBook

Ragnorok

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
    • http://
Pimp Your Zaurus: 1gbyte Nand Flash Upgrade
« Reply #14 on: September 16, 2008, 01:38:48 pm »
Quote from: pelrun
The RAM upgrade is hard simply because it's in a BGA package which needs hot-air rework equipment and no fear. I seem to recall Maslovsky had a few done.
- 'Twere he.  Saint Maslovsky has a C750 w/ 128MB RAM and was working on the C1000 about the time Cacko 1.23 was released.  Since then he evaporated, seemingly.  Hope he's okay and all.
- I like the GB flash mod.  I could fit Debian in that and not worry about stuffing it on an SD card.  Nice!  Now if I could just work up the courage to rip Hiro apart and go at him with heat and purpose.  (owlish stare)
| I shed a tear for the passing of Hiroshi; he served me well
| Zaurus zealot since Nov 2002, PDA user since Oct 1991
| Replaced Z with UMID BZ February 2010