Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src Pull up following revision(s) (requested by skrll in tick...
details: https://anonhg.NetBSD.org/src/rev/078bfcd67aae
branches: netbsd-6
changeset: 775683:078bfcd67aae
user: riz <riz%NetBSD.org@localhost>
date: Wed Feb 13 01:36:06 2013 +0000
description:
Pull up following revision(s) (requested by skrll in ticket #813):
etc/MAKEDEV.tmpl 1.160
etc/etc.evbarm/MAKEDEV.conf 1.9
external/broadcom/rpi-firmware/dist/LICENCE.broadcom 1.1
external/broadcom/rpi-firmware/dist/bootcode.bin 1.1
external/broadcom/rpi-firmware/dist/bootcode.bin 1.2
external/broadcom/rpi-firmware/dist/fixup.dat 1.1
external/broadcom/rpi-firmware/dist/fixup.dat 1.2
external/broadcom/rpi-firmware/dist/fixup_cd.dat 1.1
external/broadcom/rpi-firmware/dist/fixup_cd.dat 1.2
external/broadcom/rpi-firmware/dist/start.elf 1.1
external/broadcom/rpi-firmware/dist/start.elf 1.2
external/broadcom/rpi-firmware/dist/start_cd.elf 1.1
external/broadcom/rpi-firmware/dist/start_cd.elf 1.2
sys/arch/arm/broadcom/bcm2835_bsc.c 1.1 via patch
sys/arch/arm/broadcom/bcm2835_bscreg.h 1.1 via patch
sys/arch/arm/broadcom/bcm2835_dotg.c 1.1 via patch
sys/arch/arm/broadcom/bcm2835_emmc.c 1.7 via patch
sys/arch/arm/broadcom/bcm2835_genfb.c 1.4 via patch
sys/arch/arm/broadcom/bcm2835_gpio_subr.c 1.2 via patch
sys/arch/arm/broadcom/bcm2835_gpio_subr.h 1.1 via patch
sys/arch/arm/broadcom/bcm2835_gpioreg.h 1.1 via patch
sys/arch/arm/broadcom/bcm2835_intr.c 1.3 via patch
sys/arch/arm/broadcom/bcm2835_mbox.c 1.5 via patch
sys/arch/arm/broadcom/bcm2835_mbox.h 1.4 via patch
sys/arch/arm/broadcom/bcm2835_obio.c 1.17 via patch
sys/arch/arm/broadcom/bcm2835_pm.c 1.2 via patch
sys/arch/arm/broadcom/bcm2835_rng.c 1.3 via patch
sys/arch/arm/broadcom/bcm2835_space.c 1.5 via patch
sys/arch/arm/broadcom/bcm2835_spi.c 1.1 via patch
sys/arch/arm/broadcom/bcm2835_spireg.h 1.1 via patch
sys/arch/arm/broadcom/bcm2835_tmr.c 1.3 via patch
sys/arch/arm/broadcom/bcm2835reg.h 1.10 via patch
sys/arch/arm/broadcom/files.bcm2835 1.14 via patch
sys/arch/evbarm/conf/RPI 1.23 via patch
sys/arch/evbarm/conf/files.rpi 1.3 via patch
sys/arch/evbarm/conf/mk.rpi 1.2 via patch
sys/arch/evbarm/conf/std.rpi 1.4 via patch
sys/arch/evbarm/rpi/rpi_machdep.c 1.34 via patch
sys/arch/evbarm/rpi/rpi_start.S 1.7 via patch
sys/arch/evbarm/rpi/rpi_vcmbox.c 1.2 via patch
sys/arch/evbarm/rpi/vcio.h 1.1 via patch
sys/arch/evbarm/rpi/vcprop.h 1.7 via patch
sys/conf/files patch
sys/dev/sdmmc/sdhc.c 1.43
sys/dev/sdmmc/sdhcvar.h 1.13
sys/dev/usb/dwc_otg.c 1.45 via patch
sys/dev/usb/dwc_otgreg.h 1.5 via patch
sys/dev/usb/dwc_otgvar.h 1.11 via patch
sys/dev/usb/files.usb 1.126 via patch
sys/dev/usb/if_smsc.c 1.7 via patch
sys/dev/usb/if_smscreg.h 1.1 via patch
sys/dev/usb/if_smscvar.h 1.1 via patch
sys/dev/usb/usbdevices.config patch
sys/dev/usb/usbdevs 1.633 via patch
sys/dev/usb/usbdevs.h regen
sys/dev/usb/usbdevs_data.h regen
sys/dev/wscons/wsconsio.h 1.105,1.107 via patch
sys/dev/wscons/wsdisplayvar.h 1.50
sys/dev/wscons/wsdisplay_util.c 1.2
sys/dev/videomode/edid.c 1.12 via patch
Greatly improved Raspberry Pi support. USB and onboard
Ethernet should work.
[skrll, ticket #813]
diffstat:
etc/MAKEDEV.tmpl | 8 +-
etc/etc.evbarm/MAKEDEV.conf | 4 +-
external/broadcom/rpi-firmware/dist/LICENCE.broadcom | 29 +
external/broadcom/rpi-firmware/dist/bootcode.bin | Bin
external/broadcom/rpi-firmware/dist/fixup.dat | Bin
external/broadcom/rpi-firmware/dist/fixup_cd.dat | Bin
external/broadcom/rpi-firmware/dist/start.elf | Bin
external/broadcom/rpi-firmware/dist/start_cd.elf | Bin
sys/arch/arm/broadcom/bcm2835_bsc.c | 362 +
sys/arch/arm/broadcom/bcm2835_bscreg.h | 79 +
sys/arch/arm/broadcom/bcm2835_dotg.c | 134 +
sys/arch/arm/broadcom/bcm2835_emmc.c | 15 +-
sys/arch/arm/broadcom/bcm2835_genfb.c | 161 +
sys/arch/arm/broadcom/bcm2835_gpio_subr.c | 69 +
sys/arch/arm/broadcom/bcm2835_gpio_subr.h | 36 +
sys/arch/arm/broadcom/bcm2835_gpioreg.h | 45 +
sys/arch/arm/broadcom/bcm2835_intr.c | 19 +-
sys/arch/arm/broadcom/bcm2835_mbox.c | 179 +
sys/arch/arm/broadcom/bcm2835_mbox.h | 8 +-
sys/arch/arm/broadcom/bcm2835_obio.c | 80 +-
sys/arch/arm/broadcom/bcm2835_pm.c | 75 +-
sys/arch/arm/broadcom/bcm2835_rng.c | 141 +
sys/arch/arm/broadcom/bcm2835_space.c | 48 +-
sys/arch/arm/broadcom/bcm2835_spi.c | 303 +
sys/arch/arm/broadcom/bcm2835_spireg.h | 75 +
sys/arch/arm/broadcom/bcm2835_tmr.c | 16 +-
sys/arch/arm/broadcom/bcm2835reg.h | 44 +-
sys/arch/arm/broadcom/files.bcm2835 | 41 +-
sys/arch/evbarm/conf/RPI | 103 +-
sys/arch/evbarm/conf/files.rpi | 6 +-
sys/arch/evbarm/conf/mk.rpi | 4 +-
sys/arch/evbarm/conf/std.rpi | 5 +-
sys/arch/evbarm/rpi/rpi_machdep.c | 409 +-
sys/arch/evbarm/rpi/rpi_start.S | 14 +-
sys/arch/evbarm/rpi/rpi_vcmbox.c | 406 +
sys/arch/evbarm/rpi/vcio.h | 2 +-
sys/arch/evbarm/rpi/vcprop.h | 132 +-
sys/conf/files | 7 +-
sys/dev/sdmmc/sdhc.c | 7 +-
sys/dev/sdmmc/sdhcvar.h | 3 +-
sys/dev/usb/dwc_otg.c | 4349 ++++++++++++++++++
sys/dev/usb/dwc_otgreg.h | 880 +++
sys/dev/usb/dwc_otgvar.h | 267 +
sys/dev/usb/files.usb | 7 +-
sys/dev/usb/if_smsc.c | 1505 ++++++
sys/dev/usb/if_smscreg.h | 255 +
sys/dev/usb/if_smscvar.h | 94 +
sys/dev/usb/usbdevices.config | 6 +-
sys/dev/usb/usbdevs | 46 +-
sys/dev/usb/usbdevs.h | 48 +-
sys/dev/usb/usbdevs_data.h | 160 +-
sys/dev/videomode/edid.c | 6 +-
sys/dev/wscons/wsconsio.h | 51 +-
sys/dev/wscons/wsdisplay_util.c | 34 +-
sys/dev/wscons/wsdisplayvar.h | 6 +-
55 files changed, 10516 insertions(+), 267 deletions(-)
diffs (truncated from 11924 to 300 lines):
diff -r fe4479b8ae11 -r 078bfcd67aae etc/MAKEDEV.tmpl
--- a/etc/MAKEDEV.tmpl Mon Feb 11 21:50:30 2013 +0000
+++ b/etc/MAKEDEV.tmpl Wed Feb 13 01:36:06 2013 +0000
@@ -1,5 +1,5 @@
#!/bin/sh -
-# $NetBSD: MAKEDEV.tmpl,v 1.151.2.8 2013/02/08 23:01:49 riz Exp $
+# $NetBSD: MAKEDEV.tmpl,v 1.151.2.9 2013/02/13 01:36:06 riz Exp $
#
# Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -123,6 +123,7 @@
# ttyB0 UART on first 68901 (formerly mdm01) (atari)
# ixpcom IXP12x0 COM ports
# epcom EP93xx COM ports
+# plcom ARM PL01[01] serial ports
# ttyM? HP200/300 4 port serial mux interface (hp300)
# ttya "ttya" system console (luna68k)
# ttyb second system serial port (luna68k)
@@ -1909,6 +1910,11 @@
mkdev epcom$unit c %epcom_chr% $unit "" "" $u_uucp
;;
+plcom[0-9]*)
+ unit=${i#plcom}
+ mkdev plcom$unit c %plcom_chr% $unit "" "" $u_uucp
+ ;;
+
ucbsnd)
mkdev ucbsnd c %ucbsnd_chr% 0 666
;;
diff -r fe4479b8ae11 -r 078bfcd67aae etc/etc.evbarm/MAKEDEV.conf
--- a/etc/etc.evbarm/MAKEDEV.conf Mon Feb 11 21:50:30 2013 +0000
+++ b/etc/etc.evbarm/MAKEDEV.conf Wed Feb 13 01:36:06 2013 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: MAKEDEV.conf,v 1.5 2011/03/20 03:00:56 nonaka Exp $
+# $NetBSD: MAKEDEV.conf,v 1.5.6.1 2013/02/13 01:36:07 riz Exp $
all_md)
makedev wscons fd0 fd1 wd0 wd1 wd2 wd3 sd0 sd1 sd2 sd3 ld0
makedev flash0 flash1 flash2 flash3 flash4 flash5 flash6 flash7
- makedev tty0 tty1 st0 st1 ch0 cd0 cd1
+ makedev tty0 tty1 plcom0 st0 st1 ch0 cd0 cd1
makedev uk0 uk1 ss0
makedev lpa0 lpt0
makedev usbs isdns
diff -r fe4479b8ae11 -r 078bfcd67aae external/broadcom/rpi-firmware/dist/LICENCE.broadcom
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/broadcom/rpi-firmware/dist/LICENCE.broadcom Wed Feb 13 01:36:06 2013 +0000
@@ -0,0 +1,29 @@
+Copyright (c) 2006, Broadcom Corporation.
+All rights reserved.
+
+Redistribution. Redistribution and use in binary form, without
+modification, are permitted provided that the following conditions are
+met:
+
+* This software may only be used for the purposes of developing for,
+ running or using a Raspberry Pi device.
+* Redistributions must reproduce the above copyright notice and the
+ following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+* Neither the name of Broadcom Corporation nor the names of its suppliers
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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
+COPYRIGHT OWNER 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.
+
diff -r fe4479b8ae11 -r 078bfcd67aae external/broadcom/rpi-firmware/dist/bootcode.bin
Binary file external/broadcom/rpi-firmware/dist/bootcode.bin has changed
diff -r fe4479b8ae11 -r 078bfcd67aae external/broadcom/rpi-firmware/dist/fixup.dat
Binary file external/broadcom/rpi-firmware/dist/fixup.dat has changed
diff -r fe4479b8ae11 -r 078bfcd67aae external/broadcom/rpi-firmware/dist/fixup_cd.dat
Binary file external/broadcom/rpi-firmware/dist/fixup_cd.dat has changed
diff -r fe4479b8ae11 -r 078bfcd67aae external/broadcom/rpi-firmware/dist/start.elf
Binary file external/broadcom/rpi-firmware/dist/start.elf has changed
diff -r fe4479b8ae11 -r 078bfcd67aae external/broadcom/rpi-firmware/dist/start_cd.elf
Binary file external/broadcom/rpi-firmware/dist/start_cd.elf has changed
diff -r fe4479b8ae11 -r 078bfcd67aae sys/arch/arm/broadcom/bcm2835_bsc.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_bsc.c Wed Feb 13 01:36:06 2013 +0000
@@ -0,0 +1,362 @@
+/* $NetBSD: bcm2835_bsc.c,v 1.1.4.2 2013/02/13 01:36:14 riz Exp $ */
+
+/*
+ * Copyright (c) 2012 Jonathan A. Kollasch
+ * 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 COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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 <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.1.4.2 2013/02/13 01:36:14 riz Exp $");
+
+#include <sys/param.h>
+#include <sys/device.h>
+#include <sys/systm.h>
+#include <sys/mutex.h>
+#include <sys/bus.h>
+#include <sys/intr.h>
+
+#include <dev/i2c/i2cvar.h>
+
+#include <arm/broadcom/bcm_amba.h>
+#include <arm/broadcom/bcm2835reg.h>
+#include <arm/broadcom/bcm2835_bscreg.h>
+#include <arm/broadcom/bcm2835_gpio_subr.h>
+
+#if defined(_KERNEL_OPT)
+#include "opt_kernhist.h"
+#endif
+#include <sys/kernhist.h>
+
+KERNHIST_DECL(bsciichist);
+
+struct bsciic_softc {
+ device_t sc_dev;
+ bus_space_tag_t sc_iot;
+ bus_space_handle_t sc_ioh;
+ bus_size_t sc_ios;
+ struct i2c_controller sc_i2c;
+ kmutex_t sc_buslock;
+ void *sc_inth;
+};
+
+static int bsciic_match(device_t, cfdata_t, void *);
+static void bsciic_attach(device_t, device_t, void *);
+
+void bsciic_dump_regs(struct bsciic_softc * const);
+
+static int bsciic_acquire_bus(void *, int);
+static void bsciic_release_bus(void *, int);
+static int bsciic_exec(void *, i2c_op_t, i2c_addr_t, const void *, size_t,
+ void *, size_t, int);
+
+CFATTACH_DECL_NEW(bsciic, sizeof(struct bsciic_softc),
+ bsciic_match, bsciic_attach, NULL, NULL);
+
+static int
+bsciic_match(device_t parent, cfdata_t match, void *aux)
+{
+ struct amba_attach_args * const aaa = aux;
+
+ if (strcmp(aaa->aaa_name, "bcmbsc") != 0)
+ return 0;
+
+ return 1;
+}
+
+static void
+bsciic_attach(device_t parent, device_t self, void *aux)
+{
+ struct bsciic_softc * const sc = device_private(self);
+ struct amba_attach_args * const aaa = aux;
+ struct i2cbus_attach_args iba;
+ u_int bscunit = ~0;
+
+ switch (aaa->aaa_addr) {
+ case BCM2835_BSC0_BASE:
+ bscunit = 0;
+ break;
+ case BCM2835_BSC1_BASE:
+ bscunit = 1;
+ break;
+ }
+
+ aprint_naive("\n");
+ aprint_normal(": BSC%u\n", bscunit);
+
+ KERNHIST_INIT(bsciichist, 512);
+
+ sc->sc_dev = self;
+
+ mutex_init(&sc->sc_buslock, MUTEX_DEFAULT, IPL_NONE);
+
+ sc->sc_iot = aaa->aaa_iot;
+ if (bus_space_map(aaa->aaa_iot, aaa->aaa_addr, aaa->aaa_size, 0,
+ &sc->sc_ioh) != 0) {
+ aprint_error_dev(sc->sc_dev, "unable to map device\n");
+ return;
+ }
+ sc->sc_ios = aaa->aaa_size;
+
+ switch (aaa->aaa_addr) {
+ case BCM2835_BSC0_BASE:
+ /* SDA0 on GPIO0, SCL0 on GPIO1 */
+ bcm2835gpio_function_select(0, BCM2835_GPIO_ALT0);
+ bcm2835gpio_function_select(1, BCM2835_GPIO_ALT0);
+ break;
+ case BCM2835_BSC1_BASE:
+ /* SDA1 on GPIO2, SCL1 on GPIO3 */
+ bcm2835gpio_function_select(2, BCM2835_GPIO_ALT0);
+ bcm2835gpio_function_select(3, BCM2835_GPIO_ALT0);
+ break;
+ }
+
+ /* clear FIFO, disable controller */
+ bus_space_write_4(sc->sc_iot, sc->sc_ioh, BSC_C, BSC_C_CLEAR_CLEAR);
+ bus_space_write_4(sc->sc_iot, sc->sc_ioh, BSC_S, BSC_S_CLKT |
+ BSC_S_ERR | BSC_S_DONE);
+ bus_space_write_4(sc->sc_iot, sc->sc_ioh, BSC_DIV,
+ __SHIFTIN(250000000/100000, BSC_DIV_CDIV)); // XXX may not be this
+
+ sc->sc_i2c.ic_cookie = sc;
+ sc->sc_i2c.ic_acquire_bus = bsciic_acquire_bus;
+ sc->sc_i2c.ic_release_bus = bsciic_release_bus;
+ sc->sc_i2c.ic_exec = bsciic_exec;
+
+ memset(&iba, 0, sizeof(iba));
+
+ iba.iba_tag = &sc->sc_i2c;
+ iba.iba_type = 0;
+ config_found_ia(self, "i2cbus", &iba, iicbus_print);
+}
+
+void
+bsciic_dump_regs(struct bsciic_softc * const sc)
+{
+ KERNHIST_FUNC(__func__);
+ KERNHIST_CALLED(bsciichist);
+
+ KERNHIST_LOG(bsciichist, "C %08x S %08x D %08x A %08x",
+ bus_space_read_4(sc->sc_iot, sc->sc_ioh, BSC_C),
+ bus_space_read_4(sc->sc_iot, sc->sc_ioh, BSC_S),
+ bus_space_read_4(sc->sc_iot, sc->sc_ioh, BSC_DLEN),
+ bus_space_read_4(sc->sc_iot, sc->sc_ioh, BSC_A)
+ );
+}
+
+static int
+bsciic_acquire_bus(void *v, int flags)
+{
+ struct bsciic_softc * const sc = v;
+ uint32_t s;
+
+ mutex_enter(&sc->sc_buslock);
+
+ bus_space_write_4(sc->sc_iot, sc->sc_ioh, BSC_S, BSC_S_CLKT |
+ BSC_S_ERR | BSC_S_DONE);
+ bus_space_write_4(sc->sc_iot, sc->sc_ioh, BSC_C, BSC_C_I2CEN |
+ BSC_C_CLEAR_CLEAR);
+ s = bus_space_read_4(sc->sc_iot, sc->sc_ioh, BSC_S);
+ KASSERT((s & BSC_S_TA) == 0);
+
+ return 0;
+}
+
+static void
+bsciic_release_bus(void *v, int flags)
+{
+ struct bsciic_softc * const sc = v;
+
+ bus_space_write_4(sc->sc_iot, sc->sc_ioh, BSC_C, BSC_C_CLEAR_CLEAR);
+
+ mutex_exit(&sc->sc_buslock);
+}
+
+static int
+bsciic_exec(void *v, i2c_op_t op, i2c_addr_t addr, const void *cmdbuf,
+ size_t cmdlen, void *databuf, size_t datalen, int flags)
+{
+ KERNHIST_FUNC(__func__); KERNHIST_CALLED(bsciichist);
+ struct bsciic_softc * const sc = v;
+ uint32_t c, s, dlen, a;
+ uint32_t j;
+ uint8_t *buf;
+ size_t len;
+ size_t pos;
+ int error = 0;
+ const bool isread = I2C_OP_READ_P(op);
+
Home |
Main Index |
Thread Index |
Old Index