code:
// SPDX-License-Identifier: GPL-2.0+
/*
 * Device Tree file for Lenovo Hr855xg2 platform
 *
 * Copyright (C) 2019-present Lenovo
 */

/dts-v1/;

#include "aspeed-g5.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>

/ {
	model = "HR855XG2 BMC";
	compatible = "lenovo,hr855xg2-bmc", "aspeed,ast2500";

	aliases {
		i2c14 = &i2c_riser1;
		i2c15 = &i2c_riser2;
		i2c16 = &i2c_riser3;
		i2c17 = &i2c_M2;
		i2c18 = &channel_0;
		i2c19 = &channel_1;
		i2c20 = &channel_2;
		i2c21 = &channel_3;
	};

	chosen {
		stdout-path = &uart5;
		bootargs = "console=tty0 console=ttyS4,115200 earlycon";
	};

	memory@80000000 {
		device_type = "memory";
		reg = <0x80000000 0x20000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		flash_memory: region@98000000 {
			no-map;
			reg = <0x98000000 0x00100000>; /* 1M */
		};

		gfx_memory: framebuffer {
			size = <0x01000000>;
			alignment = <0x01000000>;
			compatible = "shared-dma-pool";
			reusable;
		};
	};

	leds {
		compatible = "gpio-leds";

		heartbeat {
			gpios = <&gpio ASPEED_GPIO(C, 7) GPIO_ACTIVE_LOW>;
		};

		fault {
			gpios = <&gpio ASPEED_GPIO(G, 3) GPIO_ACTIVE_LOW>;
		};
	};

	iio-hwmon {
		compatible = "iio-hwmon";
		io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
		<&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>,
		<&adc 8>, <&adc 9>, <&adc 10>,<&adc 11>,
		<&adc 12>,<&adc 13>,<&adc 14>;
	};

	iio-hwmon-battery {
		compatible = "iio-hwmon";
		io-channels = <&adc 15>;
	};

};

&fmc {
	status = "okay";
	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "bmc";
		spi-max-frequency = <50000000>;
#include "openbmc-flash-layout.dtsi"
	};
};

&lpc_ctrl {
	status = "okay";
	memory-region = <&flash_memory>;
	flash = <&spi1>;
};

&lpc_snoop {
	status = "okay";
	snoop-ports = <0x80>;
};

&uart1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd1_default
			&pinctrl_rxd1_default>;
};

&uart2 {
	/* Rear RS-232 connector */
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd2_default
			&pinctrl_rxd2_default
			&pinctrl_nrts2_default
			&pinctrl_ndtr2_default
			&pinctrl_ndsr2_default
			&pinctrl_ncts2_default
			&pinctrl_ndcd2_default
			&pinctrl_nri2_default>;
};

&uart3 {
	status = "okay";
};

&uart5 {
	status = "okay";
};

&ibt {
	status = "okay";
};

&mac0 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rmii1_default>;
	clocks = <&syscon ASPEED_CLK_GATE_MAC1CLK>,
		 <&syscon ASPEED_CLK_MAC1RCLK>;
	clock-names = "MACCLK", "RCLK";
	use-ncsi;
};

&mac1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rgmii2_default &pinctrl_mdio2_default>;
};

&adc{
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_adc0_default
			&pinctrl_adc1_default
			&pinctrl_adc2_default
			&pinctrl_adc3_default
			&pinctrl_adc4_default
			&pinctrl_adc5_default
			&pinctrl_adc6_default
			&pinctrl_adc7_default
			&pinctrl_adc8_default
			&pinctrl_adc9_default
			&pinctrl_adc10_default
			&pinctrl_adc11_default
			&pinctrl_adc12_default
			&pinctrl_adc13_default
			&pinctrl_adc14_default
			&pinctrl_adc15_default>;
};

&i2c0 {
	status = "okay";

	i2c-switch@70 {
		compatible = "nxp,pca9545";
		reg = <0x70>;
		#address-cells = <1>;
		#size-cells = <0>;

		i2c_riser1: i2c@0 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0>;
		};

		i2c_riser2: i2c@1 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <1>;
		};

		i2c_riser3: i2c@2 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <2>;
		};

		i2c_M2: i2c@3 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <3>;
		};
	};
};

&i2c1 {
	status = "okay";
	bus-frequency = <90000>;
	HotSwap@10 {
		compatible = "adm1272";
		reg = <0x10>;
	};

	VR@45 {
		compatible = "pmbus";
		reg = <0x45>;
	};
};

&i2c2 {
	status = "okay";
};

&i2c3 {
	status = "okay";
	i2c-switch@70 {
		compatible = "nxp,pca9546";
		reg = <0x70>;
		#address-cells = <1>;
		#size-cells = <0>;

		channel_0: i2c@0 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0>;
		};

		channel_1: i2c@1 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <1>;
		};

		channel_2: i2c@2 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <2>;
		};

		channel_3: i2c@3 {
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <3>;
		};
	};
};

&i2c4 {
	status = "okay";
};

&i2c5 {
	status = "okay";
};

&i2c6 {
	status = "okay";
	/* temp1 */
	tmp75@49 {
		compatible = "national,lm75";
		reg = <0x49>;
	};

	/* temp2 */
	tmp75@4d {
		compatible = "national,lm75";
		reg = <0x4d>;
	};

	eeprom@54 {
		compatible = "atmel,24c256";
		reg = <0x54>;
		pagesize = <16>;
	};
};

&i2c7 {
	status = "okay";
};

&i2c8 {
	status = "okay";
};

&i2c9 {
	status = "okay";
};

&i2c10 {
	status = "okay";
};

&i2c11 {
	status = "okay";
};

&i2c13 {
	status = "okay";
};

&ehci1 {
	status = "okay";
};

&uhci {
	status = "okay";
};

&gfx {
	status = "okay";
	memory-region = <&gfx_memory>;
};

&pwm_tacho {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pwm0_default
	&pinctrl_pwm1_default
	&pinctrl_pwm2_default
	&pinctrl_pwm3_default
	&pinctrl_pwm4_default
	&pinctrl_pwm5_default
	&pinctrl_pwm6_default
	&pinctrl_pwm7_default>;

	fan@0 {
		reg = <0x00>;
		aspeed,fan-tach-ch = /bits/ 8 <0x00>;
	};

	fan@1 {
		reg = <0x00>;
		aspeed,fan-tach-ch = /bits/ 8 <0x01>;
	};

	fan@2 {
		reg = <0x01>;
		aspeed,fan-tach-ch = /bits/ 8 <0x02>;
	};

	fan@3 {
		reg = <0x01>;
		aspeed,fan-tach-ch = /bits/ 8 <0x03>;
	};

	fan@4 {
		reg = <0x02>;
		aspeed,fan-tach-ch = /bits/ 8 <0x04>;
	};

	fan@5 {
		reg = <0x02>;
		aspeed,fan-tach-ch = /bits/ 8 <0x05>;
	};

	fan@6 {
		reg = <0x03>;
		aspeed,fan-tach-ch = /bits/ 8 <0x06>;
	};

	fan@7 {
		reg = <0x03>;
		aspeed,fan-tach-ch = /bits/ 8 <0x07>;
	};

	fan@8 {
		reg = <0x04>;
		aspeed,fan-tach-ch = /bits/ 8 <0x08>;
	};

	fan@9 {
		reg = <0x04>;
		aspeed,fan-tach-ch = /bits/ 8 <0x09>;
	};

	fan@10 {
		reg = <0x05>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0a>;
	};

	fan@11 {
		reg = <0x05>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0b>;
	};

	fan@12 {
		reg = <0x06>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0c>;
	};

	fan@13 {
		reg = <0x06>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0d>;
	};

	fan@14 {
		reg = <0x07>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0e>;
	};

	fan@15 {
		reg = <0x07>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0f>;
	};

	fan@16 {
		reg = <0x07>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0f>;
	};
};

&gpio {

	pin_gpio_a1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(A, 1) GPIO_ACTIVE_LOW>;
		output-high;
		line-name = "BMC_EMMC_RST_N";
	};

	pin_gpio_a3 {
		gpio-hog;
		gpios = <ASPEED_GPIO(A, 3) GPIO_ACTIVE_LOW>;
		output-high;
		line-name = "PCH_PWROK_BMC_FPGA";
	};

	pin_gpio_b5 {
		gpio-hog;
		gpios = <ASPEED_GPIO(B, 5) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "IRQ_BMC_PCH_SMI_LPC_N";
	};

	pin_gpio_b7 {
		gpio-hog;
		gpios = <ASPEED_GPIO(B, 7) GPIO_ACTIVE_LOW>;
		output-low;
		line-name = "CPU_SM_WP";
	};

	pin_gpio_e0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(E, 0) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "PDB_PSU_SEL";
	};

	pin_gpio_e2 {
		gpio-hog;
		gpios = <ASPEED_GPIO(E, 2) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "LOCATOR_LED_N";
	};

	pin_gpio_e5 {
		gpio-hog;
		gpios = <ASPEED_GPIO(E, 5) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "FM_BMC_DBP_PRESENT_R1_N";
	};

	pin_gpio_e6 {
		gpio-hog;
		gpios = <ASPEED_GPIO(E, 6) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_ME_SECURITY_OVERRIDE_N";
	};

	pin_gpio_f0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(F, 0) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "IRQ_BMC_PCH_NMI_R";
	};

	pin_gpio_f1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(F, 1) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "CPU2_PROCDIS_BMC_N";
	};

	pin_gpio_f2 {
		gpio-hog;
		gpios = <ASPEED_GPIO(F, 2) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "RM_THROTTLE_EN_N";
	};

	pin_gpio_f3 {
		gpio-hog;
		gpios = <ASPEED_GPIO(F, 3) GPIO_ACTIVE_HIGH>;
		output-low;
		line-name = "FM_PMBUS_ALERT_B_EN";
	};

	pin_gpio_f4 {
		gpio-hog;
		gpios = <ASPEED_GPIO(F, 4) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_FORCE_NM_THROTTLE_N";
	};

	pin_gpio_f6 {
		gpio-hog;
		gpios = <ASPEED_GPIO(F, 6) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "FM_BMC_CPU_PWR_DEBUG_N";
	};

	pin_gpio_g7 {
		gpio-hog;
		gpios = <ASPEED_GPIO(G, 7) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_PCIE_I2C_MUX_RST_N";
	};

	pin_gpio_h6 {
		gpio-hog;
		gpios = <ASPEED_GPIO(H, 6) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "FM_BMC_DBP_PRESENT_R2_N";
	};

	pin_gpio_i3 {
		gpio-hog;
		gpios = <ASPEED_GPIO(I, 3) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "SPI_BMC_BIOS_WP_N";
	};

	pin_gpio_j1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(J, 1) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_USB_SEL";
	};

	pin_gpio_j2 {
		gpio-hog;
		gpios = <ASPEED_GPIO(J, 2) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "PDB_SMB_RST_N";
	};

	pin_gpio_j3 {
		gpio-hog;
		gpios = <ASPEED_GPIO(J, 3) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "SPI_BMC_BIOS_HOLD_N";
	};

	pin_gpio_l0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(L, 0) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "PDB_FAN_TACH_SEL";
	};

	pin_gpio_l1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(L, 1) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "SYS_RESET_BMC_FPGA_N";
	};

	pin_gpio_l4 {
		gpio-hog;
		gpios = <ASPEED_GPIO(L, 4) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "FM_EFUSE_FAN_G1_EN";
	};

	pin_gpio_l5 {
		gpio-hog;
		gpios = <ASPEED_GPIO(L, 5) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "FM_EFUSE_FAN_G2_EN";
	};

	pin_gpio_r6 {
		gpio-hog;
		gpios = <ASPEED_GPIO(R, 6) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "CPU3_PROCDIS_BMC_N";
	};

	pin_gpio_r7 {
		gpio-hog;
		gpios = <ASPEED_GPIO(R, 7) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "CPU4_PROCDIS_BMC_N";
	};

	pin_gpio_s1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(S, 1) GPIO_ACTIVE_HIGH>;
		output-low;
		line-name = "DBP_SYSPWROK_BMC";
	};

	pin_gpio_s2 {
		gpio-hog;
		gpios = <ASPEED_GPIO(S, 2) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "PCH_RST_RSMRST_N";
	};

	pin_gpio_s6 {
		gpio-hog;
		gpios = <ASPEED_GPIO(S, 6) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_HW_STRAP_5";
	};

	pin_gpio_z3 {
		gpio-hog;
		gpios = <ASPEED_GPIO(Z, 3) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "FM_BMC_PCH_SCI_LPC_N";
	};

	pin_gpio_aa0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(AA, 0) GPIO_ACTIVE_HIGH>;
		output-low;
		line-name = "FW_PSU_ALERT_EN_N";
	};

	pin_gpio_aa4 {
		gpio-hog;
		gpios = <ASPEED_GPIO(AA, 4) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "DBP_CPU_PREQ_N";
	};

	pin_gpio_ab3 {
		gpio-hog;
		gpios = <ASPEED_GPIO(AB, 3) GPIO_ACTIVE_HIGH>;
		output-low;
		line-name = "BMC_WDTRST";
	};

	pin_gpio_ac6 {
		gpio-hog;
		gpios = <ASPEED_GPIO(AC, 6) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "ESPI_BMC_ALERT_N";
	};

};


code:
//SPDX-License-Identifier: GPL-2.0+

/dts-v1/;

#include "aspeed-g4.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>

/ {
	model = "Olympus BMC";
	compatible = "microsoft,olympus-bmc", "aspeed,ast2400";

	chosen {
		stdout-path = &uart5;
		bootargs = "console=ttyS4,115200 earlycon";
	};

	memory@40000000 {
		reg = <0x40000000 0x20000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		vga_memory: framebuffer@5f000000 {
			no-map;
			reg = <0x5f000000 0x01000000>; /* 16M */
		};
	};

	leds {
		compatible = "gpio-leds";

		bmc_heartbeat {
			gpios = <&gpio ASPEED_GPIO(B, 0) GPIO_ACTIVE_LOW>;
		};

		power_green {
			gpios = <&gpio ASPEED_GPIO(U, 2) GPIO_ACTIVE_HIGH>;
		};

		power_amber {
			gpios = <&gpio ASPEED_GPIO(U, 3) GPIO_ACTIVE_HIGH>;
		};

		identify {
			gpios = <&gpio ASPEED_GPIO(Q, 5) GPIO_ACTIVE_LOW>;
		};

		fault {
			gpios = <&gpio ASPEED_GPIO(A, 1) GPIO_ACTIVE_LOW>;
		};
	};

	iio-hwmon {
		compatible = "iio-hwmon";
		io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
		<&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>;
	};
};

&adc {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 =    <&pinctrl_adc0_default
			&pinctrl_adc1_default
			&pinctrl_adc2_default
			&pinctrl_adc3_default
			&pinctrl_adc4_default
			&pinctrl_adc5_default
			&pinctrl_adc6_default
			&pinctrl_adc7_default>;
};

&fmc {
	status = "okay";

	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "bmc";
#include "openbmc-flash-layout.dtsi"
	};
};

&spi {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1_default>;

	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "pnor";
	};
};

&uart5 {
	status = "okay";
};

&mac0 {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rgmii1_default &pinctrl_mdio1_default>;
};

&i2c0 {
	status = "okay";
};

&i2c1 {
	status = "okay";

	tmp421@4c {
		compatible = "ti,tmp421";
		reg = <0x4c>;
	};
};

&i2c2 {
	status = "okay";
};

&i2c3 {
	status = "okay";
};

&i2c4 {
	status = "okay";
	clock-frequency = <100000>;
};

&i2c5 {
	status = "okay";
};

&i2c6 {
	status = "okay";

	tmp421@4c {
		compatible = "ti,tmp421";
		reg = <0x4c>;
	};
};

&i2c7 {
	status = "okay";
};

&vuart {
	status = "okay";
};

&wdt2 {
	status = "okay";
};

&lpc_ctrl {
	status = "okay";
};

&pwm_tacho {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 =    <&pinctrl_pwm0_default
			&pinctrl_pwm1_default
			&pinctrl_pwm2_default
			&pinctrl_pwm3_default
			&pinctrl_pwm4_default
			&pinctrl_pwm5_default
			&pinctrl_pwm6_default>;

	fan@0 {
		reg = <0x00>;
		aspeed,fan-tach-ch = /bits/ 8 <0x00>;
	};

	fan@1 {
		reg = <0x01>;
		aspeed,fan-tach-ch = /bits/ 8 <0x01>;
	};

	fan@2 {
		reg = <0x02>;
		aspeed,fan-tach-ch = /bits/ 8 <0x02>;
	};

	fan@3 {
		reg = <0x03>;
		aspeed,fan-tach-ch = /bits/ 8 <0x03>;
	};

	fan@4 {
		reg = <0x04>;
		aspeed,fan-tach-ch = /bits/ 8 <0x04>;
	};

	fan@5 {
		reg = <0x05>;
		aspeed,fan-tach-ch = /bits/ 8 <0x05>;
	};

};

repo_name: angery/linux


code:
// SPDX-License-Identifier: GPL-2.0+
// Copyright (c) 2018 Inventec Corporation
/dts-v1/;

#include "aspeed-g5.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>

/ {
	model = "Lanyang BMC";
	compatible = "inventec,lanyang-bmc", "aspeed,ast2500";

	chosen {
		stdout-path = &uart5;
		bootargs = "console=ttyS4,115200 earlycon";
	};

	memory@80000000 {
		reg = <0x80000000 0x40000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		flash_memory: region@98000000 {
			no-map;
			reg = <0x98000000 0x04000000>; /* 64M */
		};
	};

	leds {
		compatible = "gpio-leds";

		sys_boot_status {
			label = "System_boot_status";
			gpios = <&gpio ASPEED_GPIO(B, 6) GPIO_ACTIVE_LOW>;
		};

		attention {
			label = "Attention_locator";
			gpios = <&gpio ASPEED_GPIO(B, 7) GPIO_ACTIVE_HIGH>;
		};

		plt_fault {
			label = "Platform_fault";
			gpios = <&gpio ASPEED_GPIO(B, 1) GPIO_ACTIVE_HIGH>;
		};

		hdd_fault {
			label = "Onboard_drive_fault";
			gpios = <&gpio ASPEED_GPIO(B, 3) GPIO_ACTIVE_HIGH>;
		};
		bmc_err {
			lable = "BMC_fault";
			gpios = <&gpio ASPEED_GPIO(H, 6) GPIO_ACTIVE_HIGH>;
		};

		sys_err {
			lable = "Sys_fault";
			gpios = <&gpio ASPEED_GPIO(H, 7) GPIO_ACTIVE_HIGH>;
		};
	};

	fsi: gpio-fsi {
		compatible = "fsi-master-gpio", "fsi-master";
		#address-cells = <2>;
		#size-cells = <0>;

		clock-gpios = <&gpio ASPEED_GPIO(J, 0) GPIO_ACTIVE_HIGH>;
		data-gpios = <&gpio ASPEED_GPIO(J, 1) GPIO_ACTIVE_HIGH>;
		trans-gpios = <&gpio ASPEED_GPIO(D, 5) GPIO_ACTIVE_HIGH>;
		enable-gpios = <&gpio ASPEED_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
		mux-gpios = <&gpio ASPEED_GPIO(H, 2) GPIO_ACTIVE_HIGH>;
	};

	iio-hwmon {
		compatible = "iio-hwmon";
		io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>,
			<&adc 4>, <&adc 5>, <&adc 6>, <&adc 7>,
			<&adc 8>, <&adc 9>, <&adc 10>, <&adc 11>,
			<&adc 13>, <&adc 14>, <&adc 15>;
	};

	iio-hwmon-battery {
		compatible = "iio-hwmon";
		io-channels = <&adc 12>;
	};
};

&pwm_tacho {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default
		&pinctrl_pwm2_default &pinctrl_pwm3_default>;

	fan@0 {
		reg = <0x00>;
		aspeed,fan-tach-ch = /bits/ 8 <0x00>;
	};

	fan@1 {
		reg = <0x01>;
		aspeed,fan-tach-ch = /bits/ 8 <0x01>;
	};

	fan@2 {
		reg = <0x02>;
		aspeed,fan-tach-ch = /bits/ 8 <0x02>;
	};

	fan@3 {
		reg = <0x03>;
		aspeed,fan-tach-ch = /bits/ 8 <0x03>;
	};
};

&fmc {
	status = "okay";
	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "bmc";
#include "openbmc-flash-layout.dtsi"
	};
};

&spi1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1_default>;

	flash@0 {
		status = "okay";
		label = "pnor";
		m25p,fast-read;
	};
};

&spi2 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi2ck_default
		     &pinctrl_spi2cs0_default
		     &pinctrl_spi2cs1_default
		     &pinctrl_spi2miso_default
		     &pinctrl_spi2mosi_default>;

	flash@0 {
		status = "okay";
	};
};

&uart1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd1_default
		     &pinctrl_rxd1_default>;
};

&lpc_ctrl {
	status = "okay";
	memory-region = <&flash_memory>;
	flash = <&spi1>;
};

&lpc_snoop {
	status = "okay";
	snoop-ports = <0x80>;
};

&uart5 {
	status = "okay";
};

&mac0 {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rmii1_default>;
	clocks = <&syscon ASPEED_CLK_GATE_MAC1CLK>,
		 <&syscon ASPEED_CLK_MAC1RCLK>;
	clock-names = "MACCLK", "RCLK";
	use-ncsi;
};

&mac1 {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rgmii2_default &pinctrl_mdio2_default>;
};

&i2c0 {
	status = "okay";

	eeprom@55 {
		compatible = "atmel,24c64";
		reg = <0x55>;
		pagesize = <32>;
	};

	rtc@68 {
		compatible = "nxp,pcf8523";
		reg = <0x68>;
	};

	tmp75@48 {
		compatible = "ti,tmp75";
		reg = <0x48>;
	};
};

&i2c1 {
	status = "okay";
};

&i2c2 {
	status = "okay";
};

&i2c3 {
	status = "okay";
};

&i2c4 {
	status = "okay";
};

&i2c5 {
	status = "okay";
};

&i2c6 {
	status = "okay";
};

&i2c7 {
	status = "okay";
};

&i2c8 {
	status = "okay";
};

&i2c9 {
	status = "okay";
};

&i2c10 {
	status = "okay";
};

&i2c11 {
	status = "okay";
};

&vuart {
	status = "okay";
};

&gfx {
	status = "okay";
};

&pinctrl {
	aspeed,external-nodes = <&gfx &lhc>;
};

&gpio {
	pin_gpio_b0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(B, 0) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_HDD1_PWR_EN";
	};

	pin_gpio_b5 {
		gpio-hog;
		gpios = <ASPEED_GPIO(B, 5) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "BMC_USB1_OCI2";
	};

	pin_gpio_h5 {
		gpio-hog;
		gpios = <ASPEED_GPIO(H, 5) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_CP0_PERST_ENABLE_R";
	};

	pin_gpio_z2 {
		gpio-hog;
		gpios = <ASPEED_GPIO(Z, 2) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "RST_PCA9546_U177_N";
	};

	pin_gpio_aa6 {
		gpio-hog;
		gpios = <ASPEED_GPIO(AA, 6) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_CP0_RESET_N";
	};

	pin_gpio_aa7 {
		gpio-hog;
		gpios = <ASPEED_GPIO(AA, 7) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_TPM_RESET_N";
	};

	pin_gpio_ab0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(AB, 0) GPIO_ACTIVE_LOW>;
		output-high;
		line-name = "BMC_USB_PWRON_N";
	};
};

&ibt {
	status = "okay";
};

&adc {
	status = "okay";
};

#include "ibm-power9-dual.dtsi"


code:
// SPDX-License-Identifier: GPL-2.0+
/dts-v1/;
#include "aspeed-g5.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>
#include <dt-bindings/leds/leds-pca955x.h>

/ {
	model = "Mowgli BMC";
	compatible = "ibm,mowgli-bmc", "aspeed,ast2500";

	chosen {
		stdout-path = &uart5;
		bootargs = "console=ttyS4,115200 earlycon";
	};

	memory@80000000 {
		reg = <0x80000000 0x20000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		flash_memory: region@98000000 {
			no-map;
			reg = <0x98000000 0x04000000>; /* 64M */
		};

		gfx_memory: framebuffer {
			size = <0x01000000>;
			alignment = <0x01000000>;
			compatible = "shared-dma-pool";
			reusable;
		};

		video_engine_memory: jpegbuffer {
			size = <0x02000000>;
			alignment = <0x01000000>;
			compatible = "shared-dma-pool";
			reusable;
		};
	};

	gpio-keys {
		compatible = "gpio-keys";

		event-air-water {
			label = "air-water";
			gpios = <&gpio ASPEED_GPIO(F, 6) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(F, 6)>;
		};

		event-checkstop {
			label = "checkstop";
			gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(J, 2)>;
		};

		event-ps0-presence {
			label = "ps0-presence";
			gpios = <&gpio ASPEED_GPIO(Z, 2) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(Z, 2)>;
		};

		event-ps1-presence {
			label = "ps1-presence";
			gpios = <&gpio ASPEED_GPIO(Z, 0) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(Z, 0)>;
		};

		button-id {
			label = "id-button";
			gpios = <&gpio ASPEED_GPIO(F, 1) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(F, 1)>;
		};
	};

	gpio-keys-polled {
		compatible = "gpio-keys-polled";
		poll-interval = <1000>;

		event-fan0-presence {
			label = "fan0-presence";
			gpios = <&pca9552 9 GPIO_ACTIVE_LOW>;
			linux,code = <9>;
		};

		event-fan1-presence {
			label = "fan1-presence";
			gpios = <&pca9552 10 GPIO_ACTIVE_LOW>;
			linux,code = <10>;
		};

		event-fan2-presence {
			label = "fan2-presence";
			gpios = <&pca9552 11 GPIO_ACTIVE_LOW>;
			linux,code = <11>;
		};

		event-fan3-presence {
			label = "fan3-presence";
			gpios = <&pca9552 12 GPIO_ACTIVE_LOW>;
			linux,code = <12>;
		};

		event-fan4-presence {
			label = "fan4-presence";
			gpios = <&pca9552 13 GPIO_ACTIVE_LOW>;
			linux,code = <13>;
		};
	};

	leds {
		compatible = "gpio-leds";

		front-fault {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&gpio ASPEED_GPIO(AA, 0) GPIO_ACTIVE_LOW>;
		};

		power-button {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&gpio ASPEED_GPIO(AA, 1) GPIO_ACTIVE_LOW>;
		};

		front-id {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&gpio ASPEED_GPIO(AA, 2) GPIO_ACTIVE_LOW>;
		};

		fan0 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca9552 0 GPIO_ACTIVE_LOW>;
		};

		fan1 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca9552 1 GPIO_ACTIVE_LOW>;
		};

		fan2 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca9552 2 GPIO_ACTIVE_LOW>;
		};

		fan3 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca9552 3 GPIO_ACTIVE_LOW>;
		};

		fan4 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca9552 4 GPIO_ACTIVE_LOW>;
		};
	};

	fsi: gpio-fsi {
		compatible = "fsi-master-gpio", "fsi-master";
		#address-cells = <2>;
		#size-cells = <0>;
		no-gpio-delays;

		clock-gpios = <&gpio ASPEED_GPIO(E, 6) GPIO_ACTIVE_HIGH>;
		data-gpios = <&gpio ASPEED_GPIO(E, 7) GPIO_ACTIVE_HIGH>;
		mux-gpios = <&gpio ASPEED_GPIO(R, 2) GPIO_ACTIVE_HIGH>;
		enable-gpios = <&gpio ASPEED_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
		trans-gpios = <&gpio ASPEED_GPIO(E, 5) GPIO_ACTIVE_HIGH>;
	};

	iio-hwmon-12v {
		compatible = "iio-hwmon";
		io-channels = <&adc 0>;
	};

	iio-hwmon-5v {
		compatible = "iio-hwmon";
		io-channels = <&adc 1>;
	};

	iio-hwmon-3v {
		compatible = "iio-hwmon";
		io-channels = <&adc 2>;
	};

	iio-hwmon-vdd {
		compatible = "iio-hwmon";
		io-channels = <&adc 3>;
	};

	iio-hwmon-vcs {
		compatible = "iio-hwmon";
		io-channels = <&adc 5>;
	};

	iio-hwmon-vdn {
		compatible = "iio-hwmon";
		io-channels = <&adc 7>;
	};

	iio-hwmon-vio {
		compatible = "iio-hwmon";
		io-channels = <&adc 9>;
	};

	iio-hwmon-vddra {
		compatible = "iio-hwmon";
		io-channels = <&adc 11>;
	};

	iio-hwmon-battery {
		compatible = "iio-hwmon";
		io-channels = <&adc 12>;
	};

	iio-hwmon-vddrb {
		compatible = "iio-hwmon";
		io-channels = <&adc 13>;
	};
};

&pwm_tacho {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default
		&pinctrl_pwm2_default &pinctrl_pwm3_default
		&pinctrl_pwm4_default>;

	fan@0 {
		reg = <0x00>;
		aspeed,fan-tach-ch = /bits/ 8 <0x00>;
	};

	fan@1 {
		reg = <0x01>;
		aspeed,fan-tach-ch = /bits/ 8 <0x01>;
	};

	fan@2 {
		reg = <0x02>;
		aspeed,fan-tach-ch = /bits/ 8 <0x02>;
	};

	fan@3 {
		reg = <0x03>;
		aspeed,fan-tach-ch = /bits/ 8 <0x03>;
	};

	fan@4 {
		reg = <0x04>;
		aspeed,fan-tach-ch = /bits/ 8 <0x04>;
	};

	fan@5 {
		reg = <0x00>;
		aspeed,fan-tach-ch = /bits/ 8 <0x05>;
	};

	fan@6 {
		reg = <0x01>;
		aspeed,fan-tach-ch = /bits/ 8 <0x06>;
	};

	fan@7 {
		reg = <0x02>;
		aspeed,fan-tach-ch = /bits/ 8 <0x07>;
	};

	fan@8 {
		reg = <0x03>;
		aspeed,fan-tach-ch = /bits/ 8 <0x08>;
	};

	fan@9 {
		reg = <0x04>;
		aspeed,fan-tach-ch = /bits/ 8 <0x09>;
	};
};

&fmc {
	status = "okay";
	flash@0 {
		status = "okay";
		label = "bmc";
		m25p,fast-read;
		spi-max-frequency = <50000000>;
		partitions {
			#address-cells = < 1 >;
			#size-cells = < 1 >;
			compatible = "fixed-partitions";
			u-boot@0 {
				reg = < 0 0x60000 >;
				label = "u-boot";
			};
			u-boot-env@60000 {
				reg = < 0x60000 0x20000 >;
				label = "u-boot-env";
			};
			obmc-ubi@80000 {
				reg = < 0x80000 0x1F80000 >;
				label = "obmc-ubi";
			};
		};
	};
	flash@1 {
		status = "okay";
		label = "alt-bmc";
		m25p,fast-read;
		spi-max-frequency = <50000000>;
		partitions {
			#address-cells = < 1 >;
			#size-cells = < 1 >;
			compatible = "fixed-partitions";
			u-boot@0 {
				reg = < 0 0x60000 >;
				label = "alt-u-boot";
			};
			u-boot-env@60000 {
				reg = < 0x60000 0x20000 >;
				label = "alt-u-boot-env";
			};
			obmc-ubi@80000 {
				reg = < 0x80000 0x1F80000 >;
				label = "alt-obmc-ubi";
			};
		};
	};
};

&spi1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1_default>;

	flash@0 {
		status = "okay";
		label = "pnor";
		m25p,fast-read;
		spi-max-frequency = <100000000>;
	};
};

&lpc_ctrl {
	status = "okay";
	memory-region = <&flash_memory>;
	flash = <&spi1>;
};

&uart1 {
	/* Rear RS-232 connector */
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd1_default
			&pinctrl_rxd1_default
			&pinctrl_nrts1_default
			&pinctrl_ndtr1_default
			&pinctrl_ndsr1_default
			&pinctrl_ncts1_default
			&pinctrl_ndcd1_default
			&pinctrl_nri1_default>;
};

&uart2 {
	/* APSS */
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd2_default &pinctrl_rxd2_default>;
};

&uart5 {
	status = "okay";
};

&mac0 {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rmii1_default>;
	clocks = <&syscon ASPEED_CLK_GATE_MAC1CLK>,
		 <&syscon ASPEED_CLK_MAC1RCLK>;
	clock-names = "MACCLK", "RCLK";
	use-ncsi;
};

&mac1 {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rgmii2_default &pinctrl_mdio2_default>;
};

&i2c0 {
	status = "okay";

	tmp275@48 {
		compatible = "ti,tmp275";
		reg = <0x48>;
	};
};

&i2c1 {
	status = "disabled";
};

&i2c2 {
	status = "okay";

	/* CPU MFG CONN */

};

&i2c3 {
	status = "okay";

	/* APSS */
	/* CPLD */

	/* PCA9516 (repeater) ->
	 *    CLK Buffer 9FGS9092
	 *    Power Supply 0
	 *    Power Supply 1
	 *    PCA 9552 LED
	 */

	pca9552: pca9552@60 {
		compatible = "nxp,pca9552";
		reg = <0x60>;
		#address-cells = <1>;
		#size-cells = <0>;
		gpio-controller;
		#gpio-cells = <2>;

		gpio@0 {
			reg = <0>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@1 {
			reg = <1>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@2 {
			reg = <2>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@3 {
			reg = <3>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@4 {
			reg = <4>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@5 {
			reg = <5>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@6 {
			reg = <6>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@7 {
			reg = <7>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@8 {
			reg = <8>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@9 {
			reg = <9>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@10 {
			reg = <10>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@11 {
			reg = <11>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@12 {
			reg = <12>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@13 {
			reg = <13>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@14 {
			reg = <14>;
			type = <PCA955X_TYPE_GPIO>;
		};
		gpio@15 {
			reg = <15>;
			type = <PCA955X_TYPE_GPIO>;
		};
	};

	power-supply@68 {
		compatible = "ibm,cffps1";
		reg = <0x68>;
	};

	power-supply@69 {
		compatible = "ibm,cffps1";
		reg = <0x69>;
	};
};

&i2c4 {
	status = "okay";

	/* CP0 VDD & VCS : IR35221 */
	/* CP0 VDN & VIO : IR35221 */
	/* CP0 VDDR : IR35221 */

	ir35221@28 {
		compatible = "infineon,ir35221";
		reg = <0x28>;
	};

	ir35221@29 {
		compatible = "infineon,ir35221";
		reg = <0x29>;
	};

	ir35221@2d {
		compatible = "infineon,ir35221";
		reg = <0x2d>;
	};

};

&i2c5 {
	status = "disabled";
};

&i2c6 {
	status = "disabled";
};

&i2c7 {
	status = "disabled";
};

&i2c8 {
	status = "okay";

	eeprom@50 {
		compatible = "atmel,24c64";
		reg = <0x50>;
	};
};

&i2c9 {
	status = "okay";

	/* PCIe G3 x16 slot */
};

&i2c10 {
	status = "disabled";
};

&i2c11 {
	status = "okay";

	/* CPLD */
	/* TPM */
	/* RTC RX8900CE */
	/* TMP275A */
	/* TMP275A */

	rtc@32 {
		compatible = "epson,rx8900";
		reg = <0x32>;
	};

	tmp275@48 {
		compatible = "ti,tmp275";
		reg = <0x48>;
	};

	tmp275@49 {
		compatible = "ti,tmp275";
		reg = <0x49>;
	};

};

&i2c12 {
	status = "disabled";
};

&i2c13 {
	status = "disabled";
};

&vuart {
	status = "okay";
};

&gfx {
	status = "okay";
	memory-region = <&gfx_memory>;
};

&adc {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_adc0_default
			&pinctrl_adc1_default
			&pinctrl_adc2_default
			&pinctrl_adc3_default
			&pinctrl_adc4_default
			&pinctrl_adc5_default
			&pinctrl_adc6_default
			&pinctrl_adc7_default
			&pinctrl_adc8_default
			&pinctrl_adc9_default
			&pinctrl_adc10_default
			&pinctrl_adc11_default
			&pinctrl_adc12_default
			&pinctrl_adc13_default
			&pinctrl_adc14_default
			&pinctrl_adc15_default>;
};

&wdt1 {
	aspeed,reset-type = "none";
	aspeed,external-signal;
	aspeed,ext-push-pull;
	aspeed,ext-active-high;

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdtrst1_default>;
};

&wdt2 {
	aspeed,alt-boot;
};

&ibt {
	status = "okay";
};

&vhub {
	status = "okay";
};

&video {
	status = "okay";
	memory-region = <&video_engine_memory>;
};

#include "ibm-power9-dual.dtsi"


code:
// SPDX-License-Identifier: GPL-2.0+
// Copyright 2019 YADRO
/dts-v1/;
#include "aspeed-g5.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>

/ {
	model = "Nicole BMC";
	compatible = "yadro,nicole-bmc", "aspeed,ast2500";

	chosen {
		stdout-path = &uart5;
		bootargs = "console=ttyS4,115200 earlycon";
	};

	memory@80000000 {
		reg = <0x80000000 0x20000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		vga_memory: framebuffer@9f000000 {
			no-map;
			reg = <0x9f000000 0x01000000>; /* 16M */
		};

		flash_memory: region@98000000 {
			no-map;
			reg = <0x98000000 0x04000000>; /* 64M */
		};

		coldfire_memory: codefire_memory@9ef00000 {
			reg = <0x9ef00000 0x00100000>;
			no-map;
		};

		gfx_memory: framebuffer {
			size = <0x01000000>;
			alignment = <0x01000000>;
			compatible = "shared-dma-pool";
			reusable;
		};

		video_engine_memory: jpegbuffer {
			size = <0x02000000>;	/* 32M */
			alignment = <0x01000000>;
			compatible = "shared-dma-pool";
			reusable;
		};
	};

	leds {
		compatible = "gpio-leds";

		power {
			label = "platform:green:power";
			gpios = <&gpio ASPEED_GPIO(AA, 4) GPIO_ACTIVE_HIGH>;
		};

		identify {
			label = "platform:blue:indicator";
			gpios = <&gpio ASPEED_GPIO(AA, 7) GPIO_ACTIVE_HIGH>;
		};

		fault {
			label = "platform:red:fault";
			gpios = <&gpio ASPEED_GPIO(AA, 3) GPIO_ACTIVE_HIGH>;
		};

		attention {
			label = "platform:yellow:alarm";
			gpios = <&gpio ASPEED_GPIO(AA, 1) GPIO_ACTIVE_HIGH>;
		};
	};

	fsi: gpio-fsi {
		compatible = "aspeed,ast2500-cf-fsi-master", "fsi-master";
		#address-cells = <2>;
		#size-cells = <0>;
		no-gpio-delays;

		memory-region = <&coldfire_memory>;
		aspeed,sram = <&sram>;
		aspeed,cvic = <&cvic>;

		clock-gpios = <&gpio ASPEED_GPIO(AA, 0) GPIO_ACTIVE_HIGH>;
		data-gpios = <&gpio ASPEED_GPIO(AA, 2) GPIO_ACTIVE_HIGH>;
		mux-gpios = <&gpio ASPEED_GPIO(A, 6) GPIO_ACTIVE_HIGH>;
		enable-gpios = <&gpio ASPEED_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
		trans-gpios = <&gpio ASPEED_GPIO(P, 1) GPIO_ACTIVE_HIGH>;
	};

	gpio-keys {
		compatible = "gpio-keys";

		event-checkstop {
			label = "checkstop";
			gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(J, 2)>;
		};
	};

	iio-hwmon-battery {
		compatible = "iio-hwmon";
		io-channels = <&adc 12>;
	};
};

&fmc {
	status = "okay";
	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "bmc";
		spi-max-frequency = <50000000>;
#include "openbmc-flash-layout.dtsi"
	};
};

&spi1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1_default>;

	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "pnor";
		spi-max-frequency = <100000000>;
	};
};

&lpc_ctrl {
	status = "okay";
	memory-region = <&flash_memory>;
	flash = <&spi1>;
};

&uart1 {
	/* Rear RS-232 connector */
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd1_default
			&pinctrl_rxd1_default
			&pinctrl_nrts1_default
			&pinctrl_ndtr1_default
			&pinctrl_ndsr1_default
			&pinctrl_ncts1_default
			&pinctrl_ndcd1_default
			&pinctrl_nri1_default>;
};

&uart5 {
	status = "okay";
};

&mac0 {
	status = "okay";

	use-ncsi;

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rmii1_default>;
	clocks = <&syscon ASPEED_CLK_GATE_MAC1CLK>,
		 <&syscon ASPEED_CLK_MAC1RCLK>;
	clock-names = "MACCLK", "RCLK";
};

&i2c0 {
	status = "okay";

	eeprom@50 {
		compatible = "atmel,24c256";
		reg = <0x50>;
		pagesize = <64>;
	};
};

&i2c2 {
	status = "okay";
	/* CPU0 characterization connector */
};

&i2c3 {
	status = "okay";
	/* CLK GEN SI5338 */
};

&i2c4 {
	status = "okay";
	/* Voltage regulators for CPU0 */
};

&i2c5 {
	status = "okay";
	/* Voltage regulators for CPU1 */
};

&i2c6 {
	status = "okay";

	rtc@32 {
		compatible = "epson,rx8900";
		reg = <0x32>;
	};
};

&i2c7 {
	status = "okay";
	/* CPLD */
};

&gpio {
	gpio-line-names =
	/*A0-A7*/	"","cfam-reset","","","","","fsi-mux","",
	/*B0-B7*/	"","","","","","","","",
	/*C0-C7*/	"","","","","","","","",
	/*D0-D7*/	"fsi-enable","bmc_power_up","sys_pwrok_buf",
			"func_mode0","func_mode1","func_mode2","","",
	/*E0-E7*/	"","ncsi_cfg","","","","","","",
	/*F0-F7*/	"","","","","","","","",
	/*G0-G7*/	"","","","","","","","",
	/*H0-H7*/	"","","","","","","","",
	/*I0-I7*/	"","","","","","","","",
	/*J0-J7*/	"","","checkstop","","","","","",
	/*K0-K7*/	"","","","","","","","",
	/*L0-L7*/	"","","","","","","","",
	/*M0-M7*/	"","","","","","","","",
	/*N0-N7*/	"","","","","","","","",
	/*O0-O7*/	"","","power-button","","","","","",
	/*P0-P7*/	"","fsi-trans","pm_rtc_adc_en","","","","","",
	/*Q0-Q7*/	"","","","","","","","id-button",
	/*R0-R7*/	"","software_pwrgood","","","","","","",
	/*S0-S7*/	"","","","","","","","seq_cont",
	/*T0-T7*/	"","","","","","","","",
	/*U0-U7*/	"","","","","","","","",
	/*V0-V7*/	"","","","","","","","",
	/*W0-W7*/	"","","","","","","","",
	/*X0-X7*/	"","","","","","","","",
	/*Y0-Y7*/	"","","","","","","","",
	/*Z0-Z7*/	"","","","","","","","",
	/*AA0-AA7*/	"fsi-clock","led-attention","fsi-data","led-fault",
			"led-power","","","led-identify",
	/*AB0-AB7*/	"","","","","","","","",
	/*AC0-AC7*/	"","","","","","","","";

	func_mode0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(D, 3) GPIO_ACTIVE_HIGH>;
		output-low;
	};
	func_mode1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(D, 4) GPIO_ACTIVE_HIGH>;
		output-low;
	};
	func_mode2 {
		gpio-hog;
		gpios = <ASPEED_GPIO(D, 5) GPIO_ACTIVE_HIGH>;
		output-low;
	};
	seq_cont {
		gpio-hog;
		gpios = <ASPEED_GPIO(S, 7) GPIO_ACTIVE_HIGH>;
		output-low;
	};
	ncsi_cfg {
		gpio-hog;
		input;
		gpios = <ASPEED_GPIO(E, 1) GPIO_ACTIVE_HIGH>;
	};
};

&vuart {
	status = "okay";
};

&gfx {
	status = "okay";
	memory-region = <&gfx_memory>;
};

&pinctrl {
	aspeed,external-nodes = <&gfx &lhc>;
};

&ibt {
	status = "okay";
};

&vhub {
	status = "okay";
};

&adc {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_adc0_default
			&pinctrl_adc1_default
			&pinctrl_adc2_default
			&pinctrl_adc3_default
			&pinctrl_adc4_default
			&pinctrl_adc5_default
			&pinctrl_adc6_default
			&pinctrl_adc7_default
			&pinctrl_adc8_default
			&pinctrl_adc9_default
			&pinctrl_adc10_default
			&pinctrl_adc11_default
			&pinctrl_adc12_default
			&pinctrl_adc13_default
			&pinctrl_adc14_default
			&pinctrl_adc15_default>;
};

&video {
	status = "okay";
	memory-region = <&video_engine_memory>;
};

#include "ibm-power9-dual.dtsi"


code:
// SPDX-License-Identifier: GPL-2.0+
/dts-v1/;

#include "aspeed-g4.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>

/ {
	model = "Palmetto BMC";
	compatible = "tyan,palmetto-bmc", "aspeed,ast2400";

	chosen {
		stdout-path = &uart5;
		bootargs = "console=ttyS4,115200 earlycon";
	};

	memory@40000000 {
		reg = <0x40000000 0x20000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		vga_memory: framebuffer@5f000000 {
			no-map;
			reg = <0x5f000000 0x01000000>; /* 16M */
		};

		coldfire_memory: codefire_memory@5ee00000 {
			reg = <0x5ee00000 0x00200000>;
			no-map;
		};

		flash_memory: region@5c000000 {
			no-map;
			reg = <0x5C000000 0x02000000>; /* 32MB */
		};
	};

	leds {
		compatible = "gpio-leds";

		heartbeat {
			gpios = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_LOW>;
		};

		power {
			gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_LOW>;
		};

		identify {
			gpios = <&gpio ASPEED_GPIO(A, 2) GPIO_ACTIVE_LOW>;
		};
	};

	fsi: gpio-fsi {
		compatible = "aspeed,ast2400-cf-fsi-master", "fsi-master";
		#address-cells = <2>;
		#size-cells = <0>;

		memory-region = <&coldfire_memory>;
		aspeed,sram = <&sram>;
		aspeed,cvic = <&cvic>;

		clock-gpios = <&gpio ASPEED_GPIO(A, 4) GPIO_ACTIVE_HIGH>;
		data-gpios = <&gpio ASPEED_GPIO(A, 5) GPIO_ACTIVE_HIGH>;
		mux-gpios = <&gpio ASPEED_GPIO(A, 6) GPIO_ACTIVE_HIGH>;
		enable-gpios = <&gpio ASPEED_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
		trans-gpios = <&gpio ASPEED_GPIO(H, 6) GPIO_ACTIVE_HIGH>;
	};

	gpio-keys {
		compatible = "gpio-keys";

		event-checkstop {
			label = "checkstop";
			gpios = <&gpio ASPEED_GPIO(P, 5) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(P, 5)>;
		};
	};
};

&fmc {
	status = "okay";
	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "bmc";
		spi-max-frequency = <50000000>;
#include "openbmc-flash-layout.dtsi"
	};
};

&spi {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1debug_default>;

	flash@0 {
		status = "okay";
		m25p,fast-read;
		spi-max-frequency = <50000000>;
		label = "pnor";
	};
};

&pinctrl {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_flbusy_default &pinctrl_flwp_default

			&pinctrl_vgahs_default &pinctrl_vgavs_default
			&pinctrl_ddcclk_default &pinctrl_ddcdat_default>;
};

&uart1 {
	/* Rear RS-232 connector */
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd1_default
			&pinctrl_rxd1_default
			&pinctrl_nrts1_default
			&pinctrl_ndtr1_default
			&pinctrl_ndsr1_default
			&pinctrl_ncts1_default
			&pinctrl_ndcd1_default
			&pinctrl_nri1_default>;
};

&uart5 {
	status = "okay";
};

&mac0 {
	status = "okay";

	use-ncsi;

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rmii1_default>;
};

&i2c0 {
	status = "okay";

	eeprom@50 {
		compatible = "atmel,24c256";
		reg = <0x50>;
		pagesize = <64>;
	};

	rtc@68 {
		compatible = "dallas,ds3231";
		reg = <0x68>;
	};
};

&i2c1 {
	status = "okay";
};

&i2c2 {
	status = "okay";

	tmp423@4c {
		compatible = "ti,tmp423";
		reg = <0x4c>;
	};
};

&i2c3 {
	status = "okay";

	occ-hwmon@50 {
		compatible = "ibm,p8-occ-hwmon";
		reg = <0x50>;
	};
};

&i2c4 {
	status = "okay";
};

&i2c5 {
	status = "okay";
};

&i2c6 {
	status = "okay";
};

&i2c7 {
	status = "okay";
};

&vuart {
	status = "okay";
};

&ibt {
	status = "okay";
};

&lpc_ctrl {
	status = "okay";
	memory-region = <&flash_memory>;
	flash = <&spi>;
};

&gpio {
	pin_func_mode0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(C, 4) GPIO_ACTIVE_HIGH>;
		output-low;
		line-name = "func_mode0";
	};

	pin_func_mode1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(C, 5)  GPIO_ACTIVE_HIGH>;
		output-low;
		line-name = "func_mode1";
	};

	pin_func_mode2 {
		gpio-hog;
		gpios = <ASPEED_GPIO(C, 6) GPIO_ACTIVE_HIGH>;
		output-low;
		line-name = "func_mode2";
	};

	pin_gpio_a0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(A, 0) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "BMC_FAN_RESERVED_N";
	};

	pin_gpio_a1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(A, 1) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "APSS_WDT_N";
	};

	pin_gpio_b1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(B, 1) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "APSS_BOOT_MODE";
	};

	pin_gpio_b2 {
		gpio-hog;
		gpios = <ASPEED_GPIO(B, 2) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "APSS_RESET_N";
	};

	pin_gpio_b7 {
		gpio-hog;
		gpios = <ASPEED_GPIO(B, 7) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "SPIVID_STBY_RESET_N";
	};

	pin_gpio_d1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(D, 1) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_POWER_UP";
	};

	pin_gpio_f1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(F, 1) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "BMC_BATTERY_TEST";
	};

	pin_gpio_f4 {
		gpio-hog;
		gpios = <ASPEED_GPIO(F, 4) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "AST_HW_FAULT_N";
	};

	pin_gpio_f5 {
		gpio-hog;
		gpios = <ASPEED_GPIO(F, 5) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "AST_SYS_FAULT_N";
	};

	pin_gpio_f7 {
		gpio-hog;
		gpios = <ASPEED_GPIO(F, 7) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_FULL_SPEED_N";
	};

	pin_gpio_g3 {
		gpio-hog;
		gpios = <ASPEED_GPIO(G, 3) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_FAN_ERROR_N";
	};

	pin_gpio_g4 {
		gpio-hog;
		gpios = <ASPEED_GPIO(G, 4) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "BMC_WDT_RST1_P";
	};

	pin_gpio_g5 {
		gpio-hog;
		gpios = <ASPEED_GPIO(G, 5) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "BMC_WDT_RST2_P";
	};

	pin_gpio_h0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(H, 0) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "PE_SLOT_TEST_EN_N";
	};

	pin_gpio_h1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(H, 1) GPIO_ACTIVE_HIGH>;
		input;
		line-name = "BMC_RTCRST_N";
	};

	pin_gpio_h2 {
		gpio-hog;
		gpios = <ASPEED_GPIO(H, 2) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "SYS_PWROK_BMC";
	};

	pin_gpio_h7 {
		gpio-hog;
		gpios = <ASPEED_GPIO(H, 7) GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "BMC_TPM_INT_N";
	};
};

&fsi {
	cfam@0,0 {
		reg = <0 0>;
		#address-cells = <1>;
		#size-cells = <1>;
		chip-id = <0>;

		scom@1000 {
			compatible = "ibm,fsi2pib";
			reg = <0x1000 0x400>;
		};

		fsi_hub0: hub@3400 {
			compatible = "ibm,fsi-master-hub";
			reg = <0x3400 0x400>;
			#address-cells = <2>;
			#size-cells = <0>;
			no-scan-on-init;
		};
	};
};


code:
// SPDX-License-Identifier: GPL-2.0+
/dts-v1/;
#include "aspeed-g5.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>

/ {
	model = "Romulus BMC";
	compatible = "ibm,romulus-bmc", "aspeed,ast2500";

	chosen {
		stdout-path = &uart5;
		bootargs = "console=ttyS4,115200 earlycon";
	};

	memory@80000000 {
		reg = <0x80000000 0x20000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		vga_memory: framebuffer@9f000000 {
			no-map;
			reg = <0x9f000000 0x01000000>; /* 16M */
		};

		flash_memory: region@98000000 {
			no-map;
			reg = <0x98000000 0x04000000>; /* 64M */
		};

		coldfire_memory: codefire_memory@9ef00000 {
			reg = <0x9ef00000 0x00100000>;
			no-map;
		};

		gfx_memory: framebuffer {
			size = <0x01000000>;
			alignment = <0x01000000>;
			compatible = "shared-dma-pool";
			reusable;
		};

		video_engine_memory: jpegbuffer {
			size = <0x02000000>;	/* 32M */
			alignment = <0x01000000>;
			compatible = "shared-dma-pool";
			reusable;
		};
	};

	leds {
		compatible = "gpio-leds";

		fault {
			gpios = <&gpio ASPEED_GPIO(N, 2) GPIO_ACTIVE_LOW>;
		};

		identify {
			gpios = <&gpio ASPEED_GPIO(N, 4) GPIO_ACTIVE_HIGH>;
		};

		power {
			gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_LOW>;
		};
	};

	fsi: gpio-fsi {
		compatible = "aspeed,ast2500-cf-fsi-master", "fsi-master";
		#address-cells = <2>;
		#size-cells = <0>;
		no-gpio-delays;

		memory-region = <&coldfire_memory>;
		aspeed,sram = <&sram>;
		aspeed,cvic = <&cvic>;

		clock-gpios = <&gpio ASPEED_GPIO(AA, 0) GPIO_ACTIVE_HIGH>;
		data-gpios = <&gpio ASPEED_GPIO(AA, 2) GPIO_ACTIVE_HIGH>;
		mux-gpios = <&gpio ASPEED_GPIO(A, 6) GPIO_ACTIVE_HIGH>;
		enable-gpios = <&gpio ASPEED_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
		trans-gpios = <&gpio ASPEED_GPIO(R, 2) GPIO_ACTIVE_HIGH>;
	};

	gpio-keys {
		compatible = "gpio-keys";

		event-checkstop {
			label = "checkstop";
			gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(J, 2)>;
		};

		id-button {
			label = "id-button";
			gpios = <&gpio ASPEED_GPIO(Q, 7) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(Q, 7)>;
		};
	};

	iio-hwmon-battery {
		compatible = "iio-hwmon";
		io-channels = <&adc 12>;
	};
};

&fmc {
	status = "okay";
	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "bmc";
		spi-max-frequency = <50000000>;
#include "openbmc-flash-layout.dtsi"
	};
};

&spi1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1_default>;

	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "pnor";
		spi-max-frequency = <100000000>;
	};
};

&lpc_ctrl {
	status = "okay";
	memory-region = <&flash_memory>;
	flash = <&spi1>;
};

&uart1 {
	/* Rear RS-232 connector */
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd1_default
			&pinctrl_rxd1_default
			&pinctrl_nrts1_default
			&pinctrl_ndtr1_default
			&pinctrl_ndsr1_default
			&pinctrl_ncts1_default
			&pinctrl_ndcd1_default
			&pinctrl_nri1_default>;
};

&uart5 {
	status = "okay";
};

&mac0 {
	status = "okay";

	use-ncsi;

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rmii1_default>;
	clocks = <&syscon ASPEED_CLK_GATE_MAC1CLK>,
		 <&syscon ASPEED_CLK_MAC1RCLK>;
	clock-names = "MACCLK", "RCLK";
};

&i2c1 {
	status = "okay";
};

&i2c2 {
	status = "okay";
};

&i2c3 {
	status = "okay";
};

&i2c4 {
	status = "okay";
};

&i2c5 {
	status = "okay";
};

&i2c6 {
	/* PCIe slot 1 (x8) */
	status = "okay";
};

&i2c7 {
	/* PCIe slot 2 (x16) */
	status = "okay";
};

&i2c8 {
	/* PCIe slot 3 (x16) */
	status = "okay";
};

&i2c9 {
	/* PCIe slot 4 (x16) */
	status = "okay";
};

&i2c10 {
	/* PCIe slot 5 (x8) */
	status = "okay";
};

&i2c11 {
	status = "okay";

	rtc@32 {
		compatible = "epson,rx8900";
		reg = <0x32>;
	};
};

&i2c12 {
	status = "okay";

	w83773g@4c {
		compatible = "nuvoton,w83773g";
		reg = <0x4c>;
	};
};

&gpio {
	gpio-line-names =
	/*A0-A7*/	"","cfam-reset","","","","","fsi-mux","",
	/*B0-B7*/	"","","","","","","","",
	/*C0-C7*/	"","","","","","","","",
	/*D0-D7*/	"fsi-enable","","","nic_func_mode0","nic_func_mode1","","","",
	/*E0-E7*/	"","","","","","","","",
	/*F0-F7*/	"","","","","","","","",
	/*G0-G7*/	"","","","","","","","",
	/*H0-H7*/	"","","","","","","","",
	/*I0-I7*/	"","","","power-button","","","","",
	/*J0-J7*/	"","","checkstop","","","","","",
	/*K0-K7*/	"","","","","","","","",
	/*L0-L7*/	"","","","","","","","",
	/*M0-M7*/	"","","","","","","","",
	/*N0-N7*/	"","","led-fault","",
				"led-identify","","","",
	/*O0-O7*/	"","","","","","","","",
	/*P0-P7*/	"","","","","","","","",
	/*Q0-Q7*/	"","","","","","","","id-button",
	/*R0-R7*/	"","","fsi-trans","","","led-power","","",
	/*S0-S7*/	"","","","","","","","seq_cont",
	/*T0-T7*/	"","","","","","","","",
	/*U0-U7*/	"","","","","","","","",
	/*V0-V7*/	"","","","","","","","",
	/*W0-W7*/	"","","","","","","","",
	/*X0-X7*/	"","","","","","","","",
	/*Y0-Y7*/	"","","","","","","","",
	/*Z0-Z7*/	"","","","","","","","",
	/*AA0-AA7*/	"fsi-clock","","fsi-data","","","","","",
	/*AB0-AB7*/	"","","","","","","","",
	/*AC0-AC7*/	"","","","","","","","";

	nic_func_mode0 {
		gpio-hog;
		gpios = <ASPEED_GPIO(D, 3) GPIO_ACTIVE_HIGH>;
		output-low;
	};
	nic_func_mode1 {
		gpio-hog;
		gpios = <ASPEED_GPIO(D, 4) GPIO_ACTIVE_HIGH>;
		output-low;
	};
	seq_cont {
		gpio-hog;
		gpios = <ASPEED_GPIO(S, 7) GPIO_ACTIVE_HIGH>;
		output-low;
	};
};

&vuart {
	status = "okay";
};

&gfx {
	status = "okay";
	memory-region = <&gfx_memory>;
};

&pinctrl {
	aspeed,external-nodes = <&gfx &lhc>;
};

&pwm_tacho {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pwm0_default &pinctrl_pwm1_default>;

	fan@0 {
		reg = <0x00>;
		aspeed,fan-tach-ch = /bits/ 8 <0x08>;
	};

	fan@1 {
		reg = <0x00>;
		aspeed,fan-tach-ch = /bits/ 8 <0x09>;
	};

	fan@2 {
		reg = <0x01>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0a>;
	};

	fan@3 {
		reg = <0x01>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0b>;
	};

	fan@4 {
		reg = <0x00>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0c>;
	};

	fan@5 {
		reg = <0x00>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0d>;
	};

	fan@6 {
		reg = <0x01>;
		aspeed,fan-tach-ch = /bits/ 8 <0x0e>;
	};
};

&ibt {
	status = "okay";
};

&vhub {
	status = "okay";
};

&adc {
	status = "okay";
};

&video {
	status = "okay";
	memory-region = <&video_engine_memory>;
};

#include "ibm-power9-dual.dtsi"


code:
// SPDX-License-Identifier: GPL-2.0+
/dts-v1/;
#include "aspeed-g5.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>
#include <dt-bindings/leds/leds-pca955x.h>

/ {
	model = "Swift BMC";
	compatible = "ibm,swift-bmc", "aspeed,ast2500";

	chosen {
		stdout-path = &uart5;
		bootargs = "console=ttyS4,115200 earlycon";
	};

	memory@80000000 {
		reg = <0x80000000 0x20000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		flash_memory: region@98000000 {
			no-map;
			reg = <0x98000000 0x04000000>; /* 64M */
		};

		gfx_memory: framebuffer {
			size = <0x01000000>;
			alignment = <0x01000000>;
			compatible = "shared-dma-pool";
			reusable;
		};
	};

	gpio-keys {
		compatible = "gpio-keys";

		event-air-water {
			label = "air-water";
			gpios = <&gpio ASPEED_GPIO(B, 5) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(B, 5)>;
		};

		event-checkstop {
			label = "checkstop";
			gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(J, 2)>;
		};

		event-ps0-presence {
			label = "ps0-presence";
			gpios = <&gpio ASPEED_GPIO(R, 7) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(R, 7)>;
		};

		event-ps1-presence {
			label = "ps1-presence";
			gpios = <&gpio ASPEED_GPIO(N, 0) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(N, 0)>;
		};

		event-oppanel-presence {
			label = "oppanel-presence";
			gpios = <&gpio ASPEED_GPIO(A, 7) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(A, 7)>;
		};

		event-opencapi-riser-presence {
			label = "opencapi-riser-presence";
			gpios = <&gpio ASPEED_GPIO(I, 0) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(I, 0)>;
		};
	};

	iio-hwmon-battery {
		compatible = "iio-hwmon";
		io-channels = <&adc 12>;
	};

	gpio-keys-polled {
		compatible = "gpio-keys-polled";
		poll-interval = <1000>;

		event-scm0-presence {
			label = "scm0-presence";
			gpios = <&pca9552 6 GPIO_ACTIVE_LOW>;
			linux,code = <6>;
		};

		event-scm1-presence {
			label = "scm1-presence";
			gpios = <&pca9552 7 GPIO_ACTIVE_LOW>;
			linux,code = <7>;
		};

		event-cpu0vrm-presence {
			label = "cpu0vrm-presence";
			gpios = <&pca9552 12 GPIO_ACTIVE_LOW>;
			linux,code = <12>;
		};

		event-cpu1vrm-presence {
			label = "cpu1vrm-presence";
			gpios = <&pca9552 13 GPIO_ACTIVE_LOW>;
			linux,code = <13>;
		};

		event-fan0-presence {
			label = "fan0-presence";
			gpios = <&pca0 5 GPIO_ACTIVE_LOW>;
			linux,code = <5>;
		};

		event-fan1-presence {
			label = "fan1-presence";
			gpios = <&pca0 6 GPIO_ACTIVE_LOW>;
			linux,code = <6>;
		};

		event-fan2-presence {
			label = "fan2-presence";
			gpios = <&pca0 7 GPIO_ACTIVE_LOW>;
			linux,code = <7>;
		};

		event-fan3-presence {
			label = "fan3-presence";
			gpios = <&pca0 8 GPIO_ACTIVE_LOW>;
			linux,code = <8>;
		};

		event-fanboost-presence {
			label = "fanboost-presence";
			gpios = <&pca0 9 GPIO_ACTIVE_LOW>;
			linux,code = <9>;
		};
	};

	leds {
		compatible = "gpio-leds";

		fan0 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 0 GPIO_ACTIVE_LOW>;
		};

		fan1 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 1 GPIO_ACTIVE_LOW>;
		};

		fan2 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 2 GPIO_ACTIVE_LOW>;
		};

		fan3 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 3 GPIO_ACTIVE_LOW>;
		};

		fanboost {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 4 GPIO_ACTIVE_LOW>;
		};

		front-fault {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca1 2 GPIO_ACTIVE_LOW>;
		};

		front-power {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca1 3 GPIO_ACTIVE_LOW>;
		};

		front-id {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca1 0 GPIO_ACTIVE_LOW>;
		};

		rear-fault {
			gpios = <&gpio ASPEED_GPIO(N, 2) GPIO_ACTIVE_LOW>;
		};

		rear-id {
			gpios = <&gpio ASPEED_GPIO(N, 4) GPIO_ACTIVE_LOW>;
		};
	};

	fsi: gpio-fsi {
		compatible = "fsi-master-gpio", "fsi-master";
		#address-cells = <2>;
		#size-cells = <0>;
		no-gpio-delays;

		clock-gpios = <&gpio ASPEED_GPIO(P, 1) GPIO_ACTIVE_HIGH>;
		data-gpios = <&gpio ASPEED_GPIO(P, 2) GPIO_ACTIVE_HIGH>;
		mux-gpios = <&gpio ASPEED_GPIO(P, 4) GPIO_ACTIVE_HIGH>;
		enable-gpios = <&gpio ASPEED_GPIO(P, 0) GPIO_ACTIVE_HIGH>;
		trans-gpios = <&gpio ASPEED_GPIO(P, 3) GPIO_ACTIVE_HIGH>;
	};

	iio-hwmon-dps310 {
		compatible = "iio-hwmon";
		io-channels = <&dps 0>;
	};

};

&fmc {
	status = "okay";

	flash@0 {
		status = "okay";
		label = "bmc";
		m25p,fast-read;
		spi-max-frequency = <100000000>;
		partitions {
			#address-cells = < 1 >;
			#size-cells = < 1 >;
			compatible = "fixed-partitions";
			u-boot@0 {
				reg = < 0 0x60000 >;
				label = "u-boot";
			};
			u-boot-env@60000 {
				reg = < 0x60000 0x20000 >;
				label = "u-boot-env";
			};
			obmc-ubi@80000 {
				reg = < 0x80000 0x7F80000>;
				label = "obmc-ubi";
			};
		};
	};

	flash@1 {
		status = "okay";
		label = "alt-bmc";
		m25p,fast-read;
		spi-max-frequency = <100000000>;
		partitions {
			#address-cells = < 1 >;
			#size-cells = < 1 >;
			compatible = "fixed-partitions";
			u-boot@0 {
				reg = < 0 0x60000 >;
				label = "alt-u-boot";
			};
			u-boot-env@60000 {
				reg = < 0x60000 0x20000 >;
				label = "alt-u-boot-env";
			};
			obmc-ubi@80000 {
				reg = < 0x80000 0x7F80000>;
				label = "alt-obmc-ubi";
			};
		};
	};
};

&spi1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1_default>;

	flash@0 {
		status = "okay";
		label = "pnor";
		m25p,fast-read;
		spi-max-frequency = <100000000>;
	};
};

&uart1 {
	/* Rear RS-232 connector */
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd1_default
			&pinctrl_rxd1_default
			&pinctrl_nrts1_default
			&pinctrl_ndtr1_default
			&pinctrl_ndsr1_default
			&pinctrl_ncts1_default
			&pinctrl_ndcd1_default
			&pinctrl_nri1_default>;
};

&uart2 {
	/* APSS */
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd2_default &pinctrl_rxd2_default>;
};

&uart5 {
	status = "okay";
};

&lpc_ctrl {
	status = "okay";
	memory-region = <&flash_memory>;
	flash = <&spi1>;
};

&mac0 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rmii1_default>;
	use-ncsi;
	clocks = <&syscon ASPEED_CLK_GATE_MAC1CLK>,
		 <&syscon ASPEED_CLK_MAC1RCLK>;
	clock-names = "MACCLK", "RCLK";
};

&i2c2 {
	status = "okay";

	/* MUX ->
	 *    Samtec 1
	 *    Samtec 2
	 */
};

&i2c3 {
	status = "okay";

	max31785@52 {
		compatible = "maxim,max31785a";
		reg = <0x52>;
		#address-cells = <1>;
		#size-cells = <0>;

		fan@0 {
			compatible = "pmbus-fan";
			reg = <0>;
			tach-pulses = <2>;
			maxim,fan-rotor-input = "tach";
			maxim,fan-pwm-freq = <25000>;
			maxim,fan-no-watchdog;
			maxim,fan-no-fault-ramp;
			maxim,fan-ramp = <2>;
			maxim,fan-fault-pin-mon;
		};

		fan@1 {
			compatible = "pmbus-fan";
			reg = <1>;
			tach-pulses = <2>;
			maxim,fan-rotor-input = "tach";
			maxim,fan-pwm-freq = <25000>;
			maxim,fan-no-watchdog;
			maxim,fan-no-fault-ramp;
			maxim,fan-ramp = <2>;
			maxim,fan-fault-pin-mon;
		};

		fan@2 {
			compatible = "pmbus-fan";
			reg = <2>;
			tach-pulses = <2>;
			maxim,fan-rotor-input = "tach";
			maxim,fan-pwm-freq = <25000>;
			maxim,fan-no-watchdog;
			maxim,fan-no-fault-ramp;
			maxim,fan-ramp = <2>;
			maxim,fan-fault-pin-mon;
		};

		fan@3 {
			compatible = "pmbus-fan";
			reg = <3>;
			tach-pulses = <2>;
			maxim,fan-rotor-input = "tach";
			maxim,fan-pwm-freq = <25000>;
			maxim,fan-no-watchdog;
			maxim,fan-no-fault-ramp;
			maxim,fan-ramp = <2>;
			maxim,fan-fault-pin-mon;
		};

		fan@4 {
			compatible = "pmbus-fan";
			reg = <4>;
			tach-pulses = <2>;
			maxim,fan-rotor-input = "tach";
			maxim,fan-pwm-freq = <25000>;
			maxim,fan-no-watchdog;
			maxim,fan-no-fault-ramp;
			maxim,fan-ramp = <2>;
			maxim,fan-fault-pin-mon;
		};
	};

	pca0: pca9552@60 {
		compatible = "nxp,pca9552";
		reg = <0x60>;
		#address-cells = <1>;
		#size-cells = <0>;

		gpio-controller;
		#gpio-cells = <2>;

		gpio@0 {
			reg = <0>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@1 {
			reg = <1>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@2 {
			reg = <2>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@3 {
			reg = <3>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@4 {
			reg = <4>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@5 {
			reg = <5>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@6 {
			reg = <6>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@7 {
			reg = <7>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@8 {
			reg = <8>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@9 {
			reg = <9>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@10 {
			reg = <10>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@11 {
			reg = <11>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@12 {
			reg = <12>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@13 {
			reg = <13>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@14 {
			reg = <14>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@15 {
			reg = <15>;
			type = <PCA955X_TYPE_GPIO>;
		};
	};

	power-supply@68 {
		compatible = "ibm,cffps2";
		reg = <0x68>;
	};

	eeprom@50 {
		compatible = "atmel,24c64";
		reg = <0x50>;
	};

	power-supply@69 {
		compatible = "ibm,cffps2";
		reg = <0x69>;
	};

	eeprom@51 {
		compatible = "atmel,24c64";
		reg = <0x51>;
	};
};

&i2c7 {
	status = "okay";

	dps: dps310@76 {
		compatible = "infineon,dps310";
		reg = <0x76>;
		#io-channel-cells = <0>;
	};

	tmp275@48 {
		compatible = "ti,tmp275";
		reg = <0x48>;
	};

	si7021a20@20 {
		compatible = "si,si7021a20";
		reg = <0x20>;
	};

	eeprom@50 {
		compatible = "atmel,24c64";
		reg = <0x50>;
	};

	pca1: pca9551@60 {
		compatible = "nxp,pca9551";
		reg = <0x60>;
		#address-cells = <1>;
		#size-cells = <0>;

		gpio-controller;
		#gpio-cells = <2>;

		gpio@0 {
			reg = <0>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@1 {
			reg = <1>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@2 {
			reg = <2>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@3 {
			reg = <3>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@4 {
			reg = <4>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@5 {
			reg = <5>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@6 {
			reg = <6>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@7 {
			reg = <7>;
			type = <PCA955X_TYPE_GPIO>;
		};
	};
};

&i2c8 {
	status = "okay";

	pca9552: pca9552@60 {
		compatible = "nxp,pca9552";
		reg = <0x60>;
		#address-cells = <1>;
		#size-cells = <0>;
		gpio-controller;
		#gpio-cells = <2>;

		gpio-line-names = "PS_SMBUS_RESET_N", "APSS_RESET_N",
			"GPU0_TH_OVERT_N_BUFF",	"GPU1_TH_OVERT_N_BUFF",
			"GPU2_TH_OVERT_N_BUFF", "GPU3_TH_OVERT_N_BUFF",
			"P9_SCM0_PRES",	"P9_SCM1_PRES",
			"GPU0_PWR_GOOD_BUFF", "GPU1_PWR_GOOD_BUFF",
			"GPU2_PWR_GOOD_BUFF", "GPU3_PWR_GOOD_BUFF",
			"PRESENT_VRM_CP0_N", "PRESENT_VRM_CP1_N",
			"12V_BREAKER_FLT_N", "THROTTLE_UNLATCHED_N";

		gpio@0 {
			reg = <0>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@1 {
			reg = <1>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@2 {
			reg = <2>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@3 {
			reg = <3>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@4 {
			reg = <4>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@5 {
			reg = <5>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@6 {
			reg = <6>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@7 {
			reg = <7>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@8 {
			reg = <8>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@9 {
			reg = <9>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@10 {
			reg = <10>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@11 {
			reg = <11>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@12 {
			reg = <12>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@13 {
			reg = <13>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@14 {
			reg = <14>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@15 {
			reg = <15>;
			type = <PCA955X_TYPE_GPIO>;
		};
	};

	rtc@32 {
		compatible = "epson,rx8900";
		reg = <0x32>;
	};

	eeprom@51 {
		compatible = "atmel,24c64";
		reg = <0x51>;
	};

	ucd90160@64 {
		compatible = "ti,ucd90160";
		reg = <0x64>;
	};
};

&i2c9 {
	status = "okay";

	eeprom@50 {
		compatible = "atmel,24c64";
		reg = <0x50>;
	};

	tmp423a@4c {
		compatible = "ti,tmp423";
		reg = <0x4c>;
	};

	ir35221@71 {
		compatible = "infineon,ir35221";
		reg = <0x71>;
	};

	ir35221@72 {
		compatible = "infineon,ir35221";
		reg = <0x72>;
	};

	pca2: pca9539@74 {
		compatible = "nxp,pca9539";
		reg = <0x74>;
		#address-cells = <1>;
		#size-cells = <0>;
		gpio-controller;
		#gpio-cells = <2>;

		gpio@0 {
			reg = <0>;
		};

		gpio@1 {
			reg = <1>;
		};

		gpio@2 {
			reg = <2>;
		};

		gpio@3 {
			reg = <3>;
		};

		gpio@4 {
			reg = <4>;
		};

		gpio@5 {
			reg = <5>;
		};

		gpio@6 {
			reg = <6>;
		};

		gpio@7 {
			reg = <7>;
		};

		gpio@8 {
			reg = <8>;
		};

		gpio@9 {
			reg = <9>;
		};

		gpio@10 {
			reg = <10>;
		};

		gpio@11 {
			reg = <11>;
		};

		gpio@12 {
			reg = <12>;
		};

		gpio@13 {
			reg = <13>;
		};

		gpio@14 {
			reg = <14>;
		};

		gpio@15 {
			reg = <15>;
		};
	};
};

&i2c10 {
	status = "okay";

	eeprom@50 {
		compatible = "atmel,24c64";
		reg = <0x50>;
	};

	tmp423a@4c {
		compatible = "ti,tmp423";
		reg = <0x4c>;
	};

	ir35221@71 {
		compatible = "infineon,ir35221";
		reg = <0x71>;
	};

	ir35221@72 {
		compatible = "infineon,ir35221";
		reg = <0x72>;
	};

	pca3: pca9539@74 {
		compatible = "nxp,pca9539";
		reg = <0x74>;
		#address-cells = <1>;
		#size-cells = <0>;
		gpio-controller;
		#gpio-cells = <2>;

		gpio@0 {
			reg = <0>;
		};

		gpio@1 {
			reg = <1>;
		};

		gpio@2 {
			reg = <2>;
		};

		gpio@3 {
			reg = <3>;
		};

		gpio@4 {
			reg = <4>;
		};

		gpio@5 {
			reg = <5>;
		};

		gpio@6 {
			reg = <6>;
		};

		gpio@7 {
			reg = <7>;
		};

		gpio@8 {
			reg = <8>;
		};

		gpio@9 {
			reg = <9>;
		};

		gpio@10 {
			reg = <10>;
		};

		gpio@11 {
			reg = <11>;
		};

		gpio@12 {
			reg = <12>;
		};

		gpio@13 {
			reg = <13>;
		};

		gpio@14 {
			reg = <14>;
		};

		gpio@15 {
			reg = <15>;
		};
	};
};

&i2c11 {
	/* MUX
	 *   -> PCIe Slot 0
	 *   -> PCIe Slot 1
	 *   -> PCIe Slot 2
	 *   -> PCIe Slot 3
	 */
	status = "okay";
};

&i2c12 {
	status = "okay";

	tmp275@48 {
		compatible = "ti,tmp275";
		reg = <0x48>;
	};

	tmp275@4a {
		compatible = "ti,tmp275";
		reg = <0x4a>;
	};
};

&i2c13 {
	status = "okay";
};

&vuart {
	status = "okay";
};

&gfx {
	status = "okay";
	memory-region = <&gfx_memory>;
};

&pinctrl {
	aspeed,external-nodes = <&gfx &lhc>;
};

&wdt1 {
	aspeed,reset-type = "none";
	aspeed,external-signal;
	aspeed,ext-push-pull;
	aspeed,ext-active-high;

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdtrst1_default>;
};

&wdt2 {
	aspeed,alt-boot;
};

&ibt {
	status = "okay";
};

&adc {
	status = "okay";
};

&sdmmc {
       status = "okay";
};

&sdhci1 {
       status = "okay";

       pinctrl-names = "default";
       pinctrl-0 = <&pinctrl_sd2_default>;
};

#include "ibm-power9-dual.dtsi"


code:
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright 2019 IBM Corp.
/dts-v1/;

#include "aspeed-g6.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>
#include <dt-bindings/i2c/i2c.h>
#include <dt-bindings/leds/leds-pca955x.h>

/ {
	model = "Tacoma";
	compatible = "ibm,tacoma-bmc", "aspeed,ast2600";

	chosen {
		stdout-path = &uart5;
		bootargs = "console=ttyS4,115200n8 earlycon";
	};

	memory@80000000 {
		device_type = "memory";
		reg = <0x80000000 0x40000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		flash_memory: region@b8000000 {
			no-map;
			reg = <0xb8000000 0x4000000>; /* 64M */
		};

		ramoops@bc000000 {
			compatible = "ramoops";
			reg = <0xbc000000 0x180000>; /* 16 * (3 * 0x8000) */
			record-size = <0x8000>;
			console-size = <0x8000>;
			pmsg-size = <0x8000>;
			max-reason = <3>; /* KMSG_DUMP_EMERG */
		};

		vga_memory: region@bf000000 {
			no-map;
			compatible = "shared-dma-pool";
			reg = <0xbf000000 0x01000000>;	/* 16M */
		};
	};

	gpio-keys {
		compatible = "gpio-keys";

		event-ps0-presence {
			label = "ps0-presence";
			gpios = <&gpio0 ASPEED_GPIO(H, 3) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(H, 3)>;
		};

		event-ps1-presence {
			label = "ps1-presence";
			gpios = <&gpio0 ASPEED_GPIO(E, 5) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(E, 5)>;
		};
	};

	gpio-keys-polled {
		compatible = "gpio-keys-polled";
		poll-interval = <1000>;

		event-fan0-presence {
			label = "fan0-presence";
			gpios = <&pca0 4 GPIO_ACTIVE_LOW>;
			linux,code = <4>;
		};

		event-fan1-presence {
			label = "fan1-presence";
			gpios = <&pca0 5 GPIO_ACTIVE_LOW>;
			linux,code = <5>;
		};

		event-fan2-presence {
			label = "fan2-presence";
			gpios = <&pca0 6 GPIO_ACTIVE_LOW>;
			linux,code = <6>;
		};

		event-fan3-presence {
			label = "fan3-presence";
			gpios = <&pca0 7 GPIO_ACTIVE_LOW>;
			linux,code = <7>;
		};
	};

	iio-hwmon-dps310 {
		compatible = "iio-hwmon";
		io-channels = <&dps 0>;
	};

	iio-hwmon-bmp280 {
		compatible = "iio-hwmon";
		io-channels = <&bmp 1>;
	};
};

&ehci1 {
	status = "okay";
};

&gpio0 {
	gpio-line-names =
	/*A0-A7*/	"","","","","","","","",
	/*B0-B7*/	"fsi-mux","","","","","","","",
	/*C0-C7*/	"","","","","","","","",
	/*D0-D7*/	"","","","","","","","",
	/*E0-E7*/	"power-button","","","checkstop","","presence-ps1","","led-rear-fault",
	/*F0-F7*/	"","","","","","","","",
	/*G0-G7*/	"","","","","","","","",
	/*H0-H7*/	"","","","presence-ps0","","","","",
	/*I0-I7*/	"","","","","","","","",
	/*J0-J7*/	"","","","","","","","",
	/*K0-K7*/	"","","","","","","","",
	/*L0-L7*/	"","","","","","","","",
	/*M0-M7*/	"","","","","","","","",
	/*N0-N7*/	"","","","","","","","",
	/*O0-O7*/	"led-rear-power","led-rear-id","","usb-power","","","","",
	/*P0-P7*/	"","","","","","bmc-tpm-reset","","",
	/*Q0-Q7*/	"cfam-reset","","","","","","","fsi-routing",
	/*R0-R7*/	"","","","","","","","",
	/*S0-S7*/	"","","","","","","","",
	/*T0-T7*/	"","","","","","","","",
	/*U0-U7*/	"","","","","","","","",
	/*V0-V7*/	"","","","","","","","",
	/*W0-W7*/	"","","","","","","","",
	/*X0-X7*/	"","","","","","","","",
	/*Y0-Y7*/	"","","","","","","","",
	/*Z0-Z7*/	"","","","","","","","";
};

&fmc {
	status = "okay";
	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "bmc";
		spi-max-frequency = <50000000>;
#include "openbmc-flash-layout-128.dtsi"
	};

	flash@1 {
		status = "okay";
		m25p,fast-read;
		label = "alt-bmc";
		spi-max-frequency = <50000000>;
	};
};

&spi1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1_default>;

	flash@0 {
		status = "okay";
		m25p,fast-read;
		label = "pnor";
		spi-max-frequency = <100000000>;
	};
};

&mac2 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rmii3_default>;
	clocks = <&syscon ASPEED_CLK_GATE_MAC3CLK>,
		 <&syscon ASPEED_CLK_MAC3RCLK>;
	clock-names = "MACCLK", "RCLK";
	use-ncsi;
};

&emmc_controller {
	status = "okay";
};

&emmc {
	status = "okay";
	clk-phase-mmc-hs200 = <36>, <270>;
};

&fsim0 {
	status = "okay";

	#address-cells = <2>;
	#size-cells = <0>;

	fsi-routing-gpios = <&gpio0 ASPEED_GPIO(Q, 7) GPIO_ACTIVE_HIGH>;
	fsi-mux-gpios = <&gpio0 ASPEED_GPIO(B, 0) GPIO_ACTIVE_HIGH>;

	cfam@0,0 {
		reg = <0 0>;
		#address-cells = <1>;
		#size-cells = <1>;
		chip-id = <0>;

		scom@1000 {
			compatible = "ibm,fsi2pib";
			reg = <0x1000 0x400>;
		};

		i2c@1800 {
			compatible = "ibm,fsi-i2c-master";
			reg = <0x1800 0x400>;
			#address-cells = <1>;
			#size-cells = <0>;

			cfam0_i2c0: i2c-bus@0 {
				reg = <0>;
			};

			cfam0_i2c1: i2c-bus@1 {
				reg = <1>;
			};

			cfam0_i2c2: i2c-bus@2 {
				reg = <2>;
			};

			cfam0_i2c3: i2c-bus@3 {
				reg = <3>;
			};

			cfam0_i2c4: i2c-bus@4 {
				reg = <4>;
			};

			cfam0_i2c5: i2c-bus@5 {
				reg = <5>;
			};

			cfam0_i2c6: i2c-bus@6 {
				reg = <6>;
			};

			cfam0_i2c7: i2c-bus@7 {
				reg = <7>;
			};

			cfam0_i2c8: i2c-bus@8 {
				reg = <8>;
			};

			cfam0_i2c9: i2c-bus@9 {
				reg = <9>;
			};

			cfam0_i2c10: i2c-bus@a {
				reg = <10>;
			};

			cfam0_i2c11: i2c-bus@b {
				reg = <11>;
			};

			cfam0_i2c12: i2c-bus@c {
				reg = <12>;
			};

			cfam0_i2c13: i2c-bus@d {
				reg = <13>;
			};

			cfam0_i2c14: i2c-bus@e {
				reg = <14>;
			};
		};

		sbefifo@2400 {
			compatible = "ibm,p9-sbefifo";
			reg = <0x2400 0x400>;
			#address-cells = <1>;
			#size-cells = <0>;

			fsi_occ0: occ {
				compatible = "ibm,p9-occ";
			};
		};

		fsi_hub0: hub@3400 {
			compatible = "fsi-master-hub";
			reg = <0x3400 0x400>;
			#address-cells = <2>;
			#size-cells = <0>;

			no-scan-on-init;
		};
	};
};

&fsi_hub0 {
	cfam@1,0 {
		reg = <1 0>;
		#address-cells = <1>;
		#size-cells = <1>;
		chip-id = <1>;

		scom@1000 {
			compatible = "ibm,fsi2pib";
			reg = <0x1000 0x400>;
		};

		i2c@1800 {
			compatible = "ibm,fsi-i2c-master";
			reg = <0x1800 0x400>;
			#address-cells = <1>;
			#size-cells = <0>;

			cfam1_i2c0: i2c-bus@0 {
				reg = <0>;
			};

			cfam1_i2c1: i2c-bus@1 {
				reg = <1>;
			};

			cfam1_i2c2: i2c-bus@2 {
				reg = <2>;
			};

			cfam1_i2c3: i2c-bus@3 {
				reg = <3>;
			};

			cfam1_i2c4: i2c-bus@4 {
				reg = <4>;
			};

			cfam1_i2c5: i2c-bus@5 {
				reg = <5>;
			};

			cfam1_i2c6: i2c-bus@6 {
				reg = <6>;
			};

			cfam1_i2c7: i2c-bus@7 {
				reg = <7>;
			};

			cfam1_i2c8: i2c-bus@8 {
				reg = <8>;
			};

			cfam1_i2c9: i2c-bus@9 {
				reg = <9>;
			};

			cfam1_i2c10: i2c-bus@a {
				reg = <10>;
			};

			cfam1_i2c11: i2c-bus@b {
				reg = <11>;
			};

			cfam1_i2c12: i2c-bus@c {
				reg = <12>;
			};

			cfam1_i2c13: i2c-bus@d {
				reg = <13>;
			};

			cfam1_i2c14: i2c-bus@e {
				reg = <14>;
			};
		};

		sbefifo@2400 {
			compatible = "ibm,p9-sbefifo";
			reg = <0x2400 0x400>;
			#address-cells = <1>;
			#size-cells = <0>;

			fsi_occ1: occ {
				compatible = "ibm,p9-occ";
			};
		};

		fsi_hub1: hub@3400 {
			compatible = "fsi-master-hub";
			reg = <0x3400 0x400>;
			#address-cells = <2>;
			#size-cells = <0>;

			no-scan-on-init;
		};
	};
};

/* Legacy OCC numbering (to get rid of when userspace is fixed) */
&fsi_occ0 {
	reg = <1>;
};

&fsi_occ1 {
	reg = <2>;
};

/ {
	aliases {
		i2c100 = &cfam0_i2c0;
		i2c101 = &cfam0_i2c1;
		i2c102 = &cfam0_i2c2;
		i2c103 = &cfam0_i2c3;
		i2c104 = &cfam0_i2c4;
		i2c105 = &cfam0_i2c5;
		i2c106 = &cfam0_i2c6;
		i2c107 = &cfam0_i2c7;
		i2c108 = &cfam0_i2c8;
		i2c109 = &cfam0_i2c9;
		i2c110 = &cfam0_i2c10;
		i2c111 = &cfam0_i2c11;
		i2c112 = &cfam0_i2c12;
		i2c113 = &cfam0_i2c13;
		i2c114 = &cfam0_i2c14;
		i2c200 = &cfam1_i2c0;
		i2c201 = &cfam1_i2c1;
		i2c202 = &cfam1_i2c2;
		i2c203 = &cfam1_i2c3;
		i2c204 = &cfam1_i2c4;
		i2c205 = &cfam1_i2c5;
		i2c206 = &cfam1_i2c6;
		i2c207 = &cfam1_i2c7;
		i2c208 = &cfam1_i2c8;
		i2c209 = &cfam1_i2c9;
		i2c210 = &cfam1_i2c10;
		i2c211 = &cfam1_i2c11;
		i2c212 = &cfam1_i2c12;
		i2c213 = &cfam1_i2c13;
		i2c214 = &cfam1_i2c14;
	};

};

&i2c0 {
	multi-master;
	status = "okay";

	ibm-panel@62 {
		compatible = "ibm,op-panel";
		reg = <(0x62 | I2C_OWN_SLAVE_ADDRESS)>;
	};
};

&i2c1 {
	status = "okay";

	tpm: tpm@2e {
		compatible = "tcg,tpm-tis-i2c";
		reg = <0x2e>;
	};
};

&i2c2 {
	status = "okay";
};

&i2c3 {
	status = "okay";

	bmp: bmp280@77 {
		compatible = "bosch,bmp280";
		reg = <0x77>;
		#io-channel-cells = <1>;
	};

	max31785@52 {
		compatible = "maxim,max31785a";
		reg = <0x52>;
		#address-cells = <1>;
		#size-cells = <0>;

		fan@0 {
			compatible = "pmbus-fan";
			reg = <0>;
			tach-pulses = <2>;
			maxim,fan-rotor-input = "tach";
			maxim,fan-pwm-freq = <25000>;
			maxim,fan-dual-tach;
			maxim,fan-no-watchdog;
			maxim,fan-no-fault-ramp;
			maxim,fan-ramp = <2>;
			maxim,fan-fault-pin-mon;
		};

		fan@1 {
			compatible = "pmbus-fan";
			reg = <1>;
			tach-pulses = <2>;
			maxim,fan-rotor-input = "tach";
			maxim,fan-pwm-freq = <25000>;
			maxim,fan-dual-tach;
			maxim,fan-no-watchdog;
			maxim,fan-no-fault-ramp;
			maxim,fan-ramp = <2>;
			maxim,fan-fault-pin-mon;
		};

		fan@2 {
			compatible = "pmbus-fan";
			reg = <2>;
			tach-pulses = <2>;
			maxim,fan-rotor-input = "tach";
			maxim,fan-pwm-freq = <25000>;
			maxim,fan-dual-tach;
			maxim,fan-no-watchdog;
			maxim,fan-no-fault-ramp;
			maxim,fan-ramp = <2>;
			maxim,fan-fault-pin-mon;
		};

		fan@3 {
			compatible = "pmbus-fan";
			reg = <3>;
			tach-pulses = <2>;
			maxim,fan-rotor-input = "tach";
			maxim,fan-pwm-freq = <25000>;
			maxim,fan-dual-tach;
			maxim,fan-no-watchdog;
			maxim,fan-no-fault-ramp;
			maxim,fan-ramp = <2>;
			maxim,fan-fault-pin-mon;
		};
	};

	dps: dps310@76 {
		compatible = "infineon,dps310";
		reg = <0x76>;
		#io-channel-cells = <0>;
	};

	pca0: pca9552@60 {
		compatible = "nxp,pca9552";
		reg = <0x60>;
		#address-cells = <1>;
		#size-cells = <0>;

		gpio-controller;
		#gpio-cells = <2>;

		gpio@0 {
			reg = <0>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@1 {
			reg = <1>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@2 {
			reg = <2>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@3 {
			reg = <3>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@4 {
			reg = <4>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@5 {
			reg = <5>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@6 {
			reg = <6>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@7 {
			reg = <7>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@8 {
			reg = <8>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@9 {
			reg = <9>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@10 {
			reg = <10>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@11 {
			reg = <11>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@12 {
			reg = <12>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@13 {
			reg = <13>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@14 {
			reg = <14>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@15 {
			reg = <15>;
			type = <PCA955X_TYPE_GPIO>;
		};
	};

	power-supply@68 {
		compatible = "ibm,cffps1";
		reg = <0x68>;
	};

	power-supply@69 {
		compatible = "ibm,cffps1";
		reg = <0x69>;
	};
};

&i2c4 {
	status = "okay";

	tmp423a@4c {
		compatible = "ti,tmp423";
		reg = <0x4c>;
	};

	ir35221@70 {
		compatible = "infineon,ir35221";
		reg = <0x70>;
	};

	ir35221@71 {
		compatible = "infineon,ir35221";
		reg = <0x71>;
	};
};

&i2c5 {
	status = "okay";

	tmp423a@4c {
		compatible = "ti,tmp423";
		reg = <0x4c>;
	};

	ir35221@70 {
		compatible = "infineon,ir35221";
		reg = <0x70>;
	};

	ir35221@71 {
		compatible = "infineon,ir35221";
		reg = <0x71>;
	};
};

&i2c7 {
	status = "okay";
};

&i2c9 {
	status = "okay";

	tmp275@4a {
		compatible = "ti,tmp275";
		reg = <0x4a>;
	};
};

&i2c10 {
	status = "okay";
};

&i2c11 {
	status = "okay";

	pca9552: pca9552@60 {
		compatible = "nxp,pca9552";
		reg = <0x60>;
		#address-cells = <1>;
		#size-cells = <0>;
		gpio-controller;
		#gpio-cells = <2>;

		gpio-line-names = "PS_SMBUS_RESET_N", "APSS_RESET_N",
			"GPU0_TH_OVERT_N_BUFF",	"GPU1_TH_OVERT_N_BUFF",
			"GPU2_TH_OVERT_N_BUFF", "GPU3_TH_OVERT_N_BUFF",
			"GPU4_TH_OVERT_N_BUFF",	"GPU5_TH_OVERT_N_BUFF",
			"GPU0_PWR_GOOD_BUFF", "GPU1_PWR_GOOD_BUFF",
			"GPU2_PWR_GOOD_BUFF", "GPU3_PWR_GOOD_BUFF",
			"GPU4_PWR_GOOD_BUFF", "GPU5_PWR_GOOD_BUFF",
			"12V_BREAKER_FLT_N", "THROTTLE_UNLATCHED_N";

		gpio@0 {
			reg = <0>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@1 {
			reg = <1>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@2 {
			reg = <2>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@3 {
			reg = <3>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@4 {
			reg = <4>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@5 {
			reg = <5>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@6 {
			reg = <6>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@7 {
			reg = <7>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@8 {
			reg = <8>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@9 {
			reg = <9>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@10 {
			reg = <10>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@11 {
			reg = <11>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@12 {
			reg = <12>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@13 {
			reg = <13>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@14 {
			reg = <14>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@15 {
			reg = <15>;
			type = <PCA955X_TYPE_GPIO>;
		};
	};

	rtc@32 {
		compatible = "epson,rx8900";
		reg = <0x32>;
	};

	eeprom@51 {
		compatible = "atmel,24c64";
		reg = <0x51>;
	};

	ucd90160@64 {
		compatible = "ti,ucd90160";
		reg = <0x64>;
	};
};

&i2c12 {
	status = "okay";
};

&i2c13 {
	status = "okay";
};

&ibt {
	status = "okay";
};

&uart1 {
	status = "okay";
	// Workaround for A0
	compatible = "snps,dw-apb-uart";
};

&uart5 {
	// Workaround for A0
	compatible = "snps,dw-apb-uart";
};

&vuart1 {
	status = "okay";
};

&vuart2 {
	status = "okay";
};

&lpc_ctrl {
	status = "okay";
	memory-region = <&flash_memory>;
	flash = <&spi1>;
};

&wdt1 {
	aspeed,reset-type = "none";
	aspeed,external-signal;
	aspeed,ext-push-pull;
	aspeed,ext-active-high;

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdtrst1_default>;
};

&wdt2 {
	status = "okay";
};

&pinctrl {
	/* Hog these as no driver is probed for the entire LPC block */
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_lpc_default>,
		    <&pinctrl_lsirq_default>;
};

&xdma {
	status = "okay";
	memory-region = <&vga_memory>;
};

&kcs2 {
	status = "okay";
	aspeed,lpc-io-reg = <0xca8 0xcac>;
};

&kcs3 {
	status = "okay";
	aspeed,lpc-io-reg = <0xca2>;
	aspeed,lpc-interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
};


code:
// SPDX-License-Identifier: GPL-2.0+
// Copyright 2019 YADRO
/dts-v1/;

#include "aspeed-g4.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>

/ {
	model = "Vesnin BMC";
	compatible = "yadro,vesnin-bmc", "aspeed,ast2400";

	chosen {
		stdout-path = &uart5;
		bootargs = "console=ttyS4,115200 earlycon";
	};

	memory@40000000 {
		reg = <0x40000000 0x20000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		vga_memory: framebuffer@5f000000 {
			no-map;
			reg = <0x5f000000 0x01000000>; /* 16MB */
		};
		flash_memory: region@5c000000 {
			no-map;
			reg = <0x5c000000 0x02000000>; /* 32M */
		};
	};

	leds {
		compatible = "gpio-leds";

		heartbeat {
			gpios = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_LOW>;
		};
		power_red {
			gpios = <&gpio ASPEED_GPIO(N, 1) GPIO_ACTIVE_LOW>;
		};

		power_green {
			gpios = <&gpio ASPEED_GPIO(F, 1) GPIO_ACTIVE_LOW>;
		};

		id_blue {
			gpios = <&gpio ASPEED_GPIO(O, 0) GPIO_ACTIVE_LOW>;
		};

		alarm_red {
			gpios = <&gpio ASPEED_GPIO(N, 6) GPIO_ACTIVE_LOW>;
		};

		alarm_yel {
			gpios = <&gpio ASPEED_GPIO(N, 7) GPIO_ACTIVE_HIGH>;
		};
	};

	gpio-keys {
		compatible = "gpio-keys";

		event-checkstop {
			label = "checkstop";
			linux,code = <74>;
			gpios = <&gpio ASPEED_GPIO(P, 5) GPIO_ACTIVE_LOW>;
		};

		event-identify {
			label = "identify";
			linux,code = <152>;
			gpios = <&gpio ASPEED_GPIO(O, 7) GPIO_ACTIVE_LOW>;
		};
	};
};

&fmc {
	status = "okay";
	flash@0 {
		status = "okay";
		m25p,fast-read;
        label = "bmc";
#include "openbmc-flash-layout.dtsi"
	};

	flash@1 {
		status = "okay";
		m25p,fast-read;
		label = "alt";
	};
};

&spi {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1debug_default>;

	flash@0 {
		status = "okay";
		label = "pnor";
		m25p,fast-read;
	};
};

&mac0 {
	status = "okay";
	use-ncsi;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rmii1_default>;
};

&uart5 {
	status = "okay";
};

&lpc_ctrl {
	status = "okay";
	memory-region = <&flash_memory>;
	flash = <&spi>;
};

&ibt {
	status = "okay";
};

&uart3 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd2_default &pinctrl_rxd2_default>;
};

&i2c0 {
	status = "okay";

	eeprom@50 {
		compatible = "atmel,24c256";
		reg = <0x50>;
		pagesize = <64>;
	};
};

&i2c1 {
	status = "okay";

	tmp75@49 {
		compatible = "ti,tmp75";
		reg = <0x49>;
	};
};

&i2c2 {
	status = "okay";
};

&i2c3 {
	status = "okay";
};

&i2c4 {
	status = "okay";

	occ-hwmon@50 {
		compatible = "ibm,p8-occ-hwmon";
		reg = <0x50>;
	};
};

&i2c5 {
	status = "okay";

	occ-hwmon@51 {
		compatible = "ibm,p8-occ-hwmon";
		reg = <0x51>;
	};
};

&i2c6 {
	status = "okay";

	w83795g@2f {
		compatible = "nuvoton,w83795g";
		reg = <0x2f>;
	};
};

&i2c7 {
	status = "okay";

	occ-hwmon@56 {
		compatible = "ibm,p8-occ-hwmon";
		reg = <0x56>;
	};
};

&i2c9 {
	status = "okay";
};

&i2c10 {
	status = "okay";
};

&i2c11 {
	status = "okay";

	occ-hwmon@57 {
		compatible = "ibm,p8-occ-hwmon";
		reg = <0x57>;
	};
};

&i2c12 {
	status = "okay";

	rtc@68 {
		compatible = "maxim,ds3231";
		reg = <0x68>;
	};
};

&i2c13 {
	status = "okay";
};

&vuart {
	status = "okay";
};

&wdt2 {
	aspeed,alt-boot;
};

&sdmmc {
	status = "okay";
};

&sdhci1 {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_sd2_default>;
	cd-inverted;
	disable-wp;
};


code:
// SPDX-License-Identifier: GPL-2.0+
/dts-v1/;
#include "aspeed-g5.dtsi"
#include <dt-bindings/gpio/aspeed-gpio.h>
#include <dt-bindings/leds/leds-pca955x.h>

/ {
	model = "Witherspoon BMC";
	compatible = "ibm,witherspoon-bmc", "aspeed,ast2500";

	chosen {
		stdout-path = &uart5;
		bootargs = "console=ttyS4,115200 earlycon";
	};

	memory@80000000 {
		reg = <0x80000000 0x20000000>;
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		flash_memory: region@98000000 {
			no-map;
			reg = <0x98000000 0x04000000>; /* 64M */
		};

		vga_memory: region@9f000000 {
			no-map;
			compatible = "shared-dma-pool";
			reg = <0x9f000000 0x01000000>; /* 16M */
		};

		gfx_memory: framebuffer {
			size = <0x01000000>;
			alignment = <0x01000000>;
			compatible = "shared-dma-pool";
			reusable;
		};

		video_engine_memory: jpegbuffer {
			size = <0x02000000>;	/* 32MM */
			alignment = <0x01000000>;
			compatible = "shared-dma-pool";
			reusable;
		};
	};

	gpio-keys {
		compatible = "gpio-keys";

		event-air-water {
			label = "air-water";
			gpios = <&gpio ASPEED_GPIO(B, 5) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(B, 5)>;
		};

		event-checkstop {
			label = "checkstop";
			gpios = <&gpio ASPEED_GPIO(J, 2) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(J, 2)>;
		};

		event-ps0-presence {
			label = "ps0-presence";
			gpios = <&gpio ASPEED_GPIO(P, 7) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(P, 7)>;
		};

		event-ps1-presence {
			label = "ps1-presence";
			gpios = <&gpio ASPEED_GPIO(N, 0) GPIO_ACTIVE_LOW>;
			linux,code = <ASPEED_GPIO(N, 0)>;
		};
	};

	iio-hwmon-battery {
		compatible = "iio-hwmon";
		io-channels = <&adc 12>;
	};

	gpio-keys-polled {
		compatible = "gpio-keys-polled";
		poll-interval = <1000>;

		event-fan0-presence {
			label = "fan0-presence";
			gpios = <&pca0 4 GPIO_ACTIVE_LOW>;
			linux,code = <4>;
		};

		event-fan1-presence {
			label = "fan1-presence";
			gpios = <&pca0 5 GPIO_ACTIVE_LOW>;
			linux,code = <5>;
		};

		event-fan2-presence {
			label = "fan2-presence";
			gpios = <&pca0 6 GPIO_ACTIVE_LOW>;
			linux,code = <6>;
		};

		event-fan3-presence {
			label = "fan3-presence";
			gpios = <&pca0 7 GPIO_ACTIVE_LOW>;
			linux,code = <7>;
		};
	};

	leds {
		compatible = "gpio-leds";

		fan0 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 0 GPIO_ACTIVE_LOW>;
		};

		fan1 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 1 GPIO_ACTIVE_LOW>;
		};

		fan2 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 2 GPIO_ACTIVE_LOW>;
		};

		fan3 {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 3 GPIO_ACTIVE_LOW>;
		};

		front-fault {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 13 GPIO_ACTIVE_LOW>;
		};

		front-power {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 14 GPIO_ACTIVE_LOW>;
		};

		front-id {
			retain-state-shutdown;
			default-state = "keep";
			gpios = <&pca0 15 GPIO_ACTIVE_LOW>;
		};

		rear-fault {
			gpios = <&gpio ASPEED_GPIO(N, 2) GPIO_ACTIVE_LOW>;
		};

		rear-id {
			gpios = <&gpio ASPEED_GPIO(N, 4) GPIO_ACTIVE_LOW>;
		};

		rear-power {
			gpios = <&gpio ASPEED_GPIO(N, 3) GPIO_ACTIVE_LOW>;
		};

		power-button {
			gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_LOW>;
		};
	};

	fsi: gpio-fsi {
		compatible = "fsi-master-gpio", "fsi-master";
		#address-cells = <2>;
		#size-cells = <0>;
		no-gpio-delays;

		clock-gpios = <&gpio ASPEED_GPIO(AA, 0) GPIO_ACTIVE_HIGH>;
		data-gpios = <&gpio ASPEED_GPIO(E, 0) GPIO_ACTIVE_HIGH>;
		mux-gpios = <&gpio ASPEED_GPIO(A, 6) GPIO_ACTIVE_HIGH>;
		enable-gpios = <&gpio ASPEED_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
		trans-gpios = <&gpio ASPEED_GPIO(R, 2) GPIO_ACTIVE_HIGH>;
	};

	iio-hwmon-dps310 {
		compatible = "iio-hwmon";
		io-channels = <&dps 0>;
	};

	iio-hwmon-bmp280 {
		compatible = "iio-hwmon";
		io-channels = <&bmp 1>;
	};

};

&gpio {
	gpio-line-names =
	/*A0-A7*/	"","cfam-reset","","","","","fsi-mux","",
	/*B0-B7*/	"","","","","","air-water","","",
	/*C0-C7*/	"","","","","","","","",
	/*D0-D7*/	"fsi-enable","","","","","","","",
	/*E0-E7*/	"fsi-data","","","","","","","",
	/*F0-F7*/	"","","","","","","","",
	/*G0-G7*/	"","","","","","","","",
	/*H0-H7*/	"","","","","","","","",
	/*I0-I7*/	"","","","","","","","",
	/*J0-J7*/	"","","checkstop","","","","","",
	/*K0-K7*/	"","","","","","","","",
	/*L0-L7*/	"","","","","","","","",
	/*M0-M7*/	"","","","","","","","",
	/*N0-N7*/	"presence-ps1","","led-rear-fault","led-rear-power",
		        "led-rear-id","","","",
	/*O0-O7*/	"","","","","","","","",
	/*P0-P7*/	"","","","","","","","presence-ps0",
	/*Q0-Q7*/	"","","","","","","","",
	/*R0-R7*/	"","","fsi-trans","","","power-button","","",
	/*S0-S7*/	"","","","","","","","",
	/*T0-T7*/	"","","","","","","","",
	/*U0-U7*/	"","","","","","","","",
	/*V0-V7*/	"","","","","","","","",
	/*W0-W7*/	"","","","","","","","",
	/*X0-X7*/	"","","","","","","","",
	/*Y0-Y7*/	"","","","","","","","",
	/*Z0-Z7*/	"","","","","","","","",
	/*AA0-AA7*/	"fsi-clock","","","","","","","",
	/*AB0-AB7*/	"","","","","","","","",
	/*AC0-AC7*/	"","","","","","","","";
};

&fmc {
	status = "okay";

	flash@0 {
		status = "okay";
		label = "bmc";
		m25p,fast-read;
		spi-max-frequency = <50000000>;

		partitions {
			#address-cells = < 1 >;
			#size-cells = < 1 >;
			compatible = "fixed-partitions";
			u-boot@0 {
				reg = < 0 0x60000 >;
				label = "u-boot";
			};
			u-boot-env@60000 {
				reg = < 0x60000 0x20000 >;
				label = "u-boot-env";
			};
			obmc-ubi@80000 {
				reg = < 0x80000 0x1F80000 >;
				label = "obmc-ubi";
			};
		};
	};

	flash@1 {
		status = "okay";
		label = "alt-bmc";
		m25p,fast-read;
		spi-max-frequency = <50000000>;

		partitions {
			#address-cells = < 1 >;
			#size-cells = < 1 >;
			compatible = "fixed-partitions";
			u-boot@0 {
				reg = < 0 0x60000 >;
				label = "alt-u-boot";
			};
			u-boot-env@60000 {
				reg = < 0x60000 0x20000 >;
				label = "alt-u-boot-env";
			};
			obmc-ubi@80000 {
				reg = < 0x80000 0x1F80000 >;
				label = "alt-obmc-ubi";
			};
		};
	};
};

&spi1 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_spi1_default>;

	flash@0 {
		status = "okay";
		label = "pnor";
		m25p,fast-read;
		spi-max-frequency = <100000000>;
	};
};

&uart1 {
	/* Rear RS-232 connector */
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd1_default
			&pinctrl_rxd1_default
			&pinctrl_nrts1_default
			&pinctrl_ndtr1_default
			&pinctrl_ndsr1_default
			&pinctrl_ncts1_default
			&pinctrl_ndcd1_default
			&pinctrl_nri1_default>;
};

&uart2 {
	/* APSS */
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_txd2_default &pinctrl_rxd2_default>;
};

&uart5 {
	status = "okay";
};

&lpc_ctrl {
	status = "okay";
	memory-region = <&flash_memory>;
	flash = <&spi1>;
};

&mac0 {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_rmii1_default>;
	clocks = <&syscon ASPEED_CLK_GATE_MAC1CLK>,
		 <&syscon ASPEED_CLK_MAC1RCLK>;
	clock-names = "MACCLK", "RCLK";
	use-ncsi;
};

&i2c2 {
	status = "okay";

	/* MUX ->
	 *    Samtec 1
	 *    Samtec 2
	 */
};

&i2c3 {
	status = "okay";

	bmp: bmp280@77 {
		compatible = "bosch,bmp280";
		reg = <0x77>;
		#io-channel-cells = <1>;
	};

	max31785@52 {
		compatible = "maxim,max31785a";
		reg = <0x52>;
		#address-cells = <1>;
		#size-cells = <0>;
	};

	dps: dps310@76 {
		compatible = "infineon,dps310";
		reg = <0x76>;
		#io-channel-cells = <0>;
	};

	pca0: pca9552@60 {
		compatible = "nxp,pca9552";
		reg = <0x60>;
		#address-cells = <1>;
		#size-cells = <0>;

		gpio-controller;
		#gpio-cells = <2>;

		gpio@0 {
			reg = <0>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@1 {
			reg = <1>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@2 {
			reg = <2>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@3 {
			reg = <3>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@4 {
			reg = <4>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@5 {
			reg = <5>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@6 {
			reg = <6>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@7 {
			reg = <7>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@8 {
			reg = <8>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@9 {
			reg = <9>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@10 {
			reg = <10>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@11 {
			reg = <11>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@12 {
			reg = <12>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@13 {
			reg = <13>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@14 {
			reg = <14>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@15 {
			reg = <15>;
			type = <PCA955X_TYPE_GPIO>;
		};
	};

	power-supply@68 {
		compatible = "ibm,cffps1";
		reg = <0x68>;
	};

	power-supply@69 {
		compatible = "ibm,cffps1";
		reg = <0x69>;
	};
};

&i2c4 {
	status = "okay";

	tmp423a@4c {
		compatible = "ti,tmp423";
		reg = <0x4c>;
	};

	ir35221@70 {
		compatible = "infineon,ir35221";
		reg = <0x70>;
	};

	ir35221@71 {
		compatible = "infineon,ir35221";
		reg = <0x71>;
	};
};

&i2c5 {
	status = "okay";

	tmp423a@4c {
		compatible = "ti,tmp423";
		reg = <0x4c>;
	};

	ir35221@70 {
		compatible = "infineon,ir35221";
		reg = <0x70>;
	};

	ir35221@71 {
		compatible = "infineon,ir35221";
		reg = <0x71>;
	};
};

&i2c9 {
	status = "okay";

	tmp275@4a {
		compatible = "ti,tmp275";
		reg = <0x4a>;
	};
};

&i2c10 {
	/* MUX
	 *   -> PCIe Slot 3
	 *   -> PCIe Slot 4
	 */
	status = "okay";
};

&i2c11 {
	status = "okay";

	pca9552: pca9552@60 {
		compatible = "nxp,pca9552";
		reg = <0x60>;
		#address-cells = <1>;
		#size-cells = <0>;
		gpio-controller;
		#gpio-cells = <2>;

		gpio-line-names = "PS_SMBUS_RESET_N", "APSS_RESET_N",
			"GPU0_TH_OVERT_N_BUFF",	"GPU1_TH_OVERT_N_BUFF",
			"GPU2_TH_OVERT_N_BUFF", "GPU3_TH_OVERT_N_BUFF",
			"GPU4_TH_OVERT_N_BUFF",	"GPU5_TH_OVERT_N_BUFF",
			"GPU0_PWR_GOOD_BUFF", "GPU1_PWR_GOOD_BUFF",
			"GPU2_PWR_GOOD_BUFF", "GPU3_PWR_GOOD_BUFF",
			"GPU4_PWR_GOOD_BUFF", "GPU5_PWR_GOOD_BUFF",
			"12V_BREAKER_FLT_N", "THROTTLE_UNLATCHED_N";

		gpio@0 {
			reg = <0>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@1 {
			reg = <1>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@2 {
			reg = <2>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@3 {
			reg = <3>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@4 {
			reg = <4>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@5 {
			reg = <5>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@6 {
			reg = <6>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@7 {
			reg = <7>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@8 {
			reg = <8>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@9 {
			reg = <9>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@10 {
			reg = <10>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@11 {
			reg = <11>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@12 {
			reg = <12>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@13 {
			reg = <13>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@14 {
			reg = <14>;
			type = <PCA955X_TYPE_GPIO>;
		};

		gpio@15 {
			reg = <15>;
			type = <PCA955X_TYPE_GPIO>;
		};
	};

	rtc@32 {
		compatible = "epson,rx8900";
		reg = <0x32>;
	};

	eeprom@51 {
		compatible = "atmel,24c64";
		reg = <0x51>;
	};

	ucd90160@64 {
		compatible = "ti,ucd90160";
		reg = <0x64>;
	};
};

&i2c12 {
	status = "okay";
};

&i2c13 {
	status = "okay";
};

&vuart {
	status = "okay";
};

&gfx {
	status = "okay";
	memory-region = <&gfx_memory>;
};

&pinctrl {
	aspeed,external-nodes = <&gfx &lhc>;
};

&wdt1 {
	aspeed,reset-type = "none";
	aspeed,external-signal;
	aspeed,ext-push-pull;
	aspeed,ext-active-high;

	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_wdtrst1_default>;
};

&wdt2 {
	aspeed,alt-boot;
};

&ibt {
	status = "okay";
};

&adc {
	status = "okay";
};

&vhub {
	status = "okay";
};

&video {
	status = "okay";
	memory-region = <&video_engine_memory>;
};

&xdma {
	status = "okay";
	memory-region = <&vga_memory>;
};

#include "ibm-power9-dual.dtsi"