// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "vr9_avm_fritz736x.dtsi"

/ {
	compatible = "avm,fritz7360sl", "avm,fritz736x", "lantiq,xway", "lantiq,vr9";
	model = "AVM FRITZ!Box 7360 SL";
};

&gpio {
	pinctrl-names = "default";
	pinctrl-0 = <&state_default>;

	state_default: pinmux {
		pcie-rst {
			lantiq,pins = "io21";
			lantiq,pull = <0>;
			lantiq,output = <1>;
		};

		phy-rst {
			lantiq,pins = "io37", "io44";
			lantiq,pull = <0>;
			lantiq,open-drain;
			lantiq,output = <1>;
		};
	};

};

&localbus {
	flash@0 {
		compatible = "lantiq,nor";
		bank-width = <2>;
		reg = <0 0x0 0x1000000>;

		partitions {
			#address-cells = <1>;
			#size-cells = <1>;
			compatible = "fixed-partitions";

			urlader: partition@0 {
				label = "urlader";
				reg = <0x00000 0x20000>;
				read-only;

				nvmem-layout {
					compatible = "fixed-layout";
					#address-cells = <1>;
					#size-cells = <1>;

					macaddr_urlader_a91: macaddr@a91 {
						compatible = "mac-base";
						reg = <0xa91 0x6>;
						#nvmem-cell-cells = <1>;
					};
				};
			};

			partition@20000 {
				label = "firmware";
				reg = <0x20000 0xf60000>;
			};

			partition@f80000 {
				label = "tffs (1)";
				reg = <0xf80000 0x40000>;
				read-only;
			};

			partition@fc0000 {
				label = "tffs (2)";
				reg = <0xfc0000 0x40000>;
				read-only;
			};
		};
	};
};

&eth0 {
	nvmem-cells = <&macaddr_urlader_a91 (-2)>;
	nvmem-cell-names = "mac-address";
};

&phy0 {
	reset-gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
};

&phy1 {
	reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
};
