From owner-freebsd-arm@FreeBSD.ORG Mon May 12 20:31:37 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 555032E0 for ; Mon, 12 May 2014 20:31:37 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 3B82F2CDA for ; Mon, 12 May 2014 20:31:36 +0000 (UTC) Received: from bender.Home (97e07ba1.skybroadband.com [151.224.123.161]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 9AE525DEC1 for ; Mon, 12 May 2014 20:31:29 +0000 (UTC) Date: Mon, 12 May 2014 21:31:21 +0100 From: Andrew Turner To: freebsd-arm@freebsd.org Subject: Early boot code changes Message-ID: <20140512213121.6765ee5e@bender.Home> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2014 20:31:37 -0000 Hello, I'm planning on committing the patch at [1]. As it affects the early boot process I would like people to review it to make sure I'm not about to break all non-Raspberry Pi boards. The patch has two parts, the first is to create a new platform infrastructure based on the PowerPC platform code. The second is to change the name of functions on platforms that do not yet use this code to make sure they still boot. The platform infrastructure is designed to help get us a GENERIC armv6 kernel. It uses kobj to select on boot which platform class to use. The intention is at some stage in the future this will be merged with the PowerPC code. To help with this there is a base class and an FDT class that inherits from this base. I have ported the bcm2835 to it already. It can be used as an example for the other platforms. Updating the other platforms shouldn't be too difficult as, at this stage, the existing initarm_* functions have a one to one mapping to the new code. Below is a simple example on using this with FDT. static platform_method_t bcm2835_methods[] = { PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), PLATFORMMETHOD_END, }; FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b"); As the platform_lastaddr functions is required it implements this, and creates the platform definition to use the bcm2835_methods with a bcm2835 platform, no softc, and will match an FDT with a compatible string of "raspberrypi,model-b". Alternatively the user could set hw.platform to "bcm2835" in loader to use this platform. As I've renamed the functions on the platforms I haven't ported to the new platform code I don' expect any problems with them. Andrew [1] http://people.freebsd.org/~andrew/arm_platform.diff