Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbmips sbmips->evbmips merge: import all the all ...



details:   https://anonhg.NetBSD.org/src/rev/f0e7512ca8c3
branches:  trunk
changeset: 825591:f0e7512ca8c3
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Jul 24 09:21:50 2017 +0000

description:
sbmips->evbmips merge:  import all the all the header files except
intr.h and disklabel.h that are needed.  both of these will need
some special attention.

diffstat:

 sys/arch/evbmips/include/loadfile_machdep.h |  53 +++++++++++++++++
 sys/arch/evbmips/sbmips/autoconf.h          |  87 +++++++++++++++++++++++++++++
 sys/arch/evbmips/sbmips/cpuvar.h            |  21 +++++++
 sys/arch/evbmips/sbmips/leds.h              |  37 ++++++++++++
 sys/arch/evbmips/sbmips/swarm.h             |  79 ++++++++++++++++++++++++++
 sys/arch/evbmips/sbmips/systemsw.h          |  65 +++++++++++++++++++++
 6 files changed, 342 insertions(+), 0 deletions(-)

diffs (truncated from 366 to 300 lines):

diff -r fbb1d05d73a2 -r f0e7512ca8c3 sys/arch/evbmips/include/loadfile_machdep.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/include/loadfile_machdep.h       Mon Jul 24 09:21:50 2017 +0000
@@ -0,0 +1,53 @@
+/*     $NetBSD: loadfile_machdep.h,v 1.1.1.1 2017/07/24 09:21:50 mrg Exp $     */
+
+/*-
+ * Copyright (c) 1999 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#define BOOT_ELF32
+#define BOOT_ELF64
+
+#define LOAD_KERNEL    (LOAD_ALL & ~LOAD_TEXTA)
+#define COUNT_KERNEL   (COUNT_ALL & ~COUNT_TEXTA)
+
+#define LOADADDR(a)            (((u_long)(a)) + offset)
+#define ALIGNENTRY(a)          ((u_long)(a))
+#define READ(f, b, c)          read((f), (void *)LOADADDR(b), (c))
+#define BCOPY(s, d, c)         memcpy((void *)LOADADDR(d), (void *)(s), (c))
+#define BZERO(d, c)            memset((void *)LOADADDR(d), 0, (c))
+#define        WARN(a)                 do { \
+                                       (void)printf a; \
+                                       if (errno) \
+                                               (void)printf(": %s\n", \
+                                                            strerror(errno)); \
+                                       else \
+                                               (void)printf("\n"); \
+                               } while(/* CONSTCOND */0)
+#define PROGRESS(a)            (void) printf a
+#define ALLOC(a)               alloc(a)
+#define DEALLOC(a, b)          dealloc(a, b)
diff -r fbb1d05d73a2 -r f0e7512ca8c3 sys/arch/evbmips/sbmips/autoconf.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/sbmips/autoconf.h        Mon Jul 24 09:21:50 2017 +0000
@@ -0,0 +1,87 @@
+/* $NetBSD: autoconf.h,v 1.1.1.1 2017/07/24 09:21:50 mrg Exp $ */
+
+/*
+ * Copyright 2000, 2001
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and copied only
+ * in accordance with the following terms and conditions.  Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * modified or unmodified copies of this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and
+ *    retain this copyright notice and list of conditions as they appear in
+ *    the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ *    Broadcom Corporation.  The "Broadcom Corporation" name may not be
+ *    used to endorse or promote products derived from this software
+ *    without the prior written permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED
+ *    WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
+ *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ *    NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE
+ *    FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE
+ *    LIABLE FOR 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), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Machine-dependent structures for autoconfiguration
+ */
+
+/*
+ * The boot program passes a pointer to a bootinfo structure to the
+ * kernel using the following convention:
+ *
+ *     a0 - CFE handle
+ *     a1 - bootinfo magic
+ *     a2 - pointer to bootinfo_v1 structrure
+ *     a3 - reserved, 0
+ */
+
+#define        BOOTINFO_MAGIC                  0x1234ABCD
+#define        BOOTINFO_VERSION                1
+
+#if _LP64
+#define BI_FIXUP(x) ((vaddr_t)x | 0xffffffff00000000)
+#else
+#define BI_FIXUP(x) x
+#endif
+ 
+
+struct bootinfo_v1 {
+       uint32_t        version;        /*  0: version of bootinfo       */
+       uint32_t        reserved;       /*  4: round to 64-bit boundary  */
+       uint32_t        ssym;           /*  8: start of kernel sym table */
+       uint32_t        esym;           /* 12: end of kernel sym table   */
+       char    boot_flags[64];         /* 16: boot flags                */
+       char    booted_kernel[64];      /* 80: name of booted kernel     */
+       uint32_t        fwhandle;       /* 144: firmware handle          */
+       uint32_t        fwentry;        /* 148: firmware entry point     */
+       u_char  reserved2[100];         /* 256: total size               */
+};
+
+
+struct bootinfo_v1_int {
+       uint32_t        version;        /*   0/0: version of bootinfo       */
+       uint32_t        reserved;       /*   4/4: round to 64-bit boundary  */
+       vaddr_t ssym;                   /*   8/8: start of kernel sym table */
+       vaddr_t esym;                   /* 12/16: end of kernel sym table   */
+       char    boot_flags[64];         /* 16/24: boot flags                */
+       char    booted_kernel[64];      /* 80/88: name of booted kernel     */
+       vaddr_t fwhandle;               /* 144/152: firmware handle         */
+       vaddr_t fwentry;                /* 148/160: firmware entry point    */
+#ifdef _LP64
+       u_char  reserved2[88];          /* 168: total size -> 256           */
+#else
+       u_char  reserved2[104];         /* 152: total size -> 256           */
+#endif
+};
+
diff -r fbb1d05d73a2 -r f0e7512ca8c3 sys/arch/evbmips/sbmips/cpuvar.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/sbmips/cpuvar.h  Mon Jul 24 09:21:50 2017 +0000
@@ -0,0 +1,21 @@
+/* $NetBSD: cpuvar.h,v 1.1.1.1 2017/07/24 09:21:50 mrg Exp $ */
+
+#ifndef _SBMIPS_CPUVAR_H_
+#define _SBMIPS_CPUVAR_H_
+
+#include <mips/cpu.h>
+
+#ifndef _LOCORE
+struct cpu_softc {
+       device_t sb1cpu_dev;
+       struct cpu_info *sb1cpu_ci;
+       vaddr_t sb1cpu_imr_base;
+       uint64_t sb1cpu_imr_all;
+       struct evcnt sb1cpu_intr_evcnts[64];
+       struct evcnt sb1cpu_spurious_intrs[_IPL_N];
+       struct evcnt sb1cpu_intrs[_IPL_N];
+       struct evcnt sb1cpu_int5;
+};
+#endif /* _LOCORE */
+
+#endif /* !_SBMIPS_CPUVAR_H_ */
diff -r fbb1d05d73a2 -r f0e7512ca8c3 sys/arch/evbmips/sbmips/leds.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/sbmips/leds.h    Mon Jul 24 09:21:50 2017 +0000
@@ -0,0 +1,37 @@
+/* $NetBSD: leds.h,v 1.1.1.1 2017/07/24 09:21:50 mrg Exp $ */
+
+/*
+ * Copyright 2000
+ * Broadcom Corporation. All rights reserved.
+ *
+ * This software is furnished under license and may be used and copied only
+ * in accordance with the following terms and conditions.  Subject to these
+ * conditions, you may download, copy, install, use, modify and distribute
+ * modified or unmodified copies of this software in source and/or binary
+ * form. No title or ownership is transferred hereby.
+ *
+ * 1) Any source code used, modified or distributed must reproduce and
+ *    retain this copyright notice and list of conditions as they appear in
+ *    the source file.
+ *
+ * 2) No right is granted to use any trade name, trademark, or logo of
+ *    Broadcom Corporation.  The "Broadcom Corporation" name may not be
+ *    used to endorse or promote products derived from this software
+ *    without the prior written permission of Broadcom Corporation.
+ *
+ * 3) THIS SOFTWARE IS PROVIDED "AS-IS" AND ANY EXPRESS OR IMPLIED
+ *    WARRANTIES, INCLUDING BUT NOT LIMITED TO, ANY IMPLIED WARRANTIES OF
+ *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+ *    NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM BE LIABLE
+ *    FOR ANY DAMAGES WHATSOEVER, AND IN PARTICULAR, BROADCOM SHALL NOT BE
+ *    LIABLE FOR 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), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* XXX DOES NOT BELONG HERE */
+
+void   cswarm_setleds(const char *str);
diff -r fbb1d05d73a2 -r f0e7512ca8c3 sys/arch/evbmips/sbmips/swarm.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/sbmips/swarm.h   Mon Jul 24 09:21:50 2017 +0000
@@ -0,0 +1,79 @@
+/* $NetBSD: swarm.h,v 1.1.1.1 2017/07/24 09:21:50 mrg Exp $ */
+
+/*
+ * I/O Address assignments for the CSWARM board
+ *
+ * Summary of address map:
+ *
+ * Address         Size   CSel    Description
+ * --------------- ----   ------  --------------------------------
+ * 0x1FC00000      2MB     CS0    Boot ROM
+ * 0x1F800000      2MB     CS1    Alternate boot ROM
+ *                         CS2    Unused
+ * 0x100A0000      64KB    CS3    LED display
+ * 0x100B0000      64KB    CS4    IDE Disk
+ *                         CS5    Unused
+ * 0x11000000      64MB    CS6    PCMCIA
+ *                         CS7    Unused
+ *
+ * GPIO assignments
+ *
+ * GPIO#    Direction  Description
+ * -------  ---------  ------------------------------------------
+ * GPIO0    Output     Debug LED
+ * GPIO1    Output     Sturgeon NMI
+ * GPIO2    Input      PHY Interrupt                   (interrupt)
+ * GPIO3    Input      Nonmaskable Interrupt           (interrupt)
+ * GPIO4    Input      IDE Disk Interrupt              (interrupt)
+ * GPIO5    Input      Temperature Sensor Alert        (interrupt)
+ * GPIO6    N/A                PCMCIA interface
+ * GPIO7    N/A                PCMCIA interface
+ * GPIO8    N/A                PCMCIA interface
+ * GPIO9    N/A                PCMCIA interface
+ * GPIO10   N/A                PCMCIA interface
+ * GPIO11   N/A                PCMCIA interface
+ * GPIO12   N/A                PCMCIA interface
+ * GPIO13   N/A                PCMCIA interface
+ * GPIO14   N/A                PCMCIA interface
+ * GPIO15   N/A                PCMCIA interface
+*/
+
+
+/* GPIO pins */
+#define        GPIO_DEBUG_LED          0
+#define        GPIO_STURGEON_NMI       1
+#define        GPIO_PHY_INTERRUPT      2
+#define        GPIO_NONMASKABLE_INT    3
+#define        GPIO_IDE_INTERRUPT      4
+#define        GPIO_TEMP_SENSOR_INT    5
+
+/* device addresses */
+#define        SWARM_LEDS_PHYS         0x100a0000
+#define        SWARM_IDE_PHYS          0x100b0000
+#define        SWARM_PCMCIA_PHYS       0x11000000
+
+/* SMBus devices */
+#define        TEMPSENSOR_SMBUS_CHAN   0
+#define        TEMPSENSOR_SMBUS_DEV    0x2A
+
+#define        DRAM_SMBUS_CHAN         0
+#define        DRAM_SMBUS_DEV          0x54
+
+#define        BIGEEPROM_SMBUS_CHAN    0
+#define        BIGEEPROM_SMBUS_DEV     0x50
+
+#define        BIGEEPROM_SMBUS_CHAN_1  1       /* rev 2.0 swarm only */
+#define        BIGEEPROM_SMBUS_DEV_1   0x51
+
+#define        CFG_DRAM_SMBUS_CHAN     0
+#define        CFG_DRAM_SMBUS_BASE     0x54    /* starting SMBus device base */
+
+#define        X1241_SMBUS_CHAN        1       /* rev 1.0 swarm only, fixed slave address */
+
+#define        M41T81_SMBUS_CHAN       1       /* rev 2.0 swarm only (or PCF8563), fixed slave address */
+
+#define        PCF8563_SMBUS_CHAN      1       /* rev 2.0 swarm only (or M41T81) */
+#define        PCF8563_SMBUS_DEV       0x50
+
+#define        MAX1617A_SMBUS_CHAN     0       /* or MAX6654 on newer board, reg compatible */
+#define        MAX1617A_SMBUS_DEV      0x2a
diff -r fbb1d05d73a2 -r f0e7512ca8c3 sys/arch/evbmips/sbmips/systemsw.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/evbmips/sbmips/systemsw.h        Mon Jul 24 09:21:50 2017 +0000



Home | Main Index | Thread Index | Old Index