Index: 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 --- powerpc/pic/intr.c 17 Oct 2007 19:56:45 -0000 1.2 +++ powerpc/pic/intr.c 4 Nov 2007 00:30:14 -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; } @@ -683,7 +682,7 @@ int ocpl; __asm volatile("sync; eieio"); /* don't reorder.... */ - + ocpl = ci->ci_cpl; ci->ci_cpl = ocpl | ncpl; __asm volatile("sync; eieio"); /* reorder protect */ Index: 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 --- powerpc/pic/pic_openpic.c 17 Oct 2007 19:56:46 -0000 1.2 +++ powerpc/pic/pic_openpic.c 4 Nov 2007 00:32:22 -0000 @@ -90,6 +90,7 @@ * OpenPIC compliant interrupt controller and see whether #else * portion can work as described. */ + // printf("%s:%d:%s\n", __func__,__LINE__,__FILE__); #if 1 openpic_set_priority(0, 15); @@ -105,6 +106,11 @@ x &= ~OPENPIC_CONFIG_8259_PASSTHRU_DISABLE; else x |= OPENPIC_CONFIG_8259_PASSTHRU_DISABLE; +#if 0 + x = openpic_read(OPENPIC_ICR); + x |= OPENPIC_ICR_SERIAL_MODE; + openpic_write(OPENPIC_ICR, x); +#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: 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 --- sandpoint/sandpoint/locore.S 17 Oct 2007 19:57:00 -0000 1.11 +++ 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: 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 --- sandpoint/stand/netboot/Makefile 30 Oct 2007 00:30:13 -0000 1.3 +++ 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: 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 --- sandpoint/stand/netboot/dev_net.c 30 Oct 2007 00:30:13 -0000 1.4 +++ 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: 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 --- sandpoint/stand/netboot/entry.S 17 Oct 2007 19:57:00 -0000 1.2 +++ 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-00,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: 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 --- sandpoint/stand/netboot/sip.c 2 Nov 2007 02:31:12 -0000 1.6 +++ sandpoint/stand/netboot/sip.c 3 Nov 2007 12:46:25 -0000 @@ -103,7 +103,13 @@ l = alloc(sizeof(struct local)); memset(l, 0, sizeof(struct local)); +#if 1 l->csr = DEVTOV(pcicfgread(tag, 0x14)); /* use mem space */ + printf("0x14 -> %0x\n", l->csr); +#else + l->csr = DEVTOV(pcicfgread(tag, 0x10)); /* use mem space */ + printf("0x10 -> %0x\n", l->csr); +#endif CSR_WRITE(l, SIP_IER, 0); CSR_WRITE(l, SIP_IMR, 0); @@ -184,10 +190,10 @@ do { if ((le32toh(TxD->xd1) & CMDSTS_OWN) == 0) goto done; - DELAY(10); + DELAY(100); inv(TxD, sizeof(struct desc)); } while (--loop > 0); - printf("xmit failed\n"); + printf("xmit failed ...\n"); return -1; done: return len; @@ -250,7 +256,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