From owner-freebsd-arm@freebsd.org Sat Jul 23 22:04:50 2016 Return-Path: Delivered-To: freebsd-arm@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 D9D0DBA31BA for ; Sat, 23 Jul 2016 22:04:50 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: from mail-oi0-x243.google.com (mail-oi0-x243.google.com [IPv6:2607:f8b0:4003:c06::243]) (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 A14E71DEC for ; Sat, 23 Jul 2016 22:04:50 +0000 (UTC) (envelope-from embaudarm@gmail.com) Received: by mail-oi0-x243.google.com with SMTP id l9so13489196oih.0 for ; Sat, 23 Jul 2016 15:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=m8NN0/Xgvf8iOhDxiRJmzxN677TiguR6G9w5Cisq8dg=; b=OIHSvxew508AxAA7XI724gyoK+Bq1qQckxROIy1XwwTcmBbck0shPgFrS+NmhgisKH hDiNe3m9uWCNKwG41jX+rutxnP+NvuBy2Bt8Rc4KthXTH2++4ECcBiKihxK2HJnpFBxy DbZKLSg6snStS0Lm5r+DY5U59uttPPfggbMhLKy+HD47BckTKboUNE8NkMps9S1qvyQ7 2Lvh8RLYNyvG6ofzLEfKjYGmCdzBesd6ykXn56h5YcYTMkIZz35GeaaiO+olCMHUqfIb cLk/tGjpFn4oFzASkSdDxc/E9bhjuM6nun5fW4yTCxJXBHoGdGKxRfabVLDY1y7TzRo1 ZirQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=m8NN0/Xgvf8iOhDxiRJmzxN677TiguR6G9w5Cisq8dg=; b=T3xCDeV6i1Nxmbz6dDFLnWbOlOZ6IilYZqP4eidEadpZcZ6Cze5+rXVcGOTtIkyYms uO+GY2zCW+gF0uCy2HJZ6pO50FxhDDowAGkavApY7Rj9um9+6ecx4ILnHj8Ur96Ftxx4 P/lTDDA7pYurFMuBUCfeglXRGbTpRlLCRG/FdU4bP/oE4pkvB9VVx+PQkjNpHvEIhm3c x0NPhIqqkKNZTdbGl3pxfMXCtl+MsaiFtsNo3r088fS2D6obdHBPedIcMv7DVsVJgRVl oPY9YXrVDumhuZGXDuhhqZWtuLHSbqFGKlececk1kXqxm4fqMFESLtdz/rR5wCu8gM3t Chkw== X-Gm-Message-State: AEkoouuGapKxDE3Amo0Fu2T1rKWyYAT2JF20sJMTJcp7Gi1+nPS7d0Zdc/YpnmK9U7N2UIvUXlTO1DLlPqODNA== X-Received: by 10.157.9.248 with SMTP id 53mr6307382otz.35.1469311489862; Sat, 23 Jul 2016 15:04:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.20.8 with HTTP; Sat, 23 Jul 2016 15:04:49 -0700 (PDT) From: Emb Aud Date: Sat, 23 Jul 2016 18:04:49 -0400 Message-ID: Subject: Questions about writing custom boot loader, Zynq, Zybo To: freebsd-arm Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2016 22:04:50 -0000 Hi Everyone, I am trying to write a custom boot loader for FreeBSD on the Zybo board (Zynq). I am able to boot with Thomas Skibo's binary files, using u-boot, but I can't seem to get it to work myself. Right now I am: + loading the kernel ELF file into DDR and jumping to the correct entry point (0x100 offset). + passing zero in r1 so it falls back to the default boot params in machdep.c + that means I am not passing in any boot params. + I have decompiled the DTB file that Thomas Skibo posted on his website, and am includiing that DTS file statically in the kernel build. I have instrumented a kernel to print out r1-r4, and also the boot params, so I can see what a successful load looks like. Soon I will try supplying a boot params structure, but right now I don't really know how to construct one properly. I have the following problems while the kernel is booting: 1. RS232 port switches to double speed when the kernel starts printing (230400 baud instead of 115200 baud). 2. The ethernet driver cannot find the MAC address 3. The whole thing freezes during configuration of the USB port. Some questions: 1. What is the role of the boot param data structure (MODINFO_NAME, etc)? Which fields are important? 2. What is the boot param field type 0x00009002? I couldn't find a #define that matched that. 3. Is there anything special about how the Zynq is configured in ps7_init.c? 4. Is the exact ps7_init.c that Thomas Skibo used for his Zybo binaries available anywhere? 5. Where is the code in ubldr that constructs the boot param structure? Any advice would be very welcome. If I get a custom boot loader working I will post the code. Thank you, Lee