From owner-svn-soc-all@FreeBSD.ORG Sun Jun 14 02:41:55 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB02E473 for ; Sun, 14 Jun 2015 02:41:54 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCD37EE3 for ; Sun, 14 Jun 2015 02:41:54 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5E2fssj068171 for ; Sun, 14 Jun 2015 02:41:54 GMT (envelope-from btw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5E2frU2068164 for svn-soc-all@FreeBSD.org; Sun, 14 Jun 2015 02:41:53 GMT (envelope-from btw@FreeBSD.org) Date: Sun, 14 Jun 2015 02:41:53 GMT Message-Id: <201506140241.t5E2frU2068164@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to btw@FreeBSD.org using -f From: btw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287061 - soc2015/btw/head/sys/netinet6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2015 02:41:55 -0000 Author: btw Date: Sun Jun 14 02:41:53 2015 New Revision: 287061 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287061 Log: Implement the IPv6 RSS software hash function: * rss_proto_software_hash_v6 - hash the given source/destination IPv6 address, port and direction. Modified: soc2015/btw/head/sys/netinet6/in6_rss.c soc2015/btw/head/sys/netinet6/in6_rss.h Modified: soc2015/btw/head/sys/netinet6/in6_rss.c ============================================================================== --- soc2015/btw/head/sys/netinet6/in6_rss.c Sun Jun 14 00:31:22 2015 (r287060) +++ soc2015/btw/head/sys/netinet6/in6_rss.c Sun Jun 14 02:41:53 2015 (r287061) @@ -101,3 +101,52 @@ datalen += sizeof(dstport); return (rss_hash(datalen, data)); } + +/* + * Calculate an appropriate ipv6 2-tuple or 4-tuple given the given + * IPv6 source/destination address, UDP or TCP source/destination ports + * and the protocol type. + * + * The protocol code may wish to do a software hash of the given + * tuple. This depends upon the currently configured RSS hash types. + * + * This assumes that the packet in question isn't a fragment. + * + * It also assumes the packet source/destination address + * are in "incoming" packet order (ie, source is "far" address.) + */ +int +rss_proto_software_hash_v6(const struct in6_addr *s, const struct in6_addr *d, + u_short sp, u_short dp, int proto, + uint32_t *hashval, uint32_t *hashtype) +{ + uint32_t hash; + + /* + * Next, choose the hash type depending upon the protocol + * identifier. + */ + if ((proto == IPPROTO_TCP) && + (rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6)) { + hash = rss_hash_ip6_4tuple(s, sp, d, dp); + *hashval = hash; + *hashtype = M_HASHTYPE_RSS_TCP_IPV6; + return (0); + } else if ((proto == IPPROTO_UDP) && + (rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6)) { + hash = rss_hash_ip6_4tuple(s, sp, d, dp); + *hashval = hash; + *hashtype = M_HASHTYPE_RSS_UDP_IPV6; + return (0); + } else if (rss_gethashconfig() & RSS_HASHTYPE_RSS_IPV6) { + /* RSS doesn't hash on other protocols like SCTP; so 2-tuple */ + hash = rss_hash_ip6_2tuple(s, d); + *hashval = hash; + *hashtype = M_HASHTYPE_RSS_IPV6; + return (0); + } + + /* No configured available hashtypes! */ + printf("%s: no available hashtypes!\n", __func__); + return (-1); +} Modified: soc2015/btw/head/sys/netinet6/in6_rss.h ============================================================================== --- soc2015/btw/head/sys/netinet6/in6_rss.h Sun Jun 14 00:31:22 2015 (r287060) +++ soc2015/btw/head/sys/netinet6/in6_rss.h Sun Jun 14 02:41:53 2015 (r287061) @@ -42,4 +42,13 @@ uint32_t rss_hash_ip6_2tuple(const struct in6_addr *src, const struct in6_addr *dst); +/* + * Functions to calculate a software RSS hash for a given mbuf or + * packet detail. + */ +int rss_proto_software_hash_v6(const struct in6_addr *src, + const struct in6_addr *dst, u_short src_port, + u_short dst_port, int proto, uint32_t *hashval, + uint32_t *hashtype); + #endif /* !_NETINET6_IN6_RSS_H_ */ From owner-svn-soc-all@FreeBSD.ORG Sun Jun 14 03:05:04 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7218CC5D for ; Sun, 14 Jun 2015 03:05:04 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 603C26DD for ; Sun, 14 Jun 2015 03:05:04 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5E354kx099537 for ; Sun, 14 Jun 2015 03:05:04 GMT (envelope-from btw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5E353GF098924 for svn-soc-all@FreeBSD.org; Sun, 14 Jun 2015 03:05:03 GMT (envelope-from btw@FreeBSD.org) Date: Sun, 14 Jun 2015 03:05:03 GMT Message-Id: <201506140305.t5E353GF098924@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to btw@FreeBSD.org using -f From: btw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287063 - soc2015/btw/head/tools/tools/mq-testing/vme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2015 03:05:04 -0000 Author: btw Date: Sun Jun 14 03:05:03 2015 New Revision: 287063 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287063 Log: Add the supports for hashing the IPv6 packets to vme. Modified: soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c Modified: soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c ============================================================================== --- soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c Sun Jun 14 02:21:19 2015 (r287062) +++ soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c Sun Jun 14 03:05:03 2015 (r287063) @@ -73,9 +73,12 @@ #include #include #include +#include #include #include +#include + #include "if_vme.h" /* @@ -1111,6 +1114,8 @@ if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && (m = m_pullup(m, hdrlen)) == NULL)) return; + eh = mtod(m, struct ether_header *); + ip = (const struct ip *)(eh + 1); uh = (const struct udphdr *)((c_caddr_t)ip + iphlen); rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst, uh->uh_sport, uh->uh_dport, proto, hashval, @@ -1121,6 +1126,8 @@ if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && (m = m_pullup(m, hdrlen)) == NULL)) return; + eh = mtod(m, struct ether_header *); + ip = (const struct ip *)(eh + 1); th = (const struct tcphdr *)((c_caddr_t)ip + iphlen); rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst, th->th_sport, th->th_dport, proto, hashval, @@ -1137,6 +1144,54 @@ static void vmersshash_v6(struct mbuf *m, uint32_t *hashval, uint32_t *hashtype) { + const struct ether_header *eh; + const struct ip6_hdr *ip6; + const struct tcphdr *th; + const struct udphdr *uh; + int hdrlen; + uint8_t proto; + + hdrlen = sizeof(*eh) + sizeof(*ip6); + + if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && + (m = m_pullup(m, hdrlen)) == NULL)) + return; + + eh = mtod(m, struct ether_header *); + ip6 = (const struct ip6_hdr *)(eh + 1); + proto = ip6->ip6_nxt; + + if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6) && + (proto == IPPROTO_UDP)) { + hdrlen += sizeof(*uh); + if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && + (m = m_pullup(m, hdrlen)) == NULL)) + return; + eh = mtod(m, struct ether_header *); + ip6 = (const struct ip6_hdr *)(eh + 1); + uh = (const struct udphdr *)(ip6 + 1); + rss_proto_software_hash_v6(&ip6->ip6_src, &ip6->ip6_dst, + uh->uh_sport, uh->uh_dport, proto, hashval, + hashtype); + } else if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6) && + (proto == IPPROTO_TCP)) { + hdrlen += sizeof(*th); + if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && + (m = m_pullup(m, hdrlen)) == NULL)) + return; + eh = mtod(m, struct ether_header *); + ip6 = (const struct ip6_hdr *)(eh + 1); + th = (const struct tcphdr *)(ip6 + 1); + rss_proto_software_hash_v6(&ip6->ip6_src, &ip6->ip6_dst, + th->th_sport, th->th_dport, proto, hashval, + hashtype); + } else if (rss_gethashconfig() & RSS_HASHTYPE_RSS_IPV6) { + rss_proto_software_hash_v6(&ip6->ip6_src, &ip6->ip6_dst, + 0 /* src port */, 0 /* dst port */, 0 /* proto */, + hashval, hashtype); + } else { + printf("%s: no available hashtypes!\n", __func__); + } } static void From owner-svn-soc-all@FreeBSD.ORG Sun Jun 14 03:22:53 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CF17366 for ; Sun, 14 Jun 2015 03:22:53 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FE1FB73 for ; Sun, 14 Jun 2015 03:22:53 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5E3Mrm0094011 for ; Sun, 14 Jun 2015 03:22:53 GMT (envelope-from btw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5E3MqPO093981 for svn-soc-all@FreeBSD.org; Sun, 14 Jun 2015 03:22:52 GMT (envelope-from btw@FreeBSD.org) Date: Sun, 14 Jun 2015 03:22:52 GMT Message-Id: <201506140322.t5E3MqPO093981@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to btw@FreeBSD.org using -f From: btw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287064 - soc2015/btw/head/tools/tools/mq-testing/vme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2015 03:22:53 -0000 Author: btw Date: Sun Jun 14 03:22:52 2015 New Revision: 287064 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287064 Log: Don't pull up the mbuf in vmersshash and the likes, m_pullup may reallocate the memory. Modified: soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c Modified: soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c ============================================================================== --- soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c Sun Jun 14 03:05:03 2015 (r287063) +++ soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c Sun Jun 14 03:22:52 2015 (r287064) @@ -1096,8 +1096,7 @@ hdrlen = sizeof(*eh) + sizeof(*ip); - if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && - (m = m_pullup(m, hdrlen)) == NULL)) + if (m->m_len < hdrlen) return; eh = mtod(m, struct ether_header *); @@ -1111,11 +1110,8 @@ if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV4) && (proto == IPPROTO_UDP) && (is_frag == 0)) { hdrlen += iphlen - sizeof(*ip) + sizeof(*uh); - if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && - (m = m_pullup(m, hdrlen)) == NULL)) + if (m->m_len < hdrlen) return; - eh = mtod(m, struct ether_header *); - ip = (const struct ip *)(eh + 1); uh = (const struct udphdr *)((c_caddr_t)ip + iphlen); rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst, uh->uh_sport, uh->uh_dport, proto, hashval, @@ -1123,11 +1119,8 @@ } else if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV4) && (proto == IPPROTO_TCP) && (is_frag == 0)) { hdrlen += iphlen - sizeof(*ip) + sizeof(*th); - if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && - (m = m_pullup(m, hdrlen)) == NULL)) + if (m->m_len < hdrlen) return; - eh = mtod(m, struct ether_header *); - ip = (const struct ip *)(eh + 1); th = (const struct tcphdr *)((c_caddr_t)ip + iphlen); rss_proto_software_hash_v4(ip->ip_src, ip->ip_dst, th->th_sport, th->th_dport, proto, hashval, @@ -1153,8 +1146,7 @@ hdrlen = sizeof(*eh) + sizeof(*ip6); - if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && - (m = m_pullup(m, hdrlen)) == NULL)) + if (m->m_len < hdrlen) return; eh = mtod(m, struct ether_header *); @@ -1164,11 +1156,8 @@ if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6) && (proto == IPPROTO_UDP)) { hdrlen += sizeof(*uh); - if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && - (m = m_pullup(m, hdrlen)) == NULL)) + if (m->m_len < hdrlen) return; - eh = mtod(m, struct ether_header *); - ip6 = (const struct ip6_hdr *)(eh + 1); uh = (const struct udphdr *)(ip6 + 1); rss_proto_software_hash_v6(&ip6->ip6_src, &ip6->ip6_dst, uh->uh_sport, uh->uh_dport, proto, hashval, @@ -1176,11 +1165,8 @@ } else if ((rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6) && (proto == IPPROTO_TCP)) { hdrlen += sizeof(*th); - if (m->m_pkthdr.len < hdrlen || (m->m_len < hdrlen && - (m = m_pullup(m, hdrlen)) == NULL)) + if (m->m_len < hdrlen) return; - eh = mtod(m, struct ether_header *); - ip6 = (const struct ip6_hdr *)(eh + 1); th = (const struct tcphdr *)(ip6 + 1); rss_proto_software_hash_v6(&ip6->ip6_src, &ip6->ip6_dst, th->th_sport, th->th_dport, proto, hashval, From owner-svn-soc-all@FreeBSD.ORG Sun Jun 14 09:54:49 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ADFA302 for ; Sun, 14 Jun 2015 09:54:49 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88690DF7 for ; Sun, 14 Jun 2015 09:54:49 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5E9snTZ092727 for ; Sun, 14 Jun 2015 09:54:49 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5E9snfc092709 for svn-soc-all@FreeBSD.org; Sun, 14 Jun 2015 09:54:49 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Sun, 14 Jun 2015 09:54:49 GMT Message-Id: <201506140954.t5E9snfc092709@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287079 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2015 09:54:49 -0000 Author: pratiksinghal Date: Sun Jun 14 09:54:48 2015 New Revision: 287079 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287079 Log: Changed the wrong value of ACCESS_BY_DMA Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.h Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.h ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.h Sun Jun 14 08:33:14 2015 (r287078) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.h Sun Jun 14 09:54:48 2015 (r287079) @@ -66,7 +66,7 @@ #define A10_MMC_DMA_ENABLE (1U << 5) #define A10_MMC_DEBOUNCE_ENABLE (1U << 8) #define A10_MMC_DDR_MODE (1U << 10) -#define A10_MMC_ACCESS_BY_DMA (1U << 30) +#define A10_MMC_ACCESS_BY_DMA (0U << 31) /*Change from previous value of 1U << 30, source : linux-sunxi*/ #define A10_MMC_ACCESS_BY_AHB (1U << 31) #define A10_MMC_RESET \ (A10_MMC_SOFT_RESET | A10_MMC_FIFO_RESET | A10_MMC_DMA_RESET) @@ -198,7 +198,6 @@ struct a10_mmc_cb { - uint32_t nsegs ; bus_addr_t addr ; bus_dma_segment_t* segs ; } ; From owner-svn-soc-all@FreeBSD.ORG Sun Jun 14 09:57:48 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B6301345 for ; Sun, 14 Jun 2015 09:57:48 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3662E09 for ; Sun, 14 Jun 2015 09:57:48 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5E9vmKF094212 for ; Sun, 14 Jun 2015 09:57:48 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5E9vmuN094181 for svn-soc-all@FreeBSD.org; Sun, 14 Jun 2015 09:57:48 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Sun, 14 Jun 2015 09:57:48 GMT Message-Id: <201506140957.t5E9vmuN094181@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287080 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2015 09:57:48 -0000 Author: pratiksinghal Date: Sun Jun 14 09:57:47 2015 New Revision: 287080 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287080 Log: DMA transfer interrupt coming but 2 problems still remain :- 1) Interrupt storm 2) Timeout in raw interrupt register Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sun Jun 14 09:54:48 2015 (r287079) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sun Jun 14 09:57:47 2015 (r287080) @@ -57,10 +57,11 @@ #define A10_MMC_IRQRES 1 #define A10_MMC_RESSZ 2 #define A10_MMC_NDESC 16 -#define A10_DMA_NSEGS 16 +#define A10_DMA_NSEGS 16 #define A10_DMA_BUFF_SIZE 512 #define A10_MMC_DMA_FTRGLEVEL_A20 0x20070008 #define A10_MMC_DMA_FTRGLEVEL_A10 0x00070208 +#define A10_MMC_DMA_MAXLEN 0x1000 struct a10_mmc_softc { bus_space_handle_t a10_bsh; @@ -92,8 +93,9 @@ int a10_dma_ndesc; void* a10_dma_desc ; /* Contains the kva of the descriptor which we will pass to DLBA */ int a10_dma_ops ; /* Which type of operation DMA is performing ? 0:read, 1:write, 2:other */ - bus_dma_tag_t a10_dma_buff_tag ; - bus_dmamap_t a10_dma_buff_map ; + bus_dma_tag_t a10_dma_buff_tag ; + bus_dmamap_t a10_dma_buff_map ; + bus_addr_t a10_dma_buff_addr ; }; @@ -107,7 +109,8 @@ static int a10_mmc_attach(device_t); static int a10_mmc_setup_dma(struct a10_mmc_softc*, device_t) ; static int a10_mmc_prepare_dma(struct a10_mmc_softc*) ; -static int a10_mmc_can_do_dma(struct mmc_request*) ; +static int a10_mmc_can_do_dma(struct mmc_request*) ; +static void a10_dma_buff_cb(void*, bus_dma_segment_t*, int, int) ; static int a10_mmc_detach(device_t); static int a10_mmc_reset(struct a10_mmc_softc *); static void a10_mmc_intr(void *); @@ -225,9 +228,9 @@ sc->a10_use_dma = 0 ; } } -#ifdef DEBUG - device_printf(sc->a10_dev, "DMA status %d\n", sc->a10_use_dma) ; -#endif +#ifdef DEBUG + device_printf(sc->a10_dev, "DMA status %d\n", sc->a10_use_dma) ; +#endif return (0); fail: @@ -268,24 +271,25 @@ if((error != 0)&&(error != EINPROGRESS)) return (error) ; - - /* Now allocate tag and map for the buffer to be used with transfer. */ + + /* Now allocate tag and map for the buffer to be used with transfer. */ error = bus_dma_tag_create(bus_get_dma_tag(dev),1, 0,BUS_SPACE_MAXADDR_32BIT,BUS_SPACE_MAXADDR, NULL,NULL,A10_DMA_BUFF_SIZE, A10_DMA_NSEGS,A10_DMA_BUFF_SIZE,0, - NULL,NULL,&sc->a10_dma_buff_tag) ; + NULL,NULL,&sc->a10_dma_buff_tag) ; if(error) - return (error) ; - - error = bus_dmamap_create(sc->a10_dma_buff_tag,0,&sc->a10_dma_buff_map) ; + return (error) ; + + error = bus_dmamap_create(sc->a10_dma_buff_tag,0,&sc->a10_dma_buff_map) ; if(error) - return (error) ; + return (error) ; return(0) ; } +/* Transfer at most 0x1000 (4K) of data (Experimental) */ static int a10_mmc_prepare_dma(struct a10_mmc_softc* sc) { @@ -299,14 +303,21 @@ bus_size_t off = 0 ; int desc, rem ; uint32_t val; - desc = 0 ; - - /* Pick a segment and program all the descriptors in the segment. */ - bus_addr_t paddr = (sc->a10_dma_cb_arg).segs[0].ds_addr; - bus_size_t len = (sc->a10_dma_cb_arg).segs[0].ds_len ; + bus_addr_t paddr = sc->a10_dma_buff_addr ; + //bus_size_t len = (sc->a10_dma_cb_arg).segs[0].ds_len ; + bus_size_t len = A10_MMC_DMA_MAXLEN ; rem = min(len,cmd->data->len) ; + uint32_t error = bus_dmamap_load(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, + cmd->data->data,rem,a10_dma_buff_cb, + &sc->a10_dma_buff_addr,BUS_DMA_NOWAIT) ; + if(error != 0) { + device_printf(sc->a10_dev, "DMA transaction failed due to insufficient resources\n") ; + return EIO ; + } + + /* Program all the descriptors in this segment. */ while(rem > 0) { if(desc == sc->a10_dma_ndesc) @@ -347,7 +358,7 @@ val |= A10_MMC_DMA_ENABLE ; val |= A10_MMC_INT_ENABLE ; A10_MMC_WRITE_4(sc, A10_MMC_GCTRL,val) ; - + /* Reset DMA */ val |= A10_MMC_DMA_RESET ; A10_MMC_WRITE_4(sc, A10_MMC_GCTRL,val) ; @@ -383,11 +394,14 @@ } -/* Not implemented yet. */ -static int +/* Not implemented yet. */ +static int a10_mmc_can_do_dma(struct mmc_request* req) { - return (1) ; + if(req->cmd->data->len > A10_MMC_DMA_MAXLEN) + return (0) ; + else + return (1) ; } static void a10_dma_cb(void* arg, bus_dma_segment_t* segs, int nsegs, int error) @@ -401,6 +415,16 @@ (*(struct a10_mmc_cb*)arg).segs = segs; } +static void +a10_dma_buff_cb(void* arg, bus_dma_segment_t* segs, int nsegs, int error) +{ + if(error) { + printf("a10_mmc: Error in a10_dma_buff_callback function, code = %d\n", error) ; + return ; + } + *(bus_addr_t*)arg = segs[0].ds_addr ; +} + static int a10_mmc_detach(device_t dev) { @@ -421,8 +445,10 @@ break; DELAY(100); } - if (timeout == 0) + if (timeout == 0) { + device_printf(sc->a10_dev, "Getting timedout in reset\n") ; return (ETIMEDOUT); + } /* Set the timeout. */ A10_MMC_WRITE_4(sc, A10_MMC_TIMEOUT, 0xffffffff); @@ -438,7 +464,7 @@ A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB); - + device_printf(sc->a10_dev,"Reset succesfully in reset function\n") ; return (0); } @@ -557,15 +583,15 @@ A10_MMC_UNLOCK(sc); return; } -#ifdef DEBUG - device_printf(sc->a10_dev, "imask: %#x, rint: %#x\n", imask, rint); -#endif + + A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint) ; + A10_MMC_WRITE_4(sc, A10_MMC_IDST, idst) ; + A10_MMC_WRITE_4(sc, A10_MMC_IMASK, imask) ; + device_printf(sc->a10_dev, "imask: %#x, rint: %#x, idst: %#x\n", imask, rint,idst); if (sc->a10_req == NULL) { device_printf(sc->a10_dev, "Spurious interrupt - no active request, rint: 0x%08X\n", rint); - A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint); - A10_MMC_WRITE_4(sc, A10_MMC_IDST, idst) ; A10_MMC_UNLOCK(sc); return; } @@ -578,8 +604,6 @@ } else sc->a10_req->cmd->error = MMC_ERR_FAILED; - A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint); - A10_MMC_WRITE_4(sc, A10_MMC_IDST, idst) ; a10_mmc_req_done(sc); A10_MMC_UNLOCK(sc); return; @@ -588,8 +612,6 @@ if(idst & A10_MMC_IDMAC_ERROR) { device_printf(sc->a10_dev, "error rint: 0x%08x\n", idst) ; sc->a10_req->cmd->error = MMC_ERR_FAILED ; - A10_MMC_WRITE_4(sc, A10_MMC_IDST, idst) ; - A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint) ; a10_mmc_req_done(sc) ; A10_MMC_UNLOCK(sc) ; return ; @@ -603,8 +625,7 @@ bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_POSTWRITE) ; else device_printf(sc->a10_dev, "Invalid operations request!\n") ; - A10_MMC_WRITE_4(sc, A10_MMC_IDST, idst) ; - A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint) ; + bus_dmamap_unload(sc->a10_dma_buff_tag, sc->a10_dma_buff_map) ; a10_mmc_req_ok(sc) ; A10_MMC_UNLOCK(sc) ; return ; @@ -626,8 +647,6 @@ if ((sc->a10_intr & sc->a10_intr_wait) == sc->a10_intr_wait) a10_mmc_req_ok(sc); - A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint); - A10_MMC_WRITE_4(sc, A10_MMC_IDST, idst) ; A10_MMC_UNLOCK(sc); } @@ -638,7 +657,7 @@ int blksz; struct a10_mmc_softc *sc; struct mmc_command *cmd; - uint32_t cmdreg,imask; + uint32_t cmdreg ; sc = device_get_softc(bus); A10_MMC_LOCK(sc); @@ -648,7 +667,6 @@ } sc->a10_req = req; - imask = 0 ; cmd = req->cmd; cmdreg = A10_MMC_START; if (cmd->opcode == MMC_GO_IDLE_STATE) @@ -668,15 +686,15 @@ if (cmd->data != NULL) { sc->a10_intr_wait |= A10_MMC_DATA_OVER; - sc->a10_dma_ops = 0 ; + sc->a10_dma_ops = 0 ; cmdreg |= A10_MMC_DATA_EXP | A10_MMC_WAIT_PREOVER; if (cmd->data->flags & MMC_DATA_MULTI) { cmdreg |= A10_MMC_SEND_AUTOSTOP; sc->a10_intr_wait |= A10_MMC_AUTOCMD_DONE; } - if (cmd->data->flags & MMC_DATA_WRITE) { + if (cmd->data->flags & MMC_DATA_WRITE) { cmdreg |= A10_MMC_WRITE; - sc->a10_dma_ops = 1 ; + sc->a10_dma_ops = 1 ; } blksz = min(cmd->data->len, MMC_SECTOR_SIZE); @@ -684,20 +702,15 @@ A10_MMC_WRITE_4(sc, A10_MMC_BCNTR, cmd->data->len); if((sc->a10_use_dma == 1)&&(a10_mmc_can_do_dma(req))) { - uint32_t error = a10_mmc_prepare_dma(sc) ; - if(error == 0) - imask |= (A10_MMC_TX_DATA_REQ|A10_MMC_RX_DATA_REQ) ; + uint32_t error = a10_mmc_prepare_dma(sc) ; + if(error == 0) { + A10_MMC_WRITE_4(sc, A10_MMC_IMASK, A10_MMC_READ_4(sc, A10_MMC_IMASK) | (A10_MMC_TX_DATA_REQ | A10_MMC_RX_DATA_REQ)) ; + } else - device_printf(sc->a10_dev, "Couldn't prepare DMA, using pio instead\n") ; + device_printf(sc->a10_dev, "Couldn't prepare DMA, using pio instead\n") ; } } - uint32_t newmask = A10_MMC_READ_4(sc, A10_MMC_IMASK) ; - if(!(imask & A10_MMC_SDIO_INT)) - A10_MMC_WRITE_2(sc, A10_MMC_IMASK, newmask) ; - else - A10_MMC_WRITE_4(sc, A10_MMC_IMASK, newmask) ; - A10_MMC_WRITE_4(sc, A10_MMC_CARG, cmd->arg); A10_MMC_WRITE_4(sc, A10_MMC_CMDR, cmdreg | cmd->opcode); callout_reset(&sc->a10_timeoutc, sc->a10_timeout * hz, From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 11:56:12 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81BA33E9 for ; Mon, 15 Jun 2015 11:56:12 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 645C8A5C for ; Mon, 15 Jun 2015 11:56:12 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FBuCRs056147 for ; Mon, 15 Jun 2015 11:56:12 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FBu9LY056076 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 11:56:09 GMT (envelope-from mihai@FreeBSD.org) Date: Mon, 15 Jun 2015 11:56:09 GMT Message-Id: <201506151156.t5FBu9LY056076@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287113 - in soc2015/mihai/bhyve-on-arm-head/sys: arm/arm arm/conf arm/vexpress boot/fdt/dts/arm conf dev/fdt dev/ofw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 11:56:12 -0000 Author: mihai Date: Mon Jun 15 11:56:08 2015 New Revision: 287113 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287113 Log: sys: boot: fdt: dts: arm: remove vexpress DTS Deleted: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/vexpress-v2m.dtsi soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/vexpress-v2p-ca15-tc1.dts Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/physmem.c soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/vfp.c soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/VEXPRESS soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/files.vexpress soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/vexpress_machdep.c soc2015/mihai/bhyve-on-arm-head/sys/conf/ldscript.arm soc2015/mihai/bhyve-on-arm-head/sys/dev/fdt/fdt_common.c soc2015/mihai/bhyve-on-arm-head/sys/dev/ofw/ofw_bus_subr.c Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/physmem.c ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/physmem.c Mon Jun 15 10:56:01 2015 (r287112) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/physmem.c Mon Jun 15 11:56:08 2015 (r287113) @@ -311,7 +311,7 @@ adj = pa - trunc_page(pa); pa = trunc_page(pa); sz = round_page(sz + adj); - + printf("%s pa: %p sz: %p\n",__func__,(void*)pa, (void*)sz); if (excnt < nitems(exregions)) insert_region(exregions, excnt++, pa, sz, exflags); } Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/vfp.c ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/vfp.c Mon Jun 15 10:56:01 2015 (r287112) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/vfp.c Mon Jun 15 11:56:08 2015 (r287113) @@ -103,7 +103,6 @@ { u_int fpsid, fpexc, tmp; u_int coproc, vfp_arch; - coproc = get_coprocessorACR(); coproc |= COPROC10 | COPROC11; set_coprocessorACR(coproc); Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/VEXPRESS ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/VEXPRESS Mon Jun 15 10:56:01 2015 (r287112) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/VEXPRESS Mon Jun 15 11:56:08 2015 (r287113) @@ -16,30 +16,33 @@ options KERNVIRTADDR=0xc0200000 makeoptions KERNVIRTADDR=0xc0200000 -options KERNPHYSADDR=0x80200000 -makeoptions KERNPHYSADDR=0x80200000 -options PHYSADDR=0x80000000 +options KERNPHYSADDR=0xc0200000 +makeoptions KERNPHYSADDR=0xc0200000 +options PHYSADDR=0xc0000000 options HZ=100 options SCHED_ULE # ULE scheduler -options PLATFORM +#options PLATFORM #options SMP # Enable multiple cores +nooptions FREEBSD_BOOT_LOADER # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options DEBUG +options EARLY_PRINTF +options VERBOSE_SYSINIT # Enable verbose sysinit messages options KDB # Enable kernel debugger support # For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic +options KDB_TRACE # Print a stack trace for a panic # For full debugger support use this instead: options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles #options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC +options DIAGNOSTIC #options ROOTDEVNAME=\"ufs:/dev/da0\" @@ -67,4 +70,4 @@ # Flattened Device Tree options FDT # Configure using FDT/DTB data options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=vexpress-v2p-ca15-tc1.dts +makeoptions FDT_DTS_FILE=rtsm_ve-cortex_a15x1.dts Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/files.vexpress ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/files.vexpress Mon Jun 15 10:56:01 2015 (r287112) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/files.vexpress Mon Jun 15 11:56:08 2015 (r287113) @@ -10,3 +10,5 @@ arm/vexpress/vexpress_common.c standard arm/vexpress/vexpress_machdep.c standard + +arm/vexpress/vexpress_semihosting.S standard Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/vexpress_machdep.c ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/vexpress_machdep.c Mon Jun 15 10:56:01 2015 (r287112) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/vexpress_machdep.c Mon Jun 15 11:56:08 2015 (r287113) @@ -54,6 +54,47 @@ #include +#include "vexpress_semihosting.h" + +vm_offset_t +platform_lastaddr(void) +{ + + return (arm_devmap_lastaddr()); +} + +void +platform_probe_and_attach(void) +{ + +} + +void +platform_gpio_init(void) +{ + +} + +void +platform_late_init(void) +{ + +} + +int +platform_devmap_init(void) +{ + /* UART0 (PL011) */ + arm_devmap_add_entry(0x1c090000, 0x1000); + + /* Peripherals (CS3) */ +// arm_devmap_add_entry(0x1C000000, 0x4000000); + + return (0); +} + + + struct arm32_dma_range * bus_dma_get_range(void) { @@ -68,6 +109,21 @@ return (0); } +#ifdef EARLY_PRINTF + +static void +eputc(int c) +{ + char str[2]; + str[0] = c; + str[1] = 0; + + __semi_call(SYS_WRITE0, str); +} + +early_putc_t * early_putc = eputc; +#endif + void cpu_reset() { Modified: soc2015/mihai/bhyve-on-arm-head/sys/conf/ldscript.arm ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/conf/ldscript.arm Mon Jun 15 10:56:01 2015 (r287112) +++ soc2015/mihai/bhyve-on-arm-head/sys/conf/ldscript.arm Mon Jun 15 11:56:08 2015 (r287113) @@ -6,7 +6,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ - . = KERNVIRTADDR + SIZEOF_HEADERS; + . = KERNVIRTADDR; /* + SIZEOF_HEADERS;*/ .text : { *(.text) Modified: soc2015/mihai/bhyve-on-arm-head/sys/dev/fdt/fdt_common.c ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/dev/fdt/fdt_common.c Mon Jun 15 10:56:01 2015 (r287112) +++ soc2015/mihai/bhyve-on-arm-head/sys/dev/fdt/fdt_common.c Mon Jun 15 11:56:08 2015 (r287113) @@ -117,22 +117,32 @@ rangesptr = &ranges[i * tuple_size]; bus_addr = fdt_data_get((void *)rangesptr, addr_cells); + printf("%s %d %d %p %p\n",__func__,i, tuples, (void*) bus_addr, (void*) addr); if (bus_addr != addr) continue; rangesptr += addr_cells; + printf("%s 2 %d %d %p %p\n",__func__,i, tuples, (void*) bus_addr, (void*) addr); par_bus_addr = fdt_data_get((void *)rangesptr, par_addr_cells); rangesptr += par_addr_cells; err = fdt_get_range_by_busaddr(OF_parent(node), par_bus_addr, &pbase, &psize); + printf("%s %d %d %p %p; %p %p\n",__func__,i, tuples, (void*) bus_addr, (void*) addr, (void*)pbase,(void*) psize); + if (err > 0) return (err); + printf("%s %d %d %p %p; %p %p\n",__func__,i, tuples, (void*) bus_addr, (void*) addr, (void*)pbase,(void*) psize); + + if (err == 0) *base = pbase; else *base = par_bus_addr; + printf("%s %d %d %p %p;;;;; %p %p; par_bus_addr: %p; base:%p\n",__func__,i, tuples, (void*) bus_addr, (void*) addr, (void*)pbase,(void*) psize, (void*)par_bus_addr, (void*)*base); + + *size = fdt_data_get((void *)rangesptr, size_cells); return (0); @@ -155,6 +165,7 @@ * Process 'ranges' property. */ par_addr_cells = fdt_parent_addr_cells(node); + printf("%s par_addr_cells: %p\n",__func__,(void*)par_addr_cells); if (par_addr_cells > 2) return (ERANGE); @@ -185,17 +196,22 @@ rangesptr = &ranges[range_id]; *base = fdt_data_get((void *)rangesptr, addr_cells); + printf("%s 1 %p, range_id:%u %p\n",__func__,(void*)*base, range_id, (void*)rangesptr); rangesptr += addr_cells; par_bus_addr = fdt_data_get((void *)rangesptr, par_addr_cells); + printf("%s ----- par_bus_addr: %d; par_bus_addr2: %d\n",__func__,*((uint32_t*)rangesptr), *(((uint32_t*)rangesptr) + 1)); rangesptr += par_addr_cells; err = fdt_get_range_by_busaddr(OF_parent(node), par_bus_addr, &pbase, &psize); + printf("%s 2 %p, pbase:%p, par_bus_addr:%lu\n",__func__,(void*)*base, (void*)pbase, par_bus_addr); + if (err == 0) *base += pbase; else *base += par_bus_addr; + printf("%s 3 %p\n",__func__,(void*)*base); *size = fdt_data_get((void *)rangesptr, size_cells); return (0); @@ -595,6 +611,7 @@ uint32_t memory_size; int addr_cells, size_cells; int i, max_size, res_len, rv, tuple_size, tuples; + printf("%s 1 \n",__func__); max_size = sizeof(reserve); root = OF_finddevice("/"); @@ -603,28 +620,35 @@ rv = ENXIO; goto out; } + printf("%s 2 \n",__func__); if ((rv = fdt_addrsize_cells(OF_parent(memory), &addr_cells, &size_cells)) != 0) goto out; + printf("%s 3 \n",__func__); if (addr_cells > 2) { rv = ERANGE; goto out; } + printf("%s 33 \n",__func__); tuple_size = sizeof(pcell_t) * (addr_cells + size_cells); + printf("%s 4 \n",__func__); res_len = OF_getproplen(root, "memreserve"); if (res_len <= 0 || res_len > sizeof(reserve)) { + printf("%s 5 \n",__func__); + rv = ERANGE; goto out; } - + printf("%s res_len %d\n",__func__,res_len); if (OF_getprop(root, "memreserve", reserve, res_len) <= 0) { rv = ENXIO; goto out; } + printf("%s res_len %d 2222222\n",__func__,res_len); memory_size = 0; tuples = res_len / tuple_size; @@ -633,9 +657,11 @@ rv = fdt_data_to_res(reservep, addr_cells, size_cells, (u_long *)&mr[i].mr_start, (u_long *)&mr[i].mr_size); + printf("%s res_len %d for: %d\n",__func__,res_len, i); if (rv != 0) goto out; + printf("%s res_len %d for after rv: %d\n",__func__,res_len, i); reservep += addr_cells + size_cells; } @@ -643,6 +669,7 @@ *mrcnt = i; rv = 0; out: + printf("%s out rv: %d\n",__func__,rv); return (rv); } Modified: soc2015/mihai/bhyve-on-arm-head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/dev/ofw/ofw_bus_subr.c Mon Jun 15 10:56:01 2015 (r287112) +++ soc2015/mihai/bhyve-on-arm-head/sys/dev/ofw/ofw_bus_subr.c Mon Jun 15 11:56:08 2015 (r287113) @@ -440,6 +440,7 @@ nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); + printf("%s %d\n",__func__,nintr); if (nintr > 0) { if (OF_searchencprop(node, "interrupt-parent", &iparent, sizeof(iparent)) == -1) { @@ -494,6 +495,7 @@ } } irqnum = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); + printf("%s irqnum:%d\m",irqnum); resource_list_add(rl, SYS_RES_IRQ, rid++, irqnum, irqnum, 1); } if (rlen != NULL) From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 12:08:54 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29E17C09 for ; Mon, 15 Jun 2015 12:08:54 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C674D04 for ; Mon, 15 Jun 2015 12:08:54 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FC8raS025001 for ; Mon, 15 Jun 2015 12:08:53 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FC8qoq023828 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 12:08:52 GMT (envelope-from mihai@FreeBSD.org) Date: Mon, 15 Jun 2015 12:08:52 GMT Message-Id: <201506151208.t5FC8qoq023828@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287114 - in soc2015/mihai/bhyve-on-arm-head/sys: arm/arm dev/fdt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 12:08:54 -0000 Author: mihai Date: Mon Jun 15 12:08:52 2015 New Revision: 287114 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287114 Log: sys: arm: remove debug printfs Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/physmem.c soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/vfp.c soc2015/mihai/bhyve-on-arm-head/sys/dev/fdt/fdt_common.c Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/physmem.c ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/physmem.c Mon Jun 15 11:56:08 2015 (r287113) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/physmem.c Mon Jun 15 12:08:52 2015 (r287114) @@ -311,7 +311,7 @@ adj = pa - trunc_page(pa); pa = trunc_page(pa); sz = round_page(sz + adj); - printf("%s pa: %p sz: %p\n",__func__,(void*)pa, (void*)sz); + if (excnt < nitems(exregions)) insert_region(exregions, excnt++, pa, sz, exflags); } Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/vfp.c ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/vfp.c Mon Jun 15 11:56:08 2015 (r287113) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/vfp.c Mon Jun 15 12:08:52 2015 (r287114) @@ -103,6 +103,7 @@ { u_int fpsid, fpexc, tmp; u_int coproc, vfp_arch; + coproc = get_coprocessorACR(); coproc |= COPROC10 | COPROC11; set_coprocessorACR(coproc); Modified: soc2015/mihai/bhyve-on-arm-head/sys/dev/fdt/fdt_common.c ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/dev/fdt/fdt_common.c Mon Jun 15 11:56:08 2015 (r287113) +++ soc2015/mihai/bhyve-on-arm-head/sys/dev/fdt/fdt_common.c Mon Jun 15 12:08:52 2015 (r287114) @@ -117,32 +117,22 @@ rangesptr = &ranges[i * tuple_size]; bus_addr = fdt_data_get((void *)rangesptr, addr_cells); - printf("%s %d %d %p %p\n",__func__,i, tuples, (void*) bus_addr, (void*) addr); if (bus_addr != addr) continue; rangesptr += addr_cells; - printf("%s 2 %d %d %p %p\n",__func__,i, tuples, (void*) bus_addr, (void*) addr); par_bus_addr = fdt_data_get((void *)rangesptr, par_addr_cells); rangesptr += par_addr_cells; err = fdt_get_range_by_busaddr(OF_parent(node), par_bus_addr, &pbase, &psize); - printf("%s %d %d %p %p; %p %p\n",__func__,i, tuples, (void*) bus_addr, (void*) addr, (void*)pbase,(void*) psize); - if (err > 0) return (err); - printf("%s %d %d %p %p; %p %p\n",__func__,i, tuples, (void*) bus_addr, (void*) addr, (void*)pbase,(void*) psize); - - if (err == 0) *base = pbase; else *base = par_bus_addr; - printf("%s %d %d %p %p;;;;; %p %p; par_bus_addr: %p; base:%p\n",__func__,i, tuples, (void*) bus_addr, (void*) addr, (void*)pbase,(void*) psize, (void*)par_bus_addr, (void*)*base); - - *size = fdt_data_get((void *)rangesptr, size_cells); return (0); @@ -165,7 +155,6 @@ * Process 'ranges' property. */ par_addr_cells = fdt_parent_addr_cells(node); - printf("%s par_addr_cells: %p\n",__func__,(void*)par_addr_cells); if (par_addr_cells > 2) return (ERANGE); @@ -196,22 +185,17 @@ rangesptr = &ranges[range_id]; *base = fdt_data_get((void *)rangesptr, addr_cells); - printf("%s 1 %p, range_id:%u %p\n",__func__,(void*)*base, range_id, (void*)rangesptr); rangesptr += addr_cells; par_bus_addr = fdt_data_get((void *)rangesptr, par_addr_cells); - printf("%s ----- par_bus_addr: %d; par_bus_addr2: %d\n",__func__,*((uint32_t*)rangesptr), *(((uint32_t*)rangesptr) + 1)); rangesptr += par_addr_cells; err = fdt_get_range_by_busaddr(OF_parent(node), par_bus_addr, &pbase, &psize); - printf("%s 2 %p, pbase:%p, par_bus_addr:%lu\n",__func__,(void*)*base, (void*)pbase, par_bus_addr); - if (err == 0) *base += pbase; else *base += par_bus_addr; - printf("%s 3 %p\n",__func__,(void*)*base); *size = fdt_data_get((void *)rangesptr, size_cells); return (0); @@ -611,7 +595,6 @@ uint32_t memory_size; int addr_cells, size_cells; int i, max_size, res_len, rv, tuple_size, tuples; - printf("%s 1 \n",__func__); max_size = sizeof(reserve); root = OF_finddevice("/"); @@ -620,35 +603,28 @@ rv = ENXIO; goto out; } - printf("%s 2 \n",__func__); if ((rv = fdt_addrsize_cells(OF_parent(memory), &addr_cells, &size_cells)) != 0) goto out; - printf("%s 3 \n",__func__); if (addr_cells > 2) { rv = ERANGE; goto out; } - printf("%s 33 \n",__func__); tuple_size = sizeof(pcell_t) * (addr_cells + size_cells); - printf("%s 4 \n",__func__); res_len = OF_getproplen(root, "memreserve"); if (res_len <= 0 || res_len > sizeof(reserve)) { - printf("%s 5 \n",__func__); - rv = ERANGE; goto out; } - printf("%s res_len %d\n",__func__,res_len); + if (OF_getprop(root, "memreserve", reserve, res_len) <= 0) { rv = ENXIO; goto out; } - printf("%s res_len %d 2222222\n",__func__,res_len); memory_size = 0; tuples = res_len / tuple_size; @@ -657,11 +633,9 @@ rv = fdt_data_to_res(reservep, addr_cells, size_cells, (u_long *)&mr[i].mr_start, (u_long *)&mr[i].mr_size); - printf("%s res_len %d for: %d\n",__func__,res_len, i); if (rv != 0) goto out; - printf("%s res_len %d for after rv: %d\n",__func__,res_len, i); reservep += addr_cells + size_cells; } @@ -669,7 +643,6 @@ *mrcnt = i; rv = 0; out: - printf("%s out rv: %d\n",__func__,rv); return (rv); } From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 12:09:51 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90B22D05 for ; Mon, 15 Jun 2015 12:09:51 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E831D0D for ; Mon, 15 Jun 2015 12:09:51 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FC9pHx069009 for ; Mon, 15 Jun 2015 12:09:51 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FC9oct068067 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 12:09:50 GMT (envelope-from mihai@FreeBSD.org) Date: Mon, 15 Jun 2015 12:09:50 GMT Message-Id: <201506151209.t5FC9oct068067@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287115 - soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 12:09:51 -0000 Author: mihai Date: Mon Jun 15 12:09:49 2015 New Revision: 287115 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287115 Log: sys: arm: vexpress: add semihosting feature for EARLY printfs using special syscall 0x1234 Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/vexpress_semihosting.S soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/vexpress_semihosting.h Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/vexpress_semihosting.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/vexpress_semihosting.S Mon Jun 15 12:09:49 2015 (r287115) @@ -0,0 +1,8 @@ + @ + @ Function for C code to make semihosting calls: + @ + .globl __semi_call +__semi_call: + svc 0x123456 + mov pc, lr + Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/vexpress_semihosting.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/vexpress_semihosting.h Mon Jun 15 12:09:49 2015 (r287115) @@ -0,0 +1,9 @@ +#ifndef SEMIHOSTING_H +#define SEMIHOSTING_H + +#define SYS_WRITE0 4 +#define SEMIHOSTING_SVC 0x123456 /* SVC comment field for semihosting */ + +int __semi_call(int id, ...); + +#endif /* ! SEMIHOSTING_H */ From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 12:11:02 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4850ED3C for ; Mon, 15 Jun 2015 12:11:02 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 366ECDA2 for ; Mon, 15 Jun 2015 12:11:02 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FCB2qD014932 for ; Mon, 15 Jun 2015 12:11:02 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FCB1T6014485 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 12:11:01 GMT (envelope-from mihai@FreeBSD.org) Date: Mon, 15 Jun 2015 12:11:01 GMT Message-Id: <201506151211.t5FCB1T6014485@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287116 - soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 12:11:02 -0000 Author: mihai Date: Mon Jun 15 12:11:00 2015 New Revision: 287116 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287116 Log: sys: boot: fdt: dts: arm: add DTS for fast model VFP Cortex-A15 Added: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-cortex_a15x1.dts soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-motherboard.dtsi Added: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-cortex_a15x1.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-cortex_a15x1.dts Mon Jun 15 12:11:00 2015 (r287116) @@ -0,0 +1,125 @@ +/* + * ARM Ltd. Fast Models + * + * Versatile Express (VE) system model + * ARMCortexA15x1CT + * + * RTSM_VE_Cortex_A15x1.lisa + */ + +/dts-v1/; + +/ { + model = "RTSM_VE_Cortex_A15x1"; + compatible = "arm,rtsm_ve,cortex_a15x1", "arm,vexpress"; + interrupt-parent = <&gic>; + #address-cells = <2>; + #size-cells = <2>; + + chosen { }; + + aliases { + serial0 = &v2m_serial0; + serial1 = &v2m_serial1; + serial2 = &v2m_serial2; + serial3 = &v2m_serial3; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <0>; + }; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0 0x80000000 0 0x40000000>; + }; + + gic: interrupt-controller@2c001000 { + compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <0>; + interrupt-controller; + reg = <0 0x2c001000 0 0x1000>, + <0 0x2c002000 0 0x2000>, + <0 0x2c004000 0 0x2000>, + <0 0x2c006000 0 0x2000>; + interrupts = <1 9 0xf04>; + }; + + timer { + compatible = "arm,armv7-timer"; + interrupts = <1 13 0xf08>, + <1 14 0xf08>, + <1 11 0xf08>, + <1 10 0xf08>; + }; + + smb { + compatible = "simple-bus"; + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0x08000000 0x04000000>, + <1 0 0x14000000 0x04000000>, + <2 0 0x18000000 0x04000000>, + <3 0 0x1c000000 0x04000000>, + <4 0 0x0c000000 0x04000000>, + <5 0 0x10000000 0x04000000>; + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 63>; + interrupt-map = <0 0 0 &gic 0 0 4>, + <0 0 1 &gic 0 1 4>, + <0 0 2 &gic 0 2 4>, + <0 0 3 &gic 0 3 4>, + <0 0 4 &gic 0 4 4>, + <0 0 5 &gic 0 5 4>, + <0 0 6 &gic 0 6 4>, + <0 0 7 &gic 0 7 4>, + <0 0 8 &gic 0 8 4>, + <0 0 9 &gic 0 9 4>, + <0 0 10 &gic 0 10 4>, + <0 0 11 &gic 0 11 4>, + <0 0 12 &gic 0 12 4>, + <0 0 13 &gic 0 13 4>, + <0 0 14 &gic 0 14 4>, + <0 0 15 &gic 0 15 4>, + <0 0 16 &gic 0 16 4>, + <0 0 17 &gic 0 17 4>, + <0 0 18 &gic 0 18 4>, + <0 0 19 &gic 0 19 4>, + <0 0 20 &gic 0 20 4>, + <0 0 21 &gic 0 21 4>, + <0 0 22 &gic 0 22 4>, + <0 0 23 &gic 0 23 4>, + <0 0 24 &gic 0 24 4>, + <0 0 25 &gic 0 25 4>, + <0 0 26 &gic 0 26 4>, + <0 0 27 &gic 0 27 4>, + <0 0 28 &gic 0 28 4>, + <0 0 29 &gic 0 29 4>, + <0 0 30 &gic 0 30 4>, + <0 0 31 &gic 0 31 4>, + <0 0 32 &gic 0 32 4>, + <0 0 33 &gic 0 33 4>, + <0 0 34 &gic 0 34 4>, + <0 0 35 &gic 0 35 4>, + <0 0 36 &gic 0 36 4>, + <0 0 37 &gic 0 37 4>, + <0 0 38 &gic 0 38 4>, + <0 0 39 &gic 0 39 4>, + <0 0 40 &gic 0 40 4>, + <0 0 41 &gic 0 41 4>, + <0 0 42 &gic 0 42 4>; + + /include/ "rtsm_ve-motherboard.dtsi" + }; +}; + Added: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-motherboard.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-motherboard.dtsi Mon Jun 15 12:11:00 2015 (r287116) @@ -0,0 +1,240 @@ +/* + * ARM Ltd. Fast Models + * + * Versatile Express (VE) system model + * Motherboard component + * + * VEMotherBoard.lisa + */ + + motherboard { + arm,v2m-memory-map = "rs1"; + compatible = "arm,rtsm_ve,vemotherboard", "simple-bus"; + #address-cells = <1>; /* SMB chipselect number and offset */ + #size-cells = <1>; + #interrupt-cells = <1>; + ranges; + + flash@0,00000000 { + compatible = "arm,vexpress-flash", "cfi-flash"; + reg = <0 0x00000000 0x04000000>, + <4 0x00000000 0x04000000>; + bank-width = <4>; + }; + + vram@2,00000000 { + compatible = "arm,vexpress-vram"; + reg = <2 0x00000000 0x00800000>; + }; + + ethernet@2,02000000 { + compatible = "smsc,lan91c111"; + reg = <2 0x02000000 0x10000>; + interrupts = <15>; + }; + + iofpga@3,00000000 { + compatible = "arm,amba-bus", "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 3 0x200000>; + + v2m_sysreg: sysreg@010000 { + compatible = "arm,vexpress-sysreg"; + reg = <0x010000 0x1000>; + gpio-controller; + #gpio-cells = <2>; + }; + + v2m_sysctl: sysctl@020000 { + compatible = "arm,sp810", "arm,primecell"; + reg = <0x020000 0x1000>; + clocks = <&v2m_refclk32khz>, <&v2m_refclk1mhz>, <&v2m_clk24mhz>; + clock-names = "refclk", "timclk", "apb_pclk"; + #clock-cells = <1>; + clock-output-names = "timerclken0", "timerclken1", "timerclken2", "timerclken3"; + }; + + aaci@040000 { + compatible = "arm,pl041", "arm,primecell"; + reg = <0x040000 0x1000>; + interrupts = <11>; + clocks = <&v2m_clk24mhz>; + clock-names = "apb_pclk"; + }; + + mmci@050000 { + compatible = "arm,pl180", "arm,primecell"; + reg = <0x050000 0x1000>; + interrupts = <9 10>; + cd-gpios = <&v2m_sysreg 0 0>; + wp-gpios = <&v2m_sysreg 1 0>; + max-frequency = <12000000>; + vmmc-supply = <&v2m_fixed_3v3>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "mclk", "apb_pclk"; + }; + + kmi@060000 { + compatible = "arm,pl050", "arm,primecell"; + reg = <0x060000 0x1000>; + interrupts = <12>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "KMIREFCLK", "apb_pclk"; + }; + + kmi@070000 { + compatible = "arm,pl050", "arm,primecell"; + reg = <0x070000 0x1000>; + interrupts = <13>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "KMIREFCLK", "apb_pclk"; + }; + + v2m_serial0: uart@090000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x090000 0x1000>; + interrupts = <5>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "uartclk", "apb_pclk"; + }; + + v2m_serial1: uart@0a0000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0a0000 0x1000>; + interrupts = <6>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "uartclk", "apb_pclk"; + }; + + v2m_serial2: uart@0b0000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0b0000 0x1000>; + interrupts = <7>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "uartclk", "apb_pclk"; + }; + + v2m_serial3: uart@0c0000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0c0000 0x1000>; + interrupts = <8>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "uartclk", "apb_pclk"; + }; + + wdt@0f0000 { + compatible = "arm,sp805", "arm,primecell"; + reg = <0x0f0000 0x1000>; + interrupts = <0>; + clocks = <&v2m_refclk32khz>, <&v2m_clk24mhz>; + clock-names = "wdogclk", "apb_pclk"; + }; + + v2m_timer01: timer@110000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x110000 0x1000>; + interrupts = <2>; + clocks = <&v2m_sysctl 0>, <&v2m_sysctl 1>, <&v2m_clk24mhz>; + clock-names = "timclken1", "timclken2", "apb_pclk"; + }; + + v2m_timer23: timer@120000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x120000 0x1000>; + interrupts = <3>; + clocks = <&v2m_sysctl 2>, <&v2m_sysctl 3>, <&v2m_clk24mhz>; + clock-names = "timclken1", "timclken2", "apb_pclk"; + }; + + virtio_block@130000 { + compatible = "virtio,mmio"; + reg = <0x130000 0x200>; + interrupts = <42>; + }; + + rtc@170000 { + compatible = "arm,pl031", "arm,primecell"; + reg = <0x170000 0x1000>; + interrupts = <4>; + clocks = <&v2m_clk24mhz>; + clock-names = "apb_pclk"; + }; + + clcd@1f0000 { + compatible = "arm,pl111", "arm,primecell"; + reg = <0x1f0000 0x1000>; + interrupts = <14>; + clocks = <&v2m_oscclk1>, <&v2m_clk24mhz>; + clock-names = "clcdclk", "apb_pclk"; + }; + }; + + v2m_fixed_3v3: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + v2m_clk24mhz: clk24mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + clock-output-names = "v2m:clk24mhz"; + }; + + v2m_refclk1mhz: refclk1mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <1000000>; + clock-output-names = "v2m:refclk1mhz"; + }; + + v2m_refclk32khz: refclk32khz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "v2m:refclk32khz"; + }; + + mcc { + compatible = "arm,vexpress,config-bus", "simple-bus"; + arm,vexpress,config-bridge = <&v2m_sysreg>; + + v2m_oscclk1: osc@1 { + /* CLCD clock */ + compatible = "arm,vexpress-osc"; + arm,vexpress-sysreg,func = <1 1>; + freq-range = <23750000 63500000>; + #clock-cells = <0>; + clock-output-names = "v2m:oscclk1"; + }; + + reset@0 { + compatible = "arm,vexpress-reset"; + arm,vexpress-sysreg,func = <5 0>; + }; + + muxfpga@0 { + compatible = "arm,vexpress-muxfpga"; + arm,vexpress-sysreg,func = <7 0>; + }; + + shutdown@0 { + compatible = "arm,vexpress-shutdown"; + arm,vexpress-sysreg,func = <8 0>; + }; + + reboot@0 { + compatible = "arm,vexpress-reboot"; + arm,vexpress-sysreg,func = <9 0>; + }; + + dvimode@0 { + compatible = "arm,vexpress-dvimode"; + arm,vexpress-sysreg,func = <11 0>; + }; + }; + }; From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 13:36:38 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1D46FBE for ; Mon, 15 Jun 2015 13:36:37 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF1AD772 for ; Mon, 15 Jun 2015 13:36:37 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FDaba9062886 for ; Mon, 15 Jun 2015 13:36:37 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FDabAJ062871 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 13:36:37 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Mon, 15 Jun 2015 13:36:37 GMT Message-Id: <201506151336.t5FDabAJ062871@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287119 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 13:36:38 -0000 Author: pratiksinghal Date: Mon Jun 15 13:36:36 2015 New Revision: 287119 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287119 Log: 1) DMA transfer is working along with pio transfer. 2) Interrupt storm error resolved. Getting a translation fault though which needs to be resolved Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Mon Jun 15 12:50:43 2015 (r287118) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Mon Jun 15 13:36:36 2015 (r287119) @@ -354,6 +354,7 @@ bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_PREWRITE) ; /* Enable DMA and interrupts*/ + device_printf(sc->a10_dev, "Previous value of gctrl was 0x%08X and new value is 0x%08X\n", A10_MMC_READ_4(sc, A10_MMC_GCTRL), A10_MMC_READ_4(sc,A10_MMC_GCTRL) | A10_MMC_DMA_ENABLE | A10_MMC_INT_ENABLE) ; val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) ; val |= A10_MMC_DMA_ENABLE ; val |= A10_MMC_INT_ENABLE ; @@ -387,7 +388,7 @@ /* Configure the watermark level. */ A10_MMC_WRITE_4(sc, A10_MMC_FTRGL,A10_MMC_DMA_FTRGLEVEL_A10) ; /* Disable debounce*/ - A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, A10_MMC_READ_4(sc, A10_MMC_GCTRL) & (~A10_MMC_DEBOUNCE_ENABLE)); + //A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, A10_MMC_READ_4(sc, A10_MMC_GCTRL) & (~A10_MMC_DEBOUNCE_ENABLE)); device_printf(sc->a10_dev, "Completed the prepare function\n") ; return (0) ; @@ -399,9 +400,9 @@ a10_mmc_can_do_dma(struct mmc_request* req) { if(req->cmd->data->len > A10_MMC_DMA_MAXLEN) - return (0) ; + return (0) ; else - return (1) ; + return (1) ; } static void a10_dma_cb(void* arg, bus_dma_segment_t* segs, int nsegs, int error) @@ -445,26 +446,30 @@ break; DELAY(100); } - if (timeout == 0) { - device_printf(sc->a10_dev, "Getting timedout in reset\n") ; + if (timeout == 0) { + device_printf(sc->a10_dev, "Getting timedout in reset\n") ; return (ETIMEDOUT); } + device_printf(sc->a10_dev, "The resetted value is %#x\n", A10_MMC_READ_4(sc, A10_MMC_GCTRL)) ; /* Set the timeout. */ A10_MMC_WRITE_4(sc, A10_MMC_TIMEOUT, 0xffffffff); /* Clear pending interrupts. */ A10_MMC_WRITE_4(sc, A10_MMC_RINTR, 0xffffffff); + /* Dubious Will it remove the interrupt throttle? */ + A10_MMC_WRITE_4(sc, A10_MMC_IDST, 0xffffffff) ; /* Unmask interrupts. */ A10_MMC_WRITE_4(sc, A10_MMC_IMASK, A10_MMC_CMD_DONE | A10_MMC_INT_ERR_BIT | A10_MMC_DATA_OVER | A10_MMC_AUTOCMD_DONE | A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ); + uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; + temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; + device_printf(sc->a10_dev, "The value I am writing is %#x\n",temp_val) ; /* Enable interrupts and AHB access. */ - A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, - A10_MMC_READ_4(sc, A10_MMC_GCTRL) | - A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB); - device_printf(sc->a10_dev,"Reset succesfully in reset function\n") ; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL,temp_val) ; + device_printf(sc->a10_dev,"Reset succesfully in reset function %#x\n", A10_MMC_READ_4(sc, A10_MMC_GCTRL)) ; return (0); } @@ -550,6 +555,7 @@ int i, write; uint32_t bit, *buf; + device_printf(sc->a10_dev, "Doing pio transfer\n") ; buf = (uint32_t *)data->data; write = (data->flags & MMC_DATA_WRITE) ? 1 : 0; bit = write ? A10_MMC_FIFO_FULL : A10_MMC_FIFO_EMPTY; @@ -587,7 +593,9 @@ A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint) ; A10_MMC_WRITE_4(sc, A10_MMC_IDST, idst) ; A10_MMC_WRITE_4(sc, A10_MMC_IMASK, imask) ; - device_printf(sc->a10_dev, "imask: %#x, rint: %#x, idst: %#x\n", imask, rint,idst); +#ifdef DEBUG + device_printf(sc->a10_dev, "imask: %#x, rint: %#x, idst: %#x, gctrl: %#x\n", imask, rint,idst, A10_MMC_READ_4(sc, A10_MMC_GCTRL)); +#endif if (sc->a10_req == NULL) { device_printf(sc->a10_dev, "Spurious interrupt - no active request, rint: 0x%08X\n", @@ -610,7 +618,7 @@ } if(idst & A10_MMC_IDMAC_ERROR) { - device_printf(sc->a10_dev, "error rint: 0x%08x\n", idst) ; + device_printf(sc->a10_dev, "error idst: 0x%08x\n", idst) ; sc->a10_req->cmd->error = MMC_ERR_FAILED ; a10_mmc_req_done(sc) ; A10_MMC_UNLOCK(sc) ; @@ -636,11 +644,13 @@ sc->a10_req->cmd->error = MMC_ERR_TIMEOUT ; a10_mmc_req_done(sc) ; A10_MMC_UNLOCK(sc) ; + return ; } sc->a10_intr |= rint; data = sc->a10_req->cmd->data; + device_printf(sc->a10_dev, "Data is %p\n", data) ; if (data != NULL && (rint & (A10_MMC_DATA_OVER | A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ)) != 0) a10_mmc_pio_transfer(sc, data); @@ -657,7 +667,7 @@ int blksz; struct a10_mmc_softc *sc; struct mmc_command *cmd; - uint32_t cmdreg ; + uint32_t cmdreg ; sc = device_get_softc(bus); A10_MMC_LOCK(sc); @@ -704,11 +714,23 @@ if((sc->a10_use_dma == 1)&&(a10_mmc_can_do_dma(req))) { uint32_t error = a10_mmc_prepare_dma(sc) ; if(error == 0) { - A10_MMC_WRITE_4(sc, A10_MMC_IMASK, A10_MMC_READ_4(sc, A10_MMC_IMASK) | (A10_MMC_TX_DATA_REQ | A10_MMC_RX_DATA_REQ)) ; + A10_MMC_WRITE_4(sc, A10_MMC_IMASK, A10_MMC_READ_4(sc, A10_MMC_IMASK) | (A10_MMC_TX_DATA_REQ | A10_MMC_RX_DATA_REQ)) ; } - else + else { + uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; + temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; device_printf(sc->a10_dev, "Couldn't prepare DMA, using pio instead\n") ; + } } + else + { + uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; + temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; + device_printf(sc->a10_dev, "Couldn't transfer this data with DMA, using pio instead\n") ; + } + } A10_MMC_WRITE_4(sc, A10_MMC_CARG, cmd->arg); From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 18:43:34 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D359DA3 for ; Mon, 15 Jun 2015 18:43:34 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 712F6181 for ; Mon, 15 Jun 2015 18:43:34 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FIhYjm070026 for ; Mon, 15 Jun 2015 18:43:34 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FIhWuN070019 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 18:43:32 GMT (envelope-from mihai@FreeBSD.org) Date: Mon, 15 Jun 2015 18:43:32 GMT Message-Id: <201506151843.t5FIhWuN070019@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287125 - in soc2015/mihai/bhyve-on-arm-head/sys: arm/vexpress boot/fdt/dts/arm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 18:43:34 -0000 Author: mihai Date: Mon Jun 15 18:43:32 2015 New Revision: 287125 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287125 Log: sys: arm: vexpress: add SP804 instead of the generic timer Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/sp804.c Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/files.vexpress soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-cortex_a15x1.dts soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-motherboard.dtsi Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/files.vexpress ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/files.vexpress Mon Jun 15 15:34:20 2015 (r287124) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/files.vexpress Mon Jun 15 18:43:32 2015 (r287125) @@ -6,9 +6,10 @@ arm/arm/bus_space_base.c standard arm/arm/gic.c standard -arm/arm/generic_timer.c standard +arm/vexpress/sp804.c standard arm/vexpress/vexpress_common.c standard arm/vexpress/vexpress_machdep.c standard arm/vexpress/vexpress_semihosting.S standard + Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/sp804.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/sp804.c Mon Jun 15 18:43:32 2015 (r287125) @@ -0,0 +1,361 @@ +/* + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012 Damjan Marion + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: soc2015/mihai/bhyve-on-arm-head/sys/arm/versatile/sp804.c 283652 2015-04-04 21:34:26Z andrew $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define SP804_TIMER1_LOAD 0x00 +#define SP804_TIMER1_VALUE 0x04 +#define SP804_TIMER1_CONTROL 0x08 +#define TIMER_CONTROL_EN (1 << 7) +#define TIMER_CONTROL_FREERUN (0 << 6) +#define TIMER_CONTROL_PERIODIC (1 << 6) +#define TIMER_CONTROL_INTREN (1 << 5) +#define TIMER_CONTROL_DIV1 (0 << 2) +#define TIMER_CONTROL_DIV16 (1 << 2) +#define TIMER_CONTROL_DIV256 (2 << 2) +#define TIMER_CONTROL_32BIT (1 << 1) +#define TIMER_CONTROL_ONESHOT (1 << 0) +#define SP804_TIMER1_INTCLR 0x0C +#define SP804_TIMER1_RIS 0x10 +#define SP804_TIMER1_MIS 0x14 +#define SP804_TIMER1_BGLOAD 0x18 +#define SP804_TIMER2_LOAD 0x20 +#define SP804_TIMER2_VALUE 0x24 +#define SP804_TIMER2_CONTROL 0x28 +#define SP804_TIMER2_INTCLR 0x2C +#define SP804_TIMER2_RIS 0x30 +#define SP804_TIMER2_MIS 0x34 +#define SP804_TIMER2_BGLOAD 0x38 + +#define SP804_PERIPH_ID0 0xFE0 +#define SP804_PERIPH_ID1 0xFE4 +#define SP804_PERIPH_ID2 0xFE8 +#define SP804_PERIPH_ID3 0xFEC +#define SP804_PRIMECELL_ID0 0xFF0 +#define SP804_PRIMECELL_ID1 0xFF4 +#define SP804_PRIMECELL_ID2 0xFF8 +#define SP804_PRIMECELL_ID3 0xFFC + +#define DEFAULT_FREQUENCY 1000000 +/* + * QEMU seems to have problem with full frequency + */ +#define DEFAULT_DIVISOR 16 +#define DEFAULT_CONTROL_DIV TIMER_CONTROL_DIV16 + +struct sp804_timer_softc { + struct resource* mem_res; + struct resource* irq_res; + void* intr_hl; + uint32_t sysclk_freq; + bus_space_tag_t bst; + bus_space_handle_t bsh; + struct timecounter tc; + bool et_enabled; + struct eventtimer et; + int timer_initialized; +}; + +/* Read/Write macros for Timer used as timecounter */ +#define sp804_timer_tc_read_4(reg) \ + bus_space_read_4(sc->bst, sc->bsh, reg) + +#define sp804_timer_tc_write_4(reg, val) \ + bus_space_write_4(sc->bst, sc->bsh, reg, val) + +static unsigned sp804_timer_tc_get_timecount(struct timecounter *); + +static unsigned +sp804_timer_tc_get_timecount(struct timecounter *tc) +{ + struct sp804_timer_softc *sc = tc->tc_priv; + return 0xffffffff - sp804_timer_tc_read_4(SP804_TIMER1_VALUE); +} + +static int +sp804_timer_start(struct eventtimer *et, sbintime_t first, sbintime_t period) +{ + struct sp804_timer_softc *sc = et->et_priv; + uint32_t count, reg; + + if (first != 0) { + sc->et_enabled = 1; + + count = ((uint32_t)et->et_frequency * first) >> 32; + + sp804_timer_tc_write_4(SP804_TIMER2_LOAD, count); + reg = TIMER_CONTROL_32BIT | TIMER_CONTROL_INTREN | + TIMER_CONTROL_PERIODIC | DEFAULT_CONTROL_DIV | + TIMER_CONTROL_EN; + sp804_timer_tc_write_4(SP804_TIMER2_CONTROL, reg); + + return (0); + } + + if (period != 0) { + panic("period"); + } + + return (EINVAL); +} + +static int +sp804_timer_stop(struct eventtimer *et) +{ + struct sp804_timer_softc *sc = et->et_priv; + uint32_t reg; + + sc->et_enabled = 0; + reg = sp804_timer_tc_read_4(SP804_TIMER2_CONTROL); + reg &= ~(TIMER_CONTROL_EN); + sp804_timer_tc_write_4(SP804_TIMER2_CONTROL, reg); + + return (0); +} + +static int +sp804_timer_intr(void *arg) +{ + struct sp804_timer_softc *sc = arg; + static uint32_t prev = 0; + uint32_t x = 0; + + x = sp804_timer_tc_read_4(SP804_TIMER1_VALUE); + + prev =x ; + sp804_timer_tc_write_4(SP804_TIMER2_INTCLR, 1); + if (sc->et_enabled) { + if (sc->et.et_active) { + sc->et.et_event_cb(&sc->et, sc->et.et_arg); + } + } + + return (FILTER_HANDLED); +} + +static int +sp804_timer_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "arm,sp804")) { + device_set_desc(dev, "SP804 System Timer"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +sp804_timer_attach(device_t dev) +{ + struct sp804_timer_softc *sc = device_get_softc(dev); + int rid = 0; + int i; + uint32_t id, reg; + phandle_t node; + pcell_t clock; + + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "could not allocate memory resource\n"); + return (ENXIO); + } + + sc->bst = rman_get_bustag(sc->mem_res); + sc->bsh = rman_get_bushandle(sc->mem_res); + + /* Request the IRQ resources */ + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); + if (sc->irq_res == NULL) { + device_printf(dev, "Error: could not allocate irq resources\n"); + return (ENXIO); + } + + sc->sysclk_freq = DEFAULT_FREQUENCY; + /* Get the base clock frequency */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "clock-frequency", &clock, sizeof(clock))) > 0) { + sc->sysclk_freq = fdt32_to_cpu(clock); + } + + /* Setup and enable the timer */ + if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CLK, + sp804_timer_intr, NULL, sc, + &sc->intr_hl) != 0) { + bus_release_resource(dev, SYS_RES_IRQ, rid, + sc->irq_res); + device_printf(dev, "Unable to setup the clock irq handler.\n"); + return (ENXIO); + } + + sp804_timer_tc_write_4(SP804_TIMER1_CONTROL, 0); + sp804_timer_tc_write_4(SP804_TIMER2_CONTROL, 0); + + /* + * Timer 1, timecounter + */ + sc->tc.tc_frequency = sc->sysclk_freq; + sc->tc.tc_name = "SP804 Time Counter"; + sc->tc.tc_get_timecount = sp804_timer_tc_get_timecount; + sc->tc.tc_poll_pps = NULL; + sc->tc.tc_counter_mask = ~0u; + sc->tc.tc_quality = 1000; + sc->tc.tc_priv = sc; + + sp804_timer_tc_write_4(SP804_TIMER1_VALUE, 0xffffffff); + sp804_timer_tc_write_4(SP804_TIMER1_LOAD, 0xffffffff); + reg = TIMER_CONTROL_PERIODIC | TIMER_CONTROL_32BIT; + sp804_timer_tc_write_4(SP804_TIMER1_CONTROL, reg); + reg |= TIMER_CONTROL_EN; + sp804_timer_tc_write_4(SP804_TIMER1_CONTROL, reg); + tc_init(&sc->tc); + + /* + * Timer 2, event timer + */ + sc->et_enabled = 0; + sc->et.et_name = malloc(64, M_DEVBUF, M_NOWAIT | M_ZERO); + sprintf(sc->et.et_name, "SP804 Event Timer %d", + device_get_unit(dev)); + sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT; + sc->et.et_quality = 1000; + sc->et.et_frequency = sc->sysclk_freq / DEFAULT_DIVISOR; + sc->et.et_min_period = (0x00000002LLU << 32) / sc->et.et_frequency; + sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency; + sc->et.et_start = sp804_timer_start; + sc->et.et_stop = sp804_timer_stop; + sc->et.et_priv = sc; + et_register(&sc->et); + + id = 0; + for (i = 3; i >= 0; i--) { + id = (id << 8) | + (sp804_timer_tc_read_4(SP804_PERIPH_ID0 + i*4) & 0xff); + } + + device_printf(dev, "peripheral ID: %08x\n", id); + + id = 0; + for (i = 3; i >= 0; i--) { + id = (id << 8) | + (sp804_timer_tc_read_4(SP804_PRIMECELL_ID0 + i*4) & 0xff); + } + + device_printf(dev, "PrimeCell ID: %08x\n", id); + + sc->timer_initialized = 1; + + return (0); +} + +static device_method_t sp804_timer_methods[] = { + DEVMETHOD(device_probe, sp804_timer_probe), + DEVMETHOD(device_attach, sp804_timer_attach), + { 0, 0 } +}; + +static driver_t sp804_timer_driver = { + "timer", + sp804_timer_methods, + sizeof(struct sp804_timer_softc), +}; + +static devclass_t sp804_timer_devclass; + +DRIVER_MODULE(sp804_timer, simplebus, sp804_timer_driver, sp804_timer_devclass, 0, 0); + +void +DELAY(int usec) +{ + int32_t counts; + uint32_t first, last; + device_t timer_dev; + struct sp804_timer_softc *sc; + int timer_initialized = 0; + + timer_dev = devclass_get_device(sp804_timer_devclass, 0); + + if (timer_dev) { + sc = device_get_softc(timer_dev); + + if (sc) + timer_initialized = sc->timer_initialized; + } + + if (!timer_initialized) { + /* + * Timer is not initialized yet + */ + for (; usec > 0; usec--) + for (counts = 200; counts > 0; counts--) + /* Prevent gcc from optimizing out the loop */ + cpufunc_nullop(); + return; + } + + /* Get the number of times to count */ + counts = usec * ((sc->tc.tc_frequency / 1000000) + 1); + + first = sp804_timer_tc_get_timecount(&sc->tc); + + while (counts > 0) { + last = sp804_timer_tc_get_timecount(&sc->tc); + if (last == first) + continue; + if (last>first) { + counts -= (int32_t)(last - first); + } else { + counts -= (int32_t)((0xFFFFFFFF - first) + last); + } + first = last; + } +} Modified: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-cortex_a15x1.dts ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-cortex_a15x1.dts Mon Jun 15 15:34:20 2015 (r287124) +++ soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-cortex_a15x1.dts Mon Jun 15 18:43:32 2015 (r287125) @@ -55,6 +55,8 @@ timer { compatible = "arm,armv7-timer"; + #interrupt-cells = <3>; + #address-cells = <0>; interrupts = <1 13 0xf08>, <1 14 0xf08>, <1 11 0xf08>, @@ -66,12 +68,12 @@ #address-cells = <1>; #size-cells = <1>; - ranges = <0 0 0x08000000 0x04000000>, + ranges = /*<0 0 0x08000000 0x04000000>, <1 0 0x14000000 0x04000000>, - <2 0 0x18000000 0x04000000>, - <3 0 0x1c000000 0x04000000>, - <4 0 0x0c000000 0x04000000>, - <5 0 0x10000000 0x04000000>; + <2 0 0x18000000 0x04000000>,*/ + <0 0 0x1c000000 0x04000000>; +/* <4 0 0x0c000000 0x04000000>, + <5 0 0x10000000 0x04000000>;*/ #interrupt-cells = <1>; interrupt-map-mask = <0 0 63>; Modified: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-motherboard.dtsi ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-motherboard.dtsi Mon Jun 15 15:34:20 2015 (r287124) +++ soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-motherboard.dtsi Mon Jun 15 18:43:32 2015 (r287125) @@ -37,7 +37,7 @@ compatible = "arm,amba-bus", "simple-bus"; #address-cells = <1>; #size-cells = <1>; - ranges = <0 3 0x200000>; + ranges = <0 0 0x200000>; v2m_sysreg: sysreg@010000 { compatible = "arm,vexpress-sysreg"; From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 18:54:30 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC329516 for ; Mon, 15 Jun 2015 18:54:29 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C81C4618 for ; Mon, 15 Jun 2015 18:54:29 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FIsTN1081949 for ; Mon, 15 Jun 2015 18:54:29 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FIsQxh081916 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 18:54:26 GMT (envelope-from mihai@FreeBSD.org) Date: Mon, 15 Jun 2015 18:54:26 GMT Message-Id: <201506151854.t5FIsQxh081916@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287126 - in soc2015/mihai/bhyve-on-arm-head/sys: arm/conf arm/fvp_ve-cortex_a15x1 arm/vexpress boot/fdt/dts/arm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 18:54:30 -0000 Author: mihai Date: Mon Jun 15 18:54:25 2015 New Revision: 287126 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287126 Log: sys/arm: renaming vexpress into fvp_ve-cortex_a15x1 - the real name of the fast model platform Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/ soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_common.c soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_machdep.c soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_semihosting.S soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_semihosting.h soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/sp804.c soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-motherboard.dtsi Deleted: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/VEXPRESS soc2015/mihai/bhyve-on-arm-head/sys/arm/vexpress/ soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-cortex_a15x1.dts soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/rtsm_ve-motherboard.dtsi Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Mon Jun 15 18:54:25 2015 (r287126) @@ -0,0 +1,73 @@ +# +# FVP_VE_CORTEX_A15x1 - custom configuration +# + +ident ./FVP_VE_CORTEX_A15x1 + +makeoption ARM_LITTLE_ENDIAN + +cpu CPU_CORTEXA +machine arm armv6 +makeoptions CONF_CFLAGS="-march=armv7a" + +include "std.armv6" + +files "../fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1" + +options KERNVIRTADDR=0xc0200000 +makeoptions KERNVIRTADDR=0xc0200000 +options KERNPHYSADDR=0xc0200000 +makeoptions KERNPHYSADDR=0xc0200000 +options PHYSADDR=0xc0000000 + +options HZ=100 +options SCHED_ULE # ULE scheduler +#options PLATFORM +#options SMP # Enable multiple cores + +nooptions FREEBSD_BOOT_LOADER + +# Debugging for use in -current +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +options DEBUG +options EARLY_PRINTF +options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB # Enable kernel debugger support +# For minimum debugger support (stable branch) use: +options KDB_TRACE # Print a stack trace for a panic +# For full debugger support use this instead: +options DDB # Enable the kernel debugger +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS # Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options DIAGNOSTIC + +#options ROOTDEVNAME=\"ufs:/dev/da0\" + +# Pseudo devices + +device loop +device ether +device random +device pty +device md +device bpf + +# Serial ports +device uart +device pl011 + +# I2C +device iic +device iicbus + +# GPIO +device gpio + + +# Flattened Device Tree +options FDT # Configure using FDT/DTB data +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=fvp_ve-cortex_a15x1.dts Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 Mon Jun 15 18:54:25 2015 (r287126) @@ -0,0 +1,13 @@ +kern/kern_clocksource.c standard + +arm/arm/bus_space_base.c standard +arm/arm/bus_space_generic.c standard +arm/arm/bus_space_asm_generic.S standard +arm/arm/gic.c standard + +arm/fvp_ve-cortex_a15x1/sp804.c standard +arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_common.c standard +arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_machdep.c standard + +arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_semihosting.S standard + Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_common.c Mon Jun 15 18:54:25 2015 (r287126) @@ -0,0 +1,72 @@ +/*- + * Copyright (C) 2008-2011 MARVELL INTERNATIONAL LTD. + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: head/sys/arm/versatile/versatile_common.c 281085 2015-04-04 21:34:26Z andrew $"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +struct fdt_fixup_entry fdt_fixup_table[] = { + { NULL, NULL } +}; + +static int +fdt_intc_decode_ic(phandle_t node, pcell_t *intr, int *interrupt, int *trig, + int *pol) +{ + + if (!fdt_is_compatible(node, "arm,cortex-a15-gic")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + + +fdt_pic_decode_t fdt_pic_table[] = { + &fdt_intc_decode_ic, + NULL +}; Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_machdep.c Mon Jun 15 18:54:25 2015 (r287126) @@ -0,0 +1,133 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko. + * All rights reserved. + * + * This code is derived from software written for Brini by Mark Brinicombe + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Brini. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include "opt_ddb.h" +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD: head/sys/arm/versatile/versatile_machdep.c 274668 2014-11-18 17:06:56Z imp $"); + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include "fvp_ve-cortex_a15x1_semihosting.h" + +vm_offset_t +platform_lastaddr(void) +{ + + return (arm_devmap_lastaddr()); +} + +void +platform_probe_and_attach(void) +{ + +} + +void +platform_gpio_init(void) +{ + +} + +void +platform_late_init(void) +{ + +} + +int +platform_devmap_init(void) +{ + /* UART0 (PL011) */ + arm_devmap_add_entry(0x1c090000, 0x1000); + + /* Peripherals (CS3) */ +// arm_devmap_add_entry(0x1C000000, 0x4000000); + + return (0); +} + + + +struct arm32_dma_range * +bus_dma_get_range(void) +{ + + return (NULL); +} + +int +bus_dma_get_range_nb(void) +{ + + return (0); +} + +#ifdef EARLY_PRINTF + +static void +eputc(int c) +{ + char str[2]; + str[0] = c; + str[1] = 0; + + __semi_call(SYS_WRITE0, str); +} + +early_putc_t * early_putc = eputc; +#endif + +void +cpu_reset() +{ + printf("cpu_reset\n"); + while (1); +} + Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_semihosting.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_semihosting.S Mon Jun 15 18:54:25 2015 (r287126) @@ -0,0 +1,8 @@ + @ + @ Function for C code to make semihosting calls: + @ + .globl __semi_call +__semi_call: + svc 0x123456 + mov pc, lr + Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_semihosting.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_semihosting.h Mon Jun 15 18:54:25 2015 (r287126) @@ -0,0 +1,9 @@ +#ifndef SEMIHOSTING_H +#define SEMIHOSTING_H + +#define SYS_WRITE0 4 +#define SEMIHOSTING_SVC 0x123456 /* SVC comment field for semihosting */ + +int __semi_call(int id, ...); + +#endif /* ! SEMIHOSTING_H */ Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/sp804.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/sp804.c Mon Jun 15 18:54:25 2015 (r287126) @@ -0,0 +1,361 @@ +/* + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012 Damjan Marion + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD: soc2015/mihai/bhyve-on-arm-head/sys/arm/versatile/sp804.c 283652 2015-04-04 21:34:26Z andrew $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define SP804_TIMER1_LOAD 0x00 +#define SP804_TIMER1_VALUE 0x04 +#define SP804_TIMER1_CONTROL 0x08 +#define TIMER_CONTROL_EN (1 << 7) +#define TIMER_CONTROL_FREERUN (0 << 6) +#define TIMER_CONTROL_PERIODIC (1 << 6) +#define TIMER_CONTROL_INTREN (1 << 5) +#define TIMER_CONTROL_DIV1 (0 << 2) +#define TIMER_CONTROL_DIV16 (1 << 2) +#define TIMER_CONTROL_DIV256 (2 << 2) +#define TIMER_CONTROL_32BIT (1 << 1) +#define TIMER_CONTROL_ONESHOT (1 << 0) +#define SP804_TIMER1_INTCLR 0x0C +#define SP804_TIMER1_RIS 0x10 +#define SP804_TIMER1_MIS 0x14 +#define SP804_TIMER1_BGLOAD 0x18 +#define SP804_TIMER2_LOAD 0x20 +#define SP804_TIMER2_VALUE 0x24 +#define SP804_TIMER2_CONTROL 0x28 +#define SP804_TIMER2_INTCLR 0x2C +#define SP804_TIMER2_RIS 0x30 +#define SP804_TIMER2_MIS 0x34 +#define SP804_TIMER2_BGLOAD 0x38 + +#define SP804_PERIPH_ID0 0xFE0 +#define SP804_PERIPH_ID1 0xFE4 +#define SP804_PERIPH_ID2 0xFE8 +#define SP804_PERIPH_ID3 0xFEC +#define SP804_PRIMECELL_ID0 0xFF0 +#define SP804_PRIMECELL_ID1 0xFF4 +#define SP804_PRIMECELL_ID2 0xFF8 +#define SP804_PRIMECELL_ID3 0xFFC + +#define DEFAULT_FREQUENCY 1000000 +/* + * QEMU seems to have problem with full frequency + */ +#define DEFAULT_DIVISOR 16 +#define DEFAULT_CONTROL_DIV TIMER_CONTROL_DIV16 + +struct sp804_timer_softc { + struct resource* mem_res; + struct resource* irq_res; + void* intr_hl; + uint32_t sysclk_freq; + bus_space_tag_t bst; + bus_space_handle_t bsh; + struct timecounter tc; + bool et_enabled; + struct eventtimer et; + int timer_initialized; +}; + +/* Read/Write macros for Timer used as timecounter */ +#define sp804_timer_tc_read_4(reg) \ + bus_space_read_4(sc->bst, sc->bsh, reg) + +#define sp804_timer_tc_write_4(reg, val) \ + bus_space_write_4(sc->bst, sc->bsh, reg, val) + +static unsigned sp804_timer_tc_get_timecount(struct timecounter *); + +static unsigned +sp804_timer_tc_get_timecount(struct timecounter *tc) +{ + struct sp804_timer_softc *sc = tc->tc_priv; + return 0xffffffff - sp804_timer_tc_read_4(SP804_TIMER1_VALUE); +} + +static int +sp804_timer_start(struct eventtimer *et, sbintime_t first, sbintime_t period) +{ + struct sp804_timer_softc *sc = et->et_priv; + uint32_t count, reg; + + if (first != 0) { + sc->et_enabled = 1; + + count = ((uint32_t)et->et_frequency * first) >> 32; + + sp804_timer_tc_write_4(SP804_TIMER2_LOAD, count); + reg = TIMER_CONTROL_32BIT | TIMER_CONTROL_INTREN | + TIMER_CONTROL_PERIODIC | DEFAULT_CONTROL_DIV | + TIMER_CONTROL_EN; + sp804_timer_tc_write_4(SP804_TIMER2_CONTROL, reg); + + return (0); + } + + if (period != 0) { + panic("period"); + } + + return (EINVAL); +} + +static int +sp804_timer_stop(struct eventtimer *et) +{ + struct sp804_timer_softc *sc = et->et_priv; + uint32_t reg; + + sc->et_enabled = 0; + reg = sp804_timer_tc_read_4(SP804_TIMER2_CONTROL); + reg &= ~(TIMER_CONTROL_EN); + sp804_timer_tc_write_4(SP804_TIMER2_CONTROL, reg); + + return (0); +} + +static int +sp804_timer_intr(void *arg) +{ + struct sp804_timer_softc *sc = arg; + static uint32_t prev = 0; + uint32_t x = 0; + + x = sp804_timer_tc_read_4(SP804_TIMER1_VALUE); + + prev =x ; + sp804_timer_tc_write_4(SP804_TIMER2_INTCLR, 1); + if (sc->et_enabled) { + if (sc->et.et_active) { + sc->et.et_event_cb(&sc->et, sc->et.et_arg); + } + } + + return (FILTER_HANDLED); +} + +static int +sp804_timer_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "arm,sp804")) { + device_set_desc(dev, "SP804 System Timer"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +sp804_timer_attach(device_t dev) +{ + struct sp804_timer_softc *sc = device_get_softc(dev); + int rid = 0; + int i; + uint32_t id, reg; + phandle_t node; + pcell_t clock; + + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "could not allocate memory resource\n"); + return (ENXIO); + } + + sc->bst = rman_get_bustag(sc->mem_res); + sc->bsh = rman_get_bushandle(sc->mem_res); + + /* Request the IRQ resources */ + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); + if (sc->irq_res == NULL) { + device_printf(dev, "Error: could not allocate irq resources\n"); + return (ENXIO); + } + + sc->sysclk_freq = DEFAULT_FREQUENCY; + /* Get the base clock frequency */ + node = ofw_bus_get_node(dev); + if ((OF_getprop(node, "clock-frequency", &clock, sizeof(clock))) > 0) { + sc->sysclk_freq = fdt32_to_cpu(clock); + } + + /* Setup and enable the timer */ + if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_CLK, + sp804_timer_intr, NULL, sc, + &sc->intr_hl) != 0) { + bus_release_resource(dev, SYS_RES_IRQ, rid, + sc->irq_res); + device_printf(dev, "Unable to setup the clock irq handler.\n"); + return (ENXIO); + } + + sp804_timer_tc_write_4(SP804_TIMER1_CONTROL, 0); + sp804_timer_tc_write_4(SP804_TIMER2_CONTROL, 0); + + /* + * Timer 1, timecounter + */ + sc->tc.tc_frequency = sc->sysclk_freq; + sc->tc.tc_name = "SP804 Time Counter"; + sc->tc.tc_get_timecount = sp804_timer_tc_get_timecount; + sc->tc.tc_poll_pps = NULL; + sc->tc.tc_counter_mask = ~0u; + sc->tc.tc_quality = 1000; + sc->tc.tc_priv = sc; + + sp804_timer_tc_write_4(SP804_TIMER1_VALUE, 0xffffffff); + sp804_timer_tc_write_4(SP804_TIMER1_LOAD, 0xffffffff); + reg = TIMER_CONTROL_PERIODIC | TIMER_CONTROL_32BIT; + sp804_timer_tc_write_4(SP804_TIMER1_CONTROL, reg); + reg |= TIMER_CONTROL_EN; + sp804_timer_tc_write_4(SP804_TIMER1_CONTROL, reg); + tc_init(&sc->tc); + + /* + * Timer 2, event timer + */ + sc->et_enabled = 0; + sc->et.et_name = malloc(64, M_DEVBUF, M_NOWAIT | M_ZERO); + sprintf(sc->et.et_name, "SP804 Event Timer %d", + device_get_unit(dev)); + sc->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT; + sc->et.et_quality = 1000; + sc->et.et_frequency = sc->sysclk_freq / DEFAULT_DIVISOR; + sc->et.et_min_period = (0x00000002LLU << 32) / sc->et.et_frequency; + sc->et.et_max_period = (0xfffffffeLLU << 32) / sc->et.et_frequency; + sc->et.et_start = sp804_timer_start; + sc->et.et_stop = sp804_timer_stop; + sc->et.et_priv = sc; + et_register(&sc->et); + + id = 0; + for (i = 3; i >= 0; i--) { + id = (id << 8) | + (sp804_timer_tc_read_4(SP804_PERIPH_ID0 + i*4) & 0xff); + } + + device_printf(dev, "peripheral ID: %08x\n", id); + + id = 0; + for (i = 3; i >= 0; i--) { + id = (id << 8) | + (sp804_timer_tc_read_4(SP804_PRIMECELL_ID0 + i*4) & 0xff); + } + + device_printf(dev, "PrimeCell ID: %08x\n", id); + + sc->timer_initialized = 1; + + return (0); +} + +static device_method_t sp804_timer_methods[] = { + DEVMETHOD(device_probe, sp804_timer_probe), + DEVMETHOD(device_attach, sp804_timer_attach), + { 0, 0 } +}; + +static driver_t sp804_timer_driver = { + "timer", + sp804_timer_methods, + sizeof(struct sp804_timer_softc), +}; + +static devclass_t sp804_timer_devclass; + +DRIVER_MODULE(sp804_timer, simplebus, sp804_timer_driver, sp804_timer_devclass, 0, 0); + +void +DELAY(int usec) +{ + int32_t counts; + uint32_t first, last; + device_t timer_dev; + struct sp804_timer_softc *sc; + int timer_initialized = 0; + + timer_dev = devclass_get_device(sp804_timer_devclass, 0); + + if (timer_dev) { + sc = device_get_softc(timer_dev); + + if (sc) + timer_initialized = sc->timer_initialized; + } + + if (!timer_initialized) { + /* + * Timer is not initialized yet + */ + for (; usec > 0; usec--) + for (counts = 200; counts > 0; counts--) + /* Prevent gcc from optimizing out the loop */ + cpufunc_nullop(); + return; + } + + /* Get the number of times to count */ + counts = usec * ((sc->tc.tc_frequency / 1000000) + 1); + + first = sp804_timer_tc_get_timecount(&sc->tc); + + while (counts > 0) { + last = sp804_timer_tc_get_timecount(&sc->tc); + if (last == first) + continue; + if (last>first) { + counts -= (int32_t)(last - first); + } else { + counts -= (int32_t)((0xFFFFFFFF - first) + last); + } + first = last; + } +} Added: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts Mon Jun 15 18:54:25 2015 (r287126) @@ -0,0 +1,127 @@ +/* + * ARM Ltd. Fast Models + * + * Versatile Express (VE) system model + * ARMCortexA15x1CT + * + * RTSM_VE_Cortex_A15x1.lisa + */ + +/dts-v1/; + +/ { + model = "RTSM_VE_Cortex_A15x1"; + compatible = "arm,rtsm_ve,cortex_a15x1", "arm,vexpress"; + interrupt-parent = <&gic>; + #address-cells = <2>; + #size-cells = <2>; + + chosen { }; + + aliases { + serial0 = &v2m_serial0; + serial1 = &v2m_serial1; + serial2 = &v2m_serial2; + serial3 = &v2m_serial3; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a15"; + reg = <0>; + }; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0 0x80000000 0 0x40000000>; + }; + + gic: interrupt-controller@2c001000 { + compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; + #interrupt-cells = <3>; + #address-cells = <0>; + interrupt-controller; + reg = <0 0x2c001000 0 0x1000>, + <0 0x2c002000 0 0x2000>, + <0 0x2c004000 0 0x2000>, + <0 0x2c006000 0 0x2000>; + interrupts = <1 9 0xf04>; + }; + + timer { + compatible = "arm,armv7-timer"; + #interrupt-cells = <3>; + #address-cells = <0>; + interrupts = <1 13 0xf08>, + <1 14 0xf08>, + <1 11 0xf08>, + <1 10 0xf08>; + }; + + smb { + compatible = "simple-bus"; + + #address-cells = <1>; + #size-cells = <1>; + ranges = /*<0 0 0x08000000 0x04000000>, + <1 0 0x14000000 0x04000000>, + <2 0 0x18000000 0x04000000>,*/ + <0 0 0x1c000000 0x04000000>; +/* <4 0 0x0c000000 0x04000000>, + <5 0 0x10000000 0x04000000>;*/ + + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 63>; + interrupt-map = <0 0 0 &gic 0 0 4>, + <0 0 1 &gic 0 1 4>, + <0 0 2 &gic 0 2 4>, + <0 0 3 &gic 0 3 4>, + <0 0 4 &gic 0 4 4>, + <0 0 5 &gic 0 5 4>, + <0 0 6 &gic 0 6 4>, + <0 0 7 &gic 0 7 4>, + <0 0 8 &gic 0 8 4>, + <0 0 9 &gic 0 9 4>, + <0 0 10 &gic 0 10 4>, + <0 0 11 &gic 0 11 4>, + <0 0 12 &gic 0 12 4>, + <0 0 13 &gic 0 13 4>, + <0 0 14 &gic 0 14 4>, + <0 0 15 &gic 0 15 4>, + <0 0 16 &gic 0 16 4>, + <0 0 17 &gic 0 17 4>, + <0 0 18 &gic 0 18 4>, + <0 0 19 &gic 0 19 4>, + <0 0 20 &gic 0 20 4>, + <0 0 21 &gic 0 21 4>, + <0 0 22 &gic 0 22 4>, + <0 0 23 &gic 0 23 4>, + <0 0 24 &gic 0 24 4>, + <0 0 25 &gic 0 25 4>, + <0 0 26 &gic 0 26 4>, + <0 0 27 &gic 0 27 4>, + <0 0 28 &gic 0 28 4>, + <0 0 29 &gic 0 29 4>, + <0 0 30 &gic 0 30 4>, + <0 0 31 &gic 0 31 4>, + <0 0 32 &gic 0 32 4>, + <0 0 33 &gic 0 33 4>, + <0 0 34 &gic 0 34 4>, + <0 0 35 &gic 0 35 4>, + <0 0 36 &gic 0 36 4>, + <0 0 37 &gic 0 37 4>, + <0 0 38 &gic 0 38 4>, + <0 0 39 &gic 0 39 4>, + <0 0 40 &gic 0 40 4>, + <0 0 41 &gic 0 41 4>, + <0 0 42 &gic 0 42 4>; + + /include/ "rtsm_ve-motherboard.dtsi" + }; +}; + Added: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-motherboard.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-motherboard.dtsi Mon Jun 15 18:54:25 2015 (r287126) @@ -0,0 +1,240 @@ +/* + * ARM Ltd. Fast Models + * + * Versatile Express (VE) system model + * Motherboard component + * + * VEMotherBoard.lisa + */ + + motherboard { + arm,v2m-memory-map = "rs1"; + compatible = "arm,rtsm_ve,vemotherboard", "simple-bus"; + #address-cells = <1>; /* SMB chipselect number and offset */ + #size-cells = <1>; + #interrupt-cells = <1>; + ranges; + + flash@0,00000000 { + compatible = "arm,vexpress-flash", "cfi-flash"; + reg = <0 0x00000000 0x04000000>, + <4 0x00000000 0x04000000>; + bank-width = <4>; + }; + + vram@2,00000000 { + compatible = "arm,vexpress-vram"; + reg = <2 0x00000000 0x00800000>; + }; + + ethernet@2,02000000 { + compatible = "smsc,lan91c111"; + reg = <2 0x02000000 0x10000>; + interrupts = <15>; + }; + + iofpga@3,00000000 { + compatible = "arm,amba-bus", "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0x200000>; + + v2m_sysreg: sysreg@010000 { + compatible = "arm,vexpress-sysreg"; + reg = <0x010000 0x1000>; + gpio-controller; + #gpio-cells = <2>; + }; + + v2m_sysctl: sysctl@020000 { + compatible = "arm,sp810", "arm,primecell"; + reg = <0x020000 0x1000>; + clocks = <&v2m_refclk32khz>, <&v2m_refclk1mhz>, <&v2m_clk24mhz>; + clock-names = "refclk", "timclk", "apb_pclk"; + #clock-cells = <1>; + clock-output-names = "timerclken0", "timerclken1", "timerclken2", "timerclken3"; + }; + + aaci@040000 { + compatible = "arm,pl041", "arm,primecell"; + reg = <0x040000 0x1000>; + interrupts = <11>; + clocks = <&v2m_clk24mhz>; + clock-names = "apb_pclk"; + }; + + mmci@050000 { + compatible = "arm,pl180", "arm,primecell"; + reg = <0x050000 0x1000>; + interrupts = <9 10>; + cd-gpios = <&v2m_sysreg 0 0>; + wp-gpios = <&v2m_sysreg 1 0>; + max-frequency = <12000000>; + vmmc-supply = <&v2m_fixed_3v3>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "mclk", "apb_pclk"; + }; + + kmi@060000 { + compatible = "arm,pl050", "arm,primecell"; + reg = <0x060000 0x1000>; + interrupts = <12>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "KMIREFCLK", "apb_pclk"; + }; + + kmi@070000 { + compatible = "arm,pl050", "arm,primecell"; + reg = <0x070000 0x1000>; + interrupts = <13>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "KMIREFCLK", "apb_pclk"; + }; + + v2m_serial0: uart@090000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x090000 0x1000>; + interrupts = <5>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "uartclk", "apb_pclk"; + }; + + v2m_serial1: uart@0a0000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0a0000 0x1000>; + interrupts = <6>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "uartclk", "apb_pclk"; + }; + + v2m_serial2: uart@0b0000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0b0000 0x1000>; + interrupts = <7>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "uartclk", "apb_pclk"; + }; + + v2m_serial3: uart@0c0000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x0c0000 0x1000>; + interrupts = <8>; + clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>; + clock-names = "uartclk", "apb_pclk"; + }; + + wdt@0f0000 { + compatible = "arm,sp805", "arm,primecell"; + reg = <0x0f0000 0x1000>; + interrupts = <0>; + clocks = <&v2m_refclk32khz>, <&v2m_clk24mhz>; + clock-names = "wdogclk", "apb_pclk"; + }; + + v2m_timer01: timer@110000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x110000 0x1000>; + interrupts = <2>; + clocks = <&v2m_sysctl 0>, <&v2m_sysctl 1>, <&v2m_clk24mhz>; + clock-names = "timclken1", "timclken2", "apb_pclk"; + }; + + v2m_timer23: timer@120000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x120000 0x1000>; + interrupts = <3>; + clocks = <&v2m_sysctl 2>, <&v2m_sysctl 3>, <&v2m_clk24mhz>; + clock-names = "timclken1", "timclken2", "apb_pclk"; + }; + + virtio_block@130000 { + compatible = "virtio,mmio"; + reg = <0x130000 0x200>; + interrupts = <42>; + }; + + rtc@170000 { + compatible = "arm,pl031", "arm,primecell"; + reg = <0x170000 0x1000>; + interrupts = <4>; + clocks = <&v2m_clk24mhz>; + clock-names = "apb_pclk"; + }; + + clcd@1f0000 { + compatible = "arm,pl111", "arm,primecell"; + reg = <0x1f0000 0x1000>; + interrupts = <14>; + clocks = <&v2m_oscclk1>, <&v2m_clk24mhz>; + clock-names = "clcdclk", "apb_pclk"; + }; + }; + + v2m_fixed_3v3: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 19:36:29 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 50DC4CA0 for ; Mon, 15 Jun 2015 19:36:29 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 247DAF6B for ; Mon, 15 Jun 2015 19:36:29 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FJaT4b057003 for ; Mon, 15 Jun 2015 19:36:29 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FJaRrm056996 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 19:36:27 GMT (envelope-from mihai@FreeBSD.org) Date: Mon, 15 Jun 2015 19:36:27 GMT Message-Id: <201506151936.t5FJaRrm056996@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287129 - in soc2015/mihai/bhyve-on-arm-head/sys: arm/conf boot/fdt/dts/arm dev/ofw MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 19:36:29 -0000 Author: mihai Date: Mon Jun 15 19:36:27 2015 New Revision: 287129 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287129 Log: sys: fix compile errors Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts soc2015/mihai/bhyve-on-arm-head/sys/dev/ofw/ofw_bus_subr.c Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Mon Jun 15 18:43:32 2015 (r287128) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Mon Jun 15 19:36:27 2015 (r287129) @@ -2,7 +2,7 @@ # FVP_VE_CORTEX_A15x1 - custom configuration # -ident ./FVP_VE_CORTEX_A15x1 +ident FVP_VE_CORTEX_A15x1 makeoption ARM_LITTLE_ENDIAN Modified: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts Mon Jun 15 18:43:32 2015 (r287128) +++ soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts Mon Jun 15 19:36:27 2015 (r287129) @@ -10,8 +10,8 @@ /dts-v1/; / { - model = "RTSM_VE_Cortex_A15x1"; - compatible = "arm,rtsm_ve,cortex_a15x1", "arm,vexpress"; + model = "FVP_VE_Cortex_A15x1"; + compatible = "arm,fvp_ve,cortex_a15x1", "arm,vexpress"; interrupt-parent = <&gic>; #address-cells = <2>; #size-cells = <2>; @@ -121,7 +121,7 @@ <0 0 41 &gic 0 41 4>, <0 0 42 &gic 0 42 4>; - /include/ "rtsm_ve-motherboard.dtsi" + /include/ "fvp_ve-motherboard.dtsi" }; }; Modified: soc2015/mihai/bhyve-on-arm-head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/dev/ofw/ofw_bus_subr.c Mon Jun 15 18:43:32 2015 (r287128) +++ soc2015/mihai/bhyve-on-arm-head/sys/dev/ofw/ofw_bus_subr.c Mon Jun 15 19:36:27 2015 (r287129) @@ -440,7 +440,6 @@ nintr = OF_getencprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); - printf("%s %d\n",__func__,nintr); if (nintr > 0) { if (OF_searchencprop(node, "interrupt-parent", &iparent, sizeof(iparent)) == -1) { @@ -495,7 +494,6 @@ } } irqnum = ofw_bus_map_intr(dev, iparent, icells, &intr[i]); - printf("%s irqnum:%d\m",irqnum); resource_list_add(rl, SYS_RES_IRQ, rid++, irqnum, irqnum, 1); } if (rlen != NULL) From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 19:51:37 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 526EE424 for ; Mon, 15 Jun 2015 19:51:37 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F18F62D for ; Mon, 15 Jun 2015 19:51:37 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FJpb5i074560 for ; Mon, 15 Jun 2015 19:51:37 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FJpWAE074039 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 19:51:32 GMT (envelope-from mihai@FreeBSD.org) Date: Mon, 15 Jun 2015 19:51:32 GMT Message-Id: <201506151951.t5FJpWAE074039@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287130 - in soc2015/mihai/boot-wrapper: . libfdt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 19:51:37 -0000 Author: mihai Date: Mon Jun 15 19:51:31 2015 New Revision: 287130 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287130 Log: soc2015: mihai: add boot-wrapper for fast-models Added: soc2015/mihai/boot-wrapper/ (props changed) soc2015/mihai/boot-wrapper/LICENSE.txt soc2015/mihai/boot-wrapper/Makefile soc2015/mihai/boot-wrapper/README.txt soc2015/mihai/boot-wrapper/boot.S soc2015/mihai/boot-wrapper/build_freebsd.sh (contents, props changed) soc2015/mihai/boot-wrapper/c_start.c soc2015/mihai/boot-wrapper/config-default.mk soc2015/mihai/boot-wrapper/libfdt/ (props changed) soc2015/mihai/boot-wrapper/libfdt/Makefile.libfdt soc2015/mihai/boot-wrapper/libfdt/fdt.c soc2015/mihai/boot-wrapper/libfdt/fdt.h soc2015/mihai/boot-wrapper/libfdt/fdt_ro.c soc2015/mihai/boot-wrapper/libfdt/fdt_rw.c soc2015/mihai/boot-wrapper/libfdt/fdt_strerror.c soc2015/mihai/boot-wrapper/libfdt/fdt_sw.c soc2015/mihai/boot-wrapper/libfdt/fdt_wip.c soc2015/mihai/boot-wrapper/libfdt/libfdt.h soc2015/mihai/boot-wrapper/libfdt/libfdt_env.h soc2015/mihai/boot-wrapper/libfdt/libfdt_internal.h soc2015/mihai/boot-wrapper/model.lds.S soc2015/mihai/boot-wrapper/semi_loader.c soc2015/mihai/boot-wrapper/semi_loader.h soc2015/mihai/boot-wrapper/semihosting.c soc2015/mihai/boot-wrapper/semihosting.h soc2015/mihai/boot-wrapper/string.c soc2015/mihai/boot-wrapper/string.h Added: soc2015/mihai/boot-wrapper/LICENSE.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/LICENSE.txt Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1,28 @@ +Copyright (c) 2011, ARM Limited +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * 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. + * Neither the name of ARM nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Added: soc2015/mihai/boot-wrapper/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/Makefile Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1,78 @@ +# Makefile - build a kernel+filesystem image for stand-alone Linux booting +# +# Copyright (C) 2011 ARM Limited. All rights reserved. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE.txt file. + + +# Include config file (prefer config.mk, fall back to config-default.mk) +ifneq ($(wildcard config.mk),) +include config.mk +else +include config-default.mk +endif + +LIBFDTOBJS = libfdt/fdt.o libfdt/fdt_ro.o libfdt/fdt_wip.o \ + libfdt/fdt_sw.o libfdt/fdt_rw.o libfdt/fdt_strerror.o +BOOTLOADER = boot.S +OBJS = boot.o c_start.o semihosting.o string.o semi_loader.o $(LIBFDTOBJS) +KERNEL = uImage + +IMAGE = linux-system.axf +SEMIIMG = linux-system-semi.axf +LD_SCRIPT = model.lds.S + + +CC = $(CROSS_COMPILE)gcc +LD = $(CROSS_COMPILE)ld + +# These are needed by the underlying kernel make +export CROSS_COMPILE ARCH + +# Build all wrappers +all: $(IMAGE) $(SEMIIMG) + +# Build just the semihosting wrapper +semi: $(SEMIIMG) + +clean distclean: + rm -f $(IMAGE) $(SEMIIMG) \ + model.lds modelsemi.lds $(OBJS) $(KERNEL) + +$(KERNEL): $(KERNEL_SRC)/arch/arm/boot/uImage + cp $< $@ + +$(IMAGE): $(OBJS) model.lds $(KERNEL) $(FILESYSTEM) Makefile + $(LD) -o $@ $(OBJS) --script=model.lds + +$(SEMIIMG): $(OBJS) modelsemi.lds + $(LD) -o $@ $(OBJS) --script=modelsemi.lds + +boot.o: $(BOOTLOADER) + $(CC) $(CPPFLAGS) -DKCMD='$(KCMD)' -c -o $@ $< + +%.o: %.c + $(CC) $(CPPFLAGS) -O2 -ffreestanding -I. -Ilibfdt -c -o $@ $< + +model.lds: $(LD_SCRIPT) Makefile + $(CC) $(CPPFLAGS) -E -P -C -o $@ $< + +modelsemi.lds: $(LD_SCRIPT) Makefile + $(CC) $(CPPFLAGS) -DSEMIHOSTING=1 -E -P -C -o $@ $< + +$(KERNEL_SRC)/arch/arm/boot/uImage: force + $(MAKE) -C $(KERNEL_SRC) -j4 uImage + +# Pass any target we don't know about through to the kernel makefile. +# This is a convenience rule so we can say 'make menuconfig' etc here. +# Note that any rules in this file must have a command or be marked as +# .PHONY. +%: force + $(MAKE) -C $(KERNEL_SRC) $@ + +force: ; + +Makefile: ; + +.PHONY: all semi clean distclean config.mk config-default.mk Added: soc2015/mihai/boot-wrapper/README.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/README.txt Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1,74 @@ +boot-wrapper: Start Linux kernels under ARM Fast Models + +The boot-wrapper is a fairly simple implementation of a boot loader +intended to run under an ARM Fast Model and boot Linux. + +License +======= + +The boot-wrapper is generally under a 3 clause BSD license +(see LICENSE.txt for details). Note that some source files +are under similar but compatible licenses. In particular +libfdt is dual-license GPL/2-clause-BSD. + +Compilation +=========== + +The expected method of building is to cross-compile on an +x86 box. You'll need an ARM cross-compiler. On Ubuntu you +can get this by installing the packages: + gcc-4.6-arm-linux-gnueabi binutils-arm-linux-gnueabi + libc6-armel-cross linux-libc-dev-armel-cross gcc-arm-linux-gnueabi + libc6-dev-armel-cross cpp-arm-linux-gnueabi + +The boot-wrapper can be compiled in two ways: + (1) as a small standalone binary which uses the model's semihosting + ABI to load a kernel (and optionally initrd and flattened device tree) + when you run the model + (2) with a specific kernel and initrd compiled into the binary; + this is less flexible but may be useful in some situations + +For case (1) you can just run: + make CROSS_COMPILE=arm-linux-gnueabi- semi +which will build "linux-system-semi.axf". +(As with a Linux kernel cross-compile, the CROSS_COMPILE +variable is set to the prefix of the cross toolchain. +"arm-linux-gnueabi-" matches the prefix used by the Ubuntu +cross toolchain.) + +For case (2) you'll need a Linux kernel tree to hand; the +boot-wrapper makefile will automatically look into it to +extract the kernel. By default this tree is assumed to be in +"../linux-kvm-arm". Assuming you have that tree set up and +have built a kernel in it, you can run: + make CROSS_COMPILE=arm-linux-gnueabi- +which will build "linux-system.axf". + +You can configure the makefile system by copying config-default.mk +to config.mk and editing it. This is only likely to be useful for +case (2); see the comments in config-default.mk for more information. + +Running +======= + +To run a model with a linux-system-semi.axf: + +RTSM_VE_Cortex-A15x1 linux-system-semi.axf -C cluster.cpu0.semihosting-cmd_line="--kernel /path/to/zImage [--initrd /path/to/initrd] [--dtb /path/to/dtb] [-- kernel command line arguments]" + +The paths to the kernel, initrd and device tree blob should all be +host filesystem paths. The initrd and dtb are both optional. Any text +following '--' is passed to the kernel as its command line; this is +also optional. + +You may also want to pass other options to the model (for instance +to enable networking); these are not described here. See the Fast +Models documentation for more information. + +Running a linux-system.axf is the same, except that since all +the files are built in there's no need to pass a command line: + +RTSM_VE_Cortex-A15x1 linux-system.axf + +Passing a command line to linux-system.axf is allowed, and any +kernel/initrd/dtb/commandline specified will override the compiled-in +version. Added: soc2015/mihai/boot-wrapper/boot.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/boot.S Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1,216 @@ +/* + * boot.S - simple register setup code for stand-alone Linux booting + * + * Copyright (C) 2011 ARM Limited. All rights reserved. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE.txt file. + */ + + .syntax unified + .arch_extension sec + .arch_extension virt + .text + +.macro enter_hyp + @ We assume we're entered in Secure Supervisor mode. To + @ get to Hyp mode we have to pass through Monitor mode + @ and NS-Supervisor mode. Note that there is no way to + @ return to the Secure world once we've done this. + @ + @ This will trash r10 and r11. + ldr r10, =vectors + mcr p15, 0, r10, c12, c0, 1 @ Monitor vector base address + @ Switch to monitor mode, which will set up the HVBAR and + @ then return to us in NS-SVC + smc #0 + @ Now we're in NS-SVC, make a Hyp call to get into Hyp mode +// hvc #0 + @ We will end up here in NS-Hyp. +.endm + +.align 5 +/* We use the same vector table for Hyp and Monitor mode, since + * we will only use each once and they don't overlap. + */ +vectors: + .word 0 /* reset */ + .word 0 /* undef */ + b 2f /* smc */ + .word 0 /* pabt */ + .word 0 /* dabt */ + b 1f + .word 0 /* irq */ + .word 0 /* fiq */ + +/* Return directly back to the caller without leaving Hyp mode: */ +1: mrs lr, elr_hyp + mov pc, lr + +/* In monitor mode, set up HVBAR and SCR then return to caller in NS-SVC. */ +2: + @ Set up HVBAR + mrc p15, 0, r10, c1, c1, 0 @ SCR + @ Set SCR.NS=1 (needed for setting HVBAR and also returning to NS state) + @ .IRQ,FIQ,EA=0 (don't take aborts/exceptions to Monitor mode) + @ .FW,AW=1 (CPSR.A,F modifiable in NS state) + @ .nET=0 (early termination OK) + @ .SCD=1 (SMC in NS mode is UNDEF, so accidental SMCs don't + @ cause us to leap back into this code confusingly) + @ .HCE=1 (HVC does Hyp call) + bic r10, r10, #0x07f + ldr r11, =0x1b1 + orr r10, r10, r11 + mcr p15, 0, r11, c1, c1, 0 + isb + ldr r11, =vectors + mcr p15, 4, r11, c12, c0, 0 @ set HVBAR + @ ...and return to calling code in NS state + movs pc, lr + + + .globl start +start: +#ifdef SMP +#ifdef VEXPRESS + @ + @ Program architected timer frequency + @ + mrc p15, 0, r0, c0, c1, 1 @ CPUID_EXT_PFR1 + lsr r0, r0, #16 + and r0, r0, #1 @ Check generic timer support + beq 1f + ldr r0, =24000000 @ 24MHz timer frequency + mcr p15, 0, r0, c14, c0, 0 @ CNTFRQ +1: +#endif + @ + @ CPU initialisation + @ + mrc p15, 0, r4, c0, c0, 5 @ MPIDR (ARMv7 only) + and r4, r4, #15 @ CPU number + + @ + @ Hypervisor / TrustZone initialization + @ + + @ Set all interrupts to be non-secure + ldr r0, =0x2c001000 @ Dist GIC base + ldr r1, [r0, #0x04] @ Type Register + cmp r4, #0 + andeq r1, r1, #0x1f + movne r1, #0 + add r2, r0, #0x080 @ Security Register 0 + mvn r3, #0 +2: str r3, [r2] + sub r1, r1, #1 + add r2, r2, #4 @ Next security register + cmp r1, #-1 + bne 2b + + @ Set GIC priority mask bit [7] = 1 + ldr r0, =0x2c002000 @ CPU GIC base + mov r1, #0x80 + str r1, [r0, #0x4] @ GIC ICCPMR + + @ Set NSACR to allow coprocessor access from non-secure + mrc p15, 0, r0, c1, c1, 2 + ldr r1, =0x43fff + orr r0, r0, r1 + mcr p15, 0, r0, c1, c1, 2 + + @ Check CPU nr again + mrc p15, 0, r0, c0, c0, 5 @ MPIDR (ARMv7 only) + bfc r0, #24, #8 @ CPU number, taking multicluster into account + cmp r0, #0 @ primary CPU? + beq 2f + + @ + @ Secondary CPUs (following the RealView SMP booting protocol) + @ + enter_hyp + + ldr r1, =fs_start - 0x100 + adr r2, 1f + ldmia r2, {r3 - r7} @ move the code to a location + stmia r1, {r3 - r7} @ less likely to be overridden +#ifdef VEXPRESS + ldr r0, =0x1c010030 @ VE SYS_FLAGS register +#else + ldr r0, =0x10000030 @ RealView SYS_FLAGS register +#endif + mov pc, r1 @ branch to the relocated code +1: +#ifdef VEXPRESS + wfe +#endif + ldr r1, [r0] + cmp r1, #0 + beq 1b + mov pc, r1 @ branch to the given address +#endif + +2: + @ + @ UART initialisation (38400 8N1) + @ +#ifdef MACH_MPS + ldr r0, =0x1f005000 @ UART3 base (MPS) +#elif defined (VEXPRESS) + ldr r0, =0x1c090000 @ UART base (Versatile Express) +#else + ldr r0, =0x10009000 @ UART base (RealView/EB) +#endif + mov r1, #0x10 @ ibrd + str r1, [r0, #0x24] + mov r1, #0xc300 + orr r1, #0x0001 @ cr + str r1, [r0, #0x30] + + @ Now we've got rid of the secondary CPUs, set up a stack + @ for CPU 0 so we can write most of this in C. + ldr sp, =stacktop + + @ And call the C entrypoint + bl c_start + @ Never reached +1: b 1b + + @ + @ Function for C code to make semihosting calls: + @ + .globl __semi_call +__semi_call: +#if defined(MACH_MPS) + @ M profile semihosting is via bpkt + bkpt 0xab +#elif defined(__thumb__) + @ Otherwise, different SVC numbers for ARM or Thumb mode + svc 0xab +#else + svc 0x123456 +#endif + mov pc, lr + +.globl __boot_kernel +__boot_kernel: + mov r4, r0 + stmfd sp!, {r1-r3} + ldmia sp, {r0-r3} + + enter_hyp + + bx r4 +.type __boot_kernel, %function + + @ + @ Data + @ + /* The kernel boot command line for builtin kernels is defined in the Make system */ + .globl kernel_cmd + .globl kernel_cmd_end +kernel_cmd: +#ifdef KCMD + .asciz KCMD +#endif +kernel_cmd_end: Added: soc2015/mihai/boot-wrapper/build_freebsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/build_freebsd.sh Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1 @@ +gmake CROSS_COMPILE=arm-none-eabi- semi Added: soc2015/mihai/boot-wrapper/c_start.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/c_start.c Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2012 Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Linaro Limited nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + */ + +/* This file just contains a small glue function which fishes the + * location of kernel etc out of linker script defined symbols, and + * calls semi_loader functions to do the actual work of loading + * and booting the kernel. + */ + +#include +#include "semihosting.h" +#include "semi_loader.h" + +/* Linker script defined symbols for any preloaded kernel/initrd */ +extern uint8_t fs_start, fs_end, kernel_entry, kernel_start, kernel_end; +/* Symbols defined by boot.S */ +extern uint8_t kernel_cmd, kernel_cmd_end; + +static struct loader_info loader; + +#ifdef MACH_MPS +#define PLAT_ID 10000 /* MPS (temporary) */ +#elif defined (VEXPRESS) +#define PLAT_ID 2272 /* Versatile Express */ +#else +#define PLAT_ID 827 /* RealView/EB */ +#endif + +void c_start(void) +{ + /* Main C entry point */ + loader.kernel_size = (uint32_t)&kernel_end - (uint32_t)&kernel_start; + loader.initrd_start = (uint32_t)&fs_start; + loader.initrd_size = (uint32_t)&fs_end - (uint32_t)&fs_start; + loader.kernel_entry = (uint32_t)&kernel_entry; + if (loader.kernel_size) { + loader.cmdline_start = (uint32_t)&kernel_cmd; + loader.cmdline_size = &kernel_cmd_end - &kernel_cmd; + } + load_kernel(&loader); + + /* Start the kernel */ + if(loader.fdt_start) { + boot_kernel(&loader, 0, -1, loader.fdt_start, 0); + } else { + boot_kernel(&loader, 0, PLAT_ID, loader.atags_start, 0); + } + + semi_write0("[bootwrapper] ERROR: returned from boot_kernel\n"); +} Added: soc2015/mihai/boot-wrapper/config-default.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/config-default.mk Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1,100 @@ +# Configuration file included in Makefile +# +# Copyright (C) 2011 Columbia University. All rights reserved. +# Christoffer Dall +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE.txt file. +# +# This is a sample configuration file. To make changes, copy this file to +# config.mk and modify that file. +# +# For all systems you can override USE_INITRD and KCMD from the command-line. +# + +########################################################################### +# Main options +# +CROSS_COMPILE ?= arm-unknown-eabi- +ARCH ?= arm +KERNEL_SRC ?= ../linux-kvm-arm + +# Select system: +# mps: MPS (Cortex-M3) +# realview_eb: RealViewPB, EB, etc. +# vexpress: Versatile Express +SYSTEM ?= vexpress + +########################################################################### +# Turn this on to use an initrd whose contents are in filesystem.cpio.gz +USE_INITRD ?= no +ifeq ($(USE_INITRD),yes) +CPPFLAGS += -DUSE_INITRD +FILESYSTEM ?= filesystem.cpio.gz +else +FILESYSTEM = +endif + +########################################################################### +# Default NFS root +NFS_ROOT ?= /srv/nfsroot +ifeq ($(origin NFS_SERVER), undefined) +NFS_SERVER := $(shell ip addr show scope global | \ + sed -ne '/inet/{s/ *inet \([^/]*\)\/.*/\1/p;q}') +endif + + +########################################################################### +# MPS (Cortex-M3) definitions +# +ifeq ($(SYSTEM),mps) +# C-flags +CPPFLAGS += -DMACH_MPS -DTHUMB2_KERNEL +CPPFLAGS += -march=armv7-m +CPPFLAGS += -mthumb -Wa,-mthumb -Wa,-mimplicit-it=always + +# Kernel command line +KCMD ?= "rdinit=/bin/sh console=ttyAMA3 mem=4M earlyprintk" +endif # SYSTEM = mps + + +########################################################################### +# EB, RealviewPB, etc +# +ifeq ($(SYSTEM),realview_eb) + +CPPFLAGS += -DSMP +CPPFLAGS += -march=armv7-a -marm +#CPPFLAGS += -DTHUMB2_KERNEL + +# Default kernel command line, using initrd: +ifeq ($(USE_INITRD),yes) + KCMD ?= "console=ttyAMA0 mem=256M earlyprintk" +endif +# +# Default kernel command line, without initrd: +ifneq ($(USE_INITRD),yes) + KCMD ?= "root=/dev/nfs nfsroot=$(NFS_HOST):$(NFS_ROOT) ip=dhcp console=ttyAMA0 mem=256M earlyprintk" +endif +endif # SYSTEM = realvire_eb + + +########################################################################### +# Versatile Express +# +ifeq ($(SYSTEM),vexpress) + +CPPFLAGS += -DSMP +CPPFLAGS += -march=armv7-a -marm +#CPPFLAGS += -DTHUMB2_KERNEL +CPPFLAGS += -DVEXPRESS + +# Default kernel command line, using initrd: +ifeq ($(USE_INITRD),yes) + KCMD ?= "console=ttyAMA0 mem=512M mem=512M@0x880000000 earlyprintk ip=dhcp" +endif +# +# Default kernel command line, without initrd: +ifneq ($(USE_INITRD),yes) + KCMD ?= "console=ttyAMA0 mem=512M mem=512M@0x880000000 earlyprintk root=/dev/nfs nfsroot=$(NFS_SERVER):$(NFS_ROOT),tcp rw ip=dhcp nfsrootdebug" +endif +endif # SYSTEM = vexpress Added: soc2015/mihai/boot-wrapper/libfdt/Makefile.libfdt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/libfdt/Makefile.libfdt Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1,24 @@ +# Makefile.libfdt +# +# This is not a complete Makefile of itself. Instead, it is designed to +# be easily embeddable into other systems of Makefiles. +# +-include $(d)/*.d + +LIBFDT_CPPFLAGS += -I$(d) +LIBFDT_OBJS := \ + $(d)/fdt.o \ + $(d)/fdt_ro.o \ + $(d)/fdt_wip.o \ + $(d)/fdt_sw.o \ + $(d)/fdt_rw.o \ + $(d)/fdt_strerror.o + +CLEAN_SUBDIRS += $(d) + +OBJS-libfdt.a = $(LIBFDT_OBJS) +libfdt.a: $(OBJS-libfdt.a) + +$(d)/%.o: $(d)/%.c + @echo " CC[LIB] $<" + $(Q)$(CC) $(LIBFDT_CPPFLAGS) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< Added: soc2015/mihai/boot-wrapper/libfdt/fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/libfdt/fdt.c Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1,201 @@ +/* + * libfdt - Flat Device Tree manipulation + * Copyright (C) 2006 David Gibson, IBM Corporation. + * + * libfdt is dual licensed: you can use it either under the terms of + * the GPL, or the BSD license, at your option. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * Alternatively, + * + * b) 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 COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "libfdt_env.h" + +#include +#include + +#include "libfdt_internal.h" + +int fdt_check_header(const void *fdt) +{ + if (fdt_magic(fdt) == FDT_MAGIC) { + /* Complete tree */ + if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION) + return -FDT_ERR_BADVERSION; + if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION) + return -FDT_ERR_BADVERSION; + } else if (fdt_magic(fdt) == FDT_SW_MAGIC) { + /* Unfinished sequential-write blob */ + if (fdt_size_dt_struct(fdt) == 0) + return -FDT_ERR_BADSTATE; + } else { + return -FDT_ERR_BADMAGIC; + } + + return 0; +} + +const void *fdt_offset_ptr(const void *fdt, int offset, int len) +{ + const char *p; + + if (fdt_version(fdt) >= 0x11) + if (((offset + len) < offset) + || ((offset + len) > fdt_size_dt_struct(fdt))) + return NULL; + + p = _fdt_offset_ptr(fdt, offset); + + if (p + len < p) + return NULL; + return p; +} + +uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset) +{ + const uint32_t *tagp, *lenp; + uint32_t tag; + const char *p; + + if (offset % FDT_TAGSIZE) + return -1; + + tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE); + if (! tagp) + return FDT_END; /* premature end */ + tag = fdt32_to_cpu(*tagp); + offset += FDT_TAGSIZE; + + switch (tag) { + case FDT_BEGIN_NODE: + /* skip name */ + do { + p = fdt_offset_ptr(fdt, offset++, 1); + } while (p && (*p != '\0')); + if (! p) + return FDT_END; + break; + case FDT_PROP: + lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp)); + if (! lenp) + return FDT_END; + /* skip name offset, length and value */ + offset += 2*FDT_TAGSIZE + fdt32_to_cpu(*lenp); + break; + } + + if (nextoffset) + *nextoffset = FDT_TAGALIGN(offset); + + return tag; +} + +int _fdt_check_node_offset(const void *fdt, int offset) +{ + if ((offset < 0) || (offset % FDT_TAGSIZE) + || (fdt_next_tag(fdt, offset, &offset) != FDT_BEGIN_NODE)) + return -FDT_ERR_BADOFFSET; + + return offset; +} + +int fdt_next_node(const void *fdt, int offset, int *depth) +{ + int nextoffset = 0; + uint32_t tag; + + if (offset >= 0) + if ((nextoffset = _fdt_check_node_offset(fdt, offset)) < 0) + return nextoffset; + + do { + offset = nextoffset; + tag = fdt_next_tag(fdt, offset, &nextoffset); + + switch (tag) { + case FDT_PROP: + case FDT_NOP: + break; + + case FDT_BEGIN_NODE: + if (depth) + (*depth)++; + break; + + case FDT_END_NODE: + if (depth) + (*depth)--; + break; + + case FDT_END: + return -FDT_ERR_NOTFOUND; + + default: + return -FDT_ERR_BADSTRUCTURE; + } + } while (tag != FDT_BEGIN_NODE); + + return offset; +} + +const char *_fdt_find_string(const char *strtab, int tabsize, const char *s) +{ + int len = strlen(s) + 1; + const char *last = strtab + tabsize - len; + const char *p; + + for (p = strtab; p <= last; p++) + if (memcmp(p, s, len) == 0) + return p; + return NULL; +} + +int fdt_move(const void *fdt, void *buf, int bufsize) +{ + FDT_CHECK_HEADER(fdt); + + if (fdt_totalsize(fdt) > bufsize) + return -FDT_ERR_NOSPACE; + + memmove(buf, fdt, fdt_totalsize(fdt)); + return 0; +} Added: soc2015/mihai/boot-wrapper/libfdt/fdt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/libfdt/fdt.h Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1,60 @@ +#ifndef _FDT_H +#define _FDT_H + +#ifndef __ASSEMBLY__ + +struct fdt_header { + uint32_t magic; /* magic word FDT_MAGIC */ + uint32_t totalsize; /* total size of DT block */ + uint32_t off_dt_struct; /* offset to structure */ + uint32_t off_dt_strings; /* offset to strings */ + uint32_t off_mem_rsvmap; /* offset to memory reserve map */ + uint32_t version; /* format version */ + uint32_t last_comp_version; /* last compatible version */ + + /* version 2 fields below */ + uint32_t boot_cpuid_phys; /* Which physical CPU id we're + booting on */ + /* version 3 fields below */ + uint32_t size_dt_strings; /* size of the strings block */ + + /* version 17 fields below */ + uint32_t size_dt_struct; /* size of the structure block */ +}; + +struct fdt_reserve_entry { + uint64_t address; + uint64_t size; +}; + +struct fdt_node_header { + uint32_t tag; + char name[0]; +}; + +struct fdt_property { + uint32_t tag; + uint32_t len; + uint32_t nameoff; + char data[0]; +}; + +#endif /* !__ASSEMBLY */ + +#define FDT_MAGIC 0xd00dfeed /* 4: version, 4: total size */ +#define FDT_TAGSIZE sizeof(uint32_t) + +#define FDT_BEGIN_NODE 0x1 /* Start node: full name */ +#define FDT_END_NODE 0x2 /* End node */ +#define FDT_PROP 0x3 /* Property: name off, + size, content */ +#define FDT_NOP 0x4 /* nop */ +#define FDT_END 0x9 + +#define FDT_V1_SIZE (7*sizeof(uint32_t)) +#define FDT_V2_SIZE (FDT_V1_SIZE + sizeof(uint32_t)) +#define FDT_V3_SIZE (FDT_V2_SIZE + sizeof(uint32_t)) +#define FDT_V16_SIZE FDT_V3_SIZE +#define FDT_V17_SIZE (FDT_V16_SIZE + sizeof(uint32_t)) + +#endif /* _FDT_H */ Added: soc2015/mihai/boot-wrapper/libfdt/fdt_ro.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/boot-wrapper/libfdt/fdt_ro.c Mon Jun 15 19:51:31 2015 (r287130) @@ -0,0 +1,469 @@ +/* + * libfdt - Flat Device Tree manipulation + * Copyright (C) 2006 David Gibson, IBM Corporation. + * + * libfdt is dual licensed: you can use it either under the terms of + * the GPL, or the BSD license, at your option. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library 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. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * Alternatively, + * + * b) 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 COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "libfdt_env.h" + +#include +#include + +#include "libfdt_internal.h" + +static int _fdt_nodename_eq(const void *fdt, int offset, + const char *s, int len) +{ + const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1); + + if (! p) + /* short match */ + return 0; + + if (memcmp(p, s, len) != 0) + return 0; + + if (p[len] == '\0') + return 1; + else if (!memchr(s, '@', len) && (p[len] == '@')) + return 1; + else + return 0; +} + +const char *fdt_string(const void *fdt, int stroffset) +{ + return (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset; +} + +int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size) +{ + FDT_CHECK_HEADER(fdt); + *address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address); + *size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size); + return 0; +} + +int fdt_num_mem_rsv(const void *fdt) +{ + int i = 0; + + while (fdt64_to_cpu(_fdt_mem_rsv(fdt, i)->size) != 0) + i++; + return i; +} + +int fdt_subnode_offset_namelen(const void *fdt, int offset, + const char *name, int namelen) +{ + int depth; + + FDT_CHECK_HEADER(fdt); + + for (depth = 0, offset = fdt_next_node(fdt, offset, &depth); + (offset >= 0) && (depth > 0); + offset = fdt_next_node(fdt, offset, &depth)) { + if (depth < 0) + return -FDT_ERR_NOTFOUND; + else if ((depth == 1) + && _fdt_nodename_eq(fdt, offset, name, namelen)) + return offset; + } + + if (offset < 0) + return offset; /* error */ + else + return -FDT_ERR_NOTFOUND; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 19:56:35 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 878406E7 for ; Mon, 15 Jun 2015 19:56:35 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DE346D1 for ; Mon, 15 Jun 2015 19:56:35 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FJuZh5078276 for ; Mon, 15 Jun 2015 19:56:35 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FJuZ1j078275 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 19:56:35 GMT (envelope-from mihai@FreeBSD.org) Date: Mon, 15 Jun 2015 19:56:35 GMT Message-Id: <201506151956.t5FJuZ1j078275@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287131 - soc2015/mihai/boot-wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 19:56:35 -0000 Author: mihai Date: Mon Jun 15 19:56:34 2015 New Revision: 287131 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287131 Log: soc2015: mihai: boot-wrapper: add ignore file Modified: soc2015/mihai/boot-wrapper/ (props changed) From owner-svn-soc-all@FreeBSD.ORG Mon Jun 15 19:58:34 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 437F380D for ; Mon, 15 Jun 2015 19:58:34 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 186E06EF for ; Mon, 15 Jun 2015 19:58:34 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5FJwXvF079205 for ; Mon, 15 Jun 2015 19:58:33 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5FJwXMt079203 for svn-soc-all@FreeBSD.org; Mon, 15 Jun 2015 19:58:33 GMT (envelope-from mihai@FreeBSD.org) Date: Mon, 15 Jun 2015 19:58:33 GMT Message-Id: <201506151958.t5FJwXMt079203@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287132 - in soc2015/mihai/boot-wrapper: . libfdt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2015 19:58:34 -0000 Author: mihai Date: Mon Jun 15 19:58:33 2015 New Revision: 287132 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287132 Log: soc2015: mihai: boot-wrapper: add ignore directory Modified: soc2015/mihai/boot-wrapper/ (props changed) soc2015/mihai/boot-wrapper/libfdt/ (props changed) From owner-svn-soc-all@FreeBSD.ORG Tue Jun 16 00:33:23 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2E8B150 for ; Tue, 16 Jun 2015 00:33:23 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C46A9334 for ; Tue, 16 Jun 2015 00:33:23 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5G0XNBF032889 for ; Tue, 16 Jun 2015 00:33:23 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5G0XNOe032886 for svn-soc-all@FreeBSD.org; Tue, 16 Jun 2015 00:33:23 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Tue, 16 Jun 2015 00:33:23 GMT Message-Id: <201506160033.t5G0XNOe032886@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287148 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 00:33:24 -0000 Author: pratiksinghal Date: Tue Jun 16 00:33:22 2015 New Revision: 287148 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287148 Log: 1) Translation fault in the earlier commit removed. 2) DMA transfer working during kernel boot, but giving panic after the kernel boots. Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Mon Jun 15 23:30:54 2015 (r287147) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Tue Jun 16 00:33:22 2015 (r287148) @@ -294,10 +294,10 @@ a10_mmc_prepare_dma(struct a10_mmc_softc* sc) { - device_printf(sc->a10_dev, "Call to prepare dma\n") ; + //device_printf(sc->a10_dev, "Call to prepare dma\n") ; struct a10_mmc_dma_desc* dma = sc->a10_dma_desc ; struct mmc_command* cmd = sc->a10_req->cmd ; - device_printf(sc->a10_dev,"sc->a10_req = %p, sc->a10_req->cmd = %p, sc->a10_req->cmd->data = %p, dma = %p\n", sc->a10_req,sc->a10_req->cmd,sc->a10_req->cmd->data,dma) ; + //device_printf(sc->a10_dev,"sc->a10_req = %p, sc->a10_req->cmd = %p, sc->a10_req->cmd->data = %p, dma = %p\n", sc->a10_req,sc->a10_req->cmd,sc->a10_req->cmd->data,dma) ; int read = (sc->a10_req->cmd->data->flags & MMC_DATA_WRITE) ? 0 : 1 ; bus_addr_t desc_paddr = (sc->a10_dma_cb_arg).addr ; bus_size_t off = 0 ; @@ -354,7 +354,7 @@ bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_PREWRITE) ; /* Enable DMA and interrupts*/ - device_printf(sc->a10_dev, "Previous value of gctrl was 0x%08X and new value is 0x%08X\n", A10_MMC_READ_4(sc, A10_MMC_GCTRL), A10_MMC_READ_4(sc,A10_MMC_GCTRL) | A10_MMC_DMA_ENABLE | A10_MMC_INT_ENABLE) ; + //device_printf(sc->a10_dev, "Previous value of gctrl was 0x%08X and new value is 0x%08X\n", A10_MMC_READ_4(sc, A10_MMC_GCTRL), A10_MMC_READ_4(sc,A10_MMC_GCTRL) | A10_MMC_DMA_ENABLE | A10_MMC_INT_ENABLE) ; val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) ; val |= A10_MMC_DMA_ENABLE ; val |= A10_MMC_INT_ENABLE ; @@ -390,7 +390,7 @@ /* Disable debounce*/ //A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, A10_MMC_READ_4(sc, A10_MMC_GCTRL) & (~A10_MMC_DEBOUNCE_ENABLE)); - device_printf(sc->a10_dev, "Completed the prepare function\n") ; + //device_printf(sc->a10_dev, "Completed the prepare function\n") ; return (0) ; } @@ -451,7 +451,6 @@ return (ETIMEDOUT); } - device_printf(sc->a10_dev, "The resetted value is %#x\n", A10_MMC_READ_4(sc, A10_MMC_GCTRL)) ; /* Set the timeout. */ A10_MMC_WRITE_4(sc, A10_MMC_TIMEOUT, 0xffffffff); @@ -466,10 +465,8 @@ A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ); uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; - device_printf(sc->a10_dev, "The value I am writing is %#x\n",temp_val) ; /* Enable interrupts and AHB access. */ A10_MMC_WRITE_4(sc, A10_MMC_GCTRL,temp_val) ; - device_printf(sc->a10_dev,"Reset succesfully in reset function %#x\n", A10_MMC_READ_4(sc, A10_MMC_GCTRL)) ; return (0); } @@ -555,7 +552,6 @@ int i, write; uint32_t bit, *buf; - device_printf(sc->a10_dev, "Doing pio transfer\n") ; buf = (uint32_t *)data->data; write = (data->flags & MMC_DATA_WRITE) ? 1 : 0; bit = write ? A10_MMC_FIFO_FULL : A10_MMC_FIFO_EMPTY; @@ -593,9 +589,7 @@ A10_MMC_WRITE_4(sc, A10_MMC_RINTR, rint) ; A10_MMC_WRITE_4(sc, A10_MMC_IDST, idst) ; A10_MMC_WRITE_4(sc, A10_MMC_IMASK, imask) ; -#ifdef DEBUG - device_printf(sc->a10_dev, "imask: %#x, rint: %#x, idst: %#x, gctrl: %#x\n", imask, rint,idst, A10_MMC_READ_4(sc, A10_MMC_GCTRL)); -#endif + //device_printf(sc->a10_dev, "imask: %#x, rint: %#x, idst: %#x, gctrl: %#x\n", imask, rint,idst, A10_MMC_READ_4(sc, A10_MMC_GCTRL)); if (sc->a10_req == NULL) { device_printf(sc->a10_dev, "Spurious interrupt - no active request, rint: 0x%08X\n", @@ -650,7 +644,7 @@ sc->a10_intr |= rint; data = sc->a10_req->cmd->data; - device_printf(sc->a10_dev, "Data is %p\n", data) ; + //device_printf(sc->a10_dev, "Data is %p\n", data) ; if (data != NULL && (rint & (A10_MMC_DATA_OVER | A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ)) != 0) a10_mmc_pio_transfer(sc, data); @@ -720,6 +714,7 @@ uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; + device_printf(sc->a10_dev, "Before page faullt (1)\n") ; device_printf(sc->a10_dev, "Couldn't prepare DMA, using pio instead\n") ; } } @@ -727,6 +722,7 @@ { uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; + device_printf(sc->a10_dev, "Before page fault (2)\n") ; A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; device_printf(sc->a10_dev, "Couldn't transfer this data with DMA, using pio instead\n") ; } From owner-svn-soc-all@FreeBSD.ORG Tue Jun 16 19:06:07 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86EED35A for ; Tue, 16 Jun 2015 19:06:07 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 740B592B for ; Tue, 16 Jun 2015 19:06:07 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GJ67kQ013589 for ; Tue, 16 Jun 2015 19:06:07 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5GJ66xT013585 for svn-soc-all@FreeBSD.org; Tue, 16 Jun 2015 19:06:06 GMT (envelope-from mihai@FreeBSD.org) Date: Tue, 16 Jun 2015 19:06:06 GMT Message-Id: <201506161906.t5GJ66xT013585@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287171 - in soc2015/mihai/bhyve-on-arm-head/sys: arm/conf arm/fvp_ve-cortex_a15x1 boot/fdt/dts/arm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 19:06:07 -0000 Author: mihai Date: Tue Jun 16 19:06:05 2015 New Revision: 287171 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287171 Log: soc2015: mihai: bhyve-on-arm-head: simplified fvp_ve-cortex_a15x1.dts with only the gic, timer and uart Deleted: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-motherboard.dtsi Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Tue Jun 16 18:43:08 2015 (r287170) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Tue Jun 16 19:06:05 2015 (r287171) @@ -45,6 +45,10 @@ #options DIAGNOSTIC #options ROOTDEVNAME=\"ufs:/dev/da0\" +options MD_ROOT +options MD_ROOT_SIZE=10240 +makeoptions MFS_IMAGE=/root/soc2015/mihai/ramdisk.img +options ROOTDEVNAME=\"ffs:/dev/md0\" # Pseudo devices @@ -63,6 +67,11 @@ device iic device iicbus + +# GIC +device gic + + # GPIO device gpio Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 Tue Jun 16 18:43:08 2015 (r287170) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 Tue Jun 16 19:06:05 2015 (r287171) @@ -3,7 +3,6 @@ arm/arm/bus_space_base.c standard arm/arm/bus_space_generic.c standard arm/arm/bus_space_asm_generic.S standard -arm/arm/gic.c standard arm/fvp_ve-cortex_a15x1/sp804.c standard arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_common.c standard Modified: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts Tue Jun 16 18:43:08 2015 (r287170) +++ soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts Tue Jun 16 19:06:05 2015 (r287171) @@ -11,10 +11,9 @@ / { model = "FVP_VE_Cortex_A15x1"; - compatible = "arm,fvp_ve,cortex_a15x1", "arm,vexpress"; - interrupt-parent = <&gic>; - #address-cells = <2>; - #size-cells = <2>; + compatible = "arm,fvp_ve,cortex_a15x1"; + #address-cells = <1>; + #size-cells = <1>; chosen { }; @@ -38,90 +37,58 @@ memory@80000000 { device_type = "memory"; - reg = <0 0x80000000 0 0x40000000>; + reg = <0x80000000 0x40000000>; }; gic: interrupt-controller@2c001000 { - compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic"; - #interrupt-cells = <3>; - #address-cells = <0>; + compatible = "arm,cortex-a15-gic"; interrupt-controller; - reg = <0 0x2c001000 0 0x1000>, - <0 0x2c002000 0 0x2000>, - <0 0x2c004000 0 0x2000>, - <0 0x2c006000 0 0x2000>; - interrupts = <1 9 0xf04>; - }; - - timer { - compatible = "arm,armv7-timer"; - #interrupt-cells = <3>; - #address-cells = <0>; - interrupts = <1 13 0xf08>, - <1 14 0xf08>, - <1 11 0xf08>, - <1 10 0xf08>; - }; - - smb { - compatible = "simple-bus"; - - #address-cells = <1>; - #size-cells = <1>; - ranges = /*<0 0 0x08000000 0x04000000>, - <1 0 0x14000000 0x04000000>, - <2 0 0x18000000 0x04000000>,*/ - <0 0 0x1c000000 0x04000000>; -/* <4 0 0x0c000000 0x04000000>, - <5 0 0x10000000 0x04000000>;*/ - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 63>; - interrupt-map = <0 0 0 &gic 0 0 4>, - <0 0 1 &gic 0 1 4>, - <0 0 2 &gic 0 2 4>, - <0 0 3 &gic 0 3 4>, - <0 0 4 &gic 0 4 4>, - <0 0 5 &gic 0 5 4>, - <0 0 6 &gic 0 6 4>, - <0 0 7 &gic 0 7 4>, - <0 0 8 &gic 0 8 4>, - <0 0 9 &gic 0 9 4>, - <0 0 10 &gic 0 10 4>, - <0 0 11 &gic 0 11 4>, - <0 0 12 &gic 0 12 4>, - <0 0 13 &gic 0 13 4>, - <0 0 14 &gic 0 14 4>, - <0 0 15 &gic 0 15 4>, - <0 0 16 &gic 0 16 4>, - <0 0 17 &gic 0 17 4>, - <0 0 18 &gic 0 18 4>, - <0 0 19 &gic 0 19 4>, - <0 0 20 &gic 0 20 4>, - <0 0 21 &gic 0 21 4>, - <0 0 22 &gic 0 22 4>, - <0 0 23 &gic 0 23 4>, - <0 0 24 &gic 0 24 4>, - <0 0 25 &gic 0 25 4>, - <0 0 26 &gic 0 26 4>, - <0 0 27 &gic 0 27 4>, - <0 0 28 &gic 0 28 4>, - <0 0 29 &gic 0 29 4>, - <0 0 30 &gic 0 30 4>, - <0 0 31 &gic 0 31 4>, - <0 0 32 &gic 0 32 4>, - <0 0 33 &gic 0 33 4>, - <0 0 34 &gic 0 34 4>, - <0 0 35 &gic 0 35 4>, - <0 0 36 &gic 0 36 4>, - <0 0 37 &gic 0 37 4>, - <0 0 38 &gic 0 38 4>, - <0 0 39 &gic 0 39 4>, - <0 0 40 &gic 0 40 4>, - <0 0 41 &gic 0 41 4>, - <0 0 42 &gic 0 42 4>; - - /include/ "fvp_ve-motherboard.dtsi" + reg = <0x2c001000 0x1000>, + <0x2c002000 0x2000>, + <0x2c004000 0x2000>, + <0x2c006000 0x2000>; + }; + + v2m_serial0: uart@1c090000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x1c090000 0x1000>; + interrupt-parent=<&gic>; + interrupts = <37>; + }; + + v2m_serial1: uart@1c0a0000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x1c0a0000 0x1000>; + interrupt-parent=<&gic>; + interrupts = <38>; + }; + + v2m_serial2: uart@1c0b0000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x1c0b0000 0x1000>; + interrupt-parent=<&gic>; + interrupts = <39>; + }; + + v2m_serial3: uart@1c0c0000 { + compatible = "arm,pl011", "arm,primecell"; + reg = <0x1c0c0000 0x1000>; + interrupt-parent=<&gic>; + interrupts = <40>; + }; + v2m_timer01: timer@1c110000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x1c110000 0x1000>; + interrupt-parent=<&gic>; + interrupts = <34>; + }; + + v2m_timer23: timer@1c120000 { + compatible = "arm,sp804", "arm,primecell"; + reg = <0x1c120000 0x1000>; + interrupt-parent=<&gic>; + interrupts = <35>; }; }; From owner-svn-soc-all@FreeBSD.ORG Tue Jun 16 19:34:12 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87839AE7 for ; Tue, 16 Jun 2015 19:34:12 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74ABDFCB for ; Tue, 16 Jun 2015 19:34:12 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GJYCh8045925 for ; Tue, 16 Jun 2015 19:34:12 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5GJYB91045919 for svn-soc-all@FreeBSD.org; Tue, 16 Jun 2015 19:34:11 GMT (envelope-from mihai@FreeBSD.org) Date: Tue, 16 Jun 2015 19:34:11 GMT Message-Id: <201506161934.t5GJYB91045919@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287172 - in soc2015/mihai/bhyve-on-arm-head/sys: arm/fvp_ve-cortex_a15x1 boot/fdt/dts/arm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 19:34:12 -0000 Author: mihai Date: Tue Jun 16 19:34:10 2015 New Revision: 287172 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287172 Log: soc2015: mihai: bhyve-on-arm-head: add generic timer instead of SP804 Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 Tue Jun 16 19:06:05 2015 (r287171) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/fvp_ve-cortex_a15x1/files.fvp_ve-cortex_a15x1 Tue Jun 16 19:34:10 2015 (r287172) @@ -4,7 +4,8 @@ arm/arm/bus_space_generic.c standard arm/arm/bus_space_asm_generic.S standard -arm/fvp_ve-cortex_a15x1/sp804.c standard +arm/arm/generic_timer.c standard +#arm/fvp_ve-cortex_a15x1/sp804.c standard arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_common.c standard arm/fvp_ve-cortex_a15x1/fvp_ve-cortex_a15x1_machdep.c standard Modified: soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts Tue Jun 16 19:06:05 2015 (r287171) +++ soc2015/mihai/bhyve-on-arm-head/sys/boot/fdt/dts/arm/fvp_ve-cortex_a15x1.dts Tue Jun 16 19:34:10 2015 (r287172) @@ -49,6 +49,12 @@ <0x2c004000 0x2000>, <0x2c006000 0x2000>; }; + generic_timer { + compatible = "arm,armv7-timer"; + clock-frequency = <24000000>; + interrupts = < 29 30 27 26 >; + interrupt-parent = <&gic>; + }; v2m_serial0: uart@1c090000 { compatible = "arm,pl011", "arm,primecell"; From owner-svn-soc-all@FreeBSD.ORG Tue Jun 16 20:11:21 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB6DBECD for ; Tue, 16 Jun 2015 20:11:21 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF72BB75 for ; Tue, 16 Jun 2015 20:11:21 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GKBLKh017907 for ; Tue, 16 Jun 2015 20:11:21 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5GKBKCl017858 for svn-soc-all@FreeBSD.org; Tue, 16 Jun 2015 20:11:20 GMT (envelope-from mihai@FreeBSD.org) Date: Tue, 16 Jun 2015 20:11:20 GMT Message-Id: <201506162011.t5GKBKCl017858@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287176 - in soc2015/mihai/bhyve-on-arm-head/sys/arm: arm conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 20:11:21 -0000 Author: mihai Date: Tue Jun 16 20:11:20 2015 New Revision: 287176 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287176 Log: soc2015: mihai: modify FreeBSD to enter SVC mode when starting Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/locore-v6.S soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/locore-v6.S ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/locore-v6.S Tue Jun 16 19:49:12 2015 (r287175) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/locore-v6.S Tue Jun 16 20:11:20 2015 (r287176) @@ -68,8 +68,8 @@ ASENTRY_NP(_start) STOP_UNWINDING /* Can't unwind into the bootloader! */ - /* Make sure interrupts are disabled. */ - cpsid ifa + /* Setup status register for supervisor mode, interrupts disabled */ + msr cpsr_fc, #0xd3 mov r8, r0 /* 0 or boot mode from boot2 */ mov r9, r1 /* Save Machine type */ @@ -398,8 +398,8 @@ #if defined(SMP) ASENTRY_NP(mpentry) - /* Make sure interrupts are disabled. */ - cpsid ifa + /* Setup status register for supervisor mode, interrupts disabled */ + msr cpsr_fc, #0xd3 /* Setup core, disable all caches. */ mrc CP15_SCTLR(r0) Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Tue Jun 16 19:49:12 2015 (r287175) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Tue Jun 16 20:11:20 2015 (r287176) @@ -32,7 +32,7 @@ options BREAK_TO_DEBUGGER options DEBUG options EARLY_PRINTF -options VERBOSE_SYSINIT # Enable verbose sysinit messages +#options VERBOSE_SYSINIT # Enable verbose sysinit messages options KDB # Enable kernel debugger support # For minimum debugger support (stable branch) use: options KDB_TRACE # Print a stack trace for a panic From owner-svn-soc-all@FreeBSD.ORG Tue Jun 16 20:11:49 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F1ADEE2 for ; Tue, 16 Jun 2015 20:11:49 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D6DDBB6 for ; Tue, 16 Jun 2015 20:11:49 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GKBnar019242 for ; Tue, 16 Jun 2015 20:11:49 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5GKBnc3019239 for svn-soc-all@FreeBSD.org; Tue, 16 Jun 2015 20:11:49 GMT (envelope-from mihai@FreeBSD.org) Date: Tue, 16 Jun 2015 20:11:49 GMT Message-Id: <201506162011.t5GKBnc3019239@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287177 - soc2015/mihai/boot-wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 20:11:49 -0000 Author: mihai Date: Tue Jun 16 20:11:48 2015 New Revision: 287177 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287177 Log: soc2015:mihai: boot-wrapper: enter HypMode before entering the SO Modified: soc2015/mihai/boot-wrapper/boot.S Modified: soc2015/mihai/boot-wrapper/boot.S ============================================================================== --- soc2015/mihai/boot-wrapper/boot.S Tue Jun 16 20:11:20 2015 (r287176) +++ soc2015/mihai/boot-wrapper/boot.S Tue Jun 16 20:11:48 2015 (r287177) @@ -25,7 +25,7 @@ @ then return to us in NS-SVC smc #0 @ Now we're in NS-SVC, make a Hyp call to get into Hyp mode -// hvc #0 + hvc #0 @ We will end up here in NS-Hyp. .endm From owner-svn-soc-all@FreeBSD.ORG Tue Jun 16 20:14:40 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C8CB17B for ; Tue, 16 Jun 2015 20:14:40 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AFD4C0F for ; Tue, 16 Jun 2015 20:14:40 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GKEeEd020855 for ; Tue, 16 Jun 2015 20:14:40 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5GKEdWN020851 for svn-soc-all@FreeBSD.org; Tue, 16 Jun 2015 20:14:39 GMT (envelope-from mihai@FreeBSD.org) Date: Tue, 16 Jun 2015 20:14:39 GMT Message-Id: <201506162014.t5GKEdWN020851@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287178 - soc2015/mihai MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 20:14:40 -0000 Author: mihai Date: Tue Jun 16 20:14:39 2015 New Revision: 287178 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287178 Log: soc2015: mihai: minimal mtree file for booting FreeBSD on ARM Added: soc2015/mihai/ramdisk.mtree Added: soc2015/mihai/ramdisk.mtree ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/ramdisk.mtree Tue Jun 16 20:14:39 2015 (r287178) @@ -0,0 +1,16 @@ +#mtree v2.0 + +# Setting the default type to "dir" allows pathnames to be implicitly created +# for components leading up to the file. +/set type=dir mode=0755 uid=0 gid=0 flags=none + +./dev type=dir mode=0555 flags=uarch +./sbin/init type=file mode=0555 contents="${ODIR}/sbin/init" +./bin/sh type=file mode=0555 contents="${ODIR}/rescue/rescue" + +# hard-links to the statically-linked rescue binary (aka /bin/sh) +./bin/sysctl type=link mode=0555 link=/bin/sh +./bin/reboot type=link mode=0555 link=/bin/sh +./bin/ls type=link mode=0555 link=/bin/sh + +# ... etc. Put in as many as you want from /rescue/* From owner-svn-soc-all@FreeBSD.ORG Tue Jun 16 20:17:23 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B85361C7 for ; Tue, 16 Jun 2015 20:17:23 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6829C36 for ; Tue, 16 Jun 2015 20:17:23 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GKHN87022582 for ; Tue, 16 Jun 2015 20:17:23 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5GKHM51022577 for svn-soc-all@FreeBSD.org; Tue, 16 Jun 2015 20:17:22 GMT (envelope-from mihai@FreeBSD.org) Date: Tue, 16 Jun 2015 20:17:22 GMT Message-Id: <201506162017.t5GKHM51022577@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287179 - in soc2015/mihai: . ramdisk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 20:17:23 -0000 Author: mihai Date: Tue Jun 16 20:17:22 2015 New Revision: 287179 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287179 Log: soc2015: mihai: add makefs scripts for creating an mtree ramdisk Added: soc2015/mihai/ramdisk/ soc2015/mihai/ramdisk/build_ramdisk.sh soc2015/mihai/ramdisk/ramdisk.mtree Deleted: soc2015/mihai/ramdisk.mtree Added: soc2015/mihai/ramdisk/build_ramdisk.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/ramdisk/build_ramdisk.sh Tue Jun 16 20:17:22 2015 (r287179) @@ -0,0 +1,7 @@ + +export ODIR=/root/rootfs +makefs -t ffs -B little\ + -o optimization=space\ + -o version=1\ + ramdisk.img ramdisk.mtree + Added: soc2015/mihai/ramdisk/ramdisk.mtree ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/ramdisk/ramdisk.mtree Tue Jun 16 20:17:22 2015 (r287179) @@ -0,0 +1,16 @@ +#mtree v2.0 + +# Setting the default type to "dir" allows pathnames to be implicitly created +# for components leading up to the file. +/set type=dir mode=0755 uid=0 gid=0 flags=none + +./dev type=dir mode=0555 flags=uarch +./sbin/init type=file mode=0555 contents="${ODIR}/sbin/init" +./bin/sh type=file mode=0555 contents="${ODIR}/rescue/rescue" + +# hard-links to the statically-linked rescue binary (aka /bin/sh) +./bin/sysctl type=link mode=0555 link=/bin/sh +./bin/reboot type=link mode=0555 link=/bin/sh +./bin/ls type=link mode=0555 link=/bin/sh + +# ... etc. Put in as many as you want from /rescue/* From owner-svn-soc-all@FreeBSD.ORG Tue Jun 16 20:19:06 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF40635F for ; Tue, 16 Jun 2015 20:19:06 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD95CC60 for ; Tue, 16 Jun 2015 20:19:06 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5GKJ6Zo023323 for ; Tue, 16 Jun 2015 20:19:06 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5GKJ6gF023297 for svn-soc-all@FreeBSD.org; Tue, 16 Jun 2015 20:19:06 GMT (envelope-from mihai@FreeBSD.org) Date: Tue, 16 Jun 2015 20:19:06 GMT Message-Id: <201506162019.t5GKJ6gF023297@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287180 - soc2015/mihai/bhyve-on-arm-head/sys/arm/conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 20:19:07 -0000 Author: mihai Date: Tue Jun 16 20:19:05 2015 New Revision: 287180 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287180 Log: soc2015: mihai: bhyve-on-arm-head: modify the location of the RAMDISK Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Tue Jun 16 20:17:22 2015 (r287179) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Tue Jun 16 20:19:05 2015 (r287180) @@ -47,7 +47,7 @@ #options ROOTDEVNAME=\"ufs:/dev/da0\" options MD_ROOT options MD_ROOT_SIZE=10240 -makeoptions MFS_IMAGE=/root/soc2015/mihai/ramdisk.img +makeoptions MFS_IMAGE=/root/soc2015/mihai/ramdisk/ramdisk.img options ROOTDEVNAME=\"ffs:/dev/md0\" # Pseudo devices From owner-svn-soc-all@FreeBSD.ORG Wed Jun 17 03:04:40 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45B319B4 for ; Wed, 17 Jun 2015 03:04:40 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33761C71 for ; Wed, 17 Jun 2015 03:04:40 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5H34edr066916 for ; Wed, 17 Jun 2015 03:04:40 GMT (envelope-from btw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5H34dLi066914 for svn-soc-all@FreeBSD.org; Wed, 17 Jun 2015 03:04:39 GMT (envelope-from btw@FreeBSD.org) Date: Wed, 17 Jun 2015 03:04:39 GMT Message-Id: <201506170304.t5H34dLi066914@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to btw@FreeBSD.org using -f From: btw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287209 - soc2015/btw/head/tools/tools/mq-testing/udp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2015 03:04:40 -0000 Author: btw Date: Wed Jun 17 03:04:38 2015 New Revision: 287209 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287209 Log: - Add the support for -h option; - Document the -46h options in usage; - Refine the format of the usage message; Modified: soc2015/btw/head/tools/tools/mq-testing/udp/server.c Modified: soc2015/btw/head/tools/tools/mq-testing/udp/server.c ============================================================================== --- soc2015/btw/head/tools/tools/mq-testing/udp/server.c Wed Jun 17 02:47:30 2015 (r287208) +++ soc2015/btw/head/tools/tools/mq-testing/udp/server.c Wed Jun 17 03:04:38 2015 (r287209) @@ -45,7 +45,7 @@ static void usage(const char *prgname) { - fprintf(stderr, "%s [-v]\n", prgname); + fprintf(stderr, "Usage: %s [-46hv]\n", prgname); exit(EXIT_FAILURE); } @@ -84,7 +84,7 @@ char msg[BUFSIZ]; int n, ch, i; - while ((ch = getopt(argc, argv, "46v")) != -1) { + while ((ch = getopt(argc, argv, "46hv")) != -1) { switch (ch) { case '4': ipversion = 4; @@ -95,6 +95,7 @@ case 'v': verbose = 1; break; + case 'h': default: usage(argv[0]); break; From owner-svn-soc-all@FreeBSD.ORG Wed Jun 17 06:39:43 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABEF3EB6 for ; Wed, 17 Jun 2015 06:39:43 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A0A461A for ; Wed, 17 Jun 2015 06:39:43 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5H6dhls081914 for ; Wed, 17 Jun 2015 06:39:43 GMT (envelope-from btw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5H6dhCf081911 for svn-soc-all@FreeBSD.org; Wed, 17 Jun 2015 06:39:43 GMT (envelope-from btw@FreeBSD.org) Date: Wed, 17 Jun 2015 06:39:43 GMT Message-Id: <201506170639.t5H6dhCf081911@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to btw@FreeBSD.org using -f From: btw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287218 - soc2015/btw/head/tools/tools/mq-testing/udp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2015 06:39:43 -0000 Author: btw Date: Wed Jun 17 06:39:42 2015 New Revision: 287218 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287218 Log: - Add the support for -h option; - Document the -b46h options in usage; - Refine the format of the usage message; Modified: soc2015/btw/head/tools/tools/mq-testing/udp/pktgen.c Modified: soc2015/btw/head/tools/tools/mq-testing/udp/pktgen.c ============================================================================== --- soc2015/btw/head/tools/tools/mq-testing/udp/pktgen.c Wed Jun 17 04:46:58 2015 (r287217) +++ soc2015/btw/head/tools/tools/mq-testing/udp/pktgen.c Wed Jun 17 06:39:42 2015 (r287218) @@ -238,8 +238,10 @@ static void usage(const char *prgname) { - fprintf(stderr, "%s [-a ip address] [-i vme interface] [-l pktsize] " - "[-p payload] [-q]\n", prgname); + fprintf(stderr, + "Usage: %s [-a ip address] [-i vme interface] [-l pktsize]\n" + " %*s [-p payload] [-b cpu] [-46hq]\n", + prgname, (int)strlen(prgname), ""); exit(EXIT_FAILURE); } @@ -252,7 +254,7 @@ uint8_t *buf; int ch; - while ((ch = getopt(argc, argv, "a:b:i:l:p:q46")) != -1) { + while ((ch = getopt(argc, argv, "a:b:i:l:p:hq46")) != -1) { switch (ch) { case 'a': strlcpy(vmeif_ipstr, optarg, sizeof(vmeif_ipstr)); @@ -278,6 +280,7 @@ case '6': ipversion = 6; break; + case 'h': default: usage(argv[0]); break; From owner-svn-soc-all@FreeBSD.ORG Wed Jun 17 12:49:20 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F255494 for ; Wed, 17 Jun 2015 12:49:20 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 419F7370 for ; Wed, 17 Jun 2015 12:49:20 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5HCnKTi047975 for ; Wed, 17 Jun 2015 12:49:20 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5HCnJkg047957 for svn-soc-all@FreeBSD.org; Wed, 17 Jun 2015 12:49:19 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Wed, 17 Jun 2015 12:49:19 GMT Message-Id: <201506171249.t5HCnJkg047957@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287236 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2015 12:49:20 -0000 Author: pratiksinghal Date: Wed Jun 17 12:49:18 2015 New Revision: 287236 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287236 Log: Corrected the buffer size for DMA transfer Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.h Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Wed Jun 17 11:48:00 2015 (r287235) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Wed Jun 17 12:49:18 2015 (r287236) @@ -58,10 +58,11 @@ #define A10_MMC_RESSZ 2 #define A10_MMC_NDESC 16 #define A10_DMA_NSEGS 16 -#define A10_DMA_BUFF_SIZE 512 +#define A10_DMA_BUFF_SIZE 0x2000 +#define A10_DMA_MAX_SIZE 0x20000 #define A10_MMC_DMA_FTRGLEVEL_A20 0x20070008 #define A10_MMC_DMA_FTRGLEVEL_A10 0x00070208 -#define A10_MMC_DMA_MAXLEN 0x10000 +#define A10_MMC_DMA_MAXLEN (A10_DMA_MAX_SIZE) struct a10_mmc_softc { bus_space_handle_t a10_bsh; @@ -228,6 +229,7 @@ sc->a10_use_dma = 0 ; } } + sc->a10_dma_buff_addr = 0; #ifdef DEBUG device_printf(sc->a10_dev, "DMA status %d\n", sc->a10_use_dma) ; #endif @@ -275,7 +277,7 @@ /* Now allocate tag and map for the buffer to be used with transfer. */ error = bus_dma_tag_create(bus_get_dma_tag(dev),1, 0,BUS_SPACE_MAXADDR_32BIT,BUS_SPACE_MAXADDR, - NULL,NULL,A10_DMA_BUFF_SIZE, + NULL,NULL,A10_DMA_MAX_SIZE, A10_DMA_NSEGS,A10_DMA_BUFF_SIZE,0, NULL,NULL,&sc->a10_dma_buff_tag) ; if(error) @@ -307,8 +309,11 @@ rem = min(len,cmd->data->len) ; uint32_t error = bus_dmamap_load(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, cmd->data->data,rem,a10_dma_buff_cb, - &sc->a10_dma_buff_addr,BUS_DMA_NOWAIT) ; - if (error != 0) { + &sc->a10_dma_buff_addr,0) ; + if(error == EINPROGRESS) { + for( ; sc->a10_dma_buff_addr == 0 ; ) { } + } + else if (error != 0) { device_printf(sc->a10_dev, "DMA transaction failed due to insufficient resources\n") ; return EIO ; } @@ -421,10 +426,8 @@ break; DELAY(100); } - if (timeout == 0) { - device_printf(sc->a10_dev, "Getting timedout in reset\n") ; + if (timeout == 0) return (ETIMEDOUT); - } /* Set the timeout. */ A10_MMC_WRITE_4(sc, A10_MMC_TIMEOUT, 0xffffffff); @@ -468,6 +471,7 @@ sc->a10_resid = 0; sc->a10_idst = 0 ; sc->a10_intr_wait = 0; + sc->a10_dma_buff_addr = 0 ; req->done(req); } @@ -576,7 +580,6 @@ if (rint & A10_MMC_INT_ERR_BIT) { device_printf(sc->a10_dev, "error rint: 0x%08X\n", rint); if (rint & A10_MMC_RESP_TIMEOUT) { - device_printf(sc->a10_dev,"Setting timeout in intr\n") ; sc->a10_req->cmd->error = MMC_ERR_TIMEOUT; } else @@ -595,7 +598,7 @@ } if(idst & A10_MMC_IDMAC_COMPLETE) { - device_printf(sc->a10_dev, "DMA transfer complete!\n") ; + //device_printf(sc->a10_dev, "DMA transfer complete!\n") ; if(sc->a10_dma_ops == 0) bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_POSTREAD) ; else if(sc->a10_dma_ops == 1) @@ -619,7 +622,6 @@ sc->a10_intr |= rint; data = sc->a10_req->cmd->data; - //device_printf(sc->a10_dev, "Data is %p\n", data) ; if (data != NULL && (rint & (A10_MMC_DATA_OVER | A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ)) != 0) a10_mmc_pio_transfer(sc, data); Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.h ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.h Wed Jun 17 11:48:00 2015 (r287235) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.h Wed Jun 17 12:49:18 2015 (r287236) @@ -66,7 +66,7 @@ #define A10_MMC_DMA_ENABLE (1U << 5) #define A10_MMC_DEBOUNCE_ENABLE (1U << 8) #define A10_MMC_DDR_MODE (1U << 10) -#define A10_MMC_ACCESS_BY_DMA (0U << 31) /*Change from previous value of 1U << 30, source : linux-sunxi*/ +#define A10_MMC_ACCESS_BY_DMA (0U << 31) #define A10_MMC_ACCESS_BY_AHB (1U << 31) #define A10_MMC_RESET \ (A10_MMC_SOFT_RESET | A10_MMC_FIFO_RESET | A10_MMC_DMA_RESET) @@ -177,29 +177,29 @@ #define A10_MMC_IDMAC_DESC_CLOSE (8U << 13) #define A10_MMC_IDMAC_ERROR \ (A10_MMC_IDMAC_FATAL_BUS_ERR | A10_MMC_IDMAC_CARD_ERR_SUM | A10_MMC_IDMAC_DES_INVALID | \ - A10_MMC_IDMAC_ABNORMAL_INT_SUM) + A10_MMC_IDMAC_ABNORMAL_INT_SUM) #define A10_MMC_IDMAC_COMPLETE \ - (A10_MMC_IDMAC_TRANSMIT_INT | A10_MMC_IDMAC_RECEIVE_INT) + (A10_MMC_IDMAC_TRANSMIT_INT | A10_MMC_IDMAC_RECEIVE_INT) -/* Used to make the descriptor table for suppoting DMA Access */ -struct a10_mmc_dma_desc { - uint32_t config ; -#define A10_MMC_DMA_CONFIG_DIC (1U << 1) -#define A10_MMC_DMA_CONFIG_LD (1U << 2) -#define A10_MMC_DMA_CONFIG_FD (1U << 3) +/* Used to make the descriptor table for suppoting DMA Access */ +struct a10_mmc_dma_desc { + uint32_t config ; +#define A10_MMC_DMA_CONFIG_DIC (1U << 1) +#define A10_MMC_DMA_CONFIG_LD (1U << 2) +#define A10_MMC_DMA_CONFIG_FD (1U << 3) #define A10_MMC_DMA_CONFIG_CH (1U << 4) -#define A10_MMC_DMA_CONFIG_ER (1U << 5) -#define A10_MMC_DMA_CONFIG_CES (1U << 30) -#define A10_MMC_DMA_CONFIG_OWN (1U << 31) - uint32_t buff_size ; - uint32_t buff_addr ; - uint32_t next; -} ; +#define A10_MMC_DMA_CONFIG_ER (1U << 5) +#define A10_MMC_DMA_CONFIG_CES (1U << 30) +#define A10_MMC_DMA_CONFIG_OWN (1U << 31) + uint32_t buff_size ; + uint32_t buff_addr ; + uint32_t next; +} ; struct a10_mmc_cb { - bus_addr_t addr ; - bus_dma_segment_t* segs ; -} ; + bus_addr_t addr ; + bus_dma_segment_t* segs ; +} ; #endif /* _A10_MMC_H_ */ From owner-svn-soc-all@FreeBSD.ORG Wed Jun 17 12:51:38 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09ADF671 for ; Wed, 17 Jun 2015 12:51:38 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBCAC95E for ; Wed, 17 Jun 2015 12:51:37 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5H9tdWA034822 for ; Wed, 17 Jun 2015 09:55:39 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5H9tcm8034818 for svn-soc-all@FreeBSD.org; Wed, 17 Jun 2015 09:55:38 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Wed, 17 Jun 2015 09:55:38 GMT Message-Id: <201506170955.t5H9tcm8034818@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287228 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2015 12:51:38 -0000 Author: pratiksinghal Date: Wed Jun 17 09:55:38 2015 New Revision: 287228 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287228 Log: Removed the geom panic message by correcting the buffer address, DMA working completely now Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Wed Jun 17 07:43:20 2015 (r287227) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Wed Jun 17 09:55:38 2015 (r287228) @@ -304,11 +304,10 @@ int desc, rem ; uint32_t val; desc = 0 ; - bus_addr_t paddr = sc->a10_dma_buff_addr ; //bus_size_t len = (sc->a10_dma_cb_arg).segs[0].ds_len ; bus_size_t len = A10_MMC_DMA_MAXLEN ; rem = min(len,cmd->data->len) ; - + device_printf(sc->a10_dev, "%d bytes to be transferred\n", rem) ; uint32_t error = bus_dmamap_load(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, cmd->data->data,rem,a10_dma_buff_cb, &sc->a10_dma_buff_addr,BUS_DMA_NOWAIT) ; @@ -317,6 +316,7 @@ return EIO ; } + bus_addr_t paddr = sc->a10_dma_buff_addr ; /* Program all the descriptors in this segment. */ while(rem > 0) { @@ -399,7 +399,7 @@ static int a10_mmc_can_do_dma(struct mmc_request* req) { - if(req->cmd->data->len > A10_MMC_DMA_MAXLEN) + if(req->cmd->data->len >= A10_MMC_DMA_MAXLEN) return (0) ; else return (1) ; From owner-svn-soc-all@FreeBSD.ORG Wed Jun 17 12:51:37 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 338C066C for ; Wed, 17 Jun 2015 12:51:37 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DA71952 for ; Wed, 17 Jun 2015 12:51:37 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5HAgqW6017552 for ; Wed, 17 Jun 2015 10:42:52 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5HAgpNU017549 for svn-soc-all@FreeBSD.org; Wed, 17 Jun 2015 10:42:51 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Wed, 17 Jun 2015 10:42:51 GMT Message-Id: <201506171042.t5HAgpNU017549@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287232 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2015 12:51:37 -0000 Author: pratiksinghal Date: Wed Jun 17 10:42:51 2015 New Revision: 287232 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287232 Log: Removed unnecessary comments, printfs and fixed some style issues Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Wed Jun 17 09:44:02 2015 (r287231) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Wed Jun 17 10:42:51 2015 (r287232) @@ -61,7 +61,7 @@ #define A10_DMA_BUFF_SIZE 512 #define A10_MMC_DMA_FTRGLEVEL_A20 0x20070008 #define A10_MMC_DMA_FTRGLEVEL_A10 0x00070208 -#define A10_MMC_DMA_MAXLEN 0x1000 +#define A10_MMC_DMA_MAXLEN 0x10000 struct a10_mmc_softc { bus_space_handle_t a10_bsh; @@ -91,8 +91,8 @@ bus_dmamap_t a10_dma_map ; bus_dma_tag_t a10_dma_tag ; int a10_dma_ndesc; - void* a10_dma_desc ; /* Contains the kva of the descriptor which we will pass to DLBA */ - int a10_dma_ops ; /* Which type of operation DMA is performing ? 0:read, 1:write, 2:other */ + void* a10_dma_desc ; + int a10_dma_ops ; bus_dma_tag_t a10_dma_buff_tag ; bus_dmamap_t a10_dma_buff_map ; bus_addr_t a10_dma_buff_addr ; @@ -294,10 +294,8 @@ a10_mmc_prepare_dma(struct a10_mmc_softc* sc) { - //device_printf(sc->a10_dev, "Call to prepare dma\n") ; struct a10_mmc_dma_desc* dma = sc->a10_dma_desc ; struct mmc_command* cmd = sc->a10_req->cmd ; - //device_printf(sc->a10_dev,"sc->a10_req = %p, sc->a10_req->cmd = %p, sc->a10_req->cmd->data = %p, dma = %p\n", sc->a10_req,sc->a10_req->cmd,sc->a10_req->cmd->data,dma) ; int read = (sc->a10_req->cmd->data->flags & MMC_DATA_WRITE) ? 0 : 1 ; bus_addr_t desc_paddr = (sc->a10_dma_cb_arg).addr ; bus_size_t off = 0 ; @@ -307,20 +305,17 @@ //bus_size_t len = (sc->a10_dma_cb_arg).segs[0].ds_len ; bus_size_t len = A10_MMC_DMA_MAXLEN ; rem = min(len,cmd->data->len) ; - device_printf(sc->a10_dev, "%d bytes to be transferred\n", rem) ; uint32_t error = bus_dmamap_load(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, cmd->data->data,rem,a10_dma_buff_cb, &sc->a10_dma_buff_addr,BUS_DMA_NOWAIT) ; - if(error != 0) { + if (error != 0) { device_printf(sc->a10_dev, "DMA transaction failed due to insufficient resources\n") ; return EIO ; } bus_addr_t paddr = sc->a10_dma_buff_addr ; - /* Program all the descriptors in this segment. */ - while(rem > 0) - { - if(desc == sc->a10_dma_ndesc) + while (rem > 0) { + if (desc == sc->a10_dma_ndesc) break ; len = min(sc->a10_dma_xfer_len, rem) ; dma[desc].buff_size = htole32(len) ; @@ -330,11 +325,10 @@ cmd->data->len -= len ; rem -= len ; off += len ; - if(desc == 0) { + if (desc == 0) dma[desc].config |= htole32(A10_MMC_DMA_CONFIG_FD) ; - } - if(cmd->data->len == 0) { + if (cmd->data->len == 0) { dma[desc].config |= htole32(A10_MMC_DMA_CONFIG_LD) ; dma[desc].config |= htole32(A10_MMC_DMA_CONFIG_ER) ; dma[desc].next = 0 ; @@ -353,44 +347,25 @@ bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_PREWRITE) ; - /* Enable DMA and interrupts*/ - //device_printf(sc->a10_dev, "Previous value of gctrl was 0x%08X and new value is 0x%08X\n", A10_MMC_READ_4(sc, A10_MMC_GCTRL), A10_MMC_READ_4(sc,A10_MMC_GCTRL) | A10_MMC_DMA_ENABLE | A10_MMC_INT_ENABLE) ; val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) ; val |= A10_MMC_DMA_ENABLE ; val |= A10_MMC_INT_ENABLE ; A10_MMC_WRITE_4(sc, A10_MMC_GCTRL,val) ; - - /* Reset DMA */ val |= A10_MMC_DMA_RESET ; A10_MMC_WRITE_4(sc, A10_MMC_GCTRL,val) ; - - /* IDMA Soft reset */ A10_MMC_WRITE_4(sc, A10_MMC_DMAC,A10_MMC_IDMAC_SOFT_RST) ; - - /* Enable IDMA with Fix burst */ A10_MMC_WRITE_4(sc, A10_MMC_DMAC,A10_MMC_IDMAC_IDMA_ON | A10_MMC_IDMAC_FIX_BURST) ; - - /* Disable interrupts */ val = A10_MMC_READ_4(sc,A10_MMC_IDIE) ; val &= ~(A10_MMC_IDMAC_RECEIVE_INT | A10_MMC_IDMAC_TRANSMIT_INT) ; A10_MMC_WRITE_4(sc,A10_MMC_IDIE, val) ; - - /* Enable required interrupts */ if(read == 1) val |= A10_MMC_IDMAC_RECEIVE_INT ; else val |= A10_MMC_IDMAC_TRANSMIT_INT ; A10_MMC_WRITE_4(sc, A10_MMC_IDIE,val) ; - - /* Give the starting segment physical address */ A10_MMC_WRITE_4(sc, A10_MMC_DLBA,desc_paddr) ; - - /* Configure the watermark level. */ A10_MMC_WRITE_4(sc, A10_MMC_FTRGL,A10_MMC_DMA_FTRGLEVEL_A10) ; - /* Disable debounce*/ - //A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, A10_MMC_READ_4(sc, A10_MMC_GCTRL) & (~A10_MMC_DEBOUNCE_ENABLE)); - //device_printf(sc->a10_dev, "Completed the prepare function\n") ; return (0) ; } @@ -399,7 +374,7 @@ static int a10_mmc_can_do_dma(struct mmc_request* req) { - if(req->cmd->data->len >= A10_MMC_DMA_MAXLEN) + if(req->cmd->data->len >= A10_MMC_DMA_MAXLEN) return (0) ; else return (1) ; @@ -463,10 +438,10 @@ A10_MMC_CMD_DONE | A10_MMC_INT_ERR_BIT | A10_MMC_DATA_OVER | A10_MMC_AUTOCMD_DONE | A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ); - uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; - temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; + uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; + temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; /* Enable interrupts and AHB access. */ - A10_MMC_WRITE_4(sc, A10_MMC_GCTRL,temp_val) ; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL,temp_val) ; return (0); } @@ -638,13 +613,13 @@ sc->a10_req->cmd->error = MMC_ERR_TIMEOUT ; a10_mmc_req_done(sc) ; A10_MMC_UNLOCK(sc) ; - return ; + return ; } sc->a10_intr |= rint; data = sc->a10_req->cmd->data; - //device_printf(sc->a10_dev, "Data is %p\n", data) ; + //device_printf(sc->a10_dev, "Data is %p\n", data) ; if (data != NULL && (rint & (A10_MMC_DATA_OVER | A10_MMC_RX_DATA_REQ | A10_MMC_TX_DATA_REQ)) != 0) a10_mmc_pio_transfer(sc, data); @@ -654,7 +629,6 @@ A10_MMC_UNLOCK(sc); } -/* Interrupt masking in linux kernel apart from RX/TX is still dubious. */ static int a10_mmc_request(device_t bus, device_t child, struct mmc_request *req) { @@ -705,26 +679,24 @@ A10_MMC_WRITE_4(sc, A10_MMC_BLKSZ, blksz); A10_MMC_WRITE_4(sc, A10_MMC_BCNTR, cmd->data->len); - if((sc->a10_use_dma == 1)&&(a10_mmc_can_do_dma(req))) { + if ((sc->a10_use_dma == 1)&&(a10_mmc_can_do_dma(req))) { uint32_t error = a10_mmc_prepare_dma(sc) ; - if(error == 0) { + if (error == 0) { A10_MMC_WRITE_4(sc, A10_MMC_IMASK, A10_MMC_READ_4(sc, A10_MMC_IMASK) | (A10_MMC_TX_DATA_REQ | A10_MMC_RX_DATA_REQ)) ; } - else { - uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; - temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; - A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; - device_printf(sc->a10_dev, "Before page faullt (1)\n") ; + else { + uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; + temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; device_printf(sc->a10_dev, "Couldn't prepare DMA, using pio instead\n") ; } } else { - uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; - temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; - device_printf(sc->a10_dev, "Before page fault (2)\n") ; - A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; - device_printf(sc->a10_dev, "Couldn't transfer this data with DMA, using pio instead\n") ; + uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; + temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; + device_printf(sc->a10_dev, "Couldn't transfer this data with DMA, using pio instead\n") ; } } From owner-svn-soc-all@FreeBSD.ORG Fri Jun 19 11:39:19 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D2BE2DF for ; Fri, 19 Jun 2015 11:39:19 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A6D8B05 for ; Fri, 19 Jun 2015 11:39:19 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5JBdJsf081470 for ; Fri, 19 Jun 2015 11:39:19 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5JBdIXk081464 for svn-soc-all@FreeBSD.org; Fri, 19 Jun 2015 11:39:18 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Fri, 19 Jun 2015 11:39:18 GMT Message-Id: <201506191139.t5JBdIXk081464@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287322 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 11:39:19 -0000 Author: pratiksinghal Date: Fri Jun 19 11:39:18 2015 New Revision: 287322 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287322 Log: Added the sync call before start of transfer Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Fri Jun 19 09:37:37 2015 (r287321) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Fri Jun 19 11:39:18 2015 (r287322) @@ -350,6 +350,11 @@ return EIO ; } + if (sc->a10_dma_ops == 0) + bus_dmamap_sync(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, BUS_DMASYNC_PREREAD) ; + else if(sc->a10_dma_ops == 1) + bus_dmamap_sync(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, BUS_DMASYNC_PREWRITE) ; + bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_PREWRITE) ; val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) ; @@ -702,6 +707,12 @@ } } + else + { + uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; + temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; + } A10_MMC_WRITE_4(sc, A10_MMC_CARG, cmd->arg); A10_MMC_WRITE_4(sc, A10_MMC_CMDR, cmdreg | cmd->opcode); From owner-svn-soc-all@FreeBSD.ORG Fri Jun 19 15:28:12 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D045344C for ; Fri, 19 Jun 2015 15:28:12 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEABAC7A for ; Fri, 19 Jun 2015 15:28:12 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5JFSCiM060753 for ; Fri, 19 Jun 2015 15:28:12 GMT (envelope-from roam@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5JFSCkI060749 for svn-soc-all@FreeBSD.org; Fri, 19 Jun 2015 15:28:12 GMT (envelope-from roam@FreeBSD.org) Date: Fri, 19 Jun 2015 15:28:12 GMT Message-Id: <201506191528.t5JFSCkI060749@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to roam@FreeBSD.org using -f From: roam@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287326 - soc2015/roam/ng_ayiya MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 15:28:12 -0000 Author: roam Date: Fri Jun 19 15:28:11 2015 New Revision: 287326 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287326 Log: Oops, avoid a null pointer dereference. Pass the correct node pointer when shutting down with a pending configuration request. ObQuote: "Doesn't have a point of view, knows not where he's going to" Modified: soc2015/roam/ng_ayiya/ng_ayiya.c Modified: soc2015/roam/ng_ayiya/ng_ayiya.c ============================================================================== --- soc2015/roam/ng_ayiya/ng_ayiya.c Fri Jun 19 14:56:24 2015 (r287325) +++ soc2015/roam/ng_ayiya/ng_ayiya.c Fri Jun 19 15:28:11 2015 (r287326) @@ -404,7 +404,7 @@ const priv_p priv = NG_NODE_PRIVATE(node); if (priv->configuring) - configuring_respond(0, ECONNABORTED); + configuring_respond(node, ECONNABORTED); free(priv, M_NETGRAPH_AYIYA); NG_NODE_SET_PRIVATE(node, NULL); NG_NODE_UNREF(node); From owner-svn-soc-all@FreeBSD.ORG Fri Jun 19 15:28:16 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4FAC745E for ; Fri, 19 Jun 2015 15:28:16 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2EFC7B for ; Fri, 19 Jun 2015 15:28:16 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5JFSGhr060782 for ; Fri, 19 Jun 2015 15:28:16 GMT (envelope-from roam@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5JFSFNx060767 for svn-soc-all@FreeBSD.org; Fri, 19 Jun 2015 15:28:15 GMT (envelope-from roam@FreeBSD.org) Date: Fri, 19 Jun 2015 15:28:15 GMT Message-Id: <201506191528.t5JFSFNx060767@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to roam@FreeBSD.org using -f From: roam@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287327 - soc2015/roam/ng_ayiya MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 15:28:16 -0000 Author: roam Date: Fri Jun 19 15:28:15 2015 New Revision: 287327 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287327 Log: Oops, send the packet out the AYIYA hook! One of the reasons why I was getting no response from SixXS :) ObQuote: "All we need to do is make sure we keep talking" Modified: soc2015/roam/ng_ayiya/ng_ayiya.c Modified: soc2015/roam/ng_ayiya/ng_ayiya.c ============================================================================== --- soc2015/roam/ng_ayiya/ng_ayiya.c Fri Jun 19 15:28:11 2015 (r287326) +++ soc2015/roam/ng_ayiya/ng_ayiya.c Fri Jun 19 15:28:15 2015 (r287327) @@ -593,7 +593,7 @@ if (error != 0) return (error); - NG_SEND_DATA_ONLY(error, priv->hooks[AYIYA_HOOK_INET6], m); + NG_SEND_DATA_ONLY(error, priv->hooks[AYIYA_HOOK_AYIYA], m); return (error); } From owner-svn-soc-all@FreeBSD.ORG Fri Jun 19 15:28:19 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2018246F for ; Fri, 19 Jun 2015 15:28:19 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F168C7C for ; Fri, 19 Jun 2015 15:28:19 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5JFSIaT060842 for ; Fri, 19 Jun 2015 15:28:18 GMT (envelope-from roam@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5JFSIoM060840 for svn-soc-all@FreeBSD.org; Fri, 19 Jun 2015 15:28:18 GMT (envelope-from roam@FreeBSD.org) Date: Fri, 19 Jun 2015 15:28:18 GMT Message-Id: <201506191528.t5JFSIoM060840@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to roam@FreeBSD.org using -f From: roam@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287328 - soc2015/roam/ng_ayiya MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 15:28:19 -0000 Author: roam Date: Fri Jun 19 15:28:18 2015 New Revision: 287328 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287328 Log: Oops, fix the AYIYA ID length calculation! Yeah, when we want to calculate 2 ** n, it's not exactly 2 << n... ObQuote: "Past the point of no return..." Modified: soc2015/roam/ng_ayiya/ng_ayiya.c Modified: soc2015/roam/ng_ayiya/ng_ayiya.c ============================================================================== --- soc2015/roam/ng_ayiya/ng_ayiya.c Fri Jun 19 15:28:15 2015 (r287327) +++ soc2015/roam/ng_ayiya/ng_ayiya.c Fri Jun 19 15:28:18 2015 (r287328) @@ -491,7 +491,7 @@ return (EINVAL); if (hdr->idlen > 4) return (EINVAL); - const int32_t ofs_sig = ofs_id + (2 << hdr->idlen); + const int32_t ofs_sig = ofs_id + (2 << (hdr->idlen - 1)); if (len < ofs_sig) return (EINVAL); const unsigned siglen = 4 * hdr->siglen; From owner-svn-soc-all@FreeBSD.ORG Fri Jun 19 15:28:22 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7DF2480 for ; Fri, 19 Jun 2015 15:28:22 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 964CDC7D for ; Fri, 19 Jun 2015 15:28:22 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5JFSMOt060868 for ; Fri, 19 Jun 2015 15:28:22 GMT (envelope-from roam@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5JFSLWX060864 for svn-soc-all@FreeBSD.org; Fri, 19 Jun 2015 15:28:21 GMT (envelope-from roam@FreeBSD.org) Date: Fri, 19 Jun 2015 15:28:21 GMT Message-Id: <201506191528.t5JFSLWX060864@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to roam@FreeBSD.org using -f From: roam@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287329 - soc2015/roam/ng_ayiya MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 15:28:22 -0000 Author: roam Date: Fri Jun 19 15:28:21 2015 New Revision: 287329 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287329 Log: Configure with AYIYA, send a heartbeat packet. Move the configuration after the AYIYA socket has been connected, and as the last part of the configuration, send an AYIYA heartbeat packet. ObQuote: "Is there anybody out there?" Modified: soc2015/roam/ng_ayiya/ng_ayiya.c soc2015/roam/ng_ayiya/scaffold.pl Modified: soc2015/roam/ng_ayiya/ng_ayiya.c ============================================================================== --- soc2015/roam/ng_ayiya/ng_ayiya.c Fri Jun 19 15:28:18 2015 (r287328) +++ soc2015/roam/ng_ayiya/ng_ayiya.c Fri Jun 19 15:28:21 2015 (r287329) @@ -123,6 +123,8 @@ }; typedef struct ng_ayiya_private *priv_p; +static int send_heartbeat(const node_p node); + static int ng_ayiya_constructor(const node_p node) { @@ -279,7 +281,8 @@ { const priv_p priv = NG_NODE_PRIVATE(node); if (msg->header.arglen != 0 || priv->configured || - !priv->hooks[AYIYA_HOOK_INET6]) + !priv->hooks[AYIYA_HOOK_INET6] || + !priv->hooks[AYIYA_HOOK_AYIYA]) ERROUT(EINVAL); if (priv->configuring) ERROUT(EINPROGRESS); @@ -337,7 +340,13 @@ } if_rele(ifp); - configuring_respond(node, found? 0: ENOENT); + if (!found) { + configuring_respond(node, ENOENT); + break; + } + + configuring_respond(node, 0); + send_heartbeat(node); break; } @@ -393,7 +402,8 @@ if (idx == AYIYA_HOOK_LAST) panic("%s", __func__); priv->hooks[idx] = NULL; - if (priv->configuring && idx == AYIYA_HOOK_INET6) + if (priv->configuring && + (idx == AYIYA_HOOK_INET6 || idx == AYIYA_HOOK_AYIYA)) configuring_respond(node, ECONNABORTED); return (0); } @@ -433,7 +443,21 @@ { struct mbuf *m = *mb; - M_PREPEND(m, sizeof(struct ng_ayiya_packet), M_NOWAIT); + if (m == NULL) { + size_t left = sizeof(struct ng_ayiya_packet); + m = m_getm2(NULL, left, M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOMEM); + for (struct mbuf *mm = m; mm != NULL && left > 0; mm = mm->m_next) + { + const size_t len = min(M_TRAILINGSPACE(mm), left); + mm->m_len = len; + m->m_pkthdr.len += len; + left -= len; + } + } else { + M_PREPEND(m, sizeof(struct ng_ayiya_packet), M_NOWAIT); + } if (m->m_next) m = m_defrag(m, M_NOWAIT); if (m == NULL) @@ -569,6 +593,20 @@ } static int +send_heartbeat(const node_p node) +{ + const priv_p priv = NG_NODE_PRIVATE(node); + + struct mbuf *m = NULL; + int error = ayiya_build(&m, 0, IPPROTO_NONE, priv); + if (error != 0) + return (error); + + NG_SEND_DATA_ONLY(error, priv->hooks[AYIYA_HOOK_AYIYA], m); + return (error); +} + +static int ng_ayiya_rcvdata(const hook_p hook, const item_p item) { const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); @@ -581,7 +619,7 @@ switch (hidx) { case AYIYA_HOOK_INET6: { - if (!priv->configured || priv->hooks[AYIYA_HOOK_AYIYA] == NULL) + if (!priv->configured) { /* FIXME: enqueue the packet? */ m_freem(m); Modified: soc2015/roam/ng_ayiya/scaffold.pl ============================================================================== --- soc2015/roam/ng_ayiya/scaffold.pl Fri Jun 19 15:28:18 2015 (r287328) +++ soc2015/roam/ng_ayiya/scaffold.pl Fri Jun 19 15:28:21 2015 (r287329) @@ -420,9 +420,6 @@ run_command 'ifconfig', $iface, 'inet6', $t->ipv6_local; # FIXME: Add a default route here, too. - - debug "Trying to get the node to configure itself"; - ngctl 'msg', "$c->{name}:", 'configure'; } sub get_tic_tunnel($) @@ -499,5 +496,7 @@ die "Could not query the newly-created ng_ksocket node\n"; } ngctl 'msg', "$pname:", 'connect', 'inet/'.$t->ipv4_pop.':5072'; - ...; + + debug "Trying to get the node to configure itself"; + ngctl 'msg', "$c->{name}:", 'configure'; } From owner-svn-soc-all@FreeBSD.ORG Fri Jun 19 20:58:44 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79843A90 for ; Fri, 19 Jun 2015 20:58:44 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67D1899A for ; Fri, 19 Jun 2015 20:58:44 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5JKwilD051721 for ; Fri, 19 Jun 2015 20:58:44 GMT (envelope-from roam@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5JKwhGe051709 for svn-soc-all@FreeBSD.org; Fri, 19 Jun 2015 20:58:43 GMT (envelope-from roam@FreeBSD.org) Date: Fri, 19 Jun 2015 20:58:43 GMT Message-Id: <201506192058.t5JKwhGe051709@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to roam@FreeBSD.org using -f From: roam@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287337 - soc2015/roam/ng_ayiya MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 20:58:44 -0000 Author: roam Date: Fri Jun 19 20:58:43 2015 New Revision: 287337 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287337 Log: Fix the AYIYA ID length calculation properly. ObQuote: "A momentary lapse of reason" Modified: soc2015/roam/ng_ayiya/ng_ayiya.c Modified: soc2015/roam/ng_ayiya/ng_ayiya.c ============================================================================== --- soc2015/roam/ng_ayiya/ng_ayiya.c Fri Jun 19 19:57:39 2015 (r287336) +++ soc2015/roam/ng_ayiya/ng_ayiya.c Fri Jun 19 20:58:43 2015 (r287337) @@ -515,7 +515,7 @@ return (EINVAL); if (hdr->idlen > 4) return (EINVAL); - const int32_t ofs_sig = ofs_id + (2 << (hdr->idlen - 1)); + const int32_t ofs_sig = ofs_id + (1 << hdr->idlen); if (len < ofs_sig) return (EINVAL); const unsigned siglen = 4 * hdr->siglen; From owner-svn-soc-all@FreeBSD.ORG Fri Jun 19 20:58:48 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0572AA3 for ; Fri, 19 Jun 2015 20:58:47 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEF8199C for ; Fri, 19 Jun 2015 20:58:47 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5JKwl5b051752 for ; Fri, 19 Jun 2015 20:58:47 GMT (envelope-from roam@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5JKwl4P051749 for svn-soc-all@FreeBSD.org; Fri, 19 Jun 2015 20:58:47 GMT (envelope-from roam@FreeBSD.org) Date: Fri, 19 Jun 2015 20:58:47 GMT Message-Id: <201506192058.t5JKwl4P051749@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to roam@FreeBSD.org using -f From: roam@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287338 - soc2015/roam MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 20:58:48 -0000 Author: roam Date: Fri Jun 19 20:58:46 2015 New Revision: 287338 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287338 Log: Add testing instructions to the README file. ObQuote: "If you want it, come and get it" Modified: soc2015/roam/README.txt Modified: soc2015/roam/README.txt ============================================================================== --- soc2015/roam/README.txt Fri Jun 19 20:58:43 2015 (r287337) +++ soc2015/roam/README.txt Fri Jun 19 20:58:46 2015 (r287338) @@ -42,3 +42,121 @@ additional data that the node will ignore. This allows the administrator or the userland utility to keep more information for clarity, documentation and so on, without interfering with the operation of the node. + + +Building ng_ayiya +----------------- + +Building the AYIYA Netgraph node should be straightforward: obtain a copy of +the source tree, change into the ng_ayiya/ subdirectory (the one containing +the ng_ayiya.c file) and run the following commands: + + make cleandir && make cleandir + make depend + make + +If you'd like to install it into the system's kernel modules directory, run: + + make install + + +Using ng_ayiya +-------------- + +Bringing up an IPv6 tunnel using the AYIYA Netgraph node involves +the following steps: + +1. Use the sixxs-aiccu utility to make sure that your SixXS tunnel is active + and there are no network connectivity issues in running AYIYA. + +2. Get the Net-SixXS Perl distribution from its Git repository: + + git clone https://gitlab.com/ppentchev/Net-SixXS.git + +3. Build and optionally install Net-SixXS: + + cd Net-SixXS + perl Build.PL + ./Build + ./Build test + + # If you'd like to install Net-SixXS system-wide, do this as root: + ./Build install + +4. Use the sixxs-tic-tunnels tool from Net-SixXS to obtain information about + your configured SixXS tunnels in a format usable by ng_ayiya's testing + infrastructure: + + # If you have installed Net-SixXS system-wide: + sixxs-tic-tunnels -s tic.sixxs.net -f /usr/local/etc/aiccu.conf > tic-tunnels.txt + + # If you have only built it and are still within the Net-SixXS directory: + perl -Iblib/lib scripts/sixxs-tic-tunnels -s tic.sixxs.net -f /usr/local/etc/aiccu.conf > tic-tunnels.txt + +5. Copy the tic-tunnels.txt file to the ng_ayiya source directory. + +6. Change into the ng_ayiya source directory (the one containing ng_ayiya.c) + +7. Build ng_ayiya: + + make cleandir && make cleandir + + # Do not run "make obj"; the testing scaffold does not really understand + # object directories just yet + + make depend + make + +8. Load the kernel module and create an AYIYA node: + + make down # or make teardown + make up # or make setup + +9. Check to see that the AYIYA node is loaded properly; these commands + should report that it has not been configured yet and it has no hooks: + + sudo ngctl list + sudo ngctl status sc_ayiya: + sudo ngctl config sc_ayiya: + +10. Use the testing scaffold to create a simple graph and connect to your + SixXS tunnel; replace "T22928" with the name of your tunnel as listed + in the tic-tunnels.txt file: + + make tic TIC_TUNNEL=T22928 + +11. Check that your tunnel is up and running: + + sudo ngctl status sc_ayiya: + sudo ngctl config sc_ayiya: + + ifconfig ng0 + + ping6 -c1 your-tunnel's-peer-IPv6-address (usually one less than + the local IPv6 address configured on the ng0 interface, but check + tic-tunnels.txt for the exact value) + + sudo route -6 add default your-tunnel's-peer-IPv6-address + + curl -6s http://www.kame.net/ | fgrep -e 'Dancing kame' + + +To-do list +---------- + +- respond to AYIYA queries, maybe with content supplied via more Netgraph + control messages + +- send AYIYA queries, maybe in response to more Netgraph control messages + +- use a callout to periodically send an AYIYA heartbeat packet + +- write a ng_ayiya manual page + +- finish the Net-SixXS Perl distribution (mostly documentation) and + release it to CPAN + +- extend the testing scaffold to make it easy to pit two ng_ayiya nodes + against each other + +- teach sixxs-aiccu about ng_ayiya From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 05:28:27 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 889BD3DD for ; Sat, 20 Jun 2015 05:28:27 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76D78FB4 for ; Sat, 20 Jun 2015 05:28:27 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5K5SRnw098360 for ; Sat, 20 Jun 2015 05:28:27 GMT (envelope-from btw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5K5SQPe098356 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 05:28:26 GMT (envelope-from btw@FreeBSD.org) Date: Sat, 20 Jun 2015 05:28:26 GMT Message-Id: <201506200528.t5K5SQPe098356@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to btw@FreeBSD.org using -f From: btw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287359 - soc2015/btw/head/tools/tools/mq-testing/vme MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 05:28:27 -0000 Author: btw Date: Sat Jun 20 05:28:26 2015 New Revision: 287359 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287359 Log: Unlock the main lock before returning. Modified: soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c Modified: soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c ============================================================================== --- soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c Sat Jun 20 04:48:53 2015 (r287358) +++ soc2015/btw/head/tools/tools/mq-testing/vme/if_vme.c Sat Jun 20 05:28:26 2015 (r287359) @@ -670,8 +670,10 @@ return (0); } - if ((error = mbufq_enqueue(&tp->vme_queue, m)) != 0) + if ((error = mbufq_enqueue(&tp->vme_queue, m)) != 0) { + mtx_unlock(&tp->vme_mtx); return (error); + } if (tp->vme_flags & VME_RWAIT) { tp->vme_flags &= ~VME_RWAIT; From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 06:12:09 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBD0FB20 for ; Sat, 20 Jun 2015 06:12:08 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8D11CC4 for ; Sat, 20 Jun 2015 06:12:08 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5K6C8nb005379 for ; Sat, 20 Jun 2015 06:12:08 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5K6C8mp004786 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 06:12:08 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Sat, 20 Jun 2015 06:12:08 GMT Message-Id: <201506200612.t5K6C8mp004786@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287361 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 06:12:09 -0000 Author: pratiksinghal Date: Sat Jun 20 06:12:07 2015 New Revision: 287361 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287361 Log: 1) Fixed the handling of AUTOCMD interrupt 2) Removed some style issues 3) Fixed the handling of maximum descriptors case in prepare function Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sat Jun 20 05:40:35 2015 (r287360) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sat Jun 20 06:12:07 2015 (r287361) @@ -58,11 +58,12 @@ #define A10_MMC_RESSZ 2 #define A10_MMC_NDESC 16 #define A10_DMA_NSEGS 16 -#define A10_DMA_BUFF_SIZE 0x2000 -#define A10_DMA_MAX_SIZE 0x20000 +#define A10_DMA_BUFF_SIZE 0x2000 +#define A10_DMA_MAX_SIZE 0x20000 #define A10_MMC_DMA_FTRGLEVEL_A20 0x20070008 #define A10_MMC_DMA_FTRGLEVEL_A10 0x00070208 -#define A10_MMC_DMA_MAXLEN (A10_DMA_MAX_SIZE) +#define A10_MMC_DMA_MAXLEN (A10_DMA_MAX_SIZE) +#define A10_MMC_DMA_MINLEN 512 struct a10_mmc_softc { bus_space_handle_t a10_bsh; @@ -223,8 +224,8 @@ goto fail; } - if(sc->a10_use_dma == 1) { - if(a10_mmc_setup_dma(sc,dev) != 0) { + if (sc->a10_use_dma == 1) { + if (a10_mmc_setup_dma(sc,dev) != 0) { device_printf(sc->a10_dev, "Couldn't setup DMA!\n") ; sc->a10_use_dma = 0 ; } @@ -244,7 +245,6 @@ return (ENXIO); } -/*TODO :- Add the dismantling DMA part also with goto statements */ static int a10_mmc_setup_dma(struct a10_mmc_softc* sc, device_t dev) { @@ -253,45 +253,37 @@ sc->a10_dma_size = sizeof(struct a10_mmc_dma_desc)*(sc->a10_dma_ndesc) ; uint32_t error ; - /* First create the tag */ error = bus_dma_tag_create(bus_get_dma_tag(dev),1, sc->a10_dma_size,BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL,NULL,sc->a10_dma_size, 1,sc->a10_dma_size,0, NULL,NULL,&sc->a10_dma_tag) ; - if(error) + if (error) return (error) ; - - /* Allocate the memory and map at kva sc->a10_dma_desc*/ - error = bus_dmamem_alloc(sc->a10_dma_tag,&sc->a10_dma_desc,BUS_DMA_WAITOK|BUS_DMA_ZERO,&sc->a10_dma_map) ; - if(error) + if (error) return (error) ; - /* Load the map */ error = bus_dmamap_load(sc->a10_dma_tag, sc->a10_dma_map,sc->a10_dma_desc,sc->a10_dma_size,a10_dma_cb, &sc->a10_dma_cb_arg,0) ; - if((error != 0)&&(error != EINPROGRESS)) + if ((error != 0)&&(error != EINPROGRESS)) return (error) ; - - /* Now allocate tag and map for the buffer to be used with transfer. */ error = bus_dma_tag_create(bus_get_dma_tag(dev),1, 0,BUS_SPACE_MAXADDR_32BIT,BUS_SPACE_MAXADDR, NULL,NULL,A10_DMA_MAX_SIZE, A10_DMA_NSEGS,A10_DMA_BUFF_SIZE,0, NULL,NULL,&sc->a10_dma_buff_tag) ; - if(error) + if (error) return (error) ; error = bus_dmamap_create(sc->a10_dma_buff_tag,0,&sc->a10_dma_buff_map) ; - if(error) + if (error) return (error) ; return(0) ; } -/* Transfer at most 0x1000 (4K) of data (Experimental) */ static int a10_mmc_prepare_dma(struct a10_mmc_softc* sc) { @@ -304,14 +296,13 @@ int desc, rem ; uint32_t val; desc = 0 ; - //bus_size_t len = (sc->a10_dma_cb_arg).segs[0].ds_len ; bus_size_t len = A10_MMC_DMA_MAXLEN ; rem = min(len,cmd->data->len) ; uint32_t error = bus_dmamap_load(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, cmd->data->data,rem,a10_dma_buff_cb, &sc->a10_dma_buff_addr,0) ; - if(error == EINPROGRESS) { - for( ; sc->a10_dma_buff_addr == 0 ; ) { } + if (error == EINPROGRESS) { + for( ; sc->a10_dma_buff_addr == 0 ; ) { } } else if (error != 0) { device_printf(sc->a10_dev, "DMA transaction failed due to insufficient resources\n") ; @@ -345,16 +336,16 @@ desc++ ; } - if(desc == sc->a10_dma_ndesc) { + if ((desc == sc->a10_dma_ndesc) && (rem > 0)) { device_printf(sc->a10_dev, "Couldn't find enough descriptors for DMA transfer! desc = %d,sc->a10_dma_ndesc = %d\n",desc, sc->a10_dma_ndesc) ; return EIO ; } if (sc->a10_dma_ops == 0) - bus_dmamap_sync(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, BUS_DMASYNC_PREREAD) ; - else if(sc->a10_dma_ops == 1) - bus_dmamap_sync(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, BUS_DMASYNC_PREWRITE) ; - + bus_dmamap_sync(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, BUS_DMASYNC_PREREAD) ; + else if (sc->a10_dma_ops == 1) + bus_dmamap_sync(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, BUS_DMASYNC_PREWRITE) ; + bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_PREWRITE) ; val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) ; @@ -368,7 +359,7 @@ val = A10_MMC_READ_4(sc,A10_MMC_IDIE) ; val &= ~(A10_MMC_IDMAC_RECEIVE_INT | A10_MMC_IDMAC_TRANSMIT_INT) ; A10_MMC_WRITE_4(sc,A10_MMC_IDIE, val) ; - if(read == 1) + if (read == 1) val |= A10_MMC_IDMAC_RECEIVE_INT ; else val |= A10_MMC_IDMAC_TRANSMIT_INT ; @@ -380,19 +371,19 @@ } -/* Not implemented yet. */ static int a10_mmc_can_do_dma(struct mmc_request* req) { - if(req->cmd->data->len >= A10_MMC_DMA_MAXLEN) - return (0) ; - else - return (1) ; + return (1) ; + //if ((req->cmd->data->len > A10_MMC_DMA_MAXLEN) || (req->cmd->data->len <= A10_MMC_DMA_MINLEN)) + // return (0) ; + //else + // return (1) ; } static void a10_dma_cb(void* arg, bus_dma_segment_t* segs, int nsegs, int error) { - if(error) { + if (error) { printf("a10_mmc: Error in a10_dma_callback function, code = %d\n",error) ; return ; } @@ -404,7 +395,7 @@ static void a10_dma_buff_cb(void* arg, bus_dma_segment_t* segs, int nsegs, int error) { - if(error) { + if (error) { printf("a10_mmc: Error in a10_dma_buff_callback function, code = %d\n", error) ; return ; } @@ -434,12 +425,8 @@ if (timeout == 0) return (ETIMEDOUT); - /* Set the timeout. */ A10_MMC_WRITE_4(sc, A10_MMC_TIMEOUT, 0xffffffff); - - /* Clear pending interrupts. */ A10_MMC_WRITE_4(sc, A10_MMC_RINTR, 0xffffffff); - /* Dubious Will it remove the interrupt throttle? */ A10_MMC_WRITE_4(sc, A10_MMC_IDST, 0xffffffff) ; /* Unmask interrupts. */ A10_MMC_WRITE_4(sc, A10_MMC_IMASK, @@ -476,7 +463,7 @@ sc->a10_resid = 0; sc->a10_idst = 0 ; sc->a10_intr_wait = 0; - sc->a10_dma_buff_addr = 0 ; + sc->a10_dma_buff_addr = 0 ; req->done(req); } @@ -582,6 +569,7 @@ return; } + sc->a10_intr |= rint; if (rint & A10_MMC_INT_ERR_BIT) { device_printf(sc->a10_dev, "error rint: 0x%08X\n", rint); if (rint & A10_MMC_RESP_TIMEOUT) { @@ -594,7 +582,7 @@ return; } - if(idst & A10_MMC_IDMAC_ERROR) { + if (idst & A10_MMC_IDMAC_ERROR) { device_printf(sc->a10_dev, "error idst: 0x%08x\n", idst) ; sc->a10_req->cmd->error = MMC_ERR_FAILED ; a10_mmc_req_done(sc) ; @@ -602,11 +590,10 @@ return ; } - if(idst & A10_MMC_IDMAC_COMPLETE) { - //device_printf(sc->a10_dev, "DMA transfer complete!\n") ; - if(sc->a10_dma_ops == 0) + if ((idst & A10_MMC_IDMAC_COMPLETE) && ((sc->a10_intr & sc->a10_intr_wait) == sc->a10_intr_wait)) { + if (sc->a10_dma_ops == 0) bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_POSTREAD) ; - else if(sc->a10_dma_ops == 1) + else if (sc->a10_dma_ops == 1) bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_POSTWRITE) ; else device_printf(sc->a10_dev, "Invalid operations request!\n") ; @@ -616,7 +603,7 @@ return ; } - if((idst)&&(!(idst & A10_MMC_IDMAC_COMPLETE))) { + if ((idst)&&(!(idst & A10_MMC_IDMAC_COMPLETE))) { device_printf(sc->a10_dev, "DMA timeout error!\n") ; sc->a10_req->cmd->error = MMC_ERR_TIMEOUT ; a10_mmc_req_done(sc) ; @@ -624,7 +611,6 @@ return ; } - sc->a10_intr |= rint; data = sc->a10_req->cmd->data; if (data != NULL && (rint & (A10_MMC_DATA_OVER | @@ -695,7 +681,6 @@ uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; - device_printf(sc->a10_dev, "Couldn't prepare DMA, using pio instead\n") ; } } else @@ -703,15 +688,14 @@ uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; - device_printf(sc->a10_dev, "Couldn't transfer this data with DMA, using pio instead\n") ; } } else { - uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; - temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; - A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; + uint32_t temp_val = A10_MMC_READ_4(sc, A10_MMC_GCTRL) | A10_MMC_INT_ENABLE | A10_MMC_ACCESS_BY_AHB ; + temp_val = temp_val & (~A10_MMC_DMA_ENABLE) ; + A10_MMC_WRITE_4(sc, A10_MMC_GCTRL, temp_val) ; } A10_MMC_WRITE_4(sc, A10_MMC_CARG, cmd->arg); From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 08:46:58 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA5C3B0C for ; Sat, 20 Jun 2015 08:46:58 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6FB1243 for ; Sat, 20 Jun 2015 08:46:58 +0000 (UTC) (envelope-from btw@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5K8kwVD056909 for ; Sat, 20 Jun 2015 08:46:58 GMT (envelope-from btw@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5K8kt5m056890 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 08:46:55 GMT (envelope-from btw@FreeBSD.org) Date: Sat, 20 Jun 2015 08:46:55 GMT Message-Id: <201506200846.t5K8kt5m056890@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to btw@FreeBSD.org using -f From: btw@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287367 - soc2015/btw/head/tools/tools/mq-testing/tcp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 08:46:58 -0000 Author: btw Date: Sat Jun 20 08:46:55 2015 New Revision: 287367 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287367 Log: Add the tools for multiqueue testing: - client: a TCP client based on vme and lwip; - server: a TCP server based on socket(2); Added: soc2015/btw/head/tools/tools/mq-testing/tcp/ soc2015/btw/head/tools/tools/mq-testing/tcp/Makefile soc2015/btw/head/tools/tools/mq-testing/tcp/client.c soc2015/btw/head/tools/tools/mq-testing/tcp/common.h soc2015/btw/head/tools/tools/mq-testing/tcp/lwipopts.h soc2015/btw/head/tools/tools/mq-testing/tcp/server.c soc2015/btw/head/tools/tools/mq-testing/tcp/vmeif.c soc2015/btw/head/tools/tools/mq-testing/tcp/vmeif.h Added: soc2015/btw/head/tools/tools/mq-testing/tcp/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/btw/head/tools/tools/mq-testing/tcp/Makefile Sat Jun 20 08:46:55 2015 (r287367) @@ -0,0 +1,93 @@ +# +# $FreeBSD$ +# + +CCDEP=cc +CC=cc + +ARCH=unix +CFLAGS=-g -Wall -D$(ARCH) -DIPv4 -pedantic -Werror \ + -Wparentheses -Wsequence-point -Wswitch-default \ + -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast \ + -Wc++-compat -Wwrite-strings -Wold-style-definition \ + -Wmissing-prototypes -Wredundant-decls -Wnested-externs +LDFLAGS=-lpthread -lutil +ARFLAGS=rs + +CONTRIBDIR=$(HOME)/lwip/lwip-1.4.1/contrib-1.4.1 +LWIPDIR=$(HOME)/lwip/lwip-1.4.1/lwip-1.4.1/src +LWIPARCH=$(CONTRIBDIR)/ports/unix + +CFLAGS:=$(CFLAGS) \ + -I. \ + -I$(LWIPDIR)/include \ + -I$(LWIPARCH)/include \ + -I$(LWIPDIR)/include/ipv4 \ + -I$(LWIPDIR) + +# COREFILES, CORE4FILES: The minimum set of files needed for lwIP. +COREFILES=$(LWIPDIR)/core/mem.c \ + $(LWIPDIR)/core/memp.c \ + $(LWIPDIR)/core/netif.c \ + $(LWIPDIR)/core/pbuf.c \ + $(LWIPDIR)/core/raw.c \ + $(LWIPDIR)/core/stats.c \ + $(LWIPDIR)/core/sys.c \ + $(LWIPDIR)/core/tcp.c \ + $(LWIPDIR)/core/tcp_in.c \ + $(LWIPDIR)/core/tcp_out.c \ + $(LWIPDIR)/core/udp.c \ + $(LWIPDIR)/core/dhcp.c \ + $(LWIPDIR)/core/init.c \ + $(LWIPDIR)/core/timers.c \ + $(LWIPDIR)/core/def.c +CORE4FILES=$(wildcard $(LWIPDIR)/core/ipv4/*.c) \ + $(LWIPDIR)/core/ipv4/inet.c \ + $(LWIPDIR)/core/ipv4/inet_chksum.c + +# APIFILES: The files which implement the sequential and socket APIs. +APIFILES=$(LWIPDIR)/api/api_lib.c \ + $(LWIPDIR)/api/api_msg.c \ + $(LWIPDIR)/api/tcpip.c \ + $(LWIPDIR)/api/err.c \ + $(LWIPDIR)/api/sockets.c \ + $(LWIPDIR)/api/netbuf.c \ + $(LWIPDIR)/api/netdb.c + +# NETIFFILES: Files implementing various generic network interface functions. +NETIFFILES=$(LWIPDIR)/netif/etharp.c + +# ARCHFILES: Architecture specific files. +ARCHFILES=$(wildcard $(LWIPARCH)/*.c) + +# LWIPFILES: All the above. +LWIPFILES=$(COREFILES) $(CORE4FILES) $(APIFILES) \ + $(NETIFFILES) $(ARCHFILES) +LWIPFILESW=$(wildcard $(LWIPFILES)) +LWIPOBJS=$(notdir $(LWIPFILESW:.c=.o)) +LWIPLIB=liblwip4.a + +CLIENTFILES=client.c vmeif.c +CLIENTOBJS=$(notdir $(CLIENTFILES:.c=.o)) + +%.o: + $(CC) $(CFLAGS) -c $(<:.o=.c) + +all: client server +.PHONY: all + +clean: + rm -f *.o $(LWIPLIB) client server *.s .depend* *.core core + +depend dep: .depend + +-include .depend + +$(LWIPLIB): $(LWIPOBJS) + $(AR) $(ARFLAGS) $(LWIPLIB) $? + +.depend: $(CLIENTFILES) $(LWIPFILES) + $(CCDEP) $(CFLAGS) -MM $^ > .depend || rm -f .depend + +client: .depend $(LWIPLIB) $(CLIENTOBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -o client $(CLIENTOBJS) $(LWIPLIB) Added: soc2015/btw/head/tools/tools/mq-testing/tcp/client.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/btw/head/tools/tools/mq-testing/tcp/client.c Sat Jun 20 08:46:55 2015 (r287367) @@ -0,0 +1,206 @@ +/*- + * Copyright (c) 2015, Tiwei Bie + * 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 unmodified, 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 +#include +#include +#include +#include + +#include "lwip/tcpip.h" +#include "lwip/sockets.h" + +#include "vmeif.h" +#include "common.h" + +static ip_addr_t ipaddr, netmask, gw; +static char payload[1024]; +static struct netif netif; +static int quiet = 0; +static int nr_connections = 10000; + +static const char *gw_str = "192.168.10.1"; +static const char *ip_str = "192.168.10.2"; +static const char *nm_str = "255.255.255.0"; + +/* nonstatic debug cmd option, exported in lwipopts.h */ +unsigned char debug_flags; + +static void +usage(const char *prgname) +{ + (void)prgname; + fprintf(stderr, + "Usage: %s [-g gateway] [-i address] [-m netmask]\n" + " %*s [-n connections] [-dhq]\n", + prgname, (int)strlen(prgname), ""); + exit(EXIT_FAILURE); +} + +static void +init_netifs(void) +{ + netif_set_default(netif_add(&netif, &ipaddr, &netmask, &gw, + NULL, vmeif_init, tcpip_input)); + netif_set_up(&netif); +} + +static void +tcpip_init_done(void *arg) +{ + sys_sem_t *sem = arg; + init_netifs(); + sys_sem_signal(sem); +} + +static void +client_routine(void) +{ + struct sockaddr_in daddr; + int sd, *sds; + int i; + + sds = malloc(sizeof(int) * nr_connections); + + memset(&daddr, 0, sizeof(daddr)); + daddr.sin_family = AF_INET; + daddr.sin_addr.s_addr = gw.addr; + daddr.sin_port = htons(SERVER_PORT); + + for (i = 0; i < nr_connections; i++) { + sd = lwip_socket(AF_INET, SOCK_STREAM, 0); + if (sd < 0) { + fprintf(stderr, "Failed to create socket\n"); + exit(EXIT_FAILURE); + } + + if (lwip_connect(sd, (struct sockaddr *)&daddr, + sizeof(daddr)) < 0) { + fprintf(stderr, "Failed to connect to server sd=%d\n", + i); + exit(EXIT_FAILURE); + } + + sds[i] = sd; + } + + while (1) { + for (i = 0; i < nr_connections; i++) { + sd = sds[i]; + + snprintf(payload, sizeof(payload), + "message from socket %d", i); + + if (lwip_send(sd, payload, strlen(payload), 0) < 0) { + fprintf(stderr, + "Failed to send data to server\n"); + exit(EXIT_FAILURE); + } + } + } +} + +static void +main_thread(void) +{ + sys_sem_t sem; + + netif_init(); + + if (sys_sem_new(&sem, 0) != ERR_OK) { + fprintf(stderr, "Failed to create semaphore\n"); + exit(EXIT_FAILURE); + } + + tcpip_init(tcpip_init_done, &sem); + sys_sem_wait(&sem); + + if (!quiet) + printf("TCP/IP initialized.\n"); + + client_routine(); +} + +static void +signal_handler(int arg) +{ + if (arg == SIGINT) + exit(EXIT_SUCCESS); +} + +int +main(int argc, char **argv) +{ + int ch; + + debug_flags = LWIP_DBG_OFF; + + while ((ch = getopt(argc, argv, "g:i:m:n:dhq")) != -1) { + switch (ch) { + case 'd': + debug_flags |= + (LWIP_DBG_ON | LWIP_DBG_TRACE | LWIP_DBG_STATE | + LWIP_DBG_FRESH | LWIP_DBG_HALT); + break; + case 'g': + gw_str = optarg; + break; + case 'i': + ip_str = optarg; + break; + case 'm': + nm_str = optarg; + break; + case 'n': + sscanf(optarg, "%d", &nr_connections); + break; + case 'q': + quiet = 1; + break; + case 'h': + default: + usage(argv[0]); + break; + } + } + + gw.addr = inet_addr(gw_str); + ipaddr.addr = inet_addr(ip_str); + netmask.addr = inet_addr(nm_str); + + signal(SIGINT, signal_handler); + + if (!quiet) { + printf("host at %s\n", ip_str); + printf("netmask: %s\n", nm_str); + printf("gateway: %s\n", gw_str); + printf("connections: %d\n", nr_connections); + } + + main_thread(); + + return (0); +} Added: soc2015/btw/head/tools/tools/mq-testing/tcp/common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/btw/head/tools/tools/mq-testing/tcp/common.h Sat Jun 20 08:46:55 2015 (r287367) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2015, Tiwei Bie + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* $FreeBSD$ */ + +#ifndef _COMMON_H_ +#define _COMMON_H_ + +#define SERVER_PORT 8000 + +#endif Added: soc2015/btw/head/tools/tools/mq-testing/tcp/lwipopts.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/btw/head/tools/tools/mq-testing/tcp/lwipopts.h Sat Jun 20 08:46:55 2015 (r287367) @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + * + */ +#ifndef __LWIPOPTS_H__ +#define __LWIPOPTS_H__ + +#define LWIP_DBG_MIN_LEVEL 0 +#define LWIP_COMPAT_SOCKETS 1 +#define TAPIF_DEBUG LWIP_DBG_ON +#define TUNIF_DEBUG LWIP_DBG_OFF +#define UNIXIF_DEBUG LWIP_DBG_OFF +#define DELIF_DEBUG LWIP_DBG_OFF +#define SIO_FIFO_DEBUG LWIP_DBG_OFF +#define TCPDUMP_DEBUG LWIP_DBG_ON + +#define PPP_DEBUG LWIP_DBG_OFF +#define MEM_DEBUG LWIP_DBG_OFF +#define MEMP_DEBUG LWIP_DBG_OFF +#define PBUF_DEBUG LWIP_DBG_OFF +#define API_LIB_DEBUG LWIP_DBG_OFF +#define API_MSG_DEBUG LWIP_DBG_OFF +#define TCPIP_DEBUG LWIP_DBG_OFF +#define NETIF_DEBUG LWIP_DBG_OFF +#define SOCKETS_DEBUG LWIP_DBG_OFF +#define DEMO_DEBUG LWIP_DBG_OFF +#define IP_DEBUG LWIP_DBG_OFF +#define IP_REASS_DEBUG LWIP_DBG_OFF +#define RAW_DEBUG LWIP_DBG_OFF +#define ICMP_DEBUG LWIP_DBG_OFF +#define UDP_DEBUG LWIP_DBG_OFF +#define TCP_DEBUG LWIP_DBG_OFF +#define TCP_INPUT_DEBUG LWIP_DBG_OFF +#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF +#define TCP_RTO_DEBUG LWIP_DBG_OFF +#define TCP_CWND_DEBUG LWIP_DBG_OFF +#define TCP_WND_DEBUG LWIP_DBG_OFF +#define TCP_FR_DEBUG LWIP_DBG_OFF +#define TCP_QLEN_DEBUG LWIP_DBG_OFF +#define TCP_RST_DEBUG LWIP_DBG_OFF + +extern unsigned char debug_flags; +#define LWIP_DBG_TYPES_ON debug_flags + +#define NO_SYS 0 +#define LWIP_SOCKET (NO_SYS==0) +#define LWIP_NETCONN (NO_SYS==0) + + +/* ---------- Memory options ---------- */ +/* MEM_ALIGNMENT: should be set to the alignment of the CPU for which + lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 + byte alignment -> define MEM_ALIGNMENT to 2. */ +/* MSVC port: intel processors don't need 4-byte alignment, + but are faster that way! */ +#define MEM_ALIGNMENT 4 + +/* MEM_SIZE: the size of the heap memory. If the application will send +a lot of data that needs to be copied, this should be set high. */ +#define MEM_SIZE 10240 + +/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application + sends a lot of data out of ROM (or other static memory), this + should be set high. */ +#define MEMP_NUM_PBUF 16 +/* MEMP_NUM_RAW_PCB: the number of UDP protocol control blocks. One + per active RAW "connection". */ +#define MEMP_NUM_RAW_PCB 3 +/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One + per active UDP "connection". */ +#define MEMP_NUM_UDP_PCB 4 +/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP + connections. */ +#define MEMP_NUM_TCP_PCB 60000 +/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP + connections. */ +#define MEMP_NUM_TCP_PCB_LISTEN 8 +/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP + segments. */ +#define MEMP_NUM_TCP_SEG 16 +/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active + timeouts. */ +#define MEMP_NUM_SYS_TIMEOUT 3 + +/* The following four are used only with the sequential API and can be + set to 0 if the application only will use the raw API. */ +/* MEMP_NUM_NETBUF: the number of struct netbufs. */ +#define MEMP_NUM_NETBUF 2 +/* MEMP_NUM_NETCONN: the number of struct netconns. */ +#define MEMP_NUM_NETCONN 60000 +/* MEMP_NUM_TCPIP_MSG_*: the number of struct tcpip_msg, which is used + for sequential API communication and incoming packets. Used in + src/api/tcpip.c. */ +#define MEMP_NUM_TCPIP_MSG_API 16 +#define MEMP_NUM_TCPIP_MSG_INPKT 16 + +/* ---------- Pbuf options ---------- */ +/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ +#define PBUF_POOL_SIZE 120 + +/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ +#define PBUF_POOL_BUFSIZE 128 + +/* PBUF_LINK_HLEN: the number of bytes that should be allocated for a + link level header. */ +#define PBUF_LINK_HLEN 16 + +/** SYS_LIGHTWEIGHT_PROT + * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection + * for certain critical regions during buffer allocation, deallocation and memory + * allocation and deallocation. + */ +#define SYS_LIGHTWEIGHT_PROT 1 + +/* ---------- TCP options ---------- */ +#define LWIP_TCP 1 +#define TCP_TTL 255 + +/* Controls if TCP should queue segments that arrive out of + order. Define to 0 if your device is low on memory. */ +#define TCP_QUEUE_OOSEQ 1 + +/* TCP Maximum segment size. */ +#define TCP_MSS 1024 + +/* TCP sender buffer space (bytes). */ +#define TCP_SND_BUF 2048 + +/* TCP sender buffer space (pbufs). This must be at least = 2 * + TCP_SND_BUF/TCP_MSS for things to work. */ +#define TCP_SND_QUEUELEN (4 * TCP_SND_BUF/TCP_MSS) + +/* TCP writable space (bytes). This must be less than or equal + to TCP_SND_BUF. It is the amount of space which must be + available in the tcp snd_buf for select to return writable */ +#define TCP_SNDLOWAT (TCP_SND_BUF/2) + +/* TCP receive window. */ +#define TCP_WND 8096 + +/* Maximum number of retransmissions of data segments. */ +#define TCP_MAXRTX 12 + +/* Maximum number of retransmissions of SYN segments. */ +#define TCP_SYNMAXRTX 4 + +/* ---------- ARP options ---------- */ +#define LWIP_ARP 1 +#define ARP_TABLE_SIZE 10 +#define ARP_QUEUEING 1 + +/* ---------- IP options ---------- */ +/* Define IP_FORWARD to 1 if you wish to have the ability to forward + IP packets across network interfaces. If you are going to run lwIP + on a device with only one network interface, define this to 0. */ +#define IP_FORWARD 1 + + +/* IP reassembly and segmentation.These are orthogonal even + * if they both deal with IP fragments */ +#define IP_REASSEMBLY 1 +#define IP_REASS_MAX_PBUFS 10 +#define MEMP_NUM_REASSDATA 10 +#define IP_FRAG 1 + +/* ---------- ICMP options ---------- */ +#define ICMP_TTL 255 + +/* ---------- DHCP options ---------- */ +/* Define LWIP_DHCP to 1 if you want DHCP configuration of + interfaces. */ +#define LWIP_DHCP 0 + +/* 1 if you want to do an ARP check on the offered address + (recommended if using DHCP). */ +#define DHCP_DOES_ARP_CHECK (LWIP_DHCP) + +/* ---------- AUTOIP options ------- */ +#define LWIP_AUTOIP 0 + +/* ---------- SNMP options ---------- */ +/** @todo SNMP is experimental for now + @note UDP must be available for SNMP transport */ +#ifndef LWIP_SNMP +#define LWIP_SNMP 0 +#endif + +#ifndef SNMP_PRIVATE_MIB +#define SNMP_PRIVATE_MIB 0 +#endif + +/* ---------- UDP options ---------- */ +#define LWIP_UDP 1 +#define UDP_TTL 255 + +/* ---------- RAW options ---------- */ +#define LWIP_RAW 1 +#define RAW_TTL 255 + +/* ---------- Statistics options ---------- */ +/* individual STATS options can be turned off by defining them to 0 + * (e.g #define TCP_STATS 0). All of them are turned off if LWIP_STATS + * is 0 + * */ + +#define LWIP_STATS 1 + +/* ---------- PPP options ---------- */ + +#define PPP_SUPPORT 0 /* Set > 0 for PPP */ + +#if PPP_SUPPORT > 0 + +#define NUM_PPP 1 /* Max PPP sessions. */ + + +/* Select modules to enable. Ideally these would be set in the makefile but + * we're limited by the command line length so you need to modify the settings + * in this file. + */ +#define PAP_SUPPORT 1 /* Set > 0 for PAP. */ +#define CHAP_SUPPORT 1 /* Set > 0 for CHAP. */ +#define MSCHAP_SUPPORT 0 /* Set > 0 for MSCHAP (NOT FUNCTIONAL!) */ +#define CBCP_SUPPORT 0 /* Set > 0 for CBCP (NOT FUNCTIONAL!) */ +#define CCP_SUPPORT 0 /* Set > 0 for CCP (NOT FUNCTIONAL!) */ +#define VJ_SUPPORT 1 /* Set > 0 for VJ header compression. */ +#define MD5_SUPPORT 1 /* Set > 0 for MD5 (see also CHAP) */ + + +/* + * Timeouts. + */ +#define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ +#define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ +#define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ +#define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ + +#define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ +#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ + +#define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ +#define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ + + +/* Interval in seconds between keepalive echo requests, 0 to disable. */ +#if 1 +#define LCP_ECHOINTERVAL 0 +#else +#define LCP_ECHOINTERVAL 10 +#endif + +/* Number of unanswered echo requests before failure. */ +#define LCP_MAXECHOFAILS 3 + +/* Max Xmit idle time (in jiffies) before resend flag char. */ +#define PPP_MAXIDLEFLAG 100 + +/* + * Packet sizes + * + * Note - lcp shouldn't be allowed to negotiate stuff outside these + * limits. See lcp.h in the pppd directory. + * (XXX - these constants should simply be shared by lcp.c instead + * of living in lcp.h) + */ +#define PPP_MTU 1500 /* Default MTU (size of Info field) */ +#if 0 +#define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) +#else +#define PPP_MAXMTU 1500 /* Largest MTU we allow */ +#endif +#define PPP_MINMTU 64 +#define PPP_MRU 1500 /* default MRU = max length of info field */ +#define PPP_MAXMRU 1500 /* Largest MRU we allow */ +#define PPP_DEFMRU 296 /* Try for this */ +#define PPP_MINMRU 128 /* No MRUs below this */ + + +#define MAXNAMELEN 256 /* max length of hostname or name for auth */ +#define MAXSECRETLEN 256 /* max length of password or secret */ + +#endif /* PPP_SUPPORT > 0 */ + +#endif /* __LWIPOPTS_H__ */ Added: soc2015/btw/head/tools/tools/mq-testing/tcp/server.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/btw/head/tools/tools/mq-testing/tcp/server.c Sat Jun 20 08:46:55 2015 (r287367) @@ -0,0 +1,216 @@ +/*- + * Copyright (c) 2015, Tiwei Bie + * 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 unmodified, 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 +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "common.h" + +static int verbose = 0; + +#define NR_EVENTS 10 + +static void +usage(const char *prgname) +{ + fprintf(stderr, "Usage: %s [-hv]\n", prgname); + exit(EXIT_FAILURE); +} + +static char * +addr2str(int af, void *addr) +{ + static char msg[1024]; + char addrstr[INET6_ADDRSTRLEN]; + + switch (af) { + case AF_INET: + snprintf(msg, sizeof(msg), "%s:%d", + inet_ntoa(((struct sockaddr_in *)addr)->sin_addr), + ntohs(((struct sockaddr_in *)addr)->sin_port)); + break; + case AF_INET6: + snprintf(msg, sizeof(msg), "%s:%d", + inet_ntop(AF_INET6, + &((struct sockaddr_in6 *)addr)->sin6_addr, + addrstr, sizeof(addrstr)), + ntohs(((struct sockaddr_in6 *)addr)->sin6_port)); + break; + } + + return (msg); +} + +static int +kq_add(int kq, int fd) +{ + struct kevent changes[1]; + int ret; + + EV_SET(&changes[0], fd, EVFILT_READ, EV_ADD, 0, 0, NULL); + ret = kevent(kq, changes, 1, NULL, 0, NULL); + + return (ret); +} + +static int +kq_delete(int kq, int fd) +{ + struct kevent changes[1]; + int ret; + + EV_SET(&changes[0], fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); + ret = kevent(kq, changes, 1, NULL, 0, NULL); + + return (ret); +} + +static void +accept_new_connection(int kq, int fd, int n) +{ + struct sockaddr_in from; + socklen_t length; + int newfd, i; + + for (i = 0; i < n; i++) { + length = sizeof(from); + newfd = accept(fd, (struct sockaddr *)&from, &length); + if (newfd < 0) + err(EXIT_FAILURE, "accept"); + + if (kq_add(kq, newfd) < 0) + err(EXIT_FAILURE, "kq_add"); + + if (verbose) + printf("accept connection from %s\n", + addr2str(AF_INET, &from)); + } +} + +static void +receive_data(int kq, int fd, int n) +{ + char msg[BUFSIZ]; + int i; + + n = read(fd, msg, sizeof(msg)); + if (n < 0) + err(EXIT_FAILURE, "read"); + + if (n == 0) { + if (kq_delete(kq, fd) < 0) + err(EXIT_FAILURE, "kq_delete"); + return; + } + + if (verbose) { + printf("len=%d ", n); + for (i = 0; i < n && msg[i]; i++) { + if (isprint(msg[i])) + printf("%c", msg[i]); + } + printf("\n"); + } +} + +int +main(int argc, char **argv) +{ + int servfd, kq; + struct sockaddr_in sin; + int ch, on; + + while ((ch = getopt(argc, argv, "hv")) != -1) { + switch (ch) { + case 'v': + verbose = 1; + break; + case 'h': + default: + usage(argv[0]); + break; + } + } + + servfd = socket(AF_INET, SOCK_STREAM, 0); + if (servfd < 0) + err(EXIT_FAILURE, "socket"); + + memset(&sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = INADDR_ANY; + sin.sin_port = htons(SERVER_PORT); + + on = 1; + if (setsockopt(servfd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) + err(EXIT_FAILURE, "setsockopt"); + + if (bind(servfd, (struct sockaddr *)&sin, sizeof(sin)) < 0) + err(EXIT_FAILURE, "bind"); + + if (listen(servfd, 5) < 0) + err(EXIT_FAILURE, "listen"); + + if ((kq = kqueue()) < 0) + err(EXIT_FAILURE, "kqueue"); + + if (kq_add(kq, servfd) < 0) + err(EXIT_FAILURE, "kq_add"); + + while (1) { + struct kevent events[NR_EVENTS]; + int n, i; + + n = kevent(kq, NULL, 0, events, NR_EVENTS, NULL); + if (n < 0) + err(EXIT_FAILURE, "kevent"); + + for (i = 0; i < n; i++) { + int sd, data; + + sd = events[i].ident; + data = events[i].data; + + if (sd == servfd) + accept_new_connection(kq, sd, data); + else + receive_data(kq, sd, data); + } + } + + return (0); +} Added: soc2015/btw/head/tools/tools/mq-testing/tcp/vmeif.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/btw/head/tools/tools/mq-testing/tcp/vmeif.c Sat Jun 20 08:46:55 2015 (r287367) @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2001-2003 Swedish Institute of Computer Science. + * Copyright (c) 2015 Tiwei Bie + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + * + * This file is part of the lwIP TCP/IP stack. + * + * Author: Adam Dunkels + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "lwip/debug.h" + +#include "lwip/opt.h" +#include "lwip/def.h" +#include "lwip/ip.h" +#include "lwip/mem.h" +#include "lwip/pbuf.h" +#include "lwip/sys.h" + +#include "netif/etharp.h" + +#include "vmeif.h" + +#define IFCONFIG_BIN "/sbin/ifconfig " + +#define DEVVME "/dev/vme0" +#define IFCONFIG_ARGS "vme0 inet %d.%d.%d.%d" + +#define IFNAME0 't' +#define IFNAME1 'p' + +#ifndef VMEIF_DEBUG +#define VMEIF_DEBUG LWIP_DBG_OFF +#endif + +struct vmeif { + struct eth_addr *ethaddr; + int fd; +}; + +/* Forward declarations. */ +static void vmeif_input(struct netif *netif); +static void vmeif_thread(void *data); + +static void +low_level_init(struct netif *netif) +{ + struct vmeif *vmeif; + char buf[sizeof(IFCONFIG_ARGS) + sizeof(IFCONFIG_BIN) + 50]; + + vmeif = (struct vmeif *)netif->state; + + /* Obtain MAC address from network interface. */ + + /* (We just fake an address...) */ + vmeif->ethaddr->addr[0] = 0xbc; + vmeif->ethaddr->addr[1] = 0xae; + vmeif->ethaddr->addr[2] = 0xc5; + vmeif->ethaddr->addr[3] = 0x23; + vmeif->ethaddr->addr[4] = 0x61; + vmeif->ethaddr->addr[5] = 0x22; + + /* Do whatever else is needed to initialize interface. */ + + vmeif->fd = open(DEVVME, O_RDWR); + LWIP_DEBUGF(VMEIF_DEBUG, ("vmeif_init: fd %d\n", vmeif->fd)); + if (vmeif->fd == -1) { + perror("vmeif_init: cannot open " DEVVME); + exit(1); + } + + sprintf(buf, IFCONFIG_BIN IFCONFIG_ARGS, + ip4_addr1(&(netif->gw)), + ip4_addr2(&(netif->gw)), + ip4_addr3(&(netif->gw)), ip4_addr4(&(netif->gw))); + + LWIP_DEBUGF(VMEIF_DEBUG, ("vmeif_init: system(\"%s\");\n", buf)); + system(buf); + sys_thread_new("vmeif_thread", vmeif_thread, netif, + DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO); + +} + +/* + * low_level_output(): + * + * Should do the actual transmission of the packet. The packet is + * contained in the pbuf that is passed to the function. This pbuf + * might be chained. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 11:34:33 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0CF7FBE for ; Sat, 20 Jun 2015 11:34:33 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E226E12 for ; Sat, 20 Jun 2015 11:34:33 +0000 (UTC) (envelope-from mihai@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5KBYXcI096211 for ; Sat, 20 Jun 2015 11:34:33 GMT (envelope-from mihai@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5KBYVG7096205 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 11:34:31 GMT (envelope-from mihai@FreeBSD.org) Date: Sat, 20 Jun 2015 11:34:31 GMT Message-Id: <201506201134.t5KBYVG7096205@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to mihai@FreeBSD.org using -f From: mihai@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287374 - in soc2015/mihai/bhyve-on-arm-head/sys: arm/arm arm/conf conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 11:34:33 -0000 Author: mihai Date: Sat Jun 20 11:34:31 2015 New Revision: 287374 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287374 Log: soc2015: mihai: bhyve-on-arm-head: install stub handler for HYP mode in order to bhyve call it later to make the real initialization Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/hypervisor-stub.S Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/locore-v6.S soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 soc2015/mihai/bhyve-on-arm-head/sys/conf/files.arm Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/hypervisor-stub.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/hypervisor-stub.S Sat Jun 20 11:34:31 2015 (r287374) @@ -0,0 +1,57 @@ +#include "assym.s" +#include +#include +#include +#include +#include +#include + +ASENTRY_NP(_hypervisor_stub_vect_install) + + /* If we are not in SVC mode than return */ + mrs r0, cpsr + and r0, r0, #(PSR_MODE) + cmp r0, #(PSR_HYP32_MODE) + movne pc, lr + + /* Install hypervisor stub vectors. */ + ldr r0, =_hypervisor_stub_vect + mcr p15, 4, r0, c12, c0, 0 @ set HVBAR + + /* Disable all the traps in the hypervisor. */ + mov r0, #0 + mcr p15, 4, r0, c1, c1, 0 @ HCR + mcr p15, 4, r0, c1, c1, 2 @ HCPTR + mcr p15, 4, r0, c1, c1, 3 @ HSTR + mcr p15, 4, r0, c1, c0, 0 @ HSCTLR + + /* Don't disable access to perf-mon from PL0,1 */ + mrc p15, 4, r0, c1, c1, 1 @ HDCR + and r0, #0x1f @ Preserve HPMN + mcr p15, 4, r0, c1, c1, 1 @ HDCR + + mov pc, lr +END(_hypervisor_stub_vect_install) + +ASENTRY_NP(_hypervisor_stub_trap) + /* + * If the first parameter is -1 than return the + * exception vector (HVBAR), otherwise set it to + * the value of it. + */ + cmp r0, #-1 + mrceq p15, 4, r0, c12, c0, 0 @ get HVBAR + mcrne p15, 4, r0, c12, c0, 0 @ set HVBAR + eret +END(_hypervisor_stub_trap) + + +_C_LABEL(_hypervisor_stub_vect): + .word 0 /* Reset */ + .word 0 /* undev */ + .word 0 /* SMC */ + .word 0 /* PABT */ + .word 0 /* DABT */ + b _hypervisor_stub_trap /* HYP-Mode */ + .word 0 /* FIQ */ + .word 0 /* IRQ */ Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/locore-v6.S ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/locore-v6.S Sat Jun 20 09:06:48 2015 (r287373) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/arm/locore-v6.S Sat Jun 20 11:34:31 2015 (r287374) @@ -67,9 +67,30 @@ btext: ASENTRY_NP(_start) STOP_UNWINDING /* Can't unwind into the bootloader! */ - - /* Setup status register for supervisor mode, interrupts disabled */ - msr cpsr_fc, #0xd3 + + # If HYP-MODE is active, install an exception vector stub + bl _hypervisor_stub_vect_install + + # Return to SVC + mrs r0, cpsr + eor r0, r0, #(PSR_HYP32_MODE) + tst r0, #(PSR_MODE) + bic r0, r0, #(PSR_MODE) + orr r0, r0, #(PSR_F | PSR_I | PSR_SVC32_MODE) + /* If we are not in HYP, we disable all interrupts and set SCVN mode */ + bne 1f + /* + * If we are in HYP mode set the LR from HYP-Mode to the + * address of label 2: and the SPSR to the value of CPSR + */ + orr r0, r0, #(PSR_A) + adr lr, 2f + msr ELR_hyp, lr + msr spsr_fsxc, r0 + eret +1: + msr cpsr_c, r0 +2: mov r8, r0 /* 0 or boot mode from boot2 */ mov r9, r1 /* Save Machine type */ Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Sat Jun 20 09:06:48 2015 (r287373) +++ soc2015/mihai/bhyve-on-arm-head/sys/arm/conf/FVP_VE_CORTEX_A15x1 Sat Jun 20 11:34:31 2015 (r287374) @@ -8,7 +8,7 @@ cpu CPU_CORTEXA machine arm armv6 -makeoptions CONF_CFLAGS="-march=armv7a" +makeoptions CONF_CFLAGS="-mcpu=cortex-a15" include "std.armv6" Modified: soc2015/mihai/bhyve-on-arm-head/sys/conf/files.arm ============================================================================== --- soc2015/mihai/bhyve-on-arm-head/sys/conf/files.arm Sat Jun 20 09:06:48 2015 (r287373) +++ soc2015/mihai/bhyve-on-arm-head/sys/conf/files.arm Sat Jun 20 11:34:31 2015 (r287374) @@ -43,6 +43,7 @@ arm/arm/in_cksum_arm.S optional inet | inet6 arm/arm/intr.c standard arm/arm/locore.S standard no-obj +arm/arm/hypervisor-stub.S standard arm/arm/machdep.c standard arm/arm/mem.c optional mem arm/arm/minidump_machdep.c optional mem From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 12:15:09 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D18B3772 for ; Sat, 20 Jun 2015 12:15:09 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B30E2970 for ; Sat, 20 Jun 2015 12:15:09 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5KCF9xF021749 for ; Sat, 20 Jun 2015 12:15:09 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5KCF9OG021731 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 12:15:09 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Sat, 20 Jun 2015 12:15:09 GMT Message-Id: <201506201215.t5KCF9OG021731@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287377 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 12:15:10 -0000 Author: pratiksinghal Date: Sat Jun 20 12:15:08 2015 New Revision: 287377 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287377 Log: Corrected the way segment address is passed in prepare function Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sat Jun 20 11:20:25 2015 (r287376) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sat Jun 20 12:15:08 2015 (r287377) @@ -97,7 +97,7 @@ int a10_dma_ops ; bus_dma_tag_t a10_dma_buff_tag ; bus_dmamap_t a10_dma_buff_map ; - bus_addr_t a10_dma_buff_addr ; + bus_addr_t a10_dma_buff_addrs[A10_DMA_NSEGS] ; }; @@ -230,7 +230,7 @@ sc->a10_use_dma = 0 ; } } - sc->a10_dma_buff_addr = 0; + sc->a10_dma_buff_addrs[0] = 0; #ifdef DEBUG device_printf(sc->a10_dev, "DMA status %d\n", sc->a10_use_dma) ; #endif @@ -300,22 +300,22 @@ rem = min(len,cmd->data->len) ; uint32_t error = bus_dmamap_load(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, cmd->data->data,rem,a10_dma_buff_cb, - &sc->a10_dma_buff_addr,0) ; + sc->a10_dma_buff_addrs,0) ; if (error == EINPROGRESS) { - for( ; sc->a10_dma_buff_addr == 0 ; ) { } + for( ; sc->a10_dma_buff_addrs[0] == 0 ; ) { } } else if (error != 0) { device_printf(sc->a10_dev, "DMA transaction failed due to insufficient resources\n") ; return EIO ; } - bus_addr_t paddr = sc->a10_dma_buff_addr ; while (rem > 0) { if (desc == sc->a10_dma_ndesc) break ; len = min(sc->a10_dma_xfer_len, rem) ; dma[desc].buff_size = htole32(len) ; - dma[desc].buff_addr = htole32(paddr + off) ; + device_printf(sc->a10_dev, "The address is %lu\n", sc->a10_dma_buff_addrs[desc]) ; + dma[desc].buff_addr = htole32(sc->a10_dma_buff_addrs[desc]) ; dma[desc].config = htole32(A10_MMC_DMA_CONFIG_CH|A10_MMC_DMA_CONFIG_OWN) ; cmd->data->len -= len ; @@ -374,11 +374,10 @@ static int a10_mmc_can_do_dma(struct mmc_request* req) { - return (1) ; - //if ((req->cmd->data->len > A10_MMC_DMA_MAXLEN) || (req->cmd->data->len <= A10_MMC_DMA_MINLEN)) - // return (0) ; - //else - // return (1) ; + if ((req->cmd->data->len > A10_MMC_DMA_MAXLEN) || (req->cmd->data->len <= A10_MMC_DMA_MINLEN)) + return (0) ; + else + return (1) ; } static void a10_dma_cb(void* arg, bus_dma_segment_t* segs, int nsegs, int error) @@ -399,7 +398,10 @@ printf("a10_mmc: Error in a10_dma_buff_callback function, code = %d\n", error) ; return ; } - *(bus_addr_t*)arg = segs[0].ds_addr ; + bus_addr_t* ptr = (bus_addr_t*) arg ; + int i = 0; + for(i=0; ia10_resid = 0; sc->a10_idst = 0 ; sc->a10_intr_wait = 0; - sc->a10_dma_buff_addr = 0 ; + sc->a10_dma_buff_addrs[0] = 0 ; req->done(req); } From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 12:47:39 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B917BE9 for ; Sat, 20 Jun 2015 12:47:39 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CEF3FC7 for ; Sat, 20 Jun 2015 12:47:39 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5KCldeo023913 for ; Sat, 20 Jun 2015 12:47:39 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5KClc3E023586 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 12:47:38 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Sat, 20 Jun 2015 12:47:38 GMT Message-Id: <201506201247.t5KClc3E023586@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287378 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 12:47:39 -0000 Author: pratiksinghal Date: Sat Jun 20 12:47:38 2015 New Revision: 287378 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287378 Log: 1) Cleaned up unused variables from softc 2) Corrected the handling of length in prepare function 3) Corrected the post i/o sync operations. Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sat Jun 20 12:15:08 2015 (r287377) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sat Jun 20 12:47:38 2015 (r287378) @@ -85,19 +85,16 @@ int a10_use_dma ; /* Fields required for DMA access */ - uint32_t a10_dma_xfer_len ; - bus_dma_segment_t* a10_dma_segs ; - int a10_dma_nsegs ; - bus_size_t a10_dma_size ; struct a10_mmc_cb a10_dma_cb_arg ; bus_dmamap_t a10_dma_map ; bus_dma_tag_t a10_dma_tag ; - int a10_dma_ndesc; void* a10_dma_desc ; int a10_dma_ops ; bus_dma_tag_t a10_dma_buff_tag ; bus_dmamap_t a10_dma_buff_map ; bus_addr_t a10_dma_buff_addrs[A10_DMA_NSEGS] ; + bus_size_t a10_dma_buff_sizes[A10_DMA_NSEGS] ; + uint32_t a10_dma_nsegs ; }; @@ -230,7 +227,7 @@ sc->a10_use_dma = 0 ; } } - sc->a10_dma_buff_addrs[0] = 0; + sc->a10_dma_nsegs = 0 ; #ifdef DEBUG device_printf(sc->a10_dev, "DMA status %d\n", sc->a10_use_dma) ; #endif @@ -248,15 +245,13 @@ static int a10_mmc_setup_dma(struct a10_mmc_softc* sc, device_t dev) { - sc->a10_dma_xfer_len = 0x2000 ; - sc->a10_dma_ndesc = A10_MMC_NDESC ; - sc->a10_dma_size = sizeof(struct a10_mmc_dma_desc)*(sc->a10_dma_ndesc) ; + uint32_t a10_dma_size = sizeof(struct a10_mmc_dma_desc)*(A10_MMC_NDESC); uint32_t error ; error = bus_dma_tag_create(bus_get_dma_tag(dev),1, - sc->a10_dma_size,BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, - NULL,NULL,sc->a10_dma_size, - 1,sc->a10_dma_size,0, + a10_dma_size,BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, + NULL,NULL,a10_dma_size, + 1,a10_dma_size,0, NULL,NULL,&sc->a10_dma_tag) ; if (error) return (error) ; @@ -264,7 +259,7 @@ if (error) return (error) ; - error = bus_dmamap_load(sc->a10_dma_tag, sc->a10_dma_map,sc->a10_dma_desc,sc->a10_dma_size,a10_dma_cb, &sc->a10_dma_cb_arg,0) ; + error = bus_dmamap_load(sc->a10_dma_tag, sc->a10_dma_map,sc->a10_dma_desc,a10_dma_size,a10_dma_cb, &sc->a10_dma_cb_arg,0) ; if ((error != 0)&&(error != EINPROGRESS)) return (error) ; @@ -300,9 +295,9 @@ rem = min(len,cmd->data->len) ; uint32_t error = bus_dmamap_load(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, cmd->data->data,rem,a10_dma_buff_cb, - sc->a10_dma_buff_addrs,0) ; + &sc->a10_dma_nsegs,0) ; if (error == EINPROGRESS) { - for( ; sc->a10_dma_buff_addrs[0] == 0 ; ) { } + for( ; sc->a10_dma_nsegs == 0 ; ) { } } else if (error != 0) { device_printf(sc->a10_dev, "DMA transaction failed due to insufficient resources\n") ; @@ -310,11 +305,10 @@ } while (rem > 0) { - if (desc == sc->a10_dma_ndesc) + if (desc == A10_MMC_NDESC) break ; - len = min(sc->a10_dma_xfer_len, rem) ; + len = min(sc->a10_dma_buff_sizes[desc], rem) ; dma[desc].buff_size = htole32(len) ; - device_printf(sc->a10_dev, "The address is %lu\n", sc->a10_dma_buff_addrs[desc]) ; dma[desc].buff_addr = htole32(sc->a10_dma_buff_addrs[desc]) ; dma[desc].config = htole32(A10_MMC_DMA_CONFIG_CH|A10_MMC_DMA_CONFIG_OWN) ; @@ -336,8 +330,8 @@ desc++ ; } - if ((desc == sc->a10_dma_ndesc) && (rem > 0)) { - device_printf(sc->a10_dev, "Couldn't find enough descriptors for DMA transfer! desc = %d,sc->a10_dma_ndesc = %d\n",desc, sc->a10_dma_ndesc) ; + if ((desc == A10_MMC_NDESC) && (rem > 0)) { + device_printf(sc->a10_dev, "Couldn't find enough descriptors for DMA transfer! desc = %d,A10_MMC_NDESC = %d\n",desc, A10_MMC_NDESC) ; return EIO ; } @@ -374,7 +368,8 @@ static int a10_mmc_can_do_dma(struct mmc_request* req) { - if ((req->cmd->data->len > A10_MMC_DMA_MAXLEN) || (req->cmd->data->len <= A10_MMC_DMA_MINLEN)) + if (req->cmd->data->len > A10_MMC_DMA_MAXLEN) + //if ((req->cmd->data->len > A10_MMC_DMA_MAXLEN) || (req->cmd->data->len <= A10_MMC_DMA_MINLEN)) return (0) ; else return (1) ; @@ -398,10 +393,12 @@ printf("a10_mmc: Error in a10_dma_buff_callback function, code = %d\n", error) ; return ; } - bus_addr_t* ptr = (bus_addr_t*) arg ; - int i = 0; - for(i=0; ia10_dma_buff_addrs[i] = segs[i].ds_addr ; + sc->a10_dma_buff_sizes[i] = segs[i].ds_len ; + } } static int @@ -465,7 +462,7 @@ sc->a10_resid = 0; sc->a10_idst = 0 ; sc->a10_intr_wait = 0; - sc->a10_dma_buff_addrs[0] = 0 ; + sc->a10_dma_nsegs = 0 ; req->done(req); } @@ -594,9 +591,9 @@ if ((idst & A10_MMC_IDMAC_COMPLETE) && ((sc->a10_intr & sc->a10_intr_wait) == sc->a10_intr_wait)) { if (sc->a10_dma_ops == 0) - bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_POSTREAD) ; + bus_dmamap_sync(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, BUS_DMASYNC_POSTREAD) ; else if (sc->a10_dma_ops == 1) - bus_dmamap_sync(sc->a10_dma_tag, sc->a10_dma_map, BUS_DMASYNC_POSTWRITE) ; + bus_dmamap_sync(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, BUS_DMASYNC_POSTWRITE) ; else device_printf(sc->a10_dev, "Invalid operations request!\n") ; bus_dmamap_unload(sc->a10_dma_buff_tag, sc->a10_dma_buff_map) ; From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 12:52:27 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21360C26 for ; Sat, 20 Jun 2015 12:52:27 +0000 (UTC) (envelope-from kczekirda@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 039F7253 for ; Sat, 20 Jun 2015 12:52:27 +0000 (UTC) (envelope-from kczekirda@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5KCqQEo047652 for ; Sat, 20 Jun 2015 12:52:26 GMT (envelope-from kczekirda@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5KCqQm4047647 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 12:52:26 GMT (envelope-from kczekirda@FreeBSD.org) Date: Sat, 20 Jun 2015 12:52:26 GMT Message-Id: <201506201252.t5KCqQm4047647@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to kczekirda@FreeBSD.org using -f From: kczekirda@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287379 - soc2015/kczekirda/ipxe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 12:52:27 -0000 Author: kczekirda Date: Sat Jun 20 12:52:25 2015 New Revision: 287379 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287379 Log: unnecessary options cleaning Modified: soc2015/kczekirda/ipxe/Makefile Modified: soc2015/kczekirda/ipxe/Makefile ============================================================================== --- soc2015/kczekirda/ipxe/Makefile Sat Jun 20 12:47:38 2015 (r287378) +++ soc2015/kczekirda/ipxe/Makefile Sat Jun 20 12:52:25 2015 (r287379) @@ -24,32 +24,15 @@ USE_GCC= any WRKSRC= ${WRKDIR}/${DISTNAME}/src -OPTIONS_DEFINE= NET_PROTO_IPV4 NET_PROTO_IPV6 NET_PROTO_FCOE \ - PXE_STACK PXE_MENU \ - DOWNLOAD_PROTO_TFTP DOWNLOAD_PROTO_HTTP \ - DOWNLOAD_PROTO_HTTPS DOWNLOAD_PROTO_FTP \ - DOWNLOAD_PROTO_SLAM DOWNLOAD_PROTO_NFS \ - SANBOOT_PROTO_ISCSI SANBOOT_PROTO_AOE SANBOOT_PROTO_IB_SRP \ - SANBOOT_PROTO_FCP \ - CRYPTO_80211_WEP CRYPTO_80211_WPA CRYPTO_80211_WPA2 \ - DNS_RESOLVER \ - IMAGE_NBI IMAGE_ELF IMAGE_MULTIBOOT IMAGE_PXE \ - IMAGE_SCRIPT IMAGE_BZIMAGE IMAGE_COMBOOT IMAGE_EFI \ - IMAGE_SDI IMAGE_PNM IMAGE_PNG \ - CMD_AUTOBOOT CMD_NVO CMD_CONFIG CMD_IFMGMT CMD_IWMGMT \ - CMD_FCMGMT CMD_ROUTE CMD_IMAGE CMD_DHCP CMD_SANBOOT \ - CMD_MENU CMD_LOGIN CMD_SYNC CMD_NSLOOKUP CMD_TIME \ - CMD_DIGEST CMD_LOTEST CMD_VLAN CMD_PXE CMD_REBOOT \ - CMD_POWEROFF CMD_IMAGE_TRUST CMD_PCI CMD_PARAM \ - CMD_NEIGHBOUR CMD_PING CMD_CONSOLE CMD_IPSTAT CMD_PROFSTAT \ - ERRMSG_80211 \ - CONF_PCI_SETTINGS CONF_CPUID_SETTINGS \ - CONF_MEMMAP_SETTINGS CONF_VMWARE_SETTINGS \ - CONF_VRAM_SETTINGS \ - USB_HCD_XHCI USB_HCD_EHCI USB_HCD_UHCI USB_KEYBOARD \ - CON_PCBIOS CON_SERIAL CON_DIRECT_VGA CON_PC_KBD \ - CON_SYSLOG CON_SYSLOGS CON_VMWARE CON_DEBUGCON CON_VESAFB \ - CON_INT13 +OPTIONS_DEFINE= NET_PROTO_IPV6 NET_PROTO_FCOE DOWNLOAD_PROTO_HTTPS \ + DOWNLOAD_PROTO_FTP DOWNLOAD_PROTO_NFS \ + IMAGE_ELF IMAGE_MULTIBOOT IMAGE_PXE IMAGE_SCRIPT \ + IMAGE_BZIMAGE IMAGE_COMBOOT IMAGE_EFI \ + CMD_NSLOOKUP CMD_DIGEST CMD_VLAN CMD_PXE CMD_REBOOT \ + CMD_POWEROFF CMD_IMAGE_TRUST CMD_PCI CMD_PING CMD_IPSTAT \ + CONF_CPUID_SETTINGS CONF_MEMMAP_SETTINGS \ + CON_PCBIOS CON_SERIAL CON_SYSLOG CON_SYSLOGS CON_VMWARE \ + CON_DEBUGCON CON_VESAFB \ #DEBUG_DESC= with DEBUG=$$DEBUG e.g =dhcp,tcp #VIRTUALBOX_DESC= build VirtualBox PXE-ROM images @@ -57,44 +40,17 @@ # Network protocols: -NET_PROTO_IPV4_DESC= IPv4 protocol NET_PROTO_IPV6_DESC= IPv6 protocol NET_PROTO_FCOE_DESC= Fibre Channel over Ethernet protocol -# PXE support - -PXE_STACK_DESC= PXE stack in iPXE - you want this! -PXE_MENU_DESC= PXE menu booting - # Download protocols -DOWNLOAD_PROTO_TFTP_DESC= Trivial File Transfer Protocol -DOWNLOAD_PROTO_HTTP_DESC= Hypertext Transfer Protocol DOWNLOAD_PROTO_HTTPS_DESC= Secure Hypertext Transfer Protocol DOWNLOAD_PROTO_FTP_DESC= File Transfer Protocol -DOWNLOAD_PROTO_SLAM_DESC= Scalable Local Area Multicast DOWNLOAD_PROTO_NFS_DESC= Network File System Protocol -# SAN boot protocols - -SANBOOT_PROTO_ISCSI_DESC= iSCSI protocol -SANBOOT_PROTO_AOE_DESC= AoE protocol -SANBOOT_PROTO_IB_SRP_DESC= Infiniband SCSI RDMA protocol -SANBOOT_PROTO_FCP_DESC= Fibre Channel protocol - -# 802.11 cryptosystems and handshaking protocols - -CRYPTO_80211_WEP_DESC= WEP encryption (deprecated and insecure!) -CRYPTO_80211_WPA_DESC= WPA Personal, authenticating with passphrase -CRYPTO_80211_WPA2_DESC= Add support for stronger WPA cryptography - -# Name resolution modules - -DNS_RESOLVER_DESC= DNS Resolver - # Image types -IMAGE_NBI_DESC= NBI image support IMAGE_ELF_DESC= ELF image support IMAGE_MULTIBOOT_DESC= MultiBoot image support IMAGE_PXE_DESC= PXE image support @@ -102,91 +58,34 @@ IMAGE_BZIMAGE_DESC= Linux bzImage image support IMAGE_COMBOOT_DESC= SYSLINUX COMBOOT image support IMAGE_EFI_DESC= EFI image support -IMAGE_SDI_DESC= SDI image support -IMAGE_PNM_DESC= PNM image support -IMAGE_PNG_DESC= PNG image support # Command-line commands to include -CMD_AUTOBOOT_DESC= Automatic booting -CMD_NVO_DESC= Non-volatile option storage commands -CMD_CONFIG_DESC= Option configuration console -CMD_IFMGMT_DESC= Interface management commands -CMD_IWMGMT_DESC= Wireless interface management commands -CMD_FCMGMT_DESC= Fibre Channel management commands -CMD_ROUTE_DESC= Routing table management commands -CMD_IMAGE_DESC= Image management commands -CMD_DHCP_DESC= DHCP management commands -CMD_SANBOOT_DESC= SAN boot commands -CMD_MENU_DESC= Menu commands -CMD_LOGIN_DESC= Login command -CMD_SYNC_DESC= Sync command CMD_NSLOOKUP_DESC= DNS resolving command -CMD_TIME_DESC= Time commands CMD_DIGEST_DESC= Image crypto digest commands -CMD_LOTEST_DESC= Loopback testing commands CMD_VLAN_DESC= VLAN commands CMD_PXE_DESC= PXE commands CMD_REBOOT_DESC= Reboot command CMD_POWEROFF_DESC= Power off command CMD_IMAGE_TRUST_DESC= Image trust management commands CMD_PCI_DESC= PCI commands -CMD_PARAM_DESC= Form parameter commands -CMD_NEIGHBOUR_DESC= Neighbour management commands CMD_PING_DESC= Ping command -CMD_CONSOLE_DESC= Console command CMD_IPSTAT_DESC= IP statistics commands -CMD_PROFSTAT_DESC= Profiling commands - -# Error message tables to include - -ERRMSG_80211_DESC= All 802.11 error descriptions (~3.3kb) # Configuration settings -CONF_PCI_SETTINGS_DESC= PCI device settings CONF_CPUID_SETTINGS_DESC= CPUID settings CONF_MEMMAP_SETTINGS_DESC= Memory map settings -CONF_VMWARE_SETTINGS_DESC= VMware GuestInfo settings -CONF_VRAM_SETTINGS_DESC= Video RAM dump settings - -# USB configuration - -# USB host controllers (all enabled by default) -USB_HCD_XHCI_DESC= xHCI USB host controller -USB_HCD_EHCI_DESC= EHCI USB host controller -USB_HCD_UHCI_DESC= UHCI USB host controller -# USB peripherals -USB_KEYBOARD_DESC= USB keyboards #Console configuration CON_PCBIOS_DESC= Default BIOS console CON_SERIAL_DESC= Serial port -CON_DIRECT_VGA_DESC= Direct access to VGA card -CON_PC_KBD_DESC= Direct access to PC keyboard CON_SYSLOG_DESC= Syslog console CON_SYSLOGS_DESC= Encrypted syslog console CON_VMWARE_DESC= VMware logfile console CON_DEBUGCON_DESC= Debug port console CON_VESAFB_DESC= VESA framebuffer console -CON_INT13_DESC= INT13 disk log console - -OPTIONS_DEFAULT= NET_PROTO_IPV4 \ - PXE_STACK PXE_MENU \ - DOWNLOAD_PROTO_TFTP DOWNLOAD_PROTO_HTTP \ - SANBOOT_PROTO_ISCSI SANBOOT_PROTO_AOE SANBOOT_PROTO_IB_SRP \ - SANBOOT_PROTO_FCP \ - CRYPTO_80211_WEP CRYPTO_80211_WPA CRYPTO_80211_WPA2 \ - DNS_RESOLVER \ - IMAGE_NBI IMAGE_ELF IMAGE_MULTIBOOT IMAGE_PXE \ - IMAGE_SCRIPT IMAGE_BZIMAGE IMAGE_COMBOOT IMAGE_EFI \ - IMAGE_SDI IMAGE_PNM IMAGE_PNG \ - CMD_AUTOBOOT CMD_NVO CMD_CONFIG CMD_IFMGMT CMD_IWMGMT \ - CMD_FCMGMT CMD_ROUTE CMD_IMAGE CMD_DHCP CMD_SANBOOT \ - CMD_MENU CMD_LOGIN CMD_SYNC \ - CONF_PCI_SETTINGS \ - USB_HCD_XHCI USB_HCD_EHCI USB_HCD_UHCI USB_KEYBOARD .include @@ -194,6 +93,58 @@ MAKE_ARGS+= ARCH=i386 .endif +# ON + +# change //#define to #define + +# IMAGE_ELF IMAGE_MULTIBOOT IMAGE_PXE +# IMAGE_SCRIPT IMAGE_BZIMAGE IMAGE_COMBOOT IMAGE_EFI +# CMD_NSLOOKUP +# CMD_DIGEST CMD_VLAN CMD_PXE CMD_REBOOT +# CMD_POWEROFF CMD_IMAGE_TRUST CMD_PCI +# CMD_PING CMD_IPSTAT + +.if ${PORT_OPTIONS:MIMAGE_ELF} +DEFINES+= IMAGE_ELF +.endif + +.if ${PORT_OPTIONS:MIMAGE_MOOLTIBOOT} +DEFINES+= IMAGE_MOOLTIBOOT +.endif + +.if ${PORT_OPTIONS:MIMAGE_PXE} +DEFINES+= IMAGE_PXE +.endif + +.if ${PORT_OPTIONS:MIMAGE_SCRIPT} +DEFINES+= IMAGE_SCRIPT +.endif + +.if ${PORT_OPTIONS:MIMAGE_BZIMAGE} +DEFINES+= IMAGE_BZIMAGE +.endif + +.if ${PORT_OPTIONS:MIMAGE_COMBOOT} +DEFINES+= IMAGE_COMBOOT +.endif + +.if ${PORT_OPTIONS:MIMAGE_EFI} +DEFINES+= IMAGE_EFI +.endif + +# +# CONF_CPUID_SETTINGS CONF_MEMMAP_SETTINGS + +# +# CON_PCBIOS CON_SERIAL \ +# CON_SYSLOG CON_SYSLOGS CON_VMWARE CON_DEBUGCON CON_VESAFB \ + +# chande undef to define: + +# NET_PROTO_IPV6 NET_PROTO_FCOE +# DOWNLOAD_PROTO_HTTPS DOWNLOAD_PROTO_FTP +# DOWNLOAD_PROTO_NFS + BINLIST= bin/undionly.kpxe bin/ipxe.iso bin/ipxe.usb ALL_TARGET?= ${BINLIST} From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 13:06:39 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F41F0F98 for ; Sat, 20 Jun 2015 13:06:38 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E19DD683 for ; Sat, 20 Jun 2015 13:06:38 +0000 (UTC) (envelope-from pratiksinghal@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5KD6cvs092826 for ; Sat, 20 Jun 2015 13:06:38 GMT (envelope-from pratiksinghal@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5KD6c6I092810 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 13:06:38 GMT (envelope-from pratiksinghal@FreeBSD.org) Date: Sat, 20 Jun 2015 13:06:38 GMT Message-Id: <201506201306.t5KD6c6I092810@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to pratiksinghal@FreeBSD.org using -f From: pratiksinghal@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287381 - soc2015/pratiksinghal/cubie-head/sys/arm/allwinner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 13:06:39 -0000 Author: pratiksinghal Date: Sat Jun 20 13:06:37 2015 New Revision: 287381 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287381 Log: Fixed errors in previous commit Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Modified: soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sat Jun 20 12:43:54 2015 (r287380) +++ soc2015/pratiksinghal/cubie-head/sys/arm/allwinner/a10_mmc.c Sat Jun 20 13:06:37 2015 (r287381) @@ -295,7 +295,7 @@ rem = min(len,cmd->data->len) ; uint32_t error = bus_dmamap_load(sc->a10_dma_buff_tag, sc->a10_dma_buff_map, cmd->data->data,rem,a10_dma_buff_cb, - &sc->a10_dma_nsegs,0) ; + sc,0) ; if (error == EINPROGRESS) { for( ; sc->a10_dma_nsegs == 0 ; ) { } } @@ -394,7 +394,8 @@ return ; } int i ; - *(uint32_t*)arg = nsegs ; + struct a10_mmc_softc* sc = (struct a10_mmc_softc*) arg ; + sc->a10_dma_nsegs = nsegs ; for(i=0; ia10_dma_buff_addrs[i] = segs[i].ds_addr ; sc->a10_dma_buff_sizes[i] = segs[i].ds_len ; From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 17:11:14 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 29C19B22 for ; Sat, 20 Jun 2015 17:11:14 +0000 (UTC) (envelope-from kczekirda@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C66768F for ; Sat, 20 Jun 2015 17:11:14 +0000 (UTC) (envelope-from kczekirda@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5KHBD4t048255 for ; Sat, 20 Jun 2015 17:11:13 GMT (envelope-from kczekirda@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5KHBDCj048235 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 17:11:13 GMT (envelope-from kczekirda@FreeBSD.org) Date: Sat, 20 Jun 2015 17:11:13 GMT Message-Id: <201506201711.t5KHBDCj048235@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to kczekirda@FreeBSD.org using -f From: kczekirda@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287387 - soc2015/kczekirda/ipxe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 17:11:14 -0000 Author: kczekirda Date: Sat Jun 20 17:11:12 2015 New Revision: 287387 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287387 Log: port configuration Modified: soc2015/kczekirda/ipxe/Makefile Modified: soc2015/kczekirda/ipxe/Makefile ============================================================================== --- soc2015/kczekirda/ipxe/Makefile Sat Jun 20 15:55:53 2015 (r287386) +++ soc2015/kczekirda/ipxe/Makefile Sat Jun 20 17:11:12 2015 (r287387) @@ -93,62 +93,154 @@ MAKE_ARGS+= ARCH=i386 .endif -# ON - -# change //#define to #define - -# IMAGE_ELF IMAGE_MULTIBOOT IMAGE_PXE -# IMAGE_SCRIPT IMAGE_BZIMAGE IMAGE_COMBOOT IMAGE_EFI -# CMD_NSLOOKUP -# CMD_DIGEST CMD_VLAN CMD_PXE CMD_REBOOT -# CMD_POWEROFF CMD_IMAGE_TRUST CMD_PCI -# CMD_PING CMD_IPSTAT - .if ${PORT_OPTIONS:MIMAGE_ELF} -DEFINES+= IMAGE_ELF +DEFINESGENERAL+= IMAGE_ELF .endif .if ${PORT_OPTIONS:MIMAGE_MOOLTIBOOT} -DEFINES+= IMAGE_MOOLTIBOOT +DEFINESGENERAL+= IMAGE_MOOLTIBOOT .endif .if ${PORT_OPTIONS:MIMAGE_PXE} -DEFINES+= IMAGE_PXE +DEFINESGENERAL+= IMAGE_PXE .endif .if ${PORT_OPTIONS:MIMAGE_SCRIPT} -DEFINES+= IMAGE_SCRIPT +DEFINESGENERAL+= IMAGE_SCRIPT .endif .if ${PORT_OPTIONS:MIMAGE_BZIMAGE} -DEFINES+= IMAGE_BZIMAGE +DEFINESGENERAL+= IMAGE_BZIMAGE .endif .if ${PORT_OPTIONS:MIMAGE_COMBOOT} -DEFINES+= IMAGE_COMBOOT +DEFINESGENERAL+= IMAGE_COMBOOT .endif .if ${PORT_OPTIONS:MIMAGE_EFI} -DEFINES+= IMAGE_EFI +DEFINESGENERAL+= IMAGE_EFI +.endif + +.if ${PORT_OPTIONS:MCMD_NSLOOKUP} +DEFINESGENERAL+= NSLOOKUP_CMD +.endif + +.if ${PORT_OPTIONS:MCMD_DIGEST} +DEFINESGENERAL+= DIGEST_CMD +.endif + +.if ${PORT_OPTIONS:MCMD_VLAN} +DEFINESGENERAL+= VLAN_CMD +.endif + +.if ${PORT_OPTIONS:MCMD_PXE} +DEFINESGENERAL+= PXE_CMD +.endif + +.if ${PORT_OPTIONS:MCMD_REBOOT} +DEFINESGENERAL+= REBOOT_CMD +.endif + +.if ${PORT_OPTIONS:MCMD_POWEROFF} +DEFINESGENERAL+= POWEROFF_CMD +.endif + +.if ${PORT_OPTIONS:MCMD_IMAGE_TRUST} +DEFINESGENERAL+= IMAGE_TRUST_CMD +.endif + +.if ${PORT_OPTIONS:MCMD_PCI} +DEFINESGENERAL+= PCI_CMD +.endif + +.if ${PORT_OPTIONS:MCMD_PING} +DEFINESGENERAL+= PING_CMD +.endif + +.if ${PORT_OPTIONS:MCMD_IPSTAT} +DEFINESGENERAL+= IPSTAT_CMD +.endif + +.if ${PORT_OPTIONS:MCONF_CPUID_SETTINGS} +DEFINESSETTINGS+= CPUID_SETTINGS +.endif + +.if ${PORT_OPTIONS:MCONF_MEMMAP_SETTINGS} +DEFINESSETTINGS+= MEMMAP_SETTINGS +.endif + +.if ${PORT_OPTIONS:MCON_PCBIOS} +DEFINESCONSOLE+= CONSOLE_PCBIOS +.endif + +.if ${PORT_OPTIONS:MCON_SERIAL} +DEFINESCONSOLE+= CONSOLE_SERIAL +.endif + +.if ${PORT_OPTIONS:MCON_SYSLOG} +DEFINESCONSOLE+= CONSOLE_SYSLOG +.endif + +.if ${PORT_OPTIONS:MCON_SYSLOGS} +DEFINESCONSOLE+= CONSOLE_SYSLOG +.endif + +.if ${PORT_OPTIONS:MCON_VMWARE} +DEFINESCONSOLE+= CONSOLE_VMWARE +.endif + +.if ${PORT_OPTIONS:MCON_DEBUGCON} +DEFINESCONSOLE+= CONSOLE_DEBUGCON +.endif + +.if ${PORT_OPTIONS:MCON_VESAFB} +DEFINESCONSOLE+= CONSOLE_VESAFB +.endif + +.if ${PORT_OPTIONS:MNET_PROTO_IPV6} +UNDEFINES+= NET_PROTO_IPV6 .endif -# -# CONF_CPUID_SETTINGS CONF_MEMMAP_SETTINGS +.if ${PORT_OPTIONS:MNET_PROTO_FCOE} +UNDEFINES+= NET_PROTO_FCOE +.endif -# -# CON_PCBIOS CON_SERIAL \ -# CON_SYSLOG CON_SYSLOGS CON_VMWARE CON_DEBUGCON CON_VESAFB \ +.if ${PORT_OPTIONS:MDOWNLOAD_PROTO_HTTPS} +UNDEFINES+= DOWNLOAD_PROTO_HTTPS +.endif -# chande undef to define: +.if ${PORT_OPTIONS:MDOWNLOAD_PROTO_FTP} +UNDEFINES+= DOWNLOAD_PROTO_FTP +.endif -# NET_PROTO_IPV6 NET_PROTO_FCOE -# DOWNLOAD_PROTO_HTTPS DOWNLOAD_PROTO_FTP -# DOWNLOAD_PROTO_NFS +.if ${PORT_OPTIONS:MDOWNLOAD_PROTO_NFS} +UNDEFINES+= DOWNLOAD_PROTO_NFS +.endif BINLIST= bin/undionly.kpxe bin/ipxe.iso bin/ipxe.usb ALL_TARGET?= ${BINLIST} +post-configure: + ${CP} -p ${WRKSRC}/config/general.h ${WRKSRC}/config/general.h.orig + for x in ${DEFINESGENERAL} ; do \ + ${REINPLACE_CMD} -E -e "s|.*([[:space:]]$$x[[:space:]].*)|#define\1|" ${WRKSRC}/config/general.h ;\ + done + for x in ${UNDEFINES} ; do \ + ${REINPLACE_CMD} -E -e "s|.*([[:space:]]$$x[[:space:]].*)|#define\1|" ${WRKSRC}/config/general.h ;\ + done + ${CP} -p ${WRKSRC}/config/settings.h ${WRKSRC}/config/settings.h.orig + for x in ${DEFINESSETTINGS} ; do \ + ${REINPLACE_CMD} -E -e "s|.*([[:space:]]$$x[[:space:]].*)|#define\1|" ${WRKSRC}/config/settings.h ;\ + done + ${CP} -p ${WRKSRC}/config/console.h ${WRKSRC}/config/console.h.orig + for x in ${DEFINESCONSOLE} ; do \ + ${REINPLACE_CMD} -E -e "s|.*([[:space:]]$$x[[:space:]].*)|#define\1|" ${WRKSRC}/config/console.h ;\ + done + -@${DIFF} ${WRKSRC}/config/general.h.orig ${WRKSRC}/config/general.h + -@${DIFF} ${WRKSRC}/config/settings.h.orig ${WRKSRC}/config/settings.h + -@${DIFF} ${WRKSRC}/config/console.h.orig ${WRKSRC}/config/console.h + do-install: ${MKDIR} ${STAGEDIR}${DATADIR} cd ${WRKSRC} && ${INSTALL_DATA} ${BINLIST} ${STAGEDIR}${DATADIR} From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 18:54:18 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A76DC5E for ; Sat, 20 Jun 2015 18:54:18 +0000 (UTC) (envelope-from kczekirda@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88E24FDD for ; Sat, 20 Jun 2015 18:54:18 +0000 (UTC) (envelope-from kczekirda@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5KIsIg9049989 for ; Sat, 20 Jun 2015 18:54:18 GMT (envelope-from kczekirda@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5KIsHT0049985 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 18:54:17 GMT (envelope-from kczekirda@FreeBSD.org) Date: Sat, 20 Jun 2015 18:54:17 GMT Message-Id: <201506201854.t5KIsHT0049985@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to kczekirda@FreeBSD.org using -f From: kczekirda@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287390 - in soc2015/kczekirda/ipxe: . files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 18:54:18 -0000 Author: kczekirda Date: Sat Jun 20 18:54:17 2015 New Revision: 287390 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287390 Log: embeded script support and portlint WARNING fix Added: soc2015/kczekirda/ipxe/files/embedded.ipxe Modified: soc2015/kczekirda/ipxe/Makefile Modified: soc2015/kczekirda/ipxe/Makefile ============================================================================== --- soc2015/kczekirda/ipxe/Makefile Sat Jun 20 17:28:30 2015 (r287389) +++ soc2015/kczekirda/ipxe/Makefile Sat Jun 20 18:54:17 2015 (r287390) @@ -97,8 +97,8 @@ DEFINESGENERAL+= IMAGE_ELF .endif -.if ${PORT_OPTIONS:MIMAGE_MOOLTIBOOT} -DEFINESGENERAL+= IMAGE_MOOLTIBOOT +.if ${PORT_OPTIONS:MIMAGE_MULTIBOOT} +DEFINESGENERAL+= IMAGE_MULTIBOOT .endif .if ${PORT_OPTIONS:MIMAGE_PXE} @@ -217,6 +217,10 @@ UNDEFINES+= DOWNLOAD_PROTO_NFS .endif +EMBEDED_SCR= ${FILESDIR}/embedded.ipxe + +MAKE_ARGS+= EMBEDDED_IMAGE=${EMBEDED_SCR} + BINLIST= bin/undionly.kpxe bin/ipxe.iso bin/ipxe.usb ALL_TARGET?= ${BINLIST} @@ -244,7 +248,7 @@ do-install: ${MKDIR} ${STAGEDIR}${DATADIR} cd ${WRKSRC} && ${INSTALL_DATA} ${BINLIST} ${STAGEDIR}${DATADIR} -# ${INSTALL_DATA} ${EMBEDED_SCR} ${STAGEDIR}${DATADIR} + ${INSTALL_DATA} ${EMBEDED_SCR} ${STAGEDIR}${DATADIR} ${LN} -sfh ${PORTVERSION} ${STAGEDIR}${DATADIR}/VER .include Added: soc2015/kczekirda/ipxe/files/embedded.ipxe ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2015/kczekirda/ipxe/files/embedded.ipxe Sat Jun 20 18:54:17 2015 (r287390) @@ -0,0 +1,4 @@ +#!ipxe + +dhcp +shell From owner-svn-soc-all@FreeBSD.ORG Sat Jun 20 19:21:13 2015 Return-Path: Delivered-To: svn-soc-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B425FDD9 for ; Sat, 20 Jun 2015 19:21:13 +0000 (UTC) (envelope-from kczekirda@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A29FA7BB for ; Sat, 20 Jun 2015 19:21:13 +0000 (UTC) (envelope-from kczekirda@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5KJLDbM008679 for ; Sat, 20 Jun 2015 19:21:13 GMT (envelope-from kczekirda@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5KJLCg7008665 for svn-soc-all@FreeBSD.org; Sat, 20 Jun 2015 19:21:12 GMT (envelope-from kczekirda@FreeBSD.org) Date: Sat, 20 Jun 2015 19:21:12 GMT Message-Id: <201506201921.t5KJLCg7008665@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to kczekirda@FreeBSD.org using -f From: kczekirda@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287391 - soc2015/kczekirda/ipxe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Jun 2015 19:21:13 -0000 Author: kczekirda Date: Sat Jun 20 19:21:12 2015 New Revision: 287391 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287391 Log: embedded script add Modified: soc2015/kczekirda/ipxe/Makefile soc2015/kczekirda/ipxe/pkg-plist Modified: soc2015/kczekirda/ipxe/Makefile ============================================================================== --- soc2015/kczekirda/ipxe/Makefile Sat Jun 20 18:54:17 2015 (r287390) +++ soc2015/kczekirda/ipxe/Makefile Sat Jun 20 19:21:12 2015 (r287391) @@ -217,9 +217,9 @@ UNDEFINES+= DOWNLOAD_PROTO_NFS .endif -EMBEDED_SCR= ${FILESDIR}/embedded.ipxe +EMBEDDED_SCR= ${FILESDIR}/embedded.ipxe -MAKE_ARGS+= EMBEDDED_IMAGE=${EMBEDED_SCR} +MAKE_ARGS+= EMBEDDED_IMAGE=${EMBEDED_SCR} BINLIST= bin/undionly.kpxe bin/ipxe.iso bin/ipxe.usb @@ -245,10 +245,12 @@ -@${DIFF} ${WRKSRC}/config/settings.h.orig ${WRKSRC}/config/settings.h -@${DIFF} ${WRKSRC}/config/console.h.orig ${WRKSRC}/config/console.h +#INSTALL_DATA= install -m 444 + do-install: ${MKDIR} ${STAGEDIR}${DATADIR} cd ${WRKSRC} && ${INSTALL_DATA} ${BINLIST} ${STAGEDIR}${DATADIR} - ${INSTALL_DATA} ${EMBEDED_SCR} ${STAGEDIR}${DATADIR} + ${INSTALL_DATA} ${EMBEDDED_SCR} ${STAGEDIR}${DATADIR} ${LN} -sfh ${PORTVERSION} ${STAGEDIR}${DATADIR}/VER .include Modified: soc2015/kczekirda/ipxe/pkg-plist ============================================================================== --- soc2015/kczekirda/ipxe/pkg-plist Sat Jun 20 18:54:17 2015 (r287390) +++ soc2015/kczekirda/ipxe/pkg-plist Sat Jun 20 19:21:12 2015 (r287391) @@ -2,4 +2,4 @@ %%DATADIR%%/ipxe.iso %%DATADIR%%/ipxe.usb %%DATADIR%%/undionly.kpxe - +%%DATADIR%%/embedded.ipxe