Subject: Re: Patch #1 for CL7500FE support

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Thu, 1 Jun 2000 07:34:13 +0100 (BST)

Jason Gunthorpe writes:
> To make this work I decided to entirely rewrite the head.S, it seemed to
> make some assumptions that are not valid on this chip. In particular you
> cannot read back the MMU control register, you get 0.

head.S does not expect that you can read back the MMU control register.
Which head.S are you mentioning here?  The one in arch/arm/kernel, or
arch/arm/boot/compressed?
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |            http://www.arm.linux.org.uk/            /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

unsubscribe: body of `unsubscribe linux-arm-kernel' to [email-masked]

---

From: Jason Gunthorpe <[email-masked]>
Date: Thu, 1 Jun 2000 12:04:31 -0600 (MDT)

> arch/arm/boot/compressed?

The one in boot/compressed. The one in the main kernel is OK. This bit:

                mrc     p15, 0, r0, c1, c0
                orr     r0, r0, #0x1000         @ I-cache enable
#ifndef DEBUG
                orr     r0, r0, #0x003d         @ Write buffer, mmu
#endif
                mcr     p15, 0, r0, c1, c0

The first instruction will return 0 on this chip.

Though that whole routine might never be run.. I will revisit that before
I make a proper patch. It may be that all it needs is the code to turn off
the mmu inserted at the top:

        ldr     r3, .MyDummyStart;        @ Real start address
        mov     r0,#((1<<5) | (1<<4) | 0) @ 32 bit Mode, MMU off
        mcr     p15,0,r1,c5,c0            @ Flush TLBs
        mcr     p15, 0, r0, c1, c0;       @ Load the new control settings
        mov     pc,r3;                    @ Jump to the real code

Part of my initial investigation was warped due to that silly ARM Debugger
software, still have to revisit that. :<

I haven't looked at the main kernel head.S too closely, it worked on the
first try!

Russell, Can you suggest how to properly patch for device addresses? For
instance the LAN chip on this board is at 0x80090300 and there are only
two serial ports (serial driver seems to find 4, two are bogus looking). 
What is the best solution here? Use a kernel command line [haven't got
that working yet :>] or extend the probe range of the drivers with an
#ifdef?

Thanks
Jason

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Thu, 1 Jun 2000 21:06:10 +0100 (BST)

> The one in boot/compressed. The one in the main kernel is OK. This bit:

Ah ha.  That bit is only ever reached if we are running on a StrongARM
processor.  The architecture of the code is not ready, and will probably
not be ready for 2.4.0real, so the intention is that it is existing
processors only (not ARM6 or ARM7).

> I haven't looked at the main kernel head.S too closely, it worked on the

Good! It's designed carefully to contain around zero dependencies on
processor type.

> that working yet :>] or extend the probe range of the drivers with an

Serial ports aren't too much of a problem - there is an architecture-
dependent include file in include/asm-arm/arch-cl7500/serial.h which
contains them.

They look like they're there for a reason, so I'd be tempted to leave
them there, or play around with the flags until they do get correctly
detected/not detected.

It may be wise to check what setserial -bav reports for each device once
you get usermode up and running.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |            http://www.arm.linux.org.uk/            /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

---

From: Jason Gunthorpe <[email-masked]>
Date: Thu, 1 Jun 2000 19:48:57 -0600 (MDT)

> processors only (not ARM6 or ARM7).

Ah OK. That means if I stick that code I pasted at the top of the loader
it should work just fine, probably will work on all the 32 bit CPUs at
least. I'll try that tomorrow.

 > Good! It's designed carefully to contain around zero dependencies on

Yeah, that was a dream, I was very happy I didn't have to debug deeper!
 
> them there, or play around with the flags until they do get correctly

I'll look the hardware address up in the guide I have and see what is
there... If anything it should be the ''standard'' alternate serial
address on the ISA bus I'd think. <shrug>

Other CL7500FE people: I spent all day working on the ethernet chip. My
board for some odd reason had a corrupt serial eeprom, I had to rewrite it
(will post code..) and the cs8900 driver is coded to expect some kind of
weird Card-Specific eeprom data :< I had just finished a patch around
that..

All that is left is to figure out what the kernel IRQ is for the pin the
chip is on and see if DMA can be made to operate. I'll mail this patch to
Andrew Morton and ask his advice I suppose.

Thanks,
Jason