From owner-freebsd-current@FreeBSD.ORG Fri Feb 15 11:41:31 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E3A28E34 for ; Fri, 15 Feb 2013 11:41:31 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id A240C2FD for ; Fri, 15 Feb 2013 11:41:31 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id 1AC38C4927; Fri, 15 Feb 2013 13:41:24 +0200 (EET) Date: Fri, 15 Feb 2013 13:41:31 +0200 From: Aleksandr Rybalko To: Yasir hussan Subject: Re: kernel boot failier Message-Id: <20130215134131.bda17d16e9118d9e99befe8b@ddteam.net> In-Reply-To: References: X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2013 11:41:31 -0000 On Wed, 13 Feb 2013 06:15:07 -0500 Yasir hussan wrote: > hi, > > i am have make some changes in my freebsd acutally have replaced mii bus > with my own switch bus and have put some code of switch but after i > successfully build kernel and world when i try to run it on machine it just > hangs up at boot time after this > > ar7100> bootm > change bootargs > console=ttyS0,115200 root=31:03 rootfstype=jffs2 init=/sbin/init > mtdparts=ar7100-nor0:256k(u-boot),64k(u-boot-env),1152k@384k > (uImage),6592k@1536k(rootfs),64k@320k(ART),64k@8128M > ## Booting image at 84000000 ... > Image Name: FreeBSD-9.0-Paxym AR7161 > Created: 2013-02-01 7:54:28 UTC > Image Type: MIPS NetBSD Kernel Image (gzip compressed) > Data Size: 2301863 Bytes = 2.2 MB > Load Address: 80050120 > Entry Point: 80050120 > Verifying Checksum ... crc32_fw: 84000040 - 84231fe6 (len:00231fa7) > calc... > OK > Uncompressing Kernel Image ... OK > ## Transferring control to NetBSD stage-2 loader (at address 80050120) ... > > One method is that i should revert all changes which will take time, Is > there is other way to debug my code, and can identify correct problem > > thanks > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" Hi Yasir, at first check if kernel entrypoint is equal `readelf -a kernel` to get it from kernel and compare it to entrypoint value passed to uboot's mkimage utility. If you want to debug early startup, you need simple UART driver. Boot goes in the following order: 1. mips/mips/locore.S 2. mips/atheros/ar71xx_machdep.c (from platform_start(...)) second one initialize UART and start printing messages to you, if everything ok of course. so to get to know if locore is ok, you need to put ASM block which will put some chars into UART TX reg. Thanks god, MIPS have mapped devices since boot (unlike ARM where you need to map devices before enable MMU). Device segment mapped to 0xa0000000 as uncached and to 0x80000000 as cached. So to use UART without cache you have to add UART physical address to 0xa0000000 and you will get base address which you can use to access UART controller. 0xa0000000 + 0x18020000 = 0xb8020000 >From possible problems what I know: 1. You may have different UART unit as console (don't remember if your SoC have more than one UART) 2. platform_start try to parse command line passed by uboot to find mem size. But it can have broken format, or may not have mem size variable. So try to disable argv/envp parsing and set realmem manually. 3. UART can be disabled, then you have to set correct value to AR71XX_GPIO_FUNCTION register. Good luck! WBW -- Aleksandr Rybalko