From owner-freebsd-arm@FreeBSD.ORG Sun Mar 16 21:44:03 2008 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E69C3106566C for ; Sun, 16 Mar 2008 21:44:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 835558FC1A for ; Sun, 16 Mar 2008 21:44:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m2GLfd49048309; Sun, 16 Mar 2008 15:41:40 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 16 Mar 2008 15:42:15 -0600 (MDT) Message-Id: <20080316.154215.1387160441.imp@bsdimp.com> To: bkoenig@alpha-tierchen.de From: "M. Warner Losh" In-Reply-To: <50161.192.168.1.2.1205540152.squirrel@webmail.alpha-tierchen.de> References: <50161.192.168.1.2.1205540152.squirrel@webmail.alpha-tierchen.de> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: arm@freebsd.org Subject: Re: defining the main clock frequency of AT91 boards 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: Sun, 16 Mar 2008 21:44:04 -0000 In message: <50161.192.168.1.2.1205540152.squirrel@webmail.alpha-tierch= en.de> Bj=F6rn_K=F6nig writes: : I would like to have a preprocessor definition called AT91C_MAIN_CLOC= K : that allows you to specify the main clock frequency of a board in the= : kernel configuration file. It avoids an intricate distinction of case= s in : at91_pmc.c:395ff and you can use the unpatched source code with board= s : that have a different quartz frequency than 10 or 16 MHz. : = : I attached a patch that deals with this issue. Users of TSC boards ne= ed to : add 'options AT91C_MAIN_CLOCK=3D16000000' to their kernel configurati= on : file. I'd go one step further. I'd require everybody to define this value since there's no 'standard' frequency and the value that's there is just the value of the boards we used for the port. It would be even better if it wasn't a #define, but a variable. There's registers that can be read to get the approximate frequency (the chip only supports one of list of something like 16 different frequencies). We should consider it and have an override for those engineers that use a non-standard frequency. Warner