From owner-freebsd-arm@freebsd.org Fri May 6 10:40:59 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 1C77BB305F8 for ; Fri, 6 May 2016 10:40:59 +0000 (UTC) (envelope-from tvijlbrief@gmail.com) Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::22d]) (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 5A3C111A2 for ; Fri, 6 May 2016 10:40:58 +0000 (UTC) (envelope-from tvijlbrief@gmail.com) Received: by mail-lf0-x22d.google.com with SMTP id j8so126418945lfd.2 for ; Fri, 06 May 2016 03:40:58 -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=QbyveD1nE4ChWfwIQXZ2fvr1539U3hWu9u+x4AORlQY=; b=YN6D+L2JcboBdtgJXg/R8FtNrBHwAZj9vLdyflVGdwI9BBTROoaZDEY2mpnnplerxd Wg9YWTgx/z7ptBmAsnlSz/V4nalMzSoGFyAMUI8Laztv/wesuZ5LdSAaHIEE2e5rAt3H m6Vra5FDr2m/Kg8iQ9l/bjRPHYlVRhO/f2NkxDgX3jVkj83gXYdMmiu8BnDon/8xBwih RCe1wGOfbJutAOQuXaUDt4Bt0XivOTn4ifUJBnTxXI+ffeJEuc0IXIv1OI8jCJ8O5wJn wpVrOlHcaAW3GKuSHlx8AGiD9nYd5wFO2hmcsvheBpTeCzkxukw2PpIg0PG0BwitaXZ4 hH4g== 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=QbyveD1nE4ChWfwIQXZ2fvr1539U3hWu9u+x4AORlQY=; b=iSe25DChjXOSRfNHB7GGnEnHLj6nk9gl54IQVDttQ/qoxHr4mQ6LA2HZBxl9mcea4B OoRcMbyIiy/v2L3myv7yIJMBguimJE1Bz0o4GDr1Unr1GhcnK6vPbyQbYpZVHl3ZctLI 29h3soP+jfAq/GCmqGSMhKwsusntU/TJS2f7DC83o2JXZ+7P2sUQ/IYRzM27h3vkkMt2 Qhs7QvGXaTLFprgOZb15Y8EpaOSnkx+GgyU7SOYItI6R0RLTWAjMY7Tnmy2hRdj5Te+K cFe0FaYW4GEdtrJ0ILJkiSMLbr+7YYOmdlAHEc5EOdpN1bFjBhAgW7q9D0Hfxi9VM+I2 YNvA== X-Gm-Message-State: AOPr4FWD/2M35S2UuEulG5LYU7M+DXc6PZKSg7GEj+vAFniTtLQkgN7VWWrFmEqcowj/L7nRtx9d9B5VKad5Kw== X-Received: by 10.25.18.217 with SMTP id 86mr7973481lfs.107.1462531255482; Fri, 06 May 2016 03:40:55 -0700 (PDT) MIME-Version: 1.0 From: Tom Vijlbrief Date: Fri, 06 May 2016 10:40:45 +0000 Message-ID: Subject: FreeBSD on the ODroid-C2 (arm64 AMLogic S905) To: freebsd-arm@freebsd.org 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: Fri, 06 May 2016 10:40:59 -0000 I've been hacking to see if I can get FreeBSD to boot on this little device, and I got to this: Using Meson_Ethernet device TFTP from server 192.168.0.171; our IP address is 192.168.0.32 Filename 'kernel'. Load address: 0x20000000 Loading: duplex 1000m ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ### 2.9 MiB/s done Bytes transferred = 4811936 (496ca0 hex) ## Starting application at 0x20001000 ... size 7f000000 pmap_bootstrap ffff000000004000 20000000 800000 ffff000000004000 0 platform_devmap_init (cbus) Early printf yielding control to the real console. KDB: debugger backends: ddb KDB: current backend: ddb Found 1 CPUs in the device tree Copyright (c) 1992-2016 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 11.0-CURRENT #478 01606fb(tc2): Fri May 6 12:17:26 CEST 2016 tom@bsd11.v7f.eu: /usr/home/tom/obj/arm64.aarch64/media/swan/github/freebsd/s ys/ODROIDC2 arm64 FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0 ) WARNING: WITNESS option enabled, expect reduced performance. Amlogic aml-s905 SoC FreeBSD/SMP: Multiprocessor System Detected: 1 CPUs ULE: setup cpu 0 null: openfirm: mem: random: harvesting attach, 8 bytes (4 bits) from nexus0 ofwbus0: simplebus0: on ofwbus0 random: harvesting attach, 8 bytes (4 bits) from simplebus0 clk_fixed0: on ofwbus0 random: harvesting attach, 8 bytes (4 bits) from clk_fixed0 random: harvesting attach, 8 bytes (4 bits) from ofwbus0 clkmsr0: mem 0xc1108758-0xc1108767 on simplebus0 clkmsr0: bus clock 167 MHz random: harvesting attach, 8 bytes (4 bits) from clkmsr0 scu0: mem 0xc4300000-0xc4300fff on simplebus0 random: harvesting attach, 8 bytes (4 bits) from scu0 cpuconfig0: mem 0xd901ff80-0xd901ff8f on simplebus0 random: harvesting attach, 8 bytes (4 bits) from cpuconfig0 ccm0: mem 0xc1104140-0xc1104153 on simplebus0 random: harvesting attach, 8 bytes (4 bits) from ccm0 gic0: mem 0xc4301000-0xc4301fff,0xc4302000-0x c4303fff,0xc4304000-0xc4305fff,0xc4306000-0xc4307fff irq 41 on ofwbus0 arm_gic_fdt_attach gic0: pn 0x20, arch 0x2, rev 0x1, implementer 0x43b irqs 256 random: harvesting attach, 8 bytes (4 bits) from gic0 generic_timer0: irq 16,19,18 on ofwbus0 ofwbus0: no default resources for rid = 3, type = 1 Timecounter "ARM MPCore Timecounter" frequency 24000000 Hz quality 1000 Event timer "ARM MPCore Eventtimer" frequency 24000000 Hz quality 1000 random: harvesting attach, 8 bytes (4 bits) from generic_timer0 ofwbus0: mem 0xc4200000-0xc4200fff irq 175 compat arm,pl310-cache (no driver attached) ofwbus0: mem 0xc1109990-0xc11099a7 irq 92 compat amlogic,meson6 -timer (no driver attached) simplebus0: mem 0xc1109900-0xc1109907 irq 32 disabled compat amlogic,meson6-wdt (no driver attached) uart0: mem 0xc11084c0-0xc11084d7 irq 58 disabled compat a mlogic,meson-uart (no driver attached) simplebus0: mem 0xc11084dc-0xc11084f3 irq 107 disabled compat amlogic,meson-uart (no driver attached) simplebus0: mem 0xc1108700-0xc1108717 irq 125 disabled compat amlogic,meson-uart (no driver attached) simplebus0: mem 0xc8100500-0xc810051f irq 124 disabled compat aml ogic,meson6-i2c (no driver attached) simplebus0: mem 0xc1108500-0xc110851f irq 53 disabled compat amlo gic,meson6-i2c (no driver attached) simplebus0: mem 0xc11087c0-0xc11087df irq 160 disabled compat aml ogic,meson6-i2c (no driver attached) simplebus0: mem 0xc8100480-0xc810049f irq 47 disabled com pat amlogic,meson6-ir (no driver attached) simplebus0: mem 0xc1108c80-0xc1108cff disabled compat amlogic,mes on6-spifc (no driver attached) simplebus0: mem 0xc9410000-0xc941ffff,0xc1108108-0xc110810b irq 40 disabled compat amlogic,meson6-dwmac (no driver attached) simplebus0: mem 0xc11080b0-0xc11080d7,0xc11080e8-0xc11080ff,0 xc1108120-0xc1108137,0xc8100014-0xc8100017,0xc810002c-0xc810002f,0xc810002c-0xc8 10002f compat amlogic,aml8726-pinctrl (no driver attached) rtc0: mem 0xc8100740-0xc8100753 irq 104 on simplebus0 rtc0: unsupported SoC device_attach: rtc0 attach returned 6 gpio0: mem 0xc8100024-0xc8100027,0xc8100024-0xc8100027,0x c8100028-0xc810002b on simplebus0 gpiobus0: on gpio0 random: harvesting attach, 8 bytes (4 bits) from gpiobus0 gpioc0: on gpio0 random: harvesting attach, 8 bytes (4 bits) from gpioc0 random: harvesting attach, 8 bytes (4 bits) from gpio0 gpio1: mem 0xc1108054-0xc1108057,0xc1108058-0xc110805b,0x c110805c-0xc110805f on simplebus0 gpiobus1: on gpio1 random: harvesting attach, 8 bytes (4 bits) from gpiobus1 gpioc1: on gpio1 random: harvesting attach, 8 bytes (4 bits) from gpioc1 random: harvesting attach, 8 bytes (4 bits) from gpio1 gpio2: mem 0xc110806c-0xc110806f,0xc1108070-0xc1108073,0x c1108074-0xc1108077 on simplebus0 gpiobus2: on gpio2 random: harvesting attach, 8 bytes (4 bits) from gpiobus2 gpioc2: on gpio2 random: harvesting attach, 8 bytes (4 bits) from gpioc2 random: harvesting attach, 8 bytes (4 bits) from gpio2 simplebus0: mem 0xc1108c20-0xc1108c3f irq 60 disabled compat amlo gic,aml8726-mmc (no driver attached) simplebus0: mem 0xc1108e00-0xc1108e3b irq 110 disabled compat am logic,aml8726-sdxc-m8 (no driver attached) simplebus0: mem 0xc1108100-0xc1108107 disabled compat amlogic,aml 8726-rng (no driver attached) simplebus0: mem 0xc1108800-0xc110881f disabled compat amlogic ,aml8726-m8-usb-phy (no driver attached) simplebus0: mem 0xc1108820-0xc110883f disabled compat amlogic ,aml8726-m8-usb-phy (no driver attached) simplebus0: mem 0xc9040000-0xc907ffff irq 62 disabled compat syno psys,designware-hs-otg2 (no driver attached) simplebus0: mem 0xc90c0000-0xc90fffff irq 63 disabled compat syno psys,designware-hs-otg2 (no driver attached) simplebus0: mem 0xc9410000-0xc9411fff irq 40 disabled compat amlo gic,meson6-dwmac (no driver attached) simplebus0: mem 0xc8006048-0xc8006053,0xc1106800-0xc1106bff,0xc110 7400-0xc11077ff irq 34,35,44,45 disabled type display compat Xamlogic,aml8726-fb (no driver attached) cpulist0: on ofwbus0 cpu0: on cpulist0 arm64_cpu0: register <200> random: harvesting attach, 8 bytes (4 bits) from arm64_cpu0 random: harvesting attach, 8 bytes (4 bits) from cpu0 random: harvesting attach, 8 bytes (4 bits) from cpulist0 ofwbus0: compat Xgpio-leds (no driver attached) Device configuration finished. procfs registered Timecounters tick every 1.000 msec tcp_init: net.inet.tcp.tcbhashsize auto tuned to 16384 ===== This is my github: https://github.com/tomtor/freebsd/tree/tc2 which contains also some commits from Andrew Turner (his early RPI3 port) and some preliminary Pine64 work (waiting for a board). A script to build an image: https://github.com/tomtor/image-freebsd-c2/blob/master/build/mkc2image.sh I'm currently stuck because I cannot get a working Timer, interrupts are for some reason not generated or get lost, so the boot hangs on an msleep late in the boot process. I have no S905 documentation, only S805 docu, which looks valid, except for the 64bit arm difference. The guys at http://www.hardkernel.com/main/products/prdt_info.php?g_code=G145457216438&tab_idx=2 are still waiting for the datasheet :-/ What I noticed is that Timer-E is somehow not running, Timer-A works as expected (I can see it counting in the debugger), except perhaps for the interrupts. If someone has suggestions how to fix this, cq hints how to proceed, that would be very nice!