CVS commit: src/sys/arch/evbarm
Module Name:src Committed By: skrll Date: Sun Sep 7 06:14:13 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c src/sys/arch/evbarm/conf: mk.awin Log Message: Fix BOARDTYPE handling To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/awin/awin_machdep.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/conf/mk.awin Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.2 src/sys/arch/evbarm/awin/awin_machdep.c:1.3 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.2 Thu Sep 4 02:34:30 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sun Sep 7 06:14:13 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.2 2014/09/04 02:34:30 jmcneill Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.3 2014/09/07 06:14:13 skrll Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: awin_machdep.c,v 1.2 2014/09/04 02:34:30 jmcneill Exp $); +__KERNEL_RCSID(0, $NetBSD: awin_machdep.c,v 1.3 2014/09/07 06:14:13 skrll Exp $); #include opt_machdep.h #include opt_ddb.h @@ -188,8 +188,6 @@ __KERNEL_RCSID(0, $NetBSD: awin_machdep #include dev/usb/ukbdvar.h #include net/if_ether.h -#define AWIN_board __CONCAT(AWIN_, BOARDTYPE) - BootConfig bootconfig; /* Boot config storage */ static char bootargs[MAX_BOOT_STRING]; char *boot_args = NULL; Index: src/sys/arch/evbarm/conf/mk.awin diff -u src/sys/arch/evbarm/conf/mk.awin:1.1 src/sys/arch/evbarm/conf/mk.awin:1.2 --- src/sys/arch/evbarm/conf/mk.awin:1.1 Sun Aug 31 19:13:01 2014 +++ src/sys/arch/evbarm/conf/mk.awin Sun Sep 7 06:14:13 2014 @@ -1,4 +1,4 @@ -# $NetBSD: mk.awin,v 1.1 2014/08/31 19:13:01 matt Exp $ +# $NetBSD: mk.awin,v 1.2 2014/09/07 06:14:13 skrll Exp $ CPPFLAGS+= -mcpu=cortex-a8 -mfpu=neon .if !empty(MACHINE_ARCH:M*eb) @@ -8,7 +8,8 @@ EXTRA_LINKFLAGS+= --be8 SYSTEM_FIRST_OBJ= awin_start.o SYSTEM_FIRST_SFILE= ${THISARM}/awin/awin_start.S -COPTS.win_machdep.c+= -DBOARDTYPE=${BOARDTYPE} +CPPFLAGS.awin_machdep.c+= -DBOARDTYPE=${BOARDTYPE} +CPPFLAGS.awin_machdep.c+= -DAWIN_board=AWIN_${BOARDTYPE} GENASSYM_EXTRAS+= ${THISARM}/awin/genassym.cf
CVS commit: src/sys/arch/evbarm
Module Name:src Committed By: skrll Date: Sun Sep 7 06:26:08 UTC 2014 Modified Files: src/sys/arch/evbarm/awin: awin_machdep.c Added Files: src/sys/arch/evbarm/conf: BPI Log Message: Add a Banana Pi kernel config and fixup mmc0detect assignment for BPI. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/awin/awin_machdep.c cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/BPI Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/awin/awin_machdep.c diff -u src/sys/arch/evbarm/awin/awin_machdep.c:1.3 src/sys/arch/evbarm/awin/awin_machdep.c:1.4 --- src/sys/arch/evbarm/awin/awin_machdep.c:1.3 Sun Sep 7 06:14:13 2014 +++ src/sys/arch/evbarm/awin/awin_machdep.c Sun Sep 7 06:26:08 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_machdep.c,v 1.3 2014/09/07 06:14:13 skrll Exp $ */ +/* $NetBSD: awin_machdep.c,v 1.4 2014/09/07 06:26:08 skrll Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: awin_machdep.c,v 1.3 2014/09/07 06:14:13 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: awin_machdep.c,v 1.4 2014/09/07 06:26:08 skrll Exp $); #include opt_machdep.h #include opt_ddb.h @@ -619,7 +619,11 @@ awin_device_register(device_t self, void prop_dictionary_set_cstring(dict, hdd5ven, PH17); prop_dictionary_set_cstring(dict, emacpwren, PH19); } +#if AWIN_board == AWIN_cubieboard || AWIN_board == AWIN_cubietruck prop_dictionary_set_cstring(dict, mmc0detect, PH1); +#elif AWIN_board == AWIN_bpi + prop_dictionary_set_cstring(dict, mmc0detect, PH10); +#endif prop_dictionary_set_cstring(dict, audiopactrl, PH15); /* Added files: Index: src/sys/arch/evbarm/conf/BPI diff -u /dev/null src/sys/arch/evbarm/conf/BPI:1.1 --- /dev/null Sun Sep 7 06:26:08 2014 +++ src/sys/arch/evbarm/conf/BPI Sun Sep 7 06:26:08 2014 @@ -0,0 +1,311 @@ +# +# $NetBSD: BPI,v 1.1 2014/09/07 06:26:08 skrll Exp $ +# +# BPI -- Banana Pi - an Allwinner A20 Eval Board Kernel +# + +include arch/evbarm/conf/std.awin + +# estimated number of users + +maxusers 32 + +# Standard system options + +options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT +#options NTP # NTP phase/frequency locked loop + +# CPU options + +no makeoptions BOARDTYPE +makeoptions BOARDTYPE=bpi +#options UVMHIST,UVMHIST_PRINT +options CPU_CORTEXA8 +options CPU_CORTEXA7 +options ALLWINNER_A10 +options ALLWINNER_A20 +options PMAPCOUNTERS +options AWIN_CONSOLE_EARLY + +# Architecture options + +# File systems + +file-system FFS # UFS +#file-system LFS # log-structured file system +file-system MFS # memory file system +file-system NFS # Network file system +#file-system ADOSFS # AmigaDOS-compatible file system +#file-system EXT2FS # second extended file system (linux) +#file-system CD9660 # ISO 9660 + Rock Ridge file system +file-system MSDOSFS # MS-DOS file system +#file-system FDESC # /dev/fd +file-system KERNFS # /kern +#file-system NULLFS # loopback file system +file-system PROCFS # /proc +#file-system PUFFS # Userspace file systems (e.g. ntfs-3g sshfs) +#file-system UMAPFS # NULLFS + uid and gid remapping +#file-system UNION # union file system +file-system TMPFS # memory file system +file-system PTYFS # /dev/pts/N support + +# File system options +#options QUOTA # legacy UFS quotas +#options QUOTA2 # new, in-filesystem UFS quotas +#options FFS_EI # FFS Endian Independent support +#options NFSSERVER +options WAPBL # File system journaling support +#options FFS_NO_SNAPSHOT # No FFS snapshot support + +# Networking options + +#options GATEWAY # packet forwarding +options INET # IP + ICMP + TCP + UDP +options INET6 # IPV6 +#options IPSEC # IP security +#options IPSEC_DEBUG # debug for IP security +#options MROUTING # IP multicast routing +#options PIM # Protocol Independent Multicast +#options NETATALK # AppleTalk networking +#options PPP_BSDCOMP # BSD-Compress compression support for PPP +#options PPP_DEFLATE # Deflate compression support for PPP +#options PPP_FILTER # Active filter support for PPP (requires bpf) +#options TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG + +options NFS_BOOT_BOOTP +options NFS_BOOT_DHCP +#options NFS_BOOT_BOOTSTATIC +#options NFS_BOOTSTATIC_MYIP=\192.168.1.4\ +#options NFS_BOOTSTATIC_GWIP=\192.168.1.1\ +#options NFS_BOOTSTATIC_MASK=\255.255.255.0\ +#options NFS_BOOTSTATIC_SERVADDR=\192.168.1.1\ +#options NFS_BOOTSTATIC_SERVER=\192.168.1.1:/nfs/sdp2430\ + +options NFS_BOOT_RWSIZE=1024 + +# Compatibility options + +options COMPAT_NETBSD32 # allow running arm (e.g. non-earm) binaries +#options COMPAT_43 # 4.3BSD compatibility. +options COMPAT_70 # NetBSD 7.0 compatibility. +options COMPAT_60 # NetBSD 6.0 compatibility. +options COMPAT_50 # NetBSD 5.0 compatibility. +options COMPAT_40 #
CVS commit: src/tests/fs/vfs
Module Name:src Committed By: gson Date: Sun Sep 7 09:10:09 UTC 2014 Modified Files: src/tests/fs/vfs: t_vnops.c Log Message: Add a test of symlinks with long targets. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/tests/fs/vfs/t_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/fs/vfs/t_vnops.c diff -u src/tests/fs/vfs/t_vnops.c:1.41 src/tests/fs/vfs/t_vnops.c:1.42 --- src/tests/fs/vfs/t_vnops.c:1.41 Tue Aug 12 12:13:09 2014 +++ src/tests/fs/vfs/t_vnops.c Sun Sep 7 09:10:09 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: t_vnops.c,v 1.41 2014/08/12 12:13:09 gson Exp $ */ +/* $NetBSD: t_vnops.c,v 1.42 2014/09/07 09:10:09 gson Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -551,19 +551,58 @@ rename_nametoolong(const atf_tc_t *tc, c rump_sys_chdir(/); } +/* + * Test creating a symlink whose length is len bytes, not including + * the terminating NUL. + */ static void -symlink_zerolen(const atf_tc_t *tc, const char *mp) +symlink_len(const atf_tc_t *tc, const char *mp, size_t len) { + char *buf; + int r; USES_SYMLINKS; RL(rump_sys_chdir(mp)); - RL(rump_sys_symlink(, afile)); + buf = malloc(len + 1); + ATF_REQUIRE(buf); + memset(buf, 'a', len); + buf[len] = '\0'; + r = rump_sys_symlink(buf, afile); + if (r == -1) { + ATF_REQUIRE_ERRNO(ENAMETOOLONG, r); + } else { + RL(rump_sys_unlink(afile)); + } + free(buf); + RL(rump_sys_chdir(/)); } static void +symlink_zerolen(const atf_tc_t *tc, const char *mp) +{ + symlink_len(tc, mp, 0); +} + +static void +symlink_long(const atf_tc_t *tc, const char *mp) +{ + /* + * Test lengths close to powers of two, as those are likely + * to be edge cases. + */ + size_t len; + int fuzz; + for (len = 2; len = 65536; len *= 2) { + for (fuzz = -1; fuzz = 1; fuzz++) { + symlink_len(tc, mp, len + fuzz); + } + } +} + +static void symlink_root(const atf_tc_t *tc, const char *mp) { @@ -920,7 +959,8 @@ ATF_TC_FSAPPLY(rename_reg_nodir, rename ATF_TC_FSAPPLY(create_nametoolong, create file with name too long); ATF_TC_FSAPPLY(create_exist, create with O_EXCL); ATF_TC_FSAPPLY(rename_nametoolong, rename to file with name too long); -ATF_TC_FSAPPLY(symlink_zerolen, symlink with 0-len target); +ATF_TC_FSAPPLY(symlink_zerolen, symlink with target of length 0); +ATF_TC_FSAPPLY(symlink_long, symlink with target of length 0); ATF_TC_FSAPPLY(symlink_root, symlink to root directory); ATF_TC_FSAPPLY(attrs, check setting attributes works); ATF_TC_FSAPPLY(fcntl_lock, check fcntl F_SETLK); @@ -944,6 +984,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_FSAPPLY(create_exist); ATF_TP_FSAPPLY(rename_nametoolong); ATF_TP_FSAPPLY(symlink_zerolen); + ATF_TP_FSAPPLY(symlink_long); ATF_TP_FSAPPLY(symlink_root); ATF_TP_FSAPPLY(attrs); ATF_TP_FSAPPLY(fcntl_lock);
CVS commit: src
Module Name:src Committed By: martin Date: Sun Sep 7 11:50:23 UTC 2014 Modified Files: src/sys/dev: clock_subr.c clock_subr.h src/tools/compat/dev: clock_subr.h Log Message: Avoid overflowing the year value by making the field uint64_t. Adapt arguments and local variables accordingly. This now fixes PR 49144 for real. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/dev/clock_subr.c src/sys/dev/clock_subr.h cvs rdiff -u -r1.1 -r1.2 src/tools/compat/dev/clock_subr.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/clock_subr.c diff -u src/sys/dev/clock_subr.c:1.21 src/sys/dev/clock_subr.c:1.22 --- src/sys/dev/clock_subr.c:1.21 Sat Sep 6 18:04:28 2014 +++ src/sys/dev/clock_subr.c Sun Sep 7 11:50:23 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: clock_subr.c,v 1.21 2014/09/06 18:04:28 martin Exp $ */ +/* $NetBSD: clock_subr.c,v 1.22 2014/09/07 11:50:23 martin Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -50,18 +50,20 @@ #ifdef _KERNEL #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: clock_subr.c,v 1.21 2014/09/06 18:04:28 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: clock_subr.c,v 1.22 2014/09/07 11:50:23 martin Exp $); #include sys/param.h #include sys/systm.h +#include sys/errno.h #else /* ! _KERNEL */ #include string.h #include time.h +#include errno.h #endif /* ! _KERNEL */ #include dev/clock_subr.h -static inline int leapyear(int year); +static inline int leapyear(uint64_t year); #define FEBRUARY 2 #define days_in_year(a) (leapyear(a) ? 366 : 365) #define days_in_month(a) (month_days[(a) - 1]) @@ -92,10 +94,13 @@ static const int month_days[12] = { * It is otherwise equivalent. */ static inline int -leapyear(int year) +leapyear(uint64_t year) { int rv = 0; + if (year 1969) + return EINVAL; + if ((year 3) == 0) { rv = 1; if ((year % 100) == 0) { @@ -110,8 +115,7 @@ leapyear(int year) time_t clock_ymdhms_to_secs(struct clock_ymdhms *dt) { - uint64_t secs; - int i, year, days; + uint64_t secs, i, year, days; year = dt-dt_year; @@ -167,13 +171,17 @@ clock_ymdhms_to_secs(struct clock_ymdhms return secs; } -void +int clock_secs_to_ymdhms(time_t secs, struct clock_ymdhms *dt) { - int i, leap; + int leap; + uint64_t i; time_t days; time_t rsec; /* remainder seconds */ + if (secs 0) + return EINVAL; + days = secs / SECDAY; rsec = secs % SECDAY; @@ -225,4 +233,6 @@ clock_secs_to_ymdhms(time_t secs, struct dt-dt_min = rsec / 60; rsec = rsec % 60; dt-dt_sec = rsec; + + return 0; } Index: src/sys/dev/clock_subr.h diff -u src/sys/dev/clock_subr.h:1.21 src/sys/dev/clock_subr.h:1.22 --- src/sys/dev/clock_subr.h:1.21 Sat Dec 12 15:10:34 2009 +++ src/sys/dev/clock_subr.h Sun Sep 7 11:50:23 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: clock_subr.h,v 1.21 2009/12/12 15:10:34 tsutsui Exp $ */ +/* $NetBSD: clock_subr.h,v 1.22 2014/09/07 11:50:23 martin Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ * POSIX time to/from YY/MM/DD/hh/mm/ss */ struct clock_ymdhms { - u_short dt_year; + uint64_t dt_year; u_char dt_mon; u_char dt_day; u_char dt_wday; /* Day of week */ @@ -46,7 +46,7 @@ struct clock_ymdhms { }; time_t clock_ymdhms_to_secs(struct clock_ymdhms *); -void clock_secs_to_ymdhms(time_t, struct clock_ymdhms *); +int clock_secs_to_ymdhms(time_t, struct clock_ymdhms *); /* * BCD to binary and binary to BCD. Index: src/tools/compat/dev/clock_subr.h diff -u src/tools/compat/dev/clock_subr.h:1.1 src/tools/compat/dev/clock_subr.h:1.2 --- src/tools/compat/dev/clock_subr.h:1.1 Mon Sep 1 07:48:16 2014 +++ src/tools/compat/dev/clock_subr.h Sun Sep 7 11:50:23 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: clock_subr.h,v 1.1 2014/09/01 07:48:16 martin Exp $ */ +/* $NetBSD: clock_subr.h,v 1.2 2014/09/07 11:50:23 martin Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ * POSIX time to/from YY/MM/DD/hh/mm/ss */ struct clock_ymdhms { - u_short dt_year; + uint64_t dt_year; u_char dt_mon; u_char dt_day; u_char dt_wday; /* Day of week */ @@ -50,7 +50,7 @@ struct clock_ymdhms { }; time_t clock_ymdhms_to_secs(struct clock_ymdhms *); -void clock_secs_to_ymdhms(time_t, struct clock_ymdhms *); +int clock_secs_to_ymdhms(time_t, struct clock_ymdhms *); /* Some handy constants. */ #define SECDAY (24 * 60 * 60)
CVS commit: src/external/bsd/cron/dist
Module Name:src Committed By: joerg Date: Sun Sep 7 13:34:12 UTC 2014 Modified Files: src/external/bsd/cron/dist: cron.c crontab.c Log Message: Mark usage and quit as dead. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/bsd/cron/dist/cron.c cvs rdiff -u -r1.10 -r1.11 src/external/bsd/cron/dist/crontab.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/cron/dist/cron.c diff -u src/external/bsd/cron/dist/cron.c:1.8 src/external/bsd/cron/dist/cron.c:1.9 --- src/external/bsd/cron/dist/cron.c:1.8 Fri Sep 5 21:32:37 2014 +++ src/external/bsd/cron/dist/cron.c Sun Sep 7 13:34:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: cron.c,v 1.8 2014/09/05 21:32:37 christos Exp $ */ +/* $NetBSD: cron.c,v 1.9 2014/09/07 13:34:12 joerg Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -25,7 +25,7 @@ #if 0 static char rcsid[] = Id: cron.c,v 1.12 2004/01/23 18:56:42 vixie Exp; #else -__RCSID($NetBSD: cron.c,v 1.8 2014/09/05 21:32:37 christos Exp $); +__RCSID($NetBSD: cron.c,v 1.9 2014/09/07 13:34:12 joerg Exp $); #endif #endif @@ -35,7 +35,7 @@ __RCSID($NetBSD: cron.c,v 1.8 2014/09/0 enum timejump { negative, small, medium, large }; -static void usage(void), +static void usage(void) __dead, run_reboot_jobs(cron_db *), find_jobs(time_t, cron_db *, int, int), set_time(int), @@ -43,7 +43,7 @@ static void usage(void), sigchld_handler(int), sighup_handler(int), sigchld_reaper(void), - quit(int), + quit(int) __dead, parse_args(int c, char *v[]); static volatile sig_atomic_t got_sighup, got_sigchld; Index: src/external/bsd/cron/dist/crontab.c diff -u src/external/bsd/cron/dist/crontab.c:1.10 src/external/bsd/cron/dist/crontab.c:1.11 --- src/external/bsd/cron/dist/crontab.c:1.10 Sat Sep 6 12:18:49 2014 +++ src/external/bsd/cron/dist/crontab.c Sun Sep 7 13:34:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: crontab.c,v 1.10 2014/09/06 12:18:49 christos Exp $ */ +/* $NetBSD: crontab.c,v 1.11 2014/09/07 13:34:12 joerg Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -25,7 +25,7 @@ #if 0 static char rcsid[] = Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp; #else -__RCSID($NetBSD: crontab.c,v 1.10 2014/09/06 12:18:49 christos Exp $); +__RCSID($NetBSD: crontab.c,v 1.11 2014/09/07 13:34:12 joerg Exp $); #endif #endif @@ -69,7 +69,7 @@ static int in_file(const char *, FILE static int relinguish_priv(void); static int regain_priv(void); -static void +static __dead void usage(const char *msg) { (void)fprintf(stderr, %s: usage error: %s\n, getprogname(), msg); (void)fprintf(stderr, usage:\t%s [-u user] file\n, getprogname()); @@ -639,7 +639,7 @@ replace_cmd(void) { */ (void)fprintf(tmp, # DO NOT EDIT THIS FILE - edit the master and reinstall.\n); (void)fprintf(tmp, # (%s installed on %-24.24s)\n, Filename, ctime(now)); - (void)fprintf(tmp, # (Cron version %s -- %s)\n, CRON_VERSION, $NetBSD: crontab.c,v 1.10 2014/09/06 12:18:49 christos Exp $); + (void)fprintf(tmp, # (Cron version %s -- %s)\n, CRON_VERSION, $NetBSD: crontab.c,v 1.11 2014/09/07 13:34:12 joerg Exp $); /* copy the crontab to the tmp */
CVS commit: src/external/bsd/cron/dist
Module Name:src Committed By: tron Date: Sun Sep 7 13:35:27 UTC 2014 Modified Files: src/external/bsd/cron/dist: env.c Log Message: Make crontab(1) work again which got broken by the last commit. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/cron/dist/env.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/cron/dist/env.c diff -u src/external/bsd/cron/dist/env.c:1.3 src/external/bsd/cron/dist/env.c:1.4 --- src/external/bsd/cron/dist/env.c:1.3 Fri Sep 5 21:32:37 2014 +++ src/external/bsd/cron/dist/env.c Sun Sep 7 13:35:27 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: env.c,v 1.3 2014/09/05 21:32:37 christos Exp $ */ +/* $NetBSD: env.c,v 1.4 2014/09/07 13:35:27 tron Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -25,7 +25,7 @@ #if 0 static char rcsid[] = Id: env.c,v 1.10 2004/01/23 18:56:42 vixie Exp; #else -__RCSID($NetBSD: env.c,v 1.3 2014/09/05 21:32:37 christos Exp $); +__RCSID($NetBSD: env.c,v 1.4 2014/09/07 13:35:27 tron Exp $); #endif #endif @@ -58,9 +58,9 @@ env_copy(char **envp) { for (count = 0; envp[count] != NULL; count++) continue; p = malloc((count + 1) * sizeof(*p)); /* 1 for the NULL */ - if (p != NULL) - return NULL; - for (i = 0; i count; i++) + if (p == NULL) + return NULL; + for (i = 0; i count; i++) { if ((p[i] = strdup(envp[i])) == NULL) { save_errno = errno; for (count = 0; count i; count++) @@ -69,6 +69,7 @@ env_copy(char **envp) { errno = save_errno; return NULL; } + } p[count] = NULL; return p; }
CVS commit: src/sys/arch/arm/broadcom
Module Name:src Committed By: jmcneill Date: Sun Sep 7 14:15:59 UTC 2014 Modified Files: src/sys/arch/arm/broadcom: bcm2835reg.h Log Message: add DMA0 int To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/broadcom/bcm2835reg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/broadcom/bcm2835reg.h diff -u src/sys/arch/arm/broadcom/bcm2835reg.h:1.10 src/sys/arch/arm/broadcom/bcm2835reg.h:1.11 --- src/sys/arch/arm/broadcom/bcm2835reg.h:1.10 Sat Jan 26 11:58:43 2013 +++ src/sys/arch/arm/broadcom/bcm2835reg.h Sun Sep 7 14:15:59 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835reg.h,v 1.10 2013/01/26 11:58:43 jmcneill Exp $ */ +/* $NetBSD: bcm2835reg.h,v 1.11 2014/09/07 14:15:59 jmcneill Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -125,6 +125,7 @@ #define BCM2835_INT_TIMER2 (BCM2835_INT_GPU0BASE + 2) #define BCM2835_INT_TIMER3 (BCM2835_INT_GPU0BASE + 3) #define BCM2835_INT_USB (BCM2835_INT_GPU0BASE + 9) +#define BCM2835_INT_DMA0 (BCM2835_INT_GPU0BASE + 16) #define BCM2835_INT_DMA2 (BCM2835_INT_GPU0BASE + 18) #define BCM2835_INT_DMA3 (BCM2835_INT_GPU0BASE + 19) #define BCM2835_INT_AUX (BCM2835_INT_GPU0BASE + 29)
CVS commit: src/sys/arch/arm/broadcom
Module Name:src Committed By: jmcneill Date: Sun Sep 7 14:16:44 UTC 2014 Modified Files: src/sys/arch/arm/broadcom: bcm2835_obio.c files.bcm2835 Added Files: src/sys/arch/arm/broadcom: bcm2835_dmac.c bcm2835_dmac.h Log Message: bcm2835 dma controller driver To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_dmac.c \ src/sys/arch/arm/broadcom/bcm2835_dmac.h cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/broadcom/bcm2835_obio.c cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/broadcom/files.bcm2835 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/broadcom/bcm2835_obio.c diff -u src/sys/arch/arm/broadcom/bcm2835_obio.c:1.20 src/sys/arch/arm/broadcom/bcm2835_obio.c:1.21 --- src/sys/arch/arm/broadcom/bcm2835_obio.c:1.20 Tue Apr 22 18:51:35 2014 +++ src/sys/arch/arm/broadcom/bcm2835_obio.c Sun Sep 7 14:16:44 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_obio.c,v 1.20 2014/04/22 18:51:35 kardel Exp $ */ +/* $NetBSD: bcm2835_obio.c,v 1.21 2014/09/07 14:16:44 jmcneill Exp $ */ /*- * Copyright (c) 2012, 2014 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bcm2835_obio.c,v 1.20 2014/04/22 18:51:35 kardel Exp $); +__KERNEL_RCSID(0, $NetBSD: bcm2835_obio.c,v 1.21 2014/09/07 14:16:44 jmcneill Exp $); #include locators.h #include obio.h @@ -105,6 +105,13 @@ static const struct ambadev_locators bcm .ad_intr = -1, }, { + /* DMA Controller */ + .ad_name = bcmdmac, + .ad_addr = BCM2835_DMA0_BASE, + .ad_size = BCM2835_DMA0_SIZE, + .ad_intr = -1, + }, + { /* Random number generator */ .ad_name = bcmrng, .ad_addr = BCM2835_RNG_BASE, Index: src/sys/arch/arm/broadcom/files.bcm2835 diff -u src/sys/arch/arm/broadcom/files.bcm2835:1.21 src/sys/arch/arm/broadcom/files.bcm2835:1.22 --- src/sys/arch/arm/broadcom/files.bcm2835:1.21 Tue Apr 22 18:51:35 2014 +++ src/sys/arch/arm/broadcom/files.bcm2835 Sun Sep 7 14:16:44 2014 @@ -1,4 +1,4 @@ -# $NetBSD: files.bcm2835,v 1.21 2014/04/22 18:51:35 kardel Exp $ +# $NetBSD: files.bcm2835,v 1.22 2014/09/07 14:16:44 jmcneill Exp $ # # Configuration info for Broadcom BCM2835 ARM Peripherals # @@ -54,6 +54,11 @@ file arch/arm/broadcom/bcm2835_plcom.c b attach sdhc at obio with bcmemmc file arch/arm/broadcom/bcm2835_emmc.c bcmemmc +# DMA Controller (BCM2835_DMA0_BASE) +device bcmdmac +attach bcmdmac at obio with bcmdmac_amba +file arch/arm/broadcom/bcm2835_dmac.c bcmdmac + # USB (BCM2835_USB_BASE) attach dwctwo at obio with bcmdwctwo file arch/arm/broadcom/bcm2835_dwctwo.c bcmdwctwo needs-flag Added files: Index: src/sys/arch/arm/broadcom/bcm2835_dmac.c diff -u /dev/null src/sys/arch/arm/broadcom/bcm2835_dmac.c:1.1 --- /dev/null Sun Sep 7 14:16:44 2014 +++ src/sys/arch/arm/broadcom/bcm2835_dmac.c Sun Sep 7 14:16:44 2014 @@ -0,0 +1,293 @@ +/* $NetBSD: bcm2835_dmac.c,v 1.1 2014/09/07 14:16:44 jmcneill Exp $ */ + +/*- + * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca + * 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 opt_ddb.h + +#include sys/cdefs.h +__KERNEL_RCSID(0, $NetBSD: bcm2835_dmac.c,v 1.1 2014/09/07 14:16:44 jmcneill Exp $); + +#include sys/param.h +#include sys/bus.h +#include sys/device.h +#include sys/intr.h +#include sys/systm.h +#include sys/kmem.h +#include sys/mutex.h + +#include arm/broadcom/bcm_amba.h +#include arm/broadcom/bcm2835reg.h +#include arm/broadcom/bcm2835_intr.h + +#include arm/broadcom/bcm2835_dmac.h + +#define BCM_DMAC_CHANNELMASK 0x0ff2 + +struct bcm_dmac_softc; + +struct bcm_dmac_channel { + struct bcm_dmac_softc *ch_sc; + void *ch_ih; +
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sun Sep 7 14:17:23 UTC 2014 Modified Files: src/sys/arch/evbarm/conf: RPI Log Message: add bcmdmac0, commented out until something uses it To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/arch/evbarm/conf/RPI Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/RPI diff -u src/sys/arch/evbarm/conf/RPI:1.50 src/sys/arch/evbarm/conf/RPI:1.51 --- src/sys/arch/evbarm/conf/RPI:1.50 Fri Sep 5 11:27:57 2014 +++ src/sys/arch/evbarm/conf/RPI Sun Sep 7 14:17:23 2014 @@ -1,5 +1,5 @@ # -# $NetBSD: RPI,v 1.50 2014/09/05 11:27:57 skrll Exp $ +# $NetBSD: RPI,v 1.51 2014/09/07 14:17:23 jmcneill Exp $ # # RPi -- Raspberry Pi # @@ -180,6 +180,9 @@ bcmicu0 at obio? bcmmbox0 at obio? vcmbox0 at bcmmbox0 +# DMA Controller +#bcmdmac0 at obio? + # VCHIQ vchiq0 at obio?
CVS commit: src/sys/arch/arm/broadcom
Module Name:src Committed By: jmcneill Date: Sun Sep 7 15:21:27 UTC 2014 Modified Files: src/sys/arch/arm/broadcom: bcm2835_dmac.c Log Message: fix a stupid bug at attach To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/broadcom/bcm2835_dmac.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/broadcom/bcm2835_dmac.c diff -u src/sys/arch/arm/broadcom/bcm2835_dmac.c:1.1 src/sys/arch/arm/broadcom/bcm2835_dmac.c:1.2 --- src/sys/arch/arm/broadcom/bcm2835_dmac.c:1.1 Sun Sep 7 14:16:44 2014 +++ src/sys/arch/arm/broadcom/bcm2835_dmac.c Sun Sep 7 15:21:27 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_dmac.c,v 1.1 2014/09/07 14:16:44 jmcneill Exp $ */ +/* $NetBSD: bcm2835_dmac.c,v 1.2 2014/09/07 15:21:27 jmcneill Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca @@ -29,7 +29,7 @@ #include opt_ddb.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bcm2835_dmac.c,v 1.1 2014/09/07 14:16:44 jmcneill Exp $); +__KERNEL_RCSID(0, $NetBSD: bcm2835_dmac.c,v 1.2 2014/09/07 15:21:27 jmcneill Exp $); #include sys/param.h #include sys/bus.h @@ -143,7 +143,7 @@ bcm_dmac_attach(device_t parent, device_ ch-ch_index = index; ch-ch_callback = NULL; ch-ch_callbackarg = NULL; - if ((index sc-sc_channelmask) == 0) + if ((__BIT(index) sc-sc_channelmask) == 0) continue; aprint_normal( DMA%d, index);
CVS commit: src/sys/arch/arm/broadcom
Module Name:src Committed By: skrll Date: Sun Sep 7 15:28:05 UTC 2014 Modified Files: src/sys/arch/arm/broadcom: bcm2835_intr.c Log Message: DMA channel interrupt names To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/broadcom/bcm2835_intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/broadcom/bcm2835_intr.c diff -u src/sys/arch/arm/broadcom/bcm2835_intr.c:1.3 src/sys/arch/arm/broadcom/bcm2835_intr.c:1.4 --- src/sys/arch/arm/broadcom/bcm2835_intr.c:1.3 Tue Jan 8 12:15:42 2013 +++ src/sys/arch/arm/broadcom/bcm2835_intr.c Sun Sep 7 15:28:05 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_intr.c,v 1.3 2013/01/08 12:15:42 skrll Exp $ */ +/* $NetBSD: bcm2835_intr.c,v 1.4 2014/09/07 15:28:05 skrll Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bcm2835_intr.c,v 1.3 2013/01/08 12:15:42 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: bcm2835_intr.c,v 1.4 2014/09/07 15:28:05 skrll Exp $); #define _INTR_PRIVATE @@ -95,10 +95,10 @@ static const char * const bcm2835_source (unused 4), (unused 5), (unused 6), jpeg, (unused 8), usb, (unused 10), (unused 11), (unused 12), (unused 13), (unused 14), (unused 15), - (unused 16), (unused 17), dma2, dma3, - (unused 20), (unused 21), (unused 22), (unused 23), - (unused 24), (unused 25), (unused 26), (unused 27), - (unused 28), aux, (unused 30), (unused 31), + dma0, dma1, dma2, dma3, + dma4, dma5, dma6, dma7, + dma8, dma9, dma10, dma11, + dma12, aux, (unused 30), (unused 31), (unused 32), (unused 33), (unused 34), (unused 35), (unused 36), (unused 37), (unused 38), (unused 39), (unused 40), (unused 41), (unused 42), i2c spl slv, @@ -172,7 +172,6 @@ bcm2835_irq_handler(void *frame) pic_do_pending_ints(I32_bit, oldipl, frame); } - static void bcm2835_pic_unblock_irqs(struct pic_softc *pic, size_t irqbase, uint32_t irq_mask)
CVS commit: src/sys/arch/evbarm/rpi
Module Name:src Committed By: skrll Date: Sun Sep 7 15:28:24 UTC 2014 Modified Files: src/sys/arch/evbarm/rpi: rpi_machdep.c Log Message: Grab the DMA channel mask from the firmware. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/arch/evbarm/rpi/rpi_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/rpi/rpi_machdep.c diff -u src/sys/arch/evbarm/rpi/rpi_machdep.c:1.45 src/sys/arch/evbarm/rpi/rpi_machdep.c:1.46 --- src/sys/arch/evbarm/rpi/rpi_machdep.c:1.45 Fri Sep 5 21:22:35 2014 +++ src/sys/arch/evbarm/rpi/rpi_machdep.c Sun Sep 7 15:28:24 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rpi_machdep.c,v 1.45 2014/09/05 21:22:35 macallan Exp $ */ +/* $NetBSD: rpi_machdep.c,v 1.46 2014/09/07 15:28:24 skrll Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rpi_machdep.c,v 1.45 2014/09/05 21:22:35 macallan Exp $); +__KERNEL_RCSID(0, $NetBSD: rpi_machdep.c,v 1.46 2014/09/07 15:28:24 skrll Exp $); #include opt_evbarm_boardtype.h #include opt_ddb.h @@ -177,6 +177,7 @@ static struct __aligned(16) { struct vcprop_tag_macaddr vbt_macaddr; struct vcprop_tag_memory vbt_memory; struct vcprop_tag_boardserial vbt_serial; + struct vcprop_tag_dmachan vbt_dmachan; struct vcprop_tag_cmdline vbt_cmdline; struct vcprop_tag_clockrate vbt_emmcclockrate; struct vcprop_tag_clockrate vbt_armclockrate; @@ -229,6 +230,13 @@ static struct __aligned(16) { .vpt_rcode = VCPROPTAG_REQUEST }, }, + .vbt_dmachan = { + .tag = { + .vpt_tag = VCPROPTAG_GET_DMACHAN, + .vpt_len = VCPROPTAG_LEN(vb.vbt_dmachan), + .vpt_rcode = VCPROPTAG_REQUEST + }, + }, .vbt_cmdline = { .tag = { .vpt_tag = VCPROPTAG_GET_CMDLINE, @@ -457,6 +465,9 @@ rpi_bootparams(void) if (vcprop_tag_success_p(vb.vbt_serial.tag)) printf(%s: board serial %llx\n, __func__, vb.vbt_serial.sn); + if (vcprop_tag_success_p(vb.vbt_dmachan.tag)) + printf(%s: DMA channel mask 0x%08x\n, __func__, + vb.vbt_dmachan.mask); if (vcprop_tag_success_p(vb.vbt_cmdline.tag)) printf(%s: cmdline %s\n, __func__,
CVS commit: src/sys/arch/arm/allwinner
Module Name:src Committed By: jmcneill Date: Sun Sep 7 15:38:06 UTC 2014 Modified Files: src/sys/arch/arm/allwinner: awin_mmc.c awin_reg.h Log Message: replace mmc magic bits with symbolic names To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/allwinner/awin_mmc.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/arm/allwinner/awin_reg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/allwinner/awin_mmc.c diff -u src/sys/arch/arm/allwinner/awin_mmc.c:1.4 src/sys/arch/arm/allwinner/awin_mmc.c:1.5 --- src/sys/arch/arm/allwinner/awin_mmc.c:1.4 Sun Aug 24 21:42:06 2014 +++ src/sys/arch/arm/allwinner/awin_mmc.c Sun Sep 7 15:38:06 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_mmc.c,v 1.4 2014/08/24 21:42:06 skrll Exp $ */ +/* $NetBSD: awin_mmc.c,v 1.5 2014/09/07 15:38:06 jmcneill Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca @@ -29,7 +29,7 @@ #include locators.h #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: awin_mmc.c,v 1.4 2014/08/24 21:42:06 skrll Exp $); +__KERNEL_RCSID(0, $NetBSD: awin_mmc.c,v 1.5 2014/09/07 15:38:06 jmcneill Exp $); #include sys/param.h #include sys/bus.h @@ -236,7 +236,7 @@ awin_mmc_host_reset(sdmmc_chipset_handle #endif MMC_WRITE(sc, AWIN_MMC_GCTRL, - MMC_READ(sc, AWIN_MMC_GCTRL) | __BITS(2,0)); + MMC_READ(sc, AWIN_MMC_GCTRL) | AWIN_MMC_GCTRL_RESET); return 0; } @@ -298,11 +298,13 @@ awin_mmc_update_clock(struct awin_mmc_so uint32_t cmd; int retry; - cmd = __BIT(31) | __BIT(21) | __BIT(13); + cmd = AWIN_MMC_CMD_START | + AWIN_MMC_CMD_UPCLK_ONLY | + AWIN_MMC_CMD_WAIT_PRE_OVER; MMC_WRITE(sc, AWIN_MMC_CMD, cmd); retry = 0xf; while (--retry 0) { - if (!(MMC_READ(sc, AWIN_MMC_CMD) __BIT(31))) + if (!(MMC_READ(sc, AWIN_MMC_CMD) AWIN_MMC_CMD_START)) break; delay(10); } @@ -326,7 +328,7 @@ awin_mmc_bus_clock(sdmmc_chipset_handle_ #endif clkcr = MMC_READ(sc, AWIN_MMC_CLKCR); - clkcr = ~__BIT(16); + clkcr = ~AWIN_MMC_CLKCR_CARDCLKON; MMC_WRITE(sc, AWIN_MMC_CLKCR, clkcr); if (awin_mmc_update_clock(sc) != 0) return 1; @@ -335,13 +337,13 @@ awin_mmc_bus_clock(sdmmc_chipset_handle_ freq_hz = freq * 1000; div = (sc-sc_mod_clk + (freq_hz 1)) / freq_hz / 2; - clkcr = ~__BITS(15,0); + clkcr = ~AWIN_MMC_CLKCR_DIV; clkcr |= div; MMC_WRITE(sc, AWIN_MMC_CLKCR, clkcr); if (awin_mmc_update_clock(sc) != 0) return 1; - clkcr |= __BIT(16); + clkcr |= AWIN_MMC_CLKCR_CARDCLKON; MMC_WRITE(sc, AWIN_MMC_CLKCR, clkcr); if (awin_mmc_update_clock(sc) != 0) return 1; @@ -361,13 +363,13 @@ awin_mmc_bus_width(sdmmc_chipset_handle_ switch (width) { case 1: - MMC_WRITE(sc, AWIN_MMC_WIDTH, 0); + MMC_WRITE(sc, AWIN_MMC_WIDTH, AWIN_MMC_WIDTH_1); break; case 4: - MMC_WRITE(sc, AWIN_MMC_WIDTH, 1); + MMC_WRITE(sc, AWIN_MMC_WIDTH, AWIN_MMC_WIDTH_4); break; case 8: - MMC_WRITE(sc, AWIN_MMC_WIDTH, 2); + MMC_WRITE(sc, AWIN_MMC_WIDTH, AWIN_MMC_WIDTH_8); break; default: return 1; @@ -388,7 +390,8 @@ static int awin_mmc_xfer_wait(struct awin_mmc_softc *sc, struct sdmmc_command *cmd) { int retry = 0xf; - uint32_t bit = (cmd-c_flags SCF_CMD_READ) ? __BIT(2) : __BIT(3); + uint32_t bit = (cmd-c_flags SCF_CMD_READ) ? + AWIN_MMC_STATUS_FIFO_EMPTY : AWIN_MMC_STATUS_FIFO_FULL; while (--retry 0) { uint32_t status = MMC_READ(sc, AWIN_MMC_STATUS); @@ -423,7 +426,7 @@ static void awin_mmc_exec_command(sdmmc_chipset_handle_t sch, struct sdmmc_command *cmd) { struct awin_mmc_softc *sc = sch; - uint32_t cmdval = __BIT(31); + uint32_t cmdval = AWIN_MMC_CMD_START; uint32_t status; int retry; @@ -434,20 +437,20 @@ awin_mmc_exec_command(sdmmc_chipset_hand #endif if (cmd-c_opcode == 0) - cmdval |= __BIT(15); + cmdval |= AWIN_MMC_CMD_SEND_INIT_SEQ; if (cmd-c_flags SCF_RSP_PRESENT) - cmdval |= __BIT(6); + cmdval |= AWIN_MMC_CMD_RSP_EXP; if (cmd-c_flags SCF_RSP_136) - cmdval |= __BIT(7); + cmdval |= AWIN_MMC_CMD_LONG_RSP; if (cmd-c_flags SCF_RSP_CRC) - cmdval |= __BIT(8); + cmdval |= AWIN_MMC_CMD_CHECK_RSP_CRC; if (cmd-c_datalen 0) { unsigned int nblks; - cmdval |= __BIT(9) | __BIT(13); + cmdval |= AWIN_MMC_CMD_DATA_EXP | AWIN_MMC_CMD_WAIT_PRE_OVER; if (!ISSET(cmd-c_flags, SCF_CMD_READ)) { - cmdval |= __BIT(10); + cmdval |= AWIN_MMC_CMD_WRITE; } nblks = cmd-c_datalen / cmd-c_blklen; @@ -455,7 +458,7 @@ awin_mmc_exec_command(sdmmc_chipset_hand ++nblks; if (nblks 1) { - cmdval |= __BIT(12); + cmdval |= AWIN_MMC_CMD_SEND_AUTO_STOP; } MMC_WRITE(sc, AWIN_MMC_BLKSZ, cmd-c_blklen); @@ -471,7 +474,7 @@ awin_mmc_exec_command(sdmmc_chipset_hand MMC_WRITE(sc, AWIN_MMC_CMD, cmdval | cmd-c_opcode); } else { MMC_WRITE(sc, AWIN_MMC_GCTRL, - MMC_READ(sc, AWIN_MMC_GCTRL) | __BIT(31)); + MMC_READ(sc, AWIN_MMC_GCTRL) |
CVS commit: src/sys/arch/arm/allwinner
Module Name:src Committed By: jmcneill Date: Sun Sep 7 17:49:39 UTC 2014 Modified Files: src/sys/arch/arm/allwinner: awin_io.c awin_reg.h files.awin Added Files: src/sys/arch/arm/allwinner: awin_rtc.c Log Message: a10/a20 rtc driver To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/allwinner/awin_io.c \ src/sys/arch/arm/allwinner/files.awin cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/allwinner/awin_reg.h cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/allwinner/awin_rtc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/allwinner/awin_io.c diff -u src/sys/arch/arm/allwinner/awin_io.c:1.10 src/sys/arch/arm/allwinner/awin_io.c:1.11 --- src/sys/arch/arm/allwinner/awin_io.c:1.10 Sat Sep 6 00:15:34 2014 +++ src/sys/arch/arm/allwinner/awin_io.c Sun Sep 7 17:49:39 2014 @@ -31,7 +31,7 @@ #include sys/cdefs.h -__KERNEL_RCSID(1, $NetBSD: awin_io.c,v 1.10 2014/09/06 00:15:34 jmcneill Exp $); +__KERNEL_RCSID(1, $NetBSD: awin_io.c,v 1.11 2014/09/07 17:49:39 jmcneill Exp $); #include sys/param.h #include sys/bus.h @@ -104,6 +104,7 @@ static const struct awin_locators awin_l { com, OFFANDSIZE(UART6), 6, AWIN_IRQ_UART6, AANY }, { com, OFFANDSIZE(UART7), 7, AWIN_IRQ_UART7, AANY }, { awinwdt, OFFANDSIZE(TMR), NOPORT, NOINTR, AANY }, + { awinrtc, OFFANDSIZE(TMR), NOPORT, NOINTR, AANY }, { awinusb, OFFANDSIZE(USB1), 0, NOINTR, AANY }, { awinusb, OFFANDSIZE(USB2), 1, NOINTR, AANY }, { awinmmc, OFFANDSIZE(SDMMC0), 0, AWIN_IRQ_SDMMC0, AANY }, Index: src/sys/arch/arm/allwinner/files.awin diff -u src/sys/arch/arm/allwinner/files.awin:1.10 src/sys/arch/arm/allwinner/files.awin:1.11 --- src/sys/arch/arm/allwinner/files.awin:1.10 Sat Sep 6 00:15:34 2014 +++ src/sys/arch/arm/allwinner/files.awin Sun Sep 7 17:49:39 2014 @@ -1,4 +1,4 @@ -# $NetBSD: files.awin,v 1.10 2014/09/06 00:15:34 jmcneill Exp $ +# $NetBSD: files.awin,v 1.11 2014/09/07 17:49:39 jmcneill Exp $ # # Configuration info for Allwinner ARM Peripherals # @@ -42,6 +42,11 @@ device awinwdt : sysmon_wdog attach awinwdt at awinio with awin_wdt file arch/arm/allwinner/awin_wdt.c awin_wdt | awin_io needs-flag +# A10/A20 RTC +device awinrtc +attach awinrtc at awinio with awin_rtc +file arch/arm/allwinner/awin_rtc.c awin_rtc + # A10 Timers device awintmr attach awintmr at awinio with awin_tmr Index: src/sys/arch/arm/allwinner/awin_reg.h diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.19 src/sys/arch/arm/allwinner/awin_reg.h:1.20 --- src/sys/arch/arm/allwinner/awin_reg.h:1.19 Sun Sep 7 15:38:06 2014 +++ src/sys/arch/arm/allwinner/awin_reg.h Sun Sep 7 17:49:39 2014 @@ -1326,6 +1326,29 @@ #define AWIN_WDOG_MODE_RST_EN __BIT(1) #define AWIN_WDOG_MODE_EN __BIT(0) +#define AWIN_LOSC_CTRL_KEY_FIELD __BITS(31,16) +#define AWIN_LOSC_CTRL_CLK32K_AUTO_SWT_PEND __BIT(15) +#define AWIN_LOSC_CTRL_CLK32K_AUTO_SWT_EN __BIT(14) +#define AWIN_LOSC_CTRL_ALM_DDHHMMSS_ACCE __BIT(9) +#define AWIN_LOSC_CTRL_RTC_HHMMSS_ACCE __BIT(8) +#define AWIN_LOSC_CTRL_RTC_YYMMDD_ACCE __BIT(7) +#define AWIN_LOSC_CTRL_EXT_LOSC_GSM __BITS(3,2) +#define AWIN_LOSC_CTRL_OSC32K_SRC_SEL __BIT(0) +#define AWIN_LOSC_CTRL_BUSY \ + (AWIN_LOSC_CTRL_ALM_DDHHMMSS_ACCE | \ + AWIN_LOSC_CTRL_RTC_HHMMSS_ACCE | \ + AWIN_LOSC_CTRL_RTC_YYMMDD_ACCE) + +#define AWIN_RTC_YY_MM_DD_RTC_SIM_CTRL __BIT(30) +#define AWIN_RTC_YY_MM_DD_LEAP __BIT(24) +#define AWIN_RTC_YY_MM_DD_YEAR __BITS(23,16) +#define AWIN_RTC_YY_MM_DD_MONTH __BITS(11,8) +#define AWIN_RTC_YY_MM_DD_DAY __BITS(4,0) +#define AWIN_RTC_HH_MM_SS_WK_NO __BITS(31,29) +#define AWIN_RTC_HH_MM_SS_HOUR __BITS(20,16) +#define AWIN_RTC_HH_MM_SS_MINUTE __BITS(13,8) +#define AWIN_RTC_HH_MM_SS_SECOND __BITS(5,0) + #define AWIN_TWI_ADDR_REG 0x #define AWIN_TWI_XADDR_REG 0x0004 #define AWIN_TWI_DATA_REG 0x0008 Added files: Index: src/sys/arch/arm/allwinner/awin_rtc.c diff -u /dev/null src/sys/arch/arm/allwinner/awin_rtc.c:1.1 --- /dev/null Sun Sep 7 17:49:39 2014 +++ src/sys/arch/arm/allwinner/awin_rtc.c Sun Sep 7 17:49:39 2014 @@ -0,0 +1,143 @@ +/* $NetBSD: awin_rtc.c,v 1.1 2014/09/07 17:49:39 jmcneill Exp $ */ + +/*- + * Copyright (c) 2014 Jared D. McNeill jmcne...@invisible.ca + * 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
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Sun Sep 7 17:50:01 UTC 2014 Modified Files: src/sys/arch/evbarm/conf: CUBIEBOARD Log Message: add awinrtc To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/evbarm/conf/CUBIEBOARD Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/CUBIEBOARD diff -u src/sys/arch/evbarm/conf/CUBIEBOARD:1.21 src/sys/arch/evbarm/conf/CUBIEBOARD:1.22 --- src/sys/arch/evbarm/conf/CUBIEBOARD:1.21 Sat Sep 6 16:55:50 2014 +++ src/sys/arch/evbarm/conf/CUBIEBOARD Sun Sep 7 17:50:01 2014 @@ -1,5 +1,5 @@ # -# $NetBSD: CUBIEBOARD,v 1.21 2014/09/06 16:55:50 jmcneill Exp $ +# $NetBSD: CUBIEBOARD,v 1.22 2014/09/07 17:50:01 jmcneill Exp $ # # CUBIEBOARD -- Allwinner A10/A20 Eval Board Kernel # @@ -232,6 +232,9 @@ awintmr0 at awinio? # Watchdog timers awinwdt* at awinio? +# RTC +awinrtc* at awinio? + # onboard audio codec awinac0 at awinio0 audio0 at awinac0
CVS commit: src
Module Name:src Committed By: skrll Date: Sun Sep 7 20:17:57 UTC 2014 Modified Files: src/etc/etc.evbarm: Makefile.inc Added Files: src/sys/arch/evbarm/conf: BPI_INSTALL Log Message: Add BPI to the list of kernels to build. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/etc/etc.evbarm/Makefile.inc cvs rdiff -u -r0 -r1.1 src/sys/arch/evbarm/conf/BPI_INSTALL Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/etc.evbarm/Makefile.inc diff -u src/etc/etc.evbarm/Makefile.inc:1.63 src/etc/etc.evbarm/Makefile.inc:1.64 --- src/etc/etc.evbarm/Makefile.inc:1.63 Fri Jul 25 11:22:50 2014 +++ src/etc/etc.evbarm/Makefile.inc Sun Sep 7 20:17:57 2014 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.63 2014/07/25 11:22:50 hkenken Exp $ +# $NetBSD: Makefile.inc,v 1.64 2014/09/07 20:17:57 skrll Exp $ # # etc.evbarm/Makefile.inc -- evbarm-specific etc Makefile targets # @@ -21,6 +21,8 @@ EVBARM_BOARDS.armv7+= BCM5301X EVBARM_BOARDS.armv7hf+= BCM5301X #EVBARM_BOARDS.armv7+= BCM56340 #EVBARM_BOARDS.armv7hf+= BCM56340 +EVBARM_BOARDS.armv7+= BPI +EVBARM_BOARDS.armv7hf+= BPI EVBARM_BOARDS.armv7+= CUBIEBOARD EVBARM_BOARDS.armv7hf+= CUBIEBOARD .else @@ -78,6 +80,8 @@ EVBARM_BOARDS.armv7+= BEAGLEBOARDXM EVBARM_BOARDS.armv7hf+= BEAGLEBOARDXM EVBARM_BOARDS.armv7+= BEAGLEBONE EVBARM_BOARDS.armv7hf+= BEAGLEBONE +EVBARM_BOARDS.armv7+= BPI +EVBARM_BOARDS.armv7hf+= BPI EVBARM_BOARDS.armv7+= CUBIEBOARD EVBARM_BOARDS.armv7hf+= CUBIEBOARD #EVBARM_BOARDS.armv7+= IGEPV2 Added files: Index: src/sys/arch/evbarm/conf/BPI_INSTALL diff -u /dev/null src/sys/arch/evbarm/conf/BPI_INSTALL:1.1 --- /dev/null Sun Sep 7 20:17:57 2014 +++ src/sys/arch/evbarm/conf/BPI_INSTALL Sun Sep 7 20:17:57 2014 @@ -0,0 +1,10 @@ +# $NetBSD: BPI_INSTALL,v 1.1 2014/09/07 20:17:57 skrll Exp $ +# +# BPI_INSTALL -- BPI kernel with installation-sized ramdisk +# + +include arch/evbarm/conf/BPI +include arch/evbarm/conf/INSTALL + +options BOOTHOWTO=RB_SINGLE +no makeoptions DEBUG
CVS commit: src/sys/arch/arm/allwinner
Module Name:src Committed By: jmcneill Date: Sun Sep 7 21:54:08 UTC 2014 Modified Files: src/sys/arch/arm/allwinner: awin_reg.h Log Message: add MMC IDMA descriptor To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/allwinner/awin_reg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/allwinner/awin_reg.h diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.20 src/sys/arch/arm/allwinner/awin_reg.h:1.21 --- src/sys/arch/arm/allwinner/awin_reg.h:1.20 Sun Sep 7 17:49:39 2014 +++ src/sys/arch/arm/allwinner/awin_reg.h Sun Sep 7 21:54:08 2014 @@ -719,6 +719,20 @@ #define AWIN_MMC_IDST_RECEIVE_INT __BIT(1) #define AWIN_MMC_IDST_TRANSMIT_INT __BIT(0) +struct awin_mmc_idma_descriptor { + uint32_t dma_config; +#define AWIN_MMC_IDMA_CONFIG_DIC __BIT(1) +#define AWIN_MMC_IDMA_CONFIG_LD __BIT(2) +#define AWIN_MMC_IDMA_CONFIG_FD __BIT(3) +#define AWIN_MMC_IDMA_CONFIG_CH __BIT(4) +#define AWIN_MMC_IDMA_CONFIG_ER __BIT(5) +#define AWIN_MMC_IDMA_CONFIG_CES __BIT(30) +#define AWIN_MMC_IDMA_CONFIG_OWN __BIT(31) + uint32_t dma_buf_size; + uint32_t dma_buf_addr; + uint32_t dma_next; +} __packed; + #define AWIN_CPUCFG_CPU0_RST_CTRL_REG 0x0040 #define AWIN_CPUCFG_CPU0_CTRL_REG 0x0044 #define AWIN_CPUCFG_CPU0_STATUS_REG 0x0048
CVS commit: src/sys/arch/arm/allwinner
Module Name:src Committed By: jmcneill Date: Sun Sep 7 22:06:36 UTC 2014 Modified Files: src/sys/arch/arm/allwinner: awin_reg.h Log Message: wrap awin_mmc_idma_descriptor in ifndef _LOCORE To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/sys/arch/arm/allwinner/awin_reg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/allwinner/awin_reg.h diff -u src/sys/arch/arm/allwinner/awin_reg.h:1.21 src/sys/arch/arm/allwinner/awin_reg.h:1.22 --- src/sys/arch/arm/allwinner/awin_reg.h:1.21 Sun Sep 7 21:54:08 2014 +++ src/sys/arch/arm/allwinner/awin_reg.h Sun Sep 7 22:06:36 2014 @@ -156,10 +156,16 @@ /* A10/A20 SRAM Controller */ #define AWIN_SRAM_CTL0_REG 0x #define AWIN_SRAM_CTL1_REG 0x0004 +#define AWIN_SRAM_VER_REG 0x0024 #define AWIN_SRAM_CTL1_A3_A4 __BITS(5,4) #define AWIN_SRAM_CTL1_A3_A4_EMAC 1 +#define AWIN_SRAM_VER_KEY_FIELD __BITS(31,16) +#define AWIN_SRAM_VER_R_EN __BIT(15) +#define AWIN_SRAM_VER_BOOT_SEL_PAD_STA __BIT(8) +#define AWIN_SRAM_VER_BITS __BITS(7,0) + /* A10/A20 DRAM Controller */ #define AWIN_DRAM_CCR_REG 0x #define AWIN_DRAM_DCR_REG 0x0004 @@ -719,6 +725,7 @@ #define AWIN_MMC_IDST_RECEIVE_INT __BIT(1) #define AWIN_MMC_IDST_TRANSMIT_INT __BIT(0) +#if !defined(_LOCORE) struct awin_mmc_idma_descriptor { uint32_t dma_config; #define AWIN_MMC_IDMA_CONFIG_DIC __BIT(1) @@ -732,6 +739,7 @@ struct awin_mmc_idma_descriptor { uint32_t dma_buf_addr; uint32_t dma_next; } __packed; +#endif #define AWIN_CPUCFG_CPU0_RST_CTRL_REG 0x0040 #define AWIN_CPUCFG_CPU0_CTRL_REG 0x0044
CVS commit: src/sys/arch/arm/allwinner
Module Name:src Committed By: jmcneill Date: Sun Sep 7 22:21:36 UTC 2014 Modified Files: src/sys/arch/arm/allwinner: awin_board.c awin_var.h Log Message: add chip id functions To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/allwinner/awin_board.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/allwinner/awin_var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/allwinner/awin_board.c diff -u src/sys/arch/arm/allwinner/awin_board.c:1.16 src/sys/arch/arm/allwinner/awin_board.c:1.17 --- src/sys/arch/arm/allwinner/awin_board.c:1.16 Thu Sep 4 02:36:08 2014 +++ src/sys/arch/arm/allwinner/awin_board.c Sun Sep 7 22:21:36 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_board.c,v 1.16 2014/09/04 02:36:08 jmcneill Exp $ */ +/* $NetBSD: awin_board.c,v 1.17 2014/09/07 22:21:36 jmcneill Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -35,7 +35,7 @@ #include sys/cdefs.h -__KERNEL_RCSID(1, $NetBSD: awin_board.c,v 1.16 2014/09/04 02:36:08 jmcneill Exp $); +__KERNEL_RCSID(1, $NetBSD: awin_board.c,v 1.17 2014/09/07 22:21:36 jmcneill Exp $); #include sys/param.h #include sys/bus.h @@ -240,6 +240,42 @@ awin_memprobe(void) return memsize; } +uint16_t +awin_chip_id(void) +{ + static uint16_t chip_id = 0; + uint32_t ver; + + if (!chip_id) { + ver = bus_space_read_4(awin_bs_tag, awin_core_bsh, + AWIN_SRAM_OFFSET + AWIN_SRAM_VER_REG); + ver |= AWIN_SRAM_VER_R_EN; + bus_space_write_4(awin_bs_tag, awin_core_bsh, + AWIN_SRAM_OFFSET + AWIN_SRAM_VER_REG, ver); + ver = bus_space_read_4(awin_bs_tag, awin_core_bsh, + AWIN_SRAM_OFFSET + AWIN_SRAM_VER_REG); + + chip_id = __SHIFTOUT(ver, AWIN_SRAM_VER_KEY_FIELD); + } + + return chip_id; +} + +const char * +awin_chip_name(void) +{ + uint16_t chip_id = awin_chip_id(); + + switch (chip_id) { + case AWIN_CHIP_ID_A10: return A10; + case AWIN_CHIP_ID_A13: return A13; + case AWIN_CHIP_ID_A20: return A20; + case AWIN_CHIP_ID_A23: return A23; + case AWIN_CHIP_ID_A31: return A31; + default: return unknown chip; + } +} + void awin_pll6_enable(void) { Index: src/sys/arch/arm/allwinner/awin_var.h diff -u src/sys/arch/arm/allwinner/awin_var.h:1.13 src/sys/arch/arm/allwinner/awin_var.h:1.14 --- src/sys/arch/arm/allwinner/awin_var.h:1.13 Sat Sep 6 17:10:17 2014 +++ src/sys/arch/arm/allwinner/awin_var.h Sun Sep 7 22:21:36 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: awin_var.h,v 1.13 2014/09/06 17:10:17 jmcneill Exp $ */ +/* $NetBSD: awin_var.h,v 1.14 2014/09/07 22:21:36 jmcneill Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. * All rights reserved. @@ -92,6 +92,14 @@ void awin_pll2_enable(void); void awin_pll6_enable(void); void awin_cpu_hatch(struct cpu_info *); +#define AWIN_CHIP_ID_A10 0x1623 +#define AWIN_CHIP_ID_A13 0x1625 +#define AWIN_CHIP_ID_A31 0x1633 +#define AWIN_CHIP_ID_A23 0x1650 +#define AWIN_CHIP_ID_A20 0x1651 +uint16_t awin_chip_id(void); +const char *awin_chip_name(void); + void awin_gpio_init(void); bool awin_gpio_pinset_available(const struct awin_gpio_pinset *); void awin_gpio_pinset_acquire(const struct awin_gpio_pinset *);
CVS commit: src/sys/arch/arm/allwinner
Module Name:src Committed By: jmcneill Date: Sun Sep 7 22:22:35 UTC 2014 Modified Files: src/sys/arch/arm/allwinner: awin_io.c Log Message: print chip name and id on attach, and use chip id instead of cpu id to determine device attachment To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/allwinner/awin_io.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/allwinner/awin_io.c diff -u src/sys/arch/arm/allwinner/awin_io.c:1.11 src/sys/arch/arm/allwinner/awin_io.c:1.12 --- src/sys/arch/arm/allwinner/awin_io.c:1.11 Sun Sep 7 17:49:39 2014 +++ src/sys/arch/arm/allwinner/awin_io.c Sun Sep 7 22:22:35 2014 @@ -31,7 +31,7 @@ #include sys/cdefs.h -__KERNEL_RCSID(1, $NetBSD: awin_io.c,v 1.11 2014/09/07 17:49:39 jmcneill Exp $); +__KERNEL_RCSID(1, $NetBSD: awin_io.c,v 1.12 2014/09/07 22:22:35 jmcneill Exp $); #include sys/param.h #include sys/bus.h @@ -146,8 +146,10 @@ static void awinio_attach(device_t parent, device_t self, void *aux) { struct awinio_softc * const sc = awinio_sc; - const bool a10_p = CPU_ID_CORTEX_A8_P(curcpu()-ci_arm_cpuid); - const bool a20_p = CPU_ID_CORTEX_A7_P(curcpu()-ci_arm_cpuid); + uint16_t chip_id = awin_chip_id(); + const char *chip_name = awin_chip_name(); + const bool a10_p = chip_id == AWIN_CHIP_ID_A10; + const bool a20_p = chip_id == AWIN_CHIP_ID_A20; prop_dictionary_t dict = device_properties(self); sc-sc_dev = self; @@ -162,7 +164,7 @@ awinio_attach(device_t parent, device_t sc-sc_ccm_bsh); aprint_naive(\n); - aprint_normal(\n); + aprint_normal(: %s (0x%04x)\n, chip_name, chip_id); const struct awin_locators * const eloc = awin_locators + __arraycount(awin_locators);
CVS commit: src/sys/arch/amiga/dev
Module Name:src Committed By: phx Date: Sun Sep 7 22:24:40 UTC 2014 Modified Files: src/sys/arch/amiga/dev: gayle_pcmcia.c Log Message: According to http://eab.abime.net/showpost.php?p=782840postcount=115 there are two methods for a Gayle PCMCIA soft-reset. pccard_attach() only implemented a method with works on A600 and some older (?) A1200 models. I added the second method as well, to make the reset work in any case. Tested on the latest A1200 model, which failed before. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amiga/dev/gayle_pcmcia.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/amiga/dev/gayle_pcmcia.c diff -u src/sys/arch/amiga/dev/gayle_pcmcia.c:1.29 src/sys/arch/amiga/dev/gayle_pcmcia.c:1.30 --- src/sys/arch/amiga/dev/gayle_pcmcia.c:1.29 Wed Jan 22 00:25:16 2014 +++ src/sys/arch/amiga/dev/gayle_pcmcia.c Sun Sep 7 22:24:40 2014 @@ -1,9 +1,9 @@ -/* $NetBSD: gayle_pcmcia.c,v 1.29 2014/01/22 00:25:16 christos Exp $ */ +/* $NetBSD: gayle_pcmcia.c,v 1.30 2014/09/07 22:24:40 phx Exp $ */ /* public domain */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: gayle_pcmcia.c,v 1.29 2014/01/22 00:25:16 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: gayle_pcmcia.c,v 1.30 2014/09/07 22:24:40 phx Exp $); /* PCMCIA front-end driver for A1200's and A600's. */ @@ -206,6 +206,11 @@ pccard_attach(device_t parent, device_t /* reset the card if it's already there */ if (gayle_pcmcia_status_read() GAYLE_CCMEM_DETECT) { volatile u_int8_t x; + + gayle_intr_ack(0xff); + delay(500); + gayle_intr_ack(0xfc); + *reset_card_reg = 0x0; delay(1000); x = *reset_card_reg;
CVS commit: src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: matt Date: Sun Sep 7 23:03:12 UTC 2014 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915: i915_debugfs.c i915_dma.c i915_drv.h i915_irq.c i915_ums.c intel_crt.c intel_ddi.c intel_display.c intel_dp.c intel_drv.h intel_dsi.c intel_dsi_cmd.c intel_dvo.c intel_hdmi.c intel_lvds.c intel_panel.c intel_pm.c intel_sdvo.c intel_sideband.c intel_sprite.c intel_tv.c Log Message: Change enum pipe to enum i915_pipe (enum pipe uses too global of a tag and conflicts with struct pipe). To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.2 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_dvo.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_sprite.c cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_display.c cvs rdiff -u -r1.8 -r1.9 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c cvs rdiff -u -r1.1.1.1 -r1.2 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_ums.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_dsi_cmd.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_sideband.c cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/dist/drm/i915/intel_crt.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_panel.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_pm.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/dist/drm/i915/intel_drv.h cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/i915/intel_dsi.c cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c \ src/sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c:1.1.1.2 src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c:1.2 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c:1.1.1.2 Wed Jul 16 19:35:25 2014 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_debugfs.c Sun Sep 7 23:03:11 2014 @@ -2360,7 +2360,7 @@ static int i915_display_info(struct seq_ struct pipe_crc_info { const char *name; struct drm_device *dev; - enum pipe pipe; + enum i915_pipe pipe; }; static int i915_pipe_crc_open(struct inode *inode, struct file *filep) @@ -2511,7 +2511,7 @@ static struct pipe_crc_info i915_pipe_cr }; static int i915_pipe_crc_create(struct dentry *root, struct drm_minor *minor, -enum pipe pipe) +enum i915_pipe pipe) { struct drm_device *dev = minor-dev; struct dentry *ent; @@ -2585,7 +2585,7 @@ static int i8xx_pipe_crc_ctl_reg(enum in return 0; } -static int i9xx_pipe_crc_auto_source(struct drm_device *dev, enum pipe pipe, +static int i9xx_pipe_crc_auto_source(struct drm_device *dev, enum i915_pipe pipe, enum intel_pipe_crc_source *source) { struct intel_encoder *encoder; @@ -2637,7 +2637,7 @@ static int i9xx_pipe_crc_auto_source(str } static int vlv_pipe_crc_ctl_reg(struct drm_device *dev, -enum pipe pipe, +enum i915_pipe pipe, enum intel_pipe_crc_source *source, uint32_t *val) { @@ -2694,7 +2694,7 @@ static int vlv_pipe_crc_ctl_reg(struct d } static int i9xx_pipe_crc_ctl_reg(struct drm_device *dev, - enum pipe pipe, + enum i915_pipe pipe, enum intel_pipe_crc_source *source, uint32_t *val) { @@ -2770,7 +2770,7 @@ static int i9xx_pipe_crc_ctl_reg(struct } static void vlv_undo_pipe_scramble_reset(struct drm_device *dev, - enum pipe pipe) + enum i915_pipe pipe) { struct drm_i915_private *dev_priv = dev-dev_private; uint32_t tmp = I915_READ(PORT_DFT2_G4X); @@ -2786,7 +2786,7 @@ static void vlv_undo_pipe_scramble_reset } static void g4x_undo_pipe_scramble_reset(struct drm_device *dev, - enum pipe pipe) + enum i915_pipe pipe) { struct drm_i915_private *dev_priv = dev-dev_private; uint32_t tmp = I915_READ(PORT_DFT2_G4X); @@ -2855,7 +2855,7 @@ static int ivb_pipe_crc_ctl_reg(enum int return 0; } -static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe, +static int pipe_crc_set_source(struct drm_device *dev, enum i915_pipe pipe, enum intel_pipe_crc_source source) { struct drm_i915_private *dev_priv = dev-dev_private; @@ -2996,7 +2996,7 @@ display_crc_ctl_parse_object(const char return -EINVAL; } -static int display_crc_ctl_parse_pipe(const char *buf, enum pipe *pipe) +static int display_crc_ctl_parse_pipe(const char