Author Topic: mtd sees flash  (Read 20727 times)

0 Members and 1 Guest are viewing this topic.

Offline sbingner

  • Administrator
  • Veteran.
  • *****
  • Posts: 1301
Re: mtd sees flash
« Reply #40 on: July 22, 2005, 06:23:34 pm »
Quote
The .s looks good, but you should use the WRITE_ADDR macro bushing posted eariler to write the control instructions to the flash chip (the data should be written without it because that's how the CPU sees the flash).

#define WRITE_ADDR(x,y) bios[(((x) & 0x7FFF)<<1) | (((x) & 0x8000) >> 15)]=(y)

So instead of:

  bios[UADDR1] = 0xAA;

You'd do:

  WRITE_ADDR(UADDR1, 0xAA);

I don't know if that will solve your segfaulting issue, but it will properly twiddle the lines on the Flash chip.

Also, because only lines A[1:15] are connected, you should only write 0x10000 bytes (0x8000 words) to the chip (A[16] isn't connected, so that just wraps around again).


I just defined the addresses as the proper addresses, why use the function?  All the function code seems to work fine, it's just getting pissy when the memory in the flash changes quickly or en-masse...

Yes the crash seems to be mixed with the program... it even ends up writing an address or two after the crash... everything it outputs as written was written properly


Anyways I'll try w/o mmap for the flash after work...

Offline RobM

  • Senior Member
  • A few posts under my belt.
  • *****
  • Posts: 48
Re: mtd sees flash
« Reply #41 on: July 22, 2005, 06:55:05 pm »
Quote
I just defined the addresses as the proper addresses, why use the function?  All the function code seems to work fine, it's just getting pissy when the memory in the flash changes quickly or en-masse...


It should be 0xAAA and 0x554 then.  That might be why...

Offline sbingner

  • Administrator
  • Veteran.
  • *****
  • Posts: 1301
Re: mtd sees flash
« Reply #42 on: July 23, 2005, 01:52:32 am »
Quote
Also, because only lines A[1:15] are connected, you should only write 0x10000 bytes (0x8000 words) to the chip (A[16] isn't connected, so that just wraps around again).


The chip is actually 0x40000 bytes, so it's 0x20000 bytes that are visible or 0x10000 words unless I've got something else mixed up like the 0x554?

Offline RobM

  • Senior Member
  • A few posts under my belt.
  • *****
  • Posts: 48
Re: mtd sees flash
« Reply #43 on: July 23, 2005, 02:06:01 am »
Ahh, you're right.  The reason A[0] on the CPU isn't connected to the flash chip is because it's addressing -words-, which I didn't exactly realize at first.  I got myself good and confused.

Apparently when you access the flash chip in byte mode, you set "A[-1]" (high or low byte in the word) via D[15] when you're writing or reading.  Odd nomenclature in the AMD doc.

Offline sbingner

  • Administrator
  • Veteran.
  • *****
  • Posts: 1301
Re: mtd sees flash
« Reply #44 on: July 23, 2005, 10:06:55 am »
Quote

It should be 0xAAA and 0x554 then.  That might be why...


That doesn't seem to make any difference...

Offline RobM

  • Senior Member
  • A few posts under my belt.
  • *****
  • Posts: 48
Re: mtd sees flash
« Reply #45 on: July 23, 2005, 02:57:33 pm »
Are you doing a jumpered internal boot through the serial port or booting off the HD?

Offline sbingner

  • Administrator
  • Veteran.
  • *****
  • Posts: 1301
Re: mtd sees flash
« Reply #46 on: July 24, 2005, 01:16:09 am »
I'm on IRC if you want to come there...

I'm writing a loader via serial since my flash chip is erased heh, then booting from ide