From owner-freebsd-arm@FreeBSD.ORG Sun Mar 22 19:11:56 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51422720 for ; Sun, 22 Mar 2015 19:11:56 +0000 (UTC) Received: from mail-yh0-x234.google.com (mail-yh0-x234.google.com [IPv6:2607:f8b0:4002:c01::234]) (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 0775D855 for ; Sun, 22 Mar 2015 19:11:56 +0000 (UTC) Received: by yhjf44 with SMTP id f44so59868723yhj.3 for ; Sun, 22 Mar 2015 12:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=UnyZK8+8RAv1C1Di5r1TbzEFsJOSqA9X+u/ryWgPREk=; b=tBMzF4rIZ1dRVDITWKOIrCoQJ9d9GonadwNR1Ye1LHVUTxn0PPqXour41KcE5qKb1U 2nqvP9T4PZQBry5XaRl51OW+e2Z18vn6m/YvuCKQ6IThIsdGvenbZd9yMpiVsuCvnC99 cnhI9rU9yI0s5U/KNRzAGZaqdhPF1Nqlgu8+E1UIbfdA94VVutoMCEoFr3ZgkJXc6je9 01twtFzWFSf44ijo+1XuF4bIetL2hsyUMhAPcIvHtGfhaS42rjmcOw+fuQjL93xKPv0R Nm6WnJhQPpdt8x52MfFLhLaUru2vjuVvaSTSkpNricUMKCEtBOFeauI6VzXAdFTQS3dz Zx3A== MIME-Version: 1.0 X-Received: by 10.236.47.229 with SMTP id t65mr92488079yhb.91.1427051514913; Sun, 22 Mar 2015 12:11:54 -0700 (PDT) Received: by 10.170.217.69 with HTTP; Sun, 22 Mar 2015 12:11:54 -0700 (PDT) In-Reply-To: <40A94DE3-36A6-4E85-8B59-15329D00E89C@kientzle.com> References: <3DF08C65-20E3-4524-B0E1-C5C096AA0FE8@hellmuth-michaelis.de> <54BA6DB9-DC61-4A6F-B948-777BB9800F54@bocal.org> <20150312132739.GA28385@cicely7.cicely.de> <3EF47A05-60B2-4BB0-8688-018E50CF7D4A@hellmuth-michaelis.de> <40A94DE3-36A6-4E85-8B59-15329D00E89C@kientzle.com> Date: Sun, 22 Mar 2015 21:11:54 +0200 Message-ID: Subject: Re: beaglebone boot from eMMC From: Guy Yur To: Tim Kientzle Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-arm , Hellmuth Michaelis X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2015 19:11:56 -0000 On Thu, Mar 19, 2015 at 5:41 AM, Tim Kientzle wrote: > >> On Mar 18, 2015, at 11:16 AM, Guy Yur wrote: >> >> Hi, >> >> >> Is your msdosfs slice on the eMMC aligned to 1 MB? >> >> I had the same "CCC" problem when I aligned the partition >> and used newfs_msdos. >> Removing the sector count adjustment calculation in newfs_msdos >> as was done in NetBSD worked for me. >> >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D183234 > > Fortunately, the AM335x TRM from TI documents the exact checks made by th= e ROM before it will recognize a valid MSDOS partition. So you don=E2=80= =99t need to guess; you can compare a hex dump of your disk with the docs a= nd see exactly what=E2=80=99s gone wrong. > > As I recall, the ROM is very unforgiving: > > * The CHS geometry used in the MBR has to exactly match the MSDOS format = geometry. Attempts to align the partition on round boundaries can screw th= is up badly. > I didn't see anything in the TI document about alignment and it works fine for me with 1MB on eMMC with patched newfs_msdos. The problem is with the check that requires the number of sectors to equal the partition size. newfs_msdos trims the sector count so the condition isn't met. Page 4574 - Figure 26-22. FAT Detection Procedure BPB_TotSec16 or BPB_TotSec32 =3D MBR_Partition_Size > * The FAT format type (12, 16, or 32) has to match the ROM expectations > > If any of the ROM checks fail, it will assume the device is not usable an= d try a different device (ultimately ending up with CCCC on the serial port= ). > > The corresponding code in Crochet uses > > $ gpart add -a 63 -b 63 -s 2m -t =E2=80=98!12=E2=80=99 > > to create the MSDOS partition and then uses > > $ newfs_msdos -L