Date: Thu, 5 Jan 2017 20:50:45 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r311460 - in projects/clang400-import: contrib/bsnmp/lib contrib/bsnmp/snmp_usm contrib/bsnmp/snmpd contrib/netbsd-tests/fs/tmpfs contrib/tcp_wrappers etc/mtree lib/libproc sys/arm/conf... Message-ID: <201701052050.v05Kojeq081358@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Thu Jan 5 20:50:44 2017 New Revision: 311460 URL: https://svnweb.freebsd.org/changeset/base/311460 Log: Merge ^/head r311314 through r311459. Added: projects/clang400-import/sys/boot/fdt/dts/arm/armada-385-db-ap.dts - copied unchanged from r311459, head/sys/boot/fdt/dts/arm/armada-385-db-ap.dts projects/clang400-import/sys/boot/fdt/dts/arm/armada-388-clearfog.dts - copied unchanged from r311459, head/sys/boot/fdt/dts/arm/armada-388-clearfog.dts projects/clang400-import/sys/boot/fdt/dts/arm/armada-38x-solidrun-microsom.dtsi - copied unchanged from r311459, head/sys/boot/fdt/dts/arm/armada-38x-solidrun-microsom.dtsi Modified: projects/clang400-import/contrib/bsnmp/lib/snmpclient.c projects/clang400-import/contrib/bsnmp/snmp_usm/usm_snmp.c projects/clang400-import/contrib/bsnmp/snmpd/main.c projects/clang400-import/contrib/bsnmp/snmpd/trans_lsock.c projects/clang400-import/contrib/netbsd-tests/fs/tmpfs/h_tools.c projects/clang400-import/contrib/tcp_wrappers/scaffold.c projects/clang400-import/contrib/tcp_wrappers/tcpd.h projects/clang400-import/etc/mtree/BSD.tests.dist projects/clang400-import/etc/mtree/BSD.var.dist projects/clang400-import/lib/libproc/proc_sym.c projects/clang400-import/sys/arm/conf/ARMADA38X projects/clang400-import/sys/boot/fdt/dts/arm/armada-38x.dtsi projects/clang400-import/sys/boot/mips/beri/boot2/Makefile projects/clang400-import/sys/boot/mips/beri/common/common.ldscript projects/clang400-import/sys/boot/mips/beri/loader/loader.ldscript projects/clang400-import/sys/cam/ctl/ctl_ha.c projects/clang400-import/sys/compat/freebsd32/freebsd32_misc.c projects/clang400-import/sys/compat/linux/linux_stats.c projects/clang400-import/sys/compat/svr4/svr4_misc.c projects/clang400-import/sys/conf/files projects/clang400-import/sys/dev/advansys/adwcam.c projects/clang400-import/sys/dev/agp/agp_i810.c projects/clang400-import/sys/dev/aha/aha.c projects/clang400-import/sys/dev/ahb/ahb.c projects/clang400-import/sys/dev/aic/aic.c projects/clang400-import/sys/dev/ath/ath_hal/ah_regdomain.c projects/clang400-import/sys/dev/ciss/ciss.c projects/clang400-import/sys/dev/dpt/dpt_scsi.c projects/clang400-import/sys/dev/etherswitch/e6000sw/e6000sw.c projects/clang400-import/sys/dev/etherswitch/e6000sw/e6000swreg.h projects/clang400-import/sys/dev/firewire/sbp.c projects/clang400-import/sys/dev/mly/mly.c projects/clang400-import/sys/dev/ncr/ncr.c projects/clang400-import/sys/dev/nvme/nvme_sim.c projects/clang400-import/sys/dev/rtwn/rtl8192c/pci/r92ce_init.c projects/clang400-import/sys/dev/rtwn/rtl8192c/r92c_init.c projects/clang400-import/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c projects/clang400-import/sys/dev/twa/tw_osl_cam.c projects/clang400-import/sys/fs/nfs/nfs_commonsubs.c projects/clang400-import/sys/fs/nfsserver/nfs_nfsdserv.c projects/clang400-import/sys/fs/nullfs/null_vfsops.c projects/clang400-import/sys/fs/unionfs/union_vfsops.c projects/clang400-import/sys/i386/ibcs2/ibcs2_stat.c projects/clang400-import/sys/kern/kern_acct.c projects/clang400-import/sys/kern/kern_exec.c projects/clang400-import/sys/kern/kern_sendfile.c projects/clang400-import/sys/kern/vfs_bio.c projects/clang400-import/sys/kern/vfs_cluster.c projects/clang400-import/sys/kern/vfs_default.c projects/clang400-import/sys/kern/vfs_mount.c projects/clang400-import/sys/kern/vfs_syscalls.c projects/clang400-import/sys/mips/include/db_machdep.h projects/clang400-import/sys/mips/mips/db_trace.c projects/clang400-import/sys/mips/mips/trap.c projects/clang400-import/sys/net/if_media.h projects/clang400-import/sys/net80211/ieee80211_var.h projects/clang400-import/sys/netinet/tcp_hostcache.c projects/clang400-import/sys/sys/imgact.h projects/clang400-import/sys/sys/mount.h projects/clang400-import/sys/vm/vm_init.c projects/clang400-import/sys/vm/vm_kern.c projects/clang400-import/sys/vm/vm_kern.h projects/clang400-import/sys/vm/vm_page.c projects/clang400-import/sys/vm/vm_page.h projects/clang400-import/sys/vm/vm_pager.c projects/clang400-import/sys/vm/vnode_pager.c projects/clang400-import/usr.bin/netstat/if.c projects/clang400-import/usr.bin/netstat/inet.c projects/clang400-import/usr.bin/netstat/inet6.c projects/clang400-import/usr.bin/netstat/mroute.c projects/clang400-import/usr.bin/netstat/netstat.h projects/clang400-import/usr.bin/netstat/route.c projects/clang400-import/usr.bin/netstat/sctp.c projects/clang400-import/usr.bin/netstat/unix.c projects/clang400-import/usr.bin/tail/reverse.c projects/clang400-import/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c projects/clang400-import/usr.sbin/inetd/inetd.c Directory Properties: projects/clang400-import/ (props changed) projects/clang400-import/contrib/netbsd-tests/ (props changed) Modified: projects/clang400-import/contrib/bsnmp/lib/snmpclient.c ============================================================================== --- projects/clang400-import/contrib/bsnmp/lib/snmpclient.c Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/contrib/bsnmp/lib/snmpclient.c Thu Jan 5 20:50:44 2017 (r311460) @@ -728,8 +728,11 @@ snmp_table_fetch_async(const struct snmp work->last_change = 0; table_init_pdu(descr, &work->pdu); - if (snmp_pdu_send(&work->pdu, table_cb, work) == -1) + if (snmp_pdu_send(&work->pdu, table_cb, work) == -1) { + free(work); + work = NULL; return (-1); + } return (0); } Modified: projects/clang400-import/contrib/bsnmp/snmp_usm/usm_snmp.c ============================================================================== --- projects/clang400-import/contrib/bsnmp/snmp_usm/usm_snmp.c Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/contrib/bsnmp/snmp_usm/usm_snmp.c Thu Jan 5 20:50:44 2017 (r311460) @@ -167,10 +167,14 @@ op_usm_users(struct snmp_context *ctx, s if ((uuser = usm_get_user(&val->var, sub)) == NULL && val->var.subs[sub - 1] != LEAF_usmUserStatus && val->var.subs[sub - 1] != LEAF_usmUserCloneFrom) - return (SNMP_ERR_NOSUCHNAME); + return (SNMP_ERR_NOSUCHNAME); + /* + * XXX (ngie): need to investigate the MIB to determine how + * this is possible given some of the transitions below. + */ if (community != COMM_INITIALIZE && - uuser->type == StorageType_readOnly) + uuser != NULL && uuser->type == StorageType_readOnly) return (SNMP_ERR_NOT_WRITEABLE); switch (val->var.subs[sub - 1]) { Modified: projects/clang400-import/contrib/bsnmp/snmpd/main.c ============================================================================== --- projects/clang400-import/contrib/bsnmp/snmpd/main.c Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/contrib/bsnmp/snmpd/main.c Thu Jan 5 20:50:44 2017 (r311460) @@ -2324,13 +2324,12 @@ lm_load(const char *path, const char *se } m->handle = NULL; m->flags = 0; - strcpy(m->section, section); + strlcpy(m->section, section, sizeof(m->section)); - if ((m->path = malloc(strlen(path) + 1)) == NULL) { + if ((m->path = strdup(path)) == NULL) { syslog(LOG_ERR, "lm_load: %m"); goto err; } - strcpy(m->path, path); /* * Make index Modified: projects/clang400-import/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- projects/clang400-import/contrib/bsnmp/snmpd/trans_lsock.c Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/contrib/bsnmp/snmpd/trans_lsock.c Thu Jan 5 20:50:44 2017 (r311460) @@ -146,16 +146,14 @@ lsock_open_port(u_char *name, size_t nam return (SNMP_ERR_BADVALUE); } - if ((port = malloc(sizeof(*port))) == NULL) + if ((port = calloc(1, sizeof(*port))) == NULL) return (SNMP_ERR_GENERR); - memset(port, 0, sizeof(*port)); if (!is_stream) { - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { free(port); return (SNMP_ERR_GENERR); } - memset(peer, 0, sizeof(*peer)); } if ((port->name = malloc(namelen + 1)) == NULL) { free(port); @@ -261,12 +259,11 @@ lsock_listen_input(int fd, void *udata) struct lsock_port *p = udata; struct lsock_peer *peer; - if ((peer = malloc(sizeof(*peer))) == NULL) { + if ((peer = calloc(1, sizeof(*peer))) == NULL) { syslog(LOG_WARNING, "%s: peer malloc failed", p->name); (void)close(accept(fd, NULL, NULL)); return; } - memset(peer, 0, sizeof(*peer)); peer->port = p; @@ -308,10 +305,9 @@ lsock_init_port(struct tport *tp) return (SNMP_ERR_RES_UNAVAIL); } - strcpy(sa.sun_path, p->name); + strlcpy(sa.sun_path, p->name, sizeof(sa.sun_path)); sa.sun_family = AF_LOCAL; - sa.sun_len = strlen(p->name) + - offsetof(struct sockaddr_un, sun_path); + sa.sun_len = SUN_LEN(&sa); (void)remove(p->name); @@ -363,10 +359,9 @@ lsock_init_port(struct tport *tp) return (SNMP_ERR_GENERR); } - strcpy(sa.sun_path, p->name); + strlcpy(sa.sun_path, p->name, sizeof(sa.sun_path)); sa.sun_family = AF_LOCAL; - sa.sun_len = strlen(p->name) + - offsetof(struct sockaddr_un, sun_path); + sa.sun_len = SUN_LEN(&sa); (void)remove(p->name); Modified: projects/clang400-import/contrib/netbsd-tests/fs/tmpfs/h_tools.c ============================================================================== --- projects/clang400-import/contrib/netbsd-tests/fs/tmpfs/h_tools.c Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/contrib/netbsd-tests/fs/tmpfs/h_tools.c Thu Jan 5 20:50:44 2017 (r311460) @@ -244,13 +244,15 @@ sockets_main(int argc, char **argv) } #ifdef __FreeBSD__ - addr.sun_len = sizeof(addr.sun_path); - (void)strlcpy(addr.sun_path, argv[1], addr.sun_len); -#else - (void)strlcpy(addr.sun_path, argv[1], sizeof(addr.sun_path)); + memset(&addr, 0, sizeof(addr)); #endif + (void)strlcpy(addr.sun_path, argv[1], sizeof(addr.sun_path)); addr.sun_family = PF_UNIX; +#ifdef __FreeBSD__ + error = bind(fd, (struct sockaddr *)&addr, SUN_LEN(&addr)); +#else error = bind(fd, (struct sockaddr *)&addr, sizeof(addr)); +#endif if (error == -1) { warn("connect"); #ifdef __FreeBSD__ Modified: projects/clang400-import/contrib/tcp_wrappers/scaffold.c ============================================================================== --- projects/clang400-import/contrib/tcp_wrappers/scaffold.c Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/contrib/tcp_wrappers/scaffold.c Thu Jan 5 20:50:44 2017 (r311460) @@ -235,16 +235,6 @@ struct request_info *request; exit(0); } -/* dummy function to intercept the real rfc931() */ - -/* ARGSUSED */ - -void rfc931(request) -struct request_info *request; -{ - strcpy(request->user, unknown); -} - /* check_path - examine accessibility */ int check_path(path, st) Modified: projects/clang400-import/contrib/tcp_wrappers/tcpd.h ============================================================================== --- projects/clang400-import/contrib/tcp_wrappers/tcpd.h Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/contrib/tcp_wrappers/tcpd.h Thu Jan 5 20:50:44 2017 (r311460) @@ -6,6 +6,12 @@ * $FreeBSD$ */ +#ifdef INET6 +#define TCPD_SOCKADDR struct sockaddr +#else +#define TCPD_SOCKADDR struct sockaddr_in +#endif + /* Structure to describe one communications endpoint. */ #define STRING_LENGTH 128 /* hosts, users, processes */ @@ -13,11 +19,7 @@ struct host_info { char name[STRING_LENGTH]; /* access via eval_hostname(host) */ char addr[STRING_LENGTH]; /* access via eval_hostaddr(host) */ -#ifdef INET6 - struct sockaddr *sin; /* socket address or 0 */ -#else - struct sockaddr_in *sin; /* socket address or 0 */ -#endif + TCPD_SOCKADDR *sin; /* socket address or 0 */ struct t_unitdata *unit; /* TLI transport address or 0 */ struct request_info *request; /* for shared information */ }; @@ -67,21 +69,22 @@ extern char paranoid[]; /* Global functions. */ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) -extern void fromhost(); /* get/validate client host info */ +extern void fromhost(struct request_info *); /* get/validate client host info */ #else -#define fromhost sock_host /* no TLI support needed */ +#define fromhost sock_host /* no TLI support needed */ #endif -extern int hosts_access(); /* access control */ -extern int hosts_ctl(); /* wrapper around request_init() */ -extern void shell_cmd(); /* execute shell command */ -extern char *percent_x(); /* do %<char> expansion */ -extern void rfc931(); /* client name from RFC 931 daemon */ -extern void clean_exit(); /* clean up and exit */ -extern void refuse(); /* clean up and exit */ -extern char *xgets(); /* fgets() on steroids */ -extern char *split_at(); /* strchr() and split */ -extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ +extern int hosts_access(struct request_info *); /* access control */ +extern int hosts_ctl(char *, char *, char *, char *); /* wrapper around request_init() */ +extern void shell_cmd(char *); /* execute shell command */ +extern char *percent_x(char *, int, char *, struct request_info *); /* do %<char> expansion */ +extern void rfc931(TCPD_SOCKADDR *, TCPD_SOCKADDR *, char *); /* client name from RFC 931 daemon */ +extern void clean_exit(struct request_info *); /* clean up and exit */ +extern void refuse(struct request_info *); /* clean up and exit */ +extern char *xgets(char *, int, FILE *); /* fgets() on steroids */ + +extern char *split_at(char *, int); /* strchr() and split */ +extern unsigned long dot_quad_addr(char *); /* restricted inet_addr() */ /* Global variables. */ @@ -98,13 +101,8 @@ extern int resident; /* > 0 if residen * attributes. Each attribute has its own key. */ -#ifdef __STDC__ -extern struct request_info *request_init(struct request_info *,...); -extern struct request_info *request_set(struct request_info *,...); -#else -extern struct request_info *request_init(); /* initialize request */ -extern struct request_info *request_set(); /* update request structure */ -#endif +extern struct request_info *request_init(struct request_info *,...); /* initialize request */ +extern struct request_info *request_set(struct request_info *,...); /* update request structure */ #define RQ_FILE 1 /* file descriptor */ #define RQ_DAEMON 2 /* server process (argv[0]) */ @@ -124,27 +122,27 @@ extern struct request_info *request_set( * host_info structures serve as caches for the lookup results. */ -extern char *eval_user(); /* client user */ -extern char *eval_hostname(); /* printable hostname */ -extern char *eval_hostaddr(); /* printable host address */ -extern char *eval_hostinfo(); /* host name or address */ -extern char *eval_client(); /* whatever is available */ -extern char *eval_server(); /* whatever is available */ +extern char *eval_user(struct request_info *); /* client user */ +extern char *eval_hostname(struct host_info *); /* printable hostname */ +extern char *eval_hostaddr(struct host_info *); /* printable host address */ +extern char *eval_hostinfo(struct host_info *); /* host name or address */ +extern char *eval_client(struct request_info *); /* whatever is available */ +extern char *eval_server(struct request_info *); /* whatever is available */ #define eval_daemon(r) ((r)->daemon) /* daemon process name */ #define eval_pid(r) ((r)->pid) /* process id */ /* Socket-specific methods, including DNS hostname lookups. */ -extern void sock_host(); /* look up endpoint addresses */ -extern void sock_hostname(); /* translate address to hostname */ -extern void sock_hostaddr(); /* address to printable address */ +extern void sock_host(struct request_info *); /* look up endpoint addresses */ +extern void sock_hostname(struct host_info *); /* translate address to hostname */ +extern void sock_hostaddr(struct host_info *); /* address to printable address */ #define sock_methods(r) \ { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } /* The System V Transport-Level Interface (TLI) interface. */ #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) -extern void tli_host(); /* look up endpoint addresses etc. */ +extern void tli_host(struct request_info *); /* look up endpoint addresses etc. */ #endif /* @@ -153,13 +151,8 @@ extern void tli_host(); /* look up end * everyone would have to include <setjmp.h>. */ -#ifdef __STDC__ extern void tcpd_warn(char *, ...); /* report problem and proceed */ extern void tcpd_jump(char *, ...); /* report problem and jump */ -#else -extern void tcpd_warn(); -extern void tcpd_jump(); -#endif struct tcpd_context { char *file; /* current file */ @@ -185,42 +178,42 @@ extern struct tcpd_context tcpd_context; * behavior. */ -extern void process_options(); /* execute options */ -extern int dry_run; /* verification flag */ +extern void process_options(char *, struct request_info *); /* execute options */ +extern int dry_run; /* verification flag */ /* Bug workarounds. */ #ifdef INET_ADDR_BUG /* inet_addr() returns struct */ #define inet_addr fix_inet_addr -extern long fix_inet_addr(); +extern long fix_inet_addr(char *); #endif #ifdef BROKEN_FGETS /* partial reads from sockets */ #define fgets fix_fgets -extern char *fix_fgets(); +extern char *fix_fgets(char *, int, FILE *); #endif #ifdef RECVFROM_BUG /* no address family info */ #define recvfrom fix_recvfrom -extern int fix_recvfrom(); +extern int fix_recvfrom(int, char *, int, int, struct sockaddr *, int *); #endif #ifdef GETPEERNAME_BUG /* claims success with UDP */ #define getpeername fix_getpeername -extern int fix_getpeername(); +extern int fix_getpeername(int, struct sockaddr *, int *); #endif #ifdef SOLARIS_24_GETHOSTBYNAME_BUG /* lists addresses as aliases */ #define gethostbyname fix_gethostbyname -extern struct hostent *fix_gethostbyname(); +extern struct hostent *fix_gethostbyname(char *); #endif #ifdef USE_STRSEP /* libc calls strtok() */ #define strtok fix_strtok -extern char *fix_strtok(); +extern char *fix_strtok(char *, char *); #endif #ifdef LIBC_CALLS_STRTOK /* libc calls strtok() */ #define strtok my_strtok -extern char *my_strtok(); +extern char *my_strtok(char *, char *); #endif Modified: projects/clang400-import/etc/mtree/BSD.tests.dist ============================================================================== --- projects/clang400-import/etc/mtree/BSD.tests.dist Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/etc/mtree/BSD.tests.dist Thu Jan 5 20:50:44 2017 (r311460) @@ -594,8 +594,8 @@ .. .. .. - bsdcat - .. + bsdcat + .. calendar .. cmp Modified: projects/clang400-import/etc/mtree/BSD.var.dist ============================================================================== --- projects/clang400-import/etc/mtree/BSD.var.dist Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/etc/mtree/BSD.var.dist Thu Jan 5 20:50:44 2017 (r311460) @@ -28,7 +28,7 @@ /set gname=wheel backups .. - cache mode=0755 + cache mode=0755 .. crash .. Modified: projects/clang400-import/lib/libproc/proc_sym.c ============================================================================== --- projects/clang400-import/lib/libproc/proc_sym.c Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/lib/libproc/proc_sym.c Thu Jan 5 20:50:44 2017 (r311460) @@ -143,10 +143,12 @@ load_symtab(Elf *e, struct symtab *symta if (scn == NULL) return (-1); - if ((symtab->data = elf_getdata(scn, NULL)) == NULL) + nsyms = shdr.sh_size / shdr.sh_entsize; + if (nsyms > (1 << 20)) return (-1); - nsyms = shdr.sh_size / shdr.sh_entsize; + if ((symtab->data = elf_getdata(scn, NULL)) == NULL) + return (-1); symtab->index = calloc(nsyms, sizeof(u_int)); if (symtab->index == NULL) Modified: projects/clang400-import/sys/arm/conf/ARMADA38X ============================================================================== --- projects/clang400-import/sys/arm/conf/ARMADA38X Thu Jan 5 20:44:45 2017 (r311459) +++ projects/clang400-import/sys/arm/conf/ARMADA38X Thu Jan 5 20:50:44 2017 (r311460) @@ -37,6 +37,9 @@ device vlan device mii device bpf device re +device mdio +device etherswitch +device e6000sw # PCI device pci Copied: projects/clang400-import/sys/boot/fdt/dts/arm/armada-385-db-ap.dts (from r311459, head/sys/boot/fdt/dts/arm/armada-385-db-ap.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang400-import/sys/boot/fdt/dts/arm/armada-385-db-ap.dts Thu Jan 5 20:50:44 2017 (r311460, copy of r311459, head/sys/boot/fdt/dts/arm/armada-385-db-ap.dts) @@ -0,0 +1,271 @@ +/* + * Device Tree file for Marvell Armada 385 Access Point Development board + * (DB-88F6820-AP) + * + * Copyright (C) 2014 Marvell + * + * Nadav Haklai <nadavh@marvell.com> + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without + * any warranty of any kind, whether express or implied. + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * $FreeBSD$ + */ + +/dts-v1/; +#include "armada-385.dtsi" + +#include <dt-bindings/gpio/gpio.h> + +/ { + model = "Marvell Armada 385 Access Point Development Board"; + compatible = "marvell,a385-db-ap", "marvell,armada385", "marvell,armada380"; + + chosen { + stdout-path = "serial1"; + }; + + memory { + device_type = "memory"; + reg = <0x00000000 0x80000000>; /* 2GB */ + }; + + soc { + ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>; + + internal-regs { + i2c0: i2c@11000 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + status = "okay"; + + /* + * This bus is wired to two EEPROM + * sockets, one of which holding the + * board ID used by the bootloader. + * Erasing this EEPROM's content will + * brick the board. + * Use this bus with caution. + */ + }; + + mdio@72004 { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + + phy0: ethernet-phy@1 { + reg = <1>; + }; + + phy1: ethernet-phy@4 { + reg = <4>; + }; + + phy2: ethernet-phy@6 { + reg = <6>; + }; + }; + + /* UART0 is exposed through the JP8 connector */ + uart0: serial@12000 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins>; + status = "okay"; + }; + + /* + * UART1 is exposed through a FTDI chip + * wired to the mini-USB connector + */ + uart1: serial@12100 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "okay"; + }; + + pinctrl@18000 { + xhci0_vbus_pins: xhci0-vbus-pins { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + }; + + /* CON3 */ + ethernet@30000 { + status = "okay"; + phy = <&phy2>; + phy-mode = "sgmii"; + buffer-manager = <&bm>; + bm,pool-long = <1>; + bm,pool-short = <3>; + }; + + /* CON2 */ + ethernet@34000 { + status = "okay"; + phy = <&phy1>; + phy-mode = "sgmii"; + buffer-manager = <&bm>; + bm,pool-long = <2>; + bm,pool-short = <3>; + }; + + usb@58000 { + status = "okay"; + }; + + /* CON4 */ + ethernet@70000 { + pinctrl-names = "default"; + + /* + * The Reference Clock 0 is used to + * provide a clock to the PHY + */ + pinctrl-0 = <&ge0_rgmii_pins>, <&ref_clk0_pins>; + status = "okay"; + phy = <&phy0>; + phy-mode = "rgmii-id"; + buffer-manager = <&bm>; + bm,pool-long = <0>; + bm,pool-short = <3>; + }; + + crypto@90000 { + status = "okay"; + }; + + crypto@92000 { + status = "okay"; + }; + + bm@c8000 { + status = "okay"; + }; + + nfc: flash@d0000 { + status = "okay"; + num-cs = <1>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + marvell,nand-keep-config; + marvell,nand-enable-arbiter; + nand-on-flash-bbt; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "U-Boot"; + reg = <0x00000000 0x00800000>; + read-only; + }; + + partition@800000 { + label = "uImage"; + reg = <0x00800000 0x00400000>; + read-only; + }; + + partition@c00000 { + label = "Root"; + reg = <0x00c00000 0x3f400000>; + }; + }; + }; + + usb3@f0000 { + status = "okay"; + usb-phy = <&usb3_phy>; + }; + }; + + bm-bppi { + status = "okay"; + }; + + pcie-controller { + status = "okay"; + + /* + * The three PCIe units are accessible through + * standard mini-PCIe slots on the board. + */ + pcie@1,0 { + /* Port 0, Lane 0 */ + status = "okay"; + }; + + pcie@2,0 { + /* Port 1, Lane 0 */ + status = "okay"; + }; + + pcie@3,0 { + /* Port 2, Lane 0 */ + status = "okay"; + }; + }; + }; + + usb3_phy: usb3_phy { + compatible = "usb-nop-xceiv"; + vcc-supply = <®_xhci0_vbus>; + }; + + reg_xhci0_vbus: xhci0-vbus { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&xhci0_vbus_pins>; + regulator-name = "xhci0-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>; + }; +}; + +&spi1 { + pinctrl-names = "default"; + pinctrl-0 = <&spi1_pins>; + status = "okay"; + + spi-flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "st,m25p128", "jedec,spi-nor"; + reg = <0>; /* Chip select 0 */ + spi-max-frequency = <54000000>; + }; +}; Copied: projects/clang400-import/sys/boot/fdt/dts/arm/armada-388-clearfog.dts (from r311459, head/sys/boot/fdt/dts/arm/armada-388-clearfog.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/clang400-import/sys/boot/fdt/dts/arm/armada-388-clearfog.dts Thu Jan 5 20:50:44 2017 (r311460, copy of r311459, head/sys/boot/fdt/dts/arm/armada-388-clearfog.dts) @@ -0,0 +1,463 @@ +/* + * Device Tree file for SolidRun Clearfog revision A1 rev 2.0 (88F6828) + * + * Copyright (C) 2015 Russell King + * + * This board is in development; the contents of this file work with + * the A1 rev 2.0 of the board, which does not represent final + * production board. Things will change, don't expect this file to + * remain compatible info the future. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This file is distributed in the hope that it will be useful + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * Or, alternatively + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * $FreeBSD$ + */ + +/dts-v1/; +#include "armada-388.dtsi" +#include "armada-38x-solidrun-microsom.dtsi" + +/ { + model = "SolidRun Clearfog A1"; + compatible = "solidrun,clearfog-a1", "marvell,armada388", + "marvell,armada385", "marvell,armada380"; + + aliases { + /* So that mvebu u-boot can update the MAC addresses */ + ethernet1 = ð0; + ethernet2 = ð1; + ethernet3 = ð2; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + reg_3p3v: regulator-3p3v { + compatible = "regulator-fixed"; + regulator-name = "3P3V"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + soc { + internal-regs { + ethernet@30000 { + phy-mode = "sgmii"; + buffer-manager = <&bm>; + bm,pool-long = <2>; + bm,pool-short = <1>; + status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + ethernet@34000 { + phy-mode = "sgmii"; + buffer-manager = <&bm>; + bm,pool-long = <3>; + bm,pool-short = <1>; + status = "okay"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + i2c@11000 { + /* Is there anything on this? */ + clock-frequency = <100000>; + pinctrl-0 = <&i2c0_pins>; + pinctrl-names = "default"; + status = "okay"; + + /* + * PCA9655 GPIO expander, up to 1MHz clock. + * 0-CON3 CLKREQ# + * 1-CON3 PERST# + * 2-CON2 PERST# + * 3-CON3 W_DISABLE + * 4-CON2 CLKREQ# + * 5-USB3 overcurrent + * 6-USB3 power + * 7-CON2 W_DISABLE + * 8-JP4 P1 + * 9-JP4 P4 + * 10-JP4 P5 + * 11-m.2 DEVSLP + * 12-SFP_LOS + * 13-SFP_TX_FAULT + * 14-SFP_TX_DISABLE + * 15-SFP_MOD_DEF0 + */ + expander0: gpio-expander@20 { + /* + * This is how it should be: + * compatible = "onnn,pca9655", + * "nxp,pca9555"; + * but you can't do this because of + * the way I2C works. + */ + compatible = "nxp,pca9555"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x20>; + + pcie1_0_clkreq { + gpio-hog; + gpios = <0 GPIO_ACTIVE_LOW>; + input; + line-name = "pcie1.0-clkreq"; + }; + pcie1_0_w_disable { + gpio-hog; + gpios = <3 GPIO_ACTIVE_LOW>; + output-low; + line-name = "pcie1.0-w-disable"; + }; + pcie2_0_clkreq { + gpio-hog; + gpios = <4 GPIO_ACTIVE_LOW>; + input; + line-name = "pcie2.0-clkreq"; + }; + pcie2_0_w_disable { + gpio-hog; + gpios = <7 GPIO_ACTIVE_LOW>; + output-low; + line-name = "pcie2.0-w-disable"; + }; + usb3_ilimit { + gpio-hog; + gpios = <5 GPIO_ACTIVE_LOW>; + input; + line-name = "usb3-current-limit"; + }; + usb3_power { + gpio-hog; + gpios = <6 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "usb3-power"; + }; + m2_devslp { + gpio-hog; + gpios = <11 GPIO_ACTIVE_HIGH>; + output-low; + line-name = "m.2 devslp"; + }; + sfp_los { + /* SFP loss of signal */ + gpio-hog; + gpios = <12 GPIO_ACTIVE_HIGH>; + input; + line-name = "sfp-los"; + }; + sfp_tx_fault { + /* SFP laser fault */ + gpio-hog; + gpios = <13 GPIO_ACTIVE_HIGH>; + input; + line-name = "sfp-tx-fault"; + }; + sfp_tx_disable { + /* SFP transmit disable */ + gpio-hog; + gpios = <14 GPIO_ACTIVE_HIGH>; + output-low; + line-name = "sfp-tx-disable"; + }; + sfp_mod_def0 { + /* SFP module present */ + gpio-hog; + gpios = <15 GPIO_ACTIVE_LOW>; + input; + line-name = "sfp-mod-def0"; + }; + }; + + /* The MCP3021 is 100kHz clock only */ + mikrobus_adc: mcp3021@4c { + compatible = "microchip,mcp3021"; + reg = <0x4c>; + }; + + /* Also something at 0x64 */ + }; + + i2c@11100 { + /* + * Routed to SFP, mikrobus, and PCIe. + * SFP limits this to 100kHz, and requires + * an AT24C01A/02/04 with address pins tied + * low, which takes addresses 0x50 and 0x51. + * Mikrobus doesn't specify beyond an I2C + * bus being present. + * PCIe uses ARP to assign addresses, or + * 0x63-0x64. + */ + clock-frequency = <100000>; + pinctrl-0 = <&clearfog_i2c1_pins>; + pinctrl-names = "default"; + status = "okay"; + }; + + pinctrl@18000 { + clearfog_dsa0_clk_pins: clearfog-dsa0-clk-pins { + marvell,pins = "mpp46"; + marvell,function = "ref"; + }; + clearfog_dsa0_pins: clearfog-dsa0-pins { + marvell,pins = "mpp23", "mpp41"; + marvell,function = "gpio"; + }; + clearfog_i2c1_pins: i2c1-pins { + /* SFP, PCIe, mSATA, mikrobus */ + marvell,pins = "mpp26", "mpp27"; + marvell,function = "i2c1"; + }; + clearfog_sdhci_cd_pins: clearfog-sdhci-cd-pins { + marvell,pins = "mpp20"; + marvell,function = "gpio"; + }; + clearfog_sdhci_pins: clearfog-sdhci-pins { + marvell,pins = "mpp21", "mpp28", + "mpp37", "mpp38", + "mpp39", "mpp40"; + marvell,function = "sd0"; + }; + clearfog_spi1_cs_pins: spi1-cs-pins { + marvell,pins = "mpp55"; + marvell,function = "spi1"; + }; + mikro_pins: mikro-pins { + /* int: mpp22 rst: mpp29 */ + marvell,pins = "mpp22", "mpp29"; + marvell,function = "gpio"; + }; + mikro_spi_pins: mikro-spi-pins { + marvell,pins = "mpp43"; + marvell,function = "spi1"; + }; + mikro_uart_pins: mikro-uart-pins { + marvell,pins = "mpp24", "mpp25"; + marvell,function = "ua1"; + }; + rear_button_pins: rear-button-pins { + marvell,pins = "mpp34"; + marvell,function = "gpio"; + }; + }; + + sata@a8000 { + /* pinctrl? */ + status = "okay"; + }; + + sata@e0000 { + /* pinctrl? */ + status = "okay"; + }; + + sdhci@d8000 { + bus-width = <4>; + cd-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; + no-1-8-v; + pinctrl-0 = <&clearfog_sdhci_pins + &clearfog_sdhci_cd_pins>; + pinctrl-names = "default"; + status = "okay"; + vmmc = <®_3p3v>; + wp-inverted; + }; + + serial@12100 { + /* mikrobus uart */ + pinctrl-0 = <&mikro_uart_pins>; + pinctrl-names = "default"; + status = "okay"; + }; + + usb@58000 { + /* CON3, nearest power. */ + status = "okay"; + }; + + crypto@90000 { + status = "okay"; + }; + + crypto@92000 { + status = "okay"; + }; + + usb3@f0000 { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701052050.v05Kojeq081358>