// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2022 MediaTek Inc.
 * Author: Sam Shih <sam.shih@mediatek.com>
 */

/dts-v1/;
#include "mt7988.dtsi"
#include <dt-bindings/gpio/gpio.h>

/ {
	model = "mt7988-rfb";
	compatible = "mediatek,mt7988-rfb";
	chosen {
		stdout-path = &uart0;
	};

	memory@40000000 {
		device_type = "memory";
		reg = <0 0x40000000 0 0x10000000>;
	};
};

&uart0 {
	status = "okay";
};

&eth {
	status = "okay";
	mediatek,gmac-id = <2>;
	phy-mode = "usxgmii";
	phy-handle = <&phy8>;

	phy8: eth-phy@8 {
		compatible = "ethernet-phy-id31c3.1c12";
		reg = <8>;
		reset-gpios = <&gpio 71 GPIO_ACTIVE_LOW>;
		reset-assert-us = <100000>;
		reset-deassert-us = <2210000>;
	};
};

&pinctrl {
	pwm_pins: pwm-pins {
		mux {
			function = "pwm";
			groups = "pwm0", "pwm1", "pwm2", "pwm3", "pwm4",
				 "pwm5", "pwm6", "pwm7";
		};
	};
};

&pwm {
	pinctrl-names = "default";
	pinctrl-0 = <&pwm_pins>;
	status = "okay";
};

&spi0 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	must_tx;
	enhance_timing;
	dma_ext;
	ipm_design;
	support_quad;
	tick_dly = <2>;
	sample_sel = <0>;

	spi_nand@0 {
		compatible = "spi-nand";
		reg = <0>;
		spi-max-frequency = <52000000>;
	};
};

&spi2 {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	must_tx;
	enhance_timing;
	dma_ext;
	ipm_design;
	support_quad;
	tick_dly = <2>;
	sample_sel = <0>;

	spi_nor@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <52000000>;
	};
};
