Subject: [E3-hacking] 435208

From: jan bartnik <[email-masked]>
Date: Tue, 5 Apr 2005 11:16:18 +0200

435208

---

From: Matt Evans <[email-masked]>
Date: Wed, 13 Apr 2005 15:28:34 +0100

Hi all,

Just thought I'd say what I've been working on currently - had a slow 
fortnight w/o much time to spare for it but...  I am writing a 2ndstage 
boot monitor for the E2 with the aim to drop it into the first block 
(or two ;) of NAND flash via David's pblq program.  I currently haven't 
touched the flash at all, and am using JTAG to download it to RAM - 
that actually works very nicely, about 3K/s too..

Anyway, it provides a basic shell on the serial port with 
peek/poke/dump/go style commands.  It'll also support YMODEM transfers 
(when I get them working) to/from DRAM and from NAND - so it'll provide 
an easy means to prototype bigger programs on top of itself, with quick 
downloads to DRAM.

I've found the NAND support to be interesting.  It's my intention to 
have it be able to scan internal NAND (and SmartMedia) for headers of 
code to load/jump to, much as PBL does.  The raw NAND contains some 
strange stuff;  there is some sort of FTL in force here.  At this point 
I got a bit exasperated trying to work out exactly what 
ECC/badblock-remapping scheme they've used in the NAND flash; however 
I've found the PBL high-level "read offset N" routines (e.g. 0x4d18), 
and can call them (in ROM) from my own code (in RAM) with success.... 
These routines seem to perform ECC/FTL-style remapping.  I haven't 
found out how to get them to read SmartMedia though... (Incidentally 
0xa0002007 bit 0x02 is an active high 'smartmedia inserted' flag, 
0xa0002005 bit 0x01 being the NAND CS for the card.)  Thinking about it 
it would make sense for the ECC/remapping stuff of the internal NAND to 
be the same as the SmartMedia standard, no point duplicating code for a 
different system for internal flash...

Anyway; anyone have any comments/input/help with regard to the PBL 
routines to access SMC or internal flash?  I haven't looked for/found 
the writeBlock routines yet, but they'll be next on the list.  Ideally 
this loader (it's about 8K now since I'm lazy and most is in C) would 
sit at the (logical ;) ) start of NAND, be brought up by PBL and then 
boot from either SMC if inserted or else search internal NAND for 
another image.  Would be a cool development cycle to just blast stuff 
onto SMC card and plug it in rather than waiting for it to download 
over serial.

Hope to get something ready over the weeken that ppl can play with if 
anyone's interested.

-Matt

---

From: David Given <[email-masked]>
Date: Wed, 13 Apr 2005 18:10:22 +0100

On Wed, 2005-04-13 at 15:28 +0100, Matt Evans wrote:
[...]
> fortnight w/o much time to spare for it but...

Hah. I've just bought a house. Suddenly I don't seem to have any time
any more...

[...]
> strange stuff;  there is some sort of FTL in force here.

Oo. I didn't know that; I thought PBL was giving me the raw data
directly... hmm. This makes a big difference for the stuff I'm doing;
now I know that I can call PBL routines and get *reliable* data off the
flash. (It also explains why the PBL flash access routines are so
complex!)

[...]
> Would be a cool development cycle to just blast stuff 

I'm not entirely sure that my E2 *has* an SMC socket. There's certainly
no metal socket soldered to the motherboard; someone suggested that it
might be possible to insert a card and have it make contact with the
metal tabs on the motherboard without needing a socket, but I'm not
convinced of this. I'm still trying to scrounge one up to find it.

How complex would a minimal USB stack be? Could we load data off a USB
storage device?

-- 
+- David Given --McQ-+ 
|  [email-masked]    | "Those that repeat truisms, are also forced to
| ([email-masked]) | repeat them." --- Anonymous from Slashdot
+- www.cowlark.com --+

---

From: Matt Evans <[email-masked]>
Date: Fri, 15 Apr 2005 13:39:20 +0100

Hi David,

Urgh, housebuying... my favourite reason for procrastination.  ;)

> convinced of this. I'm still trying to scrounge one up to find it.

Sounds interesting - may almost certainly be pads for one if it's not 
fitted.  Unless they respan the board and removed it.  SMC is a bit 
nasty though, I can see why you'd prefer USB storage devices!

> How complex would a minimal USB stack be? Could we load data off a USB

I've been wondering this;  I have no experience with USB whatsoever 
though.  It could be that porting something like Redboot might be a 
better idea than what I'm working on ;-)  But Redboot and IIRC U-Boot 
have USB support.  Of course if it's easily separable both are GPL so 
we could reuse their USB stuff!  It's likely not to be too compact 
though.

-Matt