linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Trying to enable backside on a G4
@ 2000-07-07 23:50 Guillaume Laurès
  2000-07-08  6:15 ` Michel Lanners
  0 siblings, 1 reply; 7+ messages in thread
From: Guillaume Laurès @ 2000-07-07 23:50 UTC (permalink / raw)
  To: linuxppc-dev@lists.linuxppc.org


Hi,

I'm just starting writing kernel-level code :-), and I was trying to set
the L2CR register on a G4 upgrade for a PCI PowerMac (actually a
8600/250 upgraded with a XLR8 MACh Carrier G4 350/233)

So this is my code, extracted from arch/ppc/kernel/setup.c :

/* Programme réalisant l'initialisation du registre l2cr sur G3 ou G4
   08/07/00 Guillaume Laures
*/

#include <linux/config.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <linux/reboot.h>
#include <linux/delay.h>
#include <linux/blk.h>


int main()
{
  unsigned long val = 0xb5100000;       // XLR8 MACh Carrier G4 350/233
//  unsigned long val = 0xb9100000;       // XLR8 MACh Carrier G4
350/175
//  unsigned long val = 0xb9000000;       // Apple G4 450/225 SawTooth
cpu module
//  unsigned long val = 0xb5000000;       // Apple G4 450/300 ?

  if ( ((_get_PVR() >> 16) == 8) || ((_get_PVR() >> 16) == 12) )
    {
      printk(KERN_INFO "l2cr set to %lx\n", val);
      _set_L2CR(0);
//      _set_L2CR(val);
      return 0;
    }
  else
    return 1;
}

And here is my makefile :

all:            l2cr_ini

clean:
                rm -f l2cr_ini l2cr_ini.o

l2cr_ini.o:     l2cr_ini.c
                gcc -D__KERNEL__ -I/usr/src/linux/include -Wall
-Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing
-D__powerpc__ -fsigned-char -msoft-float -pipe -fno-builtin -ffixed-r2
-Wno-uninitialized -mmultiple -mstring -c l2cr_ini.c

l2cr_ini:       l2cr_ini.o
                gcc -o l2cr_ini l2cr_ini.o

I can get the .o, but obviously not the executable, does anyone could
help me get it please ?

--
Guillaume


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-07-10 22:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-07-07 23:50 Trying to enable backside on a G4 Guillaume Laurès
2000-07-08  6:15 ` Michel Lanners
2000-07-08 11:40   ` Guillaume Laurès
2000-07-08 17:24     ` Michel Lanners
2000-07-09 16:35       ` Guillaume Laurès
2000-07-09 20:34         ` Benjamin Herrenschmidt
2000-07-10 22:17           ` Michel Lanners

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).