# SPDX-License-Identifier: GPL-2.0-or-later

chip northbridge/intel/x4x		# Northbridge
	device cpu_cluster 0 on ops x4x_cpu_bus_ops end		# APIC cluster
	device domain 0 on
		ops x4x_pci_domain_ops		# PCI domain
		subsystemid 0x8086 0x0028 inherit
		device pci 0.0 on  end		# Host Bridge
		device pci 2.0 on  end		# Integrated graphics controller
		device pci 2.1 on  end		# Integrated graphics controller 2
		device pci 3.0 off end		# ME
		device pci 3.1 off end		# ME
		chip southbridge/intel/i82801jx	# Southbridge
			register "gpe0_en" = "0x40"

			# Set AHCI mode.
			register "sata_port_map"	= "0x3f"
			register "sata_clock_request"	= "0"

			# Enable PCIe ports 0,1 as slots.
			register "pcie_slot_implemented" = "0x3"

			# "Additional LPC IO decode ranges": used for SuperIO's
			# Environment Controller on 0xa15/0xa16
			register "gen1_dec" = "0x00fc0a01"

			device pci 19.0 on  end		# GBE
			device pci 1a.0 on  end		# USB
			device pci 1a.1 on  end		# USB
			device pci 1a.2 on  end		# USB
			device pci 1a.7 on  end		# USB
			device pci 1b.0 on  end		# Audio
			device pci 1c.0 on  end		# PCIe 1
			device pci 1c.1 on  end		# PCIe 2
			device pci 1c.2 off end		# PCIe 3
			device pci 1c.3 off end		# PCIe 4
			device pci 1c.4 off end		# PCIe 5
			device pci 1c.5 off end		# PCIe 6
			device pci 1d.0 on  end		# USB
			device pci 1d.1 on  end		# USB
			device pci 1d.2 on  end		# USB
			device pci 1d.7 on  end		# USB
			device pci 1e.0 on  end		# PCI bridge
			device pci 1f.0 on		# LPC bridge
				chip superio/ite/it8720f		# Super I/O
					register "ec.smbus_en"		= "1"
					register "ec.smbus_24mhz"	= "1"
					register "TMPIN1.mode"		= "THERMAL_DIODE"
					register "TMPIN2.mode"		= "THERMAL_RESISTOR"
					register "TMPIN3.mode"		= "THERMAL_PECI"
					register "TMPIN3.offset"	= "100"
					register "TMPIN3.min"		= "0"
					register "TMPIN3.max"		= "100"

					register "FAN1.mode" = "FAN_SMART_AUTOMATIC"	# CPU fan
					register "FAN1.smart.tmpin"	= "3"
					register "FAN1.smart.tmp_off"	= "0"
					register "FAN1.smart.tmp_start"	= "50"
					register "FAN1.smart.tmp_full"	= "90"
					register "FAN1.smart.tmp_delta"	= "3"
					register "FAN1.smart.full_lmt"	= "1"
					register "FAN1.smart.smoothing"	= "0"
					register "FAN1.smart.pwm_start"	= "30"
					register "FAN1.smart.slope"	= "0x0d"
					register "FAN2.mode" = "FAN_SMART_AUTOMATIC"	# System fan
					register "FAN2.smart.tmpin"	= "2"
					register "FAN2.smart.tmp_off"	= "0"
					register "FAN2.smart.tmp_start"	= "40"
					register "FAN2.smart.tmp_full"	= "90"
					register "FAN2.smart.tmp_delta"	= "2"
					register "FAN2.smart.full_lmt"	= "0"
					register "FAN2.smart.smoothing"	= "0"
					register "FAN2.smart.pwm_start"	= "48"
					register "FAN2.smart.slope"	= "0x20"
					register "FAN3.mode" = "FAN_MODE_OFF"		# Not connected

					register "ec.vin_mask" = "VIN_ALL"

					device pnp 2e.0 off end		# Floppy
					device pnp 2e.1 off end		# COM 1
					device pnp 2e.2 off end		# COM 2
					device pnp 2e.3 off end		# Parallel port
					device pnp 2e.4 on		# Environment controller
						io 0x60 = 0xa10
						io 0x62 = 0xa00
						irq 0x70 = 0x00
						irq 0xf0 = 0x00
						irq 0xf1 = 0x00
						irq 0xf2 = 0x00
						irq 0xf3 = 0x00
						irq 0xf4 = 0x60
						irq 0xf5 = 0x00
						irq 0xf6 = 0x00
					end
					device pnp 2e.5 on		# Keyboard
						io 0x60  = 0x060
						irq 0x70 = 0x1
						io 0x62  = 0x064
						irq 0xf0 = 0x00
					end
					device pnp 2e.6 on		# Mouse
						irq 0x70 = 0x0c
						irq 0xf0 = 0x00
					end
					device pnp 2e.7 on		# GPIO
						io 0x60 = 0x000
						io 0x62 = 0xa20
						io 0x64 = 0xa30
						irq 0xc0 = 0x01		# Simple IO Set 1
						irq 0xc1 = 0x0c		# Simple IO Set 2
						irq 0xc2 = 0x70		# Simple IO Set 3
						irq 0xc3 = 0x00		# Simple IO Set 4
						irq 0xc8 = 0x01		# Simple IO Set 1 Output
						irq 0xc9 = 0x0c		# Simple IO Set 2 Output
						irq 0xca = 0x00		# Simple IO Set 3 Output
						irq 0xcb = 0x00		# Simple IO Set 4 Output
						irq 0xf0 = 0x00
						irq 0xf1 = 0x00
						irq 0xf2 = 0x00
						irq 0xf3 = 0x00
						irq 0xf4 = 0x00
						irq 0xf5 = 0x00
						irq 0xf6 = 0x00
						irq 0xf7 = 0x00
						irq 0xf8 = 0x12
						irq 0xf9 = 0x02
						irq 0xfa = 0x13
						irq 0xfb = 0x02
						#irq 0xfc = 0xef	# VID Input
						irq 0xfd = 0x00
						irq 0xfe = 0x00
					end
					device pnp 2e.a off end		# CIR
				end
			end
			device pci 1f.2 on  end		# SATA (IDE: port 0-3, AHCI/RAID: 0-5)
			device pci 1f.3 on		# SMBus
				chip drivers/i2c/ck505	# IDT CV194
					register "mask" = "{ 0xff, 0xff, 0xff, 0x00,
							     0xff, 0x00, 0x00, 0x00,
							     0x00, 0xff, 0xff, 0xff,
							     0x00, 0xff }"
					register "regs" = "{ 0x57, 0xd9, 0xfe, 0xff,
							     0xff, 0x00, 0x00, 0x00,
							     0x00, 0x24, 0x7d, 0x96,
							     0x00, 0x9d }"
					device i2c 69 on end
				end
			end
			device pci 1f.4 off end
			device pci 1f.5 off end		# SATA 2 (for port 4-5 in IDE mode)
			device pci 1f.6 off end		# Thermal Subsystem
		end
	end
end