Re: svn commit: r262196 - head/sys/netpfil/pf
On Sat, Feb 22, 2014 at 03:28:38PM -0800, Craig Rodrigues wrote: C> Much thanks to you and Nicos for working on pf + VIMAGE. C> I work on FreeNAS at iXsystems, and in FreeNAS we enable C> VIMAGE, because we use jails quiet heavily. C> C> I encouraged Martin to go with his patch, because C> it seemed to solve some problems we had with pf + VIMAGE kernel panics C> such as this one: C> C> https://bugs.freenas.org/issues/4153 C> C> Do you have a rough idea when you and Nicos will be ready to merge your C> projects/pf branch to HEAD? C> Would you be open to forking the https://github.com/trueos repository on C> github C> and putting your pf + VIMAGE patches in there? C> C> We could make special builds of FreeNAS and aggressively test your VIMAGE C> patches. FreeNAS isn't based on FreeBSD CURRENT/FreeBSD 10 yet. C> we have some work to do to get up to there. Current plan is that mm@ commits his changes to projects/pf, taking into account comment from trociny@. Then after few days of testing, he merges projects/pf to head. It was kept diverged for too long time. -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262375 - in head/sys/dev/ath/ath_hal: . ah_regdomain
Author: hiren Date: Sun Feb 23 18:07:17 2014 New Revision: 262375 URL: http://svnweb.freebsd.org/changeset/base/262375 Log: PicoStation M2HP presents reg domain 0x2a which is not found in atheros or linux reference code. Add this workaround for now. Reviewed by: adrian Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c == --- head/sys/dev/ath/ath_hal/ah_regdomain.c Sun Feb 23 17:37:24 2014 (r262374) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Sun Feb 23 18:07:17 2014 (r262375) @@ -169,6 +169,11 @@ isEepromValid(struct ath_hal *ah) if (regDomainPairs[i].regDmnEnum == rd) return AH_TRUE; } + + if (rd == FCC_UBNT) { + return AH_TRUE; + } + HALDEBUG(ah, HAL_DEBUG_REGDOMAIN, "%s: invalid regulatory domain/country code 0x%x\n", __func__, rd); return AH_FALSE; Modified: head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h == --- head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h Sun Feb 23 17:37:24 2014(r262374) +++ head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h Sun Feb 23 18:07:17 2014(r262375) @@ -51,6 +51,7 @@ enum { FCC2_FCCA = 0x20, /* Canada */ FCC2_WORLD = 0x21, /* Australia & HK */ FCC2_ETSIC = 0x22, + FCC_UBNT= 0x2A, /* Ubiquity PicoStation M2HP */ FRANCE_RES = 0x31, /* Legacy France for OEM */ FCC3_FCCA = 0x3A, /* USA & Canada w/5470 band, 11h, DFS enabled */ FCC3_WORLD = 0x3B, /* USA & Canada w/5470 band, 11h, DFS enabled */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262393 - head/sys/arm/freescale/imx
Author: ian Date: Sun Feb 23 21:13:04 2014 New Revision: 262393 URL: http://svnweb.freebsd.org/changeset/base/262393 Log: Fix a typo _IMX51_TZICRREG_H_ -> _IMX51_TZICREG_H_ (extra R) Modified: head/sys/arm/freescale/imx/imx51_tzicreg.h Modified: head/sys/arm/freescale/imx/imx51_tzicreg.h == --- head/sys/arm/freescale/imx/imx51_tzicreg.h Sun Feb 23 21:08:48 2014 (r262392) +++ head/sys/arm/freescale/imx/imx51_tzicreg.h Sun Feb 23 21:13:04 2014 (r262393) @@ -57,7 +57,7 @@ */ #ifndef _IMX51_TZICREG_H_ -#define_IMX51_TZICRREG_H_ +#define_IMX51_TZICREG_H_ #include ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262394 - head/usr.bin/dtc
Author: theraven Date: Sun Feb 23 21:13:07 2014 New Revision: 262394 URL: http://svnweb.freebsd.org/changeset/base/262394 Log: Fix parsing multiple roots with whitespace between them. Patch by: Patrick Wildt Modified: head/usr.bin/dtc/fdt.cc Modified: head/usr.bin/dtc/fdt.cc == --- head/usr.bin/dtc/fdt.cc Sun Feb 23 21:13:04 2014(r262393) +++ head/usr.bin/dtc/fdt.cc Sun Feb 23 21:13:07 2014(r262394) @@ -1059,6 +1059,7 @@ device_tree::parse_roots(input_buffer &i { valid = false; } + input.next_token(); } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262397 - head/sys/dev/iwn
Author: adrian Date: Sun Feb 23 21:43:15 2014 New Revision: 262397 URL: http://svnweb.freebsd.org/changeset/base/262397 Log: Fix indentation. Modified: head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwnreg.h == --- head/sys/dev/iwn/if_iwnreg.hSun Feb 23 21:29:13 2014 (r262396) +++ head/sys/dev/iwn/if_iwnreg.hSun Feb 23 21:43:15 2014 (r262397) @@ -1610,7 +1610,7 @@ struct iwn_fw_tlv { #define IWN_FW_TLV_INIT_DATA 4 #define IWN_FW_TLV_BOOT_TEXT 5 #define IWN_FW_TLV_PBREQ_MAXLEN6 -#defineIWN_FW_TLV_PAN 7 +#defineIWN_FW_TLV_PAN 7 #defineIWN_FW_TLV_RUNT_EVTLOG_PTR 8 #defineIWN_FW_TLV_RUNT_EVTLOG_SIZE 9 #defineIWN_FW_TLV_RUNT_ERRLOG_PTR 10 @@ -1621,7 +1621,7 @@ struct iwn_fw_tlv { #define IWN_FW_TLV_PHY_CALIB 15 #defineIWN_FW_TLV_WOWLAN_INST 16 #defineIWN_FW_TLV_WOWLAN_DATA 17 -#defineIWN_FW_TLV_FLAGS18 +#defineIWN_FW_TLV_FLAGS18 uint16_talt; uint32_tlen; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262398 - in head: contrib/libucl contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests contrib/libucl/uthash contrib/libucl/utils lib/libucl share/mk
Author: bapt Date: Sun Feb 23 21:49:21 2014 New Revision: 262398 URL: http://svnweb.freebsd.org/changeset/base/262398 Log: Import libucl into head UCL is heavily infused by nginx configuration as the example of a convenient configuration system. However, UCL is fully compatible with JSON format and is able to parse json files. UCL is used by pkg(8) for its configuration file as well for the manifest format in packages, it will be used in base for the pkg boostrap (signature checking and configuration file parsing.) libucl has been developped and is maintained by vsevolod@ Added: head/contrib/libucl/ - copied from r262396, vendor/libucl/dist/ head/lib/libucl/ head/lib/libucl/Makefile (contents, props changed) Replaced: head/contrib/libucl/.gitignore - copied unchanged from r262396, vendor/libucl/dist/.gitignore head/contrib/libucl/Makefile - copied unchanged from r262396, vendor/libucl/dist/Makefile head/contrib/libucl/README.md - copied unchanged from r262396, vendor/libucl/dist/README.md head/contrib/libucl/doc/ - copied from r262396, vendor/libucl/dist/doc/ head/contrib/libucl/doc/api.md - copied unchanged from r262396, vendor/libucl/dist/doc/api.md head/contrib/libucl/include/ - copied from r262396, vendor/libucl/dist/include/ head/contrib/libucl/include/ucl.h - copied unchanged from r262396, vendor/libucl/dist/include/ucl.h head/contrib/libucl/src/ - copied from r262396, vendor/libucl/dist/src/ head/contrib/libucl/src/ucl_chartable.h - copied unchanged from r262396, vendor/libucl/dist/src/ucl_chartable.h head/contrib/libucl/src/ucl_emitter.c - copied unchanged from r262396, vendor/libucl/dist/src/ucl_emitter.c head/contrib/libucl/src/ucl_hash.c - copied unchanged from r262396, vendor/libucl/dist/src/ucl_hash.c head/contrib/libucl/src/ucl_hash.h - copied unchanged from r262396, vendor/libucl/dist/src/ucl_hash.h head/contrib/libucl/src/ucl_internal.h - copied unchanged from r262396, vendor/libucl/dist/src/ucl_internal.h head/contrib/libucl/src/ucl_parser.c - copied unchanged from r262396, vendor/libucl/dist/src/ucl_parser.c head/contrib/libucl/src/ucl_util.c - copied unchanged from r262396, vendor/libucl/dist/src/ucl_util.c head/contrib/libucl/src/xxhash.c - copied unchanged from r262396, vendor/libucl/dist/src/xxhash.c head/contrib/libucl/src/xxhash.h - copied unchanged from r262396, vendor/libucl/dist/src/xxhash.h head/contrib/libucl/tests/ - copied from r262396, vendor/libucl/dist/tests/ head/contrib/libucl/tests/1.in - copied unchanged from r262396, vendor/libucl/dist/tests/1.in head/contrib/libucl/tests/1.res - copied unchanged from r262396, vendor/libucl/dist/tests/1.res head/contrib/libucl/tests/2.in - copied unchanged from r262396, vendor/libucl/dist/tests/2.in head/contrib/libucl/tests/2.res - copied unchanged from r262396, vendor/libucl/dist/tests/2.res head/contrib/libucl/tests/3.in - copied unchanged from r262396, vendor/libucl/dist/tests/3.in head/contrib/libucl/tests/3.res - copied unchanged from r262396, vendor/libucl/dist/tests/3.res head/contrib/libucl/tests/4.in - copied unchanged from r262396, vendor/libucl/dist/tests/4.in head/contrib/libucl/tests/4.res - copied unchanged from r262396, vendor/libucl/dist/tests/4.res head/contrib/libucl/tests/5.in - copied unchanged from r262396, vendor/libucl/dist/tests/5.in head/contrib/libucl/tests/5.res - copied unchanged from r262396, vendor/libucl/dist/tests/5.res head/contrib/libucl/tests/6.in - copied unchanged from r262396, vendor/libucl/dist/tests/6.in head/contrib/libucl/tests/6.res - copied unchanged from r262396, vendor/libucl/dist/tests/6.res head/contrib/libucl/tests/7.in - copied unchanged from r262396, vendor/libucl/dist/tests/7.in head/contrib/libucl/tests/7.res - copied unchanged from r262396, vendor/libucl/dist/tests/7.res head/contrib/libucl/tests/8.in - copied unchanged from r262396, vendor/libucl/dist/tests/8.in head/contrib/libucl/tests/8.res - copied unchanged from r262396, vendor/libucl/dist/tests/8.res head/contrib/libucl/tests/9-comment.inc - copied unchanged from r262396, vendor/libucl/dist/tests/9-comment.inc head/contrib/libucl/tests/9-empty.inc - copied unchanged from r262396, vendor/libucl/dist/tests/9-empty.inc head/contrib/libucl/tests/9.in - copied unchanged from r262396, vendor/libucl/dist/tests/9.in head/contrib/libucl/tests/9.inc - copied unchanged from r262396, vendor/libucl/dist/tests/9.inc head/contrib/libucl/tests/9.res - copied unchanged from r262396, vendor/libucl/dist/tests/9.res head/contrib/libucl/tests/generate.res - copied unchanged from r262396, vendor/libucl/dist/tests/generate.res head/contrib/libucl/tests/run_tests.sh - copied unchanged from r262396, vendor/libucl/dist/tests/ru
svn commit: r262399 - head/lib
Author: bapt Date: Sun Feb 23 21:50:11 2014 New Revision: 262399 URL: http://svnweb.freebsd.org/changeset/base/262399 Log: Branch libucl to the build Modified: head/lib/Makefile Modified: head/lib/Makefile == --- head/lib/Makefile Sun Feb 23 21:49:21 2014(r262398) +++ head/lib/Makefile Sun Feb 23 21:50:11 2014(r262399) @@ -119,6 +119,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libtelnet} \ ${_libthr} \ libthread_db \ + libucl \ libufs \ libugidfw \ libulog \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262400 - head/usr.sbin/pkg
Author: bapt Date: Sun Feb 23 21:55:07 2014 New Revision: 262400 URL: http://svnweb.freebsd.org/changeset/base/262400 Log: Switch pkg(7) from libyaml to libucl Modified: head/usr.sbin/pkg/Makefile head/usr.sbin/pkg/config.c head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/Makefile == --- head/usr.sbin/pkg/Makefile Sun Feb 23 21:50:11 2014(r262399) +++ head/usr.sbin/pkg/Makefile Sun Feb 23 21:55:07 2014(r262400) @@ -4,11 +4,11 @@ PROG= pkg SRCS= pkg.c dns_utils.c config.c MAN= pkg.7 -CFLAGS+=-I${.CURDIR}/../../contrib/libyaml/include -.PATH: ${.CURDIR}/../../contrib/libyaml/include -DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBYAML} ${LIBSBUF} ${LIBSSL} \ +CFLAGS+=-I${.CURDIR}/../../contrib/libucl/include +.PATH: ${.CURDIR}/../../contrib/libucl/include +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} ${LIBUCL} ${LIBSBUF} ${LIBSSL} \ ${LIBCRYPTO} -LDADD= -larchive -lelf -lfetch -lyaml -lsbuf -lssl -lcrypto -USEPRIVATELIB= yaml +LDADD= -larchive -lelf -lfetch -lucl -lsbuf -lssl -lcrypto +USEPRIVATELIB= ucl .include Modified: head/usr.sbin/pkg/config.c == --- head/usr.sbin/pkg/config.c Sun Feb 23 21:50:11 2014(r262399) +++ head/usr.sbin/pkg/config.c Sun Feb 23 21:55:07 2014(r262400) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include @@ -509,76 +509,45 @@ boolstr_to_bool(const char *str) } static void -config_parse(yaml_document_t *doc, yaml_node_t *node, pkg_conf_file_t conftype) +config_parse(ucl_object_t *obj, pkg_conf_file_t conftype) { - yaml_node_item_t *item; - yaml_node_pair_t *pair; - yaml_node_t *key, *val, *item_val; struct sbuf *buf = sbuf_new_auto(); + ucl_object_t *cur, *seq; + ucl_object_iter_t it = NULL, itseq = NULL; struct config_entry *temp_config; struct config_value *cv; + const char *key; int i; size_t j; - pair = node->data.mapping.pairs.start; - /* Temporary config for configs that may be disabled. */ temp_config = calloc(CONFIG_SIZE, sizeof(struct config_entry)); - while (pair < node->data.mapping.pairs.top) { - key = yaml_document_get_node(doc, pair->key); - val = yaml_document_get_node(doc, pair->value); - - /* -* ignoring silently empty keys can be empty lines -* or user mistakes -*/ - if (key->data.scalar.length <= 0) { - ++pair; - continue; - } - - /* -* silently skip on purpose to allow user to leave -* empty lines without complaining -*/ - if (val->type == YAML_NO_NODE || - (val->type == YAML_SCALAR_NODE && -val->data.scalar.length <= 0)) { - ++pair; + while ((cur = ucl_iterate_object(obj, &it, true))) { + key = ucl_object_key(cur); + if (key == NULL) continue; - } - sbuf_clear(buf); if (conftype == CONFFILE_PKG) { - for (j = 0; j < strlen(key->data.scalar.value); ++j) - sbuf_putc(buf, - toupper(key->data.scalar.value[j])); + for (j = 0; j < strlen(key); ++j) + sbuf_putc(buf, key[j]); sbuf_finish(buf); } else if (conftype == CONFFILE_REPO) { - /* The CONFFILE_REPO type is more restrictive. Only - parse known elements. */ - if (strcasecmp(key->data.scalar.value, "url") == 0) + if (strcasecmp(key, "url") == 0) sbuf_cpy(buf, "PACKAGESITE"); - else if (strcasecmp(key->data.scalar.value, - "mirror_type") == 0) + else if (strcasecmp(key, "mirror_type") == 0) sbuf_cpy(buf, "MIRROR_TYPE"); - else if (strcasecmp(key->data.scalar.value, - "signature_type") == 0) + else if (strcasecmp(key, "signature_type") == 0) sbuf_cpy(buf, "SIGNATURE_TYPE"); - else if (strcasecmp(key->data.scalar.value, - "fingerprints") == 0) + else if (strcasecmp(key, "fingerprints") == 0) sbuf_cpy(buf, "FINGERPRINTS"); - else if (strcasecmp(key->data.scalar.value, - "enabled") == 0) {
svn commit: r262401 - head/usr.sbin/pkg
Author: bapt Date: Sun Feb 23 22:04:03 2014 New Revision: 262401 URL: http://svnweb.freebsd.org/changeset/base/262401 Log: Update my copyright Modified: head/usr.sbin/pkg/config.c head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/config.c == --- head/usr.sbin/pkg/config.c Sun Feb 23 21:55:07 2014(r262400) +++ head/usr.sbin/pkg/config.c Sun Feb 23 22:04:03 2014(r262401) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013 Baptiste Daroussin + * Copyright (c) 2014 Baptiste Daroussin * Copyright (c) 2013 Bryan Drewery * All rights reserved. * Modified: head/usr.sbin/pkg/pkg.c == --- head/usr.sbin/pkg/pkg.c Sun Feb 23 21:55:07 2014(r262400) +++ head/usr.sbin/pkg/pkg.c Sun Feb 23 22:04:03 2014(r262401) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2013 Baptiste Daroussin + * Copyright (c) 2012-2014 Baptiste Daroussin * Copyright (c) 2013 Bryan Drewery * All rights reserved. * ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262402 - in head/sys/boot/ficl: . mips64
Author: rwatson Date: Sun Feb 23 22:10:25 2014 New Revision: 262402 URL: http://svnweb.freebsd.org/changeset/base/262402 Log: Give mips64 its own ficl configuration that sizes pointers/etc suitably for a 64-bit architecture, rather than trying to share the 32-bit MIPS ficl configuration. When building ficl on MIPS, don't conflate 32-bit and 64-bit ISAs -- unlike x86, we don't want a 32-bit loader on a 64-bit CPU. Use quite conservative code generation -- e.g., softfloat, no GOT, etc -- suitable for early boot. MFC after:3 weeks Sponsored by: DARPA, AFRL Added: head/sys/boot/ficl/mips64/ - copied from r262374, head/sys/boot/ficl/mips/ Modified: head/sys/boot/ficl/Makefile head/sys/boot/ficl/mips64/sysdep.h Modified: head/sys/boot/ficl/Makefile == --- head/sys/boot/ficl/Makefile Sun Feb 23 22:04:03 2014(r262401) +++ head/sys/boot/ficl/Makefile Sun Feb 23 22:10:25 2014(r262402) @@ -5,6 +5,8 @@ FICLDIR?= ${.CURDIR} .if !defined(FICL64) .PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} +.elif ${MACHINE_ARCH} == "mips64" +.PATH: ${FICLDIR}/${MACHINE_ARCH} .else .PATH: ${FICLDIR}/${MACHINE_CPUARCH} .endif @@ -21,12 +23,15 @@ CFLAGS.gcc+=-mpreferred-stack-boundary= .endif CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" CFLAGS+= -msoft-float .endif .if ${MACHINE} == "pc98" CFLAGS+= -Os -DPC98 .endif +.if ${MACHINE_CPUARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls +.endif .if HAVE_PNP CFLAGS+= -DHAVE_PNP .endif Modified: head/sys/boot/ficl/mips64/sysdep.h == --- head/sys/boot/ficl/mips/sysdep.hSun Feb 23 17:37:24 2014 (r262374) +++ head/sys/boot/ficl/mips64/sysdep.h Sun Feb 23 22:10:25 2014 (r262402) @@ -105,11 +105,11 @@ ** (11/2000: same for FICL_FLOAT) */ #if !defined FICL_INT -#define FICL_INT INT32 +#define FICL_INT long #endif #if !defined FICL_UNS -#define FICL_UNS UNS32 +#define FICL_UNS unsigned long #endif #if !defined FICL_FLOAT @@ -120,7 +120,7 @@ ** Ficl presently supports values of 32 and 64 for BITS_PER_CELL */ #if !defined BITS_PER_CELL -#define BITS_PER_CELL 32 +#define BITS_PER_CELL 64 #endif #if ((BITS_PER_CELL != 32) && (BITS_PER_CELL != 64)) @@ -366,7 +366,7 @@ typedef struct ** machine. 3 would be appropriate for a 64 bit machine. */ #if !defined FICL_ALIGN -#define FICL_ALIGN 2 +#define FICL_ALIGN 3 #define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1) #endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262403 - head/sys/boot/common
Author: rwatson Date: Sun Feb 23 22:11:26 2014 New Revision: 262403 URL: http://svnweb.freebsd.org/changeset/base/262403 Log: On mips64, built 64-bit ELF support. MFC after:3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/boot/common/Makefile.inc Modified: head/sys/boot/common/Makefile.inc == --- head/sys/boot/common/Makefile.inc Sun Feb 23 22:10:25 2014 (r262402) +++ head/sys/boot/common/Makefile.inc Sun Feb 23 22:11:26 2014 (r262403) @@ -18,6 +18,8 @@ SRCS+=load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c .elif ${MACHINE_CPUARCH} == "sparc64" SRCS+= load_elf64.c reloc_elf64.c +.elif ${MACHINE_ARCH} == "mips64" +SRCS+= load_elf64.c reloc_elf64.c .endif .if defined(LOADER_NET_SUPPORT) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262404 - head/sys/boot/fdt
Author: rwatson Date: Sun Feb 23 22:12:25 2014 New Revision: 262404 URL: http://svnweb.freebsd.org/changeset/base/262404 Log: When building FDT on MIPS, use softfloat. MFC after:3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/boot/fdt/Makefile Modified: head/sys/boot/fdt/Makefile == --- head/sys/boot/fdt/Makefile Sun Feb 23 22:11:26 2014(r262403) +++ head/sys/boot/fdt/Makefile Sun Feb 23 22:12:25 2014(r262404) @@ -16,7 +16,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/libf CFLAGS+= -ffreestanding -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" +.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" CFLAGS+= -msoft-float .endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262405 - head/usr.bin/kdump
Author: pjd Date: Sun Feb 23 22:13:16 2014 New Revision: 262405 URL: http://svnweb.freebsd.org/changeset/base/262405 Log: Capability rights are held by descriptors, not processes. Reported by: jonathan Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c == --- head/usr.bin/kdump/kdump.c Sun Feb 23 22:12:25 2014(r262404) +++ head/usr.bin/kdump/kdump.c Sun Feb 23 22:13:16 2014(r262405) @@ -1877,7 +1877,7 @@ ktrcapfail(struct ktr_cap_fail *ktr) /* operation on fd with insufficient capabilities */ printf("operation requires "); capname(&ktr->cap_needed); - printf(", process holds "); + printf(", descriptor holds "); capname(&ktr->cap_held); break; case CAPFAIL_INCREASE: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262406 - head/sys/boot/mips
Author: rwatson Date: Sun Feb 23 22:20:52 2014 New Revision: 262406 URL: http://svnweb.freebsd.org/changeset/base/262406 Log: Build the BERI boot loader on 64-bit MIPS (but not 32-bit MIPS). While these binaries aren't immediately useful on other MIPSes, still build them as part of mips64 world in order to expose them to tinderbox. MFC after:3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/boot/mips/Makefile Modified: head/sys/boot/mips/Makefile == --- head/sys/boot/mips/Makefile Sun Feb 23 22:13:16 2014(r262405) +++ head/sys/boot/mips/Makefile Sun Feb 23 22:20:52 2014(r262406) @@ -1,6 +1,11 @@ # $FreeBSD$ -.if 0 +# +# The BERI boot loader port works only on 64-bit MIPS; not a hard port to +# 32-bit if someone is interested. Build on all 64-bit MIPS platforms to +# ensure it gets adequate build-test coverage. +# +.if ${MACHINE_ARCH} == "mips64" SUBDIR=beri .endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262408 - head/sys/arm/ti/twl
Author: ian Date: Sun Feb 23 22:29:59 2014 New Revision: 262408 URL: http://svnweb.freebsd.org/changeset/base/262408 Log: Eliminate an unused-var warning by wrapping #if 0 around some tables of values that were probably entered "for completeness" from a datasheet, and for all I know may be useful/necessary some day. Modified: head/sys/arm/ti/twl/twl_vreg.c Modified: head/sys/arm/ti/twl/twl_vreg.c == --- head/sys/arm/ti/twl/twl_vreg.c Sun Feb 23 22:27:14 2014 (r262407) +++ head/sys/arm/ti/twl/twl_vreg.c Sun Feb 23 22:29:59 2014 (r262408) @@ -138,6 +138,7 @@ static const uint16_t twl4030_vsim_volta static const uint16_t twl4030_vdac_voltages[] = { 1200, 1300, 1800, 1800 }; +#if 0 /* vdd1, vdd2, vdio, not currently used. */ static const uint16_t twl4030_vdd1_voltages[] = { 800, 1450 }; @@ -147,6 +148,7 @@ static const uint16_t twl4030_vdd2_volta static const uint16_t twl4030_vio_voltages[] = { 1800, 1850 }; +#endif static const uint16_t twl4030_vintana2_voltages[] = { 2500, 2750 }; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262407 - in head: . contrib/libyaml lib lib/libyaml share/mk
Author: bapt Date: Sun Feb 23 22:27:14 2014 New Revision: 262407 URL: http://svnweb.freebsd.org/changeset/base/262407 Log: Remove libyaml, it has been replaced by libucl Deleted: head/contrib/libyaml/ head/lib/libyaml/ Modified: head/ObsoleteFiles.inc head/lib/Makefile head/share/mk/bsd.libnames.mk Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Sun Feb 23 22:20:52 2014(r262406) +++ head/ObsoleteFiles.inc Sun Feb 23 22:27:14 2014(r262407) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20140223: Remove libyaml +OLD_FILES+=usr/lib/private/libyaml.a +OLD_FILES+=usr/lib/private/libyaml.so +OLD_FILES+=usr/lib/private/libyaml.so.1 +OLD_FILES+=usr/lib/private/libyaml_p.a # 20140216: new clang import which bumps version from 3.3 to 3.4. OLD_FILES+=usr/bin/llvm-prof OLD_FILES+=usr/bin/llvm-ranlib Modified: head/lib/Makefile == --- head/lib/Makefile Sun Feb 23 22:20:52 2014(r262406) +++ head/lib/Makefile Sun Feb 23 22:27:14 2014(r262407) @@ -130,7 +130,6 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libvmmapi} \ libwrap \ liby \ - libyaml \ libz \ ${_atf} \ ${_clang} \ Modified: head/share/mk/bsd.libnames.mk == --- head/share/mk/bsd.libnames.mk Sun Feb 23 22:20:52 2014 (r262406) +++ head/share/mk/bsd.libnames.mk Sun Feb 23 22:27:14 2014 (r262407) @@ -169,7 +169,6 @@ LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBY?= ${DESTDIR}${LIBDIR}/liby.a -LIBYAML?= ${DESTDIR}${LIBPRIVATEDIR}/libyaml.a LIBYPCLNT?=${DESTDIR}${LIBDIR}/libypclnt.a LIBZ?= ${DESTDIR}${LIBDIR}/libz.a LIBZFS?= ${DESTDIR}${LIBDIR}/libzfs.a ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262409 - in head/sys/arm: include mv/armadaxp samsung/exynos ti/omap4
Author: ian Date: Sun Feb 23 22:35:18 2014 New Revision: 262409 URL: http://svnweb.freebsd.org/changeset/base/262409 Log: Move the declaration for mpentry() into a header file instead of pasting it into a bunch of different .c files. Remove declarations for the unused mptramp() function from everywhere except AramadaXP (and I think it's really not used there either, because the code that references it appears to be insanely does-nothing in nature). Modified: head/sys/arm/include/smp.h head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/samsung/exynos/exynos5_mp.c head/sys/arm/ti/omap4/omap4_mp.c Modified: head/sys/arm/include/smp.h == --- head/sys/arm/include/smp.h Sun Feb 23 22:29:59 2014(r262408) +++ head/sys/arm/include/smp.h Sun Feb 23 22:35:18 2014(r262409) @@ -15,6 +15,7 @@ #define IPI_TLB7 void init_secondary(int cpu); +void mpentry(void); void ipi_all_but_self(u_int ipi); void ipi_cpu(int cpu, u_int ipi); Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c == --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Sun Feb 23 22:29:59 2014 (r262408) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Sun Feb 23 22:35:18 2014 (r262409) @@ -96,7 +96,6 @@ platform_mp_init_secondary(void) { } -void mpentry(void); void mptramp(void); Modified: head/sys/arm/samsung/exynos/exynos5_mp.c == --- head/sys/arm/samsung/exynos/exynos5_mp.cSun Feb 23 22:29:59 2014 (r262408) +++ head/sys/arm/samsung/exynos/exynos5_mp.cSun Feb 23 22:35:18 2014 (r262409) @@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$"); #defineEXYNOS_SYSRAM 0x0202 -void mpentry(void); -void mptramp(void); - void platform_mp_init_secondary(void) { Modified: head/sys/arm/ti/omap4/omap4_mp.c == --- head/sys/arm/ti/omap4/omap4_mp.cSun Feb 23 22:29:59 2014 (r262408) +++ head/sys/arm/ti/omap4/omap4_mp.cSun Feb 23 22:35:18 2014 (r262409) @@ -38,9 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -void mpentry(void); -void mptramp(void); - void platform_mp_init_secondary(void) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262410 - head/lib/libucl
Author: bapt Date: Sun Feb 23 22:50:22 2014 New Revision: 262410 URL: http://svnweb.freebsd.org/changeset/base/262410 Log: Lower the level of WARNS to fix build with gcc Modified: head/lib/libucl/Makefile Modified: head/lib/libucl/Makefile == --- head/lib/libucl/MakefileSun Feb 23 22:35:18 2014(r262409) +++ head/lib/libucl/MakefileSun Feb 23 22:50:22 2014(r262410) @@ -13,7 +13,7 @@ SRCS= ucl_emitter.c \ .PATH: ${LIBUCL}/src -WARNS= 2 +WARNS= 1 CFLAGS+= -I${LIBUCL}/include \ -I${LIBUCL}/src \ -I${LIBUCL}/uthash ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262411 - head/sys/arm/arm
Author: ian Date: Sun Feb 23 22:52:48 2014 New Revision: 262411 URL: http://svnweb.freebsd.org/changeset/base/262411 Log: If the L2 cache type is PIPT, pass a physical address for a flush. While this is technically more correct, I don't think it much matters, because the only thing in the tree that calls cpu_flush_dcache() is md(4) and I'm > 99% sure it's bogus that it does so; md has no ability to do anything that can perturb data cache coherency. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c == --- head/sys/arm/arm/machdep.c Sun Feb 23 22:50:22 2014(r262410) +++ head/sys/arm/arm/machdep.c Sun Feb 23 22:52:48 2014(r262411) @@ -410,7 +410,11 @@ cpu_flush_dcache(void *ptr, size_t len) { cpu_dcache_wb_range((uintptr_t)ptr, len); +#ifdef ARM_L2_PIPT + cpu_l2cache_wb_range((uintptr_t)vtophys(ptr), len); +#else cpu_l2cache_wb_range((uintptr_t)ptr, len); +#endif } /* Get current clock frequency for the given cpu id. */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r262351 - head/sys/netinet6
On 23 Feb 2014, at 01:27 , Craig Rodrigues wrote: > Author: rodrigc > Date: Sun Feb 23 01:27:22 2014 > New Revision: 262351 > URL: http://svnweb.freebsd.org/changeset/base/262351 > > Log: > Remove KASSERT from in6p_lookup_mcast_ifp(). > > When the devel/jenkins port, version 1.551 was started, > the kernel would panic if INVARIANTS was enabled in the kernel config. > > Suggested by: bms This reads to me “we hit the assert, bms suggested to remove it”. Great! Caught a bug! Where is it? In no way the commit message tells me why? Why did we not hit the assert in the last n years? What has changed that we hit it now? Was the assert wrong from the beginning? Did we hit a real bug elsewhere and now lost the tracking for it? Could you please at least for the archives explain? > > Modified: > head/sys/netinet6/in6_mcast.c > > Modified: head/sys/netinet6/in6_mcast.c > == > --- head/sys/netinet6/in6_mcast.c Sun Feb 23 00:46:05 2014 > (r262350) > +++ head/sys/netinet6/in6_mcast.c Sun Feb 23 01:27:22 2014 > (r262351) > @@ -1781,8 +1781,6 @@ in6p_lookup_mcast_ifp(const struct inpcb > ("%s: not INP_IPV6 inpcb", __func__)); > KASSERT(gsin6->sin6_family == AF_INET6, > ("%s: not AF_INET6 group", __func__)); > - KASSERT(IN6_IS_ADDR_MULTICAST(&gsin6->sin6_addr), > - ("%s: not multicast", __func__)); > > ifp = NULL; > memset(&ro6, 0, sizeof(struct route_in6)); — Bjoern A. Zeeb ? ??? ??? ??: '??? ??? ?? ??? ?? ?? ??? ??? ??? ? ? ?? ?? ? ', ? ?, "??? ? ?? ?", ?.??? ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262413 - head/sys/arm/arm
Author: ian Date: Sun Feb 23 23:06:50 2014 New Revision: 262413 URL: http://svnweb.freebsd.org/changeset/base/262413 Log: Actually set the proper bit to indicate TTB shared memory. Submitted by: Juergan Weiss Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S == --- head/sys/arm/arm/locore.S Sun Feb 23 22:55:07 2014(r262412) +++ head/sys/arm/arm/locore.S Sun Feb 23 23:06:50 2014(r262413) @@ -425,7 +425,7 @@ Ltag: orr r0, r0, #PHYSADDR ldr r0, [r0] #if defined(SMP) - orr r0, r0, #0 /* Set TTB shared memory flag */ + orr r0, r0, #2 /* Set TTB shared memory flag */ #endif mcr p15, 0, r0, c2, c0, 0 /* Set TTB */ mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262414 - head/sys/dev/iwn
Author: adrian Date: Sun Feb 23 23:13:53 2014 New Revision: 262414 URL: http://svnweb.freebsd.org/changeset/base/262414 Log: Fix a typo. Modified: head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwnreg.h == --- head/sys/dev/iwn/if_iwnreg.hSun Feb 23 23:06:50 2014 (r262413) +++ head/sys/dev/iwn/if_iwnreg.hSun Feb 23 23:13:53 2014 (r262414) @@ -1530,7 +1530,7 @@ struct iwn_tx_stats { uint32_texp_ack; uint32_tack; uint32_tmsdu; - uint32_tbusrt_err1; + uint32_tburst_err1; uint32_tburst_err2; uint32_tcts_collision; uint32_tack_collision; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262417 - in head: share/man/man4 sys/dev/usb/input
Author: hselasky Date: Sun Feb 23 23:36:32 2014 New Revision: 262417 URL: http://svnweb.freebsd.org/changeset/base/262417 Log: Update ATP driver: - Support for double-tap and drag. - Support for 2-finger horizontal scrolling which translates to page-back/forward events. - Single finger tap is equivalent to a left-button press. - Two-finger taps are mapped to the right-button click. - Three fingers are mapped to middle button. - Add sysctl to disable single finger tapping. - Fix for multiple open of /dev/atp0 - Enhanced support for the Fountain/Geyser family by adding Geyser4. - Update manual page. Submitted by: Rohit Grover MFC after:2 weeks Modified: head/share/man/man4/atp.4 head/sys/dev/usb/input/atp.c Modified: head/share/man/man4/atp.4 == --- head/share/man/man4/atp.4 Sun Feb 23 23:33:11 2014(r262416) +++ head/share/man/man4/atp.4 Sun Feb 23 23:36:32 2014(r262417) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009 Rohit Grover . +.\" Copyright (c) 2014 Rohit Grover . .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2014 +.Dd February 23, 2014 .Dt ATP 4 .Os .Sh NAME @@ -41,8 +41,7 @@ your kernel configuration file: .Cd "device usb" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent atp_load="YES" @@ -50,24 +49,20 @@ atp_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the Apple Internal Trackpad -device found in many Apple laptops. +driver provides support for the Apple Internal Trackpad device found in many +Apple laptops. Older (Fountain/Geyser) and the newer (Wellspring) trackpad +families are all supported through a unified driver. +.Pp +The driver simulates a three\-button mouse using multi\-finger tap detection. +Single finger tap generates a left\-button click; two\-finger tap maps to the +middle button; whereas a three\-finger tap gets treated as a right button +click. +.Pp +There is support for 2-finger horizontal scrolling, which translates to +page\-back/forward events. .Pp -The driver simulates a three\-button mouse using multi\-finger tap -detection. -. -A single\-finger tap generates a left button click; -two\-finger tap maps to the middle button; whereas a three\-finger tap -gets treated as a right button click. -. A double\-tap followed by a drag is treated as a selection gesture; a virtual left\-button click is assumed for the lifespan of the drag. -. -.Nm -attempts to filter away activity at the horizontal edges of the -trackpad\-\-this is to keep unintentional palm movement from being -considered as user input. -. .Pp .Nm supports dynamic reconfiguration using @@ -76,6 +71,28 @@ through nodes under .Nm hw.usb.atp . Pointer sensitivity can be controlled using the sysctl tunable .Nm hw.usb.atp.scale_factor . +Smaller values of +.Fa scale_factor +result in faster movement. +. +A simple high-pass filter is used to reduce contributions +from small movements; the threshold for this filter may be controlled by +.Nm hw.usb.atp.small_movement . +. +The maximum tolerable duration of a touch gesture is controlled by +.Nm hw.usb.atp.touch_timeout +(in microseconds); beyond this period, touches are considered to be slides. +(This conversion also happens when a finger stroke accumulates at least +.Nm hw.usb.atp.slide_min_movement +movement (in mickeys). +. +The maximum time (in microseconds) to allow an association between a double- +tap and drag gesture may be controlled by +.Nm hw.usb.atp.double_tap_threshold . +. +Should one want to disable tap detection and rely only upon physical button +presses, set the following sysctl to a value of 2 +.Nm hw.usb.atp.tap_minimum . . .Sh HARDWARE The @@ -84,6 +101,8 @@ driver provides support for the followin .Pp .Bl -bullet -compact .It +PowerBooks, iBooks (IDs: 0x020e, 0x020f, 0x0210, 0x0214, 0x0215, 0x0216) +.It Core Duo MacBook & MacBook Pro (IDs: 0x0217, 0x0218, 0x0219) .It Core2 Duo MacBook & MacBook Pro (IDs: 0x021a, 0x021b, 0x021c) @@ -95,6 +114,14 @@ Core2 Duo MacBook3,1 (IDs: 0x0229, 0x022 15 inch PowerBook (IDs: 0x020e, 0x020f, 0x0215) .It 17 inch PowerBook (ID: 0x020d) +.It +Almost all recent Macbook-Pros and Airs (IDs: 0x0223, 0x0223, 0x0224, 0x0224, +0x0225, 0x0225, 0x0230, 0x0230, 0x0231, 0x0231, 0x0232, 0x0232, 0x0236, +0x0236, 0x0237, 0x0237, 0x0238, 0x0238, 0x023f, 0x023f, 0x0240, 0x0241, +0x0242, 0x0243, 0x0244, 0x0245, 0x0246, 0x0247, 0x0249, 0x024a, 0x024b, +0x024c, 0x024d, 0x024e, 0x0252, 0x0252, 0x0253, 0x0253, 0x0254, 0x0254, +0x0259, 0x025a, 0x025b, 0x0262, 0x0262, 0x0263, 0x0264, 0x0290, 0x0291, +0x0292) .El .Pp To discover the product\-id of a touchpad, search for '
svn commit: r262418 - head/usr.sbin/pkg
Author: bapt Date: Sun Feb 23 23:49:10 2014 New Revision: 262418 URL: http://svnweb.freebsd.org/changeset/base/262418 Log: Remove a useless newline, warnx already appends a newline Modified: head/usr.sbin/pkg/pkg.c Modified: head/usr.sbin/pkg/pkg.c == --- head/usr.sbin/pkg/pkg.c Sun Feb 23 23:36:32 2014(r262417) +++ head/usr.sbin/pkg/pkg.c Sun Feb 23 23:49:10 2014(r262418) @@ -299,7 +299,7 @@ parse_fingerprint(ucl_object_t *obj) fct = HASH_SHA256; if (fct == HASH_UNKNOWN) { - warnx("Unsupported hashing function: %s\n", function); + warnx("Unsupported hashing function: %s", function); return (NULL); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262419 - head/sys/arm/conf
Author: ian Date: Mon Feb 24 01:17:23 2014 New Revision: 262419 URL: http://svnweb.freebsd.org/changeset/base/262419 Log: Add an ident line. Modified: head/sys/arm/conf/IMX6 Modified: head/sys/arm/conf/IMX6 == --- head/sys/arm/conf/IMX6 Sun Feb 23 23:49:10 2014(r262418) +++ head/sys/arm/conf/IMX6 Mon Feb 24 01:17:23 2014(r262419) @@ -17,6 +17,7 @@ # # $FreeBSD$ +ident IMX6 include"../freescale/imx/std.imx6" optionsHZ=250 # Scheduling quantum is 4 milliseconds. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262420 - in head/sys/arm: arm include
Author: ian Date: Mon Feb 24 01:41:58 2014 New Revision: 262420 URL: http://svnweb.freebsd.org/changeset/base/262420 Log: Add a new cache maintenance function, idcache_inv_all, to the table, and implementations for each of the chips we support. Most chips up through armv6 can use the armv4 implementation which has a single coprocessor opcode for this operation. The rather more complex armv7 implementation comes from netbsd. Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/cpufunc_asm_armv4.S head/sys/arm/arm/cpufunc_asm_armv6.S head/sys/arm/arm/cpufunc_asm_armv7.S head/sys/arm/include/cpufunc.h Modified: head/sys/arm/arm/cpufunc.c == --- head/sys/arm/arm/cpufunc.c Mon Feb 24 01:17:23 2014(r262419) +++ head/sys/arm/arm/cpufunc.c Mon Feb 24 01:41:58 2014(r262420) @@ -146,6 +146,7 @@ struct cpu_functions arm7tdmi_cpufuncs = (void *)arm7tdmi_cache_flushID, /* dcache_inv_range */ (void *)cpufunc_nullop, /* dcache_wb_range */ + cpufunc_nullop, /* idcache_inv_all */ arm7tdmi_cache_flushID, /* idcache_wbinv_all*/ (void *)arm7tdmi_cache_flushID, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all*/ @@ -208,6 +209,7 @@ struct cpu_functions arm8_cpufuncs = { /*XXX*/(void *)arm8_cache_purgeID, /* dcache_inv_range */ (void *)arm8_cache_cleanID, /* dcache_wb_range */ + cpufunc_nullop, /* idcache_inv_all */ arm8_cache_purgeID, /* idcache_wbinv_all*/ (void *)arm8_cache_purgeID, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all*/ @@ -269,6 +271,7 @@ struct cpu_functions arm9_cpufuncs = { arm9_dcache_inv_range, /* dcache_inv_range */ arm9_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ arm9_idcache_wbinv_all, /* idcache_wbinv_all*/ arm9_idcache_wbinv_range, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all*/ @@ -331,6 +334,7 @@ struct cpu_functions armv5_ec_cpufuncs = armv5_ec_dcache_inv_range, /* dcache_inv_range */ armv5_ec_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ armv5_ec_idcache_wbinv_all, /* idcache_wbinv_all*/ armv5_ec_idcache_wbinv_range, /* idcache_wbinv_range */ @@ -392,6 +396,7 @@ struct cpu_functions sheeva_cpufuncs = { sheeva_dcache_inv_range,/* dcache_inv_range */ sheeva_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ armv5_ec_idcache_wbinv_all, /* idcache_wbinv_all*/ sheeva_idcache_wbinv_range, /* idcache_wbinv_all*/ @@ -454,6 +459,7 @@ struct cpu_functions arm10_cpufuncs = { arm10_dcache_inv_range, /* dcache_inv_range */ arm10_dcache_wb_range, /* dcache_wb_range */ + armv4_idcache_inv_all, /* idcache_inv_all */ arm10_idcache_wbinv_all,/* idcache_wbinv_all*/ arm10_idcache_wbinv_range, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all*/ @@ -515,6 +521,7 @@ struct cpu_functions pj4bv7_cpufuncs = { armv7_dcache_inv_range, /* dcache_inv_range */ armv7_dcache_wb_range, /* dcache_wb_range */ + armv7_idcache_inv_all, /* idcache_inv_all */ armv7_idcache_wbinv_all,/* idcache_wbinv_all*/ armv7_idcache_wbinv_range, /* idcache_wbinv_all*/ @@ -577,6 +584,7 @@ struct cpu_functions sa110_cpufuncs = { /*XXX*/sa1_cache_purgeD_rng, /* dcache_inv_range */ sa1_cache_cleanD_rng, /* dcache_wb_range */ + sa1_cache_flushID, /* idcache_inv_all */ sa1_cache_purgeID, /* idcache_wbinv_all*/ sa1_cache_purgeID_rng, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all*/ @@ -638,6 +646,7 @@ struct cpu_functions sa11x0_cpufuncs = { /*XXX*/sa1_cache_purgeD_rng, /* dcache_inv_range */ sa1_cache_cleanD_rng, /* dcache_wb_range */ + sa1_cache_flushID, /* idcache_inv_all */ sa1_cache_purgeID, /* idcache_wbinv_all*/ sa1_cache_purgeID_rng, /* idcache_wbinv_range */ cpufunc_nullop, /* l2cache_wbinv_all*/ @@ -699,6 +708,7 @@ struct cpu_functions ixp12x0_cpufuncs = /*XXX*/sa1_cache_purgeD_r
svn commit: r262421 - head/sys/dev/iwn
Author: adrian Date: Mon Feb 24 02:13:20 2014 New Revision: 262421 URL: http://svnweb.freebsd.org/changeset/base/262421 Log: Reserve a bit for statistics debugging. I'll hopefully use it soon. Modified: head/sys/dev/iwn/if_iwn_debug.h Modified: head/sys/dev/iwn/if_iwn_debug.h == --- head/sys/dev/iwn/if_iwn_debug.h Mon Feb 24 01:41:58 2014 (r262420) +++ head/sys/dev/iwn/if_iwn_debug.h Mon Feb 24 02:13:20 2014 (r262421) @@ -43,6 +43,7 @@ enum { IWN_DEBUG_TXRATE= 0x2000, /* TX rate debugging */ IWN_DEBUG_PWRSAVE = 0x4000, /* Power save operations */ IWN_DEBUG_SCAN = 0x8000, /* Scan related operations */ + IWN_DEBUG_STATS = 0x0001, /* Statistics updates */ IWN_DEBUG_REGISTER = 0x2000, /* print chipset register */ IWN_DEBUG_TRACE = 0x4000, /* Print begin and start driver function */ IWN_DEBUG_FATAL = 0x8000, /* fatal errors */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262422 - head/sys/dev/iwn
Author: adrian Date: Mon Feb 24 02:37:04 2014 New Revision: 262422 URL: http://svnweb.freebsd.org/changeset/base/262422 Log: Track and expose the latest statistics from the firmware. Tested: * Intel Centrino 6205 Added: head/sys/dev/iwn/if_iwn_ioctl.h (contents, props changed) Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c == --- head/sys/dev/iwn/if_iwn.c Mon Feb 24 02:13:20 2014(r262421) +++ head/sys/dev/iwn/if_iwn.c Mon Feb 24 02:37:04 2014(r262422) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct iwn_ident { uint16_tvendor; @@ -3140,6 +3141,16 @@ iwn5000_rx_calib_results(struct iwn_soft memcpy(sc->calibcmd[idx].buf, calib, len); } +static void +iwn_stats_update(struct iwn_softc *sc, struct iwn_calib_state *calib, +struct iwn_stats *stats) +{ + + /* XXX lock assert */ + memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats)); + sc->last_stat_valid = 1; +} + /* * Process an RX_STATISTICS or BEACON_STATISTICS firmware notification. * The latter is sent by the firmware after each received beacon. @@ -3172,6 +3183,9 @@ iwn_rx_statistics(struct iwn_softc *sc, __func__, desc->type); sc->calib_cnt = 0; /* Reset TX power calibration timeout. */ + /* Collect/track general statistics for reporting */ + iwn_stats_update(sc, calib, stats); + /* Test if temperature has changed. */ if (stats->general.temp != sc->rawtemp) { /* Convert "raw" temperature to degC. */ @@ -4712,6 +4726,19 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, cmd); break; + case SIOCGIWNSTATS: + IWN_LOCK(sc); + /* XXX validate permissions/memory/etc? */ + error = copyout(&sc->last_stat, ifr->ifr_data, + sizeof(struct iwn_stats)); + IWN_UNLOCK(sc); + break; + case SIOCZIWNSTATS: + IWN_LOCK(sc); + memset(&sc->last_stat, 0, sizeof(struct iwn_stats)); + IWN_UNLOCK(sc); + error = 0; + break; default: error = EINVAL; break; Added: head/sys/dev/iwn/if_iwn_ioctl.h == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iwn/if_iwn_ioctl.h Mon Feb 24 02:37:04 2014 (r262422) @@ -0,0 +1,25 @@ +/*- + * Copyright (c) 2014 Adrian Chadd + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#ifndef__IF_IWN_IOCTL_H__ +#define__IF_IWN_IOCTL_H__ + +/* XXX how should I pick appropriate ioctl numbers? */ +#defineSIOCGIWNSTATS _IOWR('i', 145, struct ifreq) +#defineSIOCZIWNSTATS _IOWR('i', 146, struct ifreq) + +#endif /* __IF_IWN_IOCTL_H__ */ Modified: head/sys/dev/iwn/if_iwnvar.h == --- head/sys/dev/iwn/if_iwnvar.hMon Feb 24 02:13:20 2014 (r262421) +++ head/sys/dev/iwn/if_iwnvar.hMon Feb 24 02:37:04 2014 (r262422) @@ -328,6 +328,22 @@ struct iwn_softc { int ctx; struct ieee80211vap *ivap[IWN_NUM_RXON_CTX]; + /* General statistics */ + /* +* The statistics are reset after each channel +* change. So it may be zeroed after things like +* a background scan. +* +* So for now, this is just a cheap hack to +* expose the last received statistics dump +* via an ioctl(). Later versions of this +* could expose the last 'n' messages, or just +* provide a pipeline for the firmware responses +* via something like BPF. +*/ + struct iwn_statslast_stat; + int last_stat_valid; + uint8_t uc_scan_progress; uint32_trawtemp; int
svn commit: r262423 - in head/tools/tools/iwn: . iwnstats
Author: adrian Date: Mon Feb 24 02:38:43 2014 New Revision: 262423 URL: http://svnweb.freebsd.org/changeset/base/262423 Log: Add a very basic and totally hacked up iwnstats program. This just extracts the current statistics out from the NIC via the new ioctl API and displays them. It runs every 100ms to hopefully grab the latest statistics. I may eventually teach this to use libstatfoo like what has been done for athstats and such; but this is good enough for now for people to do some basic investigation. Tested: * Intel Centrino 6205 Added: head/tools/tools/iwn/ head/tools/tools/iwn/Makefile (contents, props changed) head/tools/tools/iwn/iwnstats/ head/tools/tools/iwn/iwnstats/Makefile (contents, props changed) head/tools/tools/iwn/iwnstats/iwn_ioctl.c (contents, props changed) head/tools/tools/iwn/iwnstats/iwn_ioctl.h (contents, props changed) head/tools/tools/iwn/iwnstats/iwnstats.h (contents, props changed) head/tools/tools/iwn/iwnstats/main.c (contents, props changed) Added: head/tools/tools/iwn/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/iwn/Makefile Mon Feb 24 02:38:43 2014 (r262423) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR=iwnstats + +.include Added: head/tools/tools/iwn/iwnstats/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/iwn/iwnstats/Makefile Mon Feb 24 02:38:43 2014 (r262423) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +NO_MAN=1 + +.include + +.PATH: ${.CURDIR}/../../../../sys/dev/iwn/ + +CFLAGS+=-I${.CURDIR}/../../../../sys/dev/iwn/ +CFLAGS+=-I${.CURDIR}/../../../../sys/ + +PROG= iwnstats + +# Because of a clang preprocessor parser limitation causing this +# to not compile, use gcc for now. +#CC= gcc + +SRCS= main.c iwn_ioctl.c + +# CFLAGS.clang+= -fbracket-depth=512 + +.include Added: head/tools/tools/iwn/iwnstats/iwn_ioctl.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/iwn/iwnstats/iwn_ioctl.c Mon Feb 24 02:38:43 2014 (r262423) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2014 Adrian Chadd + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer, + *without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + *similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + *redistribution must be conditioned upon including a substantially + *similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ + +/* + * iwn ioctl API. + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + +#include "net80211/ieee80211_ioctl.h" +#include "net80211/ieee80211_radiotap.h" + +#include "if_iwn_ioctl.h" + +/* + * This contains the register definitions for iwn; including + * the statistics definitions. + */ +#include "if_iwnreg.h" + +#include "iwnstats.h" + +#include "iwn_ioctl.h" + +void +iwn_setifname(struct iwnstats *is, const char *ifname) +{ + + strncpy(is->ifr.ifr_name, ifname, sizeof (is->ifr.ifr_name)); +} + +void +iwn_zerostats(struct iwnstats *is) +{ + + if (ioctl(is->s, SIOCZIWNSTATS, &is->ifr) < 0) + err(-1, "ioctl: %s", is->ifr.ifr_name); +} + +int +iwn_collect(struct iwnstats *is) +{ + int err; + + is->ifr.ifr_data = (caddr_t) &is->st; + err = ioctl(is->s, SIOCGIWNSTATS, &is->ifr); + if (err < 0) + warn("ioctl: %s", is->ifr.ifr_name); + return (err); +} Added: head/tools/tools/iwn/iwnstats/iwn_ioctl.h ==
svn commit: r262424 - head/usr.sbin/pmcstat
Author: adrian Date: Mon Feb 24 02:43:58 2014 New Revision: 262424 URL: http://svnweb.freebsd.org/changeset/base/262424 Log: Add a new option - 'a ' - which spits out annotated callgraphs. '-m ' spits out the given stream into (eg, /dev/stdout). However, it only resolves the first symbol; it doesn't parse the entire callgraph. If it fails to lookup then it doesn't print anything. '-a' instead does a symbol and file:line lookup for each address in each callgraph and will happily print the address itself with no lookup information if it couldn't look things up. This makes it much easier to pull out individual records from a pmc data file and look at the callgraph information without having to hand-decode the addresses. Sponsored by: Netflix, Inc. Added: head/usr.sbin/pmcstat/pmcpl_annotate_cg.c (contents, props changed) head/usr.sbin/pmcstat/pmcpl_annotate_cg.h (contents, props changed) Modified: head/usr.sbin/pmcstat/Makefile head/usr.sbin/pmcstat/pmcstat.c head/usr.sbin/pmcstat/pmcstat.h head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/Makefile == --- head/usr.sbin/pmcstat/Makefile Mon Feb 24 02:38:43 2014 (r262423) +++ head/usr.sbin/pmcstat/Makefile Mon Feb 24 02:43:58 2014 (r262424) @@ -9,6 +9,7 @@ DPADD= ${LIBELF} ${LIBKVM} ${LIBPMC} ${L LDADD= -lelf -lkvm -lpmc -lm -lncurses SRCS= pmcstat.c pmcstat.h pmcstat_log.c \ -pmcpl_callgraph.c pmcpl_gprof.c pmcpl_annotate.c pmcpl_calltree.c +pmcpl_callgraph.c pmcpl_gprof.c pmcpl_annotate.c \ +pmcpl_annotate_cg.c pmcpl_calltree.c .include Added: head/usr.sbin/pmcstat/pmcpl_annotate_cg.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pmcstat/pmcpl_annotate_cg.c Mon Feb 24 02:43:58 2014 (r262424) @@ -0,0 +1,126 @@ +/*- + * Copyright (c) 2005-2007, Joseph Koshy + * Copyright (c) 2007 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by A. Joseph Koshy under + * sponsorship from the FreeBSD Foundation and Google, Inc. + * + * 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. + */ + +/* + * Transform a hwpmc(4) log into human readable form, and into + * gprof(1) compatible profiles. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pmcstat.h" +#include "pmcstat_log.h" +#include "pmcpl_annotate_cg.h" + +/* + * Record a callchain. + */ + +void +pmcpl_annotate_cg_process(struct pmcstat_process *pp, struct pmcstat_pmcrecord *pmcr, +uint32_t nsamples, uintfptr_t *cc, int usermode, uint32_t cpu) +{ + struct pmcstat_pcmap *map; + struct pmcstat_symbol *sym; + uintfptr_t newpc; + struct pmcstat_image *image; + int i; + char filename[PATH_MAX], funcname[PATH_MAX]; + unsigned sline; + + (void) pmcr; (void) nsamples; (void) usermode; (void) cpu; + + for (i = 0; i < (int) nsamples; i++) { + map = NULL; + sym = NULL; + image = NULL; + filename[0] = '\0'; + funcname[0] = '\0'; + sline = 0; + + map = pmcstat_process_find_map(usermode ? pp : pmcstat_kernproc, cc[i]); + if (map != NULL) { + assert(c
svn commit: r262425 - head/usr.sbin/pmcstat
Author: adrian Date: Mon Feb 24 02:47:47 2014 New Revision: 262425 URL: http://svnweb.freebsd.org/changeset/base/262425 Log: Add correct attributions. Sponsored by: Netflix, Inc. Modified: head/usr.sbin/pmcstat/pmcpl_annotate_cg.c head/usr.sbin/pmcstat/pmcpl_annotate_cg.h Modified: head/usr.sbin/pmcstat/pmcpl_annotate_cg.c == --- head/usr.sbin/pmcstat/pmcpl_annotate_cg.c Mon Feb 24 02:43:58 2014 (r262424) +++ head/usr.sbin/pmcstat/pmcpl_annotate_cg.c Mon Feb 24 02:47:47 2014 (r262425) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2005-2007, Joseph Koshy * Copyright (c) 2007 The FreeBSD Foundation + * Copyright (c) 2014, Adrian Chadd, Netflix Inc. * All rights reserved. * * Portions of this software were developed by A. Joseph Koshy under Modified: head/usr.sbin/pmcstat/pmcpl_annotate_cg.h == --- head/usr.sbin/pmcstat/pmcpl_annotate_cg.h Mon Feb 24 02:43:58 2014 (r262424) +++ head/usr.sbin/pmcstat/pmcpl_annotate_cg.h Mon Feb 24 02:47:47 2014 (r262425) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2005-2007, Joseph Koshy * Copyright (c) 2007 The FreeBSD Foundation + * Copyright (c) 2014, Adrian Chadd, Netflix Inc. * All rights reserved. * * Portions of this software were developed by A. Joseph Koshy under ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262426 - head/sys/arm/arm
Author: ian Date: Mon Feb 24 03:47:39 2014 New Revision: 262426 URL: http://svnweb.freebsd.org/changeset/base/262426 Log: Invalidate caches immediately upon entry to init_secondary(). Also set the Bufferable bit in the PDE entries of the secondary processor startup pagetables. The caches really need to be invalidated even earlier than this, but this is a big step in the right direction. The invalidate needs to happen before the MMU is enabled, which means it has to be called from asm code that's running with physical addressing. Fixing that will be handled in a future change. Modified: head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/mp_machdep.c == --- head/sys/arm/arm/mp_machdep.c Mon Feb 24 02:47:47 2014 (r262425) +++ head/sys/arm/arm/mp_machdep.c Mon Feb 24 03:47:39 2014 (r262426) @@ -128,10 +128,10 @@ cpu_mp_start(void) bzero((void *)temp_pagetable_va, L1_TABLE_SIZE); for (addr = arm_physmem_kernaddr; addr <= addr_end; addr += L1_S_SIZE) { ((int *)(temp_pagetable_va))[addr >> L1_S_SHIFT] = - L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; + L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_B|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; ((int *)(temp_pagetable_va))[(addr - arm_physmem_kernaddr + KERNVIRTADDR) >> L1_S_SHIFT] = - L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; + L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_B|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; } #if defined(CPU_MV_PJ4B) @@ -173,6 +173,8 @@ init_secondary(int cpu) uint32_t loop_counter; int start = 0, end = 0; + cpu_idcache_inv_all(); + cpu_setup(NULL); setttb(pmap_pa); cpu_tlb_flushID(); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262427 - head/sys/arm/freescale/imx
Author: ian Date: Mon Feb 24 03:51:31 2014 New Revision: 262427 URL: http://svnweb.freebsd.org/changeset/base/262427 Log: Add the bits needed to run SMP on imx6. The 'option SMP' isn't added to the kernel config yet; people wanting to test this have to opt-in for now. Added: head/sys/arm/freescale/imx/imx6_mp.c (contents, props changed) Modified: head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/std.imx6 Modified: head/sys/arm/freescale/imx/files.imx6 == --- head/sys/arm/freescale/imx/files.imx6 Mon Feb 24 03:47:39 2014 (r262426) +++ head/sys/arm/freescale/imx/files.imx6 Mon Feb 24 03:51:31 2014 (r262427) @@ -22,6 +22,7 @@ arm/freescale/imx/common.cstandard arm/freescale/imx/imx6_anatop.cstandard arm/freescale/imx/imx6_ccm.c standard arm/freescale/imx/imx6_machdep.c standard +arm/freescale/imx/imx6_mp.coptional smp arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_machdep.cstandard arm/freescale/imx/imx_gpt.cstandard Added: head/sys/arm/freescale/imx/imx6_mp.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_mp.cMon Feb 24 03:51:31 2014 (r262427) @@ -0,0 +1,166 @@ +/*- + * Copyright (c) 2014 Juergen Weiss + * Copyright (c) 2014 Ian Lepore + * 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 ``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 + +#defineSCU_PHYSBASE0x00a0 +#defineSCU_SIZE0x1000 + +#defineSCU_CONTROL_REG 0x00 +#define SCU_CONTROL_ENABLE (1 << 0) +#defineSCU_CONFIG_REG 0x04 +#define SCU_CONFIG_REG_NCPU_MASK0x03 +#defineSCU_CPUPOWER_REG0x08 +#defineSCU_INV_TAGS_REG0x0c +#defineSCU_DIAG_CONTROL0x30 +#define SCU_DIAG_DISABLE_MIGBIT (1 << 0) +#defineSCU_FILTER_START_REG0x40 +#defineSCU_FILTER_END_REG 0x44 +#defineSCU_SECURE_ACCESS_REG 0x50 +#defineSCU_NONSECURE_ACCESS_REG0x54 + +#defineSRC_PHYSBASE0x020d8000 +#define SRC_SIZE 0x4000 +#defineSRC_CONTROL_REG 0x00 +#defineSRC_CONTROL_C1ENA_SHIFT 22/* Bit for Core 1 enable */ +#defineSRC_CONTROL_C1RST_SHIFT 14/* Bit for Core 1 reset */ +#defineSRC_GPR0_C1FUNC 0x20/* Register for Core 1 entry func */ +#defineSRC_GPR1_C1ARG 0x24/* Register for Core 1 entry arg */ + +void +platform_mp_init_secondary(void) +{ + + gic_init_secondary(); +} + +void +platform_mp_setmaxid(void) +{ + bus_space_handle_t scu; + uint32_t val; + + /* If we've already set the global vars don't bother to do it again. */ + if (mp_ncpus != 0) + return; + + if (bus_space_map(fdtbus_bs_tag, SCU_PHYSBASE, SCU_SIZE, 0, &scu) != 0) + panic("Couldn't map the SCU\n"); + val = bus_space_read_4(fdtbus_bs_tag, scu, SCU_CONFIG_REG); + bus_space_unmap(fdtbus_bs_tag, scu, SCU_SIZE); + + mp_maxid = (val & SCU_CONFIG_REG_NCPU_MASK); + mp_ncpus = mp_maxid + 1; +} + +int +platform_mp_probe(void) +{ + + /* I think platf
svn commit: r262428 - head/sys/dev/etherswitch/arswitch
Author: adrian Date: Mon Feb 24 04:43:23 2014 New Revision: 262428 URL: http://svnweb.freebsd.org/changeset/base/262428 Log: * Ensure enough ports/phys are available for both the AR8327 and previous switches. * Add some new VLAN HAL methods that will be used by the VLAN configuration code. The AR933x and later switches use slightly different register layouts (even though the driver currently doesn't support it.) Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h == --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Mon Feb 24 03:51:31 2014(r262427) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Mon Feb 24 04:43:23 2014(r262428) @@ -45,6 +45,9 @@ typedef enum { #defineAR8X16_IS_SWITCH(_sc, _type) \ (!!((_sc)->sc_switchtype == AR8X16_SWITCH_ ## _type)) +#define ARSWITCH_NUM_PORTS MAX(AR8327_NUM_PORTS, AR8X16_NUM_PORTS) +#define ARSWITCH_NUM_PHYS MAX(AR8327_NUM_PHYS, AR8X16_NUM_PHYS) + struct arswitch_softc { struct mtx sc_mtx; /* serialize access to softc */ device_tsc_dev; @@ -59,9 +62,10 @@ struct arswitch_softc { int chip_rev; int mii_lo_first; ar8x16_switch_type sc_switchtype; - char*ifname[AR8X16_NUM_PHYS]; - device_tmiibus[AR8X16_NUM_PHYS]; - struct ifnet*ifp[AR8X16_NUM_PHYS]; + /* should be the max of both pre-AR8327 and AR8327 ports */ + char*ifname[ARSWITCH_NUM_PHYS]; + device_tmiibus[ARSWITCH_NUM_PHYS]; + struct ifnet*ifp[ARSWITCH_NUM_PHYS]; struct callout callout_tick; etherswitch_info_t info; @@ -82,6 +86,15 @@ struct arswitch_softc { etherswitch_port_t *); int (* arswitch_port_vlan_get) (struct arswitch_softc *, etherswitch_port_t *); + void (* arswitch_vlan_init_hw) (struct arswitch_softc *); + int (* arswitch_vlan_getvgroup) (struct arswitch_softc *, + etherswitch_vlangroup_t *); + int (* arswitch_vlan_setvgroup) (struct arswitch_softc *, + etherswitch_vlangroup_t *); + int (* arswitch_vlan_get_pvid) (struct arswitch_softc *, int, + int *); + int (* arswitch_vlan_set_pvid) (struct arswitch_softc *, int, + int); } hal; }; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262429 - head/sys/dev/etherswitch/arswitch
Author: adrian Date: Mon Feb 24 04:44:28 2014 New Revision: 262429 URL: http://svnweb.freebsd.org/changeset/base/262429 Log: Methodize the arswitch VLAN routines. These differ per chipset family in subtle and evil ways. It becomes very noticable on the AR8327 where the layout is just plain wrong. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.c head/sys/dev/etherswitch/arswitch/arswitch_vlans.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c == --- head/sys/dev/etherswitch/arswitch/arswitch.cMon Feb 24 04:43:23 2014(r262428) +++ head/sys/dev/etherswitch/arswitch/arswitch.cMon Feb 24 04:44:28 2014(r262429) @@ -222,7 +222,7 @@ arswitch_set_vlan_mode(struct arswitch_s }; /* Reset VLANs. */ - arswitch_reset_vlans(sc); + sc->hal.arswitch_vlan_init_hw(sc); return (0); } @@ -274,6 +274,11 @@ arswitch_attach(device_t dev) sc->hal.arswitch_port_init = ar8xxx_port_init; sc->hal.arswitch_port_vlan_setup = ar8xxx_port_vlan_setup; sc->hal.arswitch_port_vlan_get = ar8xxx_port_vlan_get; + sc->hal.arswitch_vlan_init_hw = ar8xxx_reset_vlans; + sc->hal.arswitch_vlan_getvgroup = ar8xxx_getvgroup; + sc->hal.arswitch_vlan_setvgroup = ar8xxx_setvgroup; + sc->hal.arswitch_vlan_get_pvid = ar8xxx_get_pvid; + sc->hal.arswitch_vlan_set_pvid = ar8xxx_set_pvid; /* * Attach switch related functions @@ -538,7 +543,7 @@ ar8xxx_port_vlan_get(struct arswitch_sof ARSWITCH_LOCK(sc); /* Retrieve the PVID. */ - arswitch_get_pvid(sc, p->es_port, &p->es_pvid); + sc->hal.arswitch_vlan_get_pvid(sc, p->es_port, &p->es_pvid); /* Port flags. */ reg = arswitch_readreg(sc->sc_dev, AR8X16_REG_PORT_CTRL(p->es_port)); @@ -602,7 +607,7 @@ ar8xxx_port_vlan_setup(struct arswitch_s /* Set the PVID. */ if (p->es_pvid != 0) - arswitch_set_pvid(sc, p->es_port, p->es_pvid); + sc->hal.arswitch_vlan_set_pvid(sc, p->es_port, p->es_pvid); /* Mutually exclusive. */ if (p->es_flags & ETHERSWITCH_PORT_ADDTAG && @@ -730,6 +735,22 @@ arswitch_setconf(device_t dev, etherswit return (0); } +static int +arswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *e) +{ + struct arswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.arswitch_vlan_getvgroup(sc, e)); +} + +static int +arswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *e) +{ + struct arswitch_softc *sc = device_get_softc(dev); + + return (sc->hal.arswitch_vlan_setvgroup(sc, e)); +} + static device_method_t arswitch_methods[] = { /* Device interface */ DEVMETHOD(device_probe, arswitch_probe), Modified: head/sys/dev/etherswitch/arswitch/arswitch_vlans.c == --- head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Mon Feb 24 04:43:23 2014(r262428) +++ head/sys/dev/etherswitch/arswitch/arswitch_vlans.c Mon Feb 24 04:44:28 2014(r262429) @@ -171,7 +171,7 @@ arswitch_set_port_vlan(struct arswitch_s * Reset vlans to default state. */ void -arswitch_reset_vlans(struct arswitch_softc *sc) +ar8xxx_reset_vlans(struct arswitch_softc *sc) { uint32_t ports; int i, j; @@ -220,7 +220,7 @@ arswitch_reset_vlans(struct arswitch_sof sc->vid[0] = 1; /* Set PVID for everyone. */ for (i = 0; i <= sc->numphys; i++) - arswitch_set_pvid(sc, i, sc->vid[0]); + sc->hal.arswitch_vlan_set_pvid(sc, i, sc->vid[0]); ports = 0; for (i = 0; i <= sc->numphys; i++) ports |= (1 << i); @@ -259,12 +259,10 @@ arswitch_reset_vlans(struct arswitch_sof } int -arswitch_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) +ar8xxx_getvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) { - struct arswitch_softc *sc; int err; - sc = device_get_softc(dev); ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); if (vg->es_vlangroup > sc->info.es_nvlangroups) @@ -305,12 +303,10 @@ arswitch_getvgroup(device_t dev, ethersw } int -arswitch_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) +ar8xxx_setvgroup(struct arswitch_softc *sc, etherswitch_vlangroup_t *vg) { - struct arswitch_softc *sc; int err, vid; - sc = device_get_softc(dev); ARSWITCH_LOCK_ASSERT(sc, MA_NOTOWNED); /* Check VLAN mode. */ @@ -362,7 +358,7 @@ arswitch_setvgroup(device_t dev, ethersw } int -arswitch_get_pvid(struct arswitch_softc *sc, int port, int *pvid) +ar8xxx_get_pvid(struct arswitch_softc *sc, int port, int *pvid) { uint32_t reg; @@ -373,7 +369,
svn commit: r262431 - head/sys/dev/etherswitch/arswitch
Author: adrian Date: Mon Feb 24 04:47:27 2014 New Revision: 262431 URL: http://svnweb.freebsd.org/changeset/base/262431 Log: Link the AR8327 to the build. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c == --- head/sys/dev/etherswitch/arswitch/arswitch.cMon Feb 24 04:47:16 2014(r262430) +++ head/sys/dev/etherswitch/arswitch/arswitch.cMon Feb 24 04:47:27 2014(r262431) @@ -66,6 +66,7 @@ #include #include #include +#include #include #include "mdio_if.h" @@ -293,6 +294,8 @@ arswitch_attach(device_t dev) ar8226_attach(sc); else if (AR8X16_IS_SWITCH(sc, AR8316)) ar8316_attach(sc); + else if (AR8X16_IS_SWITCH(sc, AR8327)) + ar8327_attach(sc); else return (ENXIO); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262430 - in head/sys: conf dev/etherswitch/arswitch
Author: adrian Date: Mon Feb 24 04:47:16 2014 New Revision: 262430 URL: http://svnweb.freebsd.org/changeset/base/262430 Log: Add initial AR8327 support. This is (almost!) enough to actually probe, attach, configure a default port group and do some basic work. It's also totally hard-coded for the Qualcomm Atheros DB120 board - it doesn't yet have any of the code from OpenWRT which parses extra configuration data to know how to program the switch. The LED stuff is also missing. But, it's enough to facilitate board, PHY, switch and VLAN bringup, so I am committing it now. Tested: * Qualcomm Atheros DB120 Obtained from:OpenWRT Added: head/sys/dev/etherswitch/arswitch/arswitch_8327.c (contents, props changed) head/sys/dev/etherswitch/arswitch/arswitch_8327.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files == --- head/sys/conf/files Mon Feb 24 04:44:28 2014(r262429) +++ head/sys/conf/files Mon Feb 24 04:47:16 2014(r262430) @@ -1343,6 +1343,7 @@ dev/etherswitch/arswitch/arswitch_phy.c dev/etherswitch/arswitch/arswitch_8216.c optional arswitch dev/etherswitch/arswitch/arswitch_8226.c optional arswitch dev/etherswitch/arswitch/arswitch_8316.c optional arswitch +dev/etherswitch/arswitch/arswitch_8327.c optional arswitch dev/etherswitch/arswitch/arswitch_7240.c optional arswitch dev/etherswitch/arswitch/arswitch_9340.c optional arswitch dev/etherswitch/arswitch/arswitch_vlans.c optional arswitch Added: head/sys/dev/etherswitch/arswitch/arswitch_8327.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Mon Feb 24 04:47:16 2014(r262430) @@ -0,0 +1,473 @@ +/*- + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2014 Adrian Chadd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "mdio_if.h" +#include "miibus_if.h" +#include "etherswitch_if.h" + +static void +ar8327_phy_fixup(struct arswitch_softc *sc, int phy) +{ + + switch (sc->chip_rev) { + case 1: + /* For 100M waveform */ + arswitch_writedbg(sc->sc_dev, phy, 0, 0x02ea); + /* Turn on Gigabit clock */ + arswitch_writedbg(sc->sc_dev, phy, 0x3d, 0x68a0); + break; + + case 2: + arswitch_writemmd(sc->sc_dev, phy, 0x7, 0x3c); + arswitch_writemmd(sc->sc_dev, phy, 0x4007, 0x0); + /* fallthrough */ + case 4: + arswitch_writemmd(sc->sc_dev, phy, 0x3, 0x800d); + arswitch_writemmd(sc->sc_dev, phy, 0x4003, 0x803f); + + arswitch_writedbg(sc->sc_dev, phy, 0x3d, 0x6860); + arswitch_writedbg(sc->sc_dev, phy, 0x5, 0x2c46); + arswitch_writedbg(sc->sc_dev, phy, 0x3c, 0x6000); + break; + } +} + +static uint32_t +ar8327_get_pad_cfg(struct ar8327_pad_cfg *cfg) +{ + uint32_t t; + + if (!cfg) + return (0); + + t = 0; + switch (cfg->mode) { + case AR8327_PAD_NC: + break; + + case AR8327_PAD_MAC2MAC_MII: +
svn commit: r262432 - head/sys/mips/conf
Author: adrian Date: Mon Feb 24 04:48:46 2014 New Revision: 262432 URL: http://svnweb.freebsd.org/changeset/base/262432 Log: Add the AR8327 bits to the DB120 config file. There's plenty of hints that I haven't yet fleshed out and are hardcoded in arswitch_8327.c. They're listed here (from OpenWRT) for completeness. This is enough to get the thing up, running and pinging. Note that the mdiobus for the on-switch switch changes - the AR8327 probes first, which exposes mdio1, and thus the arge1 mdiobus will probe and attach as mdio2. That is what the AR9344 on-chip switch has to attach to. Tested: * Qualcomm Atheros DB120 Modified: head/sys/mips/conf/DB120.hints Modified: head/sys/mips/conf/DB120.hints == --- head/sys/mips/conf/DB120.hints Mon Feb 24 04:47:27 2014 (r262431) +++ head/sys/mips/conf/DB120.hints Mon Feb 24 04:48:46 2014 (r262432) @@ -14,13 +14,37 @@ hint.argemdio.0.order=0 hint.ar934x_gmac.0.gmac_cfg=0x41 # GMAC0 here - connected to an AR8327 -#hint.arswitch.0.at="mdio0" -#hint.arswitch.0.is_7240=0 -#hint.arswitch.0.is_9340=0 # not the internal switch! -#hint.arswitch.0.numphys=5 -#hint.arswitch.0.phy4cpu=0 -#hint.arswitch.0.is_rgmii=1 -#hint.arswitch.0.is_gmii=0 +hint.arswitch.0.at="mdio0" +hint.arswitch.0.is_7240=0 +hint.arswitch.0.is_9340=0 # not the internal switch! +hint.arswitch.0.numphys=5 +hint.arswitch.0.phy4cpu=0 +hint.arswitch.0.is_rgmii=1 +hint.arswitch.0.is_gmii=0 +# XXX other AR8327 configuration parameters + +# pad0 cfg: +# .mode = AR8327_PAD_MAC_RGMII, +# .txclk_delay_en = true, +# .rxclk_delay_en = true, +# .txclk_delay_sel = AR8327_CLK_DELAY_SEL1, +# .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2, + +# .led_ctrl0 = 0x, +# .led_ctrl1 = 0xc737c737, +# .led_ctrl2 = 0x, +# .led_ctrl3 = 0x00c30c00, +# .open_drain = true, + +# .port0_cfg = { +# .force_link = 1, +# .speed = AR8327_PORT_SPEED_1000, +# .duplex = 1, +# .txpause = 1, +# .rxpause = 1, +# }, + +# port6 cfg? # XXX OpenWRT DB120 BSP doesn't have media/duplex set? hint.arge.0.phymask=0x0 @@ -36,7 +60,9 @@ hint.argemdio.1.msize=0x1000 hint.argemdio.1.order=0 # Embedded switch on the AR9344 -hint.arswitch.1.at="mdio1" +# mdio1 is actually created as the AR8327 internal bus; so +# this pops up as mdio2. +hint.arswitch.1.at="mdio2" hint.arswitch.1.is_7240=0 hint.arswitch.1.is_9340=1 hint.arswitch.1.numphys=4 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r262433 - head/sys/dev/etherswitch/arswitch
Author: adrian Date: Mon Feb 24 05:55:00 2014 New Revision: 262433 URL: http://svnweb.freebsd.org/changeset/base/262433 Log: Add in port0/port6 configuration as part of the platform data code path. It's still hardcoded (for db120) but it is now hardcoded in all the same place (ie, the pdata path.) The port config/status code now checks port0/port6 as appropriate to configure things. Tested: * Qualcomm Atheros DB120, AR8327 switch. Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c == --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Mon Feb 24 04:48:46 2014(r262432) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Mon Feb 24 05:55:00 2014(r262433) @@ -123,7 +123,7 @@ ar8327_get_pad_cfg(struct ar8327_pad_cfg t = AR8327_PAD_SGMII_EN; /* -* WAR for the QUalcomm Atheros AP136 board. +* WAR for the Qualcomm Atheros AP136 board. * It seems that RGMII TX/RX delay settings needs to be * applied for SGMII mode as well, The ethernet is not * reliable without this. @@ -183,6 +183,39 @@ ar8327_get_pad_cfg(struct ar8327_pad_cfg return (t); } + +/* + * Map the hard-coded port config from the switch setup to + * the chipset port config (status, duplex, flow, etc.) + */ +static uint32_t +ar8327_get_port_init_status(struct ar8327_port_cfg *cfg) +{ + uint32_t t; + + if (!cfg->force_link) + return (AR8X16_PORT_STS_LINK_AUTO); + + t = AR8X16_PORT_STS_TXMAC | AR8X16_PORT_STS_RXMAC; + t |= cfg->duplex ? AR8X16_PORT_STS_DUPLEX : 0; + t |= cfg->rxpause ? AR8X16_PORT_STS_RXFLOW : 0; + t |= cfg->txpause ? AR8X16_PORT_STS_TXFLOW : 0; + + switch (cfg->speed) { + case AR8327_PORT_SPEED_10: + t |= AR8X16_PORT_STS_SPEED_10; + break; + case AR8327_PORT_SPEED_100: + t |= AR8X16_PORT_STS_SPEED_100; + break; + case AR8327_PORT_SPEED_1000: + t |= AR8X16_PORT_STS_SPEED_1000; + break; + } + + return (t); +} + /* * Initialise the ar8327 specific hardware features from * the hints provided in the boot environment. @@ -191,13 +224,23 @@ static int ar8327_init_pdata(struct arswitch_softc *sc) { struct ar8327_pad_cfg pc; + struct ar8327_port_cfg port_cfg; uint32_t t; /* XXX hard-coded DB120 defaults for now! */ /* Port 0 - rgmii; 1000/full */ + bzero(&port_cfg, sizeof(port_cfg)); + port_cfg.speed = AR8327_PORT_SPEED_1000; + port_cfg.duplex = 1; + port_cfg.rxpause = 1; + port_cfg.txpause = 1; + port_cfg.force_link = 1; + sc->ar8327.port0_status = ar8327_get_port_init_status(&port_cfg); /* Port 6 - ignore */ + bzero(&port_cfg, sizeof(port_cfg)); + sc->ar8327.port6_status = ar8327_get_port_init_status(&port_cfg); /* Pad 0 */ bzero(&pc, sizeof(pc)); @@ -224,45 +267,12 @@ ar8327_init_pdata(struct arswitch_softc t = ar8327_get_pad_cfg(&pc); arswitch_writereg(sc->sc_dev, AR8327_REG_PAD6_MODE, t); - /* LED config */ + /* XXX LED config */ - /* SGMII config */ - return (0); -} + /* XXX SGMII config */ -#if 0 -/* - * Map the hard-coded port config from the switch setup to - * the chipset port config (status, duplex, flow, etc.) - */ -static uint32_t -ar8327_get_port_init_status(struct ar8327_port_cfg *cfg) -{ - uint32_t t; - - if (!cfg->force_link) - return (AR8X16_PORT_STS_LINK_AUTO); - - t = AR8X16_PORT_STS_TXMAC | AR8X16_PORT_STS_RXMAC; - t |= cfg->duplex ? AR8X16_PORT_STS_DUPLEX : 0; - t |= cfg->rxpause ? AR8X16_PORT_STS_RXFLOW : 0; - t |= cfg->txpause ? AR8X16_PORT_STS_TXFLOW : 0; - - switch (cfg->speed) { - case AR8327_PORT_SPEED_10: - t |= AR8X16_PORT_STS_SPEED_10; - break; - case AR8327_PORT_SPEED_100: - t |= AR8X16_PORT_STS_SPEED_100; - break; - case AR8327_PORT_SPEED_1000: - t |= AR8X16_PORT_STS_SPEED_1000; - break; - } - - return (t); + return (0); } -#endif static int ar8327_hw_setup(struct arswitch_softc *sc) @@ -331,15 +341,12 @@ ar8327_port_init(struct arswitch_softc * { uint32_t t; - /* XXX TODO: need to initialise port0/port6 status in pdata */ - -#if 0 -if (port == AR8216_PORT_CPU) -t = sc->chip_data.ar8327.port0_status; -else if (port == 6) -t = sc->chip_data.ar8327.port6_status; + if (port == AR8X16_PORT_CPU) + t = sc->ar8327.port0_status; + else if (