CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: thorpej Date: Sat Nov 21 17:54:48 UTC 2020 Modified Files: src/sys/arch/newsmips/apbus: apbus.c xafb.c src/sys/arch/newsmips/dev: fb.c hb.c src/sys/arch/newsmips/newsmips: bus.c Log Message: malloc(9) -> kmem(9) To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/newsmips/apbus/apbus.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/newsmips/apbus/xafb.c cvs rdiff -u -r1.26 -r1.27 src/sys/arch/newsmips/dev/fb.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/newsmips/dev/hb.c cvs rdiff -u -r1.33 -r1.34 src/sys/arch/newsmips/newsmips/bus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/apbus.c diff -u src/sys/arch/newsmips/apbus/apbus.c:1.26 src/sys/arch/newsmips/apbus/apbus.c:1.27 --- src/sys/arch/newsmips/apbus/apbus.c:1.26 Sun Nov 10 21:16:31 2019 +++ src/sys/arch/newsmips/apbus/apbus.c Sat Nov 21 17:54:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: apbus.c,v 1.26 2019/11/10 21:16:31 chs Exp $ */ +/* $NetBSD: apbus.c,v 1.27 2020/11/21 17:54:47 thorpej Exp $ */ /*- * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved. @@ -27,13 +27,13 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.26 2019/11/10 21:16:31 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.27 2020/11/21 17:54:47 thorpej Exp $"); #define __INTR_PRIVATE #include #include -#include +#include #include #include #include @@ -230,7 +230,7 @@ apbus_intr_establish(int level, int mask ip = &apintr_tab[level]; - ih = malloc(sizeof(*ih), M_DEVBUF, M_WAITOK); + ih = kmem_alloc(sizeof(*ih), KM_SLEEP); ih->ih_mask = mask; ih->ih_priority = priority; ih->ih_func = func; @@ -501,7 +501,7 @@ apbus_dmatag_init(struct apbus_attach_ar { struct newsmips_bus_dma_tag *dmat; - dmat = malloc(sizeof(*dmat), M_DEVBUF, M_WAITOK); + dmat = kmem_alloc(sizeof(*dmat), KM_SLEEP); memcpy(dmat, &apbus_dma_tag, sizeof(*dmat)); dmat->_slotno = apa->apa_slotno; dmat->_slotbaset = 0; Index: src/sys/arch/newsmips/apbus/xafb.c diff -u src/sys/arch/newsmips/apbus/xafb.c:1.18 src/sys/arch/newsmips/apbus/xafb.c:1.19 --- src/sys/arch/newsmips/apbus/xafb.c:1.18 Thu Jul 21 19:49:58 2016 +++ src/sys/arch/newsmips/apbus/xafb.c Sat Nov 21 17:54:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: xafb.c,v 1.18 2016/07/21 19:49:58 christos Exp $ */ +/* $NetBSD: xafb.c,v 1.19 2020/11/21 17:54:47 thorpej Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -29,13 +29,13 @@ /* "xa" frame buffer driver. Currently supports 1280x1024x8 only. */ #include -__KERNEL_RCSID(0, "$NetBSD: xafb.c,v 1.18 2016/07/21 19:49:58 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xafb.c,v 1.19 2020/11/21 17:54:47 thorpej Exp $"); #include #include #include #include -#include +#include #include #include @@ -157,8 +157,7 @@ xafb_attach(device_t parent, device_t se ri->ri_flg &= ~RI_NO_AUTO; sc->sc_nscreens = 1; } else { - dc = malloc(sizeof(struct xafb_devconfig), M_DEVBUF, - M_WAITOK|M_ZERO); + dc = kmem_zalloc(sizeof(struct xafb_devconfig), KM_SLEEP); dc->dc_fbpaddr = (paddr_t)0x1000; dc->dc_fbbase = (void *)MIPS_PHYS_TO_KSEG1(dc->dc_fbpaddr); dc->dc_reg = (void *)(apa->apa_hwbase + 0x3000); Index: src/sys/arch/newsmips/dev/fb.c diff -u src/sys/arch/newsmips/dev/fb.c:1.26 src/sys/arch/newsmips/dev/fb.c:1.27 --- src/sys/arch/newsmips/dev/fb.c:1.26 Fri Jan 31 15:43:06 2014 +++ src/sys/arch/newsmips/dev/fb.c Sat Nov 21 17:54:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fb.c,v 1.26 2014/01/31 15:43:06 tsutsui Exp $ */ +/* $NetBSD: fb.c,v 1.27 2020/11/21 17:54:47 thorpej Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,12 +27,12 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fb.c,v 1.26 2014/01/31 15:43:06 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fb.c,v 1.27 2020/11/21 17:54:47 thorpej Exp $"); #include #include #include -#include +#include #include #include @@ -146,8 +146,7 @@ fb_attach(device_t parent, device_t self ri->ri_flg &= ~RI_NO_AUTO; sc->sc_nscreens = 1; } else { - dc = malloc(sizeof(struct fb_devconfig), M_DEVBUF, - M_WAITOK|M_ZERO); + dc = kmem_zalloc(sizeof(struct fb_devconfig), KM_SLEEP); dc->dc_fbbase = NWB253_VRAM; fb_common_init(dc); Index: src/sys/arch/newsmips/dev/hb.c diff -u src/sys/arch/newsmips/dev/hb.c:1.20 src/sys/arch/newsmips/dev/hb.c:1.21 --- src/sys/arch/newsmips/dev/hb.c:1.20 Sun Nov 10 21:16:31 2019 +++ src/sys/arch/newsmips/dev/hb.c Sat Nov 21 17:54:47 2020 @@ -1,13 +1,13 @@ -/* $NetBSD: hb.c,v 1.20 2019/11/10 21:16:31 chs Exp $ */ +/* $NetBSD: hb.c,v 1.21 2020/11/21 17:54:47 thorpej Exp $ */ #include -__KERNEL_RCSID(0, "$NetBSD: hb.c,v 1.20 2019/11/10 21:16:31 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hb.c,v 1.21 2020/11/21 17:54:47 thorpej Exp $"); #define __INTR_PRIVATE #include #include
CVS commit: src/sys/arch/newsmips/apbus
Module Name:src Committed By: martin Date: Wed Feb 5 13:08:19 UTC 2020 Modified Files: src/sys/arch/newsmips/apbus: if_sn.c Log Message: Fix if_stats access. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/arch/newsmips/apbus/if_sn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/if_sn.c diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.48 src/sys/arch/newsmips/apbus/if_sn.c:1.49 --- src/sys/arch/newsmips/apbus/if_sn.c:1.48 Tue Feb 4 07:41:01 2020 +++ src/sys/arch/newsmips/apbus/if_sn.c Wed Feb 5 13:08:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn.c,v 1.48 2020/02/04 07:41:01 skrll Exp $ */ +/* $NetBSD: if_sn.c,v 1.49 2020/02/05 13:08:19 martin Exp $ */ /* * National Semiconductor DP8393X SONIC Driver @@ -16,7 +16,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.48 2020/02/04 07:41:01 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.49 2020/02/05 13:08:19 martin Exp $"); #include "opt_inet.h" @@ -966,9 +966,9 @@ sonicrxint(struct sn_softc *sc) (char *)sc->rbuf[orra & RBAMASK] + (rxpkt_ptr & PGOFSET); if (sonic_read(sc, pkt, len) == 0) -sc->sc_if.if_ierrors++; +if_statinc(&sc->sc_if, if_ierrors); } else - sc->sc_if.if_ierrors++; + if_statinc(&sc->sc_if, if_ierrors); /* * give receive buffer area back to chip.
CVS commit: src/sys/arch/newsmips/apbus
Module Name:src Committed By: skrll Date: Tue Feb 4 07:41:01 UTC 2020 Modified Files: src/sys/arch/newsmips/apbus: if_sn.c Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/arch/newsmips/apbus/if_sn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/if_sn.c diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.47 src/sys/arch/newsmips/apbus/if_sn.c:1.48 --- src/sys/arch/newsmips/apbus/if_sn.c:1.47 Tue Feb 4 07:36:42 2020 +++ src/sys/arch/newsmips/apbus/if_sn.c Tue Feb 4 07:41:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn.c,v 1.47 2020/02/04 07:36:42 skrll Exp $ */ +/* $NetBSD: if_sn.c,v 1.48 2020/02/04 07:41:01 skrll Exp $ */ /* * National Semiconductor DP8393X SONIC Driver @@ -16,7 +16,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.47 2020/02/04 07:36:42 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.48 2020/02/04 07:41:01 skrll Exp $"); #include "opt_inet.h" @@ -365,7 +365,7 @@ snreset(struct sn_softc *sc) sninit(sc); } -static int +static int sninit(struct sn_softc *sc) { u_long s_rcr; @@ -443,7 +443,7 @@ sninit(struct sn_softc *sc) * Called on final close of device, or if sninit() fails * part way through. */ -static int +static int snstop(struct sn_softc *sc) { struct mtd *mtd; @@ -589,7 +589,7 @@ sonicput(struct sn_softc *sc, struct mbu /* * CAM support */ -static void +static void caminitialise(struct sn_softc *sc) { void *p_cda = sc->p_cda; @@ -606,7 +606,7 @@ caminitialise(struct sn_softc *sc) SWO(bitmode, p_cda, CDA_ENABLE, 0); } -static void +static void camentry(struct sn_softc *sc, int entry, const u_char *ea) { void *p_cda = sc->p_cda; @@ -616,11 +616,11 @@ camentry(struct sn_softc *sc, int entry, SWO(bitmode, p_cda, camoffset + CDA_CAMAP2, (ea[5] << 8) | ea[4]); SWO(bitmode, p_cda, camoffset + CDA_CAMAP1, (ea[3] << 8) | ea[2]); SWO(bitmode, p_cda, camoffset + CDA_CAMAP0, (ea[1] << 8) | ea[0]); - SWO(bitmode, p_cda, CDA_ENABLE, + SWO(bitmode, p_cda, CDA_ENABLE, (SRO(bitmode, p_cda, CDA_ENABLE) | (1 << entry))); } -static void +static void camprogram(struct sn_softc *sc) { struct ethercom *ec = &sc->sc_ethercom; @@ -696,7 +696,7 @@ camprogram(struct sn_softc *sc) } #ifdef SNDEBUG -static void +static void camdump(struct sn_softc *sc) { int i; @@ -721,7 +721,7 @@ camdump(struct sn_softc *sc) } #endif -static void +static void initialise_tda(struct sn_softc *sc) { struct mtd *mtd; @@ -868,7 +868,7 @@ snintr(void *arg) /* * Transmit interrupt routine */ -static void +static void sonictxint(struct sn_softc *sc) { struct mtd *mtd; @@ -943,7 +943,7 @@ sonictxint(struct sn_softc *sc) /* * Receive interrupt routine */ -static void +static void sonicrxint(struct sn_softc *sc) { void * rda; @@ -1032,7 +1032,7 @@ sonicrxint(struct sn_softc *sc) * sonic_read -- pull packet off interface and forward to * appropriate protocol handler */ -static inline int +static inline int sonic_read(struct sn_softc *sc, void *pkt, int len) { struct ifnet *ifp = &sc->sc_if; @@ -1102,10 +1102,10 @@ sonic_get(struct sn_softc *sc, void *pkt if (mp == &top) { char *newdata = (char *) - ALIGN((char *)m->m_data + + ALIGN((char *)m->m_data + sizeof(struct ether_header)) - sizeof(struct ether_header); - len -= newdata - m->m_data; + len -= newdata - m->m_data; m->m_data = newdata; }
CVS commit: src/sys/arch/newsmips/apbus
Module Name:src Committed By: skrll Date: Tue Feb 4 07:36:42 UTC 2020 Modified Files: src/sys/arch/newsmips/apbus: if_sn.c Log Message: Adopt To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/arch/newsmips/apbus/if_sn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/if_sn.c diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.46 src/sys/arch/newsmips/apbus/if_sn.c:1.47 --- src/sys/arch/newsmips/apbus/if_sn.c:1.46 Fri Sep 13 07:55:06 2019 +++ src/sys/arch/newsmips/apbus/if_sn.c Tue Feb 4 07:36:42 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn.c,v 1.46 2019/09/13 07:55:06 msaitoh Exp $ */ +/* $NetBSD: if_sn.c,v 1.47 2020/02/04 07:36:42 skrll Exp $ */ /* * National Semiconductor DP8393X SONIC Driver @@ -16,7 +16,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.46 2019/09/13 07:55:06 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.47 2020/02/04 07:36:42 skrll Exp $"); #include "opt_inet.h" @@ -347,7 +347,7 @@ outloop: sc->mtd_prev = sc->mtd_free; sc->mtd_free = mtd_next; - ifp->if_opackets++; /* # of pkts */ + if_statinc(ifp, if_opackets); /* # of pkts */ /* Jump back for possibly more punishment. */ goto outloop; @@ -916,11 +916,11 @@ sonictxint(struct sn_softc *sc) txp_status = SRO(sc->bitmode, txp, TXP_STATUS); - ifp->if_collisions += (txp_status & TCR_EXC) ? 16 : - ((txp_status & TCR_NC) >> 12); + if_statadd(ifp, if_collisions, (txp_status & TCR_EXC) ? 16 : + ((txp_status & TCR_NC) >> 12)); if ((txp_status & TCR_PTX) == 0) { - ifp->if_oerrors++; + if_statinc(ifp, if_oerrors); printf("%s: Tx packet status=0x%x\n", device_xname(sc->sc_dev), txp_status);
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: tsutsui Date: Fri Oct 19 13:40:33 UTC 2018 Modified Files: src/sys/arch/newsmips/apbus: zs_ap.c src/sys/arch/newsmips/include: apbus.h src/sys/arch/newsmips/newsmips: machdep.c Log Message: Reorganize APbus zs(4) console handling. - set sccport0a address on early startup and use it for cnputc and cngetc - explicitly initialize zs chip in the cninit function so that zs console can be used even if it is not initialized by PROM firmware Tested on both news5 and news4000. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/arch/newsmips/apbus/zs_ap.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/newsmips/include/apbus.h cvs rdiff -u -r1.120 -r1.121 src/sys/arch/newsmips/newsmips/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/zs_ap.c diff -u src/sys/arch/newsmips/apbus/zs_ap.c:1.29 src/sys/arch/newsmips/apbus/zs_ap.c:1.30 --- src/sys/arch/newsmips/apbus/zs_ap.c:1.29 Sun Oct 14 00:10:11 2018 +++ src/sys/arch/newsmips/apbus/zs_ap.c Fri Oct 19 13:40:33 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: zs_ap.c,v 1.29 2018/10/14 00:10:11 tsutsui Exp $ */ +/* $NetBSD: zs_ap.c,v 1.30 2018/10/19 13:40:33 tsutsui Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.29 2018/10/14 00:10:11 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.30 2018/10/19 13:40:33 tsutsui Exp $"); #include #include @@ -138,12 +138,14 @@ struct zschan { static void *zsaddr[NZS]; -/* Flags from cninit() */ -static int zs_hwflags[NZS][2]; - /* Default speed for all channels */ static int zs_defspeed = 9600; +/* console status from cninit */ +static struct zs_chanstate zs_ap_conschan_store; +static struct zs_chanstate *zs_ap_conschan; +static struct zschan *zc_ap_cons; + static uint8_t zs_init_reg[16] = { 0, /* 0: CMD (reset, etc.) */ 0, /* 1: No interrupts yet. */ @@ -157,7 +159,7 @@ static uint8_t zs_init_reg[16] = { ZSWR9_MASTER_IE, 0, /*10: Misc. TX/RX control bits */ ZSWR11_TXCLK_BAUD | ZSWR11_RXCLK_BAUD, - ((PCLK/32)/9600)-2, /*12: BAUDLO (default=9600) */ + BPS_TO_TCONST(PCLK/16,9600), /*12: BAUDLO (default=9600) */ 0, /*13: BAUDHI (default=9600) */ ZSWR14_BAUD_ENA | ZSWR14_BAUD_FROM_PCLK, ZSWR15_BREAK_IE, @@ -334,7 +336,6 @@ zs_ap_attach(device_t parent, device_t s */ for (channel = 0; channel < 2; channel++) { zsc_args.channel = channel; - zsc_args.hwflags = zs_hwflags[zs_unit][channel]; cs = &zsc->zsc_cs_store[channel]; zsc->zsc_cs[channel] = cs; @@ -345,18 +346,19 @@ zs_ap_attach(device_t parent, device_t s cs->cs_brg_clk = PCLK / 16; zc = zs_get_chan_addr(zs_unit, channel); - cs->cs_reg_csr = &zc->zc_csr; - cs->cs_reg_data = &zc->zc_data; - memcpy(cs->cs_creg, zs_init_reg, 16); - memcpy(cs->cs_preg, zs_init_reg, 16); - - /* XXX: Get these from the EEPROM instead? */ - /* XXX: See the mvme167 code. Better. */ - if (zsc_args.hwflags & ZS_HWFLAG_CONSOLE) - cs->cs_defspeed = zs_get_speed(cs); - else + if (zc == zc_ap_cons) { + memcpy(cs, zs_ap_conschan, sizeof(struct zs_chanstate)); + zs_ap_conschan = cs; + zsc_args.hwflags = ZS_HWFLAG_CONSOLE; + } else { + cs->cs_reg_csr = &zc->zc_csr; + cs->cs_reg_data = &zc->zc_data; + memcpy(cs->cs_creg, zs_init_reg, 16); + memcpy(cs->cs_preg, zs_init_reg, 16); cs->cs_defspeed = zs_defspeed; + zsc_args.hwflags = 0; + } cs->cs_defcflag = zs_def_cflag; /* Make these correspond to cs_defcflag (-crtscts) */ @@ -534,21 +536,47 @@ static void zscninit(struct consdev *cn) { extern const struct cdevsw zstty_cdevsw; + struct zs_chanstate *cs; + u_int tconst; + + /* Wait a while for PROM console output to complete */ + DELAY(2); cn->cn_dev = makedev(cdevsw_lookup_major(&zstty_cdevsw), 0); cn->cn_pri = CN_REMOTE; - zs_hwflags[0][0] = ZS_HWFLAG_CONSOLE; + + zc_ap_cons = sccport0a; + zs_delay = zs_ap_delay; + + zs_ap_conschan = cs = &zs_ap_conschan_store; + + /* Setup temporary chanstate. */ + cs->cs_reg_csr = &zc_ap_cons->zc_csr; + cs->cs_reg_data = &zc_ap_cons->zc_data; + + /* Initialize the pending registers. */ + memcpy(cs->cs_preg, zs_init_reg, 16); + cs->cs_preg[5] |= ZSWR5_DTR | ZSWR5_RTS; + + cs->cs_brg_clk = PCLK / 16; + cs->cs_defspeed = 9600; /* PROM use 9600 bps */ + tconst = BPS_TO_TCONST(cs->cs_brg_clk, cs->cs_defspeed); + cs->cs_preg[12] = tconst; + cs->cs_preg[13] = tconst >> 8; + + /* Clear the master interrupt enable. */ + zs_write_reg(cs, 9, 0); + + /* Reset the whole SCC chip. */ + zs_write_reg(cs, 9, ZSWR9_HARD_RESET); + + /* Copy "pending" to "current" and H/W */ + zs_loadchannelregs(cs); } static int zscngetc(dev_t dev) { - void *sccport0a; - - if (systype == NEWS5000) - sccport0a = (void *)NEWS5000_SCCPORT0A; - if (systype == NEWS4000) - sccport0a = (void *)NEWS4000_
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: tsutsui Date: Sun Oct 14 00:10:11 UTC 2018 Modified Files: src/sys/arch/newsmips/apbus: apbus.c apbusvar.h if_sn.c if_sn_ap.c if_snvar.h kb_ap.c spifi.c zs_ap.c src/sys/arch/newsmips/conf: GENERIC files.newsmips std.newsmips src/sys/arch/newsmips/include: adrsmap.h apbus.h cpu.h intr.h src/sys/arch/newsmips/newsmips: cpu_cons.c machdep.c machid.h news5000.c src/sys/arch/newsmips/stand/boot: boot.c version Added Files: src/sys/arch/newsmips/newsmips: news4000.c Log Message: Add NWS-4000 support. Based on nonaka@'s porting effort back in 2002. See announcement on port-newsmips@ for more details: http://mail-index.netbsd.org/port-newsmips/2018/10/13/msg000231.html To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/newsmips/apbus/apbus.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/newsmips/apbus/apbusvar.h cvs rdiff -u -r1.42 -r1.43 src/sys/arch/newsmips/apbus/if_sn.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/newsmips/apbus/if_sn_ap.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/newsmips/apbus/if_snvar.h cvs rdiff -u -r1.11 -r1.12 src/sys/arch/newsmips/apbus/kb_ap.c cvs rdiff -u -r1.19 -r1.20 src/sys/arch/newsmips/apbus/spifi.c cvs rdiff -u -r1.28 -r1.29 src/sys/arch/newsmips/apbus/zs_ap.c cvs rdiff -u -r1.135 -r1.136 src/sys/arch/newsmips/conf/GENERIC cvs rdiff -u -r1.30 -r1.31 src/sys/arch/newsmips/conf/files.newsmips cvs rdiff -u -r1.18 -r1.19 src/sys/arch/newsmips/conf/std.newsmips cvs rdiff -u -r1.8 -r1.9 src/sys/arch/newsmips/include/adrsmap.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/newsmips/include/apbus.h cvs rdiff -u -r1.16 -r1.17 src/sys/arch/newsmips/include/cpu.h cvs rdiff -u -r1.26 -r1.27 src/sys/arch/newsmips/include/intr.h cvs rdiff -u -r1.13 -r1.14 src/sys/arch/newsmips/newsmips/cpu_cons.c cvs rdiff -u -r1.119 -r1.120 src/sys/arch/newsmips/newsmips/machdep.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/newsmips/newsmips/machid.h cvs rdiff -u -r0 -r1.1 src/sys/arch/newsmips/newsmips/news4000.c cvs rdiff -u -r1.21 -r1.22 src/sys/arch/newsmips/newsmips/news5000.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/newsmips/stand/boot/boot.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/newsmips/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/apbus.c diff -u src/sys/arch/newsmips/apbus/apbus.c:1.24 src/sys/arch/newsmips/apbus/apbus.c:1.25 --- src/sys/arch/newsmips/apbus/apbus.c:1.24 Sun Sep 30 14:09:35 2018 +++ src/sys/arch/newsmips/apbus/apbus.c Sun Oct 14 00:10:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: apbus.c,v 1.24 2018/09/30 14:09:35 tsutsui Exp $ */ +/* $NetBSD: apbus.c,v 1.25 2018/10/14 00:10:11 tsutsui Exp $ */ /*- * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.24 2018/09/30 14:09:35 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.25 2018/10/14 00:10:11 tsutsui Exp $"); #define __INTR_PRIVATE @@ -78,6 +78,8 @@ CFATTACH_DECL_NEW(ap, 0, #define NLEVEL 2 static struct newsmips_intr apintr_tab[NLEVEL]; +volatile uint32_t *news_wbflush; + static int apbusmatch(device_t parent, cfdata_t cf, void *aux) { @@ -102,10 +104,17 @@ apbusattach(device_t parent, device_t se apbus_map_romwork(); mips_set_wbflush(apbus_wbflush); - *(volatile uint32_t *)(NEWS5000_APBUS_INTST) = 0x; - *(volatile uint32_t *)(NEWS5000_APBUS_INTMSK) = 0x; - *(volatile uint32_t *)(NEWS5000_APBUS_CTRL) = 0x0004; - *(volatile uint32_t *)(NEWS5000_APBUS_DMA) = 0x; + if (systype == NEWS5000) { + *(volatile uint32_t *)(NEWS5000_APBUS_INTST) = 0x; + *(volatile uint32_t *)(NEWS5000_APBUS_INTMSK) = 0x; + *(volatile uint32_t *)(NEWS5000_APBUS_CTRL) = 0x0004; + *(volatile uint32_t *)(NEWS5000_APBUS_DMA) = 0x; + } + if (systype == NEWS4000) { + *(volatile uint32_t *)0xb6a4 = 0x1fff; + *(volatile uint32_t *)0xb670 = 0x; + *(volatile uint32_t *)0xb698 = 0x; + } aprint_normal("\n"); @@ -181,10 +190,9 @@ aptokseg0(void *va) void apbus_wbflush(void) { - volatile int32_t * const our_wbflush = (int32_t *)NEWS5000_WBFLUSH; (*mips_locore_jumpvec.ljv_wbflush)(); - (void)*our_wbflush; + (void)*news_wbflush; } /* @@ -249,13 +257,19 @@ apbus_intr_establish(int level, int mask LIST_INSERT_AFTER(curih, ih, ih_q); done: + if (systype == NEWS5000) { + inten0 = (uint32_t *)NEWS5000_INTEN0; + inten1 = (uint32_t *)NEWS5000_INTEN1; + } + if (systype == NEWS4000) { + inten0 = (uint32_t *)NEWS4000_INTEN0; + inten1 = (uint32_t *)NEWS4000_INTEN1; + } switch (level) { case 0: - inten0 = (volatile uint32_t *)NEWS5000_INTEN0; *inten0 |= mask; break; case 1: - inten1 = (volatile uint32_t *)NEWS5000_INTEN1; *inten1 |= mask; break; } Index: src/sys/arch/newsmips/apbus/apbusvar.
CVS commit: src/sys/arch/newsmips/apbus
Module Name:src Committed By: tsutsui Date: Sun Sep 30 14:23:24 UTC 2018 Modified Files: src/sys/arch/newsmips/apbus: if_sn_ap.c if_tlp_ap.c kb_ap.c ms_ap.c spifi.c zs_ap.c Log Message: Avoid reference of APbus workarea that can't be read via kvm(3). To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/newsmips/apbus/if_sn_ap.c \ src/sys/arch/newsmips/apbus/ms_ap.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/newsmips/apbus/if_tlp_ap.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/newsmips/apbus/kb_ap.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/newsmips/apbus/spifi.c cvs rdiff -u -r1.27 -r1.28 src/sys/arch/newsmips/apbus/zs_ap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/if_sn_ap.c diff -u src/sys/arch/newsmips/apbus/if_sn_ap.c:1.11 src/sys/arch/newsmips/apbus/if_sn_ap.c:1.12 --- src/sys/arch/newsmips/apbus/if_sn_ap.c:1.11 Wed Apr 9 15:40:30 2008 +++ src/sys/arch/newsmips/apbus/if_sn_ap.c Sun Sep 30 14:23:24 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn_ap.c,v 1.11 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: if_sn_ap.c,v 1.12 2018/09/30 14:23:24 tsutsui Exp $ */ /* * Copyright (C) 1997 Allen Briggs @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sn_ap.c,v 1.11 2008/04/09 15:40:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sn_ap.c,v 1.12 2018/09/30 14:23:24 tsutsui Exp $"); #include "opt_inet.h" @@ -117,7 +117,7 @@ sn_ap_attach(device_t parent, device_t s apbus_intr_establish(0, /* interrupt level (0 or 1) */ intrmask, 0, /* priority */ - snintr, sc, apa->apa_name, apa->apa_ctlnum); + snintr, sc, device_xname(self), apa->apa_ctlnum); } int Index: src/sys/arch/newsmips/apbus/ms_ap.c diff -u src/sys/arch/newsmips/apbus/ms_ap.c:1.11 src/sys/arch/newsmips/apbus/ms_ap.c:1.12 --- src/sys/arch/newsmips/apbus/ms_ap.c:1.11 Sat Oct 13 06:25:20 2012 +++ src/sys/arch/newsmips/apbus/ms_ap.c Sun Sep 30 14:23:24 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ms_ap.c,v 1.11 2012/10/13 06:25:20 tsutsui Exp $ */ +/* $NetBSD: ms_ap.c,v 1.12 2018/09/30 14:23:24 tsutsui Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ms_ap.c,v 1.11 2012/10/13 06:25:20 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ms_ap.c,v 1.12 2018/09/30 14:23:24 tsutsui Exp $"); #include #include @@ -101,7 +101,7 @@ ms_ap_attach(device_t parent, device_t s reg->ms_intr_en = 0; apbus_intr_establish(1, NEWS5000_INT1_KBD, 0, ms_ap_intr, sc, - "", apa->apa_ctlnum); + device_xname(self), apa->apa_ctlnum); aa.accessops = &ms_ap_accessops; aa.accesscookie = sc; Index: src/sys/arch/newsmips/apbus/if_tlp_ap.c diff -u src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.13 src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.14 --- src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.13 Fri Jul 15 07:49:20 2011 +++ src/sys/arch/newsmips/apbus/if_tlp_ap.c Sun Sep 30 14:23:24 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tlp_ap.c,v 1.13 2011/07/15 07:49:20 he Exp $ */ +/* $NetBSD: if_tlp_ap.c,v 1.14 2018/09/30 14:23:24 tsutsui Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tlp_ap.c,v 1.13 2011/07/15 07:49:20 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tlp_ap.c,v 1.14 2018/09/30 14:23:24 tsutsui Exp $"); #include #include @@ -222,7 +222,7 @@ tlp_ap_attach(device_t parent, device_t apbus_intr_establish(0, /* interrupt level (0 or 1) */ intrmask, 0, /* priority */ - tlp_intr, sc, apa->apa_name, apa->apa_ctlnum); + tlp_intr, sc, device_xname(self), apa->apa_ctlnum); } static void Index: src/sys/arch/newsmips/apbus/kb_ap.c diff -u src/sys/arch/newsmips/apbus/kb_ap.c:1.10 src/sys/arch/newsmips/apbus/kb_ap.c:1.11 --- src/sys/arch/newsmips/apbus/kb_ap.c:1.10 Sat Oct 13 06:25:20 2012 +++ src/sys/arch/newsmips/apbus/kb_ap.c Sun Sep 30 14:23:24 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: kb_ap.c,v 1.10 2012/10/13 06:25:20 tsutsui Exp $ */ +/* $NetBSD: kb_ap.c,v 1.11 2018/09/30 14:23:24 tsutsui Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kb_ap.c,v 1.10 2012/10/13 06:25:20 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kb_ap.c,v 1.11 2018/09/30 14:23:24 tsutsui Exp $"); #include #include @@ -144,7 +144,7 @@ kb_ap_attach(device_t parent, device_t s reg->kb_tx_intr_en = 0; apbus_intr_establish(1, NEWS5000_INT1_KBD, 0, kb_ap_intr, sc, - "", apa->apa_ctlnum); + device_xname(self), apa->apa_ctlnum); waa.console = cons; waa.keymap = &kb_ap_keymapdata; Index: src/sys/arch/newsmips/apbus/spifi.c diff -u src/sys/arch/newsmips/apbus/spifi.c:1.18 src/sys/arch/newsmips/apbus/spifi.c:1.19 --- src/sys/arch/newsmips/apbus/spifi.c:1.18 Fri Mar 31 08:38:13 2017 +++ src/
CVS commit: src/sys/arch/newsmips/apbus
Module Name:src Committed By: tsutsui Date: Sun Sep 30 14:09:35 UTC 2018 Modified Files: src/sys/arch/newsmips/apbus: apbus.c Log Message: Account APbus interrupts by evcnt(9). To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/newsmips/apbus/apbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/apbus.c diff -u src/sys/arch/newsmips/apbus/apbus.c:1.23 src/sys/arch/newsmips/apbus/apbus.c:1.24 --- src/sys/arch/newsmips/apbus/apbus.c:1.23 Sun Sep 30 06:14:23 2018 +++ src/sys/arch/newsmips/apbus/apbus.c Sun Sep 30 14:09:35 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: apbus.c,v 1.23 2018/09/30 06:14:23 tsutsui Exp $ */ +/* $NetBSD: apbus.c,v 1.24 2018/09/30 14:09:35 tsutsui Exp $ */ /*- * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.23 2018/09/30 06:14:23 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.24 2018/09/30 14:09:35 tsutsui Exp $"); #define __INTR_PRIVATE @@ -201,8 +201,10 @@ apbus_intr_dispatch(int level, int stat) nintr = 0; LIST_FOREACH(ih, &ip->intr_q, ih_q) { - if (ih->ih_mask & stat) + if (ih->ih_mask & stat) { nintr += (*ih->ih_func)(ih->ih_arg); + ih->intr_count.ev_count++; + } } return nintr; } @@ -227,6 +229,8 @@ apbus_intr_establish(int level, int mask ih->ih_priority = priority; ih->ih_func = func; ih->ih_arg = arg; + evcnt_attach_dynamic(&ih->intr_count, EVCNT_TYPE_INTR, + NULL, "apbus", name); if (LIST_EMPTY(&ip->intr_q)) { LIST_INSERT_HEAD(&ip->intr_q, ih, ih_q);
CVS commit: src/sys/arch/newsmips/conf
Module Name:src Committed By: tsutsui Date: Sun Sep 30 14:04:51 UTC 2018 Modified Files: src/sys/arch/newsmips/conf: GENERIC Log Message: Enable DHCP boot for modern servers rather than ancient BOOTPARAM. To generate a diff of this commit: cvs rdiff -u -r1.134 -r1.135 src/sys/arch/newsmips/conf/GENERIC Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/conf/GENERIC diff -u src/sys/arch/newsmips/conf/GENERIC:1.134 src/sys/arch/newsmips/conf/GENERIC:1.135 --- src/sys/arch/newsmips/conf/GENERIC:1.134 Wed Aug 1 20:04:13 2018 +++ src/sys/arch/newsmips/conf/GENERIC Sun Sep 30 14:04:51 2018 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.134 2018/08/01 20:04:13 maxv Exp $ +# $NetBSD: GENERIC,v 1.135 2018/09/30 14:04:51 tsutsui Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/newsmips/conf/std.newsmip options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.134 $" +#ident "GENERIC-$Revision: 1.135 $" maxusers 16 @@ -113,7 +113,8 @@ options PPP_FILTER # Active filter supp #options ALTQ_RIO # RED with IN/OUT #options ALTQ_WFQ # Weighted Fair Queueing -options NFS_BOOT_BOOTPARAM +#options NFS_BOOT_BOOTPARAM +options NFS_BOOT_DHCP # JIT compiler for bpfilter #options SLJIT
CVS commit: src/sys/arch/newsmips/stand/boot
Module Name:src Committed By: tsutsui Date: Sun Sep 30 14:02:06 UTC 2018 Modified Files: src/sys/arch/newsmips/stand/boot: Makefile net.c version Log Message: Switch bootloader to using DHCP rather than BOOTPARAM. Also bump version. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/newsmips/stand/boot/Makefile cvs rdiff -u -r1.5 -r1.6 src/sys/arch/newsmips/stand/boot/net.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/newsmips/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/stand/boot/Makefile diff -u src/sys/arch/newsmips/stand/boot/Makefile:1.22 src/sys/arch/newsmips/stand/boot/Makefile:1.23 --- src/sys/arch/newsmips/stand/boot/Makefile:1.22 Thu Dec 17 05:29:56 2009 +++ src/sys/arch/newsmips/stand/boot/Makefile Sun Sep 30 14:02:06 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.22 2009/12/17 05:29:56 matt Exp $ +# $NetBSD: Makefile,v 1.23 2018/09/30 14:02:06 tsutsui Exp $ S!= cd ${.CURDIR}/../../../..; pwd @@ -21,7 +21,8 @@ CFLAGS= -Os -ffreestanding -mmemcpy -mno CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith CPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK -CPPFLAGS+= -DSUN_BOOTPARAMS +#CPPFLAGS+= -DSUN_BOOTPARAMS +CPPFLAGS+= -DSUPPORT_DHCP -DSUPPORT_BOOTP CPPFLAGS+= -D_STANDALONE #-DBOOT_DEBUG CPPFLAGS+= -I${.CURDIR} -I. -I${S} CPPFLAGS+= -D__daddr_t=int32_t Index: src/sys/arch/newsmips/stand/boot/net.c diff -u src/sys/arch/newsmips/stand/boot/net.c:1.5 src/sys/arch/newsmips/stand/boot/net.c:1.6 --- src/sys/arch/newsmips/stand/boot/net.c:1.5 Wed Oct 21 23:12:09 2009 +++ src/sys/arch/newsmips/stand/boot/net.c Sun Sep 30 14:02:06 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: net.c,v 1.5 2009/10/21 23:12:09 snj Exp $ */ +/* $NetBSD: net.c,v 1.6 2018/09/30 14:02:06 tsutsui Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -144,7 +145,7 @@ net_mountroot(void) printf("Using IP address: %s\n", inet_ntoa(myip)); printf("myip: %s (%s)", hostname, inet_ntoa(myip)); - if (gateip) + if (gateip.s_addr) printf(", gateip: %s", inet_ntoa(gateip)); if (netmask) printf(", netmask: %s", intoa(netmask)); Index: src/sys/arch/newsmips/stand/boot/version diff -u src/sys/arch/newsmips/stand/boot/version:1.1 src/sys/arch/newsmips/stand/boot/version:1.2 --- src/sys/arch/newsmips/stand/boot/version:1.1 Thu Apr 18 14:54:39 2002 +++ src/sys/arch/newsmips/stand/boot/version Sun Sep 30 14:02:06 2018 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.1 2002/04/18 14:54:39 tsutsui Exp $ +$NetBSD: version,v 1.2 2018/09/30 14:02:06 tsutsui Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -11,3 +11,4 @@ is taken as the current. 1.5: loadfile() update to avoid backwards seeks for ELF Program Headers. 1.6: Add ustarfs support 1.7: Use newvers_stand.sh and print version strings +1.8: Switch to DHCP rather than BOOTPARAM
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: tsutsui Date: Sun Sep 30 06:14:23 UTC 2018 Modified Files: src/sys/arch/newsmips/apbus: apbus.c apbus_subr.c apbusvar.h src/sys/arch/newsmips/conf: std.newsmips Log Message: Fix news5000 panic during boot on APbus attach. PR port-newsmips/53626 Discussed with ryo@ (the original author of news5000 support). Should be pulled up to netbsd-8. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/arch/newsmips/apbus/apbus.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/newsmips/apbus/apbus_subr.c \ src/sys/arch/newsmips/apbus/apbusvar.h cvs rdiff -u -r1.17 -r1.18 src/sys/arch/newsmips/conf/std.newsmips Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/apbus.c diff -u src/sys/arch/newsmips/apbus/apbus.c:1.22 src/sys/arch/newsmips/apbus/apbus.c:1.23 --- src/sys/arch/newsmips/apbus/apbus.c:1.22 Sun Feb 20 07:56:31 2011 +++ src/sys/arch/newsmips/apbus/apbus.c Sun Sep 30 06:14:23 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: apbus.c,v 1.22 2011/02/20 07:56:31 matt Exp $ */ +/* $NetBSD: apbus.c,v 1.23 2018/09/30 06:14:23 tsutsui Exp $ */ /*- * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.22 2011/02/20 07:56:31 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.23 2018/09/30 06:14:23 tsutsui Exp $"); #define __INTR_PRIVATE @@ -99,6 +99,7 @@ apbusattach(device_t parent, device_t se struct newsmips_intr *ip; int i; + apbus_map_romwork(); mips_set_wbflush(apbus_wbflush); *(volatile uint32_t *)(NEWS5000_APBUS_INTST) = 0x; Index: src/sys/arch/newsmips/apbus/apbus_subr.c diff -u src/sys/arch/newsmips/apbus/apbus_subr.c:1.9 src/sys/arch/newsmips/apbus/apbus_subr.c:1.10 --- src/sys/arch/newsmips/apbus/apbus_subr.c:1.9 Mon Mar 24 20:05:20 2014 +++ src/sys/arch/newsmips/apbus/apbus_subr.c Sun Sep 30 06:14:23 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: apbus_subr.c,v 1.9 2014/03/24 20:05:20 christos Exp $ */ +/* $NetBSD: apbus_subr.c,v 1.10 2018/09/30 06:14:23 tsutsui Exp $ */ /*- * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved. @@ -27,15 +27,47 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: apbus_subr.c,v 1.9 2014/03/24 20:05:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apbus_subr.c,v 1.10 2018/09/30 06:14:23 tsutsui Exp $"); #include #include +#include + +#include +#include + +#include + #include static void apctl_dump(struct apbus_ctl *); +#define APBUS_ROMWORK_VA 0xfff0 + +void +apbus_map_romwork(void) +{ + static bool mapped = false; + vaddr_t apbd_work_va; + vsize_t apbd_work_sz; + paddr_t apbd_work_pa; + + if (!mapped) { + /* map PROM work RAM into VA 0xFFF0 - 0x */ + apbd_work_va = APBUS_ROMWORK_VA; + apbd_work_sz = MIPS3_PG_SIZE_MASK_TO_SIZE(MIPS3_PG_SIZE_1M); + apbd_work_pa = ctob(physmem); + + mapped = mips3_wired_enter_page(apbd_work_va, apbd_work_pa, + apbd_work_sz); + if (!mapped) { + printf("%s: cannot allocate APbus PROM work\n", + __func__); + } + } +} + void * apbus_device_to_hwaddr(struct apbus_dev *apbus_dev) { Index: src/sys/arch/newsmips/apbus/apbusvar.h diff -u src/sys/arch/newsmips/apbus/apbusvar.h:1.9 src/sys/arch/newsmips/apbus/apbusvar.h:1.10 --- src/sys/arch/newsmips/apbus/apbusvar.h:1.9 Wed Oct 17 19:55:54 2007 +++ src/sys/arch/newsmips/apbus/apbusvar.h Sun Sep 30 06:14:23 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: apbusvar.h,v 1.9 2007/10/17 19:55:54 garbled Exp $ */ +/* $NetBSD: apbusvar.h,v 1.10 2018/09/30 06:14:23 tsutsui Exp $ */ /*- * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved. @@ -39,6 +39,7 @@ struct apbus_attach_args { u_long apa_hwbase; /* hardware I/O address */ }; +void apbus_map_romwork(void); void *apbus_device_to_hwaddr(struct apbus_dev *); struct apbus_dev *apbus_lookupdev(char *); void apdevice_dump(struct apbus_dev *); Index: src/sys/arch/newsmips/conf/std.newsmips diff -u src/sys/arch/newsmips/conf/std.newsmips:1.17 src/sys/arch/newsmips/conf/std.newsmips:1.18 --- src/sys/arch/newsmips/conf/std.newsmips:1.17 Sun Dec 11 12:18:24 2005 +++ src/sys/arch/newsmips/conf/std.newsmips Sun Sep 30 06:14:23 2018 @@ -1,4 +1,4 @@ -# $NetBSD: std.newsmips,v 1.17 2005/12/11 12:18:24 christos Exp $ +# $NetBSD: std.newsmips,v 1.18 2018/09/30 06:14:23 tsutsui Exp $ machine newsmips mips include "conf/std" # MI standard options @@ -7,5 +7,7 @@ makeoptions MACHINE_ARCH="mipseb" options EXEC_ELF32 # exec ELF32 binaries options EXEC_SCRIPT # exec #! scripts +options ENABLE_MIPS3_WIRED_MAP + makeoptions DEFTEXTADDR="0x80001000" makeoptions LINKFORMAT="-N"
CVS commit: src/sys/arch/newsmips/apbus
Module Name:src Committed By: riastradh Date: Sat Jul 29 02:21:30 UTC 2017 Modified Files: src/sys/arch/newsmips/apbus: if_sn.c Log Message: Avoid memory leak in sonic_get. If this is the first time around, top is null and nothing else will free m. >From Ilja Van Sprundel. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/newsmips/apbus/if_sn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/if_sn.c diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.38 src/sys/arch/newsmips/apbus/if_sn.c:1.39 --- src/sys/arch/newsmips/apbus/if_sn.c:1.38 Wed Feb 22 09:45:16 2017 +++ src/sys/arch/newsmips/apbus/if_sn.c Sat Jul 29 02:21:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn.c,v 1.38 2017/02/22 09:45:16 nonaka Exp $ */ +/* $NetBSD: if_sn.c,v 1.39 2017/07/29 02:21:30 riastradh Exp $ */ /* * National Semiconductor DP8393X SONIC Driver @@ -16,7 +16,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.38 2017/02/22 09:45:16 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.39 2017/07/29 02:21:30 riastradh Exp $"); #include "opt_inet.h" @@ -1090,7 +1090,10 @@ sonic_get(struct sn_softc *sc, void *pkt if (datalen >= MINCLSIZE) { MCLGET(m, M_DONTWAIT); if ((m->m_flags & M_EXT) == 0) { -if (top) m_freem(top); +if (top) + m_freem(top); +else + m_freem(m); return 0; } len = MCLBYTES;
CVS commit: src/sys/arch/newsmips/conf
Module Name:src Committed By: christos Date: Sat Jul 22 20:21:09 UTC 2017 Modified Files: src/sys/arch/newsmips/conf: INSTALL Log Message: surf the bloat To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/newsmips/conf/INSTALL Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/conf/INSTALL diff -u src/sys/arch/newsmips/conf/INSTALL:1.44 src/sys/arch/newsmips/conf/INSTALL:1.45 --- src/sys/arch/newsmips/conf/INSTALL:1.44 Sat Aug 23 16:26:59 2014 +++ src/sys/arch/newsmips/conf/INSTALL Sat Jul 22 16:21:09 2017 @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.44 2014/08/23 20:26:59 dholland Exp $ +# $NetBSD: INSTALL,v 1.45 2017/07/22 20:21:09 christos Exp $ # # INSTALL kernel for RISC-NEWS @@ -14,7 +14,7 @@ maxusers 8 options MEMORY_DISK_HOOKS options MEMORY_DISK_IS_ROOT # Force root on ram-disk options MEMORY_DISK_SERVER=0 # no userspace md(4) support -options MEMORY_DISK_ROOT_SIZE=5320 # 2.6 Megabytes +options MEMORY_DISK_ROOT_SIZE=5700 # 2.85 Megabytes options MEMORY_DISK_RBFLAGS=RB_SINGLE # boot in single-user mode options news3400
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: christos Date: Thu Jul 21 19:49:59 UTC 2016 Modified Files: src/sys/arch/newsmips/apbus: xafb.c src/sys/arch/newsmips/dev: scsi_1185.c zs_hb.c src/sys/arch/newsmips/include: intr.h src/sys/arch/newsmips/newsmips: machdep.c news5000.c Log Message: Don't include in , introduces circular dependencies; instead include it in the 4 driver files that need it, and reorder it in machdep.c To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/newsmips/apbus/xafb.c cvs rdiff -u -r1.22 -r1.23 src/sys/arch/newsmips/dev/scsi_1185.c cvs rdiff -u -r1.26 -r1.27 src/sys/arch/newsmips/dev/zs_hb.c cvs rdiff -u -r1.25 -r1.26 src/sys/arch/newsmips/include/intr.h cvs rdiff -u -r1.117 -r1.118 src/sys/arch/newsmips/newsmips/machdep.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/newsmips/newsmips/news5000.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/xafb.c diff -u src/sys/arch/newsmips/apbus/xafb.c:1.17 src/sys/arch/newsmips/apbus/xafb.c:1.18 --- src/sys/arch/newsmips/apbus/xafb.c:1.17 Fri Jan 31 10:43:06 2014 +++ src/sys/arch/newsmips/apbus/xafb.c Thu Jul 21 15:49:58 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: xafb.c,v 1.17 2014/01/31 15:43:06 tsutsui Exp $ */ +/* $NetBSD: xafb.c,v 1.18 2016/07/21 19:49:58 christos Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -29,7 +29,7 @@ /* "xa" frame buffer driver. Currently supports 1280x1024x8 only. */ #include -__KERNEL_RCSID(0, "$NetBSD: xafb.c,v 1.17 2014/01/31 15:43:06 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xafb.c,v 1.18 2016/07/21 19:49:58 christos Exp $"); #include #include @@ -40,10 +40,12 @@ __KERNEL_RCSID(0, "$NetBSD: xafb.c,v 1.1 #include +#include + #include #include - #include + #include #include Index: src/sys/arch/newsmips/dev/scsi_1185.c diff -u src/sys/arch/newsmips/dev/scsi_1185.c:1.22 src/sys/arch/newsmips/dev/scsi_1185.c:1.23 --- src/sys/arch/newsmips/dev/scsi_1185.c:1.22 Sat Mar 26 13:14:38 2016 +++ src/sys/arch/newsmips/dev/scsi_1185.c Thu Jul 21 15:49:58 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: scsi_1185.c,v 1.22 2016/03/26 17:14:38 martin Exp $ */ +/* $NetBSD: scsi_1185.c,v 1.23 2016/07/21 19:49:58 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,v 1.22 2016/03/26 17:14:38 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,v 1.23 2016/07/21 19:49:58 christos Exp $"); #define __INTR_PRIVATE #include @@ -67,11 +67,13 @@ __KERNEL_RCSID(0, "$NetBSD: scsi_1185.c, #include #include +#include +#include + #include #include #include -#include #include #include Index: src/sys/arch/newsmips/dev/zs_hb.c diff -u src/sys/arch/newsmips/dev/zs_hb.c:1.26 src/sys/arch/newsmips/dev/zs_hb.c:1.27 --- src/sys/arch/newsmips/dev/zs_hb.c:1.26 Fri Jun 25 23:44:49 2010 +++ src/sys/arch/newsmips/dev/zs_hb.c Thu Jul 21 15:49:58 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: zs_hb.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $ */ +/* $NetBSD: zs_hb.c,v 1.27 2016/07/21 19:49:58 christos Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1.27 2016/07/21 19:49:58 christos Exp $"); #include #include @@ -48,6 +48,8 @@ __KERNEL_RCSID(0, "$NetBSD: zs_hb.c,v 1. #include #include +#include + #include #include Index: src/sys/arch/newsmips/include/intr.h diff -u src/sys/arch/newsmips/include/intr.h:1.25 src/sys/arch/newsmips/include/intr.h:1.26 --- src/sys/arch/newsmips/include/intr.h:1.25 Sun Feb 20 02:56:31 2011 +++ src/sys/arch/newsmips/include/intr.h Thu Jul 21 15:49:59 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.h,v 1.25 2011/02/20 07:56:31 matt Exp $ */ +/* $NetBSD: intr.h,v 1.26 2016/07/21 19:49:59 christos Exp $ */ /*- * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -38,7 +38,6 @@ #ifdef __INTR_PRIVATE #include -#include extern const struct ipl_sr_map newmips_ipl_sr_map; Index: src/sys/arch/newsmips/newsmips/machdep.c diff -u src/sys/arch/newsmips/newsmips/machdep.c:1.117 src/sys/arch/newsmips/newsmips/machdep.c:1.118 --- src/sys/arch/newsmips/newsmips/machdep.c:1.117 Mon Jun 29 22:39:03 2015 +++ src/sys/arch/newsmips/newsmips/machdep.c Thu Jul 21 15:49:59 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.117 2015/06/30 02:39:03 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.118 2016/07/21 19:49:59 christos Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.117 2015/06/30 02:39:03 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.118 2016/07/21 19:49:59 christos Exp $"); /* from: Utah Hdr: machdep.c
CVS commit: src/sys/arch/newsmips/stand
Module Name:src Committed By: christos Date: Thu Jul 21 18:50:21 UTC 2016 Modified Files: src/sys/arch/newsmips/stand: Makefile.inc Log Message: add NOPIE To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/newsmips/stand/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/stand/Makefile.inc diff -u src/sys/arch/newsmips/stand/Makefile.inc:1.8 src/sys/arch/newsmips/stand/Makefile.inc:1.9 --- src/sys/arch/newsmips/stand/Makefile.inc:1.8 Sun Jan 12 10:26:30 2014 +++ src/sys/arch/newsmips/stand/Makefile.inc Thu Jul 21 14:50:21 2016 @@ -1,6 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.8 2014/01/12 15:26:30 tsutsui Exp $ +# $NetBSD: Makefile.inc,v 1.9 2016/07/21 18:50:21 christos Exp $ BINDIR= /usr/mdec +NOPIE=yes # if there is a 'version' file, add rule for vers.c and add it to SRCS # and CLEANFILES
CVS commit: src/sys/arch/newsmips/dev
Module Name:src Committed By: martin Date: Sat Mar 26 17:14:38 UTC 2016 Modified Files: src/sys/arch/newsmips/dev: scsi_1185.c Log Message: David Binderman in PR port-newsmips/51014: Move initialization of remain_cnt up to the declaration. XXX the #ifdef here does not make much sense to me, but I know nothing about the hardware. I'd guess it could be removed or inverted and #error'd instead. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/newsmips/dev/scsi_1185.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/dev/scsi_1185.c diff -u src/sys/arch/newsmips/dev/scsi_1185.c:1.21 src/sys/arch/newsmips/dev/scsi_1185.c:1.22 --- src/sys/arch/newsmips/dev/scsi_1185.c:1.21 Mon Mar 24 20:05:20 2014 +++ src/sys/arch/newsmips/dev/scsi_1185.c Sat Mar 26 17:14:38 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: scsi_1185.c,v 1.21 2014/03/24 20:05:20 christos Exp $ */ +/* $NetBSD: scsi_1185.c,v 1.22 2016/03/26 17:14:38 martin Exp $ */ /* * Copyright (c) 1992, 1993 @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,v 1.21 2014/03/24 20:05:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,v 1.22 2016/03/26 17:14:38 martin Exp $"); #define __INTR_PRIVATE #include @@ -1720,12 +1720,11 @@ void adjust_transfer(struct sc_softc *sc, struct sc_chan_stat *cs) { struct sc_scb *scb = cs->scb; - u_int remain_cnt; + u_int remain_cnt = 0; u_int offset, sent_byte; if (sc->pad_start) { sc->pad_start = 0; - remain_cnt = 0; } else { # if defined(__mips__) && defined(CPU_SINGLE) remain_cnt = GET_CNT();
CVS commit: src/sys/arch/newsmips/newsmips
Module Name:src Committed By: christos Date: Mon Nov 24 04:06:13 UTC 2014 Modified Files: src/sys/arch/newsmips/newsmips: machdep.c Log Message: avoid shadowing a new global. To generate a diff of this commit: cvs rdiff -u -r1.115 -r1.116 src/sys/arch/newsmips/newsmips/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/newsmips/machdep.c diff -u src/sys/arch/newsmips/newsmips/machdep.c:1.115 src/sys/arch/newsmips/newsmips/machdep.c:1.116 --- src/sys/arch/newsmips/newsmips/machdep.c:1.115 Mon Mar 24 16:05:20 2014 +++ src/sys/arch/newsmips/newsmips/machdep.c Sun Nov 23 23:06:13 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.115 2014/03/24 20:05:20 christos Exp $ */ +/* $NetBSD: machdep.c,v 1.116 2014/11/24 04:06:13 christos Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.115 2014/03/24 20:05:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.116 2014/11/24 04:06:13 christos Exp $"); /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -196,7 +196,7 @@ mach_init(int x_boothowto, int x_bootdev #ifdef news5000 if (systype == NEWS5000) { int i; - char *bootspec = (char *)x_bootdev; + char *bspec = (char *)x_bootdev; if (bi_arg == NULL) panic("news5000 requires BTINFO_BOOTARG to boot"); @@ -204,21 +204,21 @@ mach_init(int x_boothowto, int x_bootdev _sip = (void *)bi_arg->sip; x_maxmem = _sip->apbsi_memsize; x_maxmem -= 0x0010; /* reserve 1MB for ROM monitor */ - if (strncmp(bootspec, "scsi", 4) == 0) { + if (strncmp(bspec, "scsi", 4) == 0) { x_bootdev = (5 << 28) | 0; /* magic, sd */ - bootspec += 4; - if (*bootspec != '(' /*)*/) + bspec += 4; + if (*bspec != '(' /*)*/) goto bootspec_end; - i = strtoul(bootspec + 1, &bootspec, 10); + i = strtoul(bspec + 1, &bspec, 10); x_bootdev |= (i << 24); /* bus */ - if (*bootspec != ',') + if (*bspec != ',') goto bootspec_end; - i = strtoul(bootspec + 1, &bootspec, 10); + i = strtoul(bspec + 1, &bspec, 10); x_bootdev |= (i / 10) << 20; /* controller */ x_bootdev |= (i % 10) << 16; /* unit */ - if (*bootspec != ',') + if (*bspec != ',') goto bootspec_end; - i = strtoul(bootspec + 1, &bootspec, 10); + i = strtoul(bspec + 1, &bspec, 10); x_bootdev |= (i << 8); /* partition */ } bootspec_end:
CVS commit: src/sys/arch/newsmips/stand/boot
Module Name:src Committed By: christos Date: Sun Sep 21 16:35:44 UTC 2014 Modified Files: src/sys/arch/newsmips/stand/boot: netif_news.c Log Message: remove stray ; To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/newsmips/stand/boot/netif_news.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/stand/boot/netif_news.c diff -u src/sys/arch/newsmips/stand/boot/netif_news.c:1.8 src/sys/arch/newsmips/stand/boot/netif_news.c:1.9 --- src/sys/arch/newsmips/stand/boot/netif_news.c:1.8 Wed Oct 21 19:12:09 2009 +++ src/sys/arch/newsmips/stand/boot/netif_news.c Sun Sep 21 12:35:44 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netif_news.c,v 1.8 2009/10/21 23:12:09 snj Exp $ */ +/* $NetBSD: netif_news.c,v 1.9 2014/09/21 16:35:44 christos Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross @@ -191,7 +191,7 @@ int prom_getether(struct romdev *pd, u_char *ea) { - if (apcall_ioctl(pd->fd, APIOCGIFHWADDR, ea)); + if (apcall_ioctl(pd->fd, APIOCGIFHWADDR, ea)) return -1; #ifdef BOOT_DEBUG
CVS commit: src/sys/arch/newsmips/stand
Module Name:src Committed By: christos Date: Wed Mar 26 17:43:11 UTC 2014 Modified Files: src/sys/arch/newsmips/stand/boot: boot.c src/sys/arch/newsmips/stand/bootxx: bootxx.c Log Message: kill sprintf To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/newsmips/stand/boot/boot.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/newsmips/stand/bootxx/bootxx.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/stand/boot/boot.c diff -u src/sys/arch/newsmips/stand/boot/boot.c:1.19 src/sys/arch/newsmips/stand/boot/boot.c:1.20 --- src/sys/arch/newsmips/stand/boot/boot.c:1.19 Sat Jan 22 14:19:21 2011 +++ src/sys/arch/newsmips/stand/boot/boot.c Wed Mar 26 13:43:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.19 2011/01/22 19:19:21 joerg Exp $ */ +/* $NetBSD: boot.c,v 1.20 2014/03/26 17:43:11 christos Exp $ */ /*- * Copyright (C) 1999 Tsubai Masanari. All rights reserved. @@ -147,7 +147,8 @@ boot(uint32_t a0, uint32_t a1, uint32_t _rtt(); } - sprintf(devname, "%s(%d,%d,%d)", devs[type], ctlr, unit, part); + snprintf(devname, sizeof(devname), "%s(%d,%d,%d)", + devs[type], ctlr, unit, part); } printf("Booting %s%s\n", devname, netbsd); @@ -165,7 +166,7 @@ boot(uint32_t a0, uint32_t a1, uint32_t marks[MARK_START] = 0; for (i = 0; kernels[i]; i++) { - sprintf(file, "%s%s", devname, kernels[i]); + snprintf(file, sizeof(file), "%s%s", devname, kernels[i]); DPRINTF("trying %s...\n", file); fd = loadfile(file, marks, loadflag); if (fd != -1) Index: src/sys/arch/newsmips/stand/bootxx/bootxx.c diff -u src/sys/arch/newsmips/stand/bootxx/bootxx.c:1.8 src/sys/arch/newsmips/stand/bootxx/bootxx.c:1.9 --- src/sys/arch/newsmips/stand/bootxx/bootxx.c:1.8 Thu Feb 21 09:32:31 2008 +++ src/sys/arch/newsmips/stand/bootxx/bootxx.c Wed Mar 26 13:43:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bootxx.c,v 1.8 2008/02/21 14:32:31 tsutsui Exp $ */ +/* $NetBSD: bootxx.c,v 1.9 2014/03/26 17:43:11 christos Exp $ */ /*- * Copyright (C) 1999 Tsubai Masanari. All rights reserved. @@ -108,7 +108,8 @@ bootxx(uint32_t a0, uint32_t a1, uint32_ printf("unknown bootdev (0x%x)\n", bootdev); return; } - sprintf(devname, "%s(%d,%d,%d)", devs[type], ctlr, unit, part); + snprintf(devname, sizeof(devname), "%s(%d,%d,%d)", + devs[type], ctlr, unit, part); fd = rom_open(devname, 0); }
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: christos Date: Mon Mar 24 20:05:20 UTC 2014 Modified Files: src/sys/arch/newsmips/apbus: apbus_subr.c src/sys/arch/newsmips/dev: scsi_1185.c src/sys/arch/newsmips/newsmips: autoconf.c machdep.c news3400.c Log Message: - fix unused - use cpu_{g,s}etmodel To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/newsmips/apbus/apbus_subr.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/newsmips/dev/scsi_1185.c cvs rdiff -u -r1.37 -r1.38 src/sys/arch/newsmips/newsmips/autoconf.c cvs rdiff -u -r1.114 -r1.115 src/sys/arch/newsmips/newsmips/machdep.c cvs rdiff -u -r1.22 -r1.23 src/sys/arch/newsmips/newsmips/news3400.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/apbus_subr.c diff -u src/sys/arch/newsmips/apbus/apbus_subr.c:1.8 src/sys/arch/newsmips/apbus/apbus_subr.c:1.9 --- src/sys/arch/newsmips/apbus/apbus_subr.c:1.8 Wed Apr 9 11:40:30 2008 +++ src/sys/arch/newsmips/apbus/apbus_subr.c Mon Mar 24 16:05:20 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: apbus_subr.c,v 1.8 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: apbus_subr.c,v 1.9 2014/03/24 20:05:20 christos Exp $ */ /*- * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: apbus_subr.c,v 1.8 2008/04/09 15:40:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apbus_subr.c,v 1.9 2014/03/24 20:05:20 christos Exp $"); #include #include @@ -74,15 +74,11 @@ apbus_lookupdev(char *devname) static void apctl_dump(struct apbus_ctl *apctl) { - unsigned int *p; - if (!apctl) return; printf(" apbus_ctl dump (%p)\n", apctl); - p = (void *)apctl; - printf(" Num: %d\n", apctl->apbc_ctlno); printf(" HWaddr: 0x%08x\n", apctl->apbc_hwbase); printf(" softc: %p\n", apctl->apbc_softc); Index: src/sys/arch/newsmips/dev/scsi_1185.c diff -u src/sys/arch/newsmips/dev/scsi_1185.c:1.20 src/sys/arch/newsmips/dev/scsi_1185.c:1.21 --- src/sys/arch/newsmips/dev/scsi_1185.c:1.20 Sun Feb 20 02:56:31 2011 +++ src/sys/arch/newsmips/dev/scsi_1185.c Mon Mar 24 16:05:20 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: scsi_1185.c,v 1.20 2011/02/20 07:56:31 matt Exp $ */ +/* $NetBSD: scsi_1185.c,v 1.21 2014/03/24 20:05:20 christos Exp $ */ /* * Copyright (c) 1992, 1993 @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,v 1.20 2011/02/20 07:56:31 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsi_1185.c,v 1.21 2014/03/24 20:05:20 christos Exp $"); #define __INTR_PRIVATE #include @@ -568,8 +568,10 @@ scintr_loop: int volatile cmonr; statr = sc_statr; + __USE(statr); DMAC_WAIT0; cmonr = sc_cmonr; + __USE(cmonr); sc->int_stat2 &= ~R3_SPE; sc->perr_flag[sc->ip->chan_num] = 1; } Index: src/sys/arch/newsmips/newsmips/autoconf.c diff -u src/sys/arch/newsmips/newsmips/autoconf.c:1.37 src/sys/arch/newsmips/newsmips/autoconf.c:1.38 --- src/sys/arch/newsmips/newsmips/autoconf.c:1.37 Sat Oct 13 02:25:20 2012 +++ src/sys/arch/newsmips/newsmips/autoconf.c Mon Mar 24 16:05:20 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.37 2012/10/13 06:25:20 tsutsui Exp $ */ +/* $NetBSD: autoconf.c,v 1.38 2014/03/24 20:05:20 christos Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -49,7 +49,7 @@ #define __INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.37 2012/10/13 06:25:20 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.38 2014/03/24 20:05:20 christos Exp $"); #include #include @@ -126,14 +126,13 @@ u_long bootdev = 0; /* should be dev_t, static void findroot(void) { - int ctlr, unit, part, type; + int ctlr, part, type; device_t dv; if (BOOTDEV_MAG(bootdev) != 5) /* NEWS-OS's B_DEVMAGIC */ return; ctlr = BOOTDEV_CTLR(bootdev); /* SCSI ID */ - unit = BOOTDEV_UNIT(bootdev); part = BOOTDEV_PART(bootdev); /* LUN */ type = BOOTDEV_TYPE(bootdev); Index: src/sys/arch/newsmips/newsmips/machdep.c diff -u src/sys/arch/newsmips/newsmips/machdep.c:1.114 src/sys/arch/newsmips/newsmips/machdep.c:1.115 --- src/sys/arch/newsmips/newsmips/machdep.c:1.114 Sat Jul 28 19:08:57 2012 +++ src/sys/arch/newsmips/newsmips/machdep.c Mon Mar 24 16:05:20 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.114 2012/07/28 23:08:57 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.115 2014/03/24 20:05:20 christos Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.114 2012/07/28 23:08:57 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.115 2014/03/24 20:05:20 christos Exp $"); /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -148,6 +148,7 @@ mach_init(int x_boothowto, int x_bootdev { u_long first, last; char *kernend; + const char *model; struct btinfo_magic *bi_magic; struct btinfo_bootarg *bi_arg; struct
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: tsutsui Date: Fri Jan 31 15:43:06 UTC 2014 Modified Files: src/sys/arch/newsmips/apbus: xafb.c src/sys/arch/newsmips/dev: fb.c Log Message: Add WSDISPLAYIO_LINEBYTES ioctl (for Xorg wsfb driver). To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/newsmips/apbus/xafb.c cvs rdiff -u -r1.25 -r1.26 src/sys/arch/newsmips/dev/fb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/xafb.c diff -u src/sys/arch/newsmips/apbus/xafb.c:1.16 src/sys/arch/newsmips/apbus/xafb.c:1.17 --- src/sys/arch/newsmips/apbus/xafb.c:1.16 Sat May 15 10:01:44 2010 +++ src/sys/arch/newsmips/apbus/xafb.c Fri Jan 31 15:43:06 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: xafb.c,v 1.16 2010/05/15 10:01:44 tsutsui Exp $ */ +/* $NetBSD: xafb.c,v 1.17 2014/01/31 15:43:06 tsutsui Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -29,7 +29,7 @@ /* "xa" frame buffer driver. Currently supports 1280x1024x8 only. */ #include -__KERNEL_RCSID(0, "$NetBSD: xafb.c,v 1.16 2010/05/15 10:01:44 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xafb.c,v 1.17 2014/01/31 15:43:06 tsutsui Exp $"); #include #include @@ -268,6 +268,10 @@ xafb_ioctl(void *v, void *vs, u_long cmd wdf->cmsize = 256; return 0; + case WSDISPLAYIO_LINEBYTES: + *(u_int *)data = dc->dc_ri.ri_stride; + return 0; + case WSDISPLAYIO_GETCMAP: return xafb_getcmap(sc, (struct wsdisplay_cmap *)data); Index: src/sys/arch/newsmips/dev/fb.c diff -u src/sys/arch/newsmips/dev/fb.c:1.25 src/sys/arch/newsmips/dev/fb.c:1.26 --- src/sys/arch/newsmips/dev/fb.c:1.25 Sat May 15 10:01:44 2010 +++ src/sys/arch/newsmips/dev/fb.c Fri Jan 31 15:43:06 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: fb.c,v 1.25 2010/05/15 10:01:44 tsutsui Exp $ */ +/* $NetBSD: fb.c,v 1.26 2014/01/31 15:43:06 tsutsui Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fb.c,v 1.25 2010/05/15 10:01:44 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fb.c,v 1.26 2014/01/31 15:43:06 tsutsui Exp $"); #include #include @@ -255,6 +255,10 @@ fb_ioctl(void *v, void *vs, u_long cmd, wdf->cmsize = 2; return 0; + case WSDISPLAYIO_LINEBYTES: + *(u_int *)data = dc->dc_ri.ri_stride; + return 0; + case WSDISPLAYIO_SVIDEO: if (*(int *)data == WSDISPLAYIO_VIDEO_OFF) { volatile u_short *ctlreg = NWB253_CTLREG;
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: tsutsui Date: Sat Oct 13 06:25:20 UTC 2012 Modified Files: src/sys/arch/newsmips/apbus: kb_ap.c ms_ap.c src/sys/arch/newsmips/dev: kb_hb.c ms_hb.c src/sys/arch/newsmips/newsmips: autoconf.c Log Message: struct device * -> device_t, use device_xname() (from chs@) To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/newsmips/apbus/kb_ap.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/newsmips/apbus/ms_ap.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/newsmips/dev/kb_hb.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/newsmips/dev/ms_hb.c cvs rdiff -u -r1.36 -r1.37 src/sys/arch/newsmips/newsmips/autoconf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/kb_ap.c diff -u src/sys/arch/newsmips/apbus/kb_ap.c:1.9 src/sys/arch/newsmips/apbus/kb_ap.c:1.10 --- src/sys/arch/newsmips/apbus/kb_ap.c:1.9 Wed Apr 9 15:40:30 2008 +++ src/sys/arch/newsmips/apbus/kb_ap.c Sat Oct 13 06:25:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: kb_ap.c,v 1.9 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: kb_ap.c,v 1.10 2012/10/13 06:25:20 tsutsui Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kb_ap.c,v 1.9 2008/04/09 15:40:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kb_ap.c,v 1.10 2012/10/13 06:25:20 tsutsui Exp $"); #include #include @@ -66,7 +66,7 @@ struct kbreg { struct kb_ap_softc { device_t sc_dev; struct kbreg *sc_reg; - struct device *sc_wskbddev; + device_t sc_wskbddev; }; int kb_ap_match(device_t, cfdata_t, void *); Index: src/sys/arch/newsmips/apbus/ms_ap.c diff -u src/sys/arch/newsmips/apbus/ms_ap.c:1.10 src/sys/arch/newsmips/apbus/ms_ap.c:1.11 --- src/sys/arch/newsmips/apbus/ms_ap.c:1.10 Wed Apr 9 15:40:30 2008 +++ src/sys/arch/newsmips/apbus/ms_ap.c Sat Oct 13 06:25:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ms_ap.c,v 1.10 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: ms_ap.c,v 1.11 2012/10/13 06:25:20 tsutsui Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ms_ap.c,v 1.10 2008/04/09 15:40:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ms_ap.c,v 1.11 2012/10/13 06:25:20 tsutsui Exp $"); #include #include @@ -50,7 +50,7 @@ struct msreg { struct ms_ap_softc { device_t sc_dev; struct msreg *sc_reg; - struct device *sc_wsmousedev; + device_t sc_wsmousedev; int sc_ndata; uint8_t sc_buf[3]; }; Index: src/sys/arch/newsmips/dev/kb_hb.c diff -u src/sys/arch/newsmips/dev/kb_hb.c:1.12 src/sys/arch/newsmips/dev/kb_hb.c:1.13 --- src/sys/arch/newsmips/dev/kb_hb.c:1.12 Wed Apr 9 15:40:30 2008 +++ src/sys/arch/newsmips/dev/kb_hb.c Sat Oct 13 06:25:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: kb_hb.c,v 1.12 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: kb_hb.c,v 1.13 2012/10/13 06:25:20 tsutsui Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kb_hb.c,v 1.12 2008/04/09 15:40:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kb_hb.c,v 1.13 2012/10/13 06:25:20 tsutsui Exp $"); #include #include @@ -52,7 +52,7 @@ struct kbreg { struct kb_hb_softc { device_t sc_dev; struct kbreg *sc_reg; - struct device *sc_wskbddev; + device_t sc_wskbddev; }; int kb_hb_match(device_t, cfdata_t, void *); Index: src/sys/arch/newsmips/dev/ms_hb.c diff -u src/sys/arch/newsmips/dev/ms_hb.c:1.13 src/sys/arch/newsmips/dev/ms_hb.c:1.14 --- src/sys/arch/newsmips/dev/ms_hb.c:1.13 Wed Apr 9 15:40:30 2008 +++ src/sys/arch/newsmips/dev/ms_hb.c Sat Oct 13 06:25:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ms_hb.c,v 1.13 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: ms_hb.c,v 1.14 2012/10/13 06:25:20 tsutsui Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ms_hb.c,v 1.13 2008/04/09 15:40:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ms_hb.c,v 1.14 2012/10/13 06:25:20 tsutsui Exp $"); #include #include @@ -50,7 +50,7 @@ struct msreg { struct ms_hb_softc { device_t sc_dev; struct msreg *sc_reg; - struct device *sc_wsmousedev; + device_t sc_wsmousedev; int sc_ndata; uint8_t sc_buf[3]; }; Index: src/sys/arch/newsmips/newsmips/autoconf.c diff -u src/sys/arch/newsmips/newsmips/autoconf.c:1.36 src/sys/arch/newsmips/newsmips/autoconf.c:1.37 --- src/sys/arch/newsmips/newsmips/autoconf.c:1.36 Sun Jul 29 18:05:45 2012 +++ src/sys/arch/newsmips/newsmips/autoconf.c Sat Oct 13 06:25:20 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.36 2012/07/29 18:05:45 mlelstv Exp $ */ +/* $NetBSD: autoconf.c,v 1.37 2012/10/13 06:25:20 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -49,7 +49,7 @@ #define __INTR_PRIVATE #include -__KERNEL_RCSID(0, "$Net
CVS commit: src/sys/arch/newsmips/apbus
Module Name:src Committed By: tsutsui Date: Sat Oct 13 06:24:15 UTC 2012 Modified Files: src/sys/arch/newsmips/apbus: if_sn.c Log Message: Fix botch on device_t/softc split inside #ifdef SNDEBUG part. from chs@ To generate a diff of this commit: cvs rdiff -u -r1.33 -r1.34 src/sys/arch/newsmips/apbus/if_sn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/if_sn.c diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.33 src/sys/arch/newsmips/apbus/if_sn.c:1.34 --- src/sys/arch/newsmips/apbus/if_sn.c:1.33 Mon Apr 5 07:19:31 2010 +++ src/sys/arch/newsmips/apbus/if_sn.c Sat Oct 13 06:24:15 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: if_sn.c,v 1.33 2010/04/05 07:19:31 joerg Exp $ */ +/* $NetBSD: if_sn.c,v 1.34 2012/10/13 06:24:15 tsutsui Exp $ */ /* * National Semiconductor DP8393X SONIC Driver @@ -16,7 +16,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.33 2010/04/05 07:19:31 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.34 2012/10/13 06:24:15 tsutsui Exp $"); #include "opt_inet.h" @@ -204,7 +204,7 @@ snsetup(struct sn_softc *sc, uint8_t *ll #ifdef SNDEBUG aprint_debug_dev(sc->sc_dev, "buffers: rra=%p cda=%p rda=%p tda=%p\n", - sc->sc_dev.dv_xname, sc->p_rra[0], sc->p_cda, + device_xname(sc->sc_dev), sc->p_rra[0], sc->p_cda, sc->p_rda, sc->mtda[0].mtd_txp); #endif
CVS commit: src/sys/arch/newsmips/apbus
Module Name:src Committed By: he Date: Fri Jul 15 07:49:20 UTC 2011 Modified Files: src/sys/arch/newsmips/apbus: if_tlp_ap.c Log Message: Track the changes to tulipvar.h -- use the recently introduced tlp_chip_name() to get the chip name for aprint output. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/newsmips/apbus/if_tlp_ap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/if_tlp_ap.c diff -u src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.12 src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.13 --- src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.12 Sun Feb 20 07:56:31 2011 +++ src/sys/arch/newsmips/apbus/if_tlp_ap.c Fri Jul 15 07:49:20 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tlp_ap.c,v 1.12 2011/02/20 07:56:31 matt Exp $ */ +/* $NetBSD: if_tlp_ap.c,v 1.13 2011/07/15 07:49:20 he Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tlp_ap.c,v 1.12 2011/02/20 07:56:31 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tlp_ap.c,v 1.13 2011/07/15 07:49:20 he Exp $"); #include #include @@ -140,7 +140,7 @@ } aprint_normal(": %s Ethernet, pass %d.%d\n", - tlp_chip_names[sc->sc_chip], + tlp_chip_name(sc->sc_chip), (sc->sc_rev >> 4) & 0xf, sc->sc_rev & 0xf); /* CSR */
CVS commit: src/sys/arch/newsmips/include
Module Name:src Committed By: tsutsui Date: Fri Mar 18 16:21:30 UTC 2011 Modified Files: src/sys/arch/newsmips/include: param.h Log Message: - include after MACHINE is defined - remove redundant comment To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/newsmips/include/param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/include/param.h diff -u src/sys/arch/newsmips/include/param.h:1.20 src/sys/arch/newsmips/include/param.h:1.21 --- src/sys/arch/newsmips/include/param.h:1.20 Sun Mar 6 20:34:57 2011 +++ src/sys/arch/newsmips/include/param.h Fri Mar 18 16:21:30 2011 @@ -1,4 +1,4 @@ -/* from $NetBSD: param.h,v 1.20 2011/03/06 20:34:57 he Exp $ */ +/* from $NetBSD: param.h,v 1.21 2011/03/18 16:21:30 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -38,23 +38,17 @@ * @(#)param.h 8.1 (Berkeley) 6/10/93 */ -/* - * Machine-dependent constants (VM, etc) common across MIPS cpus - */ - #ifndef _NEWSMIPS_PARAM_H_ #define _NEWSMIPS_PARAM_H_ -#include - /* * Machine dependent constants for mips-based NEWS. */ #define _MACHINE newsmips -#ifdef _KERNEL #define MACHINE "newsmips" -#endif + +#include #define KERNBASE 0x8000 /* start of kernel virtual */ #define KERNTEXTOFF 0x80001000 /* start of kernel text for kvm_mkdb */
CVS commit: src/sys/arch/newsmips/newsmips
Module Name:src Committed By: tsutsui Date: Thu Mar 10 15:40:36 UTC 2011 Modified Files: src/sys/arch/newsmips/newsmips: news3400.c news5000.c Log Message: Set correct struct clockframe .intr value for hardclock(9). To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/newsmips/newsmips/news3400.c cvs rdiff -u -r1.19 -r1.20 src/sys/arch/newsmips/newsmips/news5000.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/newsmips/news3400.c diff -u src/sys/arch/newsmips/newsmips/news3400.c:1.21 src/sys/arch/newsmips/newsmips/news3400.c:1.22 --- src/sys/arch/newsmips/newsmips/news3400.c:1.21 Wed Mar 9 13:21:36 2011 +++ src/sys/arch/newsmips/newsmips/news3400.c Thu Mar 10 15:40:36 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: news3400.c,v 1.21 2011/03/09 13:21:36 tsutsui Exp $ */ +/* $NetBSD: news3400.c,v 1.22 2011/03/10 15:40:36 tsutsui Exp $ */ /*- * Copyright (C) 1999 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: news3400.c,v 1.21 2011/03/09 13:21:36 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: news3400.c,v 1.22 2011/03/10 15:40:36 tsutsui Exp $"); #define __INTR_PRIVATE #include @@ -102,7 +102,7 @@ struct clockframe cf = { .pc = pc, .sr = status, - .intr = (curcpu()->ci_idepth > 0), + .intr = (curcpu()->ci_idepth > 1), }; hardclock(&cf); intrcnt[HARDCLOCK_INTR]++; Index: src/sys/arch/newsmips/newsmips/news5000.c diff -u src/sys/arch/newsmips/newsmips/news5000.c:1.19 src/sys/arch/newsmips/newsmips/news5000.c:1.20 --- src/sys/arch/newsmips/newsmips/news5000.c:1.19 Wed Mar 9 13:21:36 2011 +++ src/sys/arch/newsmips/newsmips/news5000.c Thu Mar 10 15:40:36 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: news5000.c,v 1.19 2011/03/09 13:21:36 tsutsui Exp $ */ +/* $NetBSD: news5000.c,v 1.20 2011/03/10 15:40:36 tsutsui Exp $ */ /*- * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: news5000.c,v 1.19 2011/03/09 13:21:36 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: news5000.c,v 1.20 2011/03/10 15:40:36 tsutsui Exp $"); #define __INTR_PRIVATE #include @@ -89,7 +89,6 @@ static int l2cnt = 0; #endif uint32_t int2stat; - struct clockframe cf; int2stat = *(volatile uint32_t *)NEWS5000_INTST2; @@ -105,11 +104,12 @@ #endif if (int2stat & NEWS5000_INT2_TIMER0) { +struct clockframe cf = { + .pc = pc, + .sr = status, + .intr = (curcpu()->ci_idepth > 1), +}; *(volatile uint32_t *)NEWS5000_TIMER0 = 1; - -cf.pc = pc; -cf.sr = status; - hardclock(&cf); intrcnt[HARDCLOCK_INTR]++; }
CVS commit: src/sys/arch/newsmips/newsmips
Module Name:src Committed By: tsutsui Date: Wed Mar 9 13:21:36 UTC 2011 Modified Files: src/sys/arch/newsmips/newsmips: autoconf.c machdep.c news3400.c news5000.c Log Message: Fix newsmips interrupt handling for new mips interrupt/spl framework: - make news3400_badaddr() work even if interrupts are disabled (in the old world bus error interrupt is enabled even during splhigh()) - make ipl_sr_map values model dependent Now GENERIC kernel boots to single user properly on R3000 NWS-3470D, though sh(1) still gets floating point exceptions during /etc/rc scripts. news5000 is untested (yet). To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/arch/newsmips/newsmips/autoconf.c cvs rdiff -u -r1.112 -r1.113 src/sys/arch/newsmips/newsmips/machdep.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/newsmips/newsmips/news3400.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/newsmips/newsmips/news5000.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/newsmips/autoconf.c diff -u src/sys/arch/newsmips/newsmips/autoconf.c:1.34 src/sys/arch/newsmips/newsmips/autoconf.c:1.35 --- src/sys/arch/newsmips/newsmips/autoconf.c:1.34 Sun Feb 20 07:56:31 2011 +++ src/sys/arch/newsmips/newsmips/autoconf.c Wed Mar 9 13:21:36 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.34 2011/02/20 07:56:31 matt Exp $ */ +/* $NetBSD: autoconf.c,v 1.35 2011/03/09 13:21:36 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -49,7 +49,7 @@ #define __INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.34 2011/02/20 07:56:31 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.35 2011/03/09 13:21:36 tsutsui Exp $"); #include #include @@ -94,19 +94,14 @@ /* * Kick off autoconfiguration */ - spl0(); /* enable all interrupts */ - splhigh(); /* ...then disable device interrupts */ - - if (systype == NEWS3400) { - *(char *)INTEN0 = INTEN0_BERR; /* only buserr occurs */ - *(char *)INTEN1 = 0; - } + (*disable_intr)(); + (void)splhigh(); if (config_rootfound("mainbus", NULL) == NULL) panic("no mainbus found"); /* Enable hardware interrupt registers. */ - enable_intr(); + (*enable_intr)(); /* Configuration is finished, turn on interrupts. */ spl0(); /* enable all source forcing SOFT_INTs cleared */ Index: src/sys/arch/newsmips/newsmips/machdep.c diff -u src/sys/arch/newsmips/newsmips/machdep.c:1.112 src/sys/arch/newsmips/newsmips/machdep.c:1.113 --- src/sys/arch/newsmips/newsmips/machdep.c:1.112 Sun Feb 20 07:56:31 2011 +++ src/sys/arch/newsmips/newsmips/machdep.c Wed Mar 9 13:21:36 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.112 2011/02/20 07:56:31 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.113 2011/03/09 13:21:36 tsutsui Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.112 2011/02/20 07:56:31 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.113 2011/03/09 13:21:36 tsutsui Exp $"); /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -138,27 +138,6 @@ extern void stacktrace(void); /*XXX*/ #endif -/* - * This is a mask of bits to clear in the SR when we go to a - * given interrupt priority level. - */ -const struct ipl_sr_map newsmips_ipl_sr_map = { -.sr_bits = { - [IPL_NONE] = 0, - [IPL_SOFTCLOCK] = MIPS_SOFT_INT_MASK_0, - [IPL_SOFTNET] = MIPS_SOFT_INT_MASK, - [IPL_VM] = MIPS_SOFT_INT_MASK -| MIPS_INT_MASK_0 -| MIPS_INT_MASK_1, - [IPL_SCHED] = MIPS_SOFT_INT_MASK -| MIPS_INT_MASK_0 -| MIPS_INT_MASK_1 -| MIPS_INT_MASK_2, - [IPL_DDB] = MIPS_INT_MASK, - [IPL_HIGH] = MIPS_INT_MASK, -}, -}; - extern u_long bootdev; extern char edata[], end[]; @@ -284,7 +263,6 @@ * Initialize locore-function vector. * Clear out the I and D caches. */ - ipl_sr_map = newsmips_ipl_sr_map; mips_vector_init(NULL, false); /* Index: src/sys/arch/newsmips/newsmips/news3400.c diff -u src/sys/arch/newsmips/newsmips/news3400.c:1.20 src/sys/arch/newsmips/newsmips/news3400.c:1.21 --- src/sys/arch/newsmips/newsmips/news3400.c:1.20 Sun Feb 20 07:56:31 2011 +++ src/sys/arch/newsmips/newsmips/news3400.c Wed Mar 9 13:21:36 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: news3400.c,v 1.20 2011/02/20 07:56:31 matt Exp $ */ +/* $NetBSD: news3400.c,v 1.21 2011/03/09 13:21:36 tsutsui Exp $ */ /*- * Copyright (C) 1999 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: news3400.c,v 1.20 2011/02/20 07:56:31 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: news3400.c,v 1.21 2011/03/09 13:21:36 tsutsui Exp $"); #define __INTR_PRIVATE #include @@ -59,6 +59,27 @@ #define INT_MASK_FPU MIPS_INT_MASK_3 /* + * This is a mask of bits to clear in the SR when we go to a + * given interrupt priority level. + */ +static const struct ipl_sr_map news3400
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: matt Date: Sun Feb 20 07:56:32 UTC 2011 Modified Files: src/sys/arch/newsmips/apbus: apbus.c if_snvar.h if_tlp_ap.c src/sys/arch/newsmips/conf: files.newsmips src/sys/arch/newsmips/dev: hb.c scsi_1185.c src/sys/arch/newsmips/include: intr.h src/sys/arch/newsmips/newsmips: autoconf.c bus.c clock.c cpu.c locore_machdep.S machdep.c news3400.c news5000.c Log Message: Merge forward matt-nb5-mips64 Adapt to new interrupt/spl framework To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/newsmips/apbus/apbus.c cvs rdiff -u -r1.12 -r1.13 src/sys/arch/newsmips/apbus/if_snvar.h cvs rdiff -u -r1.11 -r1.12 src/sys/arch/newsmips/apbus/if_tlp_ap.c cvs rdiff -u -r1.27 -r1.28 src/sys/arch/newsmips/conf/files.newsmips cvs rdiff -u -r1.18 -r1.19 src/sys/arch/newsmips/dev/hb.c cvs rdiff -u -r1.19 -r1.20 src/sys/arch/newsmips/dev/scsi_1185.c cvs rdiff -u -r1.24 -r1.25 src/sys/arch/newsmips/include/intr.h cvs rdiff -u -r1.33 -r1.34 src/sys/arch/newsmips/newsmips/autoconf.c cvs rdiff -u -r1.30 -r1.31 src/sys/arch/newsmips/newsmips/bus.c cvs rdiff -u -r1.15 -r1.16 src/sys/arch/newsmips/newsmips/clock.c \ src/sys/arch/newsmips/newsmips/locore_machdep.S cvs rdiff -u -r1.11 -r1.12 src/sys/arch/newsmips/newsmips/cpu.c cvs rdiff -u -r1.111 -r1.112 src/sys/arch/newsmips/newsmips/machdep.c cvs rdiff -u -r1.19 -r1.20 src/sys/arch/newsmips/newsmips/news3400.c cvs rdiff -u -r1.17 -r1.18 src/sys/arch/newsmips/newsmips/news5000.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/apbus.c diff -u src/sys/arch/newsmips/apbus/apbus.c:1.21 src/sys/arch/newsmips/apbus/apbus.c:1.22 --- src/sys/arch/newsmips/apbus/apbus.c:1.21 Wed Apr 9 15:40:30 2008 +++ src/sys/arch/newsmips/apbus/apbus.c Sun Feb 20 07:56:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: apbus.c,v 1.21 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: apbus.c,v 1.22 2011/02/20 07:56:31 matt Exp $ */ /*- * Copyright (C) 1999 SHIMIZU Ryo. All rights reserved. @@ -27,13 +27,16 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.21 2008/04/09 15:40:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apbus.c,v 1.22 2011/02/20 07:56:31 matt Exp $"); + +#define __INTR_PRIVATE #include #include #include #include #include +#include #include @@ -41,7 +44,6 @@ #include #define _NEWSMIPS_BUS_DMA_PRIVATE #include -#include #include static int apbusmatch(device_t, cfdata_t, void *); @@ -97,6 +99,8 @@ struct newsmips_intr *ip; int i; + mips_set_wbflush(apbus_wbflush); + *(volatile uint32_t *)(NEWS5000_APBUS_INTST) = 0x; *(volatile uint32_t *)(NEWS5000_APBUS_INTMSK) = 0x; *(volatile uint32_t *)(NEWS5000_APBUS_CTRL) = 0x0004; @@ -176,9 +180,10 @@ void apbus_wbflush(void) { - volatile int32_t *wbflush = (uint32_t *)NEWS5000_WBFLUSH; + volatile int32_t * const our_wbflush = (int32_t *)NEWS5000_WBFLUSH; - (void)*wbflush; + (*mips_locore_jumpvec.ljv_wbflush)(); + (void)*our_wbflush; } /* Index: src/sys/arch/newsmips/apbus/if_snvar.h diff -u src/sys/arch/newsmips/apbus/if_snvar.h:1.12 src/sys/arch/newsmips/apbus/if_snvar.h:1.13 --- src/sys/arch/newsmips/apbus/if_snvar.h:1.12 Wed Apr 9 15:40:30 2008 +++ src/sys/arch/newsmips/apbus/if_snvar.h Sun Feb 20 07:56:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_snvar.h,v 1.12 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: if_snvar.h,v 1.13 2011/02/20 07:56:31 matt Exp $ */ /* * Copyright (c) 1991 Algorithmics Ltd (http://www.algor.co.uk) @@ -32,14 +32,6 @@ #define SN_REGSIZE (SN_NREGS * 4) #include -#undef wbflush /* XXX */ - -static inline void -wbflush(void) -{ - mips3_wbflush(); - apbus_wbflush(); -}; /* * buffer sizes in 32 bit mode Index: src/sys/arch/newsmips/apbus/if_tlp_ap.c diff -u src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.11 src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.12 --- src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.11 Fri Apr 17 14:48:17 2009 +++ src/sys/arch/newsmips/apbus/if_tlp_ap.c Sun Feb 20 07:56:31 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tlp_ap.c,v 1.11 2009/04/17 14:48:17 tsutsui Exp $ */ +/* $NetBSD: if_tlp_ap.c,v 1.12 2011/02/20 07:56:31 matt Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tlp_ap.c,v 1.11 2009/04/17 14:48:17 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tlp_ap.c,v 1.12 2011/02/20 07:56:31 matt Exp $"); #include #include @@ -155,10 +155,10 @@ /* * Initialize bus specific parameters. */ - if (mips_sdcache_line_size > 0) - sc->sc_cacheline = mips_sdcache_line_size / 4; - else if (mips_pdcache_line_size > 0) - sc->sc_cacheline = mips_pdcache_line_size / 4; + if (mips_cache_info.mci_sdcache_line_size > 0) + sc->sc_cacheline = mips_cache_info.mci_sdcache_line_size / 4; + else if (mips_cache_info.mci_pdca
CVS commit: src/sys/arch/newsmips/stand/boot
Module Name:src Committed By: christos Date: Wed Aug 25 16:35:57 UTC 2010 Modified Files: src/sys/arch/newsmips/stand/boot: boot.c Log Message: s/LOAD_NOTE/LOAD_BACKWARDS/ To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/newsmips/stand/boot/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/stand/boot/boot.c diff -u src/sys/arch/newsmips/stand/boot/boot.c:1.17 src/sys/arch/newsmips/stand/boot/boot.c:1.18 --- src/sys/arch/newsmips/stand/boot/boot.c:1.17 Tue Jan 20 08:12:26 2009 +++ src/sys/arch/newsmips/stand/boot/boot.c Wed Aug 25 12:35:57 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.17 2009/01/20 13:12:26 tsutsui Exp $ */ +/* $NetBSD: boot.c,v 1.18 2010/08/25 16:35:57 christos Exp $ */ /*- * Copyright (C) 1999 Tsubai Masanari. All rights reserved. @@ -161,10 +161,9 @@ kernels[1] = NULL; } - /* disable LOAD_NOTE on floppy to avoid backward seek across volumes */ loadflag = LOAD_KERNEL; if (devname[0] == 'f') /* XXX */ - loadflag &= ~LOAD_NOTE; + loadflag &= ~LOAD_BACKWARDS; marks[MARK_START] = 0;
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: tsutsui Date: Sat Jun 26 03:49:52 UTC 2010 Modified Files: src/sys/arch/newsmips/apbus: zs_ap.c src/sys/arch/newsmips/include: z8530var.h Log Message: Um, fix botch in previous. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/newsmips/apbus/zs_ap.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/newsmips/include/z8530var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/zs_ap.c diff -u src/sys/arch/newsmips/apbus/zs_ap.c:1.26 src/sys/arch/newsmips/apbus/zs_ap.c:1.27 --- src/sys/arch/newsmips/apbus/zs_ap.c:1.26 Sat Jun 26 03:44:49 2010 +++ src/sys/arch/newsmips/apbus/zs_ap.c Sat Jun 26 03:49:52 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: zs_ap.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $ */ +/* $NetBSD: zs_ap.c,v 1.27 2010/06/26 03:49:52 tsutsui Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.27 2010/06/26 03:49:52 tsutsui Exp $"); #include #include @@ -296,7 +296,8 @@ /* * Now safe to install interrupt handlers. */ - zsc->zsc_si = softint_establish(SOFTINT_SERIAL, zssoft, zsc); + zsc->zsc_si = softint_establish(SOFTINT_SERIAL, + (void (*)(void *))zsc_intr_soft, zsc); apbus_intr_establish(1, /* interrupt level ( 0 or 1 ) */ NEWS5000_INT1_SCC, 0, /* priority */ zshard_ap, zsc, apa->apa_name, apa->apa_ctlnum); Index: src/sys/arch/newsmips/include/z8530var.h diff -u src/sys/arch/newsmips/include/z8530var.h:1.10 src/sys/arch/newsmips/include/z8530var.h:1.11 --- src/sys/arch/newsmips/include/z8530var.h:1.10 Sat Mar 29 19:15:35 2008 +++ src/sys/arch/newsmips/include/z8530var.h Sat Jun 26 03:49:52 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: z8530var.h,v 1.10 2008/03/29 19:15:35 tsutsui Exp $ */ +/* $NetBSD: z8530var.h,v 1.11 2010/06/26 03:49:52 tsutsui Exp $ */ /* * Copyright (c) 1992, 1993 @@ -111,7 +111,6 @@ int zs_print(void *, const char *); int zshard(void *); -void zssoft(void*); int zs_get_speed(struct zs_chanstate *); void (*zs_delay)(void);
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: tsutsui Date: Sat Jun 26 03:44:49 UTC 2010 Modified Files: src/sys/arch/newsmips/apbus: zs_ap.c src/sys/arch/newsmips/dev: zs.c zs_hb.c Log Message: Pull a similar fix from sparc/dev/zs.c rev 1.119: Establish interrupt handlers with proper softc per each zs device rather than sharing them among all zs devices and searching softc in handlers, to avoid possible recursive lock. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/newsmips/apbus/zs_ap.c cvs rdiff -u -r1.25 -r1.26 src/sys/arch/newsmips/dev/zs.c \ src/sys/arch/newsmips/dev/zs_hb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/zs_ap.c diff -u src/sys/arch/newsmips/apbus/zs_ap.c:1.25 src/sys/arch/newsmips/apbus/zs_ap.c:1.26 --- src/sys/arch/newsmips/apbus/zs_ap.c:1.25 Mon Apr 28 20:23:30 2008 +++ src/sys/arch/newsmips/apbus/zs_ap.c Sat Jun 26 03:44:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: zs_ap.c,v 1.25 2008/04/28 20:23:30 martin Exp $ */ +/* $NetBSD: zs_ap.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.25 2008/04/28 20:23:30 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs_ap.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $"); #include #include @@ -213,7 +213,6 @@ volatile u_int *portBctl = (void *)(apa->apa_hwbase + PORTB_OFFSET); volatile u_int *portActl = (void *)(apa->apa_hwbase + PORTA_OFFSET); volatile u_int *esccregs = (void *)(apa->apa_hwbase + ESCC_REG); - static int didintr; zsc->zsc_dev = self; zs_unit = device_unit(self); @@ -295,20 +294,12 @@ } /* - * Now safe to install interrupt handlers. Note the arguments - * to the interrupt handlers aren't used. Note, we only do this - * once since both SCCs interrupt at the same level and vector. + * Now safe to install interrupt handlers. */ - if (!didintr) { - didintr = 1; - - zsc->zsc_si = softint_establish(SOFTINT_SERIAL, zssoft, zsc); - apbus_intr_establish(1, /* interrupt level ( 0 or 1 ) */ - NEWS5000_INT1_SCC, - 0, /* priority */ - zshard_ap, zsc, - apa->apa_name, apa->apa_ctlnum); - } + zsc->zsc_si = softint_establish(SOFTINT_SERIAL, zssoft, zsc); + apbus_intr_establish(1, /* interrupt level ( 0 or 1 ) */ + NEWS5000_INT1_SCC, 0, /* priority */ + zshard_ap, zsc, apa->apa_name, apa->apa_ctlnum); /* XXX; evcnt_attach() ? */ #if 0 Index: src/sys/arch/newsmips/dev/zs.c diff -u src/sys/arch/newsmips/dev/zs.c:1.25 src/sys/arch/newsmips/dev/zs.c:1.26 --- src/sys/arch/newsmips/dev/zs.c:1.25 Fri Jun 13 12:26:35 2008 +++ src/sys/arch/newsmips/dev/zs.c Sat Jun 26 03:44:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: zs.c,v 1.25 2008/06/13 12:26:35 cegger Exp $ */ +/* $NetBSD: zs.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.25 2008/06/13 12:26:35 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.26 2010/06/26 03:44:49 tsutsui Exp $"); #include "opt_ddb.h" @@ -80,51 +80,24 @@ } /* - * Our ZS chips all share a common, autovectored interrupt, - * so we have to look at all of them on each interrupt. + * Our ZS chips all share a common interrupt level, + * but we establish zshard handler per each ZS chips + * to avoid holding unnecessary locks in interrupt context. */ int zshard(void *arg) { - struct zsc_softc *zsc; - int unit, rval, softreq; + struct zsc_softc *zsc = arg; + int rval; - rval = 0; - for (unit = 0; unit < zsc_cd.cd_ndevs; unit++) { - zsc = device_lookup_private(&zsc_cd, unit); - if (zsc == NULL) - continue; - rval |= zsc_intr_hard(zsc); - softreq = zsc->zsc_cs[0]->cs_softreq; - softreq |= zsc->zsc_cs[1]->cs_softreq; - if (softreq) - softint_schedule(zsc->zsc_si); - } + rval = zsc_intr_hard(zsc); + if (zsc->zsc_cs[0]->cs_softreq || zsc->zsc_cs[1]->cs_softreq) + softint_schedule(zsc->zsc_si); return rval; } /* - * Similar scheme as for zshard (look at all of them) - */ -void -zssoft(void *arg) -{ - struct zsc_softc *zsc; - int s, unit; - - /* Make sure we call the tty layer at spltty. */ - s = spltty(); - for (unit = 0; unit < zsc_cd.cd_ndevs; unit++) { - zsc = device_lookup_private(&zsc_cd, unit); - if (zsc == NULL) - continue; - (void)zsc_intr_soft(zsc); - } - splx(s); -} - -/* * Compute the current baud rate given a ZS channel. */ int Index: src/sys/arch/newsmips/dev/zs_hb.c diff -u src/sys/arch/newsmips/dev/zs_hb.c:1.25 src/sys/arch/newsmips/dev/zs_hb.c:1.26 --- src/sys/arch/newsmips/dev/zs_hb.c:1.25 Mon Apr 28 20:23:30 2008 +++ src/sys/arch/newsmips/dev/zs_hb.c Sat Jun 26 03:44:49 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: zs_hb.c,v 1.25 2008/04/28 20:23:30 martin Exp $ */ +/* $NetBSD: zs_hb.c,v 1.26 2010/06/26 03
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: tsutsui Date: Sat May 15 10:01:44 UTC 2010 Modified Files: src/sys/arch/newsmips/apbus: xafb.c src/sys/arch/newsmips/dev: fb.c Log Message: Set RI_NO_AUTO in ri_flg if init functions are invoked from cnattach. Tested on NWS-3470D. xafb.c for NWS-5000 is untested. XXX: isn't it better to have failsafe default than sprinkle RI_NO_AUTO XXX: to avoid fatal silent hangup? To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/newsmips/apbus/xafb.c cvs rdiff -u -r1.24 -r1.25 src/sys/arch/newsmips/dev/fb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/xafb.c diff -u src/sys/arch/newsmips/apbus/xafb.c:1.15 src/sys/arch/newsmips/apbus/xafb.c:1.16 --- src/sys/arch/newsmips/apbus/xafb.c:1.15 Wed Apr 9 15:40:30 2008 +++ src/sys/arch/newsmips/apbus/xafb.c Sat May 15 10:01:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: xafb.c,v 1.15 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: xafb.c,v 1.16 2010/05/15 10:01:44 tsutsui Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -29,7 +29,7 @@ /* "xa" frame buffer driver. Currently supports 1280x1024x8 only. */ #include -__KERNEL_RCSID(0, "$NetBSD: xafb.c,v 1.15 2008/04/09 15:40:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xafb.c,v 1.16 2010/05/15 10:01:44 tsutsui Exp $"); #include #include @@ -152,6 +152,7 @@ if (console) { dc = &xafb_console_dc; ri = &dc->dc_ri; + ri->ri_flg &= ~RI_NO_AUTO; sc->sc_nscreens = 1; } else { dc = malloc(sizeof(struct xafb_devconfig), M_DEVBUF, @@ -216,6 +217,8 @@ ri->ri_stride = 2048; ri->ri_bits = (void *)dc->dc_fbbase; ri->ri_flg = RI_FORCEMONO | RI_FULLCLEAR; + if (dc == &xafb_console_dc) + ri->ri_flg |= RI_NO_AUTO; rasops_init(ri, 44, 100); Index: src/sys/arch/newsmips/dev/fb.c diff -u src/sys/arch/newsmips/dev/fb.c:1.24 src/sys/arch/newsmips/dev/fb.c:1.25 --- src/sys/arch/newsmips/dev/fb.c:1.24 Wed Apr 9 15:40:30 2008 +++ src/sys/arch/newsmips/dev/fb.c Sat May 15 10:01:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fb.c,v 1.24 2008/04/09 15:40:30 tsutsui Exp $ */ +/* $NetBSD: fb.c,v 1.25 2010/05/15 10:01:44 tsutsui Exp $ */ /*- * Copyright (c) 2000 Tsubai Masanari. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fb.c,v 1.24 2008/04/09 15:40:30 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fb.c,v 1.25 2010/05/15 10:01:44 tsutsui Exp $"); #include #include @@ -143,6 +143,7 @@ if (console) { dc = &fb_console_dc; ri = &dc->dc_ri; + ri->ri_flg &= ~RI_NO_AUTO; sc->sc_nscreens = 1; } else { dc = malloc(sizeof(struct fb_devconfig), M_DEVBUF, @@ -201,6 +202,8 @@ ri->ri_stride = 2048 / 8; ri->ri_bits = dc->dc_fbbase; ri->ri_flg = RI_FULLCLEAR; + if (dc == &fb_console_dc) + ri->ri_flg |= RI_NO_AUTO; rasops_init(ri, 24, 80); rows = (height - 2) / ri->ri_font->fontheight;
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: matt Date: Thu Dec 17 05:29:56 UTC 2009 Modified Files: src/sys/arch/newsmips/newsmips: locore_machdep.S machdep.c src/sys/arch/newsmips/stand/boot: Makefile Log Message: More changes to make newsmips compile (include "assym.h, remove unused variables, etc.) To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/newsmips/newsmips/locore_machdep.S cvs rdiff -u -r1.106 -r1.107 src/sys/arch/newsmips/newsmips/machdep.c cvs rdiff -u -r1.21 -r1.22 src/sys/arch/newsmips/stand/boot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/newsmips/locore_machdep.S diff -u src/sys/arch/newsmips/newsmips/locore_machdep.S:1.14 src/sys/arch/newsmips/newsmips/locore_machdep.S:1.15 --- src/sys/arch/newsmips/newsmips/locore_machdep.S:1.14 Sun Dec 11 12:18:25 2005 +++ src/sys/arch/newsmips/newsmips/locore_machdep.S Thu Dec 17 05:29:56 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: locore_machdep.S,v 1.14 2005/12/11 12:18:25 christos Exp $ */ +/* $NetBSD: locore_machdep.S,v 1.15 2009/12/17 05:29:56 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -60,6 +60,8 @@ #include #include +#include "assym.h" + .set noreorder LEAF(to_monitor) Index: src/sys/arch/newsmips/newsmips/machdep.c diff -u src/sys/arch/newsmips/newsmips/machdep.c:1.106 src/sys/arch/newsmips/newsmips/machdep.c:1.107 --- src/sys/arch/newsmips/newsmips/machdep.c:1.106 Mon Dec 14 00:46:09 2009 +++ src/sys/arch/newsmips/newsmips/machdep.c Thu Dec 17 05:29:56 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.106 2009/12/14 00:46:09 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.107 2009/12/17 05:29:56 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -76,7 +76,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.106 2009/12/14 00:46:09 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.107 2009/12/17 05:29:56 matt Exp $"); /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -216,9 +216,7 @@ mach_init(int x_boothowto, int x_bootdev, int x_bootname, int x_maxmem) { u_long first, last; - struct pcb *pcb0; char *kernend; - vaddr_t v; struct btinfo_magic *bi_magic; struct btinfo_bootarg *bi_arg; struct btinfo_systype *bi_systype; @@ -378,7 +376,7 @@ /* * Allocate uarea page for lwp0 and set it. */ - pmap_init_lwp0_uarea(); + mips_init_lwp0_uarea(); /* * Determine what model of computer we are running on. Index: src/sys/arch/newsmips/stand/boot/Makefile diff -u src/sys/arch/newsmips/stand/boot/Makefile:1.21 src/sys/arch/newsmips/stand/boot/Makefile:1.22 --- src/sys/arch/newsmips/stand/boot/Makefile:1.21 Wed Dec 16 23:19:07 2009 +++ src/sys/arch/newsmips/stand/boot/Makefile Thu Dec 17 05:29:56 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.21 2009/12/16 23:19:07 matt Exp $ +# $NetBSD: Makefile,v 1.22 2009/12/17 05:29:56 matt Exp $ S!= cd ${.CURDIR}/../../../..; pwd @@ -25,9 +25,8 @@ CPPFLAGS+= -D_STANDALONE #-DBOOT_DEBUG CPPFLAGS+= -I${.CURDIR} -I. -I${S} CPPFLAGS+= -D__daddr_t=int32_t -CPPFLAGS+= -DMIPS_KSEG1_START=0xa000 -AFLAGS= -D_LOCORE -mno-abicalls +AFLAGS= -D_LOCORE -mno-abicalls -DMIPS_KSEG1_START=0xa000 LIBS = ${COMMON}/romcalls.o LIBS+= ${COMMON}/lib/sa/libsa.a
CVS commit: src/sys/arch/newsmips
Module Name:src Committed By: thorpej Date: Fri Aug 21 04:03:01 UTC 2009 Modified Files: src/sys/arch/newsmips/conf: files.newsmips src/sys/arch/newsmips/newsmips: bus.c Log Message: Use bus_dmamem_common. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/newsmips/conf/files.newsmips cvs rdiff -u -r1.28 -r1.29 src/sys/arch/newsmips/newsmips/bus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/conf/files.newsmips diff -u src/sys/arch/newsmips/conf/files.newsmips:1.26 src/sys/arch/newsmips/conf/files.newsmips:1.27 --- src/sys/arch/newsmips/conf/files.newsmips:1.26 Wed Feb 20 21:43:34 2008 +++ src/sys/arch/newsmips/conf/files.newsmips Fri Aug 21 04:03:01 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.newsmips,v 1.26 2008/02/20 21:43:34 drochner Exp $ +# $NetBSD: files.newsmips,v 1.27 2009/08/21 04:03:01 thorpej Exp $ # NEWSMIPS-specific configuration info @@ -96,6 +96,8 @@ file arch/newsmips/newsmips/cpu_cons.c file dev/cons.c +file common/bus_dma/bus_dmamem_common.c + file arch/mips/mips/softintr.c # Index: src/sys/arch/newsmips/newsmips/bus.c diff -u src/sys/arch/newsmips/newsmips/bus.c:1.28 src/sys/arch/newsmips/newsmips/bus.c:1.29 --- src/sys/arch/newsmips/newsmips/bus.c:1.28 Wed Jun 4 12:41:41 2008 +++ src/sys/arch/newsmips/newsmips/bus.c Fri Aug 21 04:03:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bus.c,v 1.28 2008/06/04 12:41:41 ad Exp $ */ +/* $NetBSD: bus.c,v 1.29 2009/08/21 04:03:01 thorpej Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.28 2008/06/04 12:41:41 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.29 2009/08/21 04:03:01 thorpej Exp $"); #include #include @@ -45,6 +45,8 @@ #include #include +#include + #include #include @@ -700,57 +702,11 @@ int flags) { extern paddr_t avail_start, avail_end; - vaddr_t curaddr, lastaddr; - psize_t high; - struct vm_page *m; - struct pglist mlist; - int curseg, error; - - /* Always round the size. */ - size = round_page(size); - - high = avail_end - PAGE_SIZE; - - /* - * Allocate pages from the VM system. - */ - error = uvm_pglistalloc(size, avail_start, high, alignment, boundary, - &mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0); - if (error) - return error; - /* - * Compute the location, size, and number of segments actually - * returned by the VM code. - */ - m = mlist.tqh_first; - curseg = 0; - lastaddr = segs[curseg].ds_addr = VM_PAGE_TO_PHYS(m); - segs[curseg].ds_len = PAGE_SIZE; - m = m->pageq.queue.tqe_next; - - for (; m != NULL; m = m->pageq.queue.tqe_next) { - curaddr = VM_PAGE_TO_PHYS(m); -#ifdef DIAGNOSTIC - if (curaddr < avail_start || curaddr >= high) { - printf("uvm_pglistalloc returned non-sensical" - " address 0x%lx\n", curaddr); - panic("_bus_dmamem_alloc"); - } -#endif - if (curaddr == (lastaddr + PAGE_SIZE)) - segs[curseg].ds_len += PAGE_SIZE; - else { - curseg++; - segs[curseg].ds_addr = curaddr; - segs[curseg].ds_len = PAGE_SIZE; - } - lastaddr = curaddr; - } - - *rsegs = curseg + 1; - - return 0; + return (_bus_dmamem_alloc_range_common(t, size, alignment, boundary, + segs, nsegs, rsegs, flags, + avail_start /*low*/, + avail_end - PAGE_SIZE /*high*/)); } /* @@ -760,25 +716,8 @@ void _bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs) { - struct vm_page *m; - bus_addr_t addr; - struct pglist mlist; - int curseg; - - /* - * Build a list of pages to free back to the VM system. - */ - TAILQ_INIT(&mlist); - for (curseg = 0; curseg < nsegs; curseg++) { - for (addr = segs[curseg].ds_addr; - addr < (segs[curseg].ds_addr + segs[curseg].ds_len); - addr += PAGE_SIZE) { - m = PHYS_TO_VM_PAGE(addr); - TAILQ_INSERT_TAIL(&mlist, m, pageq.queue); - } - } - uvm_pglistfree(&mlist); + _bus_dmamem_free_common(t, segs, nsegs); } /* @@ -789,11 +728,6 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, size_t size, void **kvap, int flags) { - vaddr_t va; - bus_addr_t addr; - int curseg; - const uvm_flag_t kmflags = - (flags & BUS_DMA_NOWAIT) != 0 ? UVM_KMF_NOWAIT : 0; /* * If we're only mapping 1 segment, and the address is lower than @@ -807,31 +741,8 @@ return 0; } - size = round_page(size); - - va = uvm_km_alloc(kernel_map, size, 0, UVM_KMF_VAONLY | kmflags); - - if (va == 0) - return ENOMEM; - - *kvap = (void *)va; - - for (curseg = 0; curseg < nsegs; curseg++) { - for (addr = segs[curseg].ds_addr; - addr < (segs[curseg].ds_addr + segs[curseg].ds_len); - addr += PAGE_SIZE, va += PAGE_SIZE, size -= PAGE_SIZE) { - if (size == 0) -panic("_bus_dmamem_map: size botch"); - pmap_enter(pmap_kernel(), va, addr, - VM_PROT_READ | VM_PROT_WRITE, - VM_PROT_READ | VM_PROT_WRITE | PMAP_WI
CVS commit: src/sys/arch/newsmips/apbus
Module Name:src Committed By: tsutsui Date: Fri Apr 17 14:48:17 UTC 2009 Modified Files: src/sys/arch/newsmips/apbus: if_tlp_ap.c Log Message: Split device_t/softc, use aprint_*(). To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/newsmips/apbus/if_tlp_ap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/apbus/if_tlp_ap.c diff -u src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.10 src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.11 --- src/sys/arch/newsmips/apbus/if_tlp_ap.c:1.10 Mon Apr 28 20:23:30 2008 +++ src/sys/arch/newsmips/apbus/if_tlp_ap.c Fri Apr 17 14:48:17 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tlp_ap.c,v 1.10 2008/04/28 20:23:30 martin Exp $ */ +/* $NetBSD: if_tlp_ap.c,v 1.11 2009/04/17 14:48:17 tsutsui Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tlp_ap.c,v 1.10 2008/04/28 20:23:30 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tlp_ap.c,v 1.11 2009/04/17 14:48:17 tsutsui Exp $"); #include #include @@ -78,10 +78,10 @@ bus_space_handle_t sc_cfsh; }; -static int tlp_ap_match(struct device *, struct cfdata *, void *); -static void tlp_ap_attach(struct device *, struct device *, void *); +static int tlp_ap_match(device_t, cfdata_t, void *); +static void tlp_ap_attach(device_t, device_t, void *); -CFATTACH_DECL(tlp_ap, sizeof(struct tulip_ap_softc), +CFATTACH_DECL_NEW(tlp_ap, sizeof(struct tulip_ap_softc), tlp_ap_match, tlp_ap_attach, NULL, NULL); static void tlp_ap_preinit(struct tulip_softc *); @@ -94,7 +94,7 @@ }; static int -tlp_ap_match(struct device *parent, struct cfdata *cf, void *aux) +tlp_ap_match(device_t parent, cfdata_t cf, void *aux) { struct apbus_attach_args *apa = aux; @@ -108,16 +108,18 @@ * Install interface into kernel networking data structures */ static void -tlp_ap_attach(struct device *parent, struct device *self, void *aux) +tlp_ap_attach(device_t parent, device_t self, void *aux) { - struct tulip_ap_softc *psc = (void *) self; + struct tulip_ap_softc *psc = device_private(self); struct tulip_softc *sc = &psc->sc_tulip; struct apbus_attach_args *apa = aux; uint8_t enaddr[ETHER_ADDR_LEN]; u_int intrmask; int i; - printf(" slot%d addr 0x%lx", apa->apa_slotno, apa->apa_hwbase); + sc->sc_dev = self; + + aprint_normal(" slot%d addr 0x%lx", apa->apa_slotno, apa->apa_hwbase); /* PCI configuration register */ psc->sc_cfst = 0; @@ -133,11 +135,11 @@ sc->sc_chip = TULIP_CHIP_21140; break; default: - printf(": unable to handle your board\n"); + aprint_error(": unable to handle your board\n"); return; } - printf(": %s Ethernet, pass %d.%d\n", + aprint_normal(": %s Ethernet, pass %d.%d\n", tlp_chip_names[sc->sc_chip], (sc->sc_rev >> 4) & 0xf, sc->sc_rev & 0xf); @@ -146,7 +148,7 @@ sc->sc_sh = apa->apa_hwbase + TLP_AP_CSR; sc->sc_dmat = apbus_dmatag_init(apa); if (sc->sc_dmat == NULL) { - printf("%s: cannot allocate memory\n", sc->sc_dev.dv_xname); + aprint_error_dev(self, "cannot allocate memory\n"); return; } @@ -202,7 +204,7 @@ TULIP_WRITE(sc, CSR_GPP, 0xcf); /* mask abort/DMA err */ if (tlp_read_srom(sc) == 0) { - printf("%s: srom read failed\n", sc->sc_dev.dv_xname); + aprint_error_dev(self, "srom read failed\n"); free(sc->sc_dmat, M_DEVBUF); return; }
CVS commit: src/sys/arch/newsmips/stand/bootxx
Module Name:src Committed By: tsutsui Date: Thu Apr 16 12:36:06 UTC 2009 Modified Files: src/sys/arch/newsmips/stand/bootxx: Makefile Log Message: Use mips/conf/stand.ldscript on link so that we can use objcopy(1) to create raw bootxx binary. Tested on NWS-5000X. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/newsmips/stand/bootxx/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/stand/bootxx/Makefile diff -u src/sys/arch/newsmips/stand/bootxx/Makefile:1.12 src/sys/arch/newsmips/stand/bootxx/Makefile:1.13 --- src/sys/arch/newsmips/stand/bootxx/Makefile:1.12 Wed Apr 15 17:15:13 2009 +++ src/sys/arch/newsmips/stand/bootxx/Makefile Thu Apr 16 12:36:06 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2009/04/15 17:15:13 tsutsui Exp $ +# $NetBSD: Makefile,v 1.13 2009/04/16 12:36:06 tsutsui Exp $ S!= cd ${.CURDIR}/../../../..; pwd @@ -14,7 +14,8 @@ COMMON!= cd ${.CURDIR}/../common && ${PRINTOBJDIR} -LINKFLAGS= -x -N -Ttext a0004000 -e _start +LDSCRIPT= ${S}/arch/mips/conf/stand.ldscript +LINKFLAGS= -x -N -Ttext a0004000 -T ${LDSCRIPT} -e _start CFLAGS= -Os -ffreestanding -mmemcpy -mno-abicalls -msoft-float -G 0 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith @@ -24,7 +25,7 @@ AFLAGS= -D_LOCORE -mno-abicalls CLEANFILES+= machine mips ${PROG}.sym -CLEANFILES+= ${PROG}.bin ${PROG}.tmp +CLEANFILES+= ${PROG}.bin LIBS= ${COMMON}/romcalls.o LIBS+= ${COMMON}/lib/sa/libsa.a ${COMMON}/lib/kern/libkern.a @@ -33,10 +34,7 @@ ${_MKTARGET_LINK} ${LD} ${LINKFLAGS} -o ${.TARGET}.sym ${OBJS} ${LIBS} ${SIZE} ${.TARGET}.sym -# XXX objcopy does not work for prog at KSEG -# ${OBJCOPY} -O binary ${.TARGET}.sym ${.TARGET} - ${STRIP} ${.TARGET}.sym -o ${.TARGET}.tmp - tail -c +177 ${.TARGET}.tmp > ${.TARGET}.bin + ${OBJCOPY} -O binary ${.TARGET}.sym ${.TARGET}.bin mv ${.TARGET}.bin ${.TARGET} .include
CVS commit: src/sys/arch/newsmips/stand
Module Name:src Committed By: tsutsui Date: Wed Apr 15 17:15:13 UTC 2009 Modified Files: src/sys/arch/newsmips/stand/boot: Makefile src/sys/arch/newsmips/stand/bootxx: Makefile src/sys/arch/newsmips/stand/common: Makefile Log Message: Use to create machine and ${MACHINE_ARCH} symlinks. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/newsmips/stand/boot/Makefile cvs rdiff -u -r1.11 -r1.12 src/sys/arch/newsmips/stand/bootxx/Makefile cvs rdiff -u -r1.10 -r1.11 src/sys/arch/newsmips/stand/common/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/stand/boot/Makefile diff -u src/sys/arch/newsmips/stand/boot/Makefile:1.19 src/sys/arch/newsmips/stand/boot/Makefile:1.20 --- src/sys/arch/newsmips/stand/boot/Makefile:1.19 Mon Jan 12 06:52:14 2009 +++ src/sys/arch/newsmips/stand/boot/Makefile Wed Apr 15 17:15:13 2009 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.19 2009/01/12 06:52:14 tsutsui Exp $ +# $NetBSD: Makefile,v 1.20 2009/04/15 17:15:13 tsutsui Exp $ -S= ${.CURDIR}/../../../.. +S!= cd ${.CURDIR}/../../../..; pwd PROG= boot SRCS= locore.S boot.c bootinfo.c devopen.c net.c netif_news.c @@ -23,7 +23,7 @@ CPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK CPPFLAGS+= -DSUN_BOOTPARAMS CPPFLAGS+= -D_STANDALONE #-DBOOT_DEBUG -CPPFLAGS+= -I${.CURDIR} -I${COMMON} -I${S} +CPPFLAGS+= -I${.CURDIR} -I. -I${S} CPPFLAGS+= -D__daddr_t=int32_t AFLAGS= -D_LOCORE -mno-abicalls @@ -39,4 +39,5 @@ -${SIZE} ${PROG}.elf ${OBJCOPY} -O binary ${PROG}.elf ${PROG} +.include .include Index: src/sys/arch/newsmips/stand/bootxx/Makefile diff -u src/sys/arch/newsmips/stand/bootxx/Makefile:1.11 src/sys/arch/newsmips/stand/bootxx/Makefile:1.12 --- src/sys/arch/newsmips/stand/bootxx/Makefile:1.11 Mon Jan 12 06:52:15 2009 +++ src/sys/arch/newsmips/stand/bootxx/Makefile Wed Apr 15 17:15:13 2009 @@ -1,4 +1,6 @@ -# $NetBSD: Makefile,v 1.11 2009/01/12 06:52:15 tsutsui Exp $ +# $NetBSD: Makefile,v 1.12 2009/04/15 17:15:13 tsutsui Exp $ + +S!= cd ${.CURDIR}/../../../..; pwd PROG= bootxx SRCS= start.S bootxx.c @@ -17,7 +19,7 @@ CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith CPPFLAGS+= -D_STANDALONE #-DBOOTXX_DEBUG -CPPFLAGS+= -nostdinc -I${COMMON} -I${.CURDIR}/../../../.. +CPPFLAGS+= -nostdinc -I. -I${S} AFLAGS= -D_LOCORE -mno-abicalls @@ -37,4 +39,5 @@ tail -c +177 ${.TARGET}.tmp > ${.TARGET}.bin mv ${.TARGET}.bin ${.TARGET} +.include .include Index: src/sys/arch/newsmips/stand/common/Makefile diff -u src/sys/arch/newsmips/stand/common/Makefile:1.10 src/sys/arch/newsmips/stand/common/Makefile:1.11 --- src/sys/arch/newsmips/stand/common/Makefile:1.10 Fri Apr 3 10:38:13 2009 +++ src/sys/arch/newsmips/stand/common/Makefile Wed Apr 15 17:15:13 2009 @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.10 2009/04/03 10:38:13 tsutsui Exp $ +# $NetBSD: Makefile,v 1.11 2009/04/15 17:15:13 tsutsui Exp $ WARNS?= 1 -S= ${.CURDIR}/../../../.. +S!= cd ${.CURDIR}/../../../..; pwd OBJS= romcalls.o @@ -25,17 +25,10 @@ SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_USE_LOADFILE=yes .include "${S}/lib/libsa/Makefile.inc" -.if !make(obj) && !make(clean) && !make(cleandir) -.BEGIN: - @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine - @[ -h mips ] || ln -s ${S}/arch/mips/include mips -.NOPATH: machine mips -.endif -CLEANFILES+= machine mips - realall: ${OBJS} ${KERNLIB} ${ZLIB} ${SALIB} # ln -s ${KERNLIB} # ln -s ${ZLIB} # ln -s ${SALIB} +.include .include
CVS commit: src/sys/arch/newsmips/include
Module Name:src Committed By: tsutsui Date: Fri Apr 10 13:29:30 UTC 2009 Modified Files: src/sys/arch/newsmips/include: intr.h Log Message: Include instead of for struct evcnt to avoid recursive dependency. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/newsmips/include/intr.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/newsmips/include/intr.h diff -u src/sys/arch/newsmips/include/intr.h:1.23 src/sys/arch/newsmips/include/intr.h:1.24 --- src/sys/arch/newsmips/include/intr.h:1.23 Mon Apr 28 20:23:30 2008 +++ src/sys/arch/newsmips/include/intr.h Fri Apr 10 13:29:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.h,v 1.23 2008/04/28 20:23:30 martin Exp $ */ +/* $NetBSD: intr.h,v 1.24 2009/04/10 13:29:30 tsutsui Exp $ */ /*- * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ #ifdef _KERNEL #ifndef _LOCORE -#include +#include #include extern const uint32_t ipl_sr_bits[_IPL_N];