Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149790711
D32538.id97009.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
23 KB
Referenced Files
None
Subscribers
None
D32538.id97009.diff
View Options
Index: sys/arm/arm/debug_monitor.c
===================================================================
--- sys/arm/arm/debug_monitor.c
+++ sys/arm/arm/debug_monitor.c
@@ -72,7 +72,7 @@
static int dbg_remove_xpoint(struct dbg_wb_conf *);
static int dbg_setup_xpoint(struct dbg_wb_conf *);
-static int dbg_capable_var; /* Indicates that machine is capable of using
+static int dbg_capable_var = 0; /* Indicates that machine is capable of using
HW watchpoints/breakpoints */
static uint32_t dbg_model; /* Debug Arch. Model */
@@ -962,6 +962,11 @@
{
int err;
+#ifdef ARMV7_FORCE_DBG_MONITOR_DISABLE
+ db_printf("ARM Debug Architecture disabled in kernel compilation.\n");
+ return;
+#endif /* ARMV7_FORCE_DBG_MONITOR_DISABLE */
+
/* Fetch ARM Debug Architecture model */
dbg_model = dbg_get_debug_model();
Index: sys/arm/arm/undefined.c
===================================================================
--- sys/arm/arm/undefined.c
+++ sys/arm/arm/undefined.c
@@ -341,7 +341,8 @@
return;
}
else
- panic("Undefined instruction in kernel.\n");
+ panic("Undefined instruction in kernel (0x%08x).\n",
+ fault_instruction);
}
userret(td, frame);
Index: sys/arm/conf/ASUS_AC1300
===================================================================
--- /dev/null
+++ sys/arm/conf/ASUS_AC1300
@@ -0,0 +1,53 @@
+#
+# ASUS_AC1300 -- Qualcomm kernel configuration file for FreeBSD/arm64
+#
+# For more information on this file, please read the config(5) manual page,
+# and/or the handbook section on Kernel Configuration Files:
+#
+# https://docs.freebsd.org/en/books/handbook/kernelconfig/#kernelconfig-config
+#
+# The handbook is also available locally in /usr/share/doc/handbook
+# if you've installed the doc distribution, otherwise always see the
+# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the
+# latest information.
+#
+# An exhaustive list of options and more detailed explanations of the
+# device lines is also present in the ../../conf/NOTES and NOTES files.
+# If you are in doubt as to the purpose or necessity of a line, check first
+# in NOTES.
+#
+
+#NO_UNIVERSE
+
+include "std.armv7"
+include "std.qca"
+
+cpu CPU_CORTEXA
+ident ASUS_AC1300
+machine arm armv7
+
+# Use a low VA here so we get the early printf stuff working all the
+# way up to cninit().
+#options SOCDEV_PA=0x07800000
+#options SOCDEV_VA=0x07800000
+#options EARLY_PRINTF
+options BOOTVERBOSE
+
+options FDT
+options FDT_DTB_STATIC
+makeoptions FDT_DTS_FILE=qcom-ipq4018-rt-ac58u.dts
+
+options LINUX_BOOT_ABI
+options SCHED_ULE
+# DEFINITELY not ready for SMP yet!
+# options SMP
+options PLATFORM
+
+device loop
+device pty
+device md
+device gpio
+
+device ether
+device mii
+device bpf
Index: sys/arm/conf/std.qca
===================================================================
--- /dev/null
+++ sys/arm/conf/std.qca
@@ -0,0 +1,28 @@
+#
+# QCA SoC support (32 bit)
+#
+
+machine arm armv7
+cpu CPU_CORTEXA
+makeoptions CONF_CFLAGS="-march=armv7a"
+
+files "../qualcomm/std.ipq4018"
+
+# Serial (COM) ports
+device uart
+device uart_msm # Qualcomm MSM UART driver
+
+device gic
+
+# MMC/SD/SDIO Card slot support
+device mmc
+device sdhci
+
+# Timers
+device generic_timer
+device mpcore_timer
+
+options FDT
+
+# Disable CP14 work in DDB as TZ won't let us by default
+options ARMV7_FORCE_DBG_MONITOR_DISABLE
Index: sys/arm/qualcomm/ipq4018_machdep.h
===================================================================
--- /dev/null
+++ sys/arm/qualcomm/ipq4018_machdep.h
@@ -0,0 +1,40 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2021 Adrian Chadd <adrian@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef IPQ4018_MACHDEP_H
+#define IPQ4018_MACHDEP_H
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+
+void ipq4018_mp_setmaxid(platform_t plat);
+void ipq4018_mp_start_ap(platform_t plat);
+
+#endif
Index: sys/arm/qualcomm/ipq4018_machdep.c
===================================================================
--- /dev/null
+++ sys/arm/qualcomm/ipq4018_machdep.c
@@ -0,0 +1,190 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2021 Adrian Chadd <adrian@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "opt_platform.h"
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/reboot.h>
+#include <sys/devmap.h>
+#include <sys/physmem.h>
+
+#include <vm/vm.h>
+
+#include <machine/bus.h>
+#include <machine/intr.h>
+#include <machine/machdep.h>
+#include <machine/platformvar.h>
+
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/openfirm.h>
+
+#include <arm/qualcomm/ipq4018_machdep.h>
+#include <arm/qualcomm/ipq4018_reg.h>
+
+#include "platform_if.h"
+
+static int
+ipq4018_attach(platform_t plat)
+{
+ return (0);
+}
+
+static void
+ipq4018_late_init(platform_t plat)
+{
+ /*
+ * These cover the SRAM/TZ regions that are not fully
+ * accessible from the OS. They're in the ipq4018.dtsi
+ * tree.
+ *
+ * Without these, the system fails to boot because we
+ * aren't parsing the regions correctly.
+ *
+ * These will be unnecessary once the parser and setup
+ * code is fixed.
+ */
+ physmem_exclude_region(IPQ4018_MEM_SMEM_START,
+ IPQ4018_MEM_SMEM_SIZE,
+ EXFLAG_NODUMP | EXFLAG_NOALLOC);
+ physmem_exclude_region(IPQ4018_MEM_TZ_START,
+ IPQ4018_MEM_TZ_SIZE,
+ EXFLAG_NODUMP | EXFLAG_NOALLOC);
+}
+
+static int
+ipq4018_devmap_init(platform_t plat)
+{
+ /*
+ * This covers the boot UART. Without it we can't boot successfully:
+ * there's a mutex uninit panic in subr_vmem.c that occurs when doing
+ * a call to pmap_mapdev() when the bus space code is doing its thing.
+ */
+ devmap_add_entry(IPQ4018_MEM_UART1_START, IPQ4018_MEM_UART1_SIZE);
+ return (0);
+}
+
+static void
+ipq4018_cpu_reset(platform_t plat)
+{
+}
+
+/*
+ * Early putc routine for EARLY_PRINTF support. To use, add to kernel config:
+ * option SOCDEV_PA=0x07800000
+ * option SOCDEV_VA=0x07800000
+ * option EARLY_PRINTF
+ * Resist the temptation to change the #if 0 to #ifdef EARLY_PRINTF here. It
+ * makes sense now, but if multiple SOCs do that it will make early_putc another
+ * duplicate symbol to be eliminated on the path to a generic kernel.
+ */
+#if 0
+void
+qca_msm_early_putc(int c)
+{
+ static int is_init = 0;
+
+ int limit;
+/*
+ * This must match what's put into SOCDEV_VA. You have to change them
+ * both together.
+ *
+ * XXX TODO I should really go and just make UART_BASE here depend upon
+ * SOCDEV_VA so they move together.
+ */
+#define UART_BASE IPQ4018_MEM_UART1_START
+ volatile uint32_t * UART_DM_TF0 = (uint32_t *)(UART_BASE + 0x70);
+ volatile uint32_t * UART_DM_SR = (uint32_t *)(UART_BASE + 0x08);
+#define UART_DM_SR_TXEMT (1 << 3)
+#define UART_DM_SR_TXRDY (1 << 2)
+ volatile uint32_t * UART_DM_ISR = (uint32_t *)(UART_BASE + 0x14);
+ volatile uint32_t * UART_DM_CR = (uint32_t *)(UART_BASE + 0x10);
+#define UART_DM_TX_READY (1 << 7)
+#define UART_DM_CLEAR_TX_READY 0x300
+ volatile uint32_t * UART_DM_NO_CHARS_FOR_TX = (uint32_t *)(UART_BASE + 0x40);
+ volatile uint32_t * UART_DM_TFWR = (uint32_t *)(UART_BASE + 0x1c);
+#define UART_DM_TFW_VALUE 0
+ volatile uint32_t * UART_DM_IPR = (uint32_t *)(UART_BASE + 0x18);
+#define UART_DM_STALE_TIMEOUT_LSB 0xf
+
+ if (is_init == 0) {
+ is_init = 1;
+ *UART_DM_TFWR = UART_DM_TFW_VALUE;
+ wmb();
+ *UART_DM_IPR = UART_DM_STALE_TIMEOUT_LSB;
+ wmb();
+ }
+
+ /* Wait until TXFIFO is empty via ISR */
+ limit = 100000;
+ if ((*UART_DM_SR & UART_DM_SR_TXEMT) == 0) {
+ while (((*UART_DM_ISR & UART_DM_TX_READY) == 0) && --limit) {
+ /* Note - can't use DELAY here yet, too early */
+ rmb();
+ }
+ *UART_DM_CR = UART_DM_CLEAR_TX_READY;
+ wmb();
+ }
+
+ /* FIFO is ready. Say we're going to write one byte */
+ *UART_DM_NO_CHARS_FOR_TX = 1;
+ wmb();
+
+ limit = 100000;
+ while (((*UART_DM_SR & UART_DM_SR_TXRDY) == 0) && --limit) {
+ /* Note - can't use DELAY here yet, too early */
+ rmb();
+ }
+
+ /* Put character in first fifo slot */
+ *UART_DM_TF0 = c;
+ wmb();
+}
+early_putc_t *early_putc = qca_msm_early_putc;
+#endif
+
+static platform_method_t ipq4018_methods[] = {
+ PLATFORMMETHOD(platform_attach, ipq4018_attach),
+ PLATFORMMETHOD(platform_devmap_init, ipq4018_devmap_init),
+ PLATFORMMETHOD(platform_late_init, ipq4018_late_init),
+ PLATFORMMETHOD(platform_cpu_reset, ipq4018_cpu_reset),
+
+#ifdef SMP
+ PLATFORMMETHOD(platform_mp_start_ap, ipq4018_mp_start_ap),
+ PLATFORMMETHOD(platform_mp_setmaxid, ipq4018_mp_setmaxid),
+#endif
+
+ PLATFORMMETHOD_END,
+};
+
+FDT_PLATFORM_DEF2(ipq4018, ipq4018_ac58u, "ASUS RT-AC58U", 0,
+ "asus,rt-ac58u", 80);
Index: sys/arm/qualcomm/ipq4018_mp.c
===================================================================
--- /dev/null
+++ sys/arm/qualcomm/ipq4018_mp.c
@@ -0,0 +1,62 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2021 Adrian Chadd <adrian@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "opt_platform.h"
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/reboot.h>
+#include <sys/devmap.h>
+
+#include <vm/vm.h>
+
+#include <machine/bus.h>
+#include <machine/intr.h>
+#include <machine/machdep.h>
+#include <machine/platformvar.h>
+
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/openfirm.h>
+
+#include <arm/qualcomm/ipq4018_machdep.h>
+
+#include "platform_if.h"
+
+void
+ipq4018_mp_setmaxid(platform_t plat)
+{
+}
+
+void
+ipq4018_mp_start_ap(platform_t plat)
+{
+}
Index: sys/arm/qualcomm/ipq4018_reg.h
===================================================================
--- /dev/null
+++ sys/arm/qualcomm/ipq4018_reg.h
@@ -0,0 +1,43 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2021 Adrian Chadd <adrian@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef IPQ4018_REG_H
+#define IPQ4018_REG_H
+
+#define IPQ4018_MEM_SMEM_START 0x87e00000
+#define IPQ4018_MEM_SMEM_SIZE 0x00080000
+
+#define IPQ4018_MEM_TZ_START 0x87e80000
+#define IPQ4018_MEM_TZ_SIZE 0x00180000
+
+#define IPQ4018_MEM_UART1_START 0x078af000
+#define IPQ4018_MEM_UART1_SIZE 0x00001000
+
+#endif
Index: sys/arm/qualcomm/std.ipq4018
===================================================================
--- /dev/null
+++ sys/arm/qualcomm/std.ipq4018
@@ -0,0 +1,3 @@
+arm/qualcomm/ipq4018_machdep.c standard
+arm/qualcomm/ipq4018_mp.c standard
+
Index: sys/conf/options
===================================================================
--- sys/conf/options
+++ sys/conf/options
@@ -1029,3 +1029,6 @@
# This option is insecure except in controlled environments where the static
# environment's contents are known to be safe.
PRESERVE_EARLY_KENV opt_global.h
+
+# ARMv7 specific options
+ARMV7_FORCE_DBG_MONITOR_DISABLE opt_global.h
Index: sys/contrib/device-tree/include/dt-bindings/soc/qcom,tcsr.h
===================================================================
--- /dev/null
+++ sys/contrib/device-tree/include/dt-bindings/soc/qcom,tcsr.h
@@ -0,0 +1,50 @@
+/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+#ifndef __DT_BINDINGS_QCOM_TCSR_H
+#define __DT_BINDINGS_QCOM_TCSR_H
+
+#define TCSR_USB_SELECT_USB3_P0 0x1
+#define TCSR_USB_SELECT_USB3_P1 0x2
+#define TCSR_USB_SELECT_USB3_DUAL 0x3
+
+/* IPQ40xx HS PHY Mode Select */
+#define TCSR_USB_HSPHY_HOST_MODE 0x00E700E7
+#define TCSR_USB_HSPHY_DEVICE_MODE 0x00C700E7
+
+/* IPQ40xx ess interface mode select */
+#define TCSR_ESS_PSGMII 0
+#define TCSR_ESS_PSGMII_RGMII5 1
+#define TCSR_ESS_PSGMII_RMII0 2
+#define TCSR_ESS_PSGMII_RMII1 4
+#define TCSR_ESS_PSGMII_RMII0_RMII1 6
+#define TCSR_ESS_PSGMII_RGMII4 9
+
+/*
+ * IPQ40xx WiFi Global Config
+ * Bit 30:AXID_EN
+ * Enable AXI master bus Axid translating to confirm all txn submitted
+ * by order
+ *
+ * Bit 24: Use locally generated socslv_wxi_bvalid
+ * 1: use locally generate socslv_wxi_bvalid for performance.
+ * 0: use SNOC socslv_wxi_bvalid.
+ */
+#define TCSR_WIFI_GLB_CFG 0x41000000
+
+/* IPQ40xx MEM_TYPE_SEL_M0_M2 Select Bit 26:24 - 2 NORMAL */
+#define TCSR_WIFI_NOC_MEMTYPE_M0_M2 0x02222222
+
+/* TCSR A/B REG */
+#define IPQ806X_TCSR_REG_A_ADM_CRCI_MUX_SEL 0
+#define IPQ806X_TCSR_REG_B_ADM_CRCI_MUX_SEL 1
+
+#endif
Index: sys/contrib/device-tree/src/arm/qcom-ipq4018-rt-ac58u.dts
===================================================================
--- /dev/null
+++ sys/contrib/device-tree/src/arm/qcom-ipq4018-rt-ac58u.dts
@@ -0,0 +1,312 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qcom-ipq4019.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/soc/qcom,tcsr.h>
+
+/ {
+ model = "ASUS RT-AC58U";
+ compatible = "asus,rt-ac58u";
+
+ memory {
+ device_type = "memory";
+ reg = <0x80000000 0x8000000>;
+ };
+
+ aliases {
+ led-boot = &led_power;
+ led-failsafe = &led_power;
+ led-running = &led_power;
+ led-upgrade = &led_power;
+ serial0 = &blsp1_uart1;
+ };
+
+ chosen {
+ bootargs-append = " ubi.mtd=UBI_DEV";
+// stdout-path = "serial0:115200n8";
+ stdout-path = "serial0";
+ };
+
+ soc {
+ rng@22000 {
+ status = "okay";
+ };
+
+ mdio@90000 {
+ status = "okay";
+ };
+
+ ess-psgmii@98000 {
+ status = "okay";
+ };
+
+ tcsr@1949000 {
+ compatible = "qcom,tcsr";
+ reg = <0x1949000 0x100>;
+ qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
+ };
+
+ tcsr@194b000 {
+ compatible = "qcom,tcsr";
+ reg = <0x194b000 0x100>;
+ qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
+ };
+
+ ess_tcsr@1953000 {
+ compatible = "qcom,tcsr";
+ reg = <0x1953000 0x1000>;
+ qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
+ };
+
+ tcsr@1957000 {
+ compatible = "qcom,tcsr";
+ reg = <0x1957000 0x100>;
+ qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
+ };
+
+ usb3@8af8800 {
+ status = "okay";
+
+ dwc3@8a00000 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ usb3_port1: port@1 {
+ reg = <1>;
+ #trigger-source-cells = <0>;
+ };
+
+ usb3_port2: port@2 {
+ reg = <2>;
+ #trigger-source-cells = <0>;
+ };
+ };
+ };
+
+ crypto@8e3a000 {
+ status = "okay";
+ };
+
+ watchdog@b017000 {
+ status = "okay";
+ };
+
+ ess-switch@c000000 {
+ status = "okay";
+ };
+
+ edma@c080000 {
+ status = "okay";
+ };
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ gpios = <&tlmm 4 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+
+ wps {
+ label = "wps";
+ gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_WPS_BUTTON>;
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led_power: status {
+ label = "blue:status";
+ gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
+ };
+
+ wan {
+ label = "blue:wan";
+ gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>;
+ };
+
+ wlan2G {
+ label = "blue:wlan2G";
+ gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "phy0tpt";
+ };
+
+ wlan5G {
+ label = "blue:wlan5G";
+ gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "phy1tpt";
+ };
+
+ usb {
+ label = "blue:usb";
+ gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
+ trigger-sources = <&usb3_port1>, <&usb3_port2>;
+ linux,default-trigger = "usbport";
+ };
+
+ lan {
+ label = "blue:lan";
+ gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>;
+ };
+ };
+};
+
+&cryptobam {
+ status = "okay";
+};
+
+&blsp_dma {
+ status = "okay";
+};
+
+&tlmm {
+ serial_pins: serial_pinmux {
+ mux {
+ pins = "gpio60", "gpio61";
+ function = "blsp_uart0";
+ bias-disable;
+ };
+ };
+
+ spi_0_pins: spi_0_pinmux {
+ mux {
+ function = "blsp_spi0";
+ pins = "gpio55", "gpio56", "gpio57";
+ drive-strength = <12>;
+ bias-disable;
+ };
+
+ mux_cs {
+ function = "gpio";
+ pins = "gpio54", "gpio59";
+ drive-strength = <2>;
+ bias-disable;
+ output-high;
+ };
+ };
+};
+
+&blsp1_spi1 { /* BLSP1 QUP1 */
+ pinctrl-0 = <&spi_0_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+ cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>,
+ <&tlmm 59 GPIO_ACTIVE_HIGH>;
+
+ flash@0 {
+ /*
+ * U-boot looks for "n25q128a11" node,
+ * if we don't have it, it will spit out the following warning:
+ * "ipq: fdt fixup unable to find compatible node".
+ */
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ linux,modalias = "m25p80", "mx25l1606e", "n25q128a11";
+ spi-max-frequency = <30000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "SBL1";
+ reg = <0x00000000 0x00040000>;
+ read-only;
+ };
+ partition@40000 {
+ label = "MIBIB";
+ reg = <0x00040000 0x00020000>;
+ read-only;
+ };
+ partition@60000 {
+ label = "QSEE";
+ reg = <0x00060000 0x00060000>;
+ read-only;
+ };
+ partition@c0000 {
+ label = "CDT";
+ reg = <0x000c0000 0x00010000>;
+ read-only;
+ };
+ partition@d0000 {
+ label = "DDRPARAMS";
+ reg = <0x000d0000 0x00010000>;
+ read-only;
+ };
+ partition@e0000 {
+ label = "APPSBLENV"; /* uboot env*/
+ reg = <0x000e0000 0x00010000>;
+ read-only;
+ };
+ partition@f0000 {
+ label = "APPSBL"; /* uboot */
+ reg = <0x000f0000 0x00080000>;
+ read-only;
+ };
+ partition@170000 {
+ label = "ART";
+ reg = <0x00170000 0x00010000>;
+ read-only;
+ };
+ /* 0x00180000 - 0x00200000 unused */
+ };
+ };
+
+ spi-nand@1 {
+ compatible = "spi-nand";
+ reg = <1>;
+ spi-max-frequency = <30000000>;
+
+ /*
+ * U-boot looks for "spinand,mt29f" node,
+ * if we don't have it, it will spit out the following warning:
+ * "ipq: fdt fixup unable to find compatible node".
+ */
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ /*
+ * TODO: change to label = "ubi" once we drop 4.14.
+ * also drop the bootargs-append and all the
+ * userspace CI_UBIPART="UBI_DEV" remains.
+ */
+ label = "UBI_DEV";
+ reg = <0x00000000 0x08000000>;
+ };
+ };
+ };
+};
+
+&blsp1_uart1 {
+ pinctrl-0 = <&serial_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+};
+
+&usb3_ss_phy {
+ status = "okay";
+};
+
+&usb3_hs_phy {
+ status = "okay";
+};
+
+&wifi0 {
+ status = "okay";
+ qcom,ath10k-calibration-variant = "RT-AC58U";
+};
+
+&wifi1 {
+ status = "okay";
+ qcom,ath10k-calibration-variant = "RT-AC58U";
+};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 28, 3:04 AM (1 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30455319
Default Alt Text
D32538.id97009.diff (23 KB)
Attached To
Mode
D32538: ipq4018: add initial IPQ4018/IPQ4019 support
Attached
Detach File
Event Timeline
Log In to Comment