Index: sys/arch/powerpc/pic/intr.c =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/powerpc/pic/intr.c,v retrieving revision 1.2 diff -u -r1.2 intr.c --- sys/arch/powerpc/pic/intr.c 17 Oct 2007 19:56:45 -0000 1.2 +++ sys/arch/powerpc/pic/intr.c 4 Nov 2007 00:56:41 -0000 @@ -221,6 +221,12 @@ *p = &fakehand; /* + * now that the handler is established we're actually ready to + * calculate the masks + */ + intr_calculatemasks(); + + /* * Poke the real handler in now. */ ih->ih_fun = ih_fun; @@ -234,13 +240,6 @@ pic->pic_establish_irq(pic, hwirq - pic->pic_intrbase, is->is_type, maxlevel); - /* - * now that the handler is established we're actually ready to - * calculate the masks - */ - intr_calculatemasks(); - - return ih; } Index: sys/arch/powerpc/pic/pic_openpic.c =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/powerpc/pic/pic_openpic.c,v retrieving revision 1.2 diff -u -r1.2 pic_openpic.c --- sys/arch/powerpc/pic/pic_openpic.c 17 Oct 2007 19:56:46 -0000 1.2 +++ sys/arch/powerpc/pic/pic_openpic.c 4 Nov 2007 03:44:00 -0000 @@ -105,6 +105,12 @@ x &= ~OPENPIC_CONFIG_8259_PASSTHRU_DISABLE; else x |= OPENPIC_CONFIG_8259_PASSTHRU_DISABLE; +#if 1 + int y; + y = openpic_read(OPENPIC_ICR); + y |= OPENPIC_ICR_SERIAL_MODE; + openpic_write(OPENPIC_ICR, y); +#endif openpic_write(OPENPIC_CONFIG, x); openpic_write(OPENPIC_SPURIOUS_VECTOR, 0xff); @@ -162,8 +168,10 @@ x = irq; x |= OPENPIC_IMASK; +#if 0 x |= (irq == 0) ? OPENPIC_POLARITY_POSITIVE : OPENPIC_POLARITY_NEGATIVE; +#endif x |= (type == IST_EDGE) ? OPENPIC_SENSE_EDGE : OPENPIC_SENSE_LEVEL; x |= realpri << OPENPIC_PRIORITY_SHIFT; openpic_write(OPENPIC_SRC_VECTOR(irq), x); Index: sys/arch/sandpoint/sandpoint/locore.S =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/sandpoint/locore.S,v retrieving revision 1.11 diff -u -r1.11 locore.S --- sys/arch/sandpoint/sandpoint/locore.S 17 Oct 2007 19:57:00 -0000 1.11 +++ sys/arch/sandpoint/sandpoint/locore.S 2 Nov 2007 13:11:08 -0000 @@ -153,6 +153,22 @@ mtmsr 3 b 0xFFF00100 + .globl _C_LABEL(onechar_out) +_C_LABEL(onechar_out): + lis 7, 0xfe00 + ori 7, 7, 0x03f8 + + li 8, 0x41 + stb 8, 0(7) + sync + isync + + li 8, 0x61 + stb 8, 0(7) + sync + isync + blr + /* * Include common switch / setfault code */ Index: sys/arch/sandpoint/stand/netboot/Makefile =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/stand/netboot/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- sys/arch/sandpoint/stand/netboot/Makefile 30 Oct 2007 00:30:13 -0000 1.3 +++ sys/arch/sandpoint/stand/netboot/Makefile 2 Nov 2007 07:36:33 -0000 @@ -25,6 +25,7 @@ BINMODE= 444 RELOC= 1000000 +RELOC= 2000000 ENTRY= _start .BEGIN: Index: sys/arch/sandpoint/stand/netboot/dev_net.c =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/stand/netboot/dev_net.c,v retrieving revision 1.4 diff -u -r1.4 dev_net.c --- sys/arch/sandpoint/stand/netboot/dev_net.c 30 Oct 2007 00:30:13 -0000 1.4 +++ sys/arch/sandpoint/stand/netboot/dev_net.c 2 Nov 2007 07:36:33 -0000 @@ -48,6 +48,7 @@ #include #include +#include static int netdev_sock = -1; static int netdev_opens; @@ -77,8 +78,13 @@ } /* XXX always to use "netbsd" kernel filename */ - strcpy(bootfile, "/netbsd"); + strcpy(bootfile, LOADFILE); +#if 1 + printf(" ... net_open: filename: %s\n", bootfile); + printf(" ... net_open: server addr: %s\n", inet_ntoa(rootip)); + printf(" ... net_open: server path: %s\n", rootpath); +#endif if (nfs_mount(netdev_sock, rootip, rootpath) != 0) { error = errno; goto bad; Index: sys/arch/sandpoint/stand/netboot/entry.S =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/stand/netboot/entry.S,v retrieving revision 1.2 diff -u -r1.2 entry.S --- sys/arch/sandpoint/stand/netboot/entry.S 17 Oct 2007 19:57:00 -0000 1.2 +++ sys/arch/sandpoint/stand/netboot/entry.S 2 Nov 2007 07:36:33 -0000 @@ -1,7 +1,8 @@ -/* $NetBSD: entry.S,v 1.2 2007/10/17 19:57:00 garbled Exp $ */ +/* $Id: 20071104-02,v 1.1.1.1 2008/03/12 10:49:18 makoto Exp $ */ #include #include +#include .text .globl _start @@ -34,6 +35,53 @@ sync isync #endif + /* we have three occasion + * (1) write this code to flash ( say 0xff00_0000 ) + * in this case the code will be copied to 0x0100_0000 by this code self + * (2) write this code to RAM ( say, 0x0110_0000 ) to test Flash version + * this will copy the self code to 0x0100_0000 + * (3) 2 steps boot, the name of this file is netbsd, and to be loaded + * on the address of this ELF code. + * The previous flash version of code will run on 0xff00_0000, that will + * copy to location (previous) RELOC defined in Makefile, say 0x0100_0000 + * and load this code to 0x0200_0000, in that case, copy won't be necessary. + * + * related variables and its value on each case: + * (1) (2) (3) + * (first step) ff00 0000 + * 0100 0000 + * flash ff00 0000 0110 0000 dont'care, no copy + * RELOC 0100 0000 0100 0000 0200 0000 + * + * (and loading) netbsd netbsd netbsd.1 + * + * define TWOSTEP in netboot.h file + */ + +#ifndef TWOSTEP + .set flash, 0xff010000 /* write to this address on flash */ + .set flash, 0x01100000 /* this will be used for test flash version on RAM */ + /* copy this code to RAM */ + lis 7, flash@h /* original place */ + ori 7, 7, flash@l + lis 8, _start@h /* location to execute */ + ori 8, 8, _start@l + + li 5, 16384 /* 64k bytes = 16k words */ + mtctr 5 +_ram_copy: + lwz 5, 0(7) + stw 5, 0(8) + addi 7, 7, 4 + addi 8, 8, 4 + bdnz _ram_copy # bc BO(16),BI(0)= blt, target +/* loop: b loop */ + lis 8, _ram_start@h + ori 8, 8, _ram_start@l + mtlr 8 + blr +# endif +_ram_start: /* make sure .bss gets zeroed. */ li 0,0 Index: sys/arch/sandpoint/stand/netboot/main.c =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/stand/netboot/main.c,v retrieving revision 1.5 diff -u -r1.5 main.c --- sys/arch/sandpoint/stand/netboot/main.c 2 Nov 2007 02:31:11 -0000 1.5 +++ sys/arch/sandpoint/stand/netboot/main.c 4 Nov 2007 01:50:10 -0000 @@ -534,8 +534,8 @@ pcicfgwrite(ide, 0x08, val | (0x8f << 8)); /* pcib: 0x43 - IDE interrupt routing */ - val = pcicfgread(pcib, 0x40) & 0x00ffffff; - pcicfgwrite(pcib, 0x40, val); + val = pcicfgread(pcib, 0x43) & 0x00ffffff; + pcicfgwrite(pcib, 0x43, val); /* pcib: 0x45/44 - PCI interrupt routing */ val = pcicfgread(pcib, 0x44) & 0xffff0000; @@ -563,8 +563,8 @@ pcicfgwrite(ide, 0x08, val | (0x8a << 8)); /* pcib: 0x43 - IDE interrupt routing */ - val = pcicfgread(pcib, 0x40) & 0x00ffffff; - pcicfgwrite(pcib, 0x40, val | (0xee << 24)); + val = pcicfgread(pcib, 0x43) & 0x00ffffff; + pcicfgwrite(pcib, 0x43, val | (0xee << 24)); /* ide: 0x45/44 - PCI interrupt routing */ val = pcicfgread(ide, 0x44) & 0xffff0000; Index: sys/arch/sandpoint/stand/netboot/sip.c =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/stand/netboot/sip.c,v retrieving revision 1.6 diff -u -r1.6 sip.c --- sys/arch/sandpoint/stand/netboot/sip.c 2 Nov 2007 02:31:12 -0000 1.6 +++ sys/arch/sandpoint/stand/netboot/sip.c 4 Nov 2007 00:58:00 -0000 @@ -250,7 +250,7 @@ data = (R110 << 6) | (loc & 0x3f); /* 6 bit addressing */ /* instruct R110 op. at loc in MSB first order */ - for (i = (1 << 11); i != 0; i >>= 1) { + for (i = (1 << 8); i != 0; i >>= 1) { if (data & i) v |= EROMAR_EEDI; else