From owner-freebsd-sparc64@FreeBSD.ORG Thu Apr 14 09:26:36 2005 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7AE9916A4CE for ; Thu, 14 Apr 2005 09:26:36 +0000 (GMT) Received: from rndsoft.co.kr (michelle.rndsoft.co.kr [211.32.202.209]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6637D43D58 for ; Thu, 14 Apr 2005 09:26:35 +0000 (GMT) (envelope-from yongari@rndsoft.co.kr) Received: from yongari@rndsoft.co.kr(192.168.5.90) by MailFilter v1.05 with ESMTP Processed in 0.125353 secs; 14 Apr 2005 18:24:54 +0900 Received: from michelle.rndsoft.co.kr (localhost.rndsoft.co.kr [127.0.0.1]) j3E9Q80T004735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 14 Apr 2005 18:26:08 +0900 (KST) (envelope-from yongari@rndsoft.co.kr) Received: (from yongari@localhost) by michelle.rndsoft.co.kr (8.13.1/8.13.1/Submit) id j3E9Q8wP004734 for freebsd-sparc64@freebsd.org; Thu, 14 Apr 2005 18:26:08 +0900 (KST) (envelope-from yongari@rndsoft.co.kr) Date: Thu, 14 Apr 2005 18:26:08 +0900 From: Pyun YongHyeon To: freebsd-sparc64@freebsd.org Message-ID: <20050414092608.GB2855@michelle.rndsoft.co.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Subject: em(4) patch X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: yongari@rndsoft.co.kr List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2005 09:26:36 -0000 I have a initial patch that make em(4) work on sparc64. The patch seems to work but it may have uncovered bugs in it. The chagnges are . outl/inl -> bus_space_read/bus_space_write . 64bit IO BAR check(Obtained from OpenBSD) . add suspend/resume code(not tested) . printf -> device_printf . fix memory/resource leakages . always honor IFF_OACTIVE flag . don't blidnly call RX/TX handlers . remove EM_MAX_INTR loops . create TX dmamap at device initialization . enable PCI memory write and invalidate . EM_MMBA -> PCIR_BAR(0) . TX/RX descriptor alignment is 16 not PAGE_SIZE . TX/RX descriptor length should be multiple of 128 not 4096. . don't create MCLBYTES*8 size TX buffers if we are not use JUMBO frame . use bus_dmamap_load_mbuf_sg() for loading RX buffers. . always print watchdog timeout message(Obtained from OpenBSD) . don't count twice in some statistics(Obtained from OpenBSD) I have tested 82545GM chipset based card on Ultra60(SMP). VLAN and POLLING were not tested at all so it may have bugs. JUMBO frame support needs more coding and cleanups since sparc64 does not allow non-aligned memory access. So don't try to use JUMBO frame at this time. If you want to test em(4) on SMP with ofw_console you need additional patch. Alternatively you can use sc(4) or serial console. I'd like to hear success/failure. em patch: http://www.kr.freebsd.org/~yongari/em.patch.0414 ofw_console patch: http://www.kr.freebsd.org/~yongari/ofw_console.patch.0414 Thanks. -- Regards, Pyun YongHyeon http://www.kr.freebsd.org/~yongari | yongari@freebsd.org