From patchwork Fri May 13 14:12:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Barrett X-Patchwork-Id: 622041 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3r5sXl6M5Nz9t7G for ; Sat, 14 May 2016 00:23:34 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CB661A7665; Fri, 13 May 2016 16:23:31 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12Yybg2uGUZQ; Fri, 13 May 2016 16:23:31 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C1A01A7621; Fri, 13 May 2016 16:23:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EC49AA7621 for ; Fri, 13 May 2016 16:12:21 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FKjJd-vXm-XX for ; Fri, 13 May 2016 16:12:21 +0200 (CEST) X-Greylist: delayed 64503 seconds by postgrey-1.34 at theia; Fri, 13 May 2016 16:12:16 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from eu-smtp-delivery-179.mimecast.com (eu-smtp-delivery-179.mimecast.com [146.101.78.179]) by theia.denx.de (Postfix) with ESMTP id 1BFE4A75BF for ; Fri, 13 May 2016 16:12:16 +0200 (CEST) Received: from DAY-EX-02.internal.ndcinfrared.com (rrcs-98-102-150-67.central.biz.rr.com [98.102.150.67]) (Using TLS) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-49-mfQz7lJYReubtynALh4kmQ-1; Fri, 13 May 2016 15:12:14 +0100 Received: from DAY-EX-03.internal.ndcinfrared.com ([fe80::9d8:abe7:9994:80f4]) by DAY-EX-02.internal.ndcinfrared.com ([fe80::f429:3f6b:9fe9:b1d%15]) with mapi id 14.03.0248.002; Fri, 13 May 2016 10:12:25 -0400 From: Nathan Barrett To: Anatolij Gustschin Thread-Topic: [U-Boot] U-Boot 2016.03 on Altera Cyclone 5 SOCKIT Thread-Index: AdGsiaDK3aNEuVXXQA6qfuGzceM5OQAtWhwAAAf+aOA= Date: Fri, 13 May 2016 14:12:25 +0000 Message-ID: <9E5584745581D44BADFE136EC8458A3558D6C3@DAY-EX-03.internal.ndcinfrared.com> References: <9E5584745581D44BADFE136EC8458A3558D556@DAY-EX-03.internal.ndcinfrared.com> <20160513154402.44d890c7@crub> In-Reply-To: <20160513154402.44d890c7@crub> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.10.55] MIME-Version: 1.0 X-MC-Unique: mfQz7lJYReubtynALh4kmQ-1 X-Mailman-Approved-At: Fri, 13 May 2016 16:23:24 +0200 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "u-boot@lists.denx.de" Subject: Re: [U-Boot] U-Boot 2016.03 on Altera Cyclone 5 SOCKIT X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Hey Anatolij, Thanks for getting back to me. I actually just solved this a few minutes ago. Here's the relevant patch: Sincerely, Nathan Barrett -----Original Message----- From: Anatolij Gustschin [mailto:agust@denx.de] Sent: Friday, May 13, 2016 9:44 AM To: Nathan Barrett Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] U-Boot 2016.03 on Altera Cyclone 5 SOCKIT Hi Nathan, On Thu, 12 May 2016 20:11:00 +0000 Nathan Barrett nathan.barrett@ndc.com wrote: > Hello All, > > I'm trying to run U-Boot 2016 on a Terasic Cyclone 5 SoC Kit. I've got everything running up to this point: > > U-Boot SPL 2016.03 (May 12 2016 - 14:56:58) > ../drivers/ddr/altera/sequencer.c: Preparing to start memory > calibration > ../drivers/ddr/altera/sequencer.c: CALIBRATION PASSED > ../drivers/ddr/altera/sequencer.c: Calibration complete Trying to boot > from MMC bad magic > SPL: failed to boot from all boot devices ### ERROR ### Please RESET > the board ### > > If I look at my generated u-boot-with-spl.sfp, at address 0x3FFF0, I can see that U-Boot is sitting there and starts with the proper magic number header (0x27051956). > > This file is being placed onto my SD card via > > #sudo dd if=u-boot-with-spl.sfp of=/dev/sdb3 I think you do not have CONFIG_SPL_FAT_SUPPORT or CONFIG_SPL_EXT_SUPPORT defined in the board config file and SPL uses MMCSD_MODE_RAW and just reads at offset CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR of the card and not from the partition 3. > I went ahead and added some debugging breadcrumbs as well: > > U-Boot SPL 2016.03 (May 12 2016 - 15:27:36) > ../drivers/ddr/altera/sequencer.c: Preparing to start memory > calibration > ../drivers/ddr/altera/sequencer.c: CALIBRATION PASSED > ../drivers/ddr/altera/sequencer.c: Calibration complete Trying to boot > from MMC > > ---At line 37 of common/spl/spl_mmc.c --- read sector a00, count=1 SPL reads at byte offset 0x140000 of the device it seems. > CONFIG_SYS_TEXT_BASE = 1000040 > sizeof(struct image_header) = 40 > magic = dba5b8aa > --------------------------------------------------- > > bad magic > SPL: failed to boot from all boot devices ### ERROR ### Please RESET > the board ### > > Can anyone assist? Does SPL detect the image if you write it to the sd-card as below? dd if=u-boot-with-spl.sfp of=/dev/sdb bs=1M seek=1 But please only write it this way if there is no partition with important data at the beginning of your sd-card. HTH, Anatolij confidentiality: This e-mail and its attachments are intended for the above named only and may be confidential. If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this e- mail and highlight the error. Security Warning: Please note that this e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. We advise that you understand and observe this lack of security when e-mailing us. Viruses: Although we have taken steps to ensure that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free. --- git.old/include/configs/socfpga_common.h +++ git/include/configs/socfpga_common.h @@ -365,9 +365,12 @@ #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot-dtb.img" #define CONFIG_SPL_LIBDISK_SUPPORT #else -#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 3 -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0xa00 /* offset 2560 sect (1M+256k) */ -#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 800 /* 400 KB */ +#define CONFIG_SPL_LIBGENERIC_SUPPORT +#define CONFIG_SPL_LIBCOMMON_SUPPORT +#define CONFIG_SPL_LIBDISK_SUPPORT +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 3 +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x200 /* offset 512 sectors (256k) */ +#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 800 /* 400 KB */ #endif #endif