From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1V3UCW-0007ml-2u for mharc-grub-devel@gnu.org; Sun, 28 Jul 2013 12:52:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3UCK-0007iG-Fu for grub-devel@gnu.org; Sun, 28 Jul 2013 12:52:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3UC8-0005CK-UU for grub-devel@gnu.org; Sun, 28 Jul 2013 12:51:56 -0400 Received: from mail-lb0-x22f.google.com ([2a00:1450:4010:c04::22f]:36633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3UC8-0005Bd-JU for grub-devel@gnu.org; Sun, 28 Jul 2013 12:51:44 -0400 Received: by mail-lb0-f175.google.com with SMTP id 13so157402lba.34 for ; Sun, 28 Jul 2013 09:51:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=jd9R04Fn7Vjkde0YAAxUCfH6J5vwPpuy+c/cqGl3Xdo=; b=pDGsEK9QlbmkZJn4xJIwdkXDVsaKalNPr8EqznrXkaSDFIDc3WWgDfJIOOeSZT9y0r Exx+SLd41TCSJSsEiAgDtC4Gpgt5LYjvkexdOot/6YEZ/RTmDt2Adi/xhimIQxh7eu2S ugWO91+IDwhCX6YzbHX1u7vMbGE5G33D18C8Bh9+Lqj0Y4qZZAegiiEUNsLrnxz+C89J U4FcncY4i7xXfRxOQobYz1NMmfAY9AIUG6L+rE0/LK0pRCM0WebhLJ/0uym07cSW9gV2 rBiGRr25CrE1RE8AGv7rYtSIAIPIwkzznKKvCvJJIKgMw3wV/DlN/0nlZWGPD2qbo10s KJCg== X-Received: by 10.112.168.137 with SMTP id zw9mr3270477lbb.93.1375030303134; Sun, 28 Jul 2013 09:51:43 -0700 (PDT) Received: from opensuse.site (ppp79-139-160-84.pppoe.spdop.ru. [79.139.160.84]) by mx.google.com with ESMTPSA id y5sm22610776lae.2.2013.07.28.09.51.42 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sun, 28 Jul 2013 09:51:42 -0700 (PDT) Date: Sun, 28 Jul 2013 20:51:41 +0400 From: Andrey Borzenkov To: grub-devel@gnu.org Subject: Re: [PATCH] [ARM] Enable boot module for arm Message-ID: <20130728205141.0621c44c@opensuse.site> In-Reply-To: <51F3DCD7.7090407@gmail.com> References: <51EBE025.6040302@gmail.com> <51F137FE.4030102@gmail.com> <51F139FF.2030402@gmail.com> <51F13E82.7040207@gmail.com> <20130727074625.64ad89d2@opensuse.site> <51F34AE4.1080709@gmail.com> <20130727091936.20e9a978@opensuse.site> <51F3DCD7.7090407@gmail.com> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.18; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22f X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2013 16:52:06 -0000 =D0=92 Sat, 27 Jul 2013 16:44:39 +0200 Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0=B8= =D1=88=D0=B5=D1=82: > > It would be the first step, but my problem is, I cannot make it work > > even using concatenation. u-boot does show me correct image info for > > embedded grub, but I cannot launch it. Using default load address > > 0x08000000 qemu errors out because address is not in RAM (and it will > > not let me change amount of RAM for versatilepb); I tried to change > > load address to something else, like 0x04000000 and it just immediately > > resets in this case after "bootm 0x04000000". > > > You probably have to change GRUB link address. And not that the address=20 > is where to find the source image not where to load to. >=20 I did try to change link address (arm_uboot_ldflags and GRUB_KERNEL_ARM_UBOOT_LINK_ADDR). As I understand, bootm is expected to relocate image to load address and jump to start address. What I have now is 1. U-Boot is configured for versatileqemu. It works in the sense I can start example standalone hello_world using bootm. 2. Grub us build for arm-uboot bor@opensuse:~/build/grub> ./configure --with-platform=3Duboot TARGET_CC=3D= arm-linux-gnueabi-gcc --target=3Darm TARGET_LD=3Darm-linux-gnueabi-ld=20 (I also tried with TARGET_CFLAGS=3D"-marm -mno-thumb-interwork -mabi=3Daapcs-linux -march=3Darmv5te" to match U-Boot flags) 3. core.img is generated using=20 bor@opensuse:~/build/grub> ./grub-mkimage --verbose -d grub-core -O arm-ubo= ot -o core.img ./grub-mkimage: info: the total module size is 0x20. ./grub-mkimage: info: getting the size of grub-core/kernel.img. ./grub-mkimage: info: reading grub-core/kernel.img. ./grub-mkimage: info: getting the size of grub-core/kernel.img. ./grub-mkimage: info: locating the section .text at 0x0. ./grub-mkimage: info: locating the section .rodata at 0x14750. ./grub-mkimage: info: locating the section .data at 0x165a0. ./grub-mkimage: info: locating the section .module_license at 0x16fa8. ./grub-mkimage: info: locating the section .bss at 0x16fc8. ./grub-mkimage: info: kernel_img=3D0x144dda0, kernel_size=3D0x16fc8. ./grub-mkimage: info: the core size is 0x16fe8. ./grub-mkimage: info: writing 0x17028 bytes. bor@opensuse:~/build/grub> file core.img core.img: u-boot legacy uImage, , Linux/ARM, OS Kernel Image (Not compresse= d), 94184 bytes, Sun Jul 28 20:46:54 2013, Load Address: 0x08000000, Entry = Point: 0x08000000, Header CRC: 0x5F6F0B3E, Data CRC: 0x474F38F8 4. "flash" is built using bor@opensuse:~/src/u-boot-2013.04> cat u-boot.bin ~/build/grub/core.img > t= est.bin Offset of core.img is bor@opensuse:~/src/u-boot-2013.04> printf "0x%X\n" $(expr $(stat -c%s u-boo= t.bin) + 65536) 0x2B558 5. I now can start it bor@opensuse:~/src/u-boot-2013.04> qemu-system-arm -M versatilepb -m 256M -= serial stdio -kernel test.bin Warning: default mac address being used, creating potential for address con= flict audio: Unknown audio driver `pa' audio: Run with -audio-help to list available drivers U-Boot 2013.04 (Jul 28 2013 - 20:16:17) DRAM: 128 MiB WARNING: Caches not enabled Using default environment In: serial Out: serial Err: serial Net: SMC91111-0 Warning: SMC91111-0 using MAC address from net device VersatilePB #=20 And it shows correct image info VersatilePB # iminfo 0x2B558 ## Checking Image at 0002b558 ... Legacy image found Image Name: =20 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 94184 Bytes =3D 92 KiB Load Address: 08000000 Entry Point: 08000000 Verifying Checksum ... OK VersatilePB #=20 But it simply resets at the attempt to launch it VersatilePB # bootm 0x2B558 ## Booting kernel from Legacy Image at 0002b558 ... Image Name: =20 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 94184 Bytes =3D 92 KiB Load Address: 08000000 Entry Point: 08000000 Loading Kernel Image ... OK OK Starting kernel ... resetting ...