From owner-freebsd-arm@FreeBSD.ORG Mon Mar 31 15:58:24 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 DF9F9106564A for ; Mon, 31 Mar 2008 15:58:24 +0000 (UTC) (envelope-from qdk@quickdekay.net) Received: from hatert.nijmegen.internl.net (mailrelay1.nijmegen.internl.net [217.149.192.44]) by mx1.freebsd.org (Postfix) with ESMTP id 95F888FC27 for ; Mon, 31 Mar 2008 15:58:24 +0000 (UTC) (envelope-from qdk@quickdekay.net) Received: from smtp20.nijmegen.internl.net by hatert.nijmegen.internl.net via smtp20.nijmegen.internl.net [217.149.192.18] with ESMTP for id m2VE2d91015104 (8.13.6/2.04); Mon, 31 Mar 2008 16:02:40 +0200 (MEST) Received: from [172.16.17.100] (waalbrug.nijmegen.internl.net [217.149.192.5]) by smtp20.nijmegen.internl.net (8.13.8/2.04) with ESMTP id m2VE2aXx026840 for ; Mon, 31 Mar 2008 16:02:37 +0200 (CEST) Message-ID: <47F0EED2.60303@quickdekay.net> Date: Mon, 31 Mar 2008 16:01:54 +0200 From: K Staring User-Agent: Thunderbird 1.5.0.14 (Macintosh/20071210) MIME-Version: 1.0 To: arm@freebsd.org Content-Type: multipart/mixed; boundary="------------030705080300040409030004" Cc: Subject: Porting FreeBSD to Atmel at91sam9263 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: Mon, 31 Mar 2008 15:58:25 -0000 This is a multi-part message in MIME format. --------------030705080300040409030004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I'm trying to get FreeBSD to boot from an Atmel 9263 based board. I suppose the porting process isn't that much trouble, as the Atmel 9261 seems to be supported. The bootloader used is u-boot. As far as I can see, the Atmel 9263 is mostly identical to the 9261, but the memory mapping of the integrated devices differ. So to start with, I created an extra hints file with the correct offsets for the devices (and use that hints file in the kernel conf). This clearly wasn't enough; I didn't get any output. Next, I tried compiling some simple code, like printing a character to the USB serial device (offset 0xffffee00 + 28) and jumping to 0x0 to reboot. This worked ok. Using the jump-to-0x0 trick (ldr r0, =0 ; mov pc, r0) I was able to boot and reboot the kernel up to the mmu enable code at Lunmapped: in locore.S (STARTUP_PAGETABLE_ADDR is defined). After this point, the board didn't reboot. Which is understandable since the mmu won't allow it. However, adding this line at the start of mmu_init_table didn't improve anything, the board still doesn't seem to reboot. MMU_INIT(0x0, 0x0 , 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) Another possibility is that u-boot doens't expect the mmu to be active and causes a protection fault itself. Can anyone give me pointers for possible next steps to try? It looks like the hints files isn't used by some of the code in the at91 directory, is this correct? Would editing at91rm92reg.h be more useful? I'm using FreeBSD 8. Thanks for any advice, Khamba -- (src/sys/arm/at91/std.a9263) include "../at91/std.at91" files "../at91/files.kb920x" makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 options STARTUP_PAGETABLE_ADDR=0x20800000 options PHYSADDR=0x20000000 -- -- (boot with u-boot) tftp 20000000 kernel go 200000e0 -- --------------030705080300040409030004 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="hints.at91sam9263" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hints.at91sam9263" # These are the wiring for the at91sam9263. These are the built-in devices # for that cpu. # DBGU is unit 0 hint.uart.0.at="apb" hint.uart.0.maddr="0xffffee00" hint.uart.0.flags=0x10 # USART0 is unit 1 hint.uart.1.at="apb" hint.uart.1.maddr="0xfff8c000" # USART1 is unit 2 hint.uart.2.at="apb" hint.uart.2.maddr="0xfff90000" # USART2 is unit 3 hint.uart.3.at="apb" hint.uart.3.maddr="0xfff94000" # SSC0 is unit 4 hint.uart.4.at="apb" hint.uart.4.maddr="0xfff98000" # SSC1 is unit 5 hint.uart.5.at="apb" hint.uart.5.maddr="0xfff9c000" # TC0, TC1, TC2 hint.tc.0.at="apb" hint.tc.0.maddr="0xfff7c000" # USB Device hint.udp.0.at="apb" hint.udp.0.maddr="0xfff78000" # MCI0 hint.mci.0.at="apb" hint.mci.0.maddr="0xfff80000" # MCI1 hint.mci.1.at="apb" hint.mci.1.maddr="0xfff84000" # TWI hint.twi.0.at="apb" hint.twi.0.maddr="0xfff88000" # SSC0 hint.ssc.0.at="apb" hint.ssc.0.maddr="0xfff98000" # SSC1 hint.ssc.1.at="apb" hint.ssc.1.maddr="0xfff9c000" # SPI0 hint.spi.0.at="apb" hint.spi.0.maddr="0xfffa4000" # SSC1 hint.spi.1.at="apb" hint.spi.1.maddr="0xfff9c000" # PMC hint.pmc.0.at="apb" hint.pmc.0.maddr="0xfffffc00" # USB host (ohci) #??? maybe this needs to be on asb instead of apb hint.ohci.at="apb" hint.ohci.maddr="0x00500000" # LCD controller hint.atlcd.at="apb" hint.atlcd.maddr="0x00600000" --------------030705080300040409030004-- From owner-freebsd-arm@FreeBSD.ORG Mon Mar 31 16:02:41 2008 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A045D1065670 for ; Mon, 31 Mar 2008 16:02:41 +0000 (UTC) (envelope-from qdk@quickdekay.net) Received: from hatert.nijmegen.internl.net (mailrelay1.nijmegen.internl.net [217.149.192.44]) by mx1.freebsd.org (Postfix) with ESMTP id 57B128FC1B for ; Mon, 31 Mar 2008 16:02:41 +0000 (UTC) (envelope-from qdk@quickdekay.net) Received: from smtp20.nijmegen.internl.net by hatert.nijmegen.internl.net via smtp20.nijmegen.internl.net [217.149.192.18] with ESMTP for id m2VFKxt6027763 (8.13.6/2.04); Mon, 31 Mar 2008 17:20:59 +0200 (MEST) Received: from [172.16.17.100] (waalbrug.nijmegen.internl.net [217.149.192.5]) by smtp20.nijmegen.internl.net (8.13.8/2.04) with ESMTP id m2VFKvgl018580 for ; Mon, 31 Mar 2008 17:20:58 +0200 (CEST) Message-ID: <47F10137.5070104@quickdekay.net> Date: Mon, 31 Mar 2008 17:20:23 +0200 From: K Staring User-Agent: Thunderbird 1.5.0.14 (Macintosh/20071210) MIME-Version: 1.0 To: freebsd-arm@freebsd.org Content-Type: multipart/mixed; boundary="------------030506020707060206060306" Subject: Porting FreeBSD to Atmel at91sam9263 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: Mon, 31 Mar 2008 16:02:41 -0000 This is a multi-part message in MIME format. --------------030506020707060206060306 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, I'm trying to get FreeBSD to boot from an Atmel 9263 based board. I suppose the porting process isn't that much trouble, as the Atmel 9261 seems to be supported. The bootloader used is u-boot. As far as I can see, the Atmel 9263 is mostly identical to the 9261, but the memory mapping of the integrated devices differ. So to start with, I created an extra hints file with the correct offsets for the devices (and use that hints file in the kernel conf). This clearly wasn't enough; I didn't get any output. Next, I tried compiling some simple code, like printing a character to the USB serial device (offset 0xffffee00 + 28) and jumping to 0x0 to reboot. This worked ok. Using the jump-to-0x0 trick (ldr r0, =0 ; mov pc, r0) I was able to boot and reboot the kernel up to the mmu enable code at Lunmapped: in locore.S (STARTUP_PAGETABLE_ADDR is defined). After this point, the board didn't reboot. Which is understandable since the mmu won't allow it. However, adding this line at the start of mmu_init_table didn't improve anything, the board still doesn't seem to reboot. MMU_INIT(0x0, 0x0 , 64, L1_TYPE_S|L1_S_C|L1_S_AP(AP_KRW)) Another possibility is that u-boot doens't expect the mmu to be active and causes a protection fault itself. Can anyone give me pointers for possible next steps to try? It looks like the hints files isn't used by some of the code in the at91 directory, is this correct? Would editing at91rm92reg.h be more useful? I'm using FreeBSD 8. Thanks for any advice, Khamba -- (src/sys/arm/at91/std.a9263) include "../at91/std.at91" files "../at91/files.kb920x" makeoptions KERNPHYSADDR=0x20000000 makeoptions KERNVIRTADDR=0xc0000000 options KERNPHYSADDR=0x20000000 options KERNVIRTADDR=0xc0000000 options STARTUP_PAGETABLE_ADDR=0x20800000 options PHYSADDR=0x20000000 -- -- (boot with u-boot) tftp 20000000 kernel go 200000e0 -- --------------030506020707060206060306 Content-Type: text/plain; x-mac-type="656E2E79"; x-mac-creator="65532F74"; name="hints.at91sam9263" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hints.at91sam9263" # These are the wiring for the at91sam9263. These are the built-in devices # for that cpu. # DBGU is unit 0 hint.uart.0.at="apb" hint.uart.0.maddr="0xffffee00" hint.uart.0.flags=0x10 # USART0 is unit 1 hint.uart.1.at="apb" hint.uart.1.maddr="0xfff8c000" # USART1 is unit 2 hint.uart.2.at="apb" hint.uart.2.maddr="0xfff90000" # USART2 is unit 3 hint.uart.3.at="apb" hint.uart.3.maddr="0xfff94000" # SSC0 is unit 4 hint.uart.4.at="apb" hint.uart.4.maddr="0xfff98000" # SSC1 is unit 5 hint.uart.5.at="apb" hint.uart.5.maddr="0xfff9c000" # TC0, TC1, TC2 hint.tc.0.at="apb" hint.tc.0.maddr="0xfff7c000" # USB Device hint.udp.0.at="apb" hint.udp.0.maddr="0xfff78000" # MCI0 hint.mci.0.at="apb" hint.mci.0.maddr="0xfff80000" # MCI1 hint.mci.1.at="apb" hint.mci.1.maddr="0xfff84000" # TWI hint.twi.0.at="apb" hint.twi.0.maddr="0xfff88000" # SSC0 hint.ssc.0.at="apb" hint.ssc.0.maddr="0xfff98000" # SSC1 hint.ssc.1.at="apb" hint.ssc.1.maddr="0xfff9c000" # SPI0 hint.spi.0.at="apb" hint.spi.0.maddr="0xfffa4000" # SSC1 hint.spi.1.at="apb" hint.spi.1.maddr="0xfff9c000" # PMC hint.pmc.0.at="apb" hint.pmc.0.maddr="0xfffffc00" # USB host (ohci) #??? maybe this needs to be on asb instead of apb hint.ohci.at="apb" hint.ohci.maddr="0x00500000" # LCD controller hint.atlcd.at="apb" hint.atlcd.maddr="0x00600000" --------------030506020707060206060306-- From owner-freebsd-arm@FreeBSD.ORG Mon Mar 31 18:13:56 2008 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D486106564A for ; Mon, 31 Mar 2008 18:13:56 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 2CBCE8FC26 for ; Mon, 31 Mar 2008 18:13:55 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id m2VHkMF0010666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 31 Mar 2008 19:46:23 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id m2VHkEMn005176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 31 Mar 2008 19:46:15 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id m2VHkEZh024752; Mon, 31 Mar 2008 19:46:14 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id m2VHkEXK024751; Mon, 31 Mar 2008 19:46:14 +0200 (CEST) (envelope-from ticso) Date: Mon, 31 Mar 2008 19:46:14 +0200 From: Bernd Walter To: K Staring Message-ID: <20080331174613.GG15954@cicely12.cicely.de> References: <47F10137.5070104@quickdekay.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47F10137.5070104@quickdekay.net> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, BAYES_00=-2.599 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on cicely12.cicely.de Cc: freebsd-arm@freebsd.org Subject: Re: Porting FreeBSD to Atmel at91sam9263 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2008 18:13:56 -0000 On Mon, Mar 31, 2008 at 05:20:23PM +0200, K Staring wrote: > Hi, > > I'm trying to get FreeBSD to boot from an Atmel 9263 based board. > I suppose the porting process isn't that much trouble, as the Atmel 9261 > seems to be supported. The bootloader used is u-boot. We don't support the 9261, we only support the RM9200. There are many differences to consider, for example the ethernet and MCI controller are different between the RM9200 and the SAM9. But also many clock related things need to be taken care of. So without setting the MCK correctly I assume your DBGU bps rate will be wrong. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. From owner-freebsd-arm@FreeBSD.ORG Tue Apr 1 17:48:45 2008 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E27451065670 for ; Tue, 1 Apr 2008 17:48:45 +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 A379B8FC2E for ; Tue, 1 Apr 2008 17:48:45 +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 m31HjwXA090245; Tue, 1 Apr 2008 11:45:58 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Tue, 01 Apr 2008 11:46:45 -0600 (MDT) Message-Id: <20080401.114645.-432836986.imp@bsdimp.com> To: ticso@cicely.de, ticso@cicely12.cicely.de From: "M. Warner Losh" In-Reply-To: <20080331174613.GG15954@cicely12.cicely.de> References: <47F10137.5070104@quickdekay.net> <20080331174613.GG15954@cicely12.cicely.de> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-arm@FreeBSD.org Subject: Re: Porting FreeBSD to Atmel at91sam9263 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: Tue, 01 Apr 2008 17:48:46 -0000 In message: <20080331174613.GG15954@cicely12.cicely.de> Bernd Walter writes: : On Mon, Mar 31, 2008 at 05:20:23PM +0200, K Staring wrote: : > Hi, : > : > I'm trying to get FreeBSD to boot from an Atmel 9263 based board. : > I suppose the porting process isn't that much trouble, as the Atmel 9261 : > seems to be supported. The bootloader used is u-boot. : : We don't support the 9261, we only support the RM9200. : There are many differences to consider, for example the ethernet and : MCI controller are different between the RM9200 and the SAM9. : But also many clock related things need to be taken care of. : So without setting the MCK correctly I assume your DBGU bps rate will : be wrong. The SAM9's also use a slightly newer core that needs support merged from the p4 tree. This is also a variation of stuff needed for the orion port that's coming soon. Stay tuned. Warner From owner-freebsd-arm@FreeBSD.ORG Wed Apr 2 11:40:42 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 7B2DA106566C; Wed, 2 Apr 2008 11:40:42 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [64.7.153.18]) by mx1.freebsd.org (Postfix) with ESMTP id 308458FC15; Wed, 2 Apr 2008 11:40:41 +0000 (UTC) (envelope-from tinderbox@freebsd.org) Received: from smtp2.sentex.ca (smtp2c.sentex.ca [64.7.153.30]) by smarthost1.sentex.ca (8.14.2/8.14.2) with ESMTP id m32BefYv064334; Wed, 2 Apr 2008 07:40:41 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: from freebsd-current.sentex.ca (freebsd-current.sentex.ca [64.7.128.98]) by smtp2.sentex.ca (8.14.2/8.14.2) with ESMTP id m32BefwH077510; Wed, 2 Apr 2008 07:40:41 -0400 (EDT) (envelope-from tinderbox@freebsd.org) Received: by freebsd-current.sentex.ca (Postfix, from userid 666) id 21D2273039; Wed, 2 Apr 2008 06:40:41 -0500 (EST) Sender: FreeBSD Tinderbox From: FreeBSD Tinderbox To: FreeBSD Tinderbox , , Precedence: bulk Message-Id: <20080402114041.21D2273039@freebsd-current.sentex.ca> Date: Wed, 2 Apr 2008 06:40:41 -0500 (EST) X-Virus-Scanned: ClamAV 0.92.1/6526/Tue Apr 1 08:33:51 2008 clamav-milter version 0.92.1 on clamscanner2 X-Virus-Status: Clean Cc: Subject: [head tinderbox] failure on arm/arm X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Apr 2008 11:40:42 -0000 TB --- 2008-04-02 11:25:00 - tinderbox 2.3 running on freebsd-current.sentex.ca TB --- 2008-04-02 11:25:00 - starting HEAD tinderbox run for arm/arm TB --- 2008-04-02 11:25:00 - cleaning the object tree TB --- 2008-04-02 11:25:26 - cvsupping the source tree TB --- 2008-04-02 11:25:26 - /usr/bin/csup -r 3 -g -L 1 -h localhost -s /tinderbox/HEAD/arm/arm/supfile TB --- 2008-04-02 11:25:33 - building world (CFLAGS=-O -pipe) TB --- 2008-04-02 11:25:33 - cd /src TB --- 2008-04-02 11:25:33 - /usr/bin/make -B buildworld >>> World build started on Wed Apr 2 11:25:36 UTC 2008 >>> Rebuilding the temporary build tree >>> stage 1.1: legacy release compatibility shims >>> stage 1.2: bootstrap tools >>> stage 2.1: cleaning up the object tree >>> stage 2.2: rebuilding the object tree >>> stage 2.3: build tools >>> stage 3: cross tools >>> stage 4.1: building includes >>> stage 4.2: building libraries [...] rm -f .depend mkdep -f .depend -a -DPTHREAD_KERNEL -I/src/lib/libthr/../libc/include -I/src/lib/libthr/thread -I/src/lib/libthr/../../include -I/src/lib/libthr/arch/arm/include -I/src/lib/libthr/sys -I/src/lib/libthr/../../libexec/rtld-elf -I/src/lib/libthr/../../libexec/rtld-elf/arm -I/src/lib/libthr/../libthread_db -D_PTHREADS_INVARIANTS /src/lib/libthr/arch/arm/arm/pthread_md.c /src/lib/libthr/sys/thr_error.c /src/lib/libthr/thread/thr_affinity.c /src/lib/libthr/thread/thr_attr.c /src/lib/libthr/thread/thr_barrier.c /src/lib/libthr/thread/thr_barrierattr.c /src/lib/libthr/thread/thr_cancel.c /src/lib/libthr/thread/thr_clean.c /src/lib/libthr/thread/thr_concurrency.c /src/lib/libthr/thread/thr_cond.c /src/lib/libthr/thread/thr_condattr.c /src/lib/libthr/thread/thr_create.c /src/lib/libthr/thread/thr_detach.c /src/lib/libthr/thread/thr_equal.c /src/lib/libthr/thread/thr_event.c /src/lib/libthr/thread/thr_exit.c /src/lib/libthr/thread/thr_fork.c /src/lib/libthr/thread/thr_getprio.c /src /lib/libthr/thread/thr_getcpuclockid.c /src/lib/libthr/thread/thr_getschedparam.c /src/lib/libthr/thread/thr_info.c /src/lib/libthr/thread/thr_init.c /src/lib/libthr/thread/thr_join.c /src/lib/libthr/thread/thr_list.c /src/lib/libthr/thread/thr_kern.c /src/lib/libthr/thread/thr_kill.c /src/lib/libthr/thread/thr_main_np.c /src/lib/libthr/thread/thr_multi_np.c /src/lib/libthr/thread/thr_mutex.c /src/lib/libthr/thread/thr_mutexattr.c /src/lib/libthr/thread/thr_once.c /src/lib/libthr/thread/thr_printf.c /src/lib/libthr/thread/thr_pspinlock.c /src/lib/libthr/thread/thr_resume_np.c /src/lib/libthr/thread/thr_rtld.c /src/lib/libthr/thread/thr_rwlock.c /src/lib/libthr/thread/thr_rwlockattr.c /src/lib/libthr/thread/thr_self.c /src/lib/libthr/thread/thr_sem.c /src/lib/libthr/thread/thr_setprio.c /src/lib/libthr/thread/thr_setschedparam.c /src/lib/libthr/thread/thr_sig.c /src/lib/libthr/thread/thr_single_np.c /src/lib/libthr/thread/thr_spec.c /src/lib/libthr/thread/thr_spinlock.c /src/ lib/libthr/thread/thr_stack.c /src/lib/libthr/thread/thr_syscalls.c /src/lib/libthr/thread/thr_suspend_np.c /src/lib/libthr/thread/thr_switch_np.c /src/lib/libthr/thread/thr_symbols.c /src/lib/libthr/thread/thr_umtx.c /src/lib/libthr/thread/thr_yield.c cc -O -pipe -DPTHREAD_KERNEL -I/src/lib/libthr/../libc/include -I/src/lib/libthr/thread -I/src/lib/libthr/../../include -I/src/lib/libthr/arch/arm/include -I/src/lib/libthr/sys -I/src/lib/libthr/../../libexec/rtld-elf -I/src/lib/libthr/../../libexec/rtld-elf/arm -I/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /src/lib/libthr/arch/arm/arm/pthread_md.c cc -O -pipe -DPTHREAD_KERNEL -I/src/lib/libthr/../libc/include -I/src/lib/libthr/thread -I/src/lib/libthr/../../include -I/src/lib/libthr/arch/arm/include -I/src/lib/libthr/sys -I/src/lib/libthr/../../libexec/rtld-elf -I/src/lib/libthr/../../libexec/rtld-elf/arm -I/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /src/lib/libthr/sys/thr_error.c cc -O -pipe -DPTHREAD_KERNEL -I/src/lib/libthr/../libc/include -I/src/lib/libthr/thread -I/src/lib/libthr/../../include -I/src/lib/libthr/arch/arm/include -I/src/lib/libthr/sys -I/src/lib/libthr/../../libexec/rtld-elf -I/src/lib/libthr/../../libexec/rtld-elf/arm -I/src/lib/libthr/../libthread_db -Winline -D_PTHREADS_INVARIANTS -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /src/lib/libthr/thread/thr_affinity.c cc1: warnings being treated as errors /src/lib/libthr/thread/thr_affinity.c:43: warning: no previous prototype for '_pthread_setaffinity_np' /src/lib/libthr/thread/thr_affinity.c:71: warning: no previous prototype for '_pthread_getaffinity_np' *** Error code 1 Stop in /src/lib/libthr. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2008-04-02 11:40:41 - WARNING: /usr/bin/make returned exit code 1 TB --- 2008-04-02 11:40:41 - ERROR: failed to build world TB --- 2008-04-02 11:40:41 - tinderbox aborted TB --- 682.34 user 93.87 system 940.66 real http://tinderbox.des.no/tinderbox-head-HEAD-arm-arm.full From owner-freebsd-arm@FreeBSD.ORG Thu Apr 3 07:50:31 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 B9BD71065673 for ; Thu, 3 Apr 2008 07:50:31 +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 29E358FC24 for ; Thu, 3 Apr 2008 07:50:31 +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 m337mngd024821 for ; Thu, 3 Apr 2008 01:48:49 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 03 Apr 2008 01:49:38 -0600 (MDT) Message-Id: <20080403.014938.709397886.imp@bsdimp.com> To: arm@freebsd.org From: "M. Warner Losh" X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Tiny cleanup 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: Thu, 03 Apr 2008 07:50:31 -0000 I've moved all the fake_preload[] initialization to one function, and changed all the machdep's in the tree to use it. All the copies were the same, as far as I could tell. Well, there were a few minor differences that I think were either the results of code drift, or were different ways to lexically spell KERNVIRTADDR. Please review this patch and let me know what you think. Comments? Warner Index: arm/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/arm/arm/machdep.c,v retrieving revision 1.29 diff -u -r1.29 machdep.c --- arm/machdep.c 16 Mar 2008 10:58:02 -0000 1.29 +++ arm/machdep.c 3 Apr 2008 07:48:17 -0000 @@ -43,6 +43,8 @@ */ #include "opt_compat.h" +#include "opt_ddb.h" + #include __FBSDID("$FreeBSD: src/sys/arm/arm/machdep.c,v 1.29 2008/03/16 10:58:02 rwatson Exp $"); @@ -101,6 +103,11 @@ int _min_memcpy_size = 0; int _min_bzero_size = 0; +extern int *end; +#ifdef DDB +extern vm_offset_t ksym_start, ksym_end; +#endif + void sendsig(catcher, ksi, mask) sig_t catcher; @@ -631,3 +638,53 @@ pcb->un_32.pcb32_lr = tf->tf_usr_lr; pcb->un_32.pcb32_sp = tf->tf_usr_sp; } + +/* + * Fake up a boot descriptor table + */ +vm_offset_t +fake_preload_metadata(void) +{ +#ifdef DDB + vm_offset_t zstart = 0, zend = 0; +#endif + vm_offset_t lastaddr; + int i = 0; + static uint32_t fake_preload[35]; + + fake_preload[i++] = MODINFO_NAME; + fake_preload[i++] = strlen("elf kernel") + 1; + strcpy((char*)&fake_preload[i++], "elf kernel"); + i += 2; + fake_preload[i++] = MODINFO_TYPE; + fake_preload[i++] = strlen("elf kernel") + 1; + strcpy((char*)&fake_preload[i++], "elf kernel"); + i += 2; + fake_preload[i++] = MODINFO_ADDR; + fake_preload[i++] = sizeof(vm_offset_t); + fake_preload[i++] = KERNVIRTADDR; + fake_preload[i++] = MODINFO_SIZE; + fake_preload[i++] = sizeof(uint32_t); + fake_preload[i++] = (uint32_t)&end - KERNVIRTADDR; +#ifdef DDB + if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) { + fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM; + fake_preload[i++] = sizeof(vm_offset_t); + fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4); + fake_preload[i++] = MODINFO_METADATA|MODINFOMD_ESYM; + fake_preload[i++] = sizeof(vm_offset_t); + fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 8); + lastaddr = *(uint32_t *)(KERNVIRTADDR + 8); + zend = lastaddr; + zstart = *(uint32_t *)(KERNVIRTADDR + 4); + ksym_start = zstart; + ksym_end = zend; + } else +#endif + lastaddr = (vm_offset_t)&end; + fake_preload[i++] = 0; + fake_preload[i] = 0; + preload_metadata = (void *)fake_preload; + + return (lastaddr); +} Index: at91/kb920x_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/arm/at91/kb920x_machdep.c,v retrieving revision 1.29 diff -u -r1.29 kb920x_machdep.c --- at91/kb920x_machdep.c 3 Apr 2008 06:07:45 -0000 1.29 +++ at91/kb920x_machdep.c 3 Apr 2008 07:48:18 -0000 @@ -44,7 +44,6 @@ */ #include "opt_msgbuf.h" -#include "opt_ddb.h" #include "opt_at91.h" #include @@ -187,12 +186,6 @@ } }; -#define SDRAM_START 0xa0000000 - -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - static long ramsize(void) { @@ -257,58 +250,15 @@ initarm(void *arg, void *arg2) { struct pv_addr kernel_l1pt; - int loop; + int loop, i; u_int l1pagetable; vm_offset_t freemempos; vm_offset_t afterkern; - int i; - uint32_t fake_preload[35]; uint32_t memsize; vm_offset_t lastaddr; -#ifdef DDB - vm_offset_t zstart = 0, zend = 0; -#endif - - i = 0; set_cpufuncs(); - - fake_preload[i++] = MODINFO_NAME; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_TYPE; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_ADDR; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = KERNVIRTADDR; - fake_preload[i++] = MODINFO_SIZE; - fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = (uint32_t)&end - KERNVIRTADDR; -#ifdef DDB - if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) { - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4); - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_ESYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 8); - lastaddr = *(uint32_t *)(KERNVIRTADDR + 8); - zend = lastaddr; - zstart = *(uint32_t *)(KERNVIRTADDR + 4); - ksym_start = zstart; - ksym_end = zend; - } else -#endif - lastaddr = (vm_offset_t)&end; - - fake_preload[i++] = 0; - fake_preload[i] = 0; - preload_metadata = (void *)fake_preload; - - + lastaddr = fake_preload_metadata(); pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); @@ -367,7 +317,7 @@ pmap_link_l2pt(l1pagetable, KERNBASE + i * 0x100000, &kernel_pt_table[KERNEL_PT_KERN + i]); pmap_map_chunk(l1pagetable, KERNBASE, PHYSADDR, - (((uint32_t)(lastaddr) - KERNBASE) + PAGE_SIZE) & ~(PAGE_SIZE - 1), + (((uint32_t)lastaddr - KERNBASE) + PAGE_SIZE) & ~(PAGE_SIZE - 1), VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); afterkern = round_page((lastaddr + L1_S_SIZE) & ~(L1_S_SIZE - 1)); Index: include/machdep.h =================================================================== RCS file: /home/ncvs/src/sys/arm/include/machdep.h,v retrieving revision 1.2 diff -u -r1.2 machdep.h --- include/machdep.h 26 Feb 2005 18:59:01 -0000 1.2 +++ include/machdep.h 3 Apr 2008 07:48:18 -0000 @@ -5,11 +5,11 @@ #define _MACHDEP_BOOT_MACHDEP_H_ /* misc prototypes used by the many arm machdeps */ -void halt (void); -void data_abort_handler (trapframe_t *); -void prefetch_abort_handler (trapframe_t *); -void undefinedinstruction_bounce (trapframe_t *); - void arm_lock_cache_line(vm_offset_t); +vm_offset_t fake_preload_metadata(void); +void halt(void); +void data_abort_handler(trapframe_t *); +void prefetch_abort_handler(trapframe_t *); +void undefinedinstruction_bounce(trapframe_t *); #endif /* !_MACHINE_MACHDEP_H_ */ Index: sa11x0/assabet_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/arm/sa11x0/assabet_machdep.c,v retrieving revision 1.22 diff -u -r1.22 assabet_machdep.c --- sa11x0/assabet_machdep.c 5 Nov 2007 11:36:10 -0000 1.22 +++ sa11x0/assabet_machdep.c 3 Apr 2008 07:48:18 -0000 @@ -217,58 +217,25 @@ u_int l1pagetable; vm_offset_t freemempos; vm_offset_t lastalloced; + vm_offset_t lastaddr; vm_size_t pt_size; - int i = 0; - uint32_t fake_preload[35]; uint32_t memsize = 32 * 1024 * 1024; sa1110_uart_vaddr = SACOM1_VBASE; boothowto = RB_VERBOSE | RB_SINGLE; cninit(); set_cpufuncs(); - fake_preload[i++] = MODINFO_NAME; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_TYPE; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_ADDR; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = KERNBASE; - fake_preload[i++] = MODINFO_SIZE; - fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = (uint32_t)&end - KERNBASE; - fake_preload[i++] = MODINFO_NAME; - fake_preload[i++] = strlen("md root") + 1; - strcpy((char*)&fake_preload[i++], "md root"); - i += 1; - fake_preload[i++] = MODINFO_TYPE; - fake_preload[i++] = strlen("md_image") + 1; - strcpy((char*)&fake_preload[i++], "md_image"); - i += 2; - fake_preload[i++] = MODINFO_ADDR; - fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = MDROOT_ADDR; - fake_preload[i++] = MODINFO_SIZE; - fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = MD_ROOT_SIZE * 1024; - fake_preload[i++] = 0; - fake_preload[i] = 0; - preload_metadata = (void *)fake_preload; - + lastaddr = fake_reload_metadata(); physmem = memsize / PAGE_SIZE; pc = &__pcpu; pcpu_init(pc, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); physical_start = (vm_offset_t) KERNBASE; - physical_end = (vm_offset_t) &end; + physical_end = lastaddr; physical_freestart = (((vm_offset_t)physical_end) + PAGE_MASK) & ~PAGE_MASK; md_addr.pv_va = md_addr.pv_pa = MDROOT_ADDR; -#define KERNEL_TEXT_BASE (KERNBASE + 0x00040000) - kerneldatasize = (u_int32_t)&end - (u_int32_t)KERNEL_TEXT_BASE; + kerneldatasize = (u_int32_t)&end - (u_int32_t)KERNVIRTADDR; symbolsize = 0; freemempos = (vm_offset_t)round_page(physical_freestart); memset((void *)freemempos, 0, 256*1024); @@ -348,7 +315,8 @@ pmap_link_l2pt(l1pagetable, KERNEL_VM_BASE + loop * 0x00100000, &kernel_pt_table[KERNEL_PT_VMDATA + loop]); pmap_map_chunk(l1pagetable, KERNBASE, KERNBASE, - ((uint32_t)&end - KERNBASE), VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + ((uint32_t)lastaddr - KERNBASE), VM_PROT_READ|VM_PROT_WRITE, + PTE_CACHE); /* Map the stack pages */ pmap_map_chunk(l1pagetable, irqstack.pv_va, irqstack.pv_pa, IRQ_STACK_SIZE * PAGE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); @@ -403,8 +371,6 @@ set_stackptr(PSR_UND32_MODE, undstack.pv_va + UND_STACK_SIZE * PAGE_SIZE); - - /* * We must now clean the cache again.... * Cleaning may be done by reading new data to displace any @@ -417,7 +383,6 @@ */ cpu_idcache_wbinv_all(); - bootverbose = 1; /* Set stack for exception handlers */ @@ -443,8 +408,7 @@ dump_avail[3] = phys_avail[3] = 0; mutex_init(); - pmap_bootstrap(freemempos, - 0xd0000000, &kernel_l1pt); + pmap_bootstrap(freemempos, 0xd0000000, &kernel_l1pt); /* Do basic tuning, hz etc */ init_param1(); Index: xscale/i80321/ep80219_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/arm/xscale/i80321/ep80219_machdep.c,v retrieving revision 1.8 diff -u -r1.8 ep80219_machdep.c --- xscale/i80321/ep80219_machdep.c 5 Nov 2007 11:36:10 -0000 1.8 +++ xscale/i80321/ep80219_machdep.c 3 Apr 2008 07:48:18 -0000 @@ -46,7 +46,6 @@ */ #include "opt_msgbuf.h" -#include "opt_ddb.h" #include __FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/ep80219_machdep.c,v 1.8 2007/11/05 11:36:10 kib Exp $"); @@ -186,10 +185,6 @@ } }; -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - extern vm_offset_t xscale_cache_clean_addr; void * @@ -203,56 +198,13 @@ vm_offset_t afterkern; vm_offset_t freemem_after; vm_offset_t lastaddr; -#ifdef DDB - vm_offset_t zstart = 0, zend = 0; -#endif - int i = 0; - uint32_t fake_preload[35]; uint32_t memsize, memstart; - i = 0; - set_cpufuncs(); - fake_preload[i++] = MODINFO_NAME; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_TYPE; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_ADDR; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = KERNBASE + 0x00200000; - fake_preload[i++] = MODINFO_SIZE; - fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = (uint32_t)&end - KERNBASE - 0x00200000; -#ifdef DDB - if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) { - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4); - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_ESYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 8); - lastaddr = *(uint32_t *)(KERNVIRTADDR + 8); - zend = lastaddr; - zstart = *(uint32_t *)(KERNVIRTADDR + 4); - ksym_start = zstart; - ksym_end = zend; - } else -#endif - lastaddr = (vm_offset_t)&end; - - fake_preload[i++] = 0; - fake_preload[i] = 0; - preload_metadata = (void *)fake_preload; - - + lastaddr = fake_reload_metadata(); pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); -#define KERNEL_TEXT_BASE (KERNBASE + 0x00200000) freemempos = 0xa0200000; /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ @@ -437,9 +389,6 @@ /* Enable MMU, I-cache, D-cache, write buffer. */ arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - - - pmap_curmaxkvaddr = afterkern + PAGE_SIZE; dump_avail[0] = 0xa0000000; dump_avail[1] = 0xa0000000 + memsize; Index: xscale/i80321/iq31244_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/arm/xscale/i80321/iq31244_machdep.c,v retrieving revision 1.29 diff -u -r1.29 iq31244_machdep.c --- xscale/i80321/iq31244_machdep.c 5 Nov 2007 11:36:10 -0000 1.29 +++ xscale/i80321/iq31244_machdep.c 3 Apr 2008 07:48:18 -0000 @@ -46,7 +46,6 @@ */ #include "opt_msgbuf.h" -#include "opt_ddb.h" #include __FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.29 2007/11/05 11:36:10 kib Exp $"); @@ -187,10 +186,6 @@ #define SDRAM_START 0xa0000000 -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - extern vm_offset_t xscale_cache_clean_addr; void * @@ -204,56 +199,13 @@ vm_offset_t afterkern; vm_offset_t freemem_after; vm_offset_t lastaddr; -#ifdef DDB - vm_offset_t zstart = 0, zend = 0; -#endif - int i; - uint32_t fake_preload[35]; uint32_t memsize, memstart; - i = 0; - set_cpufuncs(); - fake_preload[i++] = MODINFO_NAME; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_TYPE; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_ADDR; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = KERNBASE + 0x00200000; - fake_preload[i++] = MODINFO_SIZE; - fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = (uint32_t)&end - KERNBASE - 0x00200000; -#ifdef DDB - if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) { - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4); - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_ESYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 8); - lastaddr = *(uint32_t *)(KERNVIRTADDR + 8); - zend = lastaddr; - zstart = *(uint32_t *)(KERNVIRTADDR + 4); - ksym_start = zstart; - ksym_end = zend; - } else -#endif - lastaddr = (vm_offset_t)&end; - - fake_preload[i++] = 0; - fake_preload[i] = 0; - preload_metadata = (void *)fake_preload; - - + last_addr = fake_preload_metadata(); pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); -#define KERNEL_TEXT_BASE (KERNBASE + 0x00200000) freemempos = 0xa0200000; /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ Index: xscale/i8134x/crb_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/arm/xscale/i8134x/crb_machdep.c,v retrieving revision 1.4 diff -u -r1.4 crb_machdep.c --- xscale/i8134x/crb_machdep.c 12 Mar 2008 10:11:55 -0000 1.4 +++ xscale/i8134x/crb_machdep.c 3 Apr 2008 07:48:18 -0000 @@ -46,7 +46,6 @@ */ #include "opt_msgbuf.h" -#include "opt_ddb.h" #include __FBSDID("$FreeBSD: src/sys/arm/xscale/i8134x/crb_machdep.c,v 1.4 2008/03/12 10:11:55 jeff Exp $"); @@ -125,11 +124,7 @@ extern u_int undefined_handler_address; struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; - -extern void *_end; - extern vm_offset_t sa1_cache_clean_addr; - extern int *end; struct pcpu __pcpu; @@ -189,10 +184,6 @@ #define SDRAM_START 0x00000000 -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - extern vm_offset_t xscale_cache_clean_addr; void * @@ -206,56 +197,13 @@ vm_offset_t afterkern; vm_offset_t freemem_after; vm_offset_t lastaddr; -#ifdef DDB - vm_offset_t zstart = 0, zend = 0; -#endif - int i; - uint32_t fake_preload[35]; uint32_t memsize, memstart; - i = 0; - set_cpufuncs(); - fake_preload[i++] = MODINFO_NAME; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_TYPE; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_ADDR; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = KERNBASE + 0x00200000; - fake_preload[i++] = MODINFO_SIZE; - fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = (uint32_t)&end - KERNBASE - 0x00200000; -#ifdef DDB - if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) { - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4); - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_ESYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 8); - lastaddr = *(uint32_t *)(KERNVIRTADDR + 8); - zend = lastaddr; - zstart = *(uint32_t *)(KERNVIRTADDR + 4); - ksym_start = zstart; - ksym_end = zend; - } else -#endif - lastaddr = (vm_offset_t)&end; - - fake_preload[i++] = 0; - fake_preload[i] = 0; - preload_metadata = (void *)fake_preload; - - + last_addr = fake_preload_metadata(); pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); -#define KERNEL_TEXT_BASE (KERNBASE + 0x00200000) freemempos = 0x00200000; /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ Index: xscale/ixp425/avila_machdep.c =================================================================== RCS file: /home/ncvs/src/sys/arm/xscale/ixp425/avila_machdep.c,v retrieving revision 1.7 diff -u -r1.7 avila_machdep.c --- xscale/ixp425/avila_machdep.c 3 Apr 2008 06:14:23 -0000 1.7 +++ xscale/ixp425/avila_machdep.c 3 Apr 2008 07:48:18 -0000 @@ -46,7 +46,6 @@ */ #include "opt_msgbuf.h" -#include "opt_ddb.h" #include __FBSDID("$FreeBSD: src/sys/arm/xscale/ixp425/avila_machdep.c,v 1.7 2008/04/03 06:14:23 imp Exp $"); @@ -251,10 +250,6 @@ #define SDRAM_START 0x10000000 -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - extern vm_offset_t xscale_cache_clean_addr; void * @@ -268,52 +263,10 @@ vm_offset_t afterkern; vm_offset_t freemem_after; vm_offset_t lastaddr; -#ifdef DDB - vm_offset_t zstart = 0, zend = 0; -#endif - int i; - uint32_t fake_preload[35]; uint32_t memsize; - i = 0; - set_cpufuncs(); - fake_preload[i++] = MODINFO_NAME; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_TYPE; - fake_preload[i++] = strlen("elf kernel") + 1; - strcpy((char*)&fake_preload[i++], "elf kernel"); - i += 2; - fake_preload[i++] = MODINFO_ADDR; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = KERNVIRTADDR; - fake_preload[i++] = MODINFO_SIZE; - fake_preload[i++] = sizeof(uint32_t); - fake_preload[i++] = (uint32_t)&end - KERNVIRTADDR; -#ifdef DDB - if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) { - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4); - fake_preload[i++] = MODINFO_METADATA|MODINFOMD_ESYM; - fake_preload[i++] = sizeof(vm_offset_t); - fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 8); - lastaddr = *(uint32_t *)(KERNVIRTADDR + 8); - zend = lastaddr; - zstart = *(uint32_t *)(KERNVIRTADDR + 4); - ksym_start = zstart; - ksym_end = zend; - } else -#endif - lastaddr = (vm_offset_t)&end; - - fake_preload[i++] = 0; - fake_preload[i] = 0; - preload_metadata = (void *)fake_preload; - - + lastaddr = fake_reload_metadata(); pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, &thread0); From owner-freebsd-arm@FreeBSD.ORG Thu Apr 3 19:30:55 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 84B771065675 for ; Thu, 3 Apr 2008 19:30:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 07B9B8FC19 for ; Thu, 3 Apr 2008 19:30:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8s) with ESMTP id 237828024-1834499 for ; Thu, 03 Apr 2008 15:15:28 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m33JEjiB095942 for ; Thu, 3 Apr 2008 15:14:45 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: arm@FreeBSD.org Date: Thu, 3 Apr 2008 15:14:33 -0400 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804031514.33243.jhb@FreeBSD.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 03 Apr 2008 15:14:45 -0400 (EDT) X-Virus-Scanned: ClamAV 0.91.2/6568/Thu Apr 3 12:12:56 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Subject: A patch to simplify the MD interrupt code a bit.. 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: Thu, 03 Apr 2008 19:30:55 -0000 This patch adds an MI intr_event_handle() routine for the non-FILTER case so that the MD code becomes identical in both cases and all the INTR_FILTER #ifdef's end up in kern_intr.c. It's been tested on amd64, i386, and sparc64 and cross-compiled on ppc, arm, and ia64. I'd like to get it tested on arm as I slightly adjusted the MD code to just not bother masking the interrupt unless we are going to run an ithread which is mostly what the existing FILTER code did except that it unmasked the interrupt when it wasn't masked in the first place if a filter handled the interrupt. Patch is at http://www.freebsd.org/~jhb/patches/intr_filter.patch -- John Baldwin From owner-freebsd-arm@FreeBSD.ORG Fri Apr 4 02:09:18 2008 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53CEA106564A for ; Fri, 4 Apr 2008 02:09:18 +0000 (UTC) (envelope-from onlinefuturebazaar2007@gmail.com) Received: from qb-out-0506.google.com (qb-out-0506.google.com [72.14.204.236]) by mx1.freebsd.org (Postfix) with ESMTP id E271D8FC23 for ; Fri, 4 Apr 2008 02:09:17 +0000 (UTC) (envelope-from onlinefuturebazaar2007@gmail.com) Received: by qb-out-0506.google.com with SMTP id a10so4240514qbd.7 for ; Thu, 03 Apr 2008 19:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:return-receipt-to:reply-to:from:to:subject:date:organization:message-id:mime-version:content-type:x-mailer:thread-index:x-mimeole:disposition-notification-to; bh=r3d02uDGdoW9w5XKmaMukHOL8BUz9qG4RnsvZ0yax9I=; b=cMGRaOYzA5kyVAXcjehjMhrfLu1LOBMA4QwBTLlRZ9IzTOHjmEf7Io52Lbdt8EeIiUztHICpxpErplhcjn9/OK4Q/AbMur9RQa1qj9rxGlCB5Johomu/cxoKuFP5KuicqssD8FLOycbgQQV2+pNwhLFrZbSBAwUBwGH/1vDQH2o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=return-receipt-to:reply-to:from:to:subject:date:organization:message-id:mime-version:content-type:x-mailer:thread-index:x-mimeole:disposition-notification-to; b=ZrotxkdTcNqoLnrZSfLXkdjnhnhflEaz0QTnBsAY9YyM9bJl7CE/3nXhatkWZC0ff8epHnuWnBiqQoKm4Rj3WhBGI4DsBc0CkP8wg8DUkl3QlxfGgAAMhQYi0QD1/lpIQ2/9EbO4c1BSSnVk6Yk5kSbNqI103B26AK5vwA9Sd0g= Received: by 10.142.158.17 with SMTP id g17mr428607wfe.234.1207274128183; Thu, 03 Apr 2008 18:55:28 -0700 (PDT) Received: from onlinemain ( [59.161.47.100]) by mx.google.com with ESMTPS id 27sm8094416wff.8.2008.04.03.18.55.24 (version=SSLv3 cipher=RC4-MD5); Thu, 03 Apr 2008 18:55:27 -0700 (PDT) From: "Suraj Saroj" To: Date: Fri, 4 Apr 2008 06:59:24 +0530 Organization: Online Future Bazaar Message-ID: MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: AciV6UeZZwfjNv8bRRKJd1uEVqqlpw== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Online Future Bazaar X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: onlinefuturebazaar2007@gmail.com List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2008 02:09:18 -0000 Visit: www.onlinefuturebazaar.com Online Future Bazaar India From owner-freebsd-arm@FreeBSD.ORG Fri Apr 4 04:28:44 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 0C43F106566B for ; Fri, 4 Apr 2008 04:28:44 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id D4BCD8FC0C for ; Fri, 4 Apr 2008 04:28:43 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m3443889033292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 3 Apr 2008 21:03:08 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <47F5A87C.1000804@freebsd.org> Date: Thu, 03 Apr 2008 21:03:08 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: John Baldwin References: <200804031514.33243.jhb@FreeBSD.org> In-Reply-To: <200804031514.33243.jhb@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: arm@freebsd.org Subject: Re: A patch to simplify the MD interrupt code a bit.. 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: Fri, 04 Apr 2008 04:28:44 -0000 John Baldwin wrote: > This patch adds an MI intr_event_handle() routine for the non-FILTER case so > that the MD code becomes identical in both cases and all the INTR_FILTER > #ifdef's end up in kern_intr.c. It's been tested on amd64, i386, and sparc64 > and cross-compiled on ppc, arm, and ia64. I'd like to get it tested on arm > as I slightly adjusted the MD code to just not bother masking the interrupt > unless we are going to run an ithread which is mostly what the existing > FILTER code did except that it unmasked the interrupt when it wasn't masked > in the first place if a filter handled the interrupt. Patch is at > http://www.freebsd.org/~jhb/patches/intr_filter.patch > > Seems to be ok on an AVILA board w/ latest HEAD. Sam From owner-freebsd-arm@FreeBSD.ORG Fri Apr 4 04:28:44 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 40E4F106566C for ; Fri, 4 Apr 2008 04:28:44 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 142CF8FC12 for ; Fri, 4 Apr 2008 04:28:44 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m3444mqn033295 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 3 Apr 2008 21:04:48 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <47F5A8E0.7010803@freebsd.org> Date: Thu, 03 Apr 2008 21:04:48 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: John Baldwin References: <200804031514.33243.jhb@FreeBSD.org> <47F5A87C.1000804@freebsd.org> In-Reply-To: <47F5A87C.1000804@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: arm@freebsd.org Subject: Re: A patch to simplify the MD interrupt code a bit.. 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: Fri, 04 Apr 2008 04:28:44 -0000 Sam Leffler wrote: > John Baldwin wrote: >> This patch adds an MI intr_event_handle() routine for the non-FILTER >> case so that the MD code becomes identical in both cases and all the >> INTR_FILTER #ifdef's end up in kern_intr.c. It's been tested on >> amd64, i386, and sparc64 and cross-compiled on ppc, arm, and ia64. >> I'd like to get it tested on arm as I slightly adjusted the MD code >> to just not bother masking the interrupt unless we are going to run >> an ithread which is mostly what the existing FILTER code did except >> that it unmasked the interrupt when it wasn't masked in the first >> place if a filter handled the interrupt. Patch is at >> http://www.freebsd.org/~jhb/patches/intr_filter.patch >> >> > Seems to be ok on an AVILA board w/ latest HEAD. Ooops, hold that. Your patch doesn't apply cleanly and I missed that. Will try again tomorrow. Sam From owner-freebsd-arm@FreeBSD.ORG Fri Apr 4 16:42:57 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 71B971065672; Fri, 4 Apr 2008 16:42:57 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF518FC1F; Fri, 4 Apr 2008 16:42:57 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m34GguwP037603 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Apr 2008 09:42:57 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <47F65A90.6030803@freebsd.org> Date: Fri, 04 Apr 2008 09:42:56 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: John Baldwin References: <200804031514.33243.jhb@FreeBSD.org> <47F5A87C.1000804@freebsd.org> <47F5A8E0.7010803@freebsd.org> In-Reply-To: <47F5A8E0.7010803@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-Rhyolite-Metrics: ebb.errno.com; whitelist Cc: arm@freebsd.org Subject: Re: A patch to simplify the MD interrupt code a bit.. 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: Fri, 04 Apr 2008 16:42:57 -0000 Sam Leffler wrote: > Sam Leffler wrote: >> John Baldwin wrote: >>> This patch adds an MI intr_event_handle() routine for the non-FILTER >>> case so that the MD code becomes identical in both cases and all the >>> INTR_FILTER #ifdef's end up in kern_intr.c. It's been tested on >>> amd64, i386, and sparc64 and cross-compiled on ppc, arm, and ia64. >>> I'd like to get it tested on arm as I slightly adjusted the MD code >>> to just not bother masking the interrupt unless we are going to run >>> an ithread which is mostly what the existing FILTER code did except >>> that it unmasked the interrupt when it wasn't masked in the first >>> place if a filter handled the interrupt. Patch is at >>> http://www.freebsd.org/~jhb/patches/intr_filter.patch >>> >>> >> Seems to be ok on an AVILA board w/ latest HEAD. > > Ooops, hold that. Your patch doesn't apply cleanly and I missed > that. Will try again tomorrow. > Works fine on my Avila 2348 board. Sam