From owner-freebsd-mips@freebsd.org Wed May 10 23:39:43 2017 Return-Path: Delivered-To: freebsd-mips@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 52ECBD67EB6 for ; Wed, 10 May 2017 23:39:43 +0000 (UTC) (envelope-from mike@wolman.co.uk) Received: from avasout08.plus.net (avasout08.plus.net [212.159.14.20]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E49D71968 for ; Wed, 10 May 2017 23:39:42 +0000 (UTC) (envelope-from mike@wolman.co.uk) Received: from [192.168.3.50] ([80.229.66.11]) by avasout08 with smtp id Jnff1v0020EahWw01nfgAh; Thu, 11 May 2017 00:39:40 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.2 cv=JPdLi4Cb c=1 sm=1 tr=0 a=sNOkzuqjfbpz3c/qSHODpA==:117 a=sNOkzuqjfbpz3c/qSHODpA==:17 a=IkcTkHD0fZMA:10 a=QdaIrptUDSTAzdKTkdgA:9 a=rNGentn2Ty9tPtzn:21 a=15ENNxkYTuzsjevg:21 a=QEXdDO2ut3YA:10 Subject: Re: onion omega2+ To: Adrian Chadd References: <694efc3a-e183-35a1-a0bf-9a9c0d708826@wolman.co.uk> <39222.11970.qm@web101719.mail.ssk.yahoo.co.jp> <6f1b2d35-5d17-765a-6138-0ab85455fc09@wolman.co.uk> <5866.49154.qm@web101718.mail.ssk.yahoo.co.jp> <102de390-63ca-a156-2208-bea3d5eea0f9@wolman.co.uk> <541011.41820.qm@web101719.mail.ssk.yahoo.co.jp> <672be258-8fed-6317-1325-f9fccf2646c3@wolman.co.uk> <369335.16286.qm@web101716.mail.ssk.yahoo.co.jp> <711a889d-9701-2441-5c9c-98e0ac607ffb@wolman.co.uk> <456721.9572.qm@web101705.mail.ssk.yahoo.co.jp> <8b21a15c-3af8-bdba-cc70-6bd0e3a65f39@wolman.co.uk> <05065E4E-1D0F-49DE-B14D-D45ECCEA251F@gmail.com> <2b8211f6-9f42-0f11-678f-a2ed830b2430@wolman.co.uk> Cc: Aleksandr Rybalko , "freebsd-mips@freebsd.org" From: Mike Wolman Message-ID: Date: Thu, 11 May 2017 00:39:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 May 2017 23:39:43 -0000 Hi Adrian, I am making the uImage from the kernel generated in tfpboot after the freebsd-wifi-build script is complete. I had an issue with a compressed kernel with an lzma error so with help we jumped past that and have got a kernel to boot from a binary with: objcopy -O binary kernel.MT7628_FDT kernel.MT7628_FDT.bin and then on the omega just "go 0x80001100" but am unable to get "bootm 0x80001100" working from uboot image still. I am trying to get the complete wifi build so I have a filesystem and kernel image so was just following what I could find/understand in the wifi build stuff. My current problem is I am not up on the hex address stuff and cannot workout what the correct load address should be for the u-boot image eg: mkimage -A mips -O linux -T kernel -C none \ -a 0x80000C00 -e 0x80001100 \ -n "FreeBSD" -d kernel.MT7628_FDT kernel.MT7628_FDT.uImage From my searching i see it is also related to the file size so have tried various combinations but just am not getting further. So info on the kernel: -r-xr-xr-x 1 mike mike 5623376 May 10 20:49 kernel.MT7628_FDT [mike@f64-current ~/omega2/tftpboot]$ readelf -h kernel.MT7628_FDT ELF Header: Magic: 7f 45 4c 46 01 01 01 09 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: FreeBSD ABI Version: 0 Type: EXEC (Executable file) Machine: MIPS R3000 Big-Endian only Version: 0x1 Entry point address: 0x80001100 Start of program headers: 52 (bytes into file) Start of section headers: 5622096 (bytes into file) Flags: 0x50001001, mips32, o32, noreorder Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 6 Size of section headers: 40 (bytes) Number of section headers: 32 Section header string table index: 29 Also just to clarify - when using fatload the address i should use should NOT be the load or entry address ie use something like: fatload usb 0:1 0x80800000 kernel.MT7628_FDT.uImage bootm 0x8000XXXXX Where0x8000XXXXX is the load address? Thanks Mike. On 11/05/2017 00:20, Adrian Chadd wrote: > Hi, > > Ah, you're doing XIP. I haven't done XIP before; i typically just > generate a normal image and give it a separate load address 16MB or > something into physical memory so I don't overwrite it. > > Ie, when you use mkimage to create a uboot application, you provide it > /both/ a load address and a run address. So, eg, for MIPS we do this: > > * load: 0x80050000 > * run: 0x80050100 > > .. the 256 bytes is space for the ELF header. And in the std.AR* > files, we specify the run address is 0x80050100 to ensure it all lines > up. > > Then to bootm i load it somewhere else away from that load address, so > it gets copied to the right spot and run. > > > > -adrian