From owner-freebsd-arm@FreeBSD.ORG Sat Feb 16 20:09:00 2013 Return-Path: Delivered-To: arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 36BABB04 for ; Sat, 16 Feb 2013 20:09:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 9017CAB1 for ; Sat, 16 Feb 2013 20:08:59 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.6/8.14.6) with ESMTP id r1GK8wfH057391 for ; Sat, 16 Feb 2013 13:08:58 -0700 (MST) (envelope-from ian@FreeBSD.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r1GK8arc046668; Sat, 16 Feb 2013 13:08:36 -0700 (MST) (envelope-from ian@FreeBSD.org) Subject: Re: kernel address space & auto-tuning From: Ian Lepore To: Tim Kientzle In-Reply-To: <343AF6FE-05D9-48FB-9385-7EC1A532D057@kientzle.com> References: <51192C44.1060204@rice.edu> <1361039490.1164.36.camel@revolution.hippie.lan> <511FD88E.2020403@rice.edu> <1361043297.1164.43.camel@revolution.hippie.lan> <343AF6FE-05D9-48FB-9385-7EC1A532D057@kientzle.com> Content-Type: text/plain; charset="us-ascii" Date: Sat, 16 Feb 2013 13:08:36 -0700 Message-ID: <1361045316.1164.48.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: "arm@freebsd.org" , Kostik Belousov , Alan Cox X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Feb 2013 20:09:00 -0000 On Sat, 2013-02-16 at 11:59 -0800, Tim Kientzle wrote: > >> > >>> ... It may be that the important > >>> part of the change would come next: pick better arbitrary ending > >>> addresses. > >> > >> Is the location of the register mapping something that the kernel > >> chooses? Or is it something that is passed to the kernel at boot-time? > >> > > > > As near as I can tell, it's a pretty much arbitrary choice on a per-SoC > > basis, always hard-coded with a named constant of some sort in kernel > > source code. 0xE0000000 seems to be a popular choice, with comments > > about it being the address used to bootstrap the initial devmap. That > > appears to be true for only one SoC. I think maybe there's been some > > cut and paste propagation here. > > Related to another thread, it would be nice to find > ways to get more of these per-SoC values out > of hardcoded constants. > > In this case, the FDT should give the size and physical > address of the register map. Can we use that to > determine the virtual mapping dynamically at runtime? > > Tim Conceptually, yeah, it'd just be something like 0xffffff00 - size, but the fdt_immr_addr() routine that finds the PA and size and sets things up based on them takes the desired VA as an argument. Maybe a special value could request that it calculate a VA based on the size it finds in the data. -- Ian