From patchwork Thu Oct 17 18:48:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Roger Pueyo Centelles | Guifi.net" X-Patchwork-Id: 1178931 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=guifi.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jqs1uoNa"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46vJ8j5G4Cz9sPf for ; Fri, 18 Oct 2019 05:48:36 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Content-Type: MIME-Version:Date:Message-ID:To:From:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=4upf4Oh27OI97O656We/fA/Zd3buU4bX+FINTBVtWE0=; b=jqs1uoNaRMGEXV2kXNclkXEZ8/ bgjh9491zzEeSsYVnLhfRghi4ocIZ83bNH5VJoi9pzeo+zFXeY36j5ScdShbT9rFTsHa1xX64fjBx vOIbugz4DmUCVFCbmRISRNVVsViN1tmpR6QyNG2LkcYHGf3JHtce2KOvP5p3Ilp/SUMT4yH7GFzOP 0cvNO9oS05TtFmipatGQCoJcqk2eR54AxAKTs+PC3py9cIAE/J8eRUng59KC1v+iJfhpS4xTooo6o mP18jVGenzQsKt3kkSEkHIcDy5oojbfA0fwojjl/JV8zmdEvePTKGcxTQmVQ+dtMjkUD1ui2edhZX iBF9hYSg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLAp3-0001zP-Vw; Thu, 17 Oct 2019 18:48:29 +0000 Received: from masdeu.rogerpueyo.com ([5.134.119.116]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iLAoy-0001yO-WA for openwrt-devel@lists.openwrt.org; Thu, 17 Oct 2019 18:48:27 +0000 Received: from [147.83.42.157] (dync-42-157.ac.upc.edu [147.83.42.157]) by masdeu.rogerpueyo.com (Postfix) with ESMTPSA id 3058271D for ; Thu, 17 Oct 2019 20:48:16 +0200 (CEST) From: "Roger Pueyo Centelles | Guifi.net" Openpgp: preference=signencrypt Autocrypt: addr=roger.pueyo@guifi.net; prefer-encrypt=mutual; keydata= mQINBFZobbgBEADHmOhM2Qct8UPGKcdzXKlWxLcaDsgv/trVw08xpS+VbXtzLuHQ8JpD+t7Y OHRaersrfp0isxbtiZnMhInUACsvAomHHCWxKB9RKLQAQ0j/NxrGu10XGRhBPvu0lkD+3VXh WFpVa8+6h9WjH4c/NGp5fyPHIVzYRhYMQlQ36iB84KOzOc3Ul6llxrnCac3ZUI0TnXk6/1Xl magtx4mjTM23EBEof/FlksEqR0dFHeOseBinLN6E20DgVF9+zddRBSnLI01Ag7rqAtt+//F3 Kp0yXVisoxa2ATAbd3pMLht8vhYwWdrY/VpKBiMIi8LcMKRWK31bAJF7esi9xBlrKXJ91FcJ vgC+zTXnZ9KNcTESG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XE8Wmo1ahKybPzfIJytNv4GQE4IWkBm1UIw6pCGFv/Z4M1h4g0BQ+BwwcDKo78VH rawb8kLsFuBGyMMDs4bMUu5xapx5nyttq9Bq6xqe0bKaMjBctrfHcrw2EcJUq3kgJxxFf6xn 4V3sKkx3IThZTmU/6DYumXAVaDi1eHfeEEjLGWymSeosQM2nrH/Ty4TpVVYxjI3PguMn/GeS 3xlQcjclmVU4Agd1Gc04zYxC6rusW/mZ1u2AD14xVsHkkiBfTloH0oAP24kvpNsfWRawW6+/ zkN9wXUrcQ3QCOVxyoWAe8cRLL/+cHUHpAytAU5FqHrS7s+94X9SiP5uWlnf+fmrzCboyqnl NU21+/v/2gaCdL37PogscBhyxpgRA3Od4WHB4IAMKWwAVRWJrHYrCb8Sycl03+lCATn8wpx6 j8fJMgXCwO9ai/gMvX9Gz/qfy8CTIn8H2bXwzyNJeQ== To: openwrt-devel@lists.openwrt.org Message-ID: Date: Thu, 17 Oct 2019 20:48:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191017_114825_310435_9178ACE0 X-CRM114-Status: GOOD ( 17.58 ) X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [RFC] ath79: support for MikroTik wAP AC: vmlinux.elf + DTB file X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Hi, I am trying to port the "MikroTik RouterBOARD wAP G-5HacT2HnD", also known as "wAP AC" to ath79 (it's already supported in ar71xx) and I got stuck. I think I can't add the corresponding DTB to the kernel image, which has to be in ELF format so that the bootloader accepts it. So far, I get the device to boot the vmlinux.elf or the vmlinux-initramfs.elf images and show some output on the console, but it stops immediately. From what I have been able to find around, I suspect that the line: [    0.000000] OF: fdt: No valid device tree found, continuing without suggests that the DTB was not appended to the kernel, so it can not be parsed and the device ends up stopping at: [    0.000000] Failed to get CPU node [    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns I would like to ask you for your advice on how to generate the ELF images so that they include the dtb, since I am not able to make it and I can't go beyond that on supporting the device. Please find attached the complete boot log (28 lines) and the patch I have been working on (also at https://github.com/rogerpueyo/openwrt/tree/ath79-mikrotik-rb-wapg-5hact2hnd_wip). Thank you very much, Roger [ 0.000000] Linux version 4.19.79 (le@builder) (gcc version 8.3.0 (OpenWrt GCC 8.3.0 r11237-d1072096f4)) #0 Tue Oct 15 21:31:13 2019 [ 0.000000] bootconsole [early0] enabled [ 0.000000] CPU0 revision is: 00019750 (MIPS 74Kc) [ 0.000000] SoC: Qualcomm Atheros QCA9556 ver 1 rev 0 [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 04000000 @ 00000000 (usable) [ 0.000000] Initrd not found or empty - disabling initrd [ 0.000000] OF: fdt: No valid device tree found, continuing without [ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes. [ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes [ 0.000000] Zone ranges: [ 0.000000] Normal [mem 0x0000000000000000-0x0000000003ffffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000003ffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff] [ 0.000000] random: get_random_bytes called from start_kernel+0x98/0x4a8 with crng_init=0 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16240 [ 0.000000] Kernel command line: rootfstype=squashfs,jffs2 [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Writing ErrCtl register=00000000 [ 0.000000] Readback ErrCtl register=00000000 [ 0.000000] Memory: 50756K/65536K available (4273K kernel code, 178K rwdata, 1008K rodata, 8036K init, 206K bss, 14780K reserved, 0K cma-reserved) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] NR_IRQS: 51 [ 0.000000] Failed to get CPU node [ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns diff --git a/target/linux/ath79/dts/qca9556_mikrotik_rb-wapg-5hact2hnd.dts b/target/linux/ath79/dts/qca9556_mikrotik_rb-wapg-5hact2hnd.dts new file mode 100644 index 0000000000..9c86bd33c6 --- /dev/null +++ b/target/linux/ath79/dts/qca9556_mikrotik_rb-wapg-5hact2hnd.dts @@ -0,0 +1,110 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca9557.dtsi" + +/ { + compatible = "mikrotik,rb-wapg-5hact2hnd", "qca,qca9556"; + model = "MikroTik RouterBOARD wAP G-5HacT2HnD"; + + aliases { + serial0 = &uart; + }; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "routerboot"; + reg = <0x000000 0x00e000>; + read-only; + }; + + partition@e000 { + label = "hard_config"; + reg = <0x000e000 0x00f000>; + read-only; + }; + + partition@f000 { + label = "bios"; + reg = <0x000f000 0x010000>; + read-only; + }; + + partition@10000 { + label = "routerboot2"; + reg = <0x010000 0x01f000>; + read-only; + }; + + partition@1f000 { + label = "soft_config"; + reg = <0x001f000 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x020000 0x1000000>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0 0 0 0 0>; + }; +}; + +ð0 { + status = "okay"; +}; + +&wmac { + status = "okay"; +}; diff --git a/target/linux/ath79/image/common-mikrotik.mk b/target/linux/ath79/image/common-mikrotik.mk new file mode 100644 index 0000000000..24bc02a0f2 --- /dev/null +++ b/target/linux/ath79/image/common-mikrotik.mk @@ -0,0 +1,25 @@ +define Device/mikrotik + DEVICE_VENDOR := MikroTik + DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport + BOARD_NAME := routerboard + LOADER_TYPE := elf + KERNEL_NAME := vmlinux.elf + KERNEL_INITRAMFS_NAME := vmlinux-initramfs.elf + MIKROTIK_CHUNKSIZE := +endef +DEVICE_VARS += MIKROTIK_CHUNKSIZE + +define Device/rb-nor-flash-16M + $(Device/mikrotik) + DEVICE_PACKAGES := rbcfg rssileds -nand-utils kmod-ledtrig-gpio + IMAGE_SIZE := 16000k + KERNEL_INSTALL := 1 + IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef + +define Device/rb-nor-flash-16M-ac + $(Device/rb-nor-flash-16M) + DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct ath10k-firmware-qca9887-ct kmod-usb-ehci + SUPPORTED_DEVICES += rb-wapg-5hact2hnd mikrotik_rb-wapg-5hact2hnd +endef diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index acb1ab4b0b..d88b8ed5a7 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1,4 +1,5 @@ include ./common-buffalo.mk +include ./common-mikrotik.mk include ./common-netgear.mk include ./common-tp-link.mk @@ -684,6 +685,17 @@ define Device/librerouter_librerouter-v1 endef TARGET_DEVICES += librerouter_librerouter-v1 +define Device/mikrotik_rb-wapg-5hact2hnd + $(Device/rb-nor-flash-16M-ac) + ATH_SOC := qca9556 + DEVICE_VENDOR := MikroTik + DEVICE_MODEL := MikroTik RouterBOARD wAP G-5HacT2HnD (wAP AC) + LOADER_TYPE := elf + KERNEL := kernel-bin | append-dtb + KERNEL_INITRAMFS := kernel-bin | append-dtb +endef +TARGET_DEVICES += mikrotik_rb-wapg-5hact2hnd + define Device/nec_wg1200cr ATH_SOC := qca9563 DEVICE_VENDOR := NEC