From owner-freebsd-arm@FreeBSD.ORG Wed Jan 31 06:25:34 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0D8B116A500 for ; Wed, 31 Jan 2007 06:25:34 +0000 (UTC) (envelope-from jhay@meraka.csir.co.za) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [146.64.24.58]) by mx1.freebsd.org (Postfix) with ESMTP id 94D5D13C428 for ; Wed, 31 Jan 2007 06:25:33 +0000 (UTC) (envelope-from jhay@meraka.csir.co.za) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973) id 5F08533CAA; Wed, 31 Jan 2007 08:01:34 +0200 (SAST) Date: Wed, 31 Jan 2007 08:01:34 +0200 From: John Hay To: freebsd-arm@freebsd.org Message-ID: <20070131060134.GA19344@zibbi.meraka.csir.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Subject: setting kernel env variables X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2007 06:25:34 -0000 Hi, I needed to be able to set the countrycode of my atheros card, but with the arm that cannot use the loader yet, I tried to add it statically with the env keyword in the kernel config file. Something like this: env "/conf/SMALL-ARM.env" and then in that file: hw.ath.countrycode="710" When that didn't work, I looked through the code and found that the arm kernel didn't use it. So I looked at how it was done on the i386 and did the same for the arm. So is this the right place to set kern_envp or is there a better place? Index: arm/xscale/ixp425/avila_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/arm/xscale/ixp425/avila_machdep.c,v retrieving revision 1.2 diff -u -r1.2 avila_machdep.c --- arm/xscale/ixp425/avila_machdep.c 6 Dec 2006 06:34:54 -0000 1.2 +++ arm/xscale/ixp425/avila_machdep.c 16 Dec 2006 10:11:16 -0000 @@ -532,6 +532,9 @@ phys_avail[i++] = 0; phys_avail[i] = 0; + if (envmode == 1) + kern_envp = static_env; + /* Do basic tuning, hz etc */ init_param1(); init_param2(physmem); John -- John Hay -- John.Hay@meraka.csir.co.za / jhay@FreeBSD.org From owner-freebsd-arm@FreeBSD.ORG Wed Jan 31 08:58:09 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 647E816A401 for ; Wed, 31 Jan 2007 08:58:09 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 025E013C48E for ; Wed, 31 Jan 2007 08:58:08 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id l0V8uQOp029581; Wed, 31 Jan 2007 01:56:26 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 31 Jan 2007 01:56:55 -0700 (MST) Message-Id: <20070131.015655.-432838507.imp@bsdimp.com> To: jhay@meraka.org.za From: "M. Warner Losh" In-Reply-To: <20070131060134.GA19344@zibbi.meraka.csir.co.za> References: <20070131060134.GA19344@zibbi.meraka.csir.co.za> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 31 Jan 2007 01:56:26 -0700 (MST) Cc: freebsd-arm@freebsd.org Subject: Re: setting kernel env variables X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2007 08:58:09 -0000 Have you tried just putting into a hints file? Warner From owner-freebsd-arm@FreeBSD.ORG Wed Jan 31 16:14:21 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 143B616A400 for ; Wed, 31 Jan 2007 16:14:21 +0000 (UTC) (envelope-from jhay@meraka.csir.co.za) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [146.64.24.58]) by mx1.freebsd.org (Postfix) with ESMTP id 8630E13C467 for ; Wed, 31 Jan 2007 16:14:20 +0000 (UTC) (envelope-from jhay@meraka.csir.co.za) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973) id 434D233CAA; Wed, 31 Jan 2007 18:14:18 +0200 (SAST) Date: Wed, 31 Jan 2007 18:14:18 +0200 From: John Hay To: "M. Warner Losh" Message-ID: <20070131161418.GA47697@zibbi.meraka.csir.co.za> References: <20070131060134.GA19344@zibbi.meraka.csir.co.za> <20070131.015655.-432838507.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070131.015655.-432838507.imp@bsdimp.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-arm@freebsd.org Subject: Re: setting kernel env variables X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2007 16:14:21 -0000 On Wed, Jan 31, 2007 at 01:56:55AM -0700, M. Warner Losh wrote: > Have you tried just putting into a hints file? Yes, but it didn't work. Should it? Are you supposed to be able to set TUNABLE_INTs through the hints mechanism? John -- John Hay -- John.Hay@meraka.csir.co.za / jhay@FreeBSD.org From owner-freebsd-arm@FreeBSD.ORG Wed Jan 31 17:23:14 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 541B916A400 for ; Wed, 31 Jan 2007 17:23:14 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 1829C13C48D for ; Wed, 31 Jan 2007 17:23:14 +0000 (UTC) (envelope-from sam@errno.com) Received: from [10.0.0.248] (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id l0VHN91l090670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 31 Jan 2007 09:23:09 -0800 (PST) (envelope-from sam@errno.com) Message-ID: <45C0D07D.5010504@errno.com> Date: Wed, 31 Jan 2007 09:23:09 -0800 From: Sam Leffler User-Agent: Thunderbird 1.5.0.8 (X11/20061115) MIME-Version: 1.0 To: John Hay References: <20070131060134.GA19344@zibbi.meraka.csir.co.za> <20070131.015655.-432838507.imp@bsdimp.com> <20070131161418.GA47697@zibbi.meraka.csir.co.za> In-Reply-To: <20070131161418.GA47697@zibbi.meraka.csir.co.za> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org Subject: Re: setting kernel env variables X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2007 17:23:14 -0000 John Hay wrote: > On Wed, Jan 31, 2007 at 01:56:55AM -0700, M. Warner Losh wrote: >> Have you tried just putting into a hints file? > > Yes, but it didn't work. Should it? Are you supposed to be able to set > TUNABLE_INTs through the hints mechanism? Not sure about this or the fix you posted but another option is a compile-time ath option to override the default countrycode. But the intent was to use tunables... Sam From owner-freebsd-arm@FreeBSD.ORG Wed Jan 31 18:00:42 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 572C816A400 for ; Wed, 31 Jan 2007 18:00:42 +0000 (UTC) (envelope-from jhay@meraka.csir.co.za) Received: from zibbi.meraka.csir.co.za (zibbi.meraka.csir.co.za [146.64.24.58]) by mx1.freebsd.org (Postfix) with ESMTP id EB84413C48E for ; Wed, 31 Jan 2007 18:00:41 +0000 (UTC) (envelope-from jhay@meraka.csir.co.za) Received: by zibbi.meraka.csir.co.za (Postfix, from userid 3973) id 2738833CB9; Wed, 31 Jan 2007 20:00:40 +0200 (SAST) Date: Wed, 31 Jan 2007 20:00:40 +0200 From: John Hay To: Sam Leffler Message-ID: <20070131180040.GA51968@zibbi.meraka.csir.co.za> References: <20070131060134.GA19344@zibbi.meraka.csir.co.za> <20070131.015655.-432838507.imp@bsdimp.com> <20070131161418.GA47697@zibbi.meraka.csir.co.za> <45C0D07D.5010504@errno.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45C0D07D.5010504@errno.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-arm@freebsd.org Subject: Re: setting kernel env variables X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2007 18:00:42 -0000 On Wed, Jan 31, 2007 at 09:23:09AM -0800, Sam Leffler wrote: > John Hay wrote: > > On Wed, Jan 31, 2007 at 01:56:55AM -0700, M. Warner Losh wrote: > >> Have you tried just putting into a hints file? > > > > Yes, but it didn't work. Should it? Are you supposed to be able to set > > TUNABLE_INTs through the hints mechanism? > > Not sure about this or the fix you posted but another option is a > compile-time ath option to override the default countrycode. But the > intent was to use tunables... Well I just copied it from i386. i386/i386/machdep.c line 2071+ looks like this: ################## if (envmode == 1) kern_envp = static_env; else if (bootinfo.bi_envp) kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE; ################## ia64, i386 and pc98 does it this way and amd64, powerpc and sparc use kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *); John -- John Hay -- John.Hay@meraka.csir.co.za / jhay@FreeBSD.org From owner-freebsd-arm@FreeBSD.ORG Wed Jan 31 22:21:52 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0110E16A402 for ; Wed, 31 Jan 2007 22:21:52 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 93B6D13C471 for ; Wed, 31 Jan 2007 22:21:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id l0VMKcfL045957; Wed, 31 Jan 2007 15:20:41 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 31 Jan 2007 15:21:08 -0700 (MST) Message-Id: <20070131.152108.1791047120.imp@bsdimp.com> To: jhay@meraka.org.za From: "M. Warner Losh" In-Reply-To: <20070131161418.GA47697@zibbi.meraka.csir.co.za> References: <20070131060134.GA19344@zibbi.meraka.csir.co.za> <20070131.015655.-432838507.imp@bsdimp.com> <20070131161418.GA47697@zibbi.meraka.csir.co.za> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 31 Jan 2007 15:20:41 -0700 (MST) Cc: freebsd-arm@freebsd.org Subject: Re: setting kernel env variables X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2007 22:21:52 -0000 In message: <20070131161418.GA47697@zibbi.meraka.csir.co.za> John Hay writes: : On Wed, Jan 31, 2007 at 01:56:55AM -0700, M. Warner Losh wrote: : > Have you tried just putting into a hints file? : : Yes, but it didn't work. Should it? Are you supposed to be able to set : TUNABLE_INTs through the hints mechanism? You should be able to, I thought.... However, your proposed change makes good sense given that other architectures do it. Warner