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/stand/netboot/Makefile =================================================================== RCS file: /e/cvsync/cvsync/src/sys/arch/sandpoint/stand/netboot/Makefile,v retrieving revision 1.4 diff -u -r1.4 Makefile --- sys/arch/sandpoint/stand/netboot/Makefile 5 Nov 2007 13:41:48 -0000 1.4 +++ sys/arch/sandpoint/stand/netboot/Makefile 5 Nov 2007 23:13:29 -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.5 diff -u -r1.5 dev_net.c --- sys/arch/sandpoint/stand/netboot/dev_net.c 5 Nov 2007 00:40:39 -0000 1.5 +++ sys/arch/sandpoint/stand/netboot/dev_net.c 5 Nov 2007 23:13:29 -0000 @@ -47,6 +47,7 @@ #include #include +#include static int netdev_sock = -1; static int netdev_opens; @@ -79,8 +80,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.3 diff -u -r1.3 entry.S --- sys/arch/sandpoint/stand/netboot/entry.S 5 Nov 2007 13:41:48 -0000 1.3 +++ sys/arch/sandpoint/stand/netboot/entry.S 5 Nov 2007 23:20:05 -0000 @@ -1,11 +1,17 @@ -/* $NetBSD: entry.S,v 1.3 2007/11/05 13:41:48 nisimura Exp $ */ +/* $Id: 20071106-00,v 1.1.1.1 2008/03/12 10:49:18 makoto Exp $ */ #include #include +#include .text .globl _start _start: + /* prepare (1) r8 and (2) r11 */ + mfspr 8,SPR_HID0 + ori 8,8,(HID0_ICE | HID0_DCE)@l /* set Instruction/Date Cache Enable */ + mtspr SPR_HID0,8 + mfspr 11,SPR_HID0 andi. 0,11,HID0_DCE ori 11,11,HID0_ICE|HID0_DCE @@ -19,6 +25,53 @@ mtspr SPR_HID0,11 /* enable caches */ sync isync + /* 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 +_ram_start: +#endif /* make sure .bss gets zeroed. */ li 0,0