From owner-freebsd-arm@freebsd.org Thu Nov 12 05:39:41 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C47F9A29E01 for ; Thu, 12 Nov 2015 05:39:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-x231.google.com (mail-qk0-x231.google.com [IPv6:2607:f8b0:400d:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AF4E11AC for ; Thu, 12 Nov 2015 05:39:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qkcl124 with SMTP id l124so20058698qkc.3 for ; Wed, 11 Nov 2015 21:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp_com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=uaSqfqbY84/Pc9pJrA5X2yfFodX66LZ0CmSfh+2yC34=; b=vUIWwEl9UA+X9i+cGUaZVTHOuO3QAB9yoJw/skC1vVWOm/9CEE4t6X/+RMR23wd9ly P4NVR8nLumGrNP0HSVgb0237HSLM4FzssStnoah3PJnBvC7qqoqAgWWnbZeEirR9J+po tFONOUgO1i4quysL932CUXyNoSiYlEwIy22I7tDjSBbY8g4ifp0G71YYjFcKoSB+myMR nHoJwX5gPQ280XljMcbFYFk3+FV6L2piqKZf4AV9tXRQ5kd2VNkZ3ztOQd111kveewY5 KP8Bhji8TAsJFc8b2ByGaXL7cKZz23PNtsUULQxhJarwd4IkKt3FeXKrlaiYReibJSJW DJJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=uaSqfqbY84/Pc9pJrA5X2yfFodX66LZ0CmSfh+2yC34=; b=c2xH2YldKGrBoepaLbQZUNdTa3tUYkmlx/SUwjf/liUi8Yqe3Pasmcp8eN8rj+3AYr HHINHTdMsDSWrx5ovgi9NK4RZVO99PbrBOACIfNrcjxCLVzQw0IuiqCRAZfk1Gz8pk12 3GaeCz05lg0Mv06iT/Spp6DYWbUVtA/AU51AQ3yFZfuJLgHDNequmOmQLcpQojFKXrAB z7F50my3MQTh0d1TXJKfqNhNbyMTEnNr3AJNB/83flBf+OZd+WY/kypZTaO9E2Tt+Feg JKv+R8fDTwMMms+32jncm6WJKAt9tqoptvQ3hu6WV+PMlkBYbstcC/la+WmZ1oN9uU6J J69g== X-Gm-Message-State: ALoCoQlHJd00B8fq7gGJd6ZE6TyOBmQlwYnPk1YCkis4oD3kPrAs6oWsDSa45NQW982AnDQatNHa MIME-Version: 1.0 X-Received: by 10.55.21.65 with SMTP id f62mr14714174qkh.46.1447306780420; Wed, 11 Nov 2015 21:39:40 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Wed, 11 Nov 2015 21:39:40 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: Date: Wed, 11 Nov 2015 22:39:40 -0700 X-Google-Sender-Auth: YEVaXRG-tCYh7-DcvsxiRLwB75o Message-ID: Subject: Re: Hummingboard SATA From: Warner Losh To: Russell Haley Cc: freebsd-arm Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Nov 2015 05:39:42 -0000 On Wed, Nov 11, 2015 at 10:22 PM, Russell Haley wrote: > Hello again, > > I have started looking at SATA support in FreeBSD by first reading the man > pages and then examining the code. The Joseph Kong book is helping > considerably to understand the structures. > > I see that there are three drivers in play: ahci, ada and ata. Man > indicates that ahci takes precedence in driver selection. *Is that the > driver for Arm and the Hummingboard?* > ata is out of the picture now. It never really was used on arm. ahci is likely the driver you want, though I'm not sure what a Hummingboard is. A quick google search suggests it is a imx6 board. That's good news because FreeBSD has an attachment. ahci is what's call a CAM SIM. This means that it will create the ata xpt (handled in sys/cam/ata/ata_xpt.c). The XPT then enumerates the transport and finds the sata drives, which wind up getting assigned the ada PERIPH driver (handled by sys/cam/ata/ata_da.c). Chances are very good you have a problem with the ahci driver and/or how that driver is connected / sets up the iMX6 SoC sata hardware. > What I can't seem to find is any direction on getting a debugger hooked up > to driver code. Do I use gdb somehow, or do I use the kernel debugger? I'm > going back over the Developers handbook again. > I'd start with ddb. > I also don't understand how to boot with the -d option. When is this > entered? I have used the sysctl to enter the debugger and poked around > but it doesn't mean much yet. > > sysctl debug.kdb.enter=1 > I don't think that the -d option is implemented on arm. Most of the ARM kernel config files have ALT_BREAK_TO_DEBUGGER defined, which means you'll need to send ~ ^B (that's hit return, hit the tilde key, hit control B). That will get you to the ddb prompt (db>). man 8 ddb for instructions on how to use it. Warner