From owner-freebsd-mips@freebsd.org Sun Jan 3 02:23:27 2016 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 D597EA533D2 for ; Sun, 3 Jan 2016 02:23:27 +0000 (UTC) (envelope-from c.jason.browning@gmail.com) Received: from mail-yk0-x232.google.com (mail-yk0-x232.google.com [IPv6:2607:f8b0:4002:c07::232]) (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 9DE2C1E55 for ; Sun, 3 Jan 2016 02:23:27 +0000 (UTC) (envelope-from c.jason.browning@gmail.com) Received: by mail-yk0-x232.google.com with SMTP id v14so127216640ykd.3 for ; Sat, 02 Jan 2016 18:23:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=LFVycJ2/OXaypwOmu6G03RpoSvPjgfCyOM8GQ68nOqE=; b=BIPRTXYg/aazITu1EC+y7dfJzrXBCYpJiC+bbcrMIAHLpB3iZE+79uELqGat/UMNQC 74RatrEwyeTH2APvzD7083ekpjMbval7zRork3kCqbFpJ7zqF+I/nNzIASN07G6HOzSS qKIYeI0qURuVn4zJAGtT5T9aDChgzA/YoJkzGGbcgZteA+H1jFdBLBxidbKonatNpuqq fu2BgHBTybRsdiNxSZ0zMr1yDPReJS7G1gbPZRbAsCHbMLzwuinIgFzcHwx2jARs1bLV lEVfR5/lNrhNuP7SFODJh8n+XaoWFEPWwvR2MSBw5cJfIFLsa5wd7LUn5r21VaFf/zdI ZyEg== MIME-Version: 1.0 X-Received: by 10.129.51.214 with SMTP id z205mr65851667ywz.157.1451787806807; Sat, 02 Jan 2016 18:23:26 -0800 (PST) Sender: c.jason.browning@gmail.com Received: by 10.37.49.65 with HTTP; Sat, 2 Jan 2016 18:23:26 -0800 (PST) Date: Sat, 2 Jan 2016 20:23:26 -0600 X-Google-Sender-Auth: wcib-TNzVDl697oE037_pTW8FEc Message-ID: Subject: [RT5350] Boot from flash --> TLB miss (2) From: Jason Browning To: freebsd-mips@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 02:23:28 -0000 Hi! I have an RT5350-based board called a =E2=80=98VoCore=E2=80=99 http://vocore.io It=E2=80=99s small - 32M RAM, 16M SPI flash, WiFi, and GPIOs aplenty. I have a software-dev background and am new to embedded-dev, but the FreeBSD documentation and searching this list have brought me a long way. I am now at my limit. I=E2=80=99ve built kernels for (release)RT305X and (current)RT5350, and both work as expected when uploaded as an ELF to RAM and kicked-off with U-Boot=E2=80=99s =E2=80=98go=E2=80=99 command. They both f= ail with the following output when booted from on-board SPI flash: Booting image at bc050000 . Image Name: Created: 2016-01-01 7:14:33 UTC Image Type: MIPS NetBSD Kernel Image (gzip compressed) Data Size: 1580815 Bytes =3D 1.5 MB Load Address: 80000000 Entry Point: 80000100 Load Kernel: ......................... Verifying Checksum ... OK Uncompressing Kernel Image ... OK U-Boot args (from 0 args): None Environment: memsize=3D32 initrd_start=3D0x00000000 initrd_size=3D0x0 flash_start=3D0x00000000 flash_size=3D0x400000 entry: mips_init() Cache info: picache_stride =3D 4096 picache_loopcount =3D 8 pdcache_stride =3D 4096 pdcache_loopcount =3D 4 cpu0: MIPS Technologies processor v76.150 MMU: Standard TLB, 32 entries (4K 16K 64K 256K 1M 16M 64M 256M pg sizes) L1 i-cache: 4 ways of 256 sets, 32 bytes per line L1 d-cache: 4 ways of 128 sets, 32 bytes per line L2 cache: disabled Config1=3D0xbea3319e Config2=3D0x80000000 Config3=3D0x420 Physical memory chunk(s): 0x3e0000 - 0x1ffffff, 29491200 bytes (7200 pages) Maxmem is 0x2000000 GDB: debug ports: uart GDB: current port: uart KDB: debugger backends: ddb gdb KDB: current backend: ddb [ thread pid 0 tid 0 ] Stopped at 0x801f43b4 db> bt Tracing pid 0 tid 0 td 0x803646c0 8027896c+30 (?,?,?,?) ra 1880364268 sp 0 sz 0 8000f1b0+114 (0,?,ffffffff,?) ra 2080364280 sp 1 sz 1 8000e4f4+388 (?,?,?,?) ra a8803642a0 sp 0 sz 0 8000e990+70 (?,?,?,?) ra 1880364348 sp 0 sz 0 800110c8+f4 (?,?,?,?) ra 1a880364360 sp 0 sz 0 800f4590+110 (?,?,?,?) ra 3080364508 sp 0 sz 0 trap+d28 (?,?,?,?) ra c080364538 sp 0 sz 0 MipsKernGenException+134 (803f1e98,80355f1c,aba9500,0) ra c8803645f8 sp 100000001 sz 1 801f432c+88 (?,?,?,?) ra 20803646c0 sp 0 sz 0 pid 0 db> reset Trap cause =3D 2 (TLB miss (load or instr. fetch) - kernel mode) panic: trap Uptime: 1s =3D=3D More info: This board came with U-Boot+OpenWRT installed; per the U-Boot config, the FreeBSD kernels were compiled with makeoption KERNLOADADDR=3D0x80100000 when initiated with =E2=80=98go 80100100=E2=80=99 from RAM, and with makeop= tion KERNLOADADDR=3D0x80000000 when initiated with =E2=80=98bootm bc050000=E2=80=99 from SPI flash. I=E2=80=99m out of my depth here, but I *think* things go wrong from within locore.S ([srcRoot]/sys/mips/mips/locore.S) at ~line:177 where: PTR_L a0, TD_PCB(sp) I say this because the problem-scenario seems to make it out of =E2=80=98platform_start=E2=80=99 ([srcRoot]/sys/mips/rt305x/rt305x_machdep.c), and also seems never to enter =E2=80=98mi_startup=E2=80=99 ([srcRoot]/sys/mips/kern/init_main.c). Additionally, I do not know why the flash_size is reported to be only 4M, it=E2=80=99s 16M - verified. I=E2=80=99ve not delved into the intricacies of U-Boot yet. Am I on the wrong track? I=E2=80=99m at my wit=E2=80=99s end with this pro= blem. Jason