Index: head/etc/rc.d/devmatch =================================================================== --- head/etc/rc.d/devmatch (revision 333142) +++ head/etc/rc.d/devmatch (revision 333143) @@ -1,67 +1,66 @@ #!/bin/sh -# Copyright (c) 2018 Warner Losh -# All rights reserved. +# Copyright (c) 2018 M. Warner Losh # # 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$ # # PROVIDE: devmatch # REQUIRE: kldxref # KEYWORD: nojail . /etc/rc.subr name="devmatch" desc="Use devmatch(8) to load kernel modules" start_cmd="${name}_start" stop_cmd=':' one_nomatch="$2" devmatch_start() { local x if [ -n "$one_nomatch" ]; then x=$(devmatch -p "${one_nomatch}") else x=$(devmatch) fi [ -n "$x" ] || return # While kldload can accept multiple modules # on the line at once, we loop here in case # there's some weird error with one of them. # We also optimize against the false positives # or drivers that have symbolic links that # confuse devmatch by running it -n. for m in ${x}; do echo "Autoloading module: ${m}" kldload -n ${m} done } load_rc_config $name run_rc_command "$1" Index: head/share/man/man4/sn.4 =================================================================== --- head/share/man/man4/sn.4 (revision 333142) +++ head/share/man/man4/sn.4 (revision 333143) @@ -1,108 +1,107 @@ .\" -.\" Copyright (c) 2000 Warner Losh -.\" All rights reserved. +.\" Copyright (c) 2000 M. Warner Losh .\" .\" 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 ``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. .\" .\" $FreeBSD$ .\" .Dd July 16, 2005 .Dt SN 4 .Os .Sh NAME .Nm sn .Nd "Ethernet driver for SMC91Cxx based cards" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "device sn" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent if_sn_load="YES" .Ed .Sh DESCRIPTION The .Nm device driver supports SMC91Cxx based ISA and PCMCIA cards. .Sh HARDWARE The .Nm driver supports SMC91Cxx based ISA and PCMCIA cards including: .Pp .Bl -bullet -compact .It 3Com Megahertz X-Jack Ethernet PC Card XJ10BT, XJ10BC .It 3Com Megahertz XJEM and CCEM series: CCEM3288C, CCEM3288T, CCEM3336, CEM3336C, CCEM3336T, XJEM1144C, XJEM1144T, XJEM3288C, XJEM3288T, XJEM3336 .It Farallon EtherMac PC Card 595a .It Motorola Mariner Ethernet/Modem PC Card .It Ositech Seven of Diamonds Ethernet PC Card .It Ositech Jack of Hearts Ethernet/Modem PC Card .It Psion Gold Card Netglobal Ethernet PC Card .It Psion Gold Card Netglobal 10/100 Fast Ethernet PC Card .It Psion Gold Card Netglobal 56k+10Mb Ethernet PC Card .It SMC EZEther PC Card (8020BT) .It SMC EZEther PC Card (8020T) .El .Pp The .Nm driver supports the SMC 91C90, SMC 91C92, SMC 91C94, SMC 91C95, SMC 91C96, SMC91C100 and SMC 91C100FD chips from SMC. .Pp The Farallon EtherWave and EtherMac card came in two varieties. The .Xr ep 4 driver supports the 595 and 895 cards. These cards have the blue arrow on the front along with a 3Com logo. The Farallon 595a cards, which have a red arrow on the front, are also called EtherWave and EtherMac. They are supported by the .Nm driver. .Sh SEE ALSO .Xr ed 4 , .Xr ep 4 , .Xr intro 4 , .Xr ng_ether 4 , .Xr vx 4 , .Xr ifconfig 8 .Sh HISTORY The .Nm device driver appeared in .Fx 4.0 . Index: head/stand/common/zfs_cmd.c =================================================================== --- head/stand/common/zfs_cmd.c (revision 333142) +++ head/stand/common/zfs_cmd.c (revision 333143) @@ -1,108 +1,107 @@ /*- - * Copyright (c) 2018 Warner Losh - * All rights reserved. + * Copyright (c) 2018 M. Warner Losh * * 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$"); /* * MD bootstrap main() and assorted miscellaneous * commands. */ #include #include #include #include #include "bootstrap.h" #ifdef LOADER_ZFS_SUPPORT #include "../zfs/libzfs.h" #endif COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset", command_lszfs); static int command_lszfs(int argc, char *argv[]) { int err; if (argc != 2) { command_errmsg = "a single dataset must be supplied"; return (CMD_ERROR); } err = zfs_list(argv[1]); if (err != 0) { command_errmsg = strerror(err); return (CMD_ERROR); } return (CMD_OK); } COMMAND_SET(reloadbe, "reloadbe", "refresh the list of ZFS Boot Environments", command_reloadbe); static int command_reloadbe(int argc, char *argv[]) { int err; char *root; if (argc > 2) { command_errmsg = "wrong number of arguments"; return (CMD_ERROR); } if (argc == 2) { err = zfs_bootenv(argv[1]); } else { root = getenv("zfs_be_root"); if (root == NULL) { /* There does not appear to be a ZFS pool here, exit without error */ return (CMD_OK); } err = zfs_bootenv(root); } if (err != 0) { command_errmsg = strerror(err); return (CMD_ERROR); } return (CMD_OK); } uint64_t ldi_get_size(void *priv) { int fd = (uintptr_t) priv; uint64_t size; ioctl(fd, DIOCGMEDIASIZE, &size); return (size); } Index: head/stand/liblua/float.h =================================================================== --- head/stand/liblua/float.h (revision 333142) +++ head/stand/liblua/float.h (revision 333143) @@ -1,32 +1,31 @@ /*- - * Copyright (c) 2018 M Warner Losh - * All rights reserved. + * Copyright (c) 2018 M. Warner Losh * * 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$ */ /* * Empty file to keep lua build happy. Lua expects to have to include float.h * but the int64_t number implementation doesn't need it. */ Index: head/stand/liblua/locale.h =================================================================== --- head/stand/liblua/locale.h (revision 333142) +++ head/stand/liblua/locale.h (revision 333143) @@ -1,27 +1,26 @@ /*- - * Copyright (c) 2018 M Warner Losh - * All rights reserved. + * Copyright (c) 2018 M. Warner Losh * * 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$ */ Index: head/stand/liblua/math.h =================================================================== --- head/stand/liblua/math.h (revision 333142) +++ head/stand/liblua/math.h (revision 333143) @@ -1,38 +1,37 @@ /*- - * Copyright (c) 2018 M Warner Losh - * All rights reserved. + * Copyright (c) 2018 M. Warner Losh * * 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$ */ /* * A replacement for math.h that's sufficient to pretend that we * actually have one to keep the un-modified lua happy. */ #include int64_t lstd_pow(int64_t x, int64_t y); int64_t lstd_floor(int64_t); int64_t lstd_fmod(int64_t a, int64_t b); int64_t lstd_frexp(int64_t a, int *); Index: head/sys/dev/exca/exca.c =================================================================== --- head/sys/dev/exca/exca.c (revision 333142) +++ head/sys/dev/exca/exca.c (revision 333143) @@ -1,929 +1,929 @@ /*- * SPDX-License-Identifier: BSD-4-Clause AND BSD-2-Clause-FreeBSD * - * Copyright (c) 2002-2005 M Warner Losh. All rights reserved. + * Copyright (c) 2002-2005 M. Warner Losh. * * 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 ``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 may be derived from NetBSD i82365.c and other files with * the following copyright: * * Copyright (c) 1997 Marc Horowitz. 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 Marc Horowitz. * 4. 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 ``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. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef EXCA_DEBUG #define DEVPRINTF(dev, fmt, args...) device_printf((dev), (fmt), ## args) #define DPRINTF(fmt, args...) printf(fmt, ## args) #else #define DEVPRINTF(dev, fmt, args...) #define DPRINTF(fmt, args...) #endif static const char *chip_names[] = { "CardBus socket", "Intel i82365SL-A/B or clone", "Intel i82365sl-DF step", "VLSI chip", "Cirrus Logic PD6710", "Cirrus logic PD6722", "Cirrus Logic PD6729", "Vadem 365", "Vadem 465", "Vadem 468", "Vadem 469", "Ricoh RF5C296", "Ricoh RF5C396", "IBM clone", "IBM KING PCMCIA Controller" }; static exca_getb_fn exca_mem_getb; static exca_putb_fn exca_mem_putb; static exca_getb_fn exca_io_getb; static exca_putb_fn exca_io_putb; /* memory */ #define EXCA_MEMINFO(NUM) { \ EXCA_SYSMEM_ADDR ## NUM ## _START_LSB, \ EXCA_SYSMEM_ADDR ## NUM ## _START_MSB, \ EXCA_SYSMEM_ADDR ## NUM ## _STOP_LSB, \ EXCA_SYSMEM_ADDR ## NUM ## _STOP_MSB, \ EXCA_SYSMEM_ADDR ## NUM ## _WIN, \ EXCA_CARDMEM_ADDR ## NUM ## _LSB, \ EXCA_CARDMEM_ADDR ## NUM ## _MSB, \ EXCA_ADDRWIN_ENABLE_MEM ## NUM, \ } static struct mem_map_index_st { int sysmem_start_lsb; int sysmem_start_msb; int sysmem_stop_lsb; int sysmem_stop_msb; int sysmem_win; int cardmem_lsb; int cardmem_msb; int memenable; } mem_map_index[] = { EXCA_MEMINFO(0), EXCA_MEMINFO(1), EXCA_MEMINFO(2), EXCA_MEMINFO(3), EXCA_MEMINFO(4) }; #undef EXCA_MEMINFO static uint8_t exca_mem_getb(struct exca_softc *sc, int reg) { return (bus_space_read_1(sc->bst, sc->bsh, sc->offset + reg)); } static void exca_mem_putb(struct exca_softc *sc, int reg, uint8_t val) { bus_space_write_1(sc->bst, sc->bsh, sc->offset + reg, val); } static uint8_t exca_io_getb(struct exca_softc *sc, int reg) { bus_space_write_1(sc->bst, sc->bsh, EXCA_REG_INDEX, reg + sc->offset); return (bus_space_read_1(sc->bst, sc->bsh, EXCA_REG_DATA)); } static void exca_io_putb(struct exca_softc *sc, int reg, uint8_t val) { bus_space_write_1(sc->bst, sc->bsh, EXCA_REG_INDEX, reg + sc->offset); bus_space_write_1(sc->bst, sc->bsh, EXCA_REG_DATA, val); } /* * Helper function. This will map the requested memory slot. We setup the * map before we call this function. This is used to initially force the * mapping, as well as later restore the mapping after it has been destroyed * in some fashion (due to a power event typically). */ static void exca_do_mem_map(struct exca_softc *sc, int win) { struct mem_map_index_st *map; struct pccard_mem_handle *mem; uint32_t offset; uint32_t mem16; uint32_t attrmem; map = &mem_map_index[win]; mem = &sc->mem[win]; mem16 = (mem->kind & PCCARD_MEM_16BIT) ? EXCA_SYSMEM_ADDRX_START_MSB_DATASIZE_16BIT : 0; attrmem = (mem->kind & PCCARD_MEM_ATTR) ? EXCA_CARDMEM_ADDRX_MSB_REGACTIVE_ATTR : 0; offset = ((mem->cardaddr >> EXCA_CARDMEM_ADDRX_SHIFT) - (mem->addr >> EXCA_SYSMEM_ADDRX_SHIFT)) & 0x3fff; exca_putb(sc, map->sysmem_start_lsb, mem->addr >> EXCA_SYSMEM_ADDRX_SHIFT); exca_putb(sc, map->sysmem_start_msb, ((mem->addr >> (EXCA_SYSMEM_ADDRX_SHIFT + 8)) & EXCA_SYSMEM_ADDRX_START_MSB_ADDR_MASK) | mem16); exca_putb(sc, map->sysmem_stop_lsb, (mem->addr + mem->realsize - 1) >> EXCA_SYSMEM_ADDRX_SHIFT); exca_putb(sc, map->sysmem_stop_msb, (((mem->addr + mem->realsize - 1) >> (EXCA_SYSMEM_ADDRX_SHIFT + 8)) & EXCA_SYSMEM_ADDRX_STOP_MSB_ADDR_MASK) | EXCA_SYSMEM_ADDRX_STOP_MSB_WAIT2); exca_putb(sc, map->sysmem_win, mem->addr >> EXCA_MEMREG_WIN_SHIFT); exca_putb(sc, map->cardmem_lsb, offset & 0xff); exca_putb(sc, map->cardmem_msb, ((offset >> 8) & EXCA_CARDMEM_ADDRX_MSB_ADDR_MASK) | attrmem); DPRINTF("%s %d-bit memory", mem->kind & PCCARD_MEM_ATTR ? "attribute" : "common", mem->kind & PCCARD_MEM_16BIT ? 16 : 8); exca_setb(sc, EXCA_ADDRWIN_ENABLE, map->memenable | EXCA_ADDRWIN_ENABLE_MEMCS16); DELAY(100); #ifdef EXCA_DEBUG { int r1, r2, r3, r4, r5, r6, r7; r1 = exca_getb(sc, map->sysmem_start_msb); r2 = exca_getb(sc, map->sysmem_start_lsb); r3 = exca_getb(sc, map->sysmem_stop_msb); r4 = exca_getb(sc, map->sysmem_stop_lsb); r5 = exca_getb(sc, map->cardmem_msb); r6 = exca_getb(sc, map->cardmem_lsb); r7 = exca_getb(sc, map->sysmem_win); printf("exca_do_mem_map win %d: %#02x%#02x %#02x%#02x " "%#02x%#02x %#02x (%#08x+%#06x.%#06x*%#06x) flags %#x\n", win, r1, r2, r3, r4, r5, r6, r7, mem->addr, mem->size, mem->realsize, mem->cardaddr, mem->kind); } #endif } /* * public interface to map a resource. kind is the type of memory to * map (either common or attribute). Memory created via this interface * starts out at card address 0. Since the only way to set this is * to set it on a struct resource after it has been mapped, we're safe * in maping this assumption. Note that resources can be remapped using * exca_do_mem_map so that's how the card address can be set later. */ int exca_mem_map(struct exca_softc *sc, int kind, struct resource *res) { int win; for (win = 0; win < EXCA_MEM_WINS; win++) { if ((sc->memalloc & (1 << win)) == 0) { sc->memalloc |= (1 << win); break; } } if (win >= EXCA_MEM_WINS) return (ENOSPC); if (sc->flags & EXCA_HAS_MEMREG_WIN) { #ifdef __LP64__ if (rman_get_start(res) >> (EXCA_MEMREG_WIN_SHIFT + 8) != 0) { device_printf(sc->dev, "Does not support mapping above 4GB."); return (EINVAL); } #endif } else { if (rman_get_start(res) >> EXCA_MEMREG_WIN_SHIFT != 0) { device_printf(sc->dev, "Does not support mapping above 16M."); return (EINVAL); } } sc->mem[win].cardaddr = 0; sc->mem[win].memt = rman_get_bustag(res); sc->mem[win].memh = rman_get_bushandle(res); sc->mem[win].addr = rman_get_start(res); sc->mem[win].size = rman_get_end(res) - sc->mem[win].addr + 1; sc->mem[win].realsize = sc->mem[win].size + EXCA_MEM_PAGESIZE - 1; sc->mem[win].realsize = sc->mem[win].realsize - (sc->mem[win].realsize % EXCA_MEM_PAGESIZE); sc->mem[win].kind = kind; DPRINTF("exca_mem_map window %d bus %x+%x card addr %x\n", win, sc->mem[win].addr, sc->mem[win].size, sc->mem[win].cardaddr); exca_do_mem_map(sc, win); return (0); } /* * Private helper function. This turns off a given memory map that is in * use. We do this by just clearing the enable bit in the pcic. If we needed * to make memory unmapping/mapping pairs faster, we would have to store * more state information about the pcic and then use that to intelligently * to the map/unmap. However, since we don't do that sort of thing often * (generally just at configure time), it isn't a case worth optimizing. */ static void exca_mem_unmap(struct exca_softc *sc, int window) { if (window < 0 || window >= EXCA_MEM_WINS) panic("exca_mem_unmap: window out of range"); exca_clrb(sc, EXCA_ADDRWIN_ENABLE, mem_map_index[window].memenable); sc->memalloc &= ~(1 << window); } /* * Find the map that we're using to hold the resource. This works well * so long as the client drivers don't do silly things like map the same * area mutliple times, or map both common and attribute memory at the * same time. This latter restriction is a bug. We likely should just * store a pointer to the res in the mem[x] data structure. */ static int exca_mem_findmap(struct exca_softc *sc, struct resource *res) { int win; for (win = 0; win < EXCA_MEM_WINS; win++) { if (sc->mem[win].memt == rman_get_bustag(res) && sc->mem[win].addr == rman_get_start(res) && sc->mem[win].size == rman_get_size(res)) return (win); } return (-1); } /* * Set the memory flag. This means that we are setting if the memory * is coming from attribute memory or from common memory on the card. * CIS entries are generally in attribute memory (although they can * reside in common memory). Generally, this is the only use for attribute * memory. However, some cards require their drivers to dance in both * common and/or attribute memory and this interface (and setting the * offset interface) exist for such cards. */ int exca_mem_set_flags(struct exca_softc *sc, struct resource *res, uint32_t flags) { int win; win = exca_mem_findmap(sc, res); if (win < 0) { device_printf(sc->dev, "set_res_flags: specified resource not active\n"); return (ENOENT); } switch (flags) { case PCCARD_A_MEM_ATTR: sc->mem[win].kind |= PCCARD_MEM_ATTR; break; case PCCARD_A_MEM_COM: sc->mem[win].kind &= ~PCCARD_MEM_ATTR; break; case PCCARD_A_MEM_16BIT: sc->mem[win].kind |= PCCARD_MEM_16BIT; break; case PCCARD_A_MEM_8BIT: sc->mem[win].kind &= ~PCCARD_MEM_16BIT; break; } exca_do_mem_map(sc, win); return (0); } /* * Given a resource, go ahead and unmap it if we can find it in the * resrouce list that's used. */ int exca_mem_unmap_res(struct exca_softc *sc, struct resource *res) { int win; win = exca_mem_findmap(sc, res); if (win < 0) return (ENOENT); exca_mem_unmap(sc, win); return (0); } /* * Set the offset of the memory. We use this for reading the CIS and * frobbing the pccard's pccard registers (CCR, etc). Some drivers * need to access arbitrary attribute and common memory during their * initialization and operation. */ int exca_mem_set_offset(struct exca_softc *sc, struct resource *res, uint32_t cardaddr, uint32_t *deltap) { int win; uint32_t delta; win = exca_mem_findmap(sc, res); if (win < 0) { device_printf(sc->dev, "set_memory_offset: specified resource not active\n"); return (ENOENT); } sc->mem[win].cardaddr = rounddown2(cardaddr, EXCA_MEM_PAGESIZE); delta = cardaddr % EXCA_MEM_PAGESIZE; if (deltap) *deltap = delta; sc->mem[win].realsize = sc->mem[win].size + delta + EXCA_MEM_PAGESIZE - 1; sc->mem[win].realsize = sc->mem[win].realsize - (sc->mem[win].realsize % EXCA_MEM_PAGESIZE); exca_do_mem_map(sc, win); return (0); } /* I/O */ #define EXCA_IOINFO(NUM) { \ EXCA_IOADDR ## NUM ## _START_LSB, \ EXCA_IOADDR ## NUM ## _START_MSB, \ EXCA_IOADDR ## NUM ## _STOP_LSB, \ EXCA_IOADDR ## NUM ## _STOP_MSB, \ EXCA_ADDRWIN_ENABLE_IO ## NUM, \ EXCA_IOCTL_IO ## NUM ## _WAITSTATE \ | EXCA_IOCTL_IO ## NUM ## _ZEROWAIT \ | EXCA_IOCTL_IO ## NUM ## _IOCS16SRC_MASK \ | EXCA_IOCTL_IO ## NUM ## _DATASIZE_MASK, \ { \ EXCA_IOCTL_IO ## NUM ## _IOCS16SRC_CARD, \ EXCA_IOCTL_IO ## NUM ## _IOCS16SRC_DATASIZE \ | EXCA_IOCTL_IO ## NUM ## _DATASIZE_8BIT, \ EXCA_IOCTL_IO ## NUM ## _IOCS16SRC_DATASIZE \ | EXCA_IOCTL_IO ## NUM ## _DATASIZE_16BIT, \ } \ } static struct io_map_index_st { int start_lsb; int start_msb; int stop_lsb; int stop_msb; int ioenable; int ioctlmask; int ioctlbits[3]; /* indexed by PCCARD_WIDTH_* */ } io_map_index[] = { EXCA_IOINFO(0), EXCA_IOINFO(1), }; #undef EXCA_IOINFO static void exca_do_io_map(struct exca_softc *sc, int win) { struct io_map_index_st *map; struct pccard_io_handle *io; map = &io_map_index[win]; io = &sc->io[win]; exca_putb(sc, map->start_lsb, io->addr & 0xff); exca_putb(sc, map->start_msb, (io->addr >> 8) & 0xff); exca_putb(sc, map->stop_lsb, (io->addr + io->size - 1) & 0xff); exca_putb(sc, map->stop_msb, ((io->addr + io->size - 1) >> 8) & 0xff); exca_clrb(sc, EXCA_IOCTL, map->ioctlmask); exca_setb(sc, EXCA_IOCTL, map->ioctlbits[io->width]); exca_setb(sc, EXCA_ADDRWIN_ENABLE, map->ioenable); #ifdef EXCA_DEBUG { int r1, r2, r3, r4; r1 = exca_getb(sc, map->start_msb); r2 = exca_getb(sc, map->start_lsb); r3 = exca_getb(sc, map->stop_msb); r4 = exca_getb(sc, map->stop_lsb); DPRINTF("exca_do_io_map window %d: %02x%02x %02x%02x " "(%08x+%08x)\n", win, r1, r2, r3, r4, io->addr, io->size); } #endif } int exca_io_map(struct exca_softc *sc, int width, struct resource *r) { int win; #ifdef EXCA_DEBUG static char *width_names[] = { "auto", "io8", "io16"}; #endif for (win=0; win < EXCA_IO_WINS; win++) { if ((sc->ioalloc & (1 << win)) == 0) { sc->ioalloc |= (1 << win); break; } } if (win >= EXCA_IO_WINS) return (ENOSPC); sc->io[win].iot = rman_get_bustag(r); sc->io[win].ioh = rman_get_bushandle(r); sc->io[win].addr = rman_get_start(r); sc->io[win].size = rman_get_end(r) - sc->io[win].addr + 1; sc->io[win].flags = 0; sc->io[win].width = width; DPRINTF("exca_io_map window %d %s port %x+%x\n", win, width_names[width], sc->io[win].addr, sc->io[win].size); exca_do_io_map(sc, win); return (0); } static void exca_io_unmap(struct exca_softc *sc, int window) { if (window >= EXCA_IO_WINS) panic("exca_io_unmap: window out of range"); exca_clrb(sc, EXCA_ADDRWIN_ENABLE, io_map_index[window].ioenable); sc->ioalloc &= ~(1 << window); sc->io[window].iot = 0; sc->io[window].ioh = 0; sc->io[window].addr = 0; sc->io[window].size = 0; sc->io[window].flags = 0; sc->io[window].width = 0; } static int exca_io_findmap(struct exca_softc *sc, struct resource *res) { int win; for (win = 0; win < EXCA_IO_WINS; win++) { if (sc->io[win].iot == rman_get_bustag(res) && sc->io[win].addr == rman_get_start(res) && sc->io[win].size == rman_get_size(res)) return (win); } return (-1); } int exca_io_unmap_res(struct exca_softc *sc, struct resource *res) { int win; win = exca_io_findmap(sc, res); if (win < 0) return (ENOENT); exca_io_unmap(sc, win); return (0); } /* Misc */ /* * If interrupts are enabled, then we should be able to just wait for * an interrupt routine to wake us up. Busy waiting shouldn't be * necessary. Sadly, not all legacy ISA cards support an interrupt * for the busy state transitions, at least according to their datasheets, * so we busy wait a while here.. */ static void exca_wait_ready(struct exca_softc *sc) { int i; DEVPRINTF(sc->dev, "exca_wait_ready: status 0x%02x\n", exca_getb(sc, EXCA_IF_STATUS)); for (i = 0; i < 10000; i++) { if (exca_getb(sc, EXCA_IF_STATUS) & EXCA_IF_STATUS_READY) return; DELAY(500); } device_printf(sc->dev, "ready never happened, status = %02x\n", exca_getb(sc, EXCA_IF_STATUS)); } /* * Reset the card. Ideally, we'd do a lot of this via interrupts. * However, many PC Cards will deassert the ready signal. This means * that they are asserting an interrupt. This makes it hard to * do anything but a busy wait here. One could argue that these * such cards are broken, or that the bridge that allows this sort * of interrupt through isn't quite what you'd want (and may be a standards * violation). However, such arguing would leave a huge class of PC Cards * and bridges out of reach for use in the system. * * Maybe I should reevaluate the above based on the power bug I fixed * in OLDCARD. */ void exca_reset(struct exca_softc *sc, device_t child) { int win; /* enable socket i/o */ exca_setb(sc, EXCA_PWRCTL, EXCA_PWRCTL_OE); exca_putb(sc, EXCA_INTR, EXCA_INTR_ENABLE); /* hold reset for 30ms */ DELAY(30*1000); /* clear the reset flag */ exca_setb(sc, EXCA_INTR, EXCA_INTR_RESET); /* wait 20ms as per PC Card standard (r2.01) section 4.3.6 */ DELAY(20*1000); exca_wait_ready(sc); /* disable all address windows */ exca_putb(sc, EXCA_ADDRWIN_ENABLE, 0); exca_setb(sc, EXCA_INTR, EXCA_INTR_CARDTYPE_IO); DEVPRINTF(sc->dev, "card type is io\n"); /* reinstall all the memory and io mappings */ for (win = 0; win < EXCA_MEM_WINS; ++win) if (sc->memalloc & (1 << win)) exca_do_mem_map(sc, win); for (win = 0; win < EXCA_IO_WINS; ++win) if (sc->ioalloc & (1 << win)) exca_do_io_map(sc, win); } /* * Initialize the exca_softc data structure for the first time. */ void exca_init(struct exca_softc *sc, device_t dev, bus_space_tag_t bst, bus_space_handle_t bsh, uint32_t offset) { sc->dev = dev; sc->memalloc = 0; sc->ioalloc = 0; sc->bst = bst; sc->bsh = bsh; sc->offset = offset; sc->flags = 0; sc->getb = exca_mem_getb; sc->putb = exca_mem_putb; } /* * Is this socket valid? */ static int exca_valid_slot(struct exca_softc *exca) { uint8_t c; /* Assume the worst */ exca->chipset = EXCA_BOGUS; /* * see if there's a PCMCIA controller here * Intel PCMCIA controllers use 0x82 and 0x83 * IBM clone chips use 0x88 and 0x89, apparently */ c = exca_getb(exca, EXCA_IDENT); DEVPRINTF(exca->dev, "Ident is %x\n", c); if ((c & EXCA_IDENT_IFTYPE_MASK) != EXCA_IDENT_IFTYPE_MEM_AND_IO) return (0); if ((c & EXCA_IDENT_ZERO) != 0) return (0); switch (c & EXCA_IDENT_REV_MASK) { /* * 82365 or clones. */ case EXCA_IDENT_REV_I82365SLR0: case EXCA_IDENT_REV_I82365SLR1: exca->chipset = EXCA_I82365; /* * Check for Vadem chips by unlocking their extra * registers and looking for valid ID. Bit 3 in * the ID register is normally 0, except when * EXCA_VADEMREV is set. Other bridges appear * to ignore this frobbing. */ bus_space_write_1(exca->bst, exca->bsh, EXCA_REG_INDEX, EXCA_VADEM_COOKIE1); bus_space_write_1(exca->bst, exca->bsh, EXCA_REG_INDEX, EXCA_VADEM_COOKIE2); exca_setb(exca, EXCA_VADEM_VMISC, EXCA_VADEM_REV); c = exca_getb(exca, EXCA_IDENT); if (c & 0x08) { switch (c & 7) { case 1: exca->chipset = EXCA_VG365; break; case 2: exca->chipset = EXCA_VG465; break; case 3: exca->chipset = EXCA_VG468; break; default: exca->chipset = EXCA_VG469; break; } exca_clrb(exca, EXCA_VADEM_VMISC, EXCA_VADEM_REV); break; } /* * Check for RICOH RF5C[23]96 PCMCIA Controller */ c = exca_getb(exca, EXCA_RICOH_ID); if (c == EXCA_RID_396) { exca->chipset = EXCA_RF5C396; break; } else if (c == EXCA_RID_296) { exca->chipset = EXCA_RF5C296; break; } /* * Check for Cirrus logic chips. */ exca_putb(exca, EXCA_CIRRUS_CHIP_INFO, 0); c = exca_getb(exca, EXCA_CIRRUS_CHIP_INFO); if ((c & EXCA_CIRRUS_CHIP_INFO_CHIP_ID) == EXCA_CIRRUS_CHIP_INFO_CHIP_ID) { c = exca_getb(exca, EXCA_CIRRUS_CHIP_INFO); if ((c & EXCA_CIRRUS_CHIP_INFO_CHIP_ID) == 0) { if (c & EXCA_CIRRUS_CHIP_INFO_SLOTS) exca->chipset = EXCA_PD6722; else exca->chipset = EXCA_PD6710; break; } } break; case EXCA_IDENT_REV_I82365SLDF: /* * Intel i82365sl-DF step or maybe a vlsi 82c146 * we detected the vlsi case earlier, so if the controller * isn't set, we know it is a i82365sl step D. */ exca->chipset = EXCA_I82365SL_DF; break; case EXCA_IDENT_REV_IBM1: case EXCA_IDENT_REV_IBM2: exca->chipset = EXCA_IBM; break; case EXCA_IDENT_REV_IBM_KING: exca->chipset = EXCA_IBM_KING; break; default: return (0); } return (1); } /* * Probe the expected slots. We maybe should set the ID for each of these * slots too while we're at it. But maybe that belongs to a separate * function. * * The caller must guarantee that at least EXCA_NSLOTS are present in exca. */ int exca_probe_slots(device_t dev, struct exca_softc *exca, bus_space_tag_t iot, bus_space_handle_t ioh) { int err; int i; err = ENXIO; for (i = 0; i < EXCA_NSLOTS; i++) { exca_init(&exca[i], dev, iot, ioh, i * EXCA_SOCKET_SIZE); exca->getb = exca_io_getb; exca->putb = exca_io_putb; if (exca_valid_slot(&exca[i])) { device_set_desc(dev, chip_names[exca[i].chipset]); err = 0; } } return (err); } void exca_insert(struct exca_softc *exca) { if (device_is_attached(exca->pccarddev)) { if (CARD_ATTACH_CARD(exca->pccarddev) != 0) device_printf(exca->dev, "PC Card card activation failed\n"); } else { device_printf(exca->dev, "PC Card inserted, but no pccard bus.\n"); } } void exca_removal(struct exca_softc *exca) { if (device_is_attached(exca->pccarddev)) CARD_DETACH_CARD(exca->pccarddev); } int exca_activate_resource(struct exca_softc *exca, device_t child, int type, int rid, struct resource *res) { int err; if (rman_get_flags(res) & RF_ACTIVE) return (0); err = BUS_ACTIVATE_RESOURCE(device_get_parent(exca->dev), child, type, rid, res); if (err) return (err); switch (type) { case SYS_RES_IOPORT: err = exca_io_map(exca, PCCARD_WIDTH_AUTO, res); break; case SYS_RES_MEMORY: err = exca_mem_map(exca, 0, res); break; } if (err) BUS_DEACTIVATE_RESOURCE(device_get_parent(exca->dev), child, type, rid, res); return (err); } int exca_deactivate_resource(struct exca_softc *exca, device_t child, int type, int rid, struct resource *res) { if (rman_get_flags(res) & RF_ACTIVE) { /* if activated */ switch (type) { case SYS_RES_IOPORT: if (exca_io_unmap_res(exca, res)) return (ENOENT); break; case SYS_RES_MEMORY: if (exca_mem_unmap_res(exca, res)) return (ENOENT); break; } } return (BUS_DEACTIVATE_RESOURCE(device_get_parent(exca->dev), child, type, rid, res)); } #if 0 static struct resource * exca_alloc_resource(struct exca_softc *sc, device_t child, int type, int *rid, u_long start, u_long end, u_long count, uint flags) { struct resource *res = NULL; int tmp; switch (type) { case SYS_RES_MEMORY: if (start < cbb_start_mem) start = cbb_start_mem; if (end < start) end = start; flags = (flags & ~RF_ALIGNMENT_MASK) | rman_make_alignment_flags(CBB_MEMALIGN); break; case SYS_RES_IOPORT: if (start < cbb_start_16_io) start = cbb_start_16_io; if (end < start) end = start; break; case SYS_RES_IRQ: tmp = rman_get_start(sc->irq_res); if (start > tmp || end < tmp || count != 1) { device_printf(child, "requested interrupt %ld-%ld," "count = %ld not supported by cbb\n", start, end, count); return (NULL); } flags |= RF_SHAREABLE; start = end = rman_get_start(sc->irq_res); break; } res = BUS_ALLOC_RESOURCE(up, child, type, rid, start, end, count, flags & ~RF_ACTIVE); if (res == NULL) return (NULL); cbb_insert_res(sc, res, type, *rid); if (flags & RF_ACTIVE) { if (bus_activate_resource(child, type, *rid, res) != 0) { bus_release_resource(child, type, *rid, res); return (NULL); } } return (res); } static int exca_release_resource(struct exca_softc *sc, device_t child, int type, int rid, struct resource *res) { int error; if (rman_get_flags(res) & RF_ACTIVE) { error = bus_deactivate_resource(child, type, rid, res); if (error != 0) return (error); } cbb_remove_res(sc, res); return (BUS_RELEASE_RESOURCE(device_get_parent(brdev), child, type, rid, res)); } #endif static int exca_modevent(module_t mod, int cmd, void *arg) { return 0; } DEV_MODULE(exca, exca_modevent, NULL); MODULE_VERSION(exca, 1); Index: head/sys/dev/exca/excareg.h =================================================================== --- head/sys/dev/exca/excareg.h (revision 333142) +++ head/sys/dev/exca/excareg.h (revision 333143) @@ -1,437 +1,437 @@ /* $NetBSD: i82365reg.h,v 1.3 1998/12/20 17:53:28 nathanw Exp $ */ /* $FreeBSD$ */ /*- * SPDX-License-Identifier: BSD-4-Clause AND BSD-2-Clause-FreeBSD * - * Copyright (c) 2002 M Warner Losh. All rights reserved. + * Copyright (c) 2002 M. Warner Losh. * * 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 ``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 may be derived from NetBSD i82365.c and other files with * the following copyright: * * Copyright (c) 1997 Marc Horowitz. 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 Marc Horowitz. * 4. 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 ``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. */ #ifndef _SYS_DEV_EXCA_EXCAREG_H #define _SYS_DEV_EXCA_EXCAREG_H /* * All information is from the intel 82365sl PC Card Interface Controller * (PCIC) data sheet, marked "preliminary". Order number 290423-002, January * 1993. */ #define EXCA_IOSIZE 2 #define EXCA_REG_INDEX 0 #define EXCA_REG_DATA 1 #define EXCA_NSLOTS 4 /* 2 in 2 chips */ /* * I/o ports */ #define EXCA_INDEX0 0x3e0 /* * The PCIC allows two chips to share the same address. In order not to run * afoul of the bsd device model, this driver will treat those chips as * the same device. */ #define EXCA_CHIP0_BASE 0x00 #define EXCA_CHIP1_BASE 0x80 /* Each PCIC chip can drive two sockets */ #define EXCA_SOCKET_SIZE 0x40 #define EXCA_SOCKETA_INDEX 0x00 #define EXCA_SOCKETB_INDEX EXCA_SOCKET_SIZE /* general setup registers */ #define EXCA_IDENT 0x00 /* RO */ #define EXCA_IDENT_IFTYPE_MASK 0xC0 #define EXCA_IDENT_IFTYPE_IO_ONLY 0x00 #define EXCA_IDENT_IFTYPE_MEM_ONLY 0x40 #define EXCA_IDENT_IFTYPE_MEM_AND_IO 0x80 #define EXCA_IDENT_IFTYPE_RESERVED 0xC0 #define EXCA_IDENT_ZERO 0x30 #define EXCA_IDENT_REV_MASK 0x0F #define EXCA_IDENT_REV_I82365SLR0 0x02 /* step a/b */ #define EXCA_IDENT_REV_I82365SLR1 0x03 /* step c */ #define EXCA_IDENT_REV_I82365SLDF 0x04 /* step df */ #define EXCA_IDENT_REV_IBM1 0x08 /* ibm clone */ #define EXCA_IDENT_REV_IBM2 0x09 /* ibm clone */ #define EXCA_IDENT_REV_IBM_KING 0x0a /* ibm king */ #define EXCA_IF_STATUS 0x01 /* RO */ #define EXCA_IF_STATUS_GPI 0x80 /* General Purpose Input */ #define EXCA_IF_STATUS_POWERACTIVE 0x40 #define EXCA_IF_STATUS_READY 0x20 /* really READY/!BUSY */ #define EXCA_IF_STATUS_MEM_WP 0x10 #define EXCA_IF_STATUS_CARDDETECT_MASK 0x0C #define EXCA_IF_STATUS_CARDDETECT_PRESENT 0x0C #define EXCA_IF_STATUS_BATTERY_MASK 0x03 #define EXCA_IF_STATUS_BATTERY_DEAD1 0x00 #define EXCA_IF_STATUS_BATTERY_DEAD2 0x01 #define EXCA_IF_STATUS_BATTERY_WARNING 0x02 #define EXCA_IF_STATUS_BATTERY_GOOD 0x03 #define EXCA_PWRCTL 0x02 /* RW */ #define EXCA_PWRCTL_OE 0x80 /* output enable */ #define EXCA_PWRCTL_DISABLE_RESETDRV 0x40 #define EXCA_PWRCTL_AUTOSWITCH_ENABLE 0x20 #define EXCA_PWRCTL_PWR_ENABLE 0x10 #define EXCA_PWRCTL_VPP2_MASK 0x0C /* XXX these are a little unclear from the data sheet */ #define EXCA_PWRCTL_VPP2_RESERVED 0x0C #define EXCA_PWRCTL_VPP2_EN1 0x08 #define EXCA_PWRCTL_VPP2_EN0 0x04 #define EXCA_PWRCTL_VPP2_ENX 0x00 #define EXCA_PWRCTL_VPP1_MASK 0x03 /* XXX these are a little unclear from the data sheet */ #define EXCA_PWRCTL_VPP1_RESERVED 0x03 #define EXCA_PWRCTL_VPP1_EN1 0x02 #define EXCA_PWRCTL_VPP1_EN0 0x01 #define EXCA_PWRCTL_VPP1_ENX 0x00 #define EXCA_CSC 0x04 /* RW */ #define EXCA_CSC_ZERO 0xE0 #define EXCA_CSC_GPI 0x10 #define EXCA_CSC_CD 0x08 /* Card Detect Change */ #define EXCA_CSC_READY 0x04 #define EXCA_CSC_BATTWARN 0x02 #define EXCA_CSC_BATTDEAD 0x01 /* for memory cards */ #define EXCA_CSC_RI 0x01 /* for i/o cards */ #define EXCA_ADDRWIN_ENABLE 0x06 /* RW */ #define EXCA_ADDRWIN_ENABLE_IO1 0x80 #define EXCA_ADDRWIN_ENABLE_IO0 0x40 #define EXCA_ADDRWIN_ENABLE_MEMCS16 0x20 /* rtfds if you care */ #define EXCA_ADDRWIN_ENABLE_MEM4 0x10 #define EXCA_ADDRWIN_ENABLE_MEM3 0x08 #define EXCA_ADDRWIN_ENABLE_MEM2 0x04 #define EXCA_ADDRWIN_ENABLE_MEM1 0x02 #define EXCA_ADDRWIN_ENABLE_MEM0 0x01 #define EXCA_CARD_DETECT 0x16 /* RW */ #define EXCA_CARD_DETECT_RESERVED 0xC0 #define EXCA_CARD_DETECT_SW_INTR 0x20 #define EXCA_CARD_DETECT_RESUME_ENABLE 0x10 #define EXCA_CARD_DETECT_GPI_TRANSCTL 0x08 #define EXCA_CARD_DETECT_GPI_ENABLE 0x04 #define EXCA_CARD_DETECT_CFGRST_ENABLE 0x02 #define EXCA_CARD_DETECT_MEMDLY_INHIBIT 0x01 /* interrupt registers */ #define EXCA_INTR 0x03 /* RW */ #define EXCA_INTR_RI_ENABLE 0x80 #define EXCA_INTR_RESET 0x40 /* active low (zero) */ #define EXCA_INTR_CARDTYPE_MASK 0x20 #define EXCA_INTR_CARDTYPE_IO 0x20 #define EXCA_INTR_CARDTYPE_MEM 0x00 #define EXCA_INTR_ENABLE 0x10 #define EXCA_INTR_IRQ_MASK 0x0F #define EXCA_INTR_IRQ_SHIFT 0 #define EXCA_INTR_IRQ_NONE 0x00 #define EXCA_INTR_IRQ_RESERVED1 0x01 #define EXCA_INTR_IRQ_RESERVED2 0x02 #define EXCA_INTR_IRQ3 0x03 #define EXCA_INTR_IRQ4 0x04 #define EXCA_INTR_IRQ5 0x05 #define EXCA_INTR_IRQ_RESERVED6 0x06 #define EXCA_INTR_IRQ7 0x07 #define EXCA_INTR_IRQ_RESERVED8 0x08 #define EXCA_INTR_IRQ9 0x09 #define EXCA_INTR_IRQ10 0x0A #define EXCA_INTR_IRQ11 0x0B #define EXCA_INTR_IRQ12 0x0C #define EXCA_INTR_IRQ_RESERVED13 0x0D #define EXCA_INTR_IRQ14 0x0E #define EXCA_INTR_IRQ15 0x0F #define EXCA_INTR_IRQ_VALIDMASK 0xDEB8 /* 1101 1110 1011 1000 */ #define EXCA_CSC_INTR 0x05 /* RW */ #define EXCA_CSC_INTR_IRQ_MASK 0xF0 #define EXCA_CSC_INTR_IRQ_SHIFT 4 #define EXCA_CSC_INTR_IRQ_NONE 0x00 #define EXCA_CSC_INTR_IRQ_RESERVED1 0x10 #define EXCA_CSC_INTR_IRQ_RESERVED2 0x20 #define EXCA_CSC_INTR_IRQ3 0x30 #define EXCA_CSC_INTR_IRQ4 0x40 #define EXCA_CSC_INTR_IRQ5 0x50 #define EXCA_CSC_INTR_IRQ_RESERVED6 0x60 #define EXCA_CSC_INTR_IRQ7 0x70 #define EXCA_CSC_INTR_IRQ_RESERVED8 0x80 #define EXCA_CSC_INTR_IRQ9 0x90 #define EXCA_CSC_INTR_IRQ10 0xA0 #define EXCA_CSC_INTR_IRQ11 0xB0 #define EXCA_CSC_INTR_IRQ12 0xC0 #define EXCA_CSC_INTR_IRQ_RESERVED13 0xD0 #define EXCA_CSC_INTR_IRQ14 0xE0 #define EXCA_CSC_INTR_IRQ15 0xF0 #define EXCA_CSC_INTR_CD_ENABLE 0x08 #define EXCA_CSC_INTR_READY_ENABLE 0x04 #define EXCA_CSC_INTR_BATTWARN_ENABLE 0x02 #define EXCA_CSC_INTR_BATTDEAD_ENABLE 0x01 /* for memory cards */ #define EXCA_CSC_INTR_RI_ENABLE 0x01 /* for I/O cards */ #define EXCA_CSC_INTR_IRQ_VALIDMASK 0xDEB8 /* 1101 1110 1011 1000 */ /* I/O registers */ #define EXCA_IO_WINS 2 #define EXCA_IOCTL 0x07 /* RW */ #define EXCA_IOCTL_IO1_WAITSTATE 0x80 #define EXCA_IOCTL_IO1_ZEROWAIT 0x40 #define EXCA_IOCTL_IO1_IOCS16SRC_MASK 0x20 #define EXCA_IOCTL_IO1_IOCS16SRC_CARD 0x20 #define EXCA_IOCTL_IO1_IOCS16SRC_DATASIZE 0x00 #define EXCA_IOCTL_IO1_DATASIZE_MASK 0x10 #define EXCA_IOCTL_IO1_DATASIZE_16BIT 0x10 #define EXCA_IOCTL_IO1_DATASIZE_8BIT 0x00 #define EXCA_IOCTL_IO0_WAITSTATE 0x08 #define EXCA_IOCTL_IO0_ZEROWAIT 0x04 #define EXCA_IOCTL_IO0_IOCS16SRC_MASK 0x02 #define EXCA_IOCTL_IO0_IOCS16SRC_CARD 0x02 #define EXCA_IOCTL_IO0_IOCS16SRC_DATASIZE 0x00 #define EXCA_IOCTL_IO0_DATASIZE_MASK 0x01 #define EXCA_IOCTL_IO0_DATASIZE_16BIT 0x01 #define EXCA_IOCTL_IO0_DATASIZE_8BIT 0x00 #define EXCA_IOADDR0_START_LSB 0x08 #define EXCA_IOADDR0_START_MSB 0x09 #define EXCA_IOADDR0_STOP_LSB 0x0A #define EXCA_IOADDR0_STOP_MSB 0x0B #define EXCA_IOADDR1_START_LSB 0x0C #define EXCA_IOADDR1_START_MSB 0x0D #define EXCA_IOADDR1_STOP_LSB 0x0E #define EXCA_IOADDR1_STOP_MSB 0x0F /* memory registers */ /* * memory window addresses refer to bits A23-A12 of the ISA system memory * address. This is a shift of 12 bits. The LSB contains A19-A12, and the * MSB contains A23-A20, plus some other bits. */ #define EXCA_MEM_WINS 5 #define EXCA_MEM_SHIFT 12 #define EXCA_MEM_PAGESIZE (1<getb(sc, reg)); } static __inline void exca_putb(struct exca_softc *sc, int reg, uint8_t val) { sc->putb(sc, reg, val); } static __inline void exca_setb(struct exca_softc *sc, int reg, uint8_t mask) { exca_putb(sc, reg, exca_getb(sc, reg) | mask); } static __inline void exca_clrb(struct exca_softc *sc, int reg, uint8_t mask) { exca_putb(sc, reg, exca_getb(sc, reg) & ~mask); } #endif /* !_SYS_DEV_EXCA_EXCAVAR_H */ Index: head/sys/dev/iicbus/icee.c =================================================================== --- head/sys/dev/iicbus/icee.c (revision 333142) +++ head/sys/dev/iicbus/icee.c (revision 333143) @@ -1,381 +1,381 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2006 Warner Losh. All rights reserved. + * Copyright (c) 2006 M. Warner Losh. * * 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 ``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. */ #include __FBSDID("$FreeBSD$"); /* * Generic IIC eeprom support, modeled after the AT24C family of products. */ #include "opt_platform.h" #include #include #include #include #include #include #include #include #include #include #ifdef FDT #include #include #endif #include #include #include "iicbus_if.h" /* * AT24 parts have a "write page size" that differs per-device, and a "read page * size" that is always equal to the full device size. We define maximum values * here to limit how long we occupy the bus with a single transfer, and because * there are temporary buffers of these sizes allocated on the stack. */ #define MAX_RD_SZ 256 /* Largest read size we support */ #define MAX_WR_SZ 256 /* Largest write size we support */ struct icee_softc { device_t dev; /* Myself */ struct cdev *cdev; /* user interface */ int addr; /* Slave address on the bus */ int size; /* How big am I? */ int type; /* What address type 8 or 16 bit? */ int wr_sz; /* What's the write page size */ }; #ifdef FDT struct eeprom_desc { int type; int size; int wr_sz; const char *name; }; static struct eeprom_desc type_desc[] = { { 8, 128, 8, "AT24C01"}, { 8, 256, 8, "AT24C02"}, { 8, 512, 16, "AT24C04"}, { 8, 1024, 16, "AT24C08"}, { 8, 2 * 1024, 16, "AT24C16"}, {16, 4 * 1024, 32, "AT24C32"}, {16, 8 * 1024, 32, "AT24C64"}, {16, 16 * 1024, 64, "AT24C128"}, {16, 32 * 1024, 64, "AT24C256"}, {16, 64 * 1024, 128, "AT24C512"}, {16, 128 * 1024, 256, "AT24CM01"}, }; static struct ofw_compat_data compat_data[] = { {"atmel,24c01", (uintptr_t)(&type_desc[0])}, {"atmel,24c02", (uintptr_t)(&type_desc[1])}, {"atmel,24c04", (uintptr_t)(&type_desc[2])}, {"atmel,24c08", (uintptr_t)(&type_desc[3])}, {"atmel,24c16", (uintptr_t)(&type_desc[4])}, {"atmel,24c32", (uintptr_t)(&type_desc[5])}, {"atmel,24c64", (uintptr_t)(&type_desc[6])}, {"atmel,24c128", (uintptr_t)(&type_desc[7])}, {"atmel,24c256", (uintptr_t)(&type_desc[8])}, {"atmel,24c512", (uintptr_t)(&type_desc[9])}, {"atmel,24c1024", (uintptr_t)(&type_desc[10])}, {NULL, (uintptr_t)NULL}, }; #endif #define CDEV2SOFTC(dev) ((dev)->si_drv1) /* cdev routines */ static d_open_t icee_open; static d_close_t icee_close; static d_read_t icee_read; static d_write_t icee_write; static struct cdevsw icee_cdevsw = { .d_version = D_VERSION, .d_flags = D_TRACKCLOSE, .d_open = icee_open, .d_close = icee_close, .d_read = icee_read, .d_write = icee_write }; #ifdef FDT static int icee_probe(device_t dev) { struct eeprom_desc *d; if (!ofw_bus_status_okay(dev)) return (ENXIO); d = (struct eeprom_desc *) ofw_bus_search_compatible(dev, compat_data)->ocd_data; if (d == NULL) return (ENXIO); device_set_desc(dev, d->name); return (BUS_PROBE_DEFAULT); } static void icee_init(struct icee_softc *sc) { struct eeprom_desc *d; d = (struct eeprom_desc *) ofw_bus_search_compatible(sc->dev, compat_data)->ocd_data; if (d == NULL) return; /* attach will see sc->size == 0 and return error */ sc->size = d->size; sc->type = d->type; sc->wr_sz = d->wr_sz; } #else /* !FDT */ static int icee_probe(device_t dev) { device_set_desc(dev, "I2C EEPROM"); return (BUS_PROBE_NOWILDCARD); } static void icee_init(struct icee_softc *sc) { const char *dname; int dunit; dname = device_get_name(sc->dev); dunit = device_get_unit(sc->dev); resource_int_value(dname, dunit, "size", &sc->size); resource_int_value(dname, dunit, "type", &sc->type); resource_int_value(dname, dunit, "wr_sz", &sc->wr_sz); } #endif /* FDT */ static int icee_attach(device_t dev) { struct icee_softc *sc = device_get_softc(dev); sc->dev = dev; sc->addr = iicbus_get_addr(dev); icee_init(sc); if (sc->size == 0 || sc->type == 0 || sc->wr_sz == 0) { device_printf(sc->dev, "Missing config data, " "these cannot be zero: size %d type %d wr_sz %d\n", sc->size, sc->type, sc->wr_sz); return (EINVAL); } if (bootverbose) device_printf(dev, "size: %d bytes, addressing: %d-bits\n", sc->size, sc->type); sc->cdev = make_dev(&icee_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "icee%d", device_get_unit(dev)); if (sc->cdev == NULL) { return (ENOMEM); } sc->cdev->si_drv1 = sc; return (0); } static int icee_detach(device_t dev) { struct icee_softc *sc = device_get_softc(dev); destroy_dev(sc->cdev); return (0); } static int icee_open(struct cdev *dev, int oflags, int devtype, struct thread *td) { struct icee_softc *sc; sc = CDEV2SOFTC(dev); if (device_get_state(sc->dev) < DS_BUSY) device_busy(sc->dev); return (0); } static int icee_close(struct cdev *dev, int fflag, int devtype, struct thread *td) { struct icee_softc *sc; sc = CDEV2SOFTC(dev); device_unbusy(sc->dev); return (0); } static int icee_read(struct cdev *dev, struct uio *uio, int ioflag) { struct icee_softc *sc; uint8_t addr[2]; uint8_t data[MAX_RD_SZ]; int error, i, len, slave; struct iic_msg msgs[2] = { { 0, IIC_M_WR, 1, addr }, { 0, IIC_M_RD, 0, data }, }; sc = CDEV2SOFTC(dev); if (uio->uio_offset == sc->size) return (0); if (uio->uio_offset > sc->size) return (EIO); if (sc->type != 8 && sc->type != 16) return (EINVAL); slave = error = 0; while (uio->uio_resid > 0) { if (uio->uio_offset >= sc->size) break; len = MIN(MAX_RD_SZ - (uio->uio_offset & (MAX_RD_SZ - 1)), uio->uio_resid); switch (sc->type) { case 8: slave = (uio->uio_offset >> 7) | sc->addr; msgs[0].len = 1; msgs[1].len = len; addr[0] = uio->uio_offset & 0xff; break; case 16: slave = sc->addr | (uio->uio_offset >> 15); msgs[0].len = 2; msgs[1].len = len; addr[0] = (uio->uio_offset >> 8) & 0xff; addr[1] = uio->uio_offset & 0xff; break; } for (i = 0; i < 2; i++) msgs[i].slave = slave; error = iicbus_transfer_excl(sc->dev, msgs, 2, IIC_INTRWAIT); if (error) { error = iic2errno(error); break; } error = uiomove(data, len, uio); if (error) break; } return (error); } /* * Write to the part. We use three transfers here since we're actually * doing a write followed by a read to make sure that the write finished. * It is easier to encode the dummy read here than to break things up * into smaller chunks... */ static int icee_write(struct cdev *dev, struct uio *uio, int ioflag) { struct icee_softc *sc; int error, len, slave, waitlimit; uint8_t data[MAX_WR_SZ + 2]; struct iic_msg wr[1] = { { 0, IIC_M_WR, 0, data }, }; struct iic_msg rd[1] = { { 0, IIC_M_RD, 1, data }, }; sc = CDEV2SOFTC(dev); if (uio->uio_offset >= sc->size) return (EIO); if (sc->type != 8 && sc->type != 16) return (EINVAL); slave = error = 0; while (uio->uio_resid > 0) { if (uio->uio_offset >= sc->size) break; len = MIN(sc->wr_sz - (uio->uio_offset & (sc->wr_sz - 1)), uio->uio_resid); switch (sc->type) { case 8: slave = (uio->uio_offset >> 7) | sc->addr; wr[0].len = 1 + len; data[0] = uio->uio_offset & 0xff; break; case 16: slave = sc->addr | (uio->uio_offset >> 15); wr[0].len = 2 + len; data[0] = (uio->uio_offset >> 8) & 0xff; data[1] = uio->uio_offset & 0xff; break; } wr[0].slave = slave; error = uiomove(data + sc->type / 8, len, uio); if (error) break; error = iicbus_transfer_excl(sc->dev, wr, 1, IIC_INTRWAIT); if (error) { error = iic2errno(error); break; } /* Read after write to wait for write-done. */ waitlimit = 10000; rd[0].slave = slave; do { error = iicbus_transfer_excl(sc->dev, rd, 1, IIC_INTRWAIT); } while (waitlimit-- > 0 && error != 0); if (error) { error = iic2errno(error); break; } } return error; } static device_method_t icee_methods[] = { DEVMETHOD(device_probe, icee_probe), DEVMETHOD(device_attach, icee_attach), DEVMETHOD(device_detach, icee_detach), DEVMETHOD_END }; static driver_t icee_driver = { "icee", icee_methods, sizeof(struct icee_softc), }; static devclass_t icee_devclass; DRIVER_MODULE(icee, iicbus, icee_driver, icee_devclass, 0, 0); MODULE_VERSION(icee, 1); MODULE_DEPEND(icee, iicbus, 1, 1, 1); Index: head/sys/dev/nand/nfc_at91.h =================================================================== --- head/sys/dev/nand/nfc_at91.h (revision 333142) +++ head/sys/dev/nand/nfc_at91.h (revision 333143) @@ -1,52 +1,51 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (C) 2014 Warner Losh. - * All rights reserved. + * Copyright (C) 2014 M. Warner Losh. * * 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$ */ /* * Atmel at91-family integrated NAND controller driver. * * Interface to board setup code to set parameters. */ #ifndef DEV_NAND_NFC_AT91_H #define DEV_NAND_NFC_AT91_H 1 struct at91_nand_params { uint32_t ale; /* Address for ALE (address) NAND cycles */ uint32_t cle; /* Address for CLE (command) NAND cycles */ uint32_t width; /* 8 or 16 bits (specify in bits) */ uint32_t cs; /* Chip Select NAND is connected to */ uint32_t rnb_pin; /* GPIO pin # for Read/notBusy */ uint32_t nce_pin; /* GPIO pin # for CE (active low) */ }; void at91_enable_nand(const struct at91_nand_params *); #endif /* DEV_NAND_NFC_AT91_H */ Index: head/sys/dev/pccbb/pccbbvar.h =================================================================== --- head/sys/dev/pccbb/pccbbvar.h (revision 333142) +++ head/sys/dev/pccbb/pccbbvar.h (revision 333143) @@ -1,171 +1,171 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2003-2004 Warner Losh. + * Copyright (c) 2003-2004 M. Warner Losh. * Copyright (c) 2000,2001 Jonathan Chen. * 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$ */ /* * Structure definitions for the Cardbus Bridge driver */ struct cbb_intrhand { driver_filter_t *filt; driver_intr_t *intr; void *arg; struct cbb_softc *sc; void *cookie; }; struct cbb_reslist { SLIST_ENTRY(cbb_reslist) link; struct resource *res; int type; int rid; /* note: unlike the regular resource list, there can be * duplicate rid's in the same list. However, the * combination of rid and res->r_dev should be unique. */ bus_addr_t cardaddr; /* for 16-bit pccard memory */ }; #define CBB_AUTO_OPEN_SMALLHOLE 0x100 #define CBB_NSLOTS 4 struct cbb_softc { device_t dev; struct exca_softc exca[CBB_NSLOTS]; struct resource *base_res; struct resource *irq_res; void *intrhand; bus_space_tag_t bst; bus_space_handle_t bsh; uint32_t domain; unsigned int pribus; struct pcib_secbus bus; struct mtx mtx; int cardok; u_int32_t flags; #define CBB_16BIT_CARD 0x20000000 #define CBB_KTHREAD_RUNNING 0x40000000 #define CBB_KTHREAD_DONE 0x80000000 int chipset; /* chipset id */ #define CB_UNKNOWN 0 /* NOT Cardbus-PCI bridge */ #define CB_TI113X 1 /* TI PCI1130/1131 */ #define CB_TI12XX 2 /* TI PCI12xx/14xx/44xx/15xx/45xx */ #define CB_TI125X 3 /* TI PCI1250/1251(B)/1450 */ #define CB_RF5C47X 4 /* RICOH RF5C475/476/477 */ #define CB_RF5C46X 5 /* RICOH RF5C465/466/467 */ #define CB_CIRRUS 6 /* Cirrus Logic CLPD683x */ #define CB_TOPIC95 7 /* Toshiba ToPIC95 */ #define CB_TOPIC97 8 /* Toshiba ToPIC97/100 */ #define CB_O2MICRO 9 /* O2Micro chips */ SLIST_HEAD(, cbb_reslist) rl; device_t cbdev; struct proc *event_thread; void (*chipinit)(struct cbb_softc *); int powerintr; struct root_hold_token *sc_root_token; }; /* result of detect_card */ #define CARD_UKN_CARD 0x00 #define CARD_5V_CARD 0x01 #define CARD_3V_CARD 0x02 #define CARD_XV_CARD 0x04 #define CARD_YV_CARD 0x08 /* for power_socket */ #define CARD_VCC(X) (X) #define CARD_VPP_VCC 0xf0 #define CARD_VCCMASK 0xf #define CARD_VCCSHIFT 0 #define XV 2 #define YV 1 #define CARD_OFF (CARD_VCC(0)) extern int cbb_debug; extern devclass_t cbb_devclass; int cbb_activate_resource(device_t brdev, device_t child, int type, int rid, struct resource *r); struct resource *cbb_alloc_resource(device_t brdev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags); void cbb_child_detached(device_t brdev, device_t child); int cbb_child_present(device_t parent, device_t child); int cbb_deactivate_resource(device_t brdev, device_t child, int type, int rid, struct resource *r); int cbb_detach(device_t brdev); void cbb_disable_func_intr(struct cbb_softc *sc); void cbb_driver_added(device_t brdev, driver_t *driver); void cbb_event_thread(void *arg); int cbb_pcic_set_memory_offset(device_t brdev, device_t child, int rid, uint32_t cardaddr, uint32_t *deltap); int cbb_pcic_set_res_flags(device_t brdev, device_t child, int type, int rid, u_long flags); int cbb_power(device_t brdev, int volts); int cbb_power_enable_socket(device_t brdev, device_t child); int cbb_power_disable_socket(device_t brdev, device_t child); int cbb_read_ivar(device_t brdev, device_t child, int which, uintptr_t *result); int cbb_release_resource(device_t brdev, device_t child, int type, int rid, struct resource *r); int cbb_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep); int cbb_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie); int cbb_write_ivar(device_t brdev, device_t child, int which, uintptr_t value); /* */ static __inline void cbb_set(struct cbb_softc *sc, uint32_t reg, uint32_t val) { bus_space_write_4(sc->bst, sc->bsh, reg, val); } static __inline uint32_t cbb_get(struct cbb_softc *sc, uint32_t reg) { return (bus_space_read_4(sc->bst, sc->bsh, reg)); } static __inline void cbb_setb(struct cbb_softc *sc, uint32_t reg, uint32_t bits) { cbb_set(sc, reg, cbb_get(sc, reg) | bits); } static __inline void cbb_clrb(struct cbb_softc *sc, uint32_t reg, uint32_t bits) { cbb_set(sc, reg, cbb_get(sc, reg) & ~bits); } Index: head/tools/tools/nanobsd/dhcpd/common =================================================================== --- head/tools/tools/nanobsd/dhcpd/common (revision 333142) +++ head/tools/tools/nanobsd/dhcpd/common (revision 333143) @@ -1,274 +1,274 @@ # $FreeBSD$ #- -# Copyright (c) 2014 Warner Losh. All Rights Reserved. +# Copyright (c) 2014 M. Warner Losh. # Copyright (c) 2010 iXsystems, Inc., 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 iXsystems, Inc 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. # # # This file is heavily derived from both Sam Leffler's Avilia config, # as well as the BSDRP project's config file. Neither of these have # an explicit copyright/license statement, but are implicitly BSDL. This # example has been taken from the FreeNAS project (an early version) and # simplified to meet the needs of the example. # # NB: You want the other file NANO_PMAKE="make -j $(sysctl -n hw.ncpu)" NANO_CFG_BASE=$(pwd) NANO_CFG_BASE=${NANO_CFG_BASE%/dhcpd} NANO_SRC=$(pwd) NANO_SRC=${NANO_SRC%/tools/tools/nanobsd/dhcpd} NANO_OBJ=${NANO_SRC}/../dhcpd/obj # Where cust_pkg() finds packages to install #XXX: Is this the right place? #NANO_PORTS=$(realpath ${NANO_SRC}/../ports) NANO_PORTS=/usr/ports NANO_PACKAGE_DIR=${NANO_SRC}/${NANO_TOOLS}/Pkg NANO_DATADIR=${NANO_OBJ}/_.data NANO_DATASIZE=40960 NANO_INIT_IMG2=0 unset MAKEOBJDIRPREFIX # this to go into nanobsd.sh NANO_PORTS=${NANO_PORTS:-/usr/ports} customize_cmd cust_allow_ssh_root add_etc_make_conf() { touch ${NANO_WORLDDIR}/etc/make.conf } customize_cmd add_etc_make_conf clean_usr_local() { LOCAL_DIR=${NANO_WORLDDIR}/usr/local pprint 2 "Clean and create world directory (${LOCAL_DIR})" if rm -rf ${LOCAL_DIR}/ > /dev/null 2>&1 ; then true else chflags -R noschg ${LOCAL_DIR}/ rm -rf ${LOCAL_DIR}/ fi for f in bin etc lib libdata libexec sbin share; do mkdir -p ${LOCAL_DIR}/$f done } customize_cmd clean_usr_local cust_install_machine_files() { echo "cd ${NANO_CFG_BASE}/Files" cd ${NANO_CFG_BASE}/Files find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${NANO_WORLDDIR} } customize_cmd cust_install_files customize_cmd cust_install_machine_files buildenv() { cd ${NANO_SRC} env __MAKE_CONF=${NANO_MAKE_CONF_BUILD} DESTDIR=${NANO_WORLDDIR} make buildenv } NANO_MAKEFS="makefs -B big \ -o bsize=4096,fsize=512,density=8192,optimization=space" export NANO_MAKEFS # NB: leave c++ enabled so devd can be built CONF_BUILD=" WITHOUT_ACPI=true WITHOUT_ATM=true WITHOUT_AUDIT=true WITHOUT_BIND_DNSSEC=true WITHOUT_BIND_ETC=true WITHOUT_BIND_LIBS_LWRES=true WITHOUT_BLUETOOTH=true WITHOUT_CALENDAR=true WITHOUT_CVS=true WITHOUT_DICT=true WITHOUT_EXAMPLES=true WITHOUT_FORTRAN=true WITHOUT_GAMES=true WITHOUT_GCOV=true WITHOUT_GPIB=true WITHOUT_HTML=true WITHOUT_I4B=true WITHOUT_IPFILTER=true WITHOUT_IPX=true WITHOUT_LIBKSE=true WITHOUT_LOCALES=true WITHOUT_LPR=true WITHOUT_MAN=true WITHOUT_NETCAT=true WITHOUT_NIS=true WITHOUT_NLS=true WITHOUT_NS_CACHING=true WITHOUT_OBJC=true WITHOUT_PROFILE=true WITHOUT_SENDMAIL=true WITHOUT_SHAREDOCS=true WITHOUT_SYSCONS=true WITHOUT_LIB32=true " CONF_INSTALL="$CONF_BUILD INSTALL_NODEBUG=t NOPORTDOCS=t NO_INSTALL_MANPAGES=t " # The following would help... # WITHOUT_TOOLCHAIN=true can't build ports # WITHOUT_INSTALLLIB=true libgcc.a # # from the build # WITHOUT_INFO=true makeinfo # WITHOUT_RCS=true PKG_ONLY_MAKE_CONF=" WITHOUT_TOOLCHAIN=true WITHOUT_INSTALLLIB=true WITHOUT_INFO=true WITHOUT_RCS=true " NANO_PACKAGE_ONLY=1 # install a package from a pre-built binary do_add_pkg () { # Need to create ${NANO_OBJ}/ports in this add_pkg_${port} function set -x mkdir -p ${NANO_OBJ}/ports/distfiles mkdir -p ${NANO_OBJ}/ports/packages mkdir -p ${NANO_WORLDDIR}/usr/ports/packages mkdir -p ${NANO_WORLDDIR}/usr/ports/distfiles mount -t nullfs -o noatime ${NANO_OBJ}/ports/packages \ ${NANO_WORLDDIR}/usr/ports/packages mount -t nullfs -o noatime ${NANO_OBJ}/ports/distfiles \ ${NANO_WORLDDIR}/usr/ports/distfiles CR env ASSUME_ALWAYS_YES=YES SIGNATURE_TYPE=none /usr/sbin/pkg add /usr/ports/packages/All/$1.txz umount ${NANO_WORLDDIR}/usr/ports/distfiles umount ${NANO_WORLDDIR}/usr/ports/packages rmdir ${NANO_WORLDDIR}/usr/ports/packages rmdir ${NANO_WORLDDIR}/usr/ports/distfiles rmdir ${NANO_WORLDDIR}/usr/ports set +x } # Build a port (with the side effect of creating a package) do_add_port () { local port_path port_path=$1 shift set -x # Need to create ${NANO_OBJ}/ports in this add_port_${port} function mkdir -p ${NANO_OBJ}/ports/distfiles mkdir -p ${NANO_OBJ}/ports/packages mkdir -p ${NANO_PORTS}/packages mkdir -p ${NANO_PORTS}/distfiles mkdir -p ${NANO_WORLDDIR}/usr/src mkdir -p ${NANO_WORLDDIR}/usr/ports mount -t nullfs -o noatime ${NANO_SRC} ${NANO_WORLDDIR}/usr/src mount -t nullfs -o noatime ${NANO_PORTS} ${NANO_WORLDDIR}/usr/ports mount -t nullfs -o noatime ${NANO_OBJ}/ports/packages \ ${NANO_WORLDDIR}/usr/ports/packages mount -t nullfs -o noatime ${NANO_OBJ}/ports/distfiles \ ${NANO_WORLDDIR}/usr/ports/distfiles mkdir -p ${NANO_WORLDDIR}/dev mount -t devfs devfs ${NANO_WORLDDIR}/dev mkdir -p ${NANO_WORLDDIR}/usr/workdir cp /etc/resolv.conf ${NANO_WORLDDIR}/etc/resolv.conf # OK, a little inefficient, but likely not enough to worry about. CR ldconfig /lib /usr/lib /usr/local/lib CR ldconfig -R CR ldconfig -r # Improvement: Don't know why package-recursive don't works here CR "env UNAME_p=${NANO_ARCH} TARGET=${NANO_ARCH} \ TARGET_ARCH=${NANO_ARCH} PORTSDIR=${NANO_PORTS} make \ __MAKE_CONF=${NANO_MAKE_CONF_BUILD} \ WRKDIRPREFIX=/usr/workdir -C /usr/ports/$port_path \ package-recursive BATCH=yes $* clean FORCE_PKG_REGISTER=t" rm ${NANO_WORLDDIR}/etc/resolv.conf rm -rf ${NANO_WORLDDIR}/usr/obj rm -rf ${NANO_WORLDDIR}/usr/workdir umount ${NANO_WORLDDIR}/dev umount ${NANO_WORLDDIR}/usr/ports/packages umount ${NANO_WORLDDIR}/usr/ports/distfiles umount ${NANO_WORLDDIR}/usr/ports umount ${NANO_WORLDDIR}/usr/src set +x } # Need to check if this function works with cross-compiling architecture!!!! # Recursive complex fonction: Generate one function for each ports add_port () { local port_path=$1 local port=`echo $1 | sed -e 's/\//_/'` shift # Check if package already exist # Need to: # 1. check ARCH of this package! # 2. Add a trap cd ${NANO_PORTS}/${port_path} PKG_NAME=`env PORTSDIR=${NANO_PORTS} make __MAKE_CONF=${NANO_MAKE_CONF_BUILD} package-name` if [ -f ${NANO_OBJ}/ports/packages/All/${PKG_NAME}.txz ]; then # Pkg file found: Generate add_pkg_NAME function eval " add_pkg_${port} () { do_add_pkg ${PKG_NAME} } customize_cmd add_pkg_${port} " else # No pkg file: Generate add_port_NAME function eval " add_port_${port} () { do_add_port ${port_path} $* } customize_cmd add_port_${port} " NANO_PACKAGE_ONLY=0 fi } die() { echo "$*" exit 1 } # Automatically include the packaging port here so it is always first so it # builds the port and adds the package so we can add other packages. add_port ports-mgmt/pkg rp=$(realpath ${NANO_OBJ}/) __a=`mount | grep ${rp} | awk '{print length($3), $3;}' | sort -rn | awk '{$1=""; print;}'` if [ -n "$__a" ]; then echo "unmounting $__a" umount $__a fi NANO_BOOTLOADER="boot/boot0" Index: head/tools/tools/nanobsd/dhcpd/os-base =================================================================== --- head/tools/tools/nanobsd/dhcpd/os-base (revision 333142) +++ head/tools/tools/nanobsd/dhcpd/os-base (revision 333143) @@ -1,194 +1,194 @@ # $FreeBSD$ #- -# Copyright (c) 2014 Warner Losh. All Rights Reserved. +# Copyright (c) 2014 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # # This file is heavily derived from both Sam Leffler's Avilia config, # as well as the BSDRP project's config file. Neither of these have # an explicit copyright/license statement, but are implicitly BSDL. This # example has been taken from the FreeNAS project and simplified to meet # the needs of the example. # # Pull in common definitions. . common NANO_BOOT0CFG="-o packet -s 1 -m 3 -t 18" # /var -> ~10MB (look through rc.initdiskless for the formula of how this # number is calculated out). Since we hope to run NANO_RAM_TMPVARSIZE=10240 NANO_IMAGES=2 FlashDevice generic 2g if [ "$DEBUG" = 1 ]; then DEBUG_BUILD=" DEBUG_FLAGS= -g " else DEBUG_INSTALL=" INSTALL_NODEBUG= t " fi CONF_INSTALL="$CONF_BUILD ${DEBUG_BUILD} " CONF_INSTALL="$CONF_INSTALL ${DEBUG_INSTALL} " add_port security/sudo add_port ftp/curl if [ "${NANO_PACKAGE_ONLY}" -eq 1 ]; then CONF_INSTALL="${CONF_INSTALL} ${PKG_ONLY_MAKE_CONF} " echo "Automatically building a thin image with packages" else echo "Automatically building a * * F A T * * image so we can build ports" fi VARS="MASTER_SITE_BACKUP MASTER_SITE_OVERRIDE PACKAGEROOT PACKAGESITE" for var in $VARS; do val=$(eval echo "\$$var") if [ -n "$val" ]; then CONF_INSTALL="${CONF_INSTALL} $var=$val" fi done if [ "$PACKAGE_PREP_BUILD" = 1 ]; then echo "Skipping post-package customize steps" do_image=false else hack_nsswitch_conf ( ) { # Remove all references to NIS in the nsswitch.conf file # Not sure this is still needed, but FreeNAS has it... sed -i.bak -es/nis/files/g ${NANO_WORLDDIR}/etc/nsswitch.conf rm -f ${NANO_WORLDDIR}/etc/nsswitch.conf.bak } customize_cmd hack_nsswitch_conf save_build ( ) { VERSION_FILE=${NANO_WORLDDIR}/etc/version if [ "${SVNREVISION}" = "${REVISION}" ]; then echo "${NANO_NAME}" > "${VERSION_FILE}" else echo "${NANO_NAME} (${SVNREVISION})" > "${VERSION_FILE}" fi } customize_cmd save_build remove_patch_divots ( ) { find ${NANO_WORLDDIR} -name \*.orig -or -name \*.rej -delete } customize_cmd remove_patch_divots configure_mnt_md ( ) { mkdir -m 755 -p ${NANO_WORLDDIR}/conf/base/mnt echo 2048 > ${NANO_WORLDDIR}/conf/base/mnt/md_size } customize_cmd configure_mnt_md shrink_md_fbsize() { # We have a lot of little files on our memory disks. Let's decrease # the block and frag size to fit more little files on them (this # halves our space requirement by ~50% on /etc and /var on 8.x -- # and gives us more back on 9.x as the default block and frag size # are 4 times larger). sed -i '' -e 's,-S -i 4096,-S -i 4096 -b 4096 -f 512,' \ ${NANO_WORLDDIR}/etc/rc.initdiskless } customize_cmd shrink_md_fbsize if [ "${DEBUG}" = 1 ]; then unmute_console_logging() { # /var is small. Don't fill it up with messages from console.log # because it's a chatty log. sed -i '' -e 's/#console.info/console.info/' \ "${NANO_WORLDDIR}/etc/syslog.conf" } customize_cmd unmute_console_logging fi product_custom() { gzip -v9 ${NANO_WORLDDIR}/boot/kernel/kernel # kill includes (saves 14MB) find ${NANO_WORLDDIR}/usr/local/include \! -name 'pyconfig.h' -type f | xargs rm -f # kill docs (saves 22MB) rm -rf ${NANO_WORLDDIR}/usr/local/share/doc rm -rf ${NANO_WORLDDIR}/usr/local/share/gtk-doc # and info (2MB) rm -rf ${NANO_WORLDDIR}/usr/local/info # and man pages (4.4MB) rm -rf ${NANO_WORLDDIR}/usr/local/man # and examples (1.7M) rm -rf ${NANO_WORLDDIR}/usr/local/share/examples # and groff_fonts junk (3MB) rm -rf ${NANO_WORLDDIR}/usr/share/groff_font rm -rf ${NANO_WORLDDIR}/usr/share/tmac rm -rf ${NANO_WORLDDIR}/usr/share/me # Kill all .a's and .la's that are installed (20MB+) find ${NANO_WORLDDIR} -name \*.a -or -name \*.la -delete # magic.mgc is just a speed optimization. Kill it for 1.7MB rm -f ${NANO_WORLDDIR}/usr/share/misc/magic.mgc # Last second tweaks chown -R root:wheel ${NANO_WORLDDIR}/root chmod 0755 ${NANO_WORLDDIR}/root/* chmod 0755 ${NANO_WORLDDIR}/* chown -R root:wheel ${NANO_WORLDDIR}/etc chown -R root:wheel ${NANO_WORLDDIR}/boot chown root:wheel ${NANO_WORLDDIR}/ chown root:wheel ${NANO_WORLDDIR}/usr find ${NANO_WORLDDIR} -type f -name "*~" -delete find ${NANO_WORLDDIR}/usr/local -type f -name "*.po" -delete find ${NANO_WORLDDIR} -type f -name "*.service" -delete } late_customize_cmd product_custom fi # [ $PACKAGE_PREP_BUILD = 1 ] Index: head/tools/tools/nanobsd/embedded/beaglebone.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/beaglebone.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/beaglebone.cfg (revision 333143) @@ -1,36 +1,36 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=armv7 NANO_KERNEL=BEAGLEBONE NANO_DRIVE=mmcsd0 NANO_NAME=beaglebone NANO_BOOT_PKG=u-boot-beaglebone NANO_CPUTYPE=cortex-a8 . common # Pull in common definitions, keep last Index: head/tools/tools/nanobsd/embedded/common =================================================================== --- head/tools/tools/nanobsd/embedded/common (revision 333142) +++ head/tools/tools/nanobsd/embedded/common (revision 333143) @@ -1,678 +1,678 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc 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. # # # This file is heavily derived from both Sam Leffler's Avilia config, # as well as the BSDRP project's config file. Neither of these have # an explicit copyright/license statement, but are implicitly BSDL. This # example has been taken from the FreeNAS project (an early version) and # simplified to meet the needs of the example. # # NB: You want the other file as the command line arg :) # Missing in base: # o mkimg setting active partition # o mkimg starting at arbitrary offset (needed for A10, et al) # o mtools still needed because we have no makefs -t msdos # o nanobsd doesn't record changes to WORLDTEMP in customization # scripts yet, so we have kludge to pick up all files # o easy way for pkg to grab files from other repos and put that # data on the image # o Need to have some way to create / resize the s4 slice to do ping # pong bouncing between s3 and s4 for an arbitrary image. we can resize # one slice, not two # o hints in the uboot ports for how to create the image # # Missing here # o documentation for how to run the qemu images # o msdos mtools fallback # o special boot for !x86 !arm platforms # o qemu image for arm # o qemu image for aarch64 # o qemu image for armv6/armv7 # o easy support for different image / vm formats # o need to promote much of this to nanobsd.sh and friends # o uses old kludge to build image w/o ownership being right # for many files. Should move to mtree-dedup.awk. # o support for EFI images # o support for GPT partitioning # # Long Term # o common tooling for creating images for odd-ball platforms # o support for boot loaders other than uboot in the image # or via special instructions # o no pony support; sadly, you cannot have a pony # if [ -z $NANO_NAME ]; then echo "NANO_NAME not defined. Use foo.cfg instead." fi NANO_SLICE_FAT_SIZE=32m NANO_SLICE_CFG_SIZE=32m NANO_BOOT2CFG="-h -S115200" NANO_RAM_ETCSIZE=8192 NANO_RAM_TMPVARSIZE=8192 NANO_IMAGES=2 NANO_PMAKE="make -j $(sysctl -n hw.ncpu)" NANO_CFG_BASE=$(pwd) NANO_CFG_BASE=$(realpath ${NANO_CFG_BASE}/..) NANO_SRC=$(realpath ${NANO_CFG_BASE}/../../..) #### XXX share obj if [ -z ${NANO_CPUTYPE} ]; then NANO_OBJ=${NANO_SRC}/../embedded/obj else # Alas, I can't set OBJTREE to ${MACHINE}.${MACHINE_ARCH}.${CPUTYPE} # so this will have to do until I can. NANO_OBJ=${NANO_SRC}/../embedded/obj.${NANO_CPUTYPE} fi NANO_LOG=${NANO_OBJ}/../${NANO_NAME} NANO_DISKIMGDIR=${NANO_OBJ}/../images NANO_WORLDDIR=${NANO_LOG}/_.w NANO_INIT_IMG2=0 NANO_NOPRIV_BUILD=t unset MAKEOBJDIRPREFIX mkdir -p ${NANO_OBJ} NANO_OBJ=$(realpath ${NANO_OBJ}) mkdir -p ${NANO_LOG} NANO_LOG=$(realpath ${NANO_LOG}) mkdir -p ${NANO_WORLDDIR} NANO_WORLDDIR=$(realpath ${NANO_WORLDDIR}) mkdir -p ${NANO_DISKIMGDIR} NANO_DISKIMGDIR=$(realpath ${NANO_DISKIMGDIR}) NANO_FAT_DIR=${NANO_LOG}/_.fat customize_cmd cust_allow_ssh_root add_etc_make_conf ( ) ( touch ${NANO_WORLDDIR}/etc/make.conf ) customize_cmd add_etc_make_conf cust_install_machine_files ( ) ( echo "cd ${NANO_CFG_BASE}/Files" cd ${NANO_CFG_BASE}/Files find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio -dumpv ${NANO_WORLDDIR} ) customize_cmd cust_install_files customize_cmd cust_install_machine_files # NB: leave c++ enabled so devd can be built CONF_BUILD=" LOCAL_XTOOL_DIRS=usr.bin/mkimg WITHOUT_ACPI=true WITHOUT_ATM=true WITHOUT_AUDIT=true WITHOUT_BIND_DNSSEC=true WITHOUT_BIND_ETC=true WITHOUT_BIND_LIBS_LWRES=true WITHOUT_BLUETOOTH=true WITHOUT_CALENDAR=true WITHOUT_CVS=true WITHOUT_DICT=true WITHOUT_EXAMPLES=true WITHOUT_FORTRAN=true WITHOUT_GAMES=true WITHOUT_GCOV=true WITHOUT_GPIB=true WITHOUT_HTML=true WITHOUT_I4B=true WITHOUT_IPFILTER=true WITHOUT_IPX=true WITHOUT_LIBKSE=true WITHOUT_LOCALES=true WITHOUT_LPR=true WITHOUT_MAN=true WITHOUT_NETCAT=true WITHOUT_NIS=true WITHOUT_NLS=true WITHOUT_NS_CACHING=true WITHOUT_OBJC=true WITHOUT_PROFILE=true WITHOUT_SENDMAIL=true WITHOUT_SHAREDOCS=true WITHOUT_SYSCONS=true WITHOUT_LIB32=true WITHOUT_TESTS=true WITHOUT_DEBUG_FILES=t WITHOUT_KERNEL_SYMBOLS=t " CONF_INSTALL="$CONF_BUILD INSTALL_NODEBUG=t NOPORTDOCS=t NO_INSTALL_MANPAGES=t " # The following would help... # WITHOUT_TOOLCHAIN=true can't build ports # WITHOUT_INSTALLLIB=true libgcc.a # # from the build # WITHOUT_INFO=true makeinfo # WITHOUT_RCS=true PKG_ONLY_MAKE_CONF=" WITHOUT_TOOLCHAIN=true WITHOUT_INSTALLLIB=true WITHOUT_INFO=true WITHOUT_RCS=true " NANO_PACKAGE_ONLY=1 # Creates images for all the formats that use MBR / GPT # split later if the #ifdef soup gets too bad. create_diskimage_gpt ( ) ( pprint 2 "build diskimage gpt ${NANO_NAME}" create_diskimage_mbr $* ) create_diskimage_mbr ( ) ( local fmt [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmt=".${NANO_DISKIMAGE_FORMAT}" pprint 2 "build diskimage ${NANO_NAME}" pprint 3 "log: ${NANO_LOG}/_.di" pprint 3 "image in: ${NANO_DISKIMGDIR}/_.disk.image.${NANO_NAME}${fmt}" ( local extra i sz fmt fmtarg bootmbr bootbsd skiparg set -o xtrace # Tell mtools not to be too picky export MTOOLS_SKIP_CHECK=1 [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmtarg="-f ${NANO_DISKIMAGE_FORMAT}" [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmt=".${NANO_DISKIMAGE_FORMAT}" bootmbr=${NANO_BOOT_MBR:+-b ${NANO_BOOT_MBR}} bootbsd=${NANO_BOOT_BSD:+-b ${NANO_BOOT_BSD}} skiparg=${NANO_MBR_FIRST_SKIP:+-S ${NANO_MBR_FIRST_SKIP}} for i in s1 s2 s3 s4 p1 p2 p3 p4 p5 empty; do rm -fr ${NANO_LOG}/_.${i}* done # Populate the FAT partition, if needed if [ -n "${NANO_SLICE_FAT}" ]; then echo Creating MSDOS partition for kernel newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -F 16 -L ${NANO_NAME} \ ${NANO_LOG}/_.${NANO_SLICE_FAT} if [ -d ${NANO_FAT_DIR} ]; then # Need to copy files from ${NANO_FATDIR} with mtools, or use # makefs -t msdos once that's supported mcopy -i ${NANO_LOG}/_.${NANO_SLICE_FAT} ${NANO_FAT_DIR}/* :: fi fi # Populate the Powerpc boot image, if needed if [ "${NANO_LAYOUT}" = powerpc64-ibm ]; then dd if=${NANO_WORLDDIR}/boot/boot1.elf of=${NANO_LOG}/_.s1 bs=800k count=1 conv=sync fi # Populate the / partition, and place it into a slice with a # bsd label [ -z ${NANO_NOPRIV_BUILD} ] || extra="-F ${NANO_METALOG}" sz=${NANO_SLICE_ROOT_SIZE:+-s ${NANO_SLICE_ROOT_SIZE}} eval "${NANO_MAKEFS_UFS}" ${extra} $sz "${NANO_LOG}/_.${NANO_ROOT}" \ "${NANO_WORLDDIR}" case ${NANO_DISK_SCHEME} in mbr) mkimg -s bsd ${bootbsd} -p freebsd-ufs:=${NANO_LOG}/_.${NANO_ROOT} \ -o ${NANO_LOG}/_.${NANO_SLICE_ROOT} eval $NANO_SLICE_CFG=freebsd eval $NANO_SLICE_ROOT=freebsd ;; gpt) eval $NANO_SLICE_CFG=freebsd-ufs eval $NANO_SLICE_ROOT=freebsd-ufs ;; esac # Populate the /cfg partition, empty if none given if [ -z "${NANO_CFGDIR}" ]; then echo "Faking cfg dir, it's empty" NANO_CFGDIR=${NANO_LOG}/_.empty mkdir -p ${NANO_CFGDIR} fi # XXX -F cfg-mtree eval "${NANO_MAKEFS_UFS}" -s ${NANO_SLICE_CFG_SIZE} \ "${NANO_LOG}/_.${NANO_SLICE_CFG}" "${NANO_CFGDIR}" # data slice not supported since we need the part for FAT for # booting # Now shuffle all the slices together into the proper layout if [ -n "$NANO_SLICE_FAT" ]; then eval $NANO_SLICE_FAT=fat16b fi out=${NANO_DISKIMGDIR}/_.disk.image.${NANO_NAME}${fmt} # below depends on https://reviews.freebsd.org/D4403 not yet in the tree # but there's problems: it marks all partitions as active, so you have to # boot off partition 3 or 2 by hand if you're playing around with this WIP case ${NANO_LAYOUT} in std-embedded) mkimg -a 3 ${skiparg} ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_LOG}/_.s1 \ -p ${s2}:=${NANO_LOG}/_.s2 \ -p ${s3}:=${NANO_LOG}/_.s3 \ -o ${out} ;; std-x86) # s3 is cfg, s1 is /, s2 is other / (s2 is created in first boot script) mkimg -a 1 ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_LOG}/_.s1 \ -p- \ -p ${s3}:=${NANO_LOG}/_.s3 \ -o ${out} ;; std-uefi) # s1 is boot, s2 is cfg, s3 is /, not sure how to make that # boot (marked as active) with mkimg yet mkimg -a 2 ${fmtarg} ${bootmbr} -s mbr \ -p efi:=${NANO_WORLDDIR}/boot/boot1.efifat \ -p ${s2}:=${NANO_LOG}/_.s2 \ -p ${s3}:=${NANO_LOG}/_.s3 \ -o ${out} ;; std-uefi-bios) # p1 is boot for uefi, p2 is boot for gpt, p3 is cfg, p4 is / # and p5 is alt-root (after resize) mkimg -a 2 ${fmtarg} ${bootmbr} -s gpt \ -p efi:=${NANO_WORLDDIR}/boot/boot1.efifat \ -p freebsd-boot:=${NAANO_WORLDDIR}/boot/gptboot \ -p ${p3}:=${NANO_LOG}/_.p3 \ -p ${p4}:=${NANO_LOG}/_.p4 \ -o ${out} ;; powerpc64-ibm) # A lie to make the boot loader work, it boots the first BSD partition # it finds, regardless of the active flag. s2=fat16b # boot image is on a special partition, ala std-embedded, but that # partition isn't FAT with special files, but a copy of the boot # loader itself. mkimg -a 1 ${fmtarg} -s mbr -p prepboot:=${NANO_LOG}/_.s1 \ -p ${s2}:=${NANO_LOG}/_.s2 \ -p ${s3}:=${NANO_LOG}/_.s3a \ -o ${out} ;; esac rm -f ${out}.xz xz -9 --keep ${out} ) > ${NANO_LOG}/_.di 2>&1 ) die( ) { echo "$*" exit 1 } # Automatically include the packaging port here so it is always first so it # builds the port and adds the package so we can add other packages. #XXX Doesn't work for cross build, so punting until I can integreate qemu-static #XXX or poudriere, both of which require priv'd execution. Or qemu-system, #XXX which is super, super slow. #add_port ports-mgmt/pkg #add_port security/sudo #add_port ftp/curl rp=$(realpath ${NANO_OBJ}/) __a=`mount | grep ${rp} | awk '{print length($3), $3;}' | sort -rn | awk '{$1=""; print;}'` if [ -n "$__a" ]; then echo "unmounting $__a" umount $__a fi if [ "$DEBUG" = 1 ]; then DEBUG_BUILD=" DEBUG_FLAGS= -g " else DEBUG_INSTALL=" INSTALL_NODEBUG= t " fi CONF_INSTALL="$CONF_BUILD ${DEBUG_BUILD} " CONF_INSTALL="$CONF_INSTALL ${DEBUG_INSTALL} " if [ "${NANO_PACKAGE_ONLY}" -eq 1 ]; then CONF_INSTALL="${CONF_INSTALL} ${PKG_ONLY_MAKE_CONF} " echo "Automatically building a thin image with packages" else echo "Automatically building a * * F A T * * image so we can build ports" fi VARS="MASTER_SITE_BACKUP MASTER_SITE_OVERRIDE PACKAGEROOT PACKAGESITE" for var in $VARS; do val=$(eval echo "\$$var") if [ -n "$val" ]; then CONF_INSTALL="${CONF_INSTALL} $var=$val" fi done typical_embedded ( ) ( # Need to create rc.conf before we copy over /etc to /conf/base/etc # so now's a good time. local rc=${NANO_WORLDDIR}/etc/rc.conf echo "hostname=nanobsd-${NANO_NAME}" > $rc echo "growfs_enable=YES" >> $rc echo "growfs_type=nanobsd-pingpong" >> $rc echo "ntpdate_enable=YES" >> $rc echo "ifconfig_DEFAULT=DHCP" >> $rc echo "ntpdate_hosts='0.freebsd.pool.ntp.org 1.freebsd.pool.ntp.org'" >> $rc # Make sure that firstboot scripts run so growfs works. # Note: still some issues remvoing this XXX touch ${NANO_WORLDDIR}/firstboot ) customize_cmd typical_embedded fix_pkg ( ) ( chdir ${NANO_WORLDDIR} mkdir -p pkg mkdir -p pkg/db mkdir -p pkg/cache mkdir -p pkg/tmp # Needed for pkg bootstrap mkdir -p usr/local/etc # Will get moved to local/etc ( echo 'PKG_DBDIR = "/pkg/db"' echo 'PKG_CACHEDIR = "/pkg/cache"' echo 'DEFAULT_ALWAYS_YES = "yes"' echo 'ASSUME_ALWAYS_YES = "yes"' ) >> usr/local/etc/pkg.conf [ -z ${NANO_NOPRIV_BUILD} ] || ( echo "./pkg type=dir uname=root gname=wheel mode=0755" echo "./pkg/cache type=dir uname=root gname=wheel mode=0755" echo "./pkg/db type=dir uname=root gname=wheel mode=0755" echo "./pkg/tmp type=dir uname=root gname=wheel mode=0755" ) >> ${NANO_METALOG} ) customize_cmd fix_pkg save_build ( ) ( VERSION_FILE=${NANO_WORLDDIR}/etc/version if [ "${SVNREVISION}" = "${REVISION}" ]; then echo "${NANO_NAME}" > "${VERSION_FILE}" else echo "${NANO_NAME} (${SVNREVISION})" > "${VERSION_FILE}" fi ) customize_cmd save_build shrink_md_fbsize ( ) ( # We have a lot of little files on our memory disks. Let's decrease # the block and frag size to fit more little files on them (this # halves our space requirement by ~50% on /etc and /var on 8.x -- # and gives us more back on 9.x as the default block and frag size # are 4 times larger). sed -i '' -e 's,-S -i 4096,-S -i 4096 -b 4096 -f 512,' \ ${NANO_WORLDDIR}/etc/rc.initdiskless ) customize_cmd shrink_md_fbsize customize_cmd cust_comconsole dos_boot_part ( ) ( local d=/usr/local/share/u-boot/${NANO_BOOT_PKG} local f=${NANO_FAT_DIR} # For now, just copy all the files. However, for iMX6 and Allwinner, # we'll need to put a special boot block at a fixed location # on the disk as well. rm -rf $f mkdir $f chdir $f cp ${d}/* . # Also copy ubldr. u-boot will load it and it will load the kernel # from the ufs partition cp ${NANO_WORLDDIR}/boot/ubldr . cp ${NANO_WORLDDIR}/boot/ubldr.bin . # We have to touch the saveenv file touch uEnv.txt # Now we need to copy over dtb files from the build. cp ${NANO_WORLDDIR}/boot/dtb/*.dtb . ) if [ -n "$NANO_BOOT_PKG" ]; then d=/usr/local/share/u-boot/${NANO_BOOT_PKG} if [ ! -d ${d} ]; then echo ${NANO_BOOT_PKG} not installed. Sadly, it must be. exit 1 fi if [ ! -x /usr/local/bin/mcopy ]; then echo mtools not installed. Sadly, we gotta have it. exit 1 fi customize_cmd dos_boot_part fi product_custom ( ) ( # not quite ready to tweak these in nopriv build if [ -z ${NANO_NOPRIV_BUILD} ]; then # Last second tweaks -- generally not needed chown -R root:wheel ${NANO_WORLDDIR}/root chmod 0755 ${NANO_WORLDDIR}/root/* chmod 0755 ${NANO_WORLDDIR}/* chown -R root:wheel ${NANO_WORLDDIR}/etc chown -R root:wheel ${NANO_WORLDDIR}/boot chown root:wheel ${NANO_WORLDDIR}/ chown root:wheel ${NANO_WORLDDIR}/usr fi ) late_customize_cmd product_custom # # Convenience routines to bring up many settings for standard environments # # # For each architecture, we have a standard set of settings to the extent # it makes sense. For architectures that don't have a standard environment # cfg files need to either define a lot of settings, provide their own disk # imaging, or set which of the variants we support. No subshells, since we # set global variables # std_aarch64 ( ) { } std_amd64 ( ) { std_i386 } std_arm ( ) { } std_armeb ( ) { NANO_ENDIAN=big } std_armv6 ( ) { } std_armv7 ( ) { } std_i386 ( ) { # Default values, if not overridden in .cfg file : ${NANO_KERNEL:=GENERIC} : ${NANO_DRIVE:=ada0} : ${NANO_LAYOUT:=std-x86} : ${NANO_BOOT_MBR:=${NANO_WORLDDIR}/boot/boot0sio} : ${NANO_BOOT_BSD:=${NANO_WORLDDIR}/boot/boot} } std_mips ( ) { NANO_ENDIAN=big } std_mipsel ( ) { } std_mips64 ( ) { NANO_ENDIAN=big } std_mips64el ( ) { } std_powerpc ( ) { NANO_ENDIAN=big } std_powerpc64 ( ) { NANO_LAYOUT=powerpc64-ibm NANO_ENDIAN=big } std_sparc64 ( ) { NANO_ENDIAN=big } # # QEMU settings for the standard environments # qemu_env ( ) { NANO_DISKIMAGE_FORMAT=qcow2 } # other standard environments will go here eval std_${NANO_ARCH} # Slice 1: FAT for ROM loading bootstrap # Slice 2: Config partition # Slice 3: FreeBSD partition (sized exactly) # Slice 4: FreeBSD partition (empty) # on first boot, we resize slice 3 & 4 to be 1/2 of what's # left over on the SD card after slice 1 and 2 are taken # off the top. We also resize the 'a' partion on first boot # to the size of the partition for the ping/pong upgrade. # This feature needs support in the rc.d bootup script. # # Ideally, we'd not put BSD labels on the MBR disks. # However, we can't boot off raw MBR disks. First, # boot2 defaults to 'a' partition, and freaks out # unless you tell it to use 'c'. But even if we # hack that, then /boot/loader wants to load off # of 'c' partition. If you fix that, then we'll # try to mount root, but sanity checks prevent # slices from working. # : ${NANO_ENDIAN:=little} # make -V something to figure it out? : ${NANO_LAYOUT:=std-embedded} : ${NANO_MAKEFS_UFS:=makefs -t ffs -B ${NANO_ENDIAN}} : ${NANO_DISK_SCHEME:=mbr} # No others really supported ATM (well, gpt) case ${NANO_LAYOUT} in std-embedded) NANO_SLICE_FAT=s1 NANO_SLICE_CFG=s2 NANO_SLICE_ROOT=s3 NANO_SLICE_ALTROOT=s4 NANO_ROOT=${NANO_SLICE_ROOT}a NANO_ALTROOT=${NANO_SLICE_ALTROOT}a ;; std-x86) NANO_SLICE_CFG=s3 NANO_SLICE_ROOT=s1 NANO_SLICE_ALTROOT=s2 NANO_ROOT=${NANO_SLICE_ROOT}a NANO_ALTROOT=${NANO_SLICE_ALTROOT}a ;; powerpc64-ibm) NANO_SLICE_PPCBOOT=s1 NANO_SLICE_CFG=s2 NANO_SLICE_ROOT=s3 NANO_SLICE_ALTROOT=s4 NANO_ROOT=${NANO_SLICE_ROOT}a NANO_ALTROOT=${NANO_SLICE_ALTROOT}a ;; powerpc64-apple) echo Not yet exit 1 ;; std-uefi) NANO_SLICE_UEFI=s1 NANO_SLICE_CFG=s2 NANO_SLICE_ROOT=s3 NANO_SLICE_ALTROOT=s4 NANO_ROOT=${NANO_SLICE_ROOT} NANO_ALTROOT=${NANO_SLICE_ALTROOT} ;; std-uefi-bios) NANO_DISK_SCHEME=gpt NANO_SLICE_UEFI=p1 NANO_SLICE_BOOT=p2 NANO_SLICE_CFG=p3 NANO_SLICE_ROOT=p4 NANO_SLICE_ALTROOT=p5 NANO_ROOT=${NANO_SLICE_ROOT} NANO_ALTROOT=${NANO_SLICE_ALTROOT} ;; *) echo Unknown Layout ${NANO_LAYOUT} exit 1 ;; esac NANO_SLICE_DATA= # Not included # Each major disk scheme has its own routine. Generally # this is for mbr, gpt, etc. These are generally are widely # shared, but some specialized formats won't be shared. create_diskimage ( ) ( eval create_diskimage_${NANO_DISK_SCHEME} ) # Set the path to the same path we use for buldworld to use latest mkimg NANO_TARGET=$(cd ${NANO_SRC}; ${NANO_MAKE} TARGET_ARCH=${NANO_ARCH} -V _TARGET) NANO_TMPPATH=$(cd ${NANO_SRC}; ${NANO_MAKE} MK_AUTO_OBJ=no TARGET=${NANO_TARGET} TARGET_ARCH=${NANO_ARCH} -f Makefile.inc1 buildenv -V TMPPATH) export PATH="${NANO_TMPPATH}" Index: head/tools/tools/nanobsd/embedded/i386.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/i386.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/i386.cfg (revision 333143) @@ -1,34 +1,34 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=i386 NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=i386 . common # Pull in common definitions, keep last Index: head/tools/tools/nanobsd/embedded/pandaboard.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/pandaboard.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/pandaboard.cfg (revision 333143) @@ -1,36 +1,36 @@ # $FreeBSD$ #- -# Copyright (c) 2016 Warner Losh. All Rights Reserved. +# Copyright (c) 2016 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=armv7 NANO_KERNEL=PANDABOARD NANO_DRIVE=mmcsd0 NANO_NAME=pandaboard NANO_BOOT_PKG=u-boot-pandaboard NANO_CPUTYPE=cortex-a9 . common # Pull in common definitions, keep last Index: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg (revision 333143) @@ -1,43 +1,43 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=amd64 NANO_NAME=qemu-amd64-uefi-bios NANO_LAYOUT=std-uefi-bios . common # Pull in common definitions qemu_env # # Run with # qemu-system-x86_64 -m 512 -serial stdio -bios OVMF.fd \ # -hda _.disk.image.qemu-amd64-uefi.qcow2 # OVMF.fd is from # http://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip # Index: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg (revision 333143) @@ -1,43 +1,43 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=amd64 NANO_NAME=qemu-amd64-uefi NANO_LAYOUT=std-uefi . common # Pull in common definitions qemu_env # # Run with # qemu-system-x86_64 -m 512 -serial stdio -bios OVMF.fd \ # -hda _.disk.image.qemu-amd64-uefi.qcow2 # OVMF.fd is from # http://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip # Index: head/tools/tools/nanobsd/embedded/qemu-amd64.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/qemu-amd64.cfg (revision 333143) @@ -1,39 +1,39 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=amd64 NANO_NAME=qemu-amd64 . common # Pull in common definitions qemu_env # Run with: # qemu-system-x86_64 -m 512 -hdd $file -serial telnet::4444,server -nographic # To get some breathing room on the image: # qemu-img resize $file +2G Index: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/qemu-armv7.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/qemu-armv7.cfg (revision 333143) @@ -1,48 +1,48 @@ # $FreeBSD$ #- # Copyright (c) 2016 Andrew Turner. All Rights Reserved. -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=armv7 NANO_DRIVE=vtbd0 NANO_KERNEL=GENERIC NANO_NAME=qemu-armv7 NANO_LAYOUT=std-uefi-bios NANO_CPUTYPE=cortexa . common # Pull in common definitions qemu_env # # Run with # qemu-system-arm -m 512 -M virt -serial stdio -bios QEMU_EFI.fd \ # -drive if=none,file=_.disk.image.qemu-armv7.qcow2,id=hd0 \ # -device virtio-blk-device,drive=hd0 # QEMU_EFI.fd is from # http://releases.linaro.org/components/kernel/uefi-linaro/15.12/release/qemu/ # Index: head/tools/tools/nanobsd/embedded/qemu-i386.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/qemu-i386.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/qemu-i386.cfg (revision 333143) @@ -1,34 +1,34 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=i386 NANO_NAME=qemu-i386 . common # Pull in common definitions qemu_env Index: head/tools/tools/nanobsd/embedded/qemu-mips.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/qemu-mips.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/qemu-mips.cfg (revision 333143) @@ -1,36 +1,36 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=mips NANO_KERNEL=MALTA NANO_DRIVE=ada0 NANO_NAME=qemu-mips . common # Pull in common definitions qemu_env Index: head/tools/tools/nanobsd/embedded/qemu-mips64.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/qemu-mips64.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/qemu-mips64.cfg (revision 333143) @@ -1,36 +1,36 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=mips NANO_KERNEL=MALTA64 NANO_DRIVE=ada0 NANO_NAME=qemu-mips64 . common # Pull in common definitions qemu_env Index: head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg (revision 333143) @@ -1,37 +1,37 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # # Open question: do we have one for MAC G4 and one for Book-E? NANO_ARCH=powerpc NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc . common # Pull in common definitions qemu_env Index: head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg (revision 333143) @@ -1,36 +1,36 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=powerpc64 NANO_KERNEL=GENERIC64 NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc64 . common # Pull in common definitions qemu_env Index: head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg (revision 333143) @@ -1,36 +1,36 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=sparc64 NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-sparc64 . common # Pull in common definitions qemu_env Index: head/tools/tools/nanobsd/embedded/rpi.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/rpi.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/rpi.cfg (revision 333143) @@ -1,36 +1,36 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=armv6 NANO_KERNEL=RPI-B NANO_DRIVE=mmcsd0 NANO_NAME=rpi-b NANO_BOOT_PKG=u-boot-rpi NANO_CPUTYPE=arm1176jzf-s . common # Pull in common definitions, keep last Index: head/tools/tools/nanobsd/embedded/rpi2.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/rpi2.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/rpi2.cfg (revision 333143) @@ -1,35 +1,35 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=armv7 NANO_KERNEL=RPI2 NANO_DRIVE=mmcsd0 NANO_NAME=rpi2 NANO_BOOT_PKG=u-boot-rpi2 . common # Pull in common definitions, keep last Index: head/tools/tools/nanobsd/embedded/rpi3.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/rpi3.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/rpi3.cfg (revision 333143) @@ -1,35 +1,35 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=aarch64 NANO_KERNEL=GENERIC-UP NANO_DRIVE=mmcsd0 NANO_NAME=rpi3 NANO_BOOT_PKG=u-boot-rpi3 . common # Pull in common definitions, keep last Index: head/tools/tools/nanobsd/embedded/sam9260ek.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/sam9260ek.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/sam9260ek.cfg (revision 333143) @@ -1,35 +1,35 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=arm NANO_KERNEL=SAM9260EK NANO_DRIVE=mmcsd0 NANO_NAME=sam9260ek NANO_CPUTYPE=arm926ej-s . common # Pull in common definitions, keep last Index: head/tools/tools/nanobsd/embedded/sam9g20ek.cfg =================================================================== --- head/tools/tools/nanobsd/embedded/sam9g20ek.cfg (revision 333142) +++ head/tools/tools/nanobsd/embedded/sam9g20ek.cfg (revision 333143) @@ -1,35 +1,35 @@ # $FreeBSD$ #- -# Copyright (c) 2015 Warner Losh. All Rights Reserved. +# Copyright (c) 2015 M. Warner Losh. # Copyright (c) 2010-2011 iXsystems, Inc., 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 iXsystems, Inc. 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. # NANO_ARCH=arm NANO_KERNEL=SAM9G20EK NANO_DRIVE=mmcsd0 NANO_NAME=sam9g20ek NANO_CPUTYPE=arm926ej-s . common # Pull in common definitions, keep last