svn commit: r213091 - head/sys/dev/hifn
Author: gonzo Date: Fri Sep 24 04:46:46 2010 New Revision: 213091 URL: http://svn.freebsd.org/changeset/base/213091 Log: - Do not place variables to memory allocated by busdma. pre/post ops might invalidate cache and hence effectively void validity of values Modified: head/sys/dev/hifn/hifn7751.c head/sys/dev/hifn/hifn7751var.h Modified: head/sys/dev/hifn/hifn7751.c == --- head/sys/dev/hifn/hifn7751.cFri Sep 24 02:41:52 2010 (r213090) +++ head/sys/dev/hifn/hifn7751.cFri Sep 24 04:46:46 2010 (r213091) @@ -1372,45 +1372,45 @@ hifn_alloc_slot(struct hifn_softc *sc, i { struct hifn_dma *dma = sc->sc_dma; - if (dma->cmdi == HIFN_D_CMD_RSIZE) { - dma->cmdi = 0; + if (sc->sc_cmdi == HIFN_D_CMD_RSIZE) { + sc->sc_cmdi = 0; dma->cmdr[HIFN_D_CMD_RSIZE].l = htole32(HIFN_D_VALID | HIFN_D_JUMP | HIFN_D_MASKDONEIRQ); HIFN_CMDR_SYNC(sc, HIFN_D_CMD_RSIZE, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } - *cmdp = dma->cmdi++; - dma->cmdk = dma->cmdi; + *cmdp = sc->sc_cmdi++; + sc->sc_cmdk = sc->sc_cmdi; - if (dma->srci == HIFN_D_SRC_RSIZE) { - dma->srci = 0; + if (sc->sc_srci == HIFN_D_SRC_RSIZE) { + sc->sc_srci = 0; dma->srcr[HIFN_D_SRC_RSIZE].l = htole32(HIFN_D_VALID | HIFN_D_JUMP | HIFN_D_MASKDONEIRQ); HIFN_SRCR_SYNC(sc, HIFN_D_SRC_RSIZE, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } - *srcp = dma->srci++; - dma->srck = dma->srci; + *srcp = sc->sc_srci++; + sc->sc_srck = sc->sc_srci; - if (dma->dsti == HIFN_D_DST_RSIZE) { - dma->dsti = 0; + if (sc->sc_dsti == HIFN_D_DST_RSIZE) { + sc->sc_dsti = 0; dma->dstr[HIFN_D_DST_RSIZE].l = htole32(HIFN_D_VALID | HIFN_D_JUMP | HIFN_D_MASKDONEIRQ); HIFN_DSTR_SYNC(sc, HIFN_D_DST_RSIZE, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } - *dstp = dma->dsti++; - dma->dstk = dma->dsti; + *dstp = sc->sc_dsti++; + sc->sc_dstk = sc->sc_dsti; - if (dma->resi == HIFN_D_RES_RSIZE) { - dma->resi = 0; + if (sc->sc_resi == HIFN_D_RES_RSIZE) { + sc->sc_resi = 0; dma->resr[HIFN_D_RES_RSIZE].l = htole32(HIFN_D_VALID | HIFN_D_JUMP | HIFN_D_MASKDONEIRQ); HIFN_RESR_SYNC(sc, HIFN_D_RES_RSIZE, BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); } - *resp = dma->resi++; - dma->resk = dma->resi; + *resp = sc->sc_resi++; + sc->sc_resk = sc->sc_resi; } static int @@ -1563,9 +1563,9 @@ hifn_init_dma(struct hifn_softc *sc) dma->resr[HIFN_D_RES_RSIZE].p = htole32(sc->sc_dma_physaddr + offsetof(struct hifn_dma, resr[0])); - dma->cmdu = dma->srcu = dma->dstu = dma->resu = 0; - dma->cmdi = dma->srci = dma->dsti = dma->resi = 0; - dma->cmdk = dma->srck = dma->dstk = dma->resk = 0; + sc->sc_cmdu = sc->sc_srcu = sc->sc_dstu = sc->sc_resu = 0; + sc->sc_cmdi = sc->sc_srci = sc->sc_dsti = sc->sc_resi = 0; + sc->sc_cmdk = sc->sc_srck = sc->sc_dstk = sc->sc_resk = 0; } /* @@ -1723,7 +1723,7 @@ hifn_dmamap_load_dst(struct hifn_softc * u_int32_t p, l; int idx, used = 0, i; - idx = dma->dsti; + idx = sc->sc_dsti; for (i = 0; i < dst->nsegs - 1; i++) { dma->dstr[idx].p = htole32(dst->segs[i].ds_addr); dma->dstr[idx].l = htole32(HIFN_D_VALID | @@ -1764,8 +1764,8 @@ hifn_dmamap_load_dst(struct hifn_softc * idx = hifn_dmamap_dstwrap(sc, idx); - dma->dsti = idx; - dma->dstu += used; + sc->sc_dsti = idx; + sc->sc_dstu += used; return (idx); } @@ -1792,7 +1792,7 @@ hifn_dmamap_load_src(struct hifn_softc * int idx, i; u_int32_t last = 0; - idx = dma->srci; + idx = sc->sc_srci; for (i = 0; i < src->nsegs; i++) { if (i == src->nsegs - 1) last = HIFN_D_LAST; @@ -1805,8 +1805,8 @@ hifn_dmamap_load_src(struct hifn_softc * idx = hifn_dmamap_srcwrap(sc, idx); } - dma->srci = idx; - dma->srcu += src->nsegs; + sc->sc_srci = idx; + sc->sc_srcu += src->nsegs; return (idx); } @@ -1840,13 +1840,13 @@ hifn_crypto( * NB: check this first since it's easy. */ HIFN_LOCK(sc); - if ((dma->cmdu + 1) > HIFN_D_CMD_RSIZE || - (dma->resu + 1) > HIFN_D_RES_RSIZE) { + if ((sc->sc_cmdu + 1) > HIFN_D_CMD_RSIZE || + (sc->sc_resu + 1) > HIFN_D_RES_RSIZE) { #ifdef HIFN_DEBUG if (hif
svn commit: r213237 - in head/sys: conf dev/gpio sys
Author: gonzo Date: Tue Sep 28 03:24:53 2010 New Revision: 213237 URL: http://svn.freebsd.org/changeset/base/213237 Log: Initial GPIO bus support. Includes: - GPIO bus controller interface - GPIO bus interface - Implementation of GPIO led(4) compatible device - Implementation of iic(4) bus over GPIO (author: Luiz Otavio O Souza) Tested by: Luiz Otavio O Souza, Alexandr Rybalko Added: head/sys/dev/gpio/ head/sys/dev/gpio/gpio_if.m (contents, props changed) head/sys/dev/gpio/gpiobus.c (contents, props changed) head/sys/dev/gpio/gpiobus_if.m (contents, props changed) head/sys/dev/gpio/gpiobusvar.h (contents, props changed) head/sys/dev/gpio/gpioc.c (contents, props changed) head/sys/dev/gpio/gpioiic.c (contents, props changed) head/sys/dev/gpio/gpioled.c (contents, props changed) head/sys/sys/gpio.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Tue Sep 28 01:36:01 2010(r213236) +++ head/sys/conf/files Tue Sep 28 03:24:53 2010(r213237) @@ -1010,6 +1010,14 @@ dev/fxp/if_fxp.c optional fxp inet dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci dev/gem/if_gem_sbus.c optional gem sbus +dev/gpio/gpiobus.c optional gpio \ + dependency "gpiobus_if.h" +dev/gpio/gpioc.c optional gpio \ + dependency "gpio_if.h" +dev/gpio/gpioiic.c optional gpioiic +dev/gpio/gpioled.c optional gpioled +dev/gpio/gpio_if.m optional gpio +dev/gpio/gpiobus_if.m optional gpio dev/hatm/if_hatm.c optional hatm pci dev/hatm/if_hatm_intr.coptional hatm pci dev/hatm/if_hatm_ioctl.c optional hatm pci Added: head/sys/dev/gpio/gpio_if.m == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/gpio_if.m Tue Sep 28 03:24:53 2010(r213237) @@ -0,0 +1,102 @@ +#- +# Copyright (c) 2009 Oleksandr Tymoshenko +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +#include +#include + +INTERFACE gpio; + +# +# Get total number of pins +# +METHOD int pin_max { + device_t dev; + int *npins; +}; + +# +# Set value of pin specifed by pin_num +# +METHOD int pin_set { + device_t dev; + uint32_t pin_num; + uint32_t pin_value; +}; + +# +# Get value of pin specifed by pin_num +# +METHOD int pin_get { + device_t dev; + uint32_t pin_num; + uint32_t *pin_value; +}; + +# +# Toggle value of pin specifed by pin_num +# +METHOD int pin_toggle { + device_t dev; + uint32_t pin_num; +}; + +# +# Get pin capabilities +# +METHOD int pin_getcaps { + device_t dev; + uint32_t pin_num; + uint32_t *caps; +}; + +# +# Get pin flags +# +METHOD int pin_getflags { + device_t dev; + uint32_t pin_num; + uint32_t *flags; +}; + +# +# Get pin name +# +METHOD int pin_getname { + device_t dev; + uint32_t pin_num; + char *name; +}; + +# +# Set current configuration and capabilities +# +METHOD int pin_setflags { + device_t dev; + uint32_t pin_num; + uint32_t flags; +}; Added: head/sys/dev/gpio/gpiobus.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/gpiobus.c Tue Sep 28 03:24:53 2010
svn commit: r213238 - in head/usr.sbin: . gpioctl
Author: gonzo Date: Tue Sep 28 03:28:20 2010 New Revision: 213238 URL: http://svn.freebsd.org/changeset/base/213238 Log: Add gpioctl(8). Utility for configuring/accessing GPIO pins Added: head/usr.sbin/gpioctl/ head/usr.sbin/gpioctl/Makefile (contents, props changed) head/usr.sbin/gpioctl/gpioctl.8 (contents, props changed) head/usr.sbin/gpioctl/gpioctl.c (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile == --- head/usr.sbin/Makefile Tue Sep 28 03:24:53 2010(r213237) +++ head/usr.sbin/Makefile Tue Sep 28 03:28:20 2010(r213238) @@ -27,6 +27,7 @@ SUBDIR= adduser \ fwcontrol \ getfmac \ getpmac \ + gpioctl \ gstat \ i2c \ ifmcstat \ Added: head/usr.sbin/gpioctl/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/gpioctl/Makefile Tue Sep 28 03:28:20 2010 (r213238) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +PROG= gpioctl +MAN= gpioctl.8 + +.include Added: head/usr.sbin/gpioctl/gpioctl.8 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/gpioctl/gpioctl.8 Tue Sep 28 03:28:20 2010 (r213238) @@ -0,0 +1,124 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\"The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\"must display the following acknowledgement: +.\"This product includes software developed by the University of +.\"California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\"may be used to endorse or promote products derived from this software +.\"without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd September 27, 2010 +.Dt GPIOCTL 1 +.Os +.Sh NAME +.Nm gpioctl +.Nd GPIO control utility +.Sh SYNOPSIS +.Nm +.Cm -l +.Fl f Ar ctldev +.Op Fl v +.Nm +.Cm -t +.Fl f Ar ctldev +.Ar pin +.Nm +.Cm -c +.Fl f Ar ctldev +.Ar pin +.Ar flag +.Op flag ... +.Nm +.Cm -f Ar ctldev +.Ar pin +.Ar [0|1] +.Sh DESCRIPTION +The +.Nm +utility could be used to manage GPIO pins from userland and list available pins. +.Pp +The options are as follows: +.Bl -tag -width ".Fl f Ar ctldev" +.It Fl c Ar pin Ar flag Op flag ... +Configure pin by setting provided flags. The following flags are currently defined: +.Bl -tag -offset indent -width ".Cm PULSE" +.It Cm IN +Input pin +.It Cm OUT +Output pin +.It Cm OD +Open drain pin +.It Cm PP +Push pull pin +.It Cm TS +Tristate pin +.It Cm PU +Pull-up pin +.It Cm PD +Pull-down pin +.It Cm II +Inverted input pin +.It Cm IO +Inverted output pin +.El +.It Fl f Ar ctldev +GPIO controller device to use +.It Fl l +list available pins +.It Fl t Ar pin +toggle value of provided pin number +.It Fl v +be verbose: for each listed pin print current configuration +.El +.Sh EXAMPLES +.Pp +.Bl -bullet +.It +List pins available on GPIO controller defined by device /dev/gpioctl0 +.Pp +gpioctl -f /dev/gpioctl0 -l +.It +Set the value of pin 12 to 1 +.Pp +gpioctl -f /dev/gpioctl0 12 1 +.It +Configure pin 12 to be input pin +.Pp +gpioctl -f /dev
svn commit: r213239 - head/sys/mips/atheros
Author: gonzo Date: Tue Sep 28 03:31:34 2010 New Revision: 213239 URL: http://svn.freebsd.org/changeset/base/213239 Log: Add AR71XX GPIO bus driver. Added: head/sys/mips/atheros/ar71xx_gpio.c (contents, props changed) head/sys/mips/atheros/ar71xx_gpiovar.h (contents, props changed) Modified: head/sys/mips/atheros/ar71xxreg.h head/sys/mips/atheros/files.ar71xx Added: head/sys/mips/atheros/ar71xx_gpio.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/atheros/ar71xx_gpio.c Tue Sep 28 03:31:34 2010 (r213239) @@ -0,0 +1,446 @@ +/*- + * Copyright (c) 2009, Oleksandr Tymoshenko + * Copyright (c) 2009, Luiz Otavio O Souza. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice unmodified, this list of conditions, and the following + *disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * GPIO driver for AR71xx + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "gpio_if.h" + +#defineDEFAULT_CAPS(GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) + +struct ar71xx_gpio_pin { + const char *name; + int pin; + int flags; +}; + +static struct ar71xx_gpio_pin ar71xx_gpio_pins[] = { + { "RFled", 2, GPIO_PIN_OUTPUT}, + { "SW4", 8, GPIO_PIN_INPUT}, + { NULL, 0, 0}, +}; + +/* + * Helpers + */ +static void ar71xx_gpio_function_enable(struct ar71xx_gpio_softc *sc, +uint32_t mask); +static void ar71xx_gpio_function_disable(struct ar71xx_gpio_softc *sc, +uint32_t mask); +static void ar71xx_gpio_pin_configure(struct ar71xx_gpio_softc *sc, +struct gpio_pin *pin, uint32_t flags); + +/* + * Driver stuff + */ +static int ar71xx_gpio_probe(device_t dev); +static int ar71xx_gpio_attach(device_t dev); +static int ar71xx_gpio_detach(device_t dev); +static int ar71xx_gpio_filter(void *arg); +static void ar71xx_gpio_intr(void *arg); + +/* + * GPIO interface + */ +static int ar71xx_gpio_pin_max(device_t dev, int *maxpin); +static int ar71xx_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps); +static int ar71xx_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t +*flags); +static int ar71xx_gpio_pin_getname(device_t dev, uint32_t pin, char *name); +static int ar71xx_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags); +static int ar71xx_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value); +static int ar71xx_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val); +static int ar71xx_gpio_pin_toggle(device_t dev, uint32_t pin); + +static void +ar71xx_gpio_function_enable(struct ar71xx_gpio_softc *sc, uint32_t mask) +{ + GPIO_LOCK(sc); + GPIO_SET_BITS(sc, AR71XX_GPIO_FUNCTION, mask); + GPIO_UNLOCK(sc); +} + +static void +ar71xx_gpio_function_disable(struct ar71xx_gpio_softc *sc, uint32_t mask) +{ + GPIO_LOCK(sc); + GPIO_CLEAR_BITS(sc, AR71XX_GPIO_FUNCTION, mask); + GPIO_UNLOCK(sc); +} + +static void +ar71xx_gpio_pin_configure(struct ar71xx_gpio_softc *sc, struct gpio_pin *pin, +unsigned int flags) +{ + uint32_t mask; + + mask = 1 << pin->gp_pin; + GPIO_LOCK(sc); + + /* +* Manage input/output +*/ + if (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) { + pin->gp_flags &= ~(GPIO_PIN_INPUT|GPIO_PIN_OUTPUT); + if (flags & GPIO_PIN_OUTPUT) { + pin->gp_flags |= GPIO_PIN_OUTPUT; + GPIO_SET_BITS(sc, AR71XX_GPIO_OE, mask); + } +
svn commit: r213240 - head/sys/mips/conf
Author: gonzo Date: Tue Sep 28 03:34:51 2010 New Revision: 213240 URL: http://svn.freebsd.org/changeset/base/213240 Log: Add GPIO bus to config and hints. Also add sample gpioled device. Modified: head/sys/mips/conf/AR71XX head/sys/mips/conf/AR71XX.hints Modified: head/sys/mips/conf/AR71XX == --- head/sys/mips/conf/AR71XX Tue Sep 28 03:31:34 2010(r213239) +++ head/sys/mips/conf/AR71XX Tue Sep 28 03:34:51 2010(r213240) @@ -74,6 +74,9 @@ options USB_EHCI_BIG_ENDIAN_DESC device ohci device ehci +device gpio +device gpioled + device spibus device ar71xx_spi device mx25l Modified: head/sys/mips/conf/AR71XX.hints == --- head/sys/mips/conf/AR71XX.hints Tue Sep 28 03:31:34 2010 (r213239) +++ head/sys/mips/conf/AR71XX.hints Tue Sep 28 03:34:51 2010 (r213240) @@ -47,6 +47,18 @@ hint.arge.1.fduplex=1 # Uncomment this hint for RS (not PRO) # hint.arge.0.phymask=7 +# GPIO +hint.gpio.0.at="apb0" +hint.gpio.0.maddr=0x1804 +hint.gpio.0.msize=0x1000 +hint.gpio.0.irq=2 + +# RF led +hint.gpioled.0.at="gpiobus0" +hint.gpioled.0.name="rf" +# pin 2 +hint.gpioled.0.pins=0x0004 + # SPI flash hint.spi.0.at="nexus0" hint.spi.0.maddr=0x1f00 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213277 - head/sys/dev/gpio
Author: gonzo Date: Wed Sep 29 20:53:33 2010 New Revision: 213277 URL: http://svn.freebsd.org/changeset/base/213277 Log: Fix legal staff in GPIO sources: - license clause now contains "AUTHOR AND CONTRIBUTORS" instead of just "AUTHOR" - Add license/copyright to gpioc.c Spotted by: Edward Tomasz Napierala, Andrew Turner Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/gpioc.c head/sys/dev/gpio/gpioiic.c head/sys/dev/gpio/gpioled.c Modified: head/sys/dev/gpio/gpiobus.c == --- head/sys/dev/gpio/gpiobus.c Wed Sep 29 18:41:47 2010(r213276) +++ head/sys/dev/gpio/gpiobus.c Wed Sep 29 20:53:33 2010(r213277) @@ -11,16 +11,17 @@ *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include Modified: head/sys/dev/gpio/gpiobusvar.h == --- head/sys/dev/gpio/gpiobusvar.h Wed Sep 29 18:41:47 2010 (r213276) +++ head/sys/dev/gpio/gpiobusvar.h Wed Sep 29 20:53:33 2010 (r213277) @@ -11,16 +11,17 @@ *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * * $FreeBSD$ * Modified: head/sys/dev/gpio/gpioc.c == --- head/sys/dev/gpio/gpioc.c Wed Sep 29 18:41:47 2010(r213276) +++ head/sys/dev/gpio/gpioc.c Wed Sep 29 20:53:33 2010 (r213277) @@ -1,3 +1,29 @@ +/*- + * Copyright (c) 2009 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without
svn commit: r213278 - head/sys/mips/atheros
Author: gonzo Date: Wed Sep 29 21:01:16 2010 New Revision: 213278 URL: http://svn.freebsd.org/changeset/base/213278 Log: AR71XX_GPIO_* defines were introduced by adrian@ a while ago, remove duplicated. Modified: head/sys/mips/atheros/ar71xxreg.h Modified: head/sys/mips/atheros/ar71xxreg.h == --- head/sys/mips/atheros/ar71xxreg.h Wed Sep 29 20:53:33 2010 (r213277) +++ head/sys/mips/atheros/ar71xxreg.h Wed Sep 29 21:01:16 2010 (r213278) @@ -160,21 +160,6 @@ #defineGPIO_FUNC_USB_OC_EN (1 << 4) #defineGPIO_FUNC_USB_CLK_EN(0) -#defineAR71XX_GPIO_BASE0x1804 -#defineAR71XX_GPIO_OE 0x00 -#defineAR71XX_GPIO_IN 0x04 -#defineAR71XX_GPIO_OUT 0x08 -#defineAR71XX_GPIO_SET 0x0c -#defineAR71XX_GPIO_CLEAR 0x10 -#defineAR71XX_GPIO_INT 0x14 -#defineAR71XX_GPIO_INT_TYPE0x18 -#defineAR71XX_GPIO_INT_POLARITY0x1c -#defineAR71XX_GPIO_INT_PENDING 0x20 -#defineAR71XX_GPIO_INT_MASK0x24 -#defineAR71XX_GPIO_FUNCTION0x28 -#defineGPIO_SPI_CS2_EN (1 << 13) -#defineGPIO_SPI_CS1_EN (1 << 12) - #defineAR71XX_BASE_FREQ4000 #defineAR71XX_PLL_CPU_BASE 0x1805 #defineAR71XX_PLL_CPU_CONFIG 0x1805 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213286 - head/sys/mips/atheros
Author: gonzo Date: Wed Sep 29 23:06:41 2010 New Revision: 213286 URL: http://svn.freebsd.org/changeset/base/213286 Log: - Fix values of CS1_EN and CS2_EN flags - Unbreak kernel build by fixing naming convention of GPIO_FUNC flags Spotted by: Luiz Otavio O Souza, Andrew Thompson Modified: head/sys/mips/atheros/ar71xx_gpio.c head/sys/mips/atheros/ar71xxreg.h Modified: head/sys/mips/atheros/ar71xx_gpio.c == --- head/sys/mips/atheros/ar71xx_gpio.c Wed Sep 29 22:59:49 2010 (r213285) +++ head/sys/mips/atheros/ar71xx_gpio.c Wed Sep 29 23:06:41 2010 (r213286) @@ -375,8 +375,8 @@ ar71xx_gpio_attach(device_t dev) } sc->dev = dev; - ar71xx_gpio_function_enable(sc, GPIO_SPI_CS1_EN); - ar71xx_gpio_function_enable(sc, GPIO_SPI_CS2_EN); + ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS1_EN); + ar71xx_gpio_function_enable(sc, GPIO_FUNC_SPI_CS2_EN); /* Configure all pins as input */ /* disable interrupts for all pins */ GPIO_WRITE(sc, AR71XX_GPIO_INT_MASK, 0); @@ -406,8 +406,8 @@ ar71xx_gpio_detach(device_t dev) KASSERT(mtx_initialized(&sc->gpio_mtx), ("gpio mutex not initialized")); - ar71xx_gpio_function_disable(sc, GPIO_SPI_CS1_EN); - ar71xx_gpio_function_disable(sc, GPIO_SPI_CS2_EN); + ar71xx_gpio_function_disable(sc, GPIO_FUNC_SPI_CS1_EN); + ar71xx_gpio_function_disable(sc, GPIO_FUNC_SPI_CS2_EN); bus_generic_detach(dev); if (sc->gpio_mem_res) Modified: head/sys/mips/atheros/ar71xxreg.h == --- head/sys/mips/atheros/ar71xxreg.h Wed Sep 29 22:59:49 2010 (r213285) +++ head/sys/mips/atheros/ar71xxreg.h Wed Sep 29 23:06:41 2010 (r213286) @@ -151,11 +151,10 @@ #defineAR71XX_GPIO_FUNCTION0x28 #defineGPIO_FUNC_STEREO_EN (1 << 17) #defineGPIO_FUNC_SLIC_EN (1 << 16) -#defineGPIO_FUNC_SPI_CS2_EN(1 << 15) +#defineGPIO_FUNC_SPI_CS2_EN(1 << 13) /* CS2 is shared with GPIO_1 */ -#defineGPIO_FUNC_SPI_CS1_EN(1 << 14) +#defineGPIO_FUNC_SPI_CS1_EN(1 << 12) /* CS1 is shared with GPIO_0 */ -#defineGPIO_FUNC_SPI_EN(1 << 13) #defineGPIO_FUNC_UART_EN (1 << 8) #defineGPIO_FUNC_USB_OC_EN (1 << 4) #defineGPIO_FUNC_USB_CLK_EN(0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213462 - in head: share/mk usr.sbin
Author: gonzo Date: Tue Oct 5 21:19:20 2010 New Revision: 213462 URL: http://svn.freebsd.org/changeset/base/213462 Log: - Introduce WITH_GPIO knob and disable building gpioctl by default. Most systems do not need it. Modified: head/share/mk/bsd.own.mk head/usr.sbin/Makefile Modified: head/share/mk/bsd.own.mk == --- head/share/mk/bsd.own.mkTue Oct 5 20:56:08 2010(r213461) +++ head/share/mk/bsd.own.mkTue Oct 5 21:19:20 2010(r213462) @@ -422,6 +422,7 @@ MK_${var}:= yes BSD_GREP \ ${_clang_no} \ FDT \ +GPIO \ HESIOD \ IDEA .if defined(WITH_${var}) && defined(WITHOUT_${var}) Modified: head/usr.sbin/Makefile == --- head/usr.sbin/Makefile Tue Oct 5 20:56:08 2010(r213461) +++ head/usr.sbin/Makefile Tue Oct 5 21:19:20 2010(r213462) @@ -27,7 +27,6 @@ SUBDIR= adduser \ fwcontrol \ getfmac \ getpmac \ - gpioctl \ gstat \ i2c \ ifmcstat \ @@ -160,6 +159,10 @@ SUBDIR+= freebsd-update SUBDIR+= gssd .endif +.if ${MK_GPIO} != "no" +SUBDIR+= gpioctl +.endif + .if ${MK_INET6} != "no" SUBDIR+= faithd SUBDIR+= ip6addrctl ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r213238 - in head/usr.sbin: . gpioctl
On 9/28/2010 12:28 AM, Niclas Zeising wrote: This should probably be made conditional on MK_GPIO. Done ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r213463 - head/tools/build/options
Author: gonzo Date: Tue Oct 5 22:26:01 2010 New Revision: 213463 URL: http://svn.freebsd.org/changeset/base/213463 Log: - Add WITH_GPIO entry to src.conf(5) man page Added: head/tools/build/options/WITH_GPIO (contents, props changed) Added: head/tools/build/options/WITH_GPIO == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GPIO Tue Oct 5 22:26:01 2010 (r213463) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build gpioctl(8) as part of the base system. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214651 - head/contrib/gdb/gdb
Author: gonzo Date: Tue Nov 2 01:24:49 2010 New Revision: 214651 URL: http://svn.freebsd.org/changeset/base/214651 Log: Fix reading of .debug_line on MIPS64, big-endian: read_initial_length detects pointer size by checking first 4 bytes of .debug_line and stores it in struct comp_unit_head * passed to it as second argument. By passing NULL to a read_initial_length we ignore actual pointer size (8 bytes) and use default (4 bytes) which results in wrong offsets of header fields. Modified: head/contrib/gdb/gdb/dwarf2read.c Modified: head/contrib/gdb/gdb/dwarf2read.c == --- head/contrib/gdb/gdb/dwarf2read.c Mon Nov 1 22:11:18 2010 (r214650) +++ head/contrib/gdb/gdb/dwarf2read.c Tue Nov 2 01:24:49 2010 (r214651) @@ -5178,7 +5178,7 @@ dwarf_decode_line_header (unsigned int o line_ptr = dwarf_line_buffer + offset; /* read in the header */ - lh->total_length = read_initial_length (abfd, line_ptr, NULL, &bytes_read); + lh->total_length = read_initial_length (abfd, line_ptr, &cu->header, &bytes_read); line_ptr += bytes_read; if (line_ptr + lh->total_length > dwarf_line_buffer + dwarf_line_size) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214652 - head/contrib/gdb/gdb
Author: gonzo Date: Tue Nov 2 01:26:21 2010 New Revision: 214652 URL: http://svn.freebsd.org/changeset/base/214652 Log: - Add ELF core for FreeBSD/mips - Register all known cores in init function Modified: head/contrib/gdb/gdb/mipsfbsd-tdep.c Modified: head/contrib/gdb/gdb/mipsfbsd-tdep.c == --- head/contrib/gdb/gdb/mipsfbsd-tdep.cTue Nov 2 01:24:49 2010 (r214651) +++ head/contrib/gdb/gdb/mipsfbsd-tdep.cTue Nov 2 01:26:21 2010 (r214652) @@ -187,6 +187,14 @@ static struct core_fns mipsfbsd_core_fns NULL /* next */ }; +static struct core_fns mipsfbsd_elfcore_fns = +{ + bfd_target_elf_flavour, /* core_flavour */ + default_check_format,/* check_format */ + default_core_sniffer,/* core_sniffer */ + fetch_elfcore_registers, /* core_read_registers */ + NULL /* next */ +}; /* * MIPSFBSD Offsets @@ -576,4 +584,6 @@ _initialize_mipsfbsd_tdep (void) { gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_FREEBSD_ELF, mipsfbsd_init_abi); + add_core_fns (&mipsfbsd_core_fns); + add_core_fns (&mipsfbsd_elfcore_fns); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r227985 - head
Author: gonzo Date: Sat Nov 26 00:30:39 2011 New Revision: 227985 URL: http://svn.freebsd.org/changeset/base/227985 Log: Provide proper error message when trying to build xdev, xdev-build or xdev-install targets without either XDEV or XDEV_ARCH defined. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Fri Nov 25 23:45:29 2011(r227984) +++ head/Makefile.inc1 Sat Nov 26 00:30:39 2011(r227985) @@ -1639,4 +1639,7 @@ _xi-links: ln -sf ../../${XDTP}/usr/bin/$$i \ ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ done +.else +xdev xdev-buil xdev-install: + @echo "*** Error: Both XDEV and XDEV_ARCH must be defined for \"${.TARGET}\" target" .endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228088 - head/sys/mips/cavium
Author: gonzo Date: Mon Nov 28 19:28:29 2011 New Revision: 228088 URL: http://svn.freebsd.org/changeset/base/228088 Log: - Copy base MAC address from bootinfo descriptor to sysinfo struct Reviewed by: Andrew Duane Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c == --- head/sys/mips/cavium/octeon_machdep.c Mon Nov 28 19:14:38 2011 (r228087) +++ head/sys/mips/cavium/octeon_machdep.c Mon Nov 28 19:28:29 2011 (r228088) @@ -569,6 +569,8 @@ octeon_process_app_desc_ver_6(void) octeon_bootinfo->board_rev_major, octeon_bootinfo->board_rev_minor, octeon_bootinfo->eclock_hz); + memcpy(cvmx_sysinfo_get()->mac_addr_base, octeon_bootinfo->mac_addr_base, 6); + cvmx_sysinfo_get()->mac_addr_count = octeon_bootinfo->mac_addr_count; } static void ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228091 - head/sys/mips/mips
Author: gonzo Date: Mon Nov 28 19:48:04 2011 New Revision: 228091 URL: http://svn.freebsd.org/changeset/base/228091 Log: - Fix backtrace for MIPS64 platform Modified: head/sys/mips/mips/db_trace.c Modified: head/sys/mips/mips/db_trace.c == --- head/sys/mips/mips/db_trace.c Mon Nov 28 19:45:47 2011 (r228090) +++ head/sys/mips/mips/db_trace.c Mon Nov 28 19:48:04 2011 (r228091) @@ -30,7 +30,7 @@ extern char edata[]; /* * A function using a stack frame has the following instruction as the first - * one: addiu sp,sp,- + * one: [d]addiu sp,sp,- * * We make use of this to detect starting address of a function. This works * better than using 'j ra' instruction to signify end of the previous @@ -39,7 +39,8 @@ extern char edata[]; * * XXX the abi does not require that the addiu instruction be the first one. */ -#defineMIPS_START_OF_FUNCTION(ins) (((ins) & 0x8000) == 0x27bd8000) +#defineMIPS_START_OF_FUNCTION(ins) ins) & 0x8000) == 0x27bd8000) \ + || (((ins) & 0x8000) == 0x67bd8000)) /* * MIPS ABI 3.0 requires that all functions return using the 'j ra' instruction @@ -329,6 +330,8 @@ loop: case OP_ADDI: case OP_ADDIU: + case OP_DADDI: + case OP_DADDIU: /* look for stack pointer adjustment */ if (i.IType.rs != 29 || i.IType.rt != 29) break; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228294 - stable/8/share/mk
Author: gonzo Date: Mon Dec 5 23:29:27 2011 New Revision: 228294 URL: http://svn.freebsd.org/changeset/base/228294 Log: Unbreak Modified: stable/8/share/mk/bsd.cpu.mk Modified: stable/8/share/mk/bsd.cpu.mk == --- stable/8/share/mk/bsd.cpu.mkMon Dec 5 22:55:52 2011 (r228293) +++ stable/8/share/mk/bsd.cpu.mkMon Dec 5 23:29:27 2011 (r228294) @@ -242,11 +242,11 @@ LD += -EB .if ${MACHINE_ARCH} == "mips" . if defined(TARGET_BIG_ENDIAN) CFLAGS += -EB -LDFLAGS += -Wl,-EB +LDFLAGS += -EB LD += -EB . else CFLAGS += -EL -LDFLAGS += -Wl,-EL +LDFLAGS += -EL LD += -EL . endif CFLAGS += -msoft-float -G0 -mno-dsp -mabicalls ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228295 - stable/8/sys/mips/mips
Author: gonzo Date: Tue Dec 6 00:05:12 2011 New Revision: 228295 URL: http://svn.freebsd.org/changeset/base/228295 Log: Unbreak build: add missing coma Modified: stable/8/sys/mips/mips/elf_machdep.c Modified: stable/8/sys/mips/mips/elf_machdep.c == --- stable/8/sys/mips/mips/elf_machdep.cMon Dec 5 23:29:27 2011 (r228294) +++ stable/8/sys/mips/mips/elf_machdep.cTue Dec 6 00:05:12 2011 (r228295) @@ -78,7 +78,7 @@ struct sysentvec elf64_freebsd_sysvec = .sv_setregs = exec_setregs, .sv_fixlimit= NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_LP64 + .sv_flags = SV_ABI_FREEBSD | SV_LP64, .sv_schedtail = NULL, }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r228294 - stable/8/share/mk
Sorry for short comment. It was editor glitch :( Proper comment is: Unbreak 8-STABLE build. LDFLAGS is used as an argument for both ld (in kmod.mk) and cc when it acts as a linker. In latter case cc properly passes byte-order settings to ld so there is no need for -Wl, part. On 05/12/2011 3:29 PM, Oleksandr Tymoshenko wrote: Author: gonzo Date: Mon Dec 5 23:29:27 2011 New Revision: 228294 URL: http://svn.freebsd.org/changeset/base/228294 Log: Unbreak Modified: stable/8/share/mk/bsd.cpu.mk Modified: stable/8/share/mk/bsd.cpu.mk == --- stable/8/share/mk/bsd.cpu.mkMon Dec 5 22:55:52 2011 (r228293) +++ stable/8/share/mk/bsd.cpu.mkMon Dec 5 23:29:27 2011 (r228294) @@ -242,11 +242,11 @@ LD += -EB .if ${MACHINE_ARCH} == "mips" . if defined(TARGET_BIG_ENDIAN) CFLAGS += -EB -LDFLAGS += -Wl,-EB +LDFLAGS += -EB LD += -EB . else CFLAGS += -EL -LDFLAGS += -Wl,-EL +LDFLAGS += -EL LD += -EL . endif CFLAGS += -msoft-float -G0 -mno-dsp -mabicalls ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228296 - stable/8/sys/mips/include
Author: gonzo Date: Tue Dec 6 00:13:40 2011 New Revision: 228296 URL: http://svn.freebsd.org/changeset/base/228296 Log: Unbreak mips64 build by MFCing r202031 that fixes _ALIGN macros Modified: stable/8/sys/mips/include/param.h Modified: stable/8/sys/mips/include/param.h == --- stable/8/sys/mips/include/param.h Tue Dec 6 00:05:12 2011 (r228295) +++ stable/8/sys/mips/include/param.h Tue Dec 6 00:13:40 2011 (r228296) @@ -77,11 +77,11 @@ /* * Round p (pointer or byte index) up to a correctly-aligned value for all - * data types (int, long, ...). The result is u_int and must be cast to + * data types (int, long, ...). The result is u_long and must be cast to * any desired pointer type. */ #define_ALIGNBYTES 7 -#define_ALIGN(p) (((u_int)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) +#define_ALIGN(p) (((u_long)(p) + _ALIGNBYTES) &~ _ALIGNBYTES) #defineALIGNBYTES _ALIGNBYTES #defineALIGN(p)_ALIGN(p) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228337 - in stable/8: contrib/binutils/bfd contrib/binutils/gas/config contrib/binutils/include/elf contrib/binutils/include/opcode contrib/binutils/opcodes contrib/gcc/config contrib/...
Author: gonzo Date: Thu Dec 8 00:47:22 2011 New Revision: 228337 URL: http://svn.freebsd.org/changeset/base/228337 Log: MFC r208737 (required by OCTEON* kernels): Add/improve mips64r2, Octeon, n32 and n64 support in the toolchain. o) Add TARGET_ABI to the MIPS toolchain build process. This sets the default ABI to one of o32, n32 or n64. If it is not set, o32 is assumed as that is the current default. o) Set the default GCC cpu type to any specified TARGET_CPUTYPE. This is necessary to have a working "cc" if e.g. mips64 is specified, as binutils will refuse to link objects using different ISAs in some cases. o) Add support for n32 and n64 ABIs to binutils and GCC. o) Add additional required libgcc2 stubs for n32 and n64. o) Add support for the "mips64r2" architecture to GCC. Add the "octeon" o) When static linking, wrap default libraries in --start-group and --end-group. This is required for static linking to work on n64 with the interdependencies between libraries there. This is what other OSes that support n64 seem to do, as well. o) Fix our GCC spec to define __mips64 for 64-bit targets, not __mips64__, the former being what libgcc, etc., check and the latter seemingly being a misspelling of a hand merge from a Linux spec. o) When no TARGET_CPUTYPE is specified at build time, make GCC take the default ISA from the ABI. Our old defaults were too liberal and assumed that 64-bit ABIs should default to the MIPS64 ISA and that 32-bit ABIs should default to the MIPS32 ISA, when we are supporting or will support some systems based on earlier 32-bit and 64-bit ISAs, most notably MIPS-III. o) Merge a new opcode file (and support code) from a later version of binutils and add flags and code necessary to support Octeon-specific instructions. This should also make merging opcodes for other modern architectures easier. No objections from: imp, jmallet, jchandra MFC after:18 months Added: stable/8/contrib/gcc/config/fixdfdi.c - copied unchanged from r208737, head/contrib/gcc/config/fixdfdi.c stable/8/contrib/gcc/config/fixsfdi.c - copied unchanged from r208737, head/contrib/gcc/config/fixsfdi.c stable/8/contrib/gcc/config/fixunsdfsi.c - copied unchanged from r208737, head/contrib/gcc/config/fixunsdfsi.c stable/8/contrib/gcc/config/fixunssfsi.c - copied unchanged from r208737, head/contrib/gcc/config/fixunssfsi.c stable/8/contrib/gcc/config/floatdidf.c - copied unchanged from r208737, head/contrib/gcc/config/floatdidf.c stable/8/contrib/gcc/config/floatdisf.c - copied unchanged from r208737, head/contrib/gcc/config/floatdisf.c stable/8/contrib/gcc/config/floatundidf.c - copied unchanged from r208737, head/contrib/gcc/config/floatundidf.c stable/8/contrib/gcc/config/floatundisf.c - copied unchanged from r208737, head/contrib/gcc/config/floatundisf.c Modified: stable/8/contrib/binutils/bfd/archures.c stable/8/contrib/binutils/bfd/bfd-in2.h stable/8/contrib/binutils/bfd/cpu-mips.c stable/8/contrib/binutils/bfd/elfxx-mips.c stable/8/contrib/binutils/gas/config/tc-mips.c stable/8/contrib/binutils/gas/config/tc-mips.h stable/8/contrib/binutils/include/elf/mips.h stable/8/contrib/binutils/include/opcode/mips.h stable/8/contrib/binutils/opcodes/mips-dis.c stable/8/contrib/binutils/opcodes/mips-opc.c stable/8/contrib/binutils/opcodes/mips16-opc.c stable/8/contrib/gcc/config/mips/freebsd.h stable/8/contrib/gcc/config/mips/mips.c stable/8/contrib/gcc/config/mips/mips.h stable/8/contrib/gcc/config/mips/mips.md stable/8/gnu/lib/libgcc/Makefile stable/8/gnu/lib/libgomp/Makefile stable/8/gnu/usr.bin/binutils/Makefile.inc0 stable/8/gnu/usr.bin/binutils/ld/Makefile.mips stable/8/gnu/usr.bin/binutils/libbfd/Makefile.mips stable/8/gnu/usr.bin/binutils/libbfd/bfd.h Directory Properties: stable/8/contrib/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/gnu/ (props changed) stable/8/gnu/lib/libgcc/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/binutils/ld/ (props changed) Modified: stable/8/contrib/binutils/bfd/archures.c == --- stable/8/contrib/binutils/bfd/archures.cWed Dec 7 23:20:14 2011 (r228336) +++ stable/8/contrib/binutils/bfd/archures.cThu Dec 8 00:47:22 2011 (r228337) @@ -1,6 +1,6 @@ /* BFD library support routines for architectures. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003 + 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Hacked by John Gilmore and Steve Chamberlain of Cygnus Support. @@ -18,7 +18,7 @@ You should have received a copy of the
svn commit: r228338 - stable/8/sys/mips/conf
Author: gonzo Date: Thu Dec 8 00:48:06 2011 New Revision: 228338 URL: http://svn.freebsd.org/changeset/base/228338 Log: Unbreak MALTA64 build by providing proper ldscript name Modified: stable/8/sys/mips/conf/MALTA64 Modified: stable/8/sys/mips/conf/MALTA64 == --- stable/8/sys/mips/conf/MALTA64 Thu Dec 8 00:47:22 2011 (r228337) +++ stable/8/sys/mips/conf/MALTA64 Thu Dec 8 00:48:06 2011 (r228338) @@ -21,7 +21,7 @@ ident MALTA makeoptionsARCH_FLAGS="-march=mips64 -mabi=64" makeoptionsMIPS_LITTLE_ENDIAN=defined -makeoptionsLDSCRIPT_NAME= ldscript.mips.mips64 +makeoptionsLDSCRIPT_NAME= ldscript.mips.64 optionsYAMON ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228339 - stable/8/sys/mips/conf
Author: gonzo Date: Thu Dec 8 00:48:47 2011 New Revision: 228339 URL: http://svn.freebsd.org/changeset/base/228339 Log: Add -march=octeon optoin for building OCTEON1-32 kernel Modified: stable/8/sys/mips/conf/OCTEON1-32 Modified: stable/8/sys/mips/conf/OCTEON1-32 == --- stable/8/sys/mips/conf/OCTEON1-32 Thu Dec 8 00:48:06 2011 (r228338) +++ stable/8/sys/mips/conf/OCTEON1-32 Thu Dec 8 00:48:47 2011 (r228339) @@ -24,7 +24,7 @@ ident OCTEON1 # Don't build any modules yet. makeoptionsMODULES_OVERRIDE="" makeoptionsTARGET_BIG_ENDIAN=defined -#makeoptions ARCH_FLAGS="-march=octeon" +makeoptionsARCH_FLAGS="-march=octeon" makeoptionsLDSCRIPT_NAME=ldscript.mips.octeon1.32 makeoptionsKERNLOADADDR=0x8100 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228340 - stable/8/sys/conf
Author: gonzo Date: Thu Dec 8 00:50:14 2011 New Revision: 228340 URL: http://svn.freebsd.org/changeset/base/228340 Log: Add ldscripts for OCTEON1 and OCTEON1-32 Added: - copied unchanged from r215938, head/sys/conf/ldscript.mips.octeon1.32 - copied unchanged from r215938, head/sys/conf/ldscript.mips.octeon1.64 Directory Properties: stable/8/sys/conf/ldscript.mips.octeon1.32 (props changed) stable/8/sys/conf/ldscript.mips.octeon1.64 (props changed) Copied: stable/8/sys/conf/ldscript.mips.octeon1.32 (from r215938, head/sys/conf/ldscript.mips.octeon1.32) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/conf/ldscript.mips.octeon1.32 Thu Dec 8 00:50:14 2011 (r228340, copy of r215938, head/sys/conf/ldscript.mips.octeon1.32) @@ -0,0 +1,60 @@ +/* $FreeBSD$ */ + +TARGET(elf32-tradbigmips) +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips") +OUTPUT_ARCH(mips) +ENTRY(_start) + __DYNAMIC = 0; +PROVIDE (_DYNAMIC = 0); + +SECTIONS { + . = KERNLOADADDR + SIZEOF_HEADERS; + + .text . : { + *(.text) + *(.dynamic) + etext = .; + _etext = .; + . = ALIGN(0x2000); + } + + .rodata ALIGN(0x2000) : { + _fdata = .; + *(.rodata) + . = ALIGN(32); + } + + .data . : { +_rwdata = .; + *(.data) + . = ALIGN(32); + CONSTRUCTORS; + } + + _gp = (. + 0x8000); + + .sdata . : { +_small_start = .; + *(.sdata) + . = ALIGN(32); + edata = .; + _edata = .; + } + + .sbss . : { + __bss_start = .; + _fbss = .; + *(.sbss) *(.scommon) +_small_end = .; + . = ALIGN(32); + } + + .bss . : { + *(.bss) + *(COMMON) + . = ALIGN(32); + _end = .; + end = .; + } + +} Copied: stable/8/sys/conf/ldscript.mips.octeon1.64 (from r215938, head/sys/conf/ldscript.mips.octeon1.64) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/conf/ldscript.mips.octeon1.64 Thu Dec 8 00:50:14 2011 (r228340, copy of r215938, head/sys/conf/ldscript.mips.octeon1.64) @@ -0,0 +1,65 @@ +/* $FreeBSD$ */ + +TARGET(elf64-tradbigmips) +OUTPUT_FORMAT("elf64-tradbigmips", "elf64-tradbigmips", "elf64-tradlittlemips") +OUTPUT_ARCH(mips) +ENTRY(_start) + __DYNAMIC = 0; +PROVIDE (_DYNAMIC = 0); + +PHDRS { + text PT_LOAD FLAGS(0x7); +} + +SECTIONS { + . = KERNLOADADDR + SIZEOF_HEADERS; + + .text : { + *(.text) + *(.dynamic) + etext = .; + _etext = .; + . = ALIGN(0x2000); + } : text + + . = ALIGN(0x2000); + .rodata : { + _fdata = .; + *(.rodata) + . = ALIGN(32); + } + + .data : { +_rwdata = .; + *(.data) + . = ALIGN(32); + CONSTRUCTORS; + } + + _gp = (. + 0x8000); + + .sdata : { +_small_start = .; + *(.sdata) + . = ALIGN(32); + edata = .; + _edata = .; + } : text + + .sbss : { + __bss_start = .; + _fbss = .; + *(.sbss) *(.scommon) +_small_end = .; + . = ALIGN(32); + } + + .bss : { + *(.bss) + *(COMMON) + . = ALIGN(32); + _end = .; + end = .; + } + +} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228341 - stable/8/sys/dev/ic
Author: gonzo Date: Thu Dec 8 00:56:23 2011 New Revision: 228341 URL: http://svn.freebsd.org/changeset/base/228341 Log: MFS r202062: Defintions for cavium uart MFC after:23 months Modified: stable/8/sys/dev/ic/ns16550.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/ic/ns16550.h == --- stable/8/sys/dev/ic/ns16550.h Thu Dec 8 00:50:14 2011 (r228340) +++ stable/8/sys/dev/ic/ns16550.h Thu Dec 8 00:56:23 2011 (r228341) @@ -52,6 +52,7 @@ #defineREG_IIR com_iir #defineIIR_IMASK 0xf #defineIIR_RXTOUT 0xc +#defineIIR_BUSY0x7 #defineIIR_RLS 0x6 #defineIIR_RXRDY 0x4 #defineIIR_TXRDY 0x2 @@ -181,6 +182,10 @@ #definecom_xoff1 6 /* XOFF 1 character (R/W) */ #definecom_xoff2 7 /* XOFF 2 character (R/W) */ +#define com_usr39 /* Octeon 16750/16550 Uart Status Reg */ +#define REG_USRcom_usr +#define USR_TXFIFO_NOTFULL 2/* Uart TX FIFO Not full */ + /* 16950 register #1. Access enabled by ACR[7]. Also requires !LCR[7]. */ #definecom_asr 1 /* additional status register (R[0-7]/W[0-1]) */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228853 - head/sys/mips/cavium
Author: gonzo Date: Fri Dec 23 22:10:55 2011 New Revision: 228853 URL: http://svn.freebsd.org/changeset/base/228853 Log: - Set CF physical address base in sysinfo structure Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c == --- head/sys/mips/cavium/octeon_machdep.c Fri Dec 23 20:59:58 2011 (r228852) +++ head/sys/mips/cavium/octeon_machdep.c Fri Dec 23 22:10:55 2011 (r228853) @@ -571,6 +571,8 @@ octeon_process_app_desc_ver_6(void) octeon_bootinfo->eclock_hz); memcpy(cvmx_sysinfo_get()->mac_addr_base, octeon_bootinfo->mac_addr_base, 6); cvmx_sysinfo_get()->mac_addr_count = octeon_bootinfo->mac_addr_count; + cvmx_sysinfo_get()->compact_flash_common_base_addr = + octeon_bootinfo->compact_flash_common_base_addr; } static void ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228854 - head/sys/dev/usb/controller
Author: gonzo Date: Sat Dec 24 00:22:21 2011 New Revision: 228854 URL: http://svn.freebsd.org/changeset/base/228854 Log: - Enable usbus on octusb Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c == --- head/sys/dev/usb/controller/usb_controller.cFri Dec 23 22:10:55 2011(r228853) +++ head/sys/dev/usb/controller/usb_controller.cSat Dec 24 00:22:21 2011(r228854) @@ -122,6 +122,7 @@ DRIVER_MODULE(usbus, xhci, usb_driver, u DRIVER_MODULE(usbus, at91_udp, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, musbotg, usb_driver, usb_devclass, 0, 0); DRIVER_MODULE(usbus, uss820, usb_driver, usb_devclass, 0, 0); +DRIVER_MODULE(usbus, octusb, usb_driver, usb_devclass, 0, 0); /** * usb_probe ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228872 - head/sys/mips/cavium
Author: gonzo Date: Sat Dec 24 23:15:25 2011 New Revision: 228872 URL: http://svn.freebsd.org/changeset/base/228872 Log: - Initialize compact_flash_attribute_base_addr from bootinfo structure Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c == --- head/sys/mips/cavium/octeon_machdep.c Sat Dec 24 22:37:27 2011 (r228871) +++ head/sys/mips/cavium/octeon_machdep.c Sat Dec 24 23:15:25 2011 (r228872) @@ -573,6 +573,8 @@ octeon_process_app_desc_ver_6(void) cvmx_sysinfo_get()->mac_addr_count = octeon_bootinfo->mac_addr_count; cvmx_sysinfo_get()->compact_flash_common_base_addr = octeon_bootinfo->compact_flash_common_base_addr; + cvmx_sysinfo_get()->compact_flash_attribute_base_addr = + octeon_bootinfo->compact_flash_attribute_base_addr; } static void ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r228925 - head/sys/mips/cavium
Author: gonzo Date: Wed Dec 28 05:57:03 2011 New Revision: 228925 URL: http://svn.freebsd.org/changeset/base/228925 Log: - Add generic GPIO driver for Cavium Octeon. At the moment pin definition is hardcoded but will be changed later with more flexible way to define them. Added: head/sys/mips/cavium/octeon_gpio.c (contents, props changed) head/sys/mips/cavium/octeon_gpiovar.h (contents, props changed) Modified: head/sys/mips/cavium/files.octeon1 Modified: head/sys/mips/cavium/files.octeon1 == --- head/sys/mips/cavium/files.octeon1 Wed Dec 28 05:35:33 2011 (r228924) +++ head/sys/mips/cavium/files.octeon1 Wed Dec 28 05:57:03 2011 (r228925) @@ -49,6 +49,8 @@ mips/cavium/usb/octusb_octeon.c option contrib/octeon-sdk/cvmx-usb.c optional octusb +mips/cavium/octeon_gpio.c optional gpio + # XXX Some files could be excluded in some configurations. Making them # optional but on in the default config would seem reasonable. contrib/octeon-sdk/cvmx-cmd-queue.cstandard Added: head/sys/mips/cavium/octeon_gpio.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octeon_gpio.c Wed Dec 28 05:57:03 2011 (r228925) @@ -0,0 +1,494 @@ +/*- + * Copyright (c) 2011, Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice unmodified, this list of conditions, and the following + *disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * GPIO driver for Cavium Octeon + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include "gpio_if.h" + +#defineDEFAULT_CAPS(GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) + +struct octeon_gpio_pin { + const char *name; + int pin; + int flags; +}; + +/* + * on CAP100 GPIO 7 is "Factory defaults" button + * + */ +static struct octeon_gpio_pin octeon_gpio_pins[] = { + { "F/D", 7, GPIO_PIN_INPUT}, + { NULL, 0, 0}, +}; + +/* + * Helpers + */ +static void octeon_gpio_pin_configure(struct octeon_gpio_softc *sc, +struct gpio_pin *pin, uint32_t flags); + +/* + * Driver stuff + */ +static void octeon_gpio_identify(driver_t *, device_t); +static int octeon_gpio_probe(device_t dev); +static int octeon_gpio_attach(device_t dev); +static int octeon_gpio_detach(device_t dev); +static int octeon_gpio_filter(void *arg); +static void octeon_gpio_intr(void *arg); + +/* + * GPIO interface + */ +static int octeon_gpio_pin_max(device_t dev, int *maxpin); +static int octeon_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps); +static int octeon_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t +*flags); +static int octeon_gpio_pin_getname(device_t dev, uint32_t pin, char *name); +static int octeon_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags); +static int octeon_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value); +static int octeon_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val); +static int octeon_gpio_pin_toggle(device_t dev, uint32_t pin); + +static void +octeon_gpio_pin_configure(struct octeon_gpio_softc *sc, struct gpio_pin *pin, +unsigned int flags) +{ + uint32_t mask; + cvmx_gpio_bit_cfgx_t gpio_cfgx; + + mask = 1 << pin->gp_pin; + GPIO_LOCK(sc); + + /* +* Manage input/output +*/ + if (flags & (GPIO_PIN_INPUT|GP
Re: svn commit: r228925 - head/sys/mips/cavium
On 28/12/2011 2:15 AM, Aleksandr Rybalko wrote: On Wed, 28 Dec 2011 05:57:03 + (UTC) Oleksandr Tymoshenko wrote: Author: gonzo Date: Wed Dec 28 05:57:03 2011 New Revision: 228925 URL: http://svn.freebsd.org/changeset/base/228925 Log: - Add generic GPIO driver for Cavium Octeon. At the moment pin definition is hardcoded but will be changed later with more flexible way to define them. /* __OCTEON_GPIOVAR_H__ */ Thank you very much Oleksandr! Oleksandr, can you please avoid define board depended futures in a SoC drivers in future '{ "F/D", 7, GPIO_PIN_INPUT}'? So others will be able to use driver in different boards w/o modification (just by define it in hints/FDT or so). OK, I'll remove it soon. It supposed to be just example. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229070 - head/sys/contrib/octeon-sdk
Author: gonzo Date: Sat Dec 31 05:24:21 2011 New Revision: 229070 URL: http://svn.freebsd.org/changeset/base/229070 Log: - CAPK-0100 board's USB timer is 12MHz Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c == --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Sat Dec 31 04:47:00 2011(r229069) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Sat Dec 31 05:24:21 2011(r229070) @@ -866,6 +866,9 @@ cvmx_helper_board_usb_clock_types_t __cv case CVMX_BOARD_TYPE_CUST_LANNER_MR320: case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: #endif +#if defined(OCTEON_BOARD_CAPK_0100ND) + case CVMX_BOARD_TYPE_CN3010_EVB_HS5: +#endif return USB_CLOCK_TYPE_CRYSTAL_12; } return USB_CLOCK_TYPE_REF_48; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229071 - head/sys/contrib/octeon-sdk
Author: gonzo Date: Sat Dec 31 05:25:42 2011 New Revision: 229071 URL: http://svn.freebsd.org/changeset/base/229071 Log: - Properly clean state structure in cvmx_usb_initialize Modified: head/sys/contrib/octeon-sdk/cvmx-usb.c Modified: head/sys/contrib/octeon-sdk/cvmx-usb.c == --- head/sys/contrib/octeon-sdk/cvmx-usb.c Sat Dec 31 05:24:21 2011 (r229070) +++ head/sys/contrib/octeon-sdk/cvmx-usb.c Sat Dec 31 05:25:42 2011 (r229071) @@ -654,7 +654,7 @@ cvmx_usb_status_t cvmx_usb_initialize(cv } } -memset(usb, 0, sizeof(usb)); +memset(usb, 0, sizeof(*usb)); usb->init_flags = flags; /* Initialize the USB state structure */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229072 - head/sys/mips/cavium/usb
Author: gonzo Date: Sat Dec 31 05:45:10 2011 New Revision: 229072 URL: http://svn.freebsd.org/changeset/base/229072 Log: - Pass proper endpoint number (without direction flag) to cvmx_usb_open_pipe Modified: head/sys/mips/cavium/usb/octusb.c Modified: head/sys/mips/cavium/usb/octusb.c == --- head/sys/mips/cavium/usb/octusb.c Sat Dec 31 05:25:42 2011 (r229071) +++ head/sys/mips/cavium/usb/octusb.c Sat Dec 31 05:45:10 2011 (r229072) @@ -162,7 +162,7 @@ octusb_host_alloc_endpoint(struct octusb &sc->sc_port[td->qh->port_index].state, 0, td->qh->dev_addr, - td->qh->ep_num, + td->qh->ep_num & UE_ADDR, octusb_convert_speed(td->qh->dev_speed), td->qh->max_packet_size, octusb_convert_ep_type(td->qh->ep_type), ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229161 - head/sys/mips/cavium
Author: gonzo Date: Sat Dec 31 23:21:36 2011 New Revision: 229161 URL: http://svn.freebsd.org/changeset/base/229161 Log: - struct clocktime sets different ranges for DOW and month comparing to struct timeval. for clocktime they should be 1..7 and 1..12 respectively - CAPK-0100ND uses RTC without centruy bit (DS1307) so set it 21st Modified: head/sys/mips/cavium/octeon_ds1337.c Modified: head/sys/mips/cavium/octeon_ds1337.c == --- head/sys/mips/cavium/octeon_ds1337.cSat Dec 31 22:37:12 2011 (r229160) +++ head/sys/mips/cavium/octeon_ds1337.cSat Dec 31 23:21:36 2011 (r229161) @@ -81,9 +81,9 @@ static int validate_ct_struct(struct clo CT_CHECK(ct->min < 0 || ct->min > 59, "minute"); CT_CHECK(ct->hour < 0 || ct->hour > 23, "hour"); CT_CHECK(ct->day < 1 || ct->day > 31, "day"); -CT_CHECK(ct->dow < 0 || ct->dow > 6, "day of week"); -CT_CHECK(ct->mon < 0 || ct->mon > 11, "month"); -CT_CHECK(ct->year < 0 || ct->year > 200,"year"); +CT_CHECK(ct->dow < 1 || ct->dow > 7, "day of week"); +CT_CHECK(ct->mon < 1 || ct->mon > 12, "month"); +CT_CHECK(ct->year > 2037,"year"); return rc; } @@ -124,10 +124,17 @@ uint32_t cvmx_rtc_ds1337_read(void) { ct.hour = (ct.hour + 12) % 24; } -ct.dow = (reg[3] & 0x7) - 1; /* Day of week field is 0..6 */ +ct.dow = (reg[3] & 0x7); /* Day of week field is 1..7 */ ct.day = bcd2bin(reg[4] & 0x3f); -ct.mon = bcd2bin(reg[5] & 0x1f) - 1; /* Month field is 0..11 */ -ct.year = ((reg[5] & 0x80) ? 100 : 0) + bcd2bin(reg[6]); +ct.mon = bcd2bin(reg[5] & 0x1f); /* Month field is 1..12 */ +#if defined(OCTEON_BOARD_CAPK_0100ND) +/* + * CAPK-0100ND uses DS1307 that does not have century bit + */ +ct.year = 2000 + bcd2bin(reg[6]); +#else +ct.year = ((reg[5] & 0x80) ? 2000 : 1900) + bcd2bin(reg[6]); +#endif if (validate_ct_struct(&ct)) @@ -166,11 +173,11 @@ int cvmx_rtc_ds1337_write(uint32_t time) reg[0] = bin2bcd(ct.sec); reg[1] = bin2bcd(ct.min); -reg[2] = bin2bcd(ct.hour); /* Force 0..23 format even if using AM/PM */ -reg[3] = bin2bcd(ct.dow + 1); +reg[2] = bin2bcd(ct.hour); /* Force 0..23 format even if using AM/PM */ +reg[3] = bin2bcd(ct.dow); reg[4] = bin2bcd(ct.day); -reg[5] = bin2bcd(ct.mon + 1); -if (ct.year >= 100) /* Set century bit*/ +reg[5] = bin2bcd(ct.mon); +if (ct.year >= 2000) /* Set century bit*/ { reg[5] |= 0x80; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229168 - head/sys/mips/cavium/usb
Author: gonzo Date: Sun Jan 1 09:12:21 2012 New Revision: 229168 URL: http://svn.freebsd.org/changeset/base/229168 Log: - Properly set IRQ handlers for all USB ports Modified: head/sys/mips/cavium/usb/octusb.h head/sys/mips/cavium/usb/octusb_octeon.c Modified: head/sys/mips/cavium/usb/octusb.h == --- head/sys/mips/cavium/usb/octusb.h Sun Jan 1 03:38:36 2012 (r229167) +++ head/sys/mips/cavium/usb/octusb.h Sun Jan 1 09:12:21 2012 (r229168) @@ -29,14 +29,7 @@ #define_OCTUSB_H_ #defineOCTUSB_MAX_DEVICES MIN(USB_MAX_DEVICES, 64) -/* - * The second port is on a different IRQ and so we disable it for now. - */ -#if 1 -#defineOCTUSB_MAX_PORTS1 /* hardcoded */ -#else #defineOCTUSB_MAX_PORTS2 /* hardcoded */ -#endif #defineOCTUSB_MAX_FIXUP4096/* bytes */ #defineOCTUSB_INTR_ENDPT 0x01 @@ -121,8 +114,8 @@ struct octusb_softc { struct usb_device *sc_devices[OCTUSB_MAX_DEVICES]; - struct resource *sc_irq_res; - void *sc_intr_hdl; + struct resource *sc_irq_res[OCTUSB_MAX_PORTS]; + void *sc_intr_hdl[OCTUSB_MAX_PORTS]; struct octusb_port sc_port[OCTUSB_MAX_PORTS]; device_t sc_dev; Modified: head/sys/mips/cavium/usb/octusb_octeon.c == --- head/sys/mips/cavium/usb/octusb_octeon.cSun Jan 1 03:38:36 2012 (r229167) +++ head/sys/mips/cavium/usb/octusb_octeon.cSun Jan 1 09:12:21 2012 (r229168) @@ -94,6 +94,8 @@ octusb_octeon_attach(device_t dev) struct octusb_octeon_softc *sc = device_get_softc(dev); int err; int rid; + int nports; + int i; /* setup controller interface softc */ @@ -107,12 +109,29 @@ octusb_octeon_attach(device_t dev) USB_GET_DMA_TAG(dev), NULL)) { return (ENOMEM); } - rid = 0; - sc->sc_dci.sc_irq_res = - bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - CVMX_IRQ_USB, CVMX_IRQ_USB, 1, RF_ACTIVE); - if (!(sc->sc_dci.sc_irq_res)) { - goto error; + nports = cvmx_usb_get_num_ports(); + if (nports > OCTUSB_MAX_PORTS) + panic("octusb: too many USB ports %d", nports); + for (i = 0; i < nports; i++) { + rid = 0; + sc->sc_dci.sc_irq_res[i] = + bus_alloc_resource(dev, SYS_RES_IRQ, &rid, + CVMX_IRQ_USB0 + i, CVMX_IRQ_USB0 + i, 1, RF_ACTIVE); + if (!(sc->sc_dci.sc_irq_res[i])) { + goto error; + } + +#if (__FreeBSD_version >= 700031) + err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res[i], INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)octusb_interrupt, sc, &sc->sc_dci.sc_intr_hdl[i]); +#else + err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res[i], INTR_TYPE_BIO | INTR_MPSAFE, + (driver_intr_t *)octusb_interrupt, sc, &sc->sc_dci.sc_intr_hdl[i]); +#endif + if (err) { + sc->sc_dci.sc_intr_hdl[i] = NULL; + goto error; + } } sc->sc_dci.sc_bus.bdev = device_add_child(dev, "usbus", -1); @@ -121,17 +140,7 @@ octusb_octeon_attach(device_t dev) } device_set_ivars(sc->sc_dci.sc_bus.bdev, &sc->sc_dci.sc_bus); -#if (__FreeBSD_version >= 700031) - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)octusb_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#else - err = bus_setup_intr(dev, sc->sc_dci.sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - (driver_intr_t *)octusb_interrupt, sc, &sc->sc_dci.sc_intr_hdl); -#endif - if (err) { - sc->sc_dci.sc_intr_hdl = NULL; - goto error; - } + err = octusb_init(&sc->sc_dci); if (!err) { err = device_probe_and_attach(sc->sc_dci.sc_bus.bdev); @@ -152,6 +161,8 @@ octusb_octeon_detach(device_t dev) struct octusb_octeon_softc *sc = device_get_softc(dev); device_t bdev; int err; + int nports; + int i; if (sc->sc_dci.sc_bus.bdev) { bdev = sc->sc_dci.sc_bus.bdev; @@ -161,20 +172,26 @@ octusb_octeon_detach(device_t dev) /* during module unload there are lots of children leftover */ device_delete_children(dev); - if (sc->sc_dci.sc_irq_res && sc->sc_dci.sc_intr_hdl) { + if (sc->sc_dci.sc_irq_res[0] && sc->sc_dci.sc_intr_hdl[0]) /* -* only call octusb_octeon_uninit() after octusb_octeon_init() -*/ +* only call octusb_octeon_uninit() after octusb_octeon_init() +
svn commit: r229408 - head/sys/mips/cavium/usb
Author: gonzo Date: Tue Jan 3 19:10:37 2012 New Revision: 229408 URL: http://svn.freebsd.org/changeset/base/229408 Log: - Octeon-SDK strictly requires multi_count to be zero for full and low speed devices. Modified: head/sys/mips/cavium/usb/octusb.c Modified: head/sys/mips/cavium/usb/octusb.c == --- head/sys/mips/cavium/usb/octusb.c Tue Jan 3 19:09:01 2012 (r229407) +++ head/sys/mips/cavium/usb/octusb.c Tue Jan 3 19:10:37 2012 (r229408) @@ -169,7 +169,7 @@ octusb_host_alloc_endpoint(struct octusb (td->qh->ep_num & UE_DIR_IN) ? CVMX_USB_DIRECTION_IN : CVMX_USB_DIRECTION_OUT, td->qh->ep_interval, - td->qh->ep_mult, + (td->qh->dev_speed == USB_SPEED_HIGH) ? td->qh->ep_mult : 0, td->qh->hs_hub_addr, td->qh->hs_hub_port); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214903 - in head/sys: conf mips/include mips/mips sys vm
Author: gonzo Date: Sun Nov 7 03:09:02 2010 New Revision: 214903 URL: http://svn.freebsd.org/changeset/base/214903 Log: - Add minidump support for FreeBSD/mips Added: head/sys/mips/mips/minidump_machdep.c (contents, props changed) Modified: head/sys/conf/files.mips head/sys/mips/include/cpuregs.h head/sys/mips/include/md_var.h head/sys/mips/include/pmap.h head/sys/mips/mips/dump_machdep.c head/sys/mips/mips/machdep.c head/sys/sys/kerneldump.h head/sys/vm/vm_page.c Modified: head/sys/conf/files.mips == --- head/sys/conf/files.mipsSun Nov 7 02:20:34 2010(r214902) +++ head/sys/conf/files.mipsSun Nov 7 03:09:02 2010(r214903) @@ -55,6 +55,7 @@ mips/mips/db_trace.c optionalddb mips/mips/dump_machdep.c standard mips/mips/in_cksum.c optionalinet mips/mips/locore.S standardno-obj +mips/mips/minidump_machdep.c standard mips/mips/mem.coptionalmem mips/mips/nexus.c standard mips/mips/stack_machdep.c optionalddb | stack Modified: head/sys/mips/include/cpuregs.h == --- head/sys/mips/include/cpuregs.h Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/mips/include/cpuregs.h Sun Nov 7 03:09:02 2010 (r214903) @@ -181,6 +181,9 @@ #defineMIPS_XUSEG_END 0x0100 #defineMIPS_XKSEG_START0xc000 #defineMIPS_XKSEG_END 0xc0ff8000 +#defineMIPS_XKSEG_COMPAT32_START 0x8000 +#defineMIPS_XKSEG_COMPAT32_END 0x +#defineMIPS_XKSEG_TO_COMPAT32(va) ((va) & 0x) #ifdef __mips_n64 #defineMIPS_DIRECT_MAPPABLE(pa)1 Modified: head/sys/mips/include/md_var.h == --- head/sys/mips/include/md_var.h Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/mips/include/md_var.h Sun Nov 7 03:09:02 2010 (r214903) @@ -42,6 +42,8 @@ extern longMaxmem; extern charsigcode[]; extern int szsigcode, szosigcode; +extern uint32_t *vm_page_dump; +extern int vm_page_dump_size; extern vm_offset_t kstack0; extern vm_offset_t kernel_kseg0_end; @@ -74,4 +76,7 @@ void platform_identify(void); extern int busdma_swi_pending; void busdma_swi(void); + +struct dumperinfo; +void minidumpsys(struct dumperinfo *); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/mips/include/pmap.h == --- head/sys/mips/include/pmap.hSun Nov 7 02:20:34 2010 (r214902) +++ head/sys/mips/include/pmap.hSun Nov 7 03:09:02 2010 (r214903) @@ -144,6 +144,8 @@ extern vm_offset_t physmem_desc[PHYS_AVA extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; +extern vm_paddr_t dump_avail[PHYS_AVAIL_ENTRIES + 2]; + #definepmap_page_get_memattr(m)VM_MEMATTR_DEFAULT #definepmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) #definepmap_page_set_memattr(m, ma)(void)0 Modified: head/sys/mips/mips/dump_machdep.c == --- head/sys/mips/mips/dump_machdep.c Sun Nov 7 02:20:34 2010 (r214902) +++ head/sys/mips/mips/dump_machdep.c Sun Nov 7 03:09:02 2010 (r214903) @@ -1,35 +1,362 @@ /*- - * Copyright (c) 2006 Oleksandr Tymoshenko + * Copyright (c) 2002 Marcel Moolenaar * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * 1. Redistributions of source code must retain the above copyright - *notice, this list of conditions, and the following disclaimer, - *without modification, immediately at the beginning of the file. - * 2. The name of the author may not be used to endorse or promote products - *derived from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS
svn commit: r214904 - head/lib/libkvm
Author: gonzo Date: Sun Nov 7 03:26:22 2010 New Revision: 214904 URL: http://svn.freebsd.org/changeset/base/214904 Log: Add minidump support for MIPS Added: head/lib/libkvm/kvm_minidump_mips.c (contents, props changed) Modified: head/lib/libkvm/Makefile head/lib/libkvm/kvm_mips.c head/lib/libkvm/kvm_private.h Modified: head/lib/libkvm/Makefile == --- head/lib/libkvm/MakefileSun Nov 7 03:09:02 2010(r214903) +++ head/lib/libkvm/MakefileSun Nov 7 03:26:22 2010(r214904) @@ -20,7 +20,7 @@ WARNS?= 0 SRCS= kvm.c kvm_${KVM_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ -${MACHINE_CPUARCH} == "arm" +${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" SRCS+= kvm_minidump_${KVM_ARCH}.c .endif INCS= kvm.h Added: head/lib/libkvm/kvm_minidump_mips.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/kvm_minidump_mips.c Sun Nov 7 03:26:22 2010 (r214904) @@ -0,0 +1,275 @@ +/*- + * Copyright (c) 2010 Oleksandr Tymoshenko + * Copyright (c) 2008 Semihalf, Grzegorz Bernacki + * Copyright (c) 2006 Peter Wemm + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * From: FreeBSD: src/lib/libkvm/kvm_minidump_arm.c r214223 + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * MIPS machine dependent routines for kvm and minidumps. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include "kvm_private.h" + +struct hpte { + struct hpte *next; + uint64_tpa; + int64_t off; +}; + +#define HPT_SIZE 1024 + +/* minidump must be the first field */ +struct vmstate { + int minidump; /* 1 = minidump mode */ + struct minidumphdr hdr; + void*hpt_head[HPT_SIZE]; + uint32_t*bitmap; + void*ptemap; +}; + +static void +hpt_insert(kvm_t *kd, uint64_t pa, int64_t off) +{ + struct hpte *hpte; + uint32_t fnv = FNV1_32_INIT; + + fnv = fnv_32_buf(&pa, sizeof(pa), fnv); + fnv &= (HPT_SIZE - 1); + hpte = malloc(sizeof(*hpte)); + hpte->pa = pa; + hpte->off = off; + hpte->next = kd->vmst->hpt_head[fnv]; + kd->vmst->hpt_head[fnv] = hpte; +} + +static int64_t +hpt_find(kvm_t *kd, uint64_t pa) +{ + struct hpte *hpte; + uint32_t fnv = FNV1_32_INIT; + + fnv = fnv_32_buf(&pa, sizeof(pa), fnv); + fnv &= (HPT_SIZE - 1); + for (hpte = kd->vmst->hpt_head[fnv]; hpte != NULL; hpte = hpte->next) + if (pa == hpte->pa) + return (hpte->off); + + return (-1); +} + +static int +inithash(kvm_t *kd, uint32_t *base, int len, off_t off) +{ + uint64_t idx, pa; + uint32_t bit, bits; + + for (idx = 0; idx < len / sizeof(*base); idx++) { + bits = base[idx]; + while (bits) { + bit = ffs(bits) - 1; + bits &= ~(1ul << bit); + pa = (idx * sizeof(*base) * NBBY + bit) * PAGE_SIZE; + hpt_insert(kd, pa, off); + off += PAGE_SIZE; + } +
svn commit: r214947 - head/contrib/gdb/gdb
Author: gonzo Date: Sun Nov 7 20:37:25 2010 New Revision: 214947 URL: http://svn.freebsd.org/changeset/base/214947 Log: Calculate offset from frame top for registers saved on a stack frame. Modified: head/contrib/gdb/gdb/mips-tdep.c Modified: head/contrib/gdb/gdb/mips-tdep.c == --- head/contrib/gdb/gdb/mips-tdep.cSun Nov 7 20:33:39 2010 (r214946) +++ head/contrib/gdb/gdb/mips-tdep.cSun Nov 7 20:37:25 2010 (r214947) @@ -1495,6 +1495,7 @@ mips_mdebug_frame_cache (struct frame_in int kernel_trap; /* What registers have been saved? Bitmasks. */ unsigned long gen_mask, float_mask; + long reg_offset; if ((*this_cache) != NULL) return (*this_cache); @@ -1513,6 +1514,8 @@ mips_mdebug_frame_cache (struct frame_in /* Extract the frame's base. */ cache->base = (frame_unwind_register_signed (next_frame, NUM_REGS + PROC_FRAME_REG (proc_desc)) + PROC_FRAME_OFFSET (proc_desc) - PROC_FRAME_ADJUST (proc_desc)); + /* Save registers offset from scratching by following find_proc_desc call */ + reg_offset = PROC_REG_OFFSET (proc_desc); kernel_trap = PROC_REG_MASK (proc_desc) & 1; gen_mask = kernel_trap ? 0x : PROC_REG_MASK (proc_desc); @@ -1567,8 +1570,7 @@ mips_mdebug_frame_cache (struct frame_in /* Fill in the offsets for the registers which gen_mask says were saved. */ { -CORE_ADDR reg_position = (cache->base - + PROC_REG_OFFSET (proc_desc)); +CORE_ADDR reg_position = (cache->base + reg_offset); int ireg; for (ireg = MIPS_NUMREGS - 1; gen_mask; --ireg, gen_mask <<= 1) if (gen_mask & 0x8000) @@ -2162,15 +2164,18 @@ restart: { PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; set_reg_offset (temp_saved_regs, reg, sp + low_word); + /* Do we have registers offset yet? */ + if (!PROC_REG_OFFSET (&temp_proc_desc)) +PROC_REG_OFFSET (&temp_proc_desc) = low_word - PROC_FRAME_OFFSET (&temp_proc_desc); } else if ((high_word & 0xFFE0) == 0xffa0) /* sd reg,offset($sp) */ { - /* Irix 6.2 N32 ABI uses sd instructions for saving $gp and $ra, -but the register size used is only 32 bits. Make the address -for the saved register point to the lower 32 bits. */ PROC_REG_MASK (&temp_proc_desc) |= 1 << reg; set_reg_offset (temp_saved_regs, reg, - sp + low_word + 8 - mips_regsize (current_gdbarch)); + sp + low_word); + /* Do we have registers offset yet? */ + if (!PROC_REG_OFFSET (&temp_proc_desc)) +PROC_REG_OFFSET (&temp_proc_desc) = low_word - PROC_FRAME_OFFSET (&temp_proc_desc); } else if (high_word == 0x27be)/* addiu $30,$sp,size */ { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214949 - head/contrib/gdb/gdb
Author: gonzo Date: Sun Nov 7 20:40:00 2010 New Revision: 214949 URL: http://svn.freebsd.org/changeset/base/214949 Log: Change register numbers according to current struct reg and struct fpreg in src/sys/mips/include/reg.h Modified: head/contrib/gdb/gdb/mips-tdep.h head/contrib/gdb/gdb/mipsfbsd-tdep.h Modified: head/contrib/gdb/gdb/mips-tdep.h == --- head/contrib/gdb/gdb/mips-tdep.hSun Nov 7 20:38:14 2010 (r214948) +++ head/contrib/gdb/gdb/mips-tdep.hSun Nov 7 20:40:00 2010 (r214949) @@ -78,7 +78,7 @@ enum { MIPS_EMBED_BADVADDR_REGNUM = 35, MIPS_EMBED_CAUSE_REGNUM = 36, MIPS_EMBED_PC_REGNUM = 37, - MIPS_EMBED_FP0_REGNUM = 38 + MIPS_EMBED_FP0_REGNUM = 40 }; /* Defined in mips-tdep.c and used in remote-mips.c */ Modified: head/contrib/gdb/gdb/mipsfbsd-tdep.h == --- head/contrib/gdb/gdb/mipsfbsd-tdep.hSun Nov 7 20:38:14 2010 (r214948) +++ head/contrib/gdb/gdb/mipsfbsd-tdep.hSun Nov 7 20:40:00 2010 (r214949) @@ -34,7 +34,7 @@ void mipsfbsd_fill_reg (char *, int); void mipsfbsd_supply_fpreg (char *, int); void mipsfbsd_fill_fpreg (char *, int); -#define SIZEOF_STRUCT_REG (38 * mips_regsize (current_gdbarch)) -#define SIZEOF_STRUCT_FPREG(33 * mips_regsize (current_gdbarch)) +#define SIZEOF_STRUCT_REG (40 * mips_regsize (current_gdbarch)) +#define SIZEOF_STRUCT_FPREG(34 * mips_regsize (current_gdbarch)) #endif /* mipsfbsd_TDEP_H */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214950 - head/contrib/binutils/bfd
Author: gonzo Date: Sun Nov 7 20:44:46 2010 New Revision: 214950 URL: http://svn.freebsd.org/changeset/base/214950 Log: Prevent endless loop by detecting broken MIPS.options Modified: head/contrib/binutils/bfd/elfxx-mips.c Modified: head/contrib/binutils/bfd/elfxx-mips.c == --- head/contrib/binutils/bfd/elfxx-mips.c Sun Nov 7 20:40:00 2010 (r214949) +++ head/contrib/binutils/bfd/elfxx-mips.c Sun Nov 7 20:44:46 2010 (r214950) @@ -4330,6 +4330,15 @@ _bfd_mips_elf_section_processing (bfd *a bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l, &intopt); + if (intopt.size < sizeof (Elf_External_Options)) + { + (*_bfd_error_handler) + (_("Warning: bad `%s' option size %u smaller than its header"), + MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size); + break; + } + + if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO) { bfd_byte buf[8]; @@ -4542,6 +4551,14 @@ _bfd_mips_elf_section_from_shdr (bfd *ab bfd_mips_elf_swap_options_in (abfd, (Elf_External_Options *) l, &intopt); + if (intopt.size < sizeof (Elf_External_Options)) + { + (*_bfd_error_handler) + (_("Warning: bad `%s' option size %u smaller than its header"), + MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size); + break; + } + if (ABI_64_P (abfd) && intopt.kind == ODK_REGINFO) { Elf64_Internal_RegInfo intreg; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214951 - head/gnu/usr.bin/gdb/arch/mips
Author: gonzo Date: Sun Nov 7 20:53:19 2010 New Revision: 214951 URL: http://svn.freebsd.org/changeset/base/214951 Log: Link threads support to the build Modified: head/gnu/usr.bin/gdb/arch/mips/Makefile head/gnu/usr.bin/gdb/arch/mips/init.c Modified: head/gnu/usr.bin/gdb/arch/mips/Makefile == --- head/gnu/usr.bin/gdb/arch/mips/Makefile Sun Nov 7 20:44:46 2010 (r214950) +++ head/gnu/usr.bin/gdb/arch/mips/Makefile Sun Nov 7 20:53:19 2010 (r214951) @@ -1,7 +1,7 @@ # $FreeBSD$ .if !defined(GDB_CROSS_DEBUGGER) -LIBSRCS+= mipsfbsd-nat.c +LIBSRCS+= mipsfbsd-nat.c fbsd-threads.c .endif LIBSRCS+= solib.c solib-svr4.c LIBSRCS+= mips-tdep.c mipsfbsd-tdep.c fbsd-proc.c Modified: head/gnu/usr.bin/gdb/arch/mips/init.c == --- head/gnu/usr.bin/gdb/arch/mips/init.c Sun Nov 7 20:44:46 2010 (r214950) +++ head/gnu/usr.bin/gdb/arch/mips/init.c Sun Nov 7 20:53:19 2010 (r214951) @@ -131,6 +131,7 @@ initialize_all_files (void) _initialize_infptrace (); _initialize_inftarg (); _initialize_solib (); + _initialize_thread_db (); _initialize_svr4_solib (); #if 0 _initialize_svr4_lm (); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214952 - head/gnu/usr.bin/gdb/kgdb
Author: gonzo Date: Sun Nov 7 20:56:41 2010 New Revision: 214952 URL: http://svn.freebsd.org/changeset/base/214952 Log: - Use proper constant for accessing PCB intead of hardcoded numbers - Minor clean-up Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c == --- head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sun Nov 7 20:53:19 2010 (r214951) +++ head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sun Nov 7 20:56:41 2010 (r214952) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "kgdb.h" void @@ -61,24 +63,26 @@ kgdb_trgt_fetch_registers(int regno __un warnx("kvm_read: %s", kvm_geterr(kvm)); memset(&pcb, 0, sizeof(pcb)); } - supply_register(MIPS_S0_REGNUM, (char *)&pcb.pcb_context[0]); - supply_register(MIPS_S1_REGNUM, (char *)&pcb.pcb_context[1]); - supply_register(MIPS_S2_REGNUM, (char *)&pcb.pcb_context[2]); - supply_register(MIPS_S3_REGNUM, (char *)&pcb.pcb_context[3]); - supply_register(MIPS_S4_REGNUM, (char *)&pcb.pcb_context[4]); - supply_register(MIPS_S5_REGNUM, (char *)&pcb.pcb_context[5]); - supply_register(MIPS_S6_REGNUM, (char *)&pcb.pcb_context[6]); - supply_register(MIPS_S7_REGNUM, (char *)&pcb.pcb_context[7]); - supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context[8]); - supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[9]); - supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[10]); + + supply_register(MIPS_S0_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S0]); + supply_register(MIPS_S1_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S1]); + supply_register(MIPS_S2_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S2]); + supply_register(MIPS_S3_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S3]); + supply_register(MIPS_S4_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S4]); + supply_register(MIPS_S5_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S5]); + supply_register(MIPS_S6_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S6]); + supply_register(MIPS_S7_REGNUM, (char *)&pcb.pcb_context[PCB_REG_S7]); + supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_SP]); + supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_GP]); + supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[PCB_REG_RA]); + supply_register(MIPS_EMBED_PC_REGNUM, (char *)&pcb.pcb_context[PCB_REG_PC]); } void kgdb_trgt_store_registers(int regno __unused) { - fprintf_unfiltered(gdb_stderr, "XXX: %s\n", __func__); + fprintf_unfiltered(gdb_stderr, "Unimplemented function: %s\n", __func__); } void @@ -127,7 +131,7 @@ static int kgdb_trgt_frame_offset[] = { }; static struct kgdb_frame_cache * -kgdb_trgt_frame_cache(struct frame_info *next_frame __unused, void **this_cache __unused) +kgdb_trgt_frame_cache(struct frame_info *next_frame, void **this_cache) { char buf[MAX_REGISTER_SIZE]; struct kgdb_frame_cache *cache; @@ -192,7 +196,7 @@ static const struct frame_unwind kgdb_tr }; const struct frame_unwind * -kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame __unused) +kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame) { char *pname; CORE_ADDR pc; @@ -207,6 +211,5 @@ kgdb_trgt_trapframe_sniffer(struct frame (strcmp(pname, "MipsUserIntr") == 0) || (strcmp(pname, "MipsUserGenException") == 0)) return (&kgdb_trgt_trapframe_unwind); - /* printf("%s: %llx =%s\n", __func__, pc, pname); */ return (NULL); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214960 - head/gnu/usr.bin/gdb/arch/mips
Author: gonzo Date: Sun Nov 7 23:22:22 2010 New Revision: 214960 URL: http://svn.freebsd.org/changeset/base/214960 Log: Fix initialization order:_initialize_svr4_solib should be called before _initialize_thread_db Modified: head/gnu/usr.bin/gdb/arch/mips/init.c Modified: head/gnu/usr.bin/gdb/arch/mips/init.c == --- head/gnu/usr.bin/gdb/arch/mips/init.c Sun Nov 7 22:51:54 2010 (r214959) +++ head/gnu/usr.bin/gdb/arch/mips/init.c Sun Nov 7 23:22:22 2010 (r214960) @@ -119,6 +119,8 @@ initialize_all_files (void) _initialize_mips_tdep (); _initialize_mipsfbsd_tdep (); _initialize_corelow (); + _initialize_solib (); + _initialize_svr4_solib (); _initialize_ser_hardwire (); _initialize_ser_pipe (); _initialize_ser_tcp (); @@ -130,9 +132,7 @@ initialize_all_files (void) _initialize_kernel_u_addr (); _initialize_infptrace (); _initialize_inftarg (); - _initialize_solib (); _initialize_thread_db (); - _initialize_svr4_solib (); #if 0 _initialize_svr4_lm (); #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214962 - head/gnu/usr.bin/gdb/kgdb
Author: gonzo Date: Sun Nov 7 23:23:48 2010 New Revision: 214962 URL: http://svn.freebsd.org/changeset/base/214962 Log: Fix cross-debugger build Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c == --- head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sun Nov 7 23:22:42 2010 (r214961) +++ head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sun Nov 7 23:23:48 2010 (r214962) @@ -46,13 +46,16 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndefCROSS_DEBUGGER #include +#endif #include "kgdb.h" void kgdb_trgt_fetch_registers(int regno __unused) { +#ifndefCROSS_DEBUGGER struct kthr *kt; struct pcb pcb; @@ -76,6 +79,7 @@ kgdb_trgt_fetch_registers(int regno __un supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[PCB_REG_GP]); supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[PCB_REG_RA]); supply_register(MIPS_EMBED_PC_REGNUM, (char *)&pcb.pcb_context[PCB_REG_PC]); +#endif } void @@ -90,6 +94,7 @@ kgdb_trgt_new_objfile(struct objfile *ob { } +#ifndef CROSS_DEBUGGER struct kgdb_frame_cache { CORE_ADDR pc; CORE_ADDR sp; @@ -194,10 +199,12 @@ static const struct frame_unwind kgdb_tr &kgdb_trgt_trapframe_this_id, &kgdb_trgt_trapframe_prev_register }; +#endif const struct frame_unwind * kgdb_trgt_trapframe_sniffer(struct frame_info *next_frame) { +#ifndef CROSS_DEBUGGER char *pname; CORE_ADDR pc; @@ -211,5 +218,6 @@ kgdb_trgt_trapframe_sniffer(struct frame (strcmp(pname, "MipsUserIntr") == 0) || (strcmp(pname, "MipsUserGenException") == 0)) return (&kgdb_trgt_trapframe_unwind); +#endif return (NULL); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r214965 - head/sys/mips/mips
Author: gonzo Date: Mon Nov 8 00:26:49 2010 New Revision: 214965 URL: http://svn.freebsd.org/changeset/base/214965 Log: - Provide more registers for GDB Modified: head/sys/mips/mips/gdb_machdep.c Modified: head/sys/mips/mips/gdb_machdep.c == --- head/sys/mips/mips/gdb_machdep.cSun Nov 7 23:44:40 2010 (r214964) +++ head/sys/mips/mips/gdb_machdep.cMon Nov 8 00:26:49 2010 (r214965) @@ -117,26 +117,33 @@ gdb_cpu_getreg(int regnum, size_t *regsz *regsz = gdb_cpu_regsz(regnum); if (kdb_thread == PCPU_GET(curthread)) { - switch (regnum) { - /* - * XXX: May need to add more registers - */ - case 2: return (&kdb_frame->v0); - case 3: return (&kdb_frame->v1); - } + register_t *zero_ptr = &kdb_frame->zero; + return zero_ptr + regnum; } + switch (regnum) { - case 16: return (&kdb_thrctx->pcb_context[0]); - case 17: return (&kdb_thrctx->pcb_context[1]); - case 18: return (&kdb_thrctx->pcb_context[2]); - case 19: return (&kdb_thrctx->pcb_context[3]); - case 20: return (&kdb_thrctx->pcb_context[4]); - case 21: return (&kdb_thrctx->pcb_context[5]); - case 22: return (&kdb_thrctx->pcb_context[6]); - case 23: return (&kdb_thrctx->pcb_context[7]); - case 29: return (&kdb_thrctx->pcb_context[8]); - case 30: return (&kdb_thrctx->pcb_context[9]); - case 31: return (&kdb_thrctx->pcb_context[10]); + /* +* S0..S7 +*/ + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + return (&kdb_thrctx->pcb_context[PCB_REG_S0 + regnum - 16]); + case 28: + return (&kdb_thrctx->pcb_context[PCB_REG_GP]); + case 29: + return (&kdb_thrctx->pcb_context[PCB_REG_SP]); + case 30: + return (&kdb_thrctx->pcb_context[PCB_REG_S8]); + case 31: + return (&kdb_thrctx->pcb_context[PCB_REG_RA]); + case 37: + return (&kdb_thrctx->pcb_context[PCB_REG_PC]); } return (NULL); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215322 - head/share/man/man5
Author: gonzo Date: Sun Nov 14 22:08:56 2010 New Revision: 215322 URL: http://svn.freebsd.org/changeset/base/215322 Log: Regenerate src.conf manpage after adding WITHOUT_GPIO build knob Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 == --- head/share/man/man5/src.conf.5 Sun Nov 14 21:59:11 2010 (r215321) +++ head/share/man/man5/src.conf.5 Sun Nov 14 22:08:56 2010 (r215322) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm .\" $FreeBSD$ -.Dd August 25, 2010 +.Dd November 14, 2010 .Dt SRC.CONF 5 .Os .Sh NAME @@ -355,6 +355,9 @@ Set to build some programs without optio .It Va WITHOUT_GPIB .\" from FreeBSD: head/tools/build/options/WITHOUT_GPIB 156932 2006-03-21 07:50:50Z ru Set to not build GPIB bus support. +.It Va WITH_GPIO +.\" from FreeBSD: head/tools/build/options/WITH_GPIO 213463 2010-10-05 22:26:01Z gonzo +Set to build gpioctl(8) as part of the base system. .It Va WITHOUT_GROFF .\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 156932 2006-03-21 07:50:50Z ru Set to not build ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215323 - head/tools/build/mk
Author: gonzo Date: Sun Nov 14 22:14:36 2010 New Revision: 215323 URL: http://svn.freebsd.org/changeset/base/215323 Log: Add optional files controlled by WITH_GPIO knob Submitted by: Alexander Best Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Nov 14 22:08:56 2010(r215322) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Nov 14 22:14:36 2010(r215323) @@ -808,6 +808,11 @@ OLD_FILES+=usr/lib32/libgpib_p.a .endif .endif +.if ${MK_GPIO} == no +OLD_FILES+=usr/sbin/gpioctl +OLD_FILES+=usr/share/man/man8/gpioctl.8.gz +.endif + .if ${MK_GSSAPI} == no OLD_FILES+=usr/lib/libgssapi.a OLD_FILES+=usr/lib/libgssapi.so ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215961 - in stable/8/sys/mips: atheros conf
Author: gonzo Date: Sun Nov 28 00:53:43 2010 New Revision: 215961 URL: http://svn.freebsd.org/changeset/base/215961 Log: MFC r211509: add the PLL set functions to cpuops Modified: stable/8/sys/mips/atheros/ar71xx_cpudef.h stable/8/sys/mips/conf/AR71XX Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/mips/alchemy/ (props changed) stable/8/sys/mips/atheros/ (props changed) stable/8/sys/mips/cavium/ (props changed) stable/8/sys/mips/cavium/dev/ (props changed) stable/8/sys/mips/rmi/ (props changed) stable/8/sys/mips/rmi/dev/ (props changed) stable/8/sys/mips/sibyte/ (props changed) Modified: stable/8/sys/mips/atheros/ar71xx_cpudef.h == --- stable/8/sys/mips/atheros/ar71xx_cpudef.h Sun Nov 28 00:52:02 2010 (r215960) +++ stable/8/sys/mips/atheros/ar71xx_cpudef.h Sun Nov 28 00:53:43 2010 (r215961) @@ -81,6 +81,16 @@ static inline int ar71xx_device_stopped( return ar71xx_cpu_ops->ar71xx_chip_device_stopped(mask); } +static inline void ar71xx_device_set_pll_ge0(int speed) +{ + ar71xx_cpu_ops->ar71xx_chip_set_pll_ge0(speed); +} + +static inline void ar71xx_device_set_pll_ge1(int speed) +{ + ar71xx_cpu_ops->ar71xx_chip_set_pll_ge1(speed); +} + static inline void ar71xx_device_flush_ddr_ge0(void) { ar71xx_cpu_ops->ar71xx_chip_ddr_flush_ge0(); Modified: stable/8/sys/mips/conf/AR71XX == --- stable/8/sys/mips/conf/AR71XX Sun Nov 28 00:52:02 2010 (r215960) +++ stable/8/sys/mips/conf/AR71XX Sun Nov 28 00:53:43 2010 (r215961) @@ -62,7 +62,7 @@ deviceath # Atheros pci/ca optionsATH_DEBUG device ath_hal option AH_SUPPORT_AR5416 -option AH_RXCFG_SDMAMW_4BYTES # See NOTES for details of this WAR +# option AH_RXCFG_SDMAMW_4BYTES # See NOTES for details of this WAR device ath_rate_sample device mii @@ -74,12 +74,12 @@ options USB_EHCI_BIG_ENDIAN_DESC device ohci device ehci -device gpio -device gpioled +# device gpio +# device gpioled -device spibus -device ar71xx_spi -device mx25l +# device spibus +# device ar71xx_spi +# device mx25l # device geom_redboot device ar71xx_wdog ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215965 - stable/8/sys/mips/atheros
Author: gonzo Date: Sun Nov 28 01:08:42 2010 New Revision: 215965 URL: http://svn.freebsd.org/changeset/base/215965 Log: init_static_kenv is available only in 9-CURRENT, replace its functionality with custom solution Modified: stable/8/sys/mips/atheros/ar71xx_machdep.c Modified: stable/8/sys/mips/atheros/ar71xx_machdep.c == --- stable/8/sys/mips/atheros/ar71xx_machdep.c Sun Nov 28 01:03:06 2010 (r215964) +++ stable/8/sys/mips/atheros/ar71xx_machdep.c Sun Nov 28 01:08:42 2010 (r215965) @@ -66,6 +66,26 @@ uint32_t ar711_base_mac[ETHER_ADDR_LEN]; /* 4KB static data aread to keep a copy of the bootload env until the dynamic kenv is setup */ char boot1_env[4096]; +int boot1_env_pos = 0; + +static void +static_setenv(char *n, char *v) +{ + int nlen, vlen; + + nlen = strlen(n); + vlen = strlen(v); + if (boot1_env_pos + nlen + vlen + 2 > sizeof(boot1_env)) { + printf("*** Environment could not be copied in full\n"); + return; + } + memcpy (&boot1_env[boot1_env_pos], n, nlen); + boot1_env_pos += nlen + 1; + boot1_env[boot1_env_pos-1] = '\0'; + memcpy (&boot1_env[boot1_env_pos], v, vlen); + boot1_env_pos += vlen + 1; + boot1_env[boot1_env_pos-1] = '\0'; +} /* * We get a string in from Redboot with the all the arguments together, @@ -93,9 +113,8 @@ parse_argv(char *str) } else { n = strsep(&v, "="); if (v == NULL) - setenv(n, "1"); - else - setenv(n, v); + v = "1"; + static_setenv(n, v); } } } @@ -200,7 +219,6 @@ platform_start(__register_t a0 __unused, platform_counter_freq = ar71xx_cpu_freq(); mips_timer_init_params(platform_counter_freq, 1); cninit(); - init_static_kenv(boot1_env, sizeof(boot1_env)); printf("CPU platform: %s\n", ar71xx_get_system_type()); printf("CPU Frequency=%d MHz\n", u_ar71xx_cpu_freq / 100); @@ -229,11 +247,12 @@ platform_start(__register_t a0 __unused, if (MIPS_IS_VALID_PTR(envp)) { for (i = 0; envp[i]; i+=2) { printf(" %s = %s\n", envp[i], envp[i+1]); - setenv(envp[i], envp[i+1]); + static_setenv(envp[i], envp[i+1]); } } else printf ("envp is invalid\n"); + kern_envp = boot1_env; /* * "ethaddr" is passed via envp on RedBoot platforms ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215967 - stable/8/sys/mips/conf
Author: gonzo Date: Sun Nov 28 01:18:11 2010 New Revision: 215967 URL: http://svn.freebsd.org/changeset/base/215967 Log: Remove options that are not available in 8 Modified: stable/8/sys/mips/conf/AR71XX Modified: stable/8/sys/mips/conf/AR71XX == --- stable/8/sys/mips/conf/AR71XX Sun Nov 28 01:16:37 2010 (r215966) +++ stable/8/sys/mips/conf/AR71XX Sun Nov 28 01:18:11 2010 (r215967) @@ -62,7 +62,6 @@ deviceath # Atheros pci/ca optionsATH_DEBUG device ath_hal option AH_SUPPORT_AR5416 -# option AH_RXCFG_SDMAMW_4BYTES # See NOTES for details of this WAR device ath_rate_sample device mii @@ -74,13 +73,8 @@ options USB_EHCI_BIG_ENDIAN_DESC device ohci device ehci -# device gpio -# device gpioled - -# device spibus -# device ar71xx_spi -# device mx25l -# device geom_redboot +device spibus +device ar71xx_spi device ar71xx_wdog ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r215961 - in stable/8/sys/mips: atheros conf
> > stable/8/sys/mips/conf/AR71XX This wasn't supposed to be in this commit :( -- gonzo ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r215989 - head/sys/mips/cavium
Author: gonzo Date: Sun Nov 28 08:11:05 2010 New Revision: 215989 URL: http://svn.freebsd.org/changeset/base/215989 Log: - Add watchdog driver for Cavium Octeon. At the moment only UP systems are supported. Added: head/sys/mips/cavium/octeon_nmi.S (contents, props changed) head/sys/mips/cavium/octeon_wdog.c (contents, props changed) Modified: head/sys/mips/cavium/files.octeon1 Modified: head/sys/mips/cavium/files.octeon1 == --- head/sys/mips/cavium/files.octeon1 Sun Nov 28 08:09:20 2010 (r215988) +++ head/sys/mips/cavium/files.octeon1 Sun Nov 28 08:11:05 2010 (r215989) @@ -16,6 +16,8 @@ mips/mips/intr_machdep.c standard mips/mips/tick.c standard mips/cavium/octeon_rnd.c optional random +mips/cavium/octeon_wdog.c optional octeon_wdog +mips/cavium/octeon_nmi.S optional octeon_wdog mips/cavium/cryptocteon/cavium_crypto.coptional cryptocteon mips/cavium/cryptocteon/cryptocteon.c optional cryptocteon Added: head/sys/mips/cavium/octeon_nmi.S == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octeon_nmi.S Sun Nov 28 08:11:05 2010 (r215989) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2010 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +.set noreorder + +/* + * Only first 128 bytes of handler is used + */ +NESTED_NOPROFILE(octeon_wdog_nmi_handler, 32, ra) +.setpush +.setnoat +PTR_LA k0, _C_LABEL(octeon_wdog_nmi) + jr k0 + nop +1: + nop + j 1b + nop +.setat +END(octeon_wdog_nmi_handler) Added: head/sys/mips/cavium/octeon_wdog.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octeon_wdog.c Sun Nov 28 08:11:05 2010 (r215989) @@ -0,0 +1,259 @@ +/*- + * Copyright (c) 2009, Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice unmodified, this list of conditions, and the following + *disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Watchdog driver for Cavium Octeon + */ +
svn commit: r216318 - in head/sys/mips: adm5120 alchemy atheros cavium idt malta rmi sentry5 sibyte
Author: gonzo Date: Thu Dec 9 07:01:03 2010 New Revision: 216318 URL: http://svn.freebsd.org/changeset/base/216318 Log: - Populate dump_avail with proper values from phys_avail Modified: head/sys/mips/adm5120/adm5120_machdep.c head/sys/mips/alchemy/alchemy_machdep.c head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/idt/idt_machdep.c head/sys/mips/malta/malta_machdep.c head/sys/mips/rmi/xlr_machdep.c head/sys/mips/sentry5/s5_machdep.c head/sys/mips/sibyte/sb_machdep.c Modified: head/sys/mips/adm5120/adm5120_machdep.c == --- head/sys/mips/adm5120/adm5120_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/adm5120/adm5120_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -97,6 +97,9 @@ mips_init(void) phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + physmem = realmem; init_param1(); Modified: head/sys/mips/alchemy/alchemy_machdep.c == --- head/sys/mips/alchemy/alchemy_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/alchemy/alchemy_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -97,6 +97,9 @@ mips_init(void) phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + physmem = realmem; init_param1(); Modified: head/sys/mips/atheros/ar71xx_machdep.c == --- head/sys/mips/atheros/ar71xx_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/atheros/ar71xx_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -184,6 +184,9 @@ platform_start(__register_t a0 __unused, phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + physmem = realmem; /* Modified: head/sys/mips/cavium/octeon_machdep.c == --- head/sys/mips/cavium/octeon_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/cavium/octeon_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -265,7 +265,7 @@ octeon_memory_init(void) { vm_paddr_t phys_end; int64_t addr; - unsigned i; + unsigned i, j; phys_end = round_page(MIPS_KSEG0_TO_PHYS((vm_offset_t)&end)); @@ -274,6 +274,9 @@ octeon_memory_init(void) phys_avail[0] = phys_end; phys_avail[1] = 96 << 20; + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + realmem = physmem = btoc(phys_avail[1] - phys_avail[0]); return; } @@ -314,6 +317,11 @@ octeon_memory_init(void) i += 2; } + for (j = 0; j < i; j += 2) { + dump_avail[j] = phys_avail[j]; + dump_avail[j+1] = phys_avail[j+1] - phys_avail[j]; + } + realmem = physmem; } Modified: head/sys/mips/idt/idt_machdep.c == --- head/sys/mips/idt/idt_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/idt/idt_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -167,6 +167,9 @@ platform_start(__register_t a0, __regist phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + physmem = realmem; /* Modified: head/sys/mips/malta/malta_machdep.c == --- head/sys/mips/malta/malta_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/malta/malta_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -181,6 +181,9 @@ mips_init(void) phys_avail[0] = MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); phys_avail[1] = ctob(realmem); + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1] - phys_avail[0]; + physmem = realmem; init_param1(); Modified: head/sys/mips/rmi/xlr_machdep.c == --- head/sys/mips/rmi/xlr_machdep.c Thu Dec 9 06:54:06 2010 (r216317) +++ head/sys/mips/rmi/xlr_machdep.c Thu Dec 9 07:01:03 2010 (r216318) @@ -363,6 +363,9 @@ xlr_mem_init(void)
svn commit: r216320 - in head/sys/mips: adm5120 alchemy cavium idt malta rmi sentry5 sibyte
Author: gonzo Date: Thu Dec 9 07:47:40 2010 New Revision: 216320 URL: http://svn.freebsd.org/changeset/base/216320 Log: - dump_avail layout should be sequence of [start, end) pairs, not . Spotted by: alc@ Modified: head/sys/mips/adm5120/adm5120_machdep.c head/sys/mips/alchemy/alchemy_machdep.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/idt/idt_machdep.c head/sys/mips/malta/malta_machdep.c head/sys/mips/rmi/xlr_machdep.c head/sys/mips/sentry5/s5_machdep.c head/sys/mips/sibyte/sb_machdep.c Modified: head/sys/mips/adm5120/adm5120_machdep.c == --- head/sys/mips/adm5120/adm5120_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/adm5120/adm5120_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -98,7 +98,7 @@ mips_init(void) phys_avail[1] = ctob(realmem); dump_avail[0] = phys_avail[0]; - dump_avail[1] = phys_avail[1] - phys_avail[0]; + dump_avail[1] = phys_avail[1]; physmem = realmem; Modified: head/sys/mips/alchemy/alchemy_machdep.c == --- head/sys/mips/alchemy/alchemy_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/alchemy/alchemy_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -98,7 +98,7 @@ mips_init(void) phys_avail[1] = ctob(realmem); dump_avail[0] = phys_avail[0]; - dump_avail[1] = phys_avail[1] - phys_avail[0]; + dump_avail[1] = phys_avail[1]; physmem = realmem; Modified: head/sys/mips/cavium/octeon_machdep.c == --- head/sys/mips/cavium/octeon_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/cavium/octeon_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -275,7 +275,7 @@ octeon_memory_init(void) phys_avail[1] = 96 << 20; dump_avail[0] = phys_avail[0]; - dump_avail[1] = phys_avail[1] - phys_avail[0]; + dump_avail[1] = phys_avail[1]; realmem = physmem = btoc(phys_avail[1] - phys_avail[0]); return; @@ -317,10 +317,8 @@ octeon_memory_init(void) i += 2; } - for (j = 0; j < i; j += 2) { + for (j = 0; j < i; j++) dump_avail[j] = phys_avail[j]; - dump_avail[j+1] = phys_avail[j+1] - phys_avail[j]; - } realmem = physmem; } Modified: head/sys/mips/idt/idt_machdep.c == --- head/sys/mips/idt/idt_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/idt/idt_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -168,7 +168,7 @@ platform_start(__register_t a0, __regist phys_avail[1] = ctob(realmem); dump_avail[0] = phys_avail[0]; - dump_avail[1] = phys_avail[1] - phys_avail[0]; + dump_avail[1] = phys_avail[1]; physmem = realmem; Modified: head/sys/mips/malta/malta_machdep.c == --- head/sys/mips/malta/malta_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/malta/malta_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -182,7 +182,7 @@ mips_init(void) phys_avail[1] = ctob(realmem); dump_avail[0] = phys_avail[0]; - dump_avail[1] = phys_avail[1] - phys_avail[0]; + dump_avail[1] = phys_avail[1]; physmem = realmem; Modified: head/sys/mips/rmi/xlr_machdep.c == --- head/sys/mips/rmi/xlr_machdep.c Thu Dec 9 07:39:06 2010 (r216319) +++ head/sys/mips/rmi/xlr_machdep.c Thu Dec 9 07:47:40 2010 (r216320) @@ -363,8 +363,8 @@ xlr_mem_init(void) (void *)phys_avail[0], (void *)phys_avail[1]); - dump_avail[0] = boot_map->physmem_map[0].addr; - dump_avail[1] = boot_map->physmem_map[0].size; + dump_avail[0] = phys_avail[0]; + dump_avail[1] = phys_avail[1]; } else { /* @@ -394,8 +394,8 @@ xlr_mem_init(void) (void *)phys_avail[j+1]); } - dump_avail[j] = boot_map->physmem_map[j].addr; - dump_avail[j+1] = boot_map->physmem_map[j].size; + dump_avail[j] = phys_avail[j]; + dump_avail[j+1] = phys_avail[j+1]; physsz += boot_map->physmem_map[i].size; } Modified: head/sys/mips/sentry5/s5_machdep.c ===
svn commit: r216475 - head/sys/mips/conf
Author: gonzo Date: Thu Dec 16 05:13:41 2010 New Revision: 216475 URL: http://svn.freebsd.org/changeset/base/216475 Log: - include argument should be in quotes Modified: head/sys/mips/conf/SWARM head/sys/mips/conf/SWARM64 head/sys/mips/conf/SWARM64_SMP head/sys/mips/conf/SWARM_SMP Modified: head/sys/mips/conf/SWARM == --- head/sys/mips/conf/SWARMThu Dec 16 04:56:03 2010(r216474) +++ head/sys/mips/conf/SWARMThu Dec 16 05:13:41 2010(r216475) @@ -2,7 +2,7 @@ # $FreeBSD$ # -includestd.SWARM +include"std.SWARM" ident SWARM Modified: head/sys/mips/conf/SWARM64 == --- head/sys/mips/conf/SWARM64 Thu Dec 16 04:56:03 2010(r216474) +++ head/sys/mips/conf/SWARM64 Thu Dec 16 05:13:41 2010(r216475) @@ -2,7 +2,7 @@ # $FreeBSD$ # -includestd.SWARM +include"std.SWARM" ident SWARM64 Modified: head/sys/mips/conf/SWARM64_SMP == --- head/sys/mips/conf/SWARM64_SMP Thu Dec 16 04:56:03 2010 (r216474) +++ head/sys/mips/conf/SWARM64_SMP Thu Dec 16 05:13:41 2010 (r216475) @@ -2,7 +2,7 @@ # $FreeBSD$ # -includestd.SWARM +include"std.SWARM" ident SWARM64_SMP Modified: head/sys/mips/conf/SWARM_SMP == --- head/sys/mips/conf/SWARM_SMPThu Dec 16 04:56:03 2010 (r216474) +++ head/sys/mips/conf/SWARM_SMPThu Dec 16 05:13:41 2010 (r216475) @@ -2,7 +2,7 @@ # $FreeBSD$ # -includestd.SWARM +include"std.SWARM" ident SWARM_SMP ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r199114 - head/sys/mips/mips
Author: gonzo Date: Mon Nov 9 22:01:58 2009 New Revision: 199114 URL: http://svn.freebsd.org/changeset/base/199114 Log: Unbreak booting of FreeBSD/mips by merging r195429 from projects/mips: - Move dpcpu initialization to mips_proc0_init. It's more appropriate place for it. Besides dpcpu_init requires pmap module to be initialized and calling it int pmap.c hangs the system Modified: head/sys/mips/mips/machdep.c head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/machdep.c == --- head/sys/mips/mips/machdep.cMon Nov 9 21:54:34 2009 (r199113) +++ head/sys/mips/mips/machdep.cMon Nov 9 22:01:58 2009 (r199114) @@ -274,6 +274,9 @@ mips_proc0_init(void) (thread0.td_kstack_pages - 1) * PAGE_SIZE) - 1; thread0.td_frame = &thread0.td_pcb->pcb_regs; + /* Steal memory for the dynamic per-cpu area. */ + dpcpu_init((void *)pmap_steal_memory(DPCPU_SIZE), 0); + /* * There is no need to initialize md_upte array for thread0 as it's * located in .bss section and should be explicitly zeroed during Modified: head/sys/mips/mips/pmap.c == --- head/sys/mips/mips/pmap.c Mon Nov 9 21:54:34 2009(r199113) +++ head/sys/mips/mips/pmap.c Mon Nov 9 22:01:58 2009(r199114) @@ -331,9 +331,6 @@ again: msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE); msgbufinit(msgbufp, MSGBUF_SIZE); - /* Steal memory for the dynamic per-cpu area. */ - dpcpu_init((void *)pmap_steal_memory(DPCPU_SIZE), 0); - /* * Steal thread0 kstack. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r217620 - head/sys/mips/cavium/cryptocteon
Author: gonzo Date: Thu Jan 20 05:44:36 2011 New Revision: 217620 URL: http://svn.freebsd.org/changeset/base/217620 Log: Fix build by changing format for size_t to %jd Modified: head/sys/mips/cavium/cryptocteon/cavium_crypto.c Modified: head/sys/mips/cavium/cryptocteon/cavium_crypto.c == --- head/sys/mips/cavium/cryptocteon/cavium_crypto.cThu Jan 20 04:59:11 2011(r217619) +++ head/sys/mips/cavium/cryptocteon/cavium_crypto.cThu Jan 20 05:44:36 2011(r217620) @@ -355,7 +355,7 @@ octo_des_cbc_encrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -418,7 +418,7 @@ octo_des_cbc_decrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -483,7 +483,7 @@ octo_aes_cbc_encrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -557,7 +557,7 @@ octo_aes_cbc_decrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -635,7 +635,7 @@ octo_null_md5_encrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || (auth_off & 0x7) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -741,7 +741,7 @@ octo_null_sha1_encrypt( if (__predict_false(od == NULL || iov==NULL || iovlen==0 || (auth_off & 0x7) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -858,7 +858,7 @@ octo_des_cbc_md5_encrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -1011,7 +1011,7 @@ octo_des_cbc_md5_decrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " "icv_off=%d ivp=%p\n", __func__, od, iov, iovlen, auth_off, auth_len, crypt_off, crypt_len, icv_off, ivp); @@ -1167,7 +1167,7 @@ octo_des_cbc_sha1_encrypt( (crypt_len & 0x7) || (auth_len & 0x7) || (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%d " + dprintf("%s: Bad parameters od=%p iov=%p iov
svn commit: r221753 - head/sys/mips/conf
Author: gonzo Date: Wed May 11 00:52:41 2011 New Revision: 221753 URL: http://svn.freebsd.org/changeset/base/221753 Log: Use new option names for NFS client and NFS server See UPDATING entry for 20110427 Modified: head/sys/mips/conf/ADM5120 head/sys/mips/conf/ALCHEMY head/sys/mips/conf/AR71XX head/sys/mips/conf/AR91XX_BASE head/sys/mips/conf/IDT head/sys/mips/conf/MALTA head/sys/mips/conf/MALTA64 head/sys/mips/conf/OCTEON1 head/sys/mips/conf/PB92 head/sys/mips/conf/QEMU head/sys/mips/conf/RT305X head/sys/mips/conf/SENTRY5 head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 head/sys/mips/conf/std.SWARM Modified: head/sys/mips/conf/ADM5120 == --- head/sys/mips/conf/ADM5120 Wed May 11 00:47:24 2011(r221752) +++ head/sys/mips/conf/ADM5120 Wed May 11 00:52:41 2011(r221753) @@ -33,8 +33,8 @@ options KDB optionsSCHED_4BSD #4BSD scheduler optionsINET#InterNETworking -optionsNFSCLIENT #Network Filesystem Client -optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT +optionsNFSCL #Network Filesystem Client +optionsNFS_ROOT#NFS usable as /, requires NFSCL optionsPSEUDOFS#Pseudo-filesystem framework #options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/ALCHEMY == --- head/sys/mips/conf/ALCHEMY Wed May 11 00:47:24 2011(r221752) +++ head/sys/mips/conf/ALCHEMY Wed May 11 00:52:41 2011(r221753) @@ -33,8 +33,8 @@ options KDB optionsSCHED_4BSD #4BSD scheduler optionsINET#InterNETworking -optionsNFSCLIENT #Network Filesystem Client -optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT +optionsNFSCL #Network Filesystem Client +optionsNFS_ROOT#NFS usable as /, requires NFSCL optionsPSEUDOFS#Pseudo-filesystem framework # options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/AR71XX == --- head/sys/mips/conf/AR71XX Wed May 11 00:47:24 2011(r221752) +++ head/sys/mips/conf/AR71XX Wed May 11 00:52:41 2011(r221753) @@ -19,8 +19,8 @@ options KDB optionsSCHED_4BSD #4BSD scheduler optionsINET#InterNETworking -optionsNFSCLIENT #Network Filesystem Client -optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT +optionsNFSCL #Network Filesystem Client +optionsNFS_ROOT#NFS usable as /, requires NFSCL optionsPSEUDOFS#Pseudo-filesystem framework options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/AR91XX_BASE == --- head/sys/mips/conf/AR91XX_BASE Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/AR91XX_BASE Wed May 11 00:52:41 2011 (r221753) @@ -29,7 +29,7 @@ options KDB optionsSCHED_4BSD #4BSD scheduler optionsINET#InterNETworking optionsINET6 #InterNETworking -optionsNFSCLIENT #Network Filesystem Client +optionsNFSCL #Network Filesystem Client optionsPSEUDOFS#Pseudo-filesystem framework options_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/IDT == --- head/sys/mips/conf/IDT Wed May 11 00:47:24 2011(r221752) +++ head/sys/mips/conf/IDT Wed May 11 00:52:41 2011(r221753) @@ -16,8 +16,8 @@ options KDB optionsSCHED_4BSD #4BSD scheduler optionsINET#InterNETworking -optionsNFSCLIENT #Network Filesystem Client -optionsNFS_ROOT#NFS usable as /, requires NFSCLIENT +optionsNFSCL #Network Filesystem Client +optionsNFS_ROOT#NFS usable as /, requires NFSCL optionsPSEUDOFS#Pseudo-filesystem framework options
Re: svn commit: r222143 - in head/sys: net netinet netinet6
On 20/05/2011 12:12 PM, Qing Li wrote: Author: qingli Date: Fri May 20 19:12:20 2011 New Revision: 222143 URL: http://svn.freebsd.org/changeset/base/222143 Log: The statically configured (permanent) ARP entries are removed when an interface is brought down, even though the interface address is still valid. This patch maintains the permanent ARP entries as long as the interface address (having the same prefix as that of the ARP entries) is valid. Reviewed by: delphij MFC after: 5 days This commit breaks netboot with NFS root: bootpc_init: wired to interface 'nlge1' nlge1: [10Mbps] Sending DHCP Discover packet from interface nlge1 (00:0f:30:00:20:4f) nlge1: [1000Mbps] nlge1: link state changed to UP Received DHCP Offer packet on nlge1 from 192.168.5.1 (accepted) (no root path) Sending DHCP Request packet from interface nlge1 (00:0f:30:00:20:4f) Received DHCP Ack packet on nlge1 from 192.168.5.1 (accepted) (got root path) nlge1 at 192.168.5.32 server 192.168.5.1 server name zoo.freebsd.org boot file /zoo/gonzo/lama1/boot/kernel/kernel subnet mask 255.255.255.0 root_server 192.168.5.1 rootfs /zoo/gonzo/lama1 rootopts nolockd Adjusted interface nlge1 Updating packet distribution for SMP Trying to mount root from nfs: []... nlge1: [1000Mbps] panic: nfs_mountroot: SIOCAIFADDR: 17 cpuid = 1 KDB: enter: panic [ thread pid 1 tid 11 ] Stopped at kdb_enter+0x8c: lui at,0x0 db> ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r190983 - svnadmin/conf
Author: gonzo Date: Mon Apr 13 03:04:12 2009 New Revision: 190983 URL: http://svn.freebsd.org/changeset/base/190983 Log: - Raise my commit limit for projects/mips "merge from head" Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf == --- svnadmin/conf/sizelimit.confMon Apr 13 00:32:34 2009 (r190982) +++ svnadmin/conf/sizelimit.confMon Apr 13 03:04:12 2009 (r190983) @@ -25,3 +25,4 @@ obrien thompsa sam rpaulo +gonzo ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r190985 - svnadmin/conf
Author: gonzo Date: Mon Apr 13 03:13:16 2009 New Revision: 190985 URL: http://svn.freebsd.org/changeset/base/190985 Log: - Revert size limit Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf == --- svnadmin/conf/sizelimit.confMon Apr 13 03:08:11 2009 (r190984) +++ svnadmin/conf/sizelimit.confMon Apr 13 03:13:16 2009 (r190985) @@ -25,4 +25,3 @@ obrien thompsa sam rpaulo -gonzo ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r191862 - svnadmin/conf
Author: gonzo Date: Wed May 6 22:31:04 2009 New Revision: 191862 URL: http://svn.freebsd.org/changeset/base/191862 Log: - Increase size limit for HEAD merge to projects/mips Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf == --- svnadmin/conf/sizelimit.confWed May 6 22:26:49 2009 (r191861) +++ svnadmin/conf/sizelimit.confWed May 6 22:31:04 2009 (r191862) @@ -26,3 +26,4 @@ thompsa sam rpaulo rwatson +gonzo ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r252064 - in head/sys: conf modules/runfw
Author: gonzo Date: Fri Jun 21 18:16:54 2013 New Revision: 252064 URL: http://svnweb.freebsd.org/changeset/base/252064 Log: Rename run(4) firmware file from runfw to run.fw. Previous name was the same as top-level target name for "device runfw" kernel option and caused cyclic dependancy that lead to kernel build breakage Module change is not strictly required and done for name unification sake PR: conf/175751 Submitted by: Issei Modified: head/sys/conf/files head/sys/modules/runfw/Makefile Modified: head/sys/conf/files == --- head/sys/conf/files Fri Jun 21 17:36:33 2013(r252063) +++ head/sys/conf/files Fri Jun 21 18:16:54 2013(r252064) @@ -2284,19 +2284,19 @@ dev/usb/net/uhso.c optional uhso dev/usb/wlan/if_rum.c optional rum dev/usb/wlan/if_run.c optional run runfw.coptional runfw \ - compile-with"${AWK} -f $S/tools/fw_stub.awk runfw:runfw -mrunfw -c${.TARGET}" \ + compile-with"${AWK} -f $S/tools/fw_stub.awk run.fw:runfw -mrunfw -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "runfw.c" runfw.fwo optional runfw \ - dependency "runfw" \ + dependency "run.fw" \ compile-with"${NORMAL_FWO}" \ no-implicit-rule \ clean "runfw.fwo" -runfw optional runfw \ +run.fw optional runfw \ dependency "$S/contrib/dev/run/rt2870.fw.uu" \ compile-with"${NORMAL_FW}" \ no-obj no-implicit-rule \ - clean "runfw" + clean "run.fw" dev/usb/wlan/if_uath.c optional uath dev/usb/wlan/if_upgt.c optional upgt dev/usb/wlan/if_ural.c optional ural Modified: head/sys/modules/runfw/Makefile == --- head/sys/modules/runfw/Makefile Fri Jun 21 17:36:33 2013 (r252063) +++ head/sys/modules/runfw/Makefile Fri Jun 21 18:16:54 2013 (r252064) @@ -1,11 +1,11 @@ # $FreeBSD$ KMOD= runfw -FIRMWS=runfw:runfw:1 +FIRMWS=run.fw:runfw:1 -CLEANFILES=runfw +CLEANFILES=run.fw -runfw: ${.CURDIR}/../../contrib/dev/run/rt2870.fw.uu +run.fw: ${.CURDIR}/../../contrib/dev/run/rt2870.fw.uu uudecode -p ${.CURDIR}/../../contrib/dev/run/rt2870.fw.uu > ${.TARGET} .include ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r252282 - head/sys/arm/ti/am335x
Author: gonzo Date: Thu Jun 27 00:33:08 2013 New Revision: 252282 URL: http://svnweb.freebsd.org/changeset/base/252282 Log: - Request non-cached memory for framebuffer - Properly probe/initialize syscons Modified: head/sys/arm/ti/am335x/am335x_lcd.c Modified: head/sys/arm/ti/am335x/am335x_lcd.c == --- head/sys/arm/ti/am335x/am335x_lcd.c Thu Jun 27 00:31:21 2013 (r252281) +++ head/sys/arm/ti/am335x/am335x_lcd.c Thu Jun 27 00:33:08 2013 (r252282) @@ -42,6 +42,10 @@ __FBSDID("$FreeBSD$"); #include #include +/* syscons bits */ +#include +#include + #include #include @@ -49,6 +53,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include #include @@ -395,12 +402,19 @@ am335x_lcd_intr(void *arg) static int am335x_lcd_probe(device_t dev) { + int err; + if (!ofw_bus_is_compatible(dev, "ti,am335x-lcd")) return (ENXIO); device_set_desc(dev, "AM335x LCD controller"); - return (0); + err = sc_probe_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD); + if (err != 0) + return (err); + + return (BUS_PROBE_DEFAULT); } static int @@ -480,7 +494,7 @@ am335x_lcd_attach(device_t dev) goto fail; err = bus_dmamem_alloc(sc->sc_dma_tag, (void **)&sc->sc_fb_base, - 0, &sc->sc_dma_map); + BUS_DMA_COHERENT, &sc->sc_dma_map); if (err) { device_printf(dev, "cannot allocate framebuffer\n"); @@ -631,6 +645,14 @@ am335x_lcd_attach(device_t dev) PWM_PERIOD, PWM_PERIOD) == 0) sc->sc_backlight = 100; + err = (sc_attach_unit(device_get_unit(dev), + device_get_flags(dev) | SC_AUTODETECT_KBD)); + + if (err) { + device_printf(dev, "failed to attach syscons\n"); + goto fail; + } + am335x_lcd_syscons_setup((vm_offset_t)sc->sc_fb_base, sc->sc_fb_phys, &panel); return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r252393 - head/sys/arm/versatile
Author: gonzo Date: Sat Jun 29 23:40:44 2013 New Revision: 252393 URL: http://svnweb.freebsd.org/changeset/base/252393 Log: Enable patth-through of IRQ30 and IRQ31 to PIC just as comment states Modified: head/sys/arm/versatile/versatile_sic.c Modified: head/sys/arm/versatile/versatile_sic.c == --- head/sys/arm/versatile/versatile_sic.c Sat Jun 29 23:39:38 2013 (r252392) +++ head/sys/arm/versatile/versatile_sic.c Sat Jun 29 23:40:44 2013 (r252393) @@ -110,7 +110,7 @@ versatile_sic_attach(device_t dev) * Let PCI and Ethernet interrupts pass through * IRQ25, IRQ27..IRQ31 */ - pass_irqs = (7 << 27) | (1 << 25); + pass_irqs = (0x1f << 27) | (1 << 25); sic_write_4(sc, SIC_PICENSET, pass_irqs); return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r252395 - head/sys/arm/versatile
Author: gonzo Date: Sat Jun 29 23:51:17 2013 New Revision: 252395 URL: http://svnweb.freebsd.org/changeset/base/252395 Log: - Fix IMAPx registers values calculation - Initialize SMAPx registers too although they're unused in QEMU - Do not pass IO/MEM resources to upper bus for activation, handle them locally. Previously ACTIVATE method of upper bus was no-op so nothing bad happened. But now FDT maps physaddr to vaddr and it causes troubles: fdtbus_activate_resource resource assumes that bustag/bushandle are already set which in this case is wrong. Modified: head/sys/arm/versatile/versatile_pci.c Modified: head/sys/arm/versatile/versatile_pci.c == --- head/sys/arm/versatile/versatile_pci.c Sat Jun 29 23:48:08 2013 (r252394) +++ head/sys/arm/versatile/versatile_pci.c Sat Jun 29 23:51:17 2013 (r252395) @@ -173,16 +173,17 @@ versatile_pci_attach(device_t dev) /* * Setup memory windows */ - versatile_pci_core_write_4(PCI_CORE_IMAP0, (PCI_IO_WINDOW >> 11)); - versatile_pci_core_write_4(PCI_CORE_IMAP1, (PCI_NPREFETCH_WINDOW >> 11)); - versatile_pci_core_write_4(PCI_CORE_IMAP2, (PCI_PREFETCH_WINDOW >> 11)); + versatile_pci_core_write_4(PCI_CORE_IMAP0, (PCI_IO_WINDOW >> 28)); + versatile_pci_core_write_4(PCI_CORE_IMAP1, (PCI_NPREFETCH_WINDOW >> 28)); + versatile_pci_core_write_4(PCI_CORE_IMAP2, (PCI_PREFETCH_WINDOW >> 28)); /* * XXX: this is SDRAM offset >> 28 +* Unused as of QEMU 1.5 */ - versatile_pci_core_write_4(PCI_CORE_SMAP0, 0); - versatile_pci_core_write_4(PCI_CORE_SMAP1, 0); - versatile_pci_core_write_4(PCI_CORE_SMAP2, 0); + versatile_pci_core_write_4(PCI_CORE_SMAP0, (PCI_IO_WINDOW >> 28)); + versatile_pci_core_write_4(PCI_CORE_SMAP1, (PCI_NPREFETCH_WINDOW >> 28)); + versatile_pci_core_write_4(PCI_CORE_SMAP2, (PCI_NPREFETCH_WINDOW >> 28)); versatile_pci_sys_write_4(SYS_PCICTL, 1); @@ -307,7 +308,7 @@ versatile_pci_alloc_resource(device_t bu struct resource *rv; struct rman *rm; - printf("Alloc resources %d, %08lx..%08lx, %ld\n", type, start, end, count); + dprintf("Alloc resources %d, %08lx..%08lx, %ld\n", type, start, end, count); switch (type) { case SYS_RES_IOPORT: @@ -344,20 +345,23 @@ versatile_pci_activate_resource(device_t struct resource *r) { vm_offset_t vaddr; - int res = (BUS_ACTIVATE_RESOURCE(device_get_parent(bus), - child, type, rid, r)); + int res; - if (!res) { - switch(type) { - case SYS_RES_MEMORY: - case SYS_RES_IOPORT: - vaddr = (vm_offset_t)pmap_mapdev(rman_get_start(r), - rman_get_size(r)); - rman_set_bushandle(r, vaddr); - rman_set_bustag(r, versatile_bus_space_pcimem); - break; - } + switch(type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + vaddr = (vm_offset_t)pmap_mapdev(rman_get_start(r), + rman_get_size(r)); + rman_set_bushandle(r, vaddr); + rman_set_bustag(r, versatile_bus_space_pcimem); + res = rman_activate_resource(r); + break; + case SYS_RES_IRQ: + res = (BUS_ACTIVATE_RESOURCE(device_get_parent(bus), + child, type, rid, r)); + break; } + return (res); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r252652 - head/sys/arm/arm
Author: gonzo Date: Wed Jul 3 23:38:02 2013 New Revision: 252652 URL: http://svnweb.freebsd.org/changeset/base/252652 Log: Fix one of INVARIANTS-related UMA panics on ARM Force UMA zone to allocate service structures like slabs using own allocator. uma_debug code performs atomic ops on uma_slab_t fields and safety of this operation is not guaranteed for write-back caches Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c == --- head/sys/arm/arm/busdma_machdep-v6.cWed Jul 3 23:29:40 2013 (r252651) +++ head/sys/arm/arm/busdma_machdep-v6.cWed Jul 3 23:38:02 2013 (r252652) @@ -192,14 +192,26 @@ static busdma_bufalloc_t standard_alloca static void busdma_init(void *dummy) { + int uma_flags; + + uma_flags = 0; /* Create a cache of buffers in standard (cacheable) memory. */ standard_allocator = busdma_bufalloc_create("buffer", arm_dcache_align, /* minimum_alignment */ NULL, /* uma_alloc func */ NULL, /* uma_free func */ - 0); /* uma_zcreate_flags */ + uma_flags); /* uma_zcreate_flags */ +#ifdef INVARIANTS + /* +* Force UMA zone to allocate service structures like +* slabs using own allocator. uma_debug code performs +* atomic ops on uma_slab_t fields and safety of this +* operation is not guaranteed for write-back caches +*/ + uma_flags = UMA_ZONE_OFFPAGE; +#endif /* * Create a cache of buffers in uncacheable memory, to implement the * BUS_DMA_COHERENT (and potentially BUS_DMA_NOCACHE) flag. @@ -208,7 +220,7 @@ busdma_init(void *dummy) arm_dcache_align, /* minimum_alignment */ busdma_bufalloc_alloc_uncacheable, busdma_bufalloc_free_uncacheable, - 0); /* uma_zcreate_flags */ + uma_flags); /* uma_zcreate_flags */ } /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r252719 - head/sys/boot/fdt/dts
Author: gonzo Date: Thu Jul 4 20:08:42 2013 New Revision: 252719 URL: http://svnweb.freebsd.org/changeset/base/252719 Log: Add nodes for PWMSS1 and PWMSS2 Modified: head/sys/boot/fdt/dts/am335x.dtsi Modified: head/sys/boot/fdt/dts/am335x.dtsi == --- head/sys/boot/fdt/dts/am335x.dtsi Thu Jul 4 19:47:46 2013 (r252718) +++ head/sys/boot/fdt/dts/am335x.dtsi Thu Jul 4 20:08:42 2013 (r252719) @@ -155,7 +155,7 @@ compatible = "ti,am335x-pwm"; #address-cells = <1>; #size-cells = <1>; - reg = < 0x4830 0x100/* PWMSS */ + reg = < 0x4830 0x100/* PWMSS0 */ 0x48300100 0x80 /* eCAP0 */ 0x48300180 0x80 /* eQEP0 */ 0x48300200 0x60 /* ePWM0 */ @@ -165,6 +165,34 @@ pwm-device-id = <0>; }; + pwm@48302000 { + compatible = "ti,am335x-pwm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x48302000 0x100/* PWMSS1 */ + 0x48302100 0x80 /* eCAP1 */ + 0x48302180 0x80 /* eQEP1 */ + 0x48302200 0x60 /* ePWM1 */ + >; + interrupts = <87 59>; /* ePWM1INT, ePWM1_TZINT */ + interrupt-parent = <&AINTC>; + pwm-device-id = <1>; + }; + + pwm@48304000 { + compatible = "ti,am335x-pwm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x48304000 0x100/* PWMSS2 */ + 0x48304100 0x80 /* eCAP2 */ + 0x48304180 0x80 /* eQEP2 */ + 0x48304200 0x60 /* ePWM2 */ + >; + interrupts = <88 60>; /* ePWM2INT, ePWM2_TZINT */ + interrupt-parent = <&AINTC>; + pwm-device-id = <2>; + }; + lcd: lcd@4830e000 { #address-cells = <1>; #size-cells = <0>; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r252722 - head/sys/arm/ti/am335x
Author: gonzo Date: Thu Jul 4 20:13:22 2013 New Revision: 252722 URL: http://svnweb.freebsd.org/changeset/base/252722 Log: Add support for ePWM submodule of PWMSS ePWM is controlled by sysctl nodes dev.am335x_pwm.N.period, dev.am335x_pwm.N.dutyA and dev.am335x_pwm.N.dutyB that controls PWM period and duty cycles for channels A and B respectively. Period and duty cycle are measured in clock ticks. Default clock frequency for AM335x PWM subsystem is 100MHz Modified: head/sys/arm/ti/am335x/am335x_pwm.c Modified: head/sys/arm/ti/am335x/am335x_pwm.c == --- head/sys/arm/ti/am335x/am335x_pwm.c Thu Jul 4 20:12:12 2013 (r252721) +++ head/sys/arm/ti/am335x/am335x_pwm.c Thu Jul 4 20:13:22 2013 (r252722) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -50,6 +51,9 @@ __FBSDID("$FreeBSD$"); #include "am335x_pwm.h" #include "am335x_scm.h" +/* In ticks */ +#defineDEFAULT_PWM_PERIOD 1000 + #definePWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #definePWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #definePWM_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ @@ -96,15 +100,24 @@ static struct resource_spec am335x_pwm_m #defineECCTL2_TSCTRSTOP_FREERUN(1 << 4) #defineEPWM_TBCTL 0x00 +#defineTBCTL_FREERUN (2 << 14) #defineTBCTL_PHDIR_UP (1 << 13) #defineTBCTL_PHDIR_DOWN(0 << 13) #defineTBCTL_CLKDIV(x) ((x) << 10) +#defineTBCTL_CLKDIV_MASK (3 << 10) #defineTBCTL_HSPCLKDIV(x) ((x) << 7) +#defineTBCTL_HSPCLKDIV_MASK(3 << 7) #defineTBCTL_SYNCOSEL_DISABLED (3 << 4) #defineTBCTL_PRDLD_SHADOW (0 << 3) #defineTBCTL_PRDLD_IMMEDIATE (0 << 3) #defineTBCTL_PHSEN_ENABLED (1 << 2) #defineTBCTL_PHSEN_DISABLED(0 << 2) +#defineTBCTL_CTRMODE_MASK (3) +#defineTBCTL_CTRMODE_UP(0 << 0) +#defineTBCTL_CTRMODE_DOWN (1 << 0) +#defineTBCTL_CTRMODE_UPDOWN(2 << 0) +#defineTBCTL_CTRMODE_FREEZE(3 << 0) + #defineEPWM_TBSTS 0x02 #defineEPWM_TBPHSHR0x04 #defineEPWM_TBPHS 0x06 @@ -130,10 +143,14 @@ static struct resource_spec am335x_pwm_m /* CMPCTL_LOADAMODE_ZERO */ #defineEPWM_AQCTLA 0x16 #defineEPWM_AQCTLB 0x18 -#defineAQCTL_CAU_NONE (0 << 0) -#defineAQCTL_CAU_CLEAR (1 << 0) -#defineAQCTL_CAU_SET (2 << 0) -#defineAQCTL_CAU_TOGGLE(3 << 0) +#defineAQCTL_CBU_NONE (0 << 8) +#defineAQCTL_CBU_CLEAR (1 << 8) +#defineAQCTL_CBU_SET (2 << 8) +#defineAQCTL_CBU_TOGGLE(3 << 8) +#defineAQCTL_CAU_NONE (0 << 4) +#defineAQCTL_CAU_CLEAR (1 << 4) +#defineAQCTL_CAU_SET (2 << 4) +#defineAQCTL_CAU_TOGGLE(3 << 4) #defineAQCTL_ZRO_NONE (0 << 0) #defineAQCTL_ZRO_CLEAR (1 << 0) #defineAQCTL_ZRO_SET (2 << 0) @@ -141,6 +158,15 @@ static struct resource_spec am335x_pwm_m #defineEPWM_AQSFRC 0x1a #defineEPWM_AQCSFRC0x1c +/* Trip-Zone module */ +#defineEPWM_TZCTL 0x28 +#defineEPWM_TZFLG 0x2C +/* High-Resolution PWM */ +#defineEPWM_HRCTL 0x40 +#defineHRCTL_DELMODE_BOTH 3 +#defineHRCTL_DELMODE_FALL 2 +#defineHRCTL_DELMODE_RISE 1 + static device_probe_t am335x_pwm_probe; static device_attach_t am335x_pwm_attach; static device_detach_t am335x_pwm_detach; @@ -150,6 +176,13 @@ struct am335x_pwm_softc { struct mtx sc_mtx; struct resource *sc_mem_res[4]; int sc_id; + /* sysctl for configuration */ + struct sysctl_oid *sc_period_oid; + struct sysctl_oid *sc_chanA_oid; + struct sysctl_oid *sc_chanB_oid; + uint32_tsc_pwm_period; + uint32_tsc_pwm_dutyA; + uint32_tsc_pwm_dutyB; }; static device_method_t am335x_pwm_methods[] = { @@ -209,6 +242,71 @@ am335x_pwm_config_ecas(int unit, int per } static int +am335x_pwm_sysctl_duty(SYSCTL_HANDLER_ARGS) +{ + struct am335x_pwm_softc *sc = (struct am335x_pwm_softc*)arg1; + int error; + uint32_t du
svn commit: r252912 - head/sys/dev/usb/controller
Author: gonzo Date: Sun Jul 7 04:18:35 2013 New Revision: 252912 URL: http://svnweb.freebsd.org/changeset/base/252912 Log: - Add initial host mode support for Mentor Graphics USB OTG controller - Sync musb_otg_atmelarm with new core logic API Modified: head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/musb_otg.h head/sys/dev/usb/controller/musb_otg_atmelarm.c Modified: head/sys/dev/usb/controller/musb_otg.c == --- head/sys/dev/usb/controller/musb_otg.c Sun Jul 7 04:16:31 2013 (r252911) +++ head/sys/dev/usb/controller/musb_otg.c Sun Jul 7 04:18:35 2013 (r252912) @@ -95,6 +95,8 @@ SYSCTL_INT(_hw_usb_musbotg, OID_AUTO, de &musbotgdebug, 0, "Debug level"); #endif +#defineMAX_NAK_TO 16 + /* prototypes */ struct usb_bus_methods musbotg_bus_methods; @@ -103,17 +105,35 @@ struct usb_pipe_methods musbotg_device_c struct usb_pipe_methods musbotg_device_intr_methods; struct usb_pipe_methods musbotg_device_isoc_methods; -static musbotg_cmd_t musbotg_setup_rx; -static musbotg_cmd_t musbotg_setup_data_rx; -static musbotg_cmd_t musbotg_setup_data_tx; -static musbotg_cmd_t musbotg_setup_status; -static musbotg_cmd_t musbotg_data_rx; -static musbotg_cmd_t musbotg_data_tx; +/* Control transfers: Device mode */ +static musbotg_cmd_t musbotg_dev_ctrl_setup_rx; +static musbotg_cmd_t musbotg_dev_ctrl_data_rx; +static musbotg_cmd_t musbotg_dev_ctrl_data_tx; +static musbotg_cmd_t musbotg_dev_ctrl_status; + +/* Control transfers: Host mode */ +static musbotg_cmd_t musbotg_host_ctrl_setup_tx; +static musbotg_cmd_t musbotg_host_ctrl_data_rx; +static musbotg_cmd_t musbotg_host_ctrl_data_tx; +static musbotg_cmd_t musbotg_host_ctrl_status_rx; +static musbotg_cmd_t musbotg_host_ctrl_status_tx; + +/* Bulk, Interrupt, Isochronous: Device mode */ +static musbotg_cmd_t musbotg_dev_data_rx; +static musbotg_cmd_t musbotg_dev_data_tx; + +/* Bulk, Interrupt, Isochronous: Host mode */ +static musbotg_cmd_t musbotg_host_data_rx; +static musbotg_cmd_t musbotg_host_data_tx; + static voidmusbotg_device_done(struct usb_xfer *, usb_error_t); static voidmusbotg_do_poll(struct usb_bus *); static voidmusbotg_standard_done(struct usb_xfer *); static voidmusbotg_interrupt_poll(struct musbotg_softc *); static voidmusbotg_root_intr(struct musbotg_softc *); +static int musbotg_channel_alloc(struct musbotg_softc *, struct musbotg_td *td); +static voidmusbotg_channel_free(struct musbotg_softc *, struct musbotg_td *td); +static voidmusbotg_ep_int_set(struct musbotg_softc *sc, int channel, int on); /* * Here is a configuration that the chip supports. @@ -128,6 +148,64 @@ static const struct usb_hw_ep_profile mu } }; +static int +musbotg_channel_alloc(struct musbotg_softc *sc, struct musbotg_td *td) +{ + int ch; + int ep; + + ep = td->ep_no; + + /* In device mode each EP got its own channel */ + if (sc->sc_mode == MUSB2_DEVICE_MODE) { + musbotg_ep_int_set(sc, ep, 1); + return (ep); + } + + /* +* All control transactions go through EP0 +*/ + if (ep == 0) { + if (sc->sc_channel_mask & (1 << 0)) + return (-1); + sc->sc_channel_mask |= (1 << 0); + musbotg_ep_int_set(sc, ep, 1); + return (0); + } + + for (ch = 1; ch < MUSB2_EP_MAX; ch++) { + if (!(sc->sc_channel_mask & (1 << ch))) { + sc->sc_channel_mask |= (1 << ch); + musbotg_ep_int_set(sc, ch, 1); + return (ch); + } + } + + DPRINTFN(-1, "No available channels. Mask: %04x\n", sc->sc_channel_mask); + + return (-1); +} + +static void +musbotg_channel_free(struct musbotg_softc *sc, struct musbotg_td *td) +{ + + DPRINTFN(1, "ep_no=%d\n", td->channel); + + if (sc->sc_mode == MUSB2_DEVICE_MODE) + return; + + if (td == NULL) + return; + if (td->channel == -1) + return; + + musbotg_ep_int_set(sc, td->channel, 0); + sc->sc_channel_mask &= ~(1 << td->channel); + + td->channel = -1; +} + static void musbotg_get_hw_ep_profile(struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr) @@ -218,6 +296,46 @@ musbotg_pull_down(struct musbotg_softc * } static void +musbotg_suspend_host(struct musbotg_softc *sc) +{ + uint8_t temp; + + if (sc->sc_flags.status_suspend) { + return; + } + + temp = MUSB2_READ_1(sc, MUSB2_REG_POWER); + temp |= MUSB2_MASK_SUSPMODE; + MUSB2_WRITE_1(sc, MUSB2_REG_POWER, temp); + sc->sc_flags.status_suspend = 1; +} + +static void +musbotg_wakeup_host(struct musbotg_softc *sc) +{ + uint8_t temp; + + if (!(sc->sc_flags.stat
svn commit: r252913 - head/sys/arm/ti/am335x
Author: gonzo Date: Sun Jul 7 04:22:08 2013 New Revision: 252913 URL: http://svnweb.freebsd.org/changeset/base/252913 Log: - Add USBSS driver for AM335x SoC. Driver is a wrapper around Mentors Graphic USB OTG core. Added: head/sys/arm/ti/am335x/am335x_usbss.c (contents, props changed) Modified: head/sys/arm/ti/am335x/files.am335x Added: head/sys/arm/ti/am335x/am335x_usbss.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_usbss.c Sun Jul 7 04:22:08 2013 (r252913) @@ -0,0 +1,481 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#defineUSB_DEBUG_VAR usbssdebug + +#include +#include +#include +#include + +#include + +#include +#include +#include + +#defineAM335X_USB_PORTS2 + +#defineUSBSS_REVREG0x00 +#defineUSBSS_SYSCONFIG 0x10 +#defineUSBSS_SYSCONFIG_SRESET 1 + +#define USBCTRL_REV0x00 +#define USBCTRL_CTRL 0x14 +#define USBCTRL_STAT 0x18 +#define USBCTRL_IRQ_STAT0 0x30 +#defineIRQ_STAT0_RXSHIFT 16 +#defineIRQ_STAT0_TXSHIFT 0 +#define USBCTRL_IRQ_STAT1 0x34 +#defineIRQ_STAT1_DRVVBUS (1 << 8) +#define USBCTRL_INTEN_SET0 0x38 +#define USBCTRL_INTEN_SET1 0x3C +#defineUSBCTRL_INTEN_USB_ALL 0x1ff +#defineUSBCTRL_INTEN_USB_SOF (1 << 3) +#define USBCTRL_INTEN_CLR0 0x40 +#define USBCTRL_INTEN_CLR1 0x44 +#define USBCTRL_UTMI 0xE0 +#defineUSBCTRL_UTMI_FSDATAEXT (1 << 1) +#define USBCTRL_MODE 0xE8 +#defineUSBCTRL_MODE_IDDIG (1 << 8) +#defineUSBCTRL_MODE_IDDIGMUX (1 << 7) + +/* USBSS resource + 2 MUSB ports */ + +#define RES_USBSS 0 +#define RES_USBCTRL(i) (3*i+1) +#define RES_USBPHY(i) (3*i+2) +#define RES_USBCORE(i) (3*i+3) + +#defineUSB_WRITE4(sc, idx, reg, val) do {\ + bus_write_4((sc)->sc_mem_res[idx], (reg), (val)); \ +} while (0) + +#defineUSB_READ4(sc, idx, reg) bus_read_4((sc)->sc_mem_res[idx], (reg)) + +#defineUSBSS_WRITE4(sc, reg, val) \ +USB_WRITE4((sc), RES_USBSS, (reg), (val)) +#defineUSBSS_READ4(sc, reg)\ +USB_READ4((sc), RES_USBSS, (reg)) +#defineUSBCTRL_WRITE4(sc, unit, reg, val) \ +USB_WRITE4((sc), RES_USBCTRL(unit), (reg), (val)) +#defineUSBCTRL_READ4(sc, unit, reg)\ +USB_READ4((sc), RES_USBCTRL(unit), (reg)) +#defineUSBPHY_WRITE4(sc, unit, reg, val) \ +USB_WRITE4((sc), RES_USBPHY(unit), (reg), (val)) +#defineUSBPHY_READ4(sc, unit, reg) \ +USB_READ4((sc), RES_USBPHY(unit), (reg)) + +static struct resource_spec am335x_musbotg_mem_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, + { SYS_RES_MEMORY, 2, RF_ACTIVE }, + { SYS_RES_MEMORY, 3, RF_ACTIVE }, + { SYS_RES_MEMORY, 4, RF_ACTIVE }, + { SYS_RES_MEMORY, 5, RF_ACTIVE }, + { SYS_RES_MEMORY, 6, RF_ACTIVE },
svn commit: r252914 - head/sys/boot/fdt/dts
Author: gonzo Date: Sun Jul 7 04:23:29 2013 New Revision: 252914 URL: http://svnweb.freebsd.org/changeset/base/252914 Log: - Add musb node to shared dtsi and proper pin configuratin for every AM553x-based device Modified: head/sys/boot/fdt/dts/am335x-evm.dts head/sys/boot/fdt/dts/am335x.dtsi head/sys/boot/fdt/dts/beaglebone-black.dts head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/am335x-evm.dts == --- head/sys/boot/fdt/dts/am335x-evm.dtsSun Jul 7 04:22:08 2013 (r252913) +++ head/sys/boot/fdt/dts/am335x-evm.dtsSun Jul 7 04:23:29 2013 (r252914) @@ -106,6 +106,9 @@ "GPMC_BEn0_CLE", "timer5", "output", "GPMC_WEn", "timer6", "output", "GPMC_OEn_REn", "timer7", "output", + /* USB0 and USB1 */ + "USB0_DRVVBUS", "USB0_DRVVBUS", "output", + "USB1_DRVVBUS", "USB1_DRVVBUS", "output", /* LCD */ "GPMC_AD8", "lcd_data23", "output", "GPMC_AD9", "lcd_data22", "output", Modified: head/sys/boot/fdt/dts/am335x.dtsi == --- head/sys/boot/fdt/dts/am335x.dtsi Sun Jul 7 04:22:08 2013 (r252913) +++ head/sys/boot/fdt/dts/am335x.dtsi Sun Jul 7 04:23:29 2013 (r252914) @@ -201,5 +201,23 @@ interrupts = <36>; interrupt-parent = <&AINTC>; }; + + usb@4740 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,musb-am33xx"; + reg =< 0x4740 0x1000 /* USBSS */ + 0x47401000 0x300/* USB0 */ + 0x47401300 0x100/* USB0_PHY */ + 0x47401400 0x400/* USB0_CORE */ + 0x47401800 0x300/* USB1 */ + 0x47401B00 0x100/* USB1_PHY */ + 0x47401C00 0x400/* USB1_CORE */ + >; + interrupts = <17 18 19>; + interrupt-parent = <&AINTC>; + /* 1 - Host Mode, 0 - Device Mode */ + modemask = <2>; + }; }; }; Modified: head/sys/boot/fdt/dts/beaglebone-black.dts == --- head/sys/boot/fdt/dts/beaglebone-black.dts Sun Jul 7 04:22:08 2013 (r252913) +++ head/sys/boot/fdt/dts/beaglebone-black.dts Sun Jul 7 04:23:29 2013 (r252914) @@ -123,6 +123,9 @@ "GPMC_BEn0_CLE", "timer5", "output", "GPMC_WEn", "timer6", "output", "GPMC_OEn_REn", "timer7", "output", + /* USB0 and USB1 */ + "USB0_DRVVBUS", "USB0_DRVVBUS", "output", + "USB1_DRVVBUS", "USB1_DRVVBUS", "output", /* PWM */ "GPMC_A2", "ehrpwm1A", "output", "GPMC_A3", "ehrpwm1B", "output", Modified: head/sys/boot/fdt/dts/beaglebone.dts == --- head/sys/boot/fdt/dts/beaglebone.dtsSun Jul 7 04:22:08 2013 (r252913) +++ head/sys/boot/fdt/dts/beaglebone.dtsSun Jul 7 04:23:29 2013 (r252914) @@ -74,6 +74,9 @@ "MMC0_DAT1", "mmc0_dat1", "input_pullup", "MMC0_DAT2", "mmc0_dat2", "input_pullup", "MMC0_DAT3", "mmc0_dat3", "input_pullup", + /* USB0 and USB1 */ + "USB0_DRVVBUS", "USB0_DRVVBUS", "output", + "USB1_DRVVBUS", "USB1_DRVVBUS", "output", /* GPIO */ "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", "GPMC_AD10", "gpio0_26", "input_pulldown", ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r252915 - head/sys/arm/conf
Author: gonzo Date: Sun Jul 7 04:24:38 2013 New Revision: 252915 URL: http://svnweb.freebsd.org/changeset/base/252915 Log: - Add USFS driver as an example of device mode for AM335x-based devices Modified: head/sys/arm/conf/BEAGLEBONE Modified: head/sys/arm/conf/BEAGLEBONE == --- head/sys/arm/conf/BEAGLEBONESun Jul 7 04:23:29 2013 (r252914) +++ head/sys/arm/conf/BEAGLEBONESun Jul 7 04:24:38 2013 (r252915) @@ -123,6 +123,10 @@ device bpf device miibus device axe # ASIX Electronics USB Ethernet +# Device mode support and USFS template +device usb_template# Control of the gadget +device usfs + # Flattened Device Tree options FDT options FDT_DTB_STATIC ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r252912 - head/sys/dev/usb/controller
On 2013-07-06, at 9:18 PM, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Sun Jul 7 04:18:35 2013 > New Revision: 252912 > URL: http://svnweb.freebsd.org/changeset/base/252912 > > Log: > - Add initial host mode support for Mentor Graphics USB OTG controller > - Sync musb_otg_atmelarm with new core logic API Reviewed by: hselasky@ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r253023 - head/sys/arm/ti
Author: gonzo Date: Mon Jul 8 04:27:03 2013 New Revision: 253023 URL: http://svnweb.freebsd.org/changeset/base/253023 Log: - AM335x requires updated soft-reset logic too Modified: head/sys/arm/ti/ti_mmchs.c Modified: head/sys/arm/ti/ti_mmchs.c == --- head/sys/arm/ti/ti_mmchs.c Mon Jul 8 02:03:18 2013(r253022) +++ head/sys/arm/ti/ti_mmchs.c Mon Jul 8 04:27:03 2013(r253023) @@ -213,10 +213,13 @@ ti_mmchs_reset_controller(struct ti_mmch sysctl = ti_mmchs_read_4(sc, MMCHS_SYSCTL); ti_mmchs_write_4(sc, MMCHS_SYSCTL, sysctl | bit); - if ((ti_chip() == CHIP_OMAP_4) && (ti_revision() > OMAP4430_REV_ES1_0)) { - /* OMAP4 ES2 and greater has an updated reset logic. -* Monitor a 0->1 transition first -*/ + + /* +* AM335x and OMAP4 ES2 and greater has an updated reset logic. +* Monitor a 0->1 transition first +*/ + if ((ti_chip() == CHIP_AM335X) || + ((ti_chip() == CHIP_OMAP_4) && (ti_revision() > OMAP4430_REV_ES1_0))) { attempts = 1; while (!(ti_mmchs_read_4(sc, MMCHS_SYSCTL) & bit) && (attempts-- > 0)) continue; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r253024 - head/sys/boot/fdt/dts
Author: gonzo Date: Mon Jul 8 04:30:12 2013 New Revision: 253024 URL: http://svnweb.freebsd.org/changeset/base/253024 Log: - MMC1 (internal eMMC) pins should be configured as input-pullup, except for reset pin Modified: head/sys/boot/fdt/dts/beaglebone-black.dts Modified: head/sys/boot/fdt/dts/beaglebone-black.dts == --- head/sys/boot/fdt/dts/beaglebone-black.dts Mon Jul 8 04:27:03 2013 (r253023) +++ head/sys/boot/fdt/dts/beaglebone-black.dts Mon Jul 8 04:30:12 2013 (r253024) @@ -76,17 +76,17 @@ "MMC0_DAT2", "mmc0_dat2", "input_pullup", "MMC0_DAT3", "mmc0_dat3", "input_pullup", /* MMC1 */ - "GPMC_CSn1", "mmc1_clk", "input_pulldown", - "GPMC_CSn2", "mmc1_cmd", "input_pulldown", - "GPMC_CSn3", "gpio2_0", "output", /* Reset */ - "GPMC_AD0", "mmc1_dat0", "input_pulldown", - "GPMC_AD1", "mmc1_dat1", "input_pulldown", - "GPMC_AD2", "mmc1_dat2", "input_pulldown", - "GPMC_AD3", "mmc1_dat3", "input_pulldown", - "GPMC_AD4", "mmc1_dat4", "input_pulldown", - "GPMC_AD5", "mmc1_dat5", "input_pulldown", - "GPMC_AD6", "mmc1_dat6", "input_pulldown", - "GPMC_AD7", "mmc1_dat7", "input_pulldown", + "GPMC_CSn1", "mmc1_clk", "input_pullup", + "GPMC_CSn2", "mmc1_cmd", "input_pullup", + "GPMC_CSn3", "gpio2_0", "output_pullup", /* Reset */ + "GPMC_AD0", "mmc1_dat0", "input_pullup", + "GPMC_AD1", "mmc1_dat1", "input_pullup", + "GPMC_AD2", "mmc1_dat2", "input_pullup", + "GPMC_AD3", "mmc1_dat3", "input_pullup", + "GPMC_AD4", "mmc1_dat4", "input_pullup", + "GPMC_AD5", "mmc1_dat5", "input_pullup", + "GPMC_AD6", "mmc1_dat6", "input_pullup", + "GPMC_AD7", "mmc1_dat7", "input_pullup", /* GPIO */ "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", "GPMC_AD10", "gpio0_26", "input_pulldown", ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r253025 - head/sys/arm/ti/am335x
Author: gonzo Date: Mon Jul 8 05:06:32 2013 New Revision: 253025 URL: http://svnweb.freebsd.org/changeset/base/253025 Log: Add IDs for TPS65217C and TPS65217D Modified: head/sys/arm/ti/am335x/am335x_pmic.c Modified: head/sys/arm/ti/am335x/am335x_pmic.c == --- head/sys/arm/ti/am335x/am335x_pmic.cMon Jul 8 04:30:12 2013 (r253024) +++ head/sys/arm/ti/am335x/am335x_pmic.cMon Jul 8 05:06:32 2013 (r253025) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #define TPS65217A 0x7 #define TPS65217B 0xF +#define TPS65217C 0xE +#define TPS65217D 0x6 /* TPS65217 Reisters */ #define TPS65217_CHIPID_REG0x00 @@ -131,6 +133,12 @@ am335x_pmic_start(void *xdev) case TPS65217B: sprintf(name, "TPS65217B ver 1.%u", reg & 0xF); break; + case TPS65217C: + sprintf(name, "TPS65217C ver 1.%u", reg & 0xF); + break; + case TPS65217D: + sprintf(name, "TPS65217D ver 1.%u", reg & 0xF); + break; default: sprintf(name, "Unknown PMIC"); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r249181 - head/sys/arm/ti
Author: gonzo Date: Sat Apr 6 03:31:28 2013 New Revision: 249181 URL: http://svnweb.freebsd.org/changeset/base/249181 Log: Properly clean "spurious interrupt" state Suggested by: Ian Lepore Modified: head/sys/arm/ti/aintc.c Modified: head/sys/arm/ti/aintc.c == --- head/sys/arm/ti/aintc.c Sat Apr 6 00:47:33 2013(r249180) +++ head/sys/arm/ti/aintc.c Sat Apr 6 03:31:28 2013(r249181) @@ -157,6 +157,7 @@ arm_get_next_irq(int last_irq) if ((active_irq & 0xff80)) { device_printf(ti_aintc_sc->sc_dev, "Spurious interrupt detected (0x%08x)\n", active_irq); + aintc_write_4(INTC_SIR_IRQ, 0); return -1; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r249774 - head/sys/boot/fdt/dts
Author: gonzo Date: Mon Apr 22 18:53:36 2013 New Revision: 249774 URL: http://svnweb.freebsd.org/changeset/base/249774 Log: Split BeagleBone DTS to generic AM335x part and Beagle-bone specific Added: head/sys/boot/fdt/dts/am335x.dtsi (contents, props changed) Modified: head/sys/boot/fdt/dts/beaglebone.dts Added: head/sys/boot/fdt/dts/am335x.dtsi == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/am335x.dtsi Mon Apr 22 18:53:36 2013 (r249774) @@ -0,0 +1,225 @@ +/*- + * Copyright (c) 2012 Damjan Marion + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/ { + compatible = "ti,am335x"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-parent = <&AINTC>; + + SOC: am335x { + #address-cells = <1>; + #size-cells = <1>; + compatible = "simple-bus"; + ranges; + bus-frequency = <0>; + + AINTC: interrupt-controller@4820 { + compatible = "ti,aintc"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = < 0x4820 0x1000 >; + }; + + scm@44e1 { + compatible = "ti,scm"; + reg = < 0x44e1 0x2000 >; + /* Set of triplets < padname, muxname, padstate> */ + scm-pad-config = + /* I2C0 */ + "I2C0_SDA", "I2C0_SDA","i2c", + "I2C0_SCL", "I2C0_SCL","i2c", + /* Ethernet */ + "MII1_RX_ER", "gmii1_rxerr", "input_pulldown", + "MII1_TX_EN", "gmii1_txen", "output", + "MII1_RX_DV", "gmii1_rxdv", "input_pulldown", + "MII1_TXD3", "gmii1_txd3", "output", + "MII1_TXD2", "gmii1_txd2", "output", + "MII1_TXD1", "gmii1_txd1", "output", + "MII1_TXD0", "gmii1_txd0", "output", + "MII1_TX_CLK", "gmii1_txclk", "input_pulldown", + "MII1_RX_CLK", "gmii1_rxclk", "input_pulldown", + "MII1_RXD3", "gmii1_rxd3", "input_pulldown", + "MII1_RXD2", "gmii1_rxd2", "input_pulldown", + "MII1_RXD1", "gmii1_rxd1", "input_pulldown", + "MII1_RXD0", "gmii1_rxd0", "input_pulldown", + "MDIO", "mdio_data", "input_pullup", + "MDC", "mdio_clk", "output_pullup", + /* MMCSD0 */ + "MMC0_CMD", "mmc0_cmd", "input_pullup", + "MMC0_CLK", "mmc0_clk", "input_pullup", + "MMC0_DAT0", "mmc0_dat0", "input_pullup", + "MMC0_DAT1", "mmc0_dat1", "input_pullup", + "MMC0_DAT2", "mmc0_dat2", "input_pullup", + "MMC0_DAT3", "mmc0_dat3", "input_pullup", + /* GPIO */ + "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", + "GPMC_AD10", "gpio0_26", "input_pulldown", + "GPMC_AD11", "gpio0_27", "input_pulldow
svn commit: r249946 - head/sys/boot/fdt/dts
Author: gonzo Date: Fri Apr 26 17:27:53 2013 New Revision: 249946 URL: http://svnweb.freebsd.org/changeset/base/249946 Log: Move pinmux configuration to board-specific config. It will vary from board to board. Modified: head/sys/boot/fdt/dts/am335x.dtsi head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/am335x.dtsi == --- head/sys/boot/fdt/dts/am335x.dtsi Fri Apr 26 17:12:51 2013 (r249945) +++ head/sys/boot/fdt/dts/am335x.dtsi Fri Apr 26 17:27:53 2013 (r249946) @@ -51,85 +51,6 @@ scm@44e1 { compatible = "ti,scm"; reg = < 0x44e1 0x2000 >; - /* Set of triplets < padname, muxname, padstate> */ - scm-pad-config = - /* I2C0 */ - "I2C0_SDA", "I2C0_SDA","i2c", - "I2C0_SCL", "I2C0_SCL","i2c", - /* Ethernet */ - "MII1_RX_ER", "gmii1_rxerr", "input_pulldown", - "MII1_TX_EN", "gmii1_txen", "output", - "MII1_RX_DV", "gmii1_rxdv", "input_pulldown", - "MII1_TXD3", "gmii1_txd3", "output", - "MII1_TXD2", "gmii1_txd2", "output", - "MII1_TXD1", "gmii1_txd1", "output", - "MII1_TXD0", "gmii1_txd0", "output", - "MII1_TX_CLK", "gmii1_txclk", "input_pulldown", - "MII1_RX_CLK", "gmii1_rxclk", "input_pulldown", - "MII1_RXD3", "gmii1_rxd3", "input_pulldown", - "MII1_RXD2", "gmii1_rxd2", "input_pulldown", - "MII1_RXD1", "gmii1_rxd1", "input_pulldown", - "MII1_RXD0", "gmii1_rxd0", "input_pulldown", - "MDIO", "mdio_data", "input_pullup", - "MDC", "mdio_clk", "output_pullup", - /* MMCSD0 */ - "MMC0_CMD", "mmc0_cmd", "input_pullup", - "MMC0_CLK", "mmc0_clk", "input_pullup", - "MMC0_DAT0", "mmc0_dat0", "input_pullup", - "MMC0_DAT1", "mmc0_dat1", "input_pullup", - "MMC0_DAT2", "mmc0_dat2", "input_pullup", - "MMC0_DAT3", "mmc0_dat3", "input_pullup", - /* GPIO */ - "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", - "GPMC_AD10", "gpio0_26", "input_pulldown", - "GPMC_AD11", "gpio0_27", "input_pulldown", - "GPMC_AD0", "gpio1_0", "input_pulldown", - "GPMC_AD1", "gpio1_1", "input_pulldown", - "GPMC_AD2", "gpio1_2", "input_pulldown", - "GPMC_AD3", "gpio1_3", "input_pulldown", - "GPMC_AD4", "gpio1_4", "input_pulldown", - "GPMC_AD5", "gpio1_5", "input_pulldown", - "GPMC_AD6", "gpio1_6", "input_pulldown", - "GPMC_AD7", "gpio1_7", "input_pulldown", - "GPMC_AD12", "gpio1_12", "input_pulldown", - "GPMC_AD13", "gpio1_13", "input_pulldown", - "GPMC_AD14", "gpio1_14", "input_pulldown", - "GPMC_AD15", "gpio1_15", "input_pulldown", - "GPMC_A0", "gpio1_16", "input_pulldown", - "GPMC_A1", "gpio1_17", "input_pulldown", - "GPMC_A5", "gpio1_21", "output", /* User LED 1 */ - "GPMC_A6", "gpio1_22", "output", /* User LED 2 */ - "GPMC_A7", "gpio1_23", "output", /* User LED 3 */ - "GPMC_A8", "gpio1_24", "output", /* User LED 4 */ - "GPMC_BEn1", "gpio1_28", "input_pulldown", - "GPMC_CSn0", "gpio1_29", "input_pulldown", - "GPMC_CSn1", "gpio1_30", "input_pulldown", - "GPMC_CSn2", "gpio1_31", "input_pulldown", - "GPMC_CLK", "gpio2_1", "input_pulldown", - "LCD_DATA0", "gpio2_6", "input_pulldown", - "LCD_DATA1", "gpio2_7", "input_pulldown", - "LCD_DATA2", "gpio2_8", "input_pulldown", - "LCD_DATA3", "gpio2_9", "input_pulldown", -
svn commit: r262682 - head/sys/boot/fdt/dts/arm
Author: gonzo Date: Sun Mar 2 06:36:49 2014 New Revision: 262682 URL: http://svnweb.freebsd.org/changeset/base/262682 Log: - Fix BBB's dts compilation with GNU dtc Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts == --- head/sys/boot/fdt/dts/arm/beaglebone-black.dts Sun Mar 2 05:48:56 2014(r262681) +++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts Sun Mar 2 06:36:49 2014(r262682) @@ -150,7 +150,7 @@ compatible = "ti,am335x-pmic"; reg = <0x24>; }; - } + }; }; leds { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r254944 - head/sys/mips/malta
Author: gonzo Date: Tue Aug 27 01:08:55 2013 New Revision: 254944 URL: http://svnweb.freebsd.org/changeset/base/254944 Log: - Initialize freq variable so we will not end up with random value if there is no YAMON present Modified: head/sys/mips/malta/yamon.c Modified: head/sys/mips/malta/yamon.c == --- head/sys/mips/malta/yamon.c Mon Aug 26 23:48:21 2013(r254943) +++ head/sys/mips/malta/yamon.c Tue Aug 27 01:08:55 2013(r254944) @@ -56,6 +56,7 @@ yamon_getcpufreq(void) uint32_t freq; int ret; + freq = 0; ret = YAMON_SYSCON_READ(SYSCON_BOARD_CPU_CLOCK_FREQ_ID, &freq, sizeof(freq)); if (ret != 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r254946 - head/sys/mips/malta
Author: gonzo Date: Tue Aug 27 01:40:13 2013 New Revision: 254946 URL: http://svnweb.freebsd.org/changeset/base/254946 Log: Fixes for compatibility with QEMU: - Route PCI interrupt for NIC - Make "no mapping" warning more user-friendly: add device name and mention that it's IRQ mapping - Do not overlap ICUs' IO window with PCI devices' IO windows by starting IO rman at offset 0x100 Modified: head/sys/mips/malta/gt_pci.c Modified: head/sys/mips/malta/gt_pci.c == --- head/sys/mips/malta/gt_pci.cTue Aug 27 01:31:12 2013 (r254945) +++ head/sys/mips/malta/gt_pci.cTue Aug 27 01:40:13 2013 (r254946) @@ -266,8 +266,12 @@ gt_pci_attach(device_t dev) sc->sc_io = MIPS_PHYS_TO_KSEG1(MALTA_PCI0_IO_BASE); sc->sc_io_rman.rm_type = RMAN_ARRAY; sc->sc_io_rman.rm_descr = "GT64120 PCI I/O Ports"; + /* +* First 256 bytes are ISA's registers: e.g. i8259's +* So do not use them for general purpose PCI I/O window +*/ if (rman_init(&sc->sc_io_rman) != 0 || - rman_manage_region(&sc->sc_io_rman, 0, 0x) != 0) { + rman_manage_region(&sc->sc_io_rman, 0x100, 0x) != 0) { panic("gt_pci_attach: failed to set up I/O rman"); } @@ -568,8 +572,10 @@ gt_pci_route_interrupt(device_t pcib, de * PIIX4 IDE adapter. HW IRQ0 */ return 0; + case 11: /* Ethernet */ + return 10; default: - printf("No mapping for %d/%d/%d/%d\n", bus, device, func, pin); + device_printf(pcib, "no IRQ mapping for %d/%d/%d/%d\n", bus, device, func, pin); } return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r254983 - head/sys/mips/malta
Author: gonzo Date: Wed Aug 28 01:10:51 2013 New Revision: 254983 URL: http://svnweb.freebsd.org/changeset/base/254983 Log: Fix GT PCI controller driver on big-endian hardware Modified: head/sys/mips/malta/gt_pci.c Modified: head/sys/mips/malta/gt_pci.c == --- head/sys/mips/malta/gt_pci.cWed Aug 28 00:39:47 2013 (r254982) +++ head/sys/mips/malta/gt_pci.cWed Aug 28 01:10:51 2013 (r254983) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -91,6 +92,14 @@ __FBSDID("$FreeBSD$"); #define OCW3_POLL_IRQ(x) ((x) & 0x7f) #define OCW3_POLL_PENDING (1U << 7) +/* + * Galileo controller's registers are LE so convert to then + * to/from native byte order. We rely on boot loader or emulator + * to set "swap bytes" configuration correctly for us + */ +#defineGT_PCI_DATA(v) htole32((v)) +#defineGT_HOST_DATA(v) le32toh((v)) + struct gt_pci_softc; struct gt_pci_intr_cookie { @@ -437,20 +446,20 @@ gt_pci_read_config(device_t dev, u_int b return (uint32_t)(-1); /* Clear cause register bits. */ - GT_REGVAL(GT_INTR_CAUSE) = 0; - - GT_REGVAL(GT_PCI0_CFG_ADDR) = (1 << 31) | addr; - data = GT_REGVAL(GT_PCI0_CFG_DATA); + GT_REGVAL(GT_INTR_CAUSE) = GT_PCI_DATA(0); + GT_REGVAL(GT_PCI0_CFG_ADDR) = GT_PCI_DATA((1 << 31) | addr); + /* +* Galileo system controller is special +*/ + if ((bus == 0) && (slot == 0)) + data = GT_PCI_DATA(GT_REGVAL(GT_PCI0_CFG_DATA)); + else + data = GT_REGVAL(GT_PCI0_CFG_DATA); /* Check for master abort. */ - if (GT_REGVAL(GT_INTR_CAUSE) & (GTIC_MASABORT0 | GTIC_TARABORT0)) + if (GT_HOST_DATA(GT_REGVAL(GT_INTR_CAUSE)) & (GTIC_MASABORT0 | GTIC_TARABORT0)) data = (uint32_t) -1; - /* -* XXX: We assume that words readed from GT chip are BE. -* Should we set the mode explicitly during chip -* Initialization? -*/ switch(reg % 4) { case 3: @@ -507,11 +516,6 @@ gt_pci_write_config(device_t dev, u_int { reg_data = gt_pci_read_config(dev, bus, slot, func, reg, 4); - /* - * XXX: We assume that words readed from GT chip are BE. - * Should we set the mode explicitly during chip - * Initialization? - */ shift = 8 * (reg & 3); switch(bytes) @@ -548,10 +552,23 @@ gt_pci_write_config(device_t dev, u_int return; /* Clear cause register bits. */ - GT_REGVAL(GT_INTR_CAUSE) = 0; + GT_REGVAL(GT_INTR_CAUSE) = GT_PCI_DATA(0); + + GT_REGVAL(GT_PCI0_CFG_ADDR) = GT_PCI_DATA((1 << 31) | addr); + + /* +* Galileo system controller is special +*/ + if ((bus == 0) && (slot == 0)) + GT_REGVAL(GT_PCI0_CFG_DATA) = GT_PCI_DATA(data); + else + GT_REGVAL(GT_PCI0_CFG_DATA) = data; + +#if 0 + printf("PCICONF_WRITE(%02x:%02x.%02x[%04x] -> %02x(%d)\n", + bus, slot, func, reg, data, bytes); +#endif - GT_REGVAL(GT_PCI0_CFG_ADDR) = (1 << 31) | addr; - GT_REGVAL(GT_PCI0_CFG_DATA) = data; } static int ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r255083 - head/sys/mips/malta
(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr += 2) + wr16(addr, value); +} + +void +gt_pci_bs_sr_4(void *t, bus_space_handle_t bsh, +bus_size_t offset, uint32_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr += 4) + wr32(addr, value); +} Added: head/sys/mips/malta/gt_pci_bus_space.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/malta/gt_pci_bus_space.h Fri Aug 30 20:28:35 2013 (r255083) @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2009, Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice unmodified, this list of conditions, and the following + *disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef __GT_PCI_BUS_SPACEH__ +#define __GT_PCI_BUS_SPACEH__ + +extern bus_space_tag_t gt_pci_bus_space; + +#endif /* __GT_PCI_BUS_SPACEH__ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r255084 - head/sys/mips/conf
Author: gonzo Date: Fri Aug 30 20:30:33 2013 New Revision: 255084 URL: http://svnweb.freebsd.org/changeset/base/255084 Log: Add bpf(4) to config file to get dhclient working Modified: head/sys/mips/conf/MALTA Modified: head/sys/mips/conf/MALTA == --- head/sys/mips/conf/MALTAFri Aug 30 20:28:35 2013(r255083) +++ head/sys/mips/conf/MALTAFri Aug 30 20:30:33 2013(r255084) @@ -65,5 +65,6 @@ deviceloop device ether device le device miibus +device bpf device md device uart ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r255088 - head/sys/mips/malta
Author: gonzo Date: Sat Aug 31 01:24:05 2013 New Revision: 255088 URL: http://svnweb.freebsd.org/changeset/base/255088 Log: YAMON is 32-bit application and uses 32-bit pointers to pass kernel arguments and environment names/values. Cast values to proper pointer type to make MALTA kernel 64-bit compatible Modified: head/sys/mips/malta/malta_machdep.c Modified: head/sys/mips/malta/malta_machdep.c == --- head/sys/mips/malta/malta_machdep.c Fri Aug 30 20:50:28 2013 (r255087) +++ head/sys/mips/malta/malta_machdep.c Sat Aug 31 01:24:05 2013 (r255088) @@ -269,8 +269,8 @@ platform_start(__register_t a0, __regist vm_offset_t kernend; uint64_t platform_counter_freq; int argc = a0; - char **argv = (char **)a1; - char **envp = (char **)a2; + int32_t *argv = (int32_t*)a1; + int32_t *envp = (int32_t*)a2; unsigned int memsize = a3; int i; @@ -289,15 +289,20 @@ platform_start(__register_t a0, __regist printf("entry: platform_start()\n"); bootverbose = 1; + /* +* YAMON uses 32bit pointers to strings so +* convert them to proper type manually +*/ if (bootverbose) { printf("cmd line: "); for (i = 0; i < argc; i++) - printf("%s ", argv[i]); + printf("%s ", (char*)(intptr_t)argv[i]); printf("\n"); printf("envp:\n"); for (i = 0; envp[i]; i += 2) - printf("\t%s = %s\n", envp[i], envp[i+1]); + printf("\t%s = %s\n", (char*)(intptr_t)envp[i], + (char*)(intptr_t)envp[i+1]); printf("memsize = %08x\n", memsize); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r255089 - head/sys/mips/conf
Author: gonzo Date: Sat Aug 31 01:30:01 2013 New Revision: 255089 URL: http://svnweb.freebsd.org/changeset/base/255089 Log: - Set proper KERNLOADADDR - Add bpf(4) required by dhclient Modified: head/sys/mips/conf/MALTA64 Modified: head/sys/mips/conf/MALTA64 == --- head/sys/mips/conf/MALTA64 Sat Aug 31 01:24:05 2013(r255088) +++ head/sys/mips/conf/MALTA64 Sat Aug 31 01:30:01 2013(r255089) @@ -31,6 +31,8 @@ makeoptions MODULES_OVERRIDE="" optionsTICK_USE_YAMON_FREQ=defined #options TICK_USE_MALTA_RTC=defined +makeoptionsKERNLOADADDR=0x8010 + include"../malta/std.malta" hints "MALTA.hints" #Default places to look for devices. @@ -66,4 +68,5 @@ deviceether device le device miibus device md +device bpf device uart ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r255212 - in head/sys: dev/gxemul/cons dev/gxemul/disk dev/gxemul/ether mips/conf mips/gxemul
Author: gonzo Date: Wed Sep 4 20:34:36 2013 New Revision: 255212 URL: http://svnweb.freebsd.org/changeset/base/255212 Log: Add 32-bit support for Gxemul's oldtestmips machine emulation Original work by: kan@ Added: head/sys/mips/conf/GXEMUL32 (contents, props changed) Modified: head/sys/dev/gxemul/cons/gxemul_cons.c head/sys/dev/gxemul/disk/gxemul_disk.c head/sys/dev/gxemul/disk/gxemul_diskreg.h head/sys/dev/gxemul/ether/gxreg.h head/sys/mips/gxemul/mpreg.h Modified: head/sys/dev/gxemul/cons/gxemul_cons.c == --- head/sys/dev/gxemul/cons/gxemul_cons.c Wed Sep 4 20:12:33 2013 (r255211) +++ head/sys/dev/gxemul/cons/gxemul_cons.c Wed Sep 4 20:34:36 2013 (r255212) @@ -99,18 +99,16 @@ static void gxemul_cons_timeout(void *) * XXXRW: Should be using FreeBSD's bus routines here, but they are not * available until later in the boot. */ -typedefuint64_tpaddr_t; -typedefuint64_tvaddr_t; -static inline vaddr_t -mips_phys_to_uncached(paddr_t phys) +static inline vm_offset_t +mips_phys_to_uncached(vm_paddr_t phys) { return (MIPS_PHYS_TO_DIRECT_UNCACHED(phys)); } static inline uint8_t -mips_ioread_uint8(vaddr_t vaddr) +mips_ioread_uint8(vm_offset_t vaddr) { uint8_t v; @@ -119,7 +117,7 @@ mips_ioread_uint8(vaddr_t vaddr) } static inline void -mips_iowrite_uint8(vaddr_t vaddr, uint8_t v) +mips_iowrite_uint8(vm_offset_t vaddr, uint8_t v) { __asm__ __volatile__ ("sb %0, 0(%1)" : : "r" (v), "r" (vaddr)); Modified: head/sys/dev/gxemul/disk/gxemul_disk.c == --- head/sys/dev/gxemul/disk/gxemul_disk.c Wed Sep 4 20:12:33 2013 (r255211) +++ head/sys/dev/gxemul/disk/gxemul_disk.c Wed Sep 4 20:34:36 2013 (r255212) @@ -214,7 +214,14 @@ gxemul_disk_read(unsigned diskid, void * if (off < 0 || off % GXEMUL_DISK_DEV_BLOCKSIZE != 0) return (EINVAL); +#ifdef _LP64 GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_OFFSET, (uint64_t)off); +#else + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_OFFSET_LO, + (uint32_t)(off & 0x)); + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_OFFSET_HI, + (uint32_t)((off >> 32) & 0x)); +#endif GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_DISKID, diskid); GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_START, GXEMUL_DISK_DEV_START_READ); switch (GXEMUL_DISK_DEV_READ(GXEMUL_DISK_DEV_STATUS)) { @@ -280,7 +287,15 @@ gxemul_disk_write(unsigned diskid, const if (off < 0 || off % GXEMUL_DISK_DEV_BLOCKSIZE != 0) return (EINVAL); +#ifdef _LP64 GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_OFFSET, (uint64_t)off); +#else + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_OFFSET_LO, + (uint32_t)(off & 0x)); + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_OFFSET_HI, + (uint32_t)((off >> 32) & 0x)); +#endif + GXEMUL_DISK_DEV_WRITE(GXEMUL_DISK_DEV_DISKID, diskid); dst = GXEMUL_DISK_DEV_FUNCTION(GXEMUL_DISK_DEV_BLOCK); Modified: head/sys/dev/gxemul/disk/gxemul_diskreg.h == --- head/sys/dev/gxemul/disk/gxemul_diskreg.h Wed Sep 4 20:12:33 2013 (r255211) +++ head/sys/dev/gxemul/disk/gxemul_diskreg.h Wed Sep 4 20:34:36 2013 (r255212) @@ -36,16 +36,28 @@ #defineGXEMUL_DISK_DEV_ID_START(0x) #defineGXEMUL_DISK_DEV_ID_END (0x0100) -#defineGXEMUL_DISK_DEV_OFFSET (0x) +#ifdef _LP64 +#define GXEMUL_DISK_DEV_OFFSET (0x) +#else +#define GXEMUL_DISK_DEV_OFFSET_LO (0x) +#define GXEMUL_DISK_DEV_OFFSET_HI (0x0008) +#endif #defineGXEMUL_DISK_DEV_DISKID (0x0010) #defineGXEMUL_DISK_DEV_START (0x0020) #defineGXEMUL_DISK_DEV_STATUS (0x0030) #defineGXEMUL_DISK_DEV_BLOCK (0x4000) +#ifdef _LP64 #defineGXEMUL_DISK_DEV_FUNCTION(f) \ (volatile uint64_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_DISK_DEV_BASE + (f)) #defineGXEMUL_DISK_DEV_READ(f) \ (volatile uint64_t)*GXEMUL_DISK_DEV_FUNCTION(f) +#else +#defineGXEMUL_DISK_DEV_FUNCTION(f) \ + (volatile uint32_t *)MIPS_PHYS_TO_DIRECT_UNCACHED(GXEMUL_DISK_DEV_BASE + (f)) +#defineGXEMUL_DISK_DEV_READ(f) \ + (volatile uint32_t)*GXEMUL_DISK_DEV_FUNCTION(f) +#endif #defineGXEMUL_DISK_DEV_WRITE(f, v) \ *GXEMUL_DISK_DEV_FUNCTION(f) = (v) Modified: head/sys/dev/gxemul/ether/gxreg.h =
Re: svn commit: r249774 - head/sys/boot/fdt/dts
On 4/29/2013 9:31 PM, Tim Kientzle wrote: On Apr 22, 2013, at 11:53 AM, Oleksandr Tymoshenko wrote: Author: gonzo Date: Mon Apr 22 18:53:36 2013 New Revision: 249774 URL: http://svnweb.freebsd.org/changeset/base/249774 Log: Split BeagleBone DTS to generic AM335x part and Beagle-bone specific Added: head/sys/boot/fdt/dts/am335x.dtsi (contents, props changed) Modified: head/sys/boot/fdt/dts/beaglebone.dts Added: head/sys/boot/fdt/dts/am335x.dtsi == + +/ { + compatible = "ti,am335x"; Modified: head/sys/boot/fdt/dts/beaglebone.dts == +/include/ "am335x.dtsi" + / { model = "beaglebone"; - compatible = "beaglebone", "ti,am335x"; This used to have two "compatible" names; now it only has one. Is there a way to have both again? (Mostly I'm just curious; I'm still learning FDT conventions.) I think it was wrong of me to move compatible property to dtsi. I'll move it back to main .dts file. Thanks for spotting. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r250435 - head/sys/boot/fdt/dts
On 2013-05-09, at 10:34 PM, Tim Kientzle wrote: > Author: kientzle > Date: Fri May 10 05:34:08 2013 > New Revision: 250435 > URL: http://svnweb.freebsd.org/changeset/base/250435 > > Log: > Move 'compatible' line out of the common am335x.dtsi and into > the beaglebone-specific .dts file. > > Add a new .dts for the BeagleBone Black with more memory, > slightly different pinmux initialization, and with mmchs1 > configured (though the latter doesn't quite work yet). Thanks for sorting this out, Tim. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r251015 - in head/sys/arm/ti: . am335x
Author: gonzo Date: Mon May 27 00:06:24 2013 New Revision: 251015 URL: http://svnweb.freebsd.org/changeset/base/251015 Log: Add clock definitions for LCD controller and PWM module Modified: head/sys/arm/ti/am335x/am335x_prcm.c head/sys/arm/ti/ti_prcm.h Modified: head/sys/arm/ti/am335x/am335x_prcm.c == --- head/sys/arm/ti/am335x/am335x_prcm.cSun May 26 22:23:39 2013 (r251014) +++ head/sys/arm/ti/am335x/am335x_prcm.cMon May 27 00:06:24 2013 (r251015) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #define CM_PER_L3S_CLKSTCTRL (CM_PER + 0x004) #define CM_PER_L3_CLKSTCTRL(CM_PER + 0x00C) #define CM_PER_CPGMAC0_CLKCTRL (CM_PER + 0x014) +#define CM_PER_LCDC_CLKCTRL(CM_PER + 0x018) #define CM_PER_USB0_CLKCTRL(CM_PER + 0x01C) #define CM_PER_TPTC0_CLKCTRL (CM_PER + 0x024) #define CM_PER_MMC0_CLKCTRL(CM_PER + 0x03C) @@ -72,6 +73,9 @@ __FBSDID("$FreeBSD$"); #define CM_PER_GPIO2_CLKCTRL (CM_PER + 0x0B0) #define CM_PER_GPIO3_CLKCTRL (CM_PER + 0x0B4) #define CM_PER_TPCC_CLKCTRL(CM_PER + 0x0BC) +#define CM_PER_EPWMSS1_CLKCTRL (CM_PER + 0x0CC) +#define CM_PER_EPWMSS0_CLKCTRL (CM_PER + 0x0D4) +#define CM_PER_EPWMSS2_CLKCTRL (CM_PER + 0x0D8) #define CM_PER_L3_INSTR_CLKCTRL(CM_PER + 0x0DC) #define CM_PER_L3_CLKCTRL (CM_PER + 0x0E0) #define CM_PER_TIMER5_CLKCTRL (CM_PER + 0x0EC) @@ -90,7 +94,10 @@ __FBSDID("$FreeBSD$"); #define CM_WKUP_GPIO0_CLKCTRL (CM_WKUP + 0x008) #define CM_WKUP_CM_L3_AON_CLKSTCTRL(CM_WKUP + 0x01C) #define CM_WKUP_CM_CLKSEL_DPLL_MPU (CM_WKUP + 0x02C) +#define CM_WKUP_CM_IDLEST_DPLL_DISP(CM_WKUP + 0x048) +#define CM_WKUP_CM_CLKSEL_DPLL_DISP(CM_WKUP + 0x054) #define CM_WKUP_CM_CLKDCOLDO_DPLL_PER (CM_WKUP + 0x07C) +#define CM_WKUP_CM_CLKMODE_DPLL_DISP (CM_WKUP + 0x098) #define CM_WKUP_I2C0_CLKCTRL (CM_WKUP + 0x0B8) #define CM_DPLL0x500 @@ -124,9 +131,11 @@ static int am335x_clk_generic_set_source static int am335x_clk_hsmmc_get_source_freq(struct ti_clock_dev *clkdev, unsigned int *freq); static int am335x_clk_get_sysclk_freq(struct ti_clock_dev *clkdev, unsigned int *freq); static int am335x_clk_get_arm_fclk_freq(struct ti_clock_dev *clkdev, unsigned int *freq); +static int am335x_clk_get_arm_disp_freq(struct ti_clock_dev *clkdev, unsigned int *freq); static void am335x_prcm_reset(void); static int am335x_clk_cpsw_activate(struct ti_clock_dev *clkdev); static int am335x_clk_musb0_activate(struct ti_clock_dev *clkdev); +static int am335x_clk_lcdc_activate(struct ti_clock_dev *clkdev); #define AM335X_GENERIC_CLOCK_DEV(i) \ { .id = (i), \ @@ -190,6 +199,15 @@ struct ti_clock_dev ti_clk_devmap[] = { .clk_get_source_freq = NULL, }, + /* LCD controller clocks */ + { .id = LCDC_CLK, + .clk_activate= am335x_clk_lcdc_activate, + .clk_deactivate = NULL, + .clk_set_source = NULL, + .clk_accessible = NULL, + .clk_get_source_freq = am335x_clk_get_arm_disp_freq, + }, + /* DMTimer */ AM335X_GENERIC_CLOCK_DEV(DMTIMER2_CLK), AM335X_GENERIC_CLOCK_DEV(DMTIMER3_CLK), @@ -220,6 +238,11 @@ struct ti_clock_dev ti_clk_devmap[] = { AM335X_MMCHS_CLOCK_DEV(MMC1_CLK), AM335X_MMCHS_CLOCK_DEV(MMC2_CLK), + /* PWMSS */ + AM335X_GENERIC_CLOCK_DEV(PWMSS0_CLK), + AM335X_GENERIC_CLOCK_DEV(PWMSS1_CLK), + AM335X_GENERIC_CLOCK_DEV(PWMSS2_CLK), + { INVALID_CLK_IDENT, NULL, NULL, NULL, NULL } }; @@ -267,6 +290,11 @@ static struct am335x_clk_details g_am335 _CLK_DETAIL(MMC1_CLK, CM_PER_MMC1_CLKCTRL, 0), _CLK_DETAIL(MMC2_CLK, CM_PER_MMC1_CLKCTRL, 0), + /* PWMSS modules */ + _CLK_DETAIL(PWMSS0_CLK, CM_PER_EPWMSS0_CLKCTRL, 0), + _CLK_DETAIL(PWMSS1_CLK, CM_PER_EPWMSS1_CLKCTRL, 0), + _CLK_DETAIL(PWMSS2_CLK, CM_PER_EPWMSS2_CLKCTRL, 0), + { INVALID_CLK_IDENT, 0}, }; @@ -491,14 +519,15 @@ am335x_clk_get_sysclk_freq(struct ti_clo return (0); } +#define DPLL_BYP_CLKSEL(reg) ((reg>>23) & 1) +#define DPLL_DIV(reg) ((reg & 0x7f)+1) +#define DPLL_MULT(reg) ((reg>>8) & 0x7FF) + static int am335x_clk_get_arm_fclk_freq(struct ti_clock_dev *clkdev, unsigned int *freq) { uint32_t reg; uint32_t sysclk; -#define DPLL_BYP_CLKSEL(reg) ((reg>>23) & 1) -#define DPLL_DIV(reg) ((reg & 0x7f)+1) -#define DPLL_MULT(reg) ((reg>>8) & 0x7FF) reg = prcm_read_4(CM_WKUP_CM_CLKSEL_DPLL_MPU); @@ -511,6 +540,23 @@ am335x_clk_get_arm_fclk_freq(struct ti_c return(0); } +static int +am335x_clk_get_arm_disp_freq(struct ti_clo
svn commit: r251016 - head/sys/arm/ti/am335x
Author: gonzo Date: Mon May 27 00:09:04 2013 New Revision: 251016 URL: http://svnweb.freebsd.org/changeset/base/251016 Log: Add SCM registers definitions for AM335x platform Added: head/sys/arm/ti/am335x/am335x_scm.h (contents, props changed) Added: head/sys/arm/ti/am335x/am335x_scm.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_scm.h Mon May 27 00:09:04 2013 (r251016) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef __AM335X_SCM_H__ +#define __AM335X_SCM_H__ + +/* AM335x-specific registers for control module (scm) */ +#defineSCM_USB_CTRL0 0x620 +#defineSCM_USB_STS00x624 +#defineSCM_USB_CTRL1 0x628 +#defineSCM_USB_STS10x62C +#defineSCM_PWMSS_CTRL 0x664 + +#endif /* __AM335X_SCM_H__ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r251017 - head/sys/arm/ti/am335x
Author: gonzo Date: Mon May 27 00:13:27 2013 New Revision: 251017 URL: http://svnweb.freebsd.org/changeset/base/251017 Log: Add PWM module driver for AM335x. Only eCAS subsystem is supported Export function to configure eCAS submodule from another drivers. It's used to control LCD panel backlight on AM335x EVM. Added: head/sys/arm/ti/am335x/am335x_pwm.c (contents, props changed) head/sys/arm/ti/am335x/am335x_pwm.h (contents, props changed) Modified: head/sys/arm/ti/am335x/files.am335x Added: head/sys/arm/ti/am335x/am335x_pwm.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_pwm.c Mon May 27 00:13:27 2013 (r251017) @@ -0,0 +1,285 @@ +/*- + * Copyright (c) 2013 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include "am335x_pwm.h" +#include "am335x_scm.h" + +#definePWM_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#definePWM_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#definePWM_LOCK_INIT(_sc) mtx_init(&(_sc)->sc_mtx, \ +device_get_nameunit(_sc->sc_dev), "am335x_pwm softc", MTX_DEF) +#definePWM_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx); + +static struct resource_spec am335x_pwm_mem_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, /* PWMSS */ + { SYS_RES_MEMORY, 1, RF_ACTIVE }, /* eCAP */ + { SYS_RES_MEMORY, 2, RF_ACTIVE }, /* eQEP */ + { SYS_RES_MEMORY, 3, RF_ACTIVE }, /*ePWM */ + { -1, 0, 0 } +}; + +#definePWMSS_READ4(_sc, reg) bus_read_4((_sc)->sc_mem_res[0], reg); +#definePWMSS_WRITE4(_sc, reg, value) \ +bus_write_4((_sc)->sc_mem_res[0], reg, value); + +#defineECAP_READ2(_sc, reg)bus_read_2((_sc)->sc_mem_res[1], reg); +#defineECAP_WRITE2(_sc, reg, value)\ +bus_write_2((_sc)->sc_mem_res[1], reg, value); +#defineECAP_READ4(_sc, reg)bus_read_4((_sc)->sc_mem_res[1], reg); +#defineECAP_WRITE4(_sc, reg, value)\ +bus_write_4((_sc)->sc_mem_res[1], reg, value); + +#defineEPWM_READ2(_sc, reg)bus_read_2((_sc)->sc_mem_res[3], reg); +#defineEPWM_WRITE2(_sc, reg, value)\ +bus_write_2((_sc)->sc_mem_res[3], reg, value); + +#definePWMSS_IDVER 0x00 +#definePWMSS_SYSCONFIG 0x04 +#definePWMSS_CLKCONFIG 0x08 +#defineCLKCONFIG_EPWMCLK_EN(1 << 8) +#definePWMSS_CLKSTATUS 0x0C + +#defineECAP_TSCTR 0x00 +#defineECAP_CAP1 0x08 +#defineECAP_CAP2 0x0C +#defineECAP_CAP3 0x10 +#defineECAP_CAP4 0x14 +#defineECAP_ECCTL2 0x2A +#defineECCTL2_MODE_APWM(1 << 9) +#defineECCTL2_SYNCO_SEL(3 << 6) +#defineECCTL2_TSCTRSTOP_FREERUN(1 << 4) + +#defineEPWM_TBCTL 0x00 +#defineTBCTL_PHDIR_UP (1 << 13) +#defineTBCTL_PHDIR_DOWN(0 << 13) +#defineTBCTL_CLKDIV(x) ((x) << 10) +#defineTBCTL_HSPCLKDIV(x) ((x) << 7) +#define
svn commit: r251018 - head/sys/arm/ti/am335x
Author: gonzo Date: Mon May 27 00:23:01 2013 New Revision: 251018 URL: http://svnweb.freebsd.org/changeset/base/251018 Log: AM335x LCD controller driver with syscons support Limitations: - Raster mode only - 24 and 32 bpp only Added: head/sys/arm/ti/am335x/am335x_lcd.c (contents, props changed) head/sys/arm/ti/am335x/am335x_lcd.h (contents, props changed) head/sys/arm/ti/am335x/am335x_lcd_syscons.c (contents, props changed) Modified: head/sys/arm/ti/am335x/files.am335x Added: head/sys/arm/ti/am335x/am335x_lcd.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/ti/am335x/am335x_lcd.c Mon May 27 00:23:01 2013 (r251018) @@ -0,0 +1,667 @@ +/*- + * Copyright 2013 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include + +#include "am335x_lcd.h" +#include "am335x_pwm.h" + +#defineLCD_PID 0x00 +#defineLCD_CTRL0x04 +#defineCTRL_DIV_MASK 0xff +#defineCTRL_DIV_SHIFT 8 +#defineCTRL_AUTO_UFLOW_RESTART (1 << 1) +#defineCTRL_RASTER_MODE1 +#defineCTRL_LIDD_MODE 0 +#defineLCD_LIDD_CTRL 0x0C +#defineLCD_LIDD_CS0_CONF 0x10 +#defineLCD_LIDD_CS0_ADDR 0x14 +#defineLCD_LIDD_CS0_DATA 0x18 +#defineLCD_LIDD_CS1_CONF 0x1C +#defineLCD_LIDD_CS1_ADDR 0x20 +#defineLCD_LIDD_CS1_DATA 0x24 +#defineLCD_RASTER_CTRL 0x28 +#defineRASTER_CTRL_TFT24_UNPACKED (1 << 26) +#defineRASTER_CTRL_TFT24 (1 << 25) +#defineRASTER_CTRL_STN565 (1 << 24) +#defineRASTER_CTRL_TFTPMAP (1 << 23) +#defineRASTER_CTRL_NIBMODE (1 << 22) +#defineRASTER_CTRL_PALMODE_SHIFT 20 +#definePALETTE_PALETTE_AND_DATA0x00 +#definePALETTE_PALETTE_ONLY0x01 +#definePALETTE_DATA_ONLY 0x02 +#defineRASTER_CTRL_REQDLY_SHIFT12 +#defineRASTER_CTRL_MONO8B (1 << 9) +#defineRASTER_CTRL_RBORDER (1 << 8) +#defineRASTER_CTRL_LCDTFT (1 << 7) +#defineRASTER_CTRL_LCDBW (1 << 1) +#defineRASTER_CTRL_LCDEN (1 << 0) +#defineLCD_RASTER_TIMING_0 0x2C +#defineRASTER_TIMING_0_HBP_SHIFT 24 +#defineRASTER_TIMING_0_HFP_SHIFT 16 +#defineRASTER_TIMING_0_HSW_SHIFT 10 +#defineRASTER_TIMING_0_PPLLSB_SHIFT4 +#defineRASTER_TIMING_0_PPLMSB_SHIFT3 +#defineLCD_RASTER_TIMING_1 0x30 +#defineRASTER_TIMING_1_VBP_SHIFT 24 +#defineRASTER_TIMING_1_VFP_SHIFT 16 +#defineRASTER_TIMING_1_VSW_SHIFT 10 +#defineRASTER_TIMING_1_LPP_SHIFT 0 +#defineLCD_RASTER_TIMING_2 0x34 +#define
svn commit: r251019 - head/sys/boot/fdt/dts
Author: gonzo Date: Mon May 27 00:23:59 2013 New Revision: 251019 URL: http://svnweb.freebsd.org/changeset/base/251019 Log: Add PWM and LCDC nodes to base DTS for AM335x-based devices Modified: head/sys/boot/fdt/dts/am335x.dtsi Modified: head/sys/boot/fdt/dts/am335x.dtsi == --- head/sys/boot/fdt/dts/am335x.dtsi Mon May 27 00:23:01 2013 (r251018) +++ head/sys/boot/fdt/dts/am335x.dtsi Mon May 27 00:23:59 2013 (r251019) @@ -150,5 +150,28 @@ interrupt-parent = <&AINTC>; i2c-device-id = <0>; }; + + pwm@4830 { + compatible = "ti,am335x-pwm"; + #address-cells = <1>; + #size-cells = <1>; + reg = < 0x4830 0x100/* PWMSS */ + 0x48300100 0x80 /* eCAP0 */ + 0x48300180 0x80 /* eQEP0 */ + 0x48300200 0x60 /* ePWM0 */ + >; + interrupts = <86 58>; /* ePWM0INT, ePWM0_TZINT */ + interrupt-parent = <&AINTC>; + pwm-device-id = <0>; + }; + + lcd: lcd@4830e000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "ti,am335x-lcd"; + reg =< 0x4830e000 0x1000 >; + interrupts = <36>; + interrupt-parent = <&AINTC>; + }; }; }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r251020 - head/sys/boot/fdt/dts
Author: gonzo Date: Mon May 27 00:26:29 2013 New Revision: 251020 URL: http://svnweb.freebsd.org/changeset/base/251020 Log: Add DTS for AM335x EVM with properly muxed PWM and LCD pins, and LCD panel description Added: head/sys/boot/fdt/dts/am335x-evm.dts (contents, props changed) Added: head/sys/boot/fdt/dts/am335x-evm.dts == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/am335x-evm.dtsMon May 27 00:26:29 2013 (r251020) @@ -0,0 +1,180 @@ +/*- + * Copyright (c) 2012 Damjan Marion + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/dts-v1/; + +/include/ "am335x.dtsi" + +/ { + model = "TMDXEVM3358"; + compatible = "ti,am335x"; + + aliases { + soc = &SOC; + uart0 = &uart0; + }; + + memory { + device_type = "memory"; + reg = < 0x8000 0x1000 >;/* 256MB RAM */ + }; + + am335x { + scm@44e1 { + /* Set of triplets < padname, muxname, padstate> */ + scm-pad-config = + /* I2C0 */ + "I2C0_SDA", "I2C0_SDA","i2c", + "I2C0_SCL", "I2C0_SCL","i2c", + /* Ethernet */ + "MII1_RX_ER", "gmii1_rxerr", "input_pulldown", + "MII1_TX_EN", "gmii1_txen", "output", + "MII1_RX_DV", "gmii1_rxdv", "input_pulldown", + "MII1_TXD3", "gmii1_txd3", "output", + "MII1_TXD2", "gmii1_txd2", "output", + "MII1_TXD1", "gmii1_txd1", "output", + "MII1_TXD0", "gmii1_txd0", "output", + "MII1_TX_CLK", "gmii1_txclk", "input_pulldown", + "MII1_RX_CLK", "gmii1_rxclk", "input_pulldown", + "MII1_RXD3", "gmii1_rxd3", "input_pulldown", + "MII1_RXD2", "gmii1_rxd2", "input_pulldown", + "MII1_RXD1", "gmii1_rxd1", "input_pulldown", + "MII1_RXD0", "gmii1_rxd0", "input_pulldown", + "MDIO", "mdio_data", "input_pullup", + "MDC", "mdio_clk", "output_pullup", + /* MMCSD0 */ + "MMC0_CMD", "mmc0_cmd", "input_pullup", + "MMC0_CLK", "mmc0_clk", "input_pullup", + "MMC0_DAT0", "mmc0_dat0", "input_pullup", + "MMC0_DAT1", "mmc0_dat1", "input_pullup", + "MMC0_DAT2", "mmc0_dat2", "input_pullup", + "MMC0_DAT3", "mmc0_dat3", "input_pullup", + /* GPIO */ + "GPMC_AD10", "gpio0_26", "input_pulldown", + "GPMC_AD11", "gpio0_27", "input_pulldown", + "GPMC_AD0", "gpio1_0", "input_pulldown", + "GPMC_AD1", "gpio1_1", "input_pulldown", + "GPMC_AD2", "gpio1_2", "input_pulldown", + "GPMC_AD3", "gpio1_3", "input_pulldown", + "GPMC_AD4", "gpio1_4", "input_pulldown", + "GPMC_AD5", "gpio1_5", "input_pulldown", + "GPMC_AD6", "gpio1_6",
svn commit: r256871 - head/sys/arm/broadcom/bcm2835
Author: gonzo Date: Tue Oct 22 05:19:42 2013 New Revision: 256871 URL: http://svnweb.freebsd.org/changeset/base/256871 Log: - Implement watchdog function and register it with watchdog list Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_wdog.c == --- head/sys/arm/broadcom/bcm2835/bcm2835_wdog.cTue Oct 22 02:39:56 2013(r256870) +++ head/sys/arm/broadcom/bcm2835/bcm2835_wdog.cTue Oct 22 05:19:42 2013(r256871) @@ -76,11 +76,10 @@ struct bcmwd_softc { int wdog_armed; int wdog_period; charwdog_passwd; + struct mtx mtx; }; -#ifdef notyet static void bcmwd_watchdog_fn(void *private, u_int cmd, int *error); -#endif static int bcmwd_probe(device_t dev) @@ -120,19 +119,59 @@ bcmwd_attach(device_t dev) sc->bsh = rman_get_bushandle(sc->res); bcmwd_lsc = sc; -#ifdef notyet + mtx_init(&sc->mtx, "BCM2835 Watchdog", "bcmwd", MTX_DEF); EVENTHANDLER_REGISTER(watchdog_list, bcmwd_watchdog_fn, sc, 0); -#endif + return (0); } -#ifdef notyet static void bcmwd_watchdog_fn(void *private, u_int cmd, int *error) { - /* XXX: not yet */ + struct bcmwd_softc *sc; + uint64_t sec; + uint32_t ticks, reg; + + sc = private; + mtx_lock(&sc->mtx); + + cmd &= WD_INTERVAL; + + if (cmd > 0) { + sec = ((uint64_t)1 << (cmd & WD_INTERVAL)) / 10; + ticks = (sec << 16) & BCM2835_WDOG_TIME_MASK; + if (ticks == 0) { + /* +* Can't arm +* disable watchdog as watchdog(9) requires +*/ + device_printf(sc->dev, + "Can't arm, timeout is less than 1 second\n"); + WRITE(sc, BCM2835_RSTC_REG, + (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT) | + BCM2835_RSTC_RESET); + mtx_unlock(&sc->mtx); + return; + } + + reg = (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT) | ticks; + WRITE(sc, BCM2835_WDOG_REG, reg); + + reg = READ(sc, BCM2835_RSTC_REG); + reg &= BCM2835_RSTC_WRCFG_CLR; + reg |= BCM2835_RSTC_WRCFG_FULL_RESET; + reg |= (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT); + WRITE(sc, BCM2835_RSTC_REG, reg); + + *error = 0; + } + else + WRITE(sc, BCM2835_RSTC_REG, + (BCM2835_PASWORD << BCM2835_PASSWORD_SHIFT) | + BCM2835_RSTC_RESET); + + mtx_unlock(&sc->mtx); } -#endif void bcmwd_watchdog_reset() ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r256873 - head/sys/arm/allwinner
Author: gonzo Date: Tue Oct 22 05:22:46 2013 New Revision: 256873 URL: http://svnweb.freebsd.org/changeset/base/256873 Log: Make watchdog function conform watchdog(9): Set error to 0 when watchdog is armed and disable it when timeout is too large to be set. Modified: head/sys/arm/allwinner/a10_wdog.c Modified: head/sys/arm/allwinner/a10_wdog.c == --- head/sys/arm/allwinner/a10_wdog.c Tue Oct 22 05:22:25 2013 (r256872) +++ head/sys/arm/allwinner/a10_wdog.c Tue Oct 22 05:22:46 2013 (r256873) @@ -150,6 +150,18 @@ a10wd_watchdog_fn(void *private, u_int c (wd_intervals[i].value << WDOG_MODE_INTVL_SHIFT) | WDOG_MODE_EN | WDOG_MODE_RST_EN); WRITE(sc, WDOG_CTRL, WDOG_CTRL_RESTART); + *error = 0; + } + else { + /* +* Can't arm +* disable watchdog as watchdog(9) requires +*/ + device_printf(sc->dev, + "Can't arm, timeout is more than 16 sec\n"); + mtx_unlock(&sc->mtx); + WRITE(sc, WDOG_MODE, 0); + return; } } else ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"