diff options
author | Varshit B Pandya <varshit.b.pandya@intel.com> | 2021-06-15 18:17:28 +0530 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-07-05 10:51:32 +0000 |
commit | 048870ae2c0e1baf65004fe27c1523ad1a76314b (patch) | |
tree | e075af3f2a9665821f1114528a8f42ee8e0fa455 /src/mainboard/intel/adlrvp | |
parent | adface7ace1a9ad0d2534f084eef4461e7171deb (diff) |
mb/intel/adlrvp: Remove ASL code and enable dynamic SSDT creation for camera ACPI
This change updates device tree to enable SSDT generation for
world facing camera and user facing camera for ADLRVP.
Also reverts DSDT changes related to both camera.
TEST=Build and Boot aldrvp check i2c enumeration and output of media-ctl
Compared SSDT with this patch against DSDT without this patch, they are same
Signed-off-by: Varshit B Pandya <varshit.b.pandya@intel.com>
Change-Id: I08834bbcf80dc46737de07f69a2402ed6bf93d4f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55526
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rizwan Qureshi <rizwan.qureshi@intel.com>
Diffstat (limited to 'src/mainboard/intel/adlrvp')
-rw-r--r-- | src/mainboard/intel/adlrvp/Kconfig.name | 4 | ||||
-rw-r--r-- | src/mainboard/intel/adlrvp/acpi/mipi_camera.asl | 499 | ||||
-rw-r--r-- | src/mainboard/intel/adlrvp/devicetree.cb | 103 | ||||
-rw-r--r-- | src/mainboard/intel/adlrvp/dsdt.asl | 4 |
4 files changed, 104 insertions, 506 deletions
diff --git a/src/mainboard/intel/adlrvp/Kconfig.name b/src/mainboard/intel/adlrvp/Kconfig.name index 743253e5b6..c05074bba9 100644 --- a/src/mainboard/intel/adlrvp/Kconfig.name +++ b/src/mainboard/intel/adlrvp/Kconfig.name @@ -2,10 +2,14 @@ config BOARD_INTEL_ADLRVP_P bool "Alderlake-P RVP" select DRIVERS_UART_8250IO select MAINBOARD_USES_IFD_EC_REGION + select DRIVERS_INTEL_MIPI_CAMERA + select SOC_INTEL_COMMON_BLOCK_IPU config BOARD_INTEL_ADLRVP_P_EXT_EC bool "Alderlake-P RVP with Chrome EC" select INTEL_LPSS_UART_FOR_CONSOLE + select DRIVERS_INTEL_MIPI_CAMERA + select SOC_INTEL_COMMON_BLOCK_IPU config BOARD_INTEL_ADLRVP_M bool "Alderlake-M RVP" diff --git a/src/mainboard/intel/adlrvp/acpi/mipi_camera.asl b/src/mainboard/intel/adlrvp/acpi/mipi_camera.asl deleted file mode 100644 index b8bd6dcd9b..0000000000 --- a/src/mainboard/intel/adlrvp/acpi/mipi_camera.asl +++ /dev/null @@ -1,499 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -Scope (\_SB.PCI0.IPU0) -{ - Name (_DSD, Package (0x02) /* _DSD: Device-Specific Data */ - { - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package (0x02) - { - Package (0x02) - { - "port0", - "PRT0" - }, - Package (0x02) - { - "port1", - "PRT1" - } - } - }) - Name (PRT0, Package (0x04) - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x01) - { - Package (0x02) - { - "port", - 2 - } - }, - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package (0x01) - { - Package (0x02) - { - "endpoint0", - "EP00" - } - } - }) - Name (PRT1, Package (0x04) - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x01) - { - Package (0x02) - { - "port", - One - } - }, - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package (0x01) - { - Package (0x02) - { - "endpoint0", - "EP10" - } - } - }) -} - -Scope (\_SB.PCI0.IPU0) -{ - Name (EP00, Package (0x02) - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x04) - { - Package (0x02) - { - "endpoint", - Zero - }, - Package (0x02) - { - "clock-lanes", - Zero - }, - Package (0x02) - { - "data-lanes", - Package (0x02) - { - One, - 0x02, - } - }, - Package (0x02) - { - "remote-endpoint", - Package (0x03) - { - ^I2C5.CAM1, - Zero, - Zero - } - } - } - }) - Name (EP10, Package (0x02) - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x04) - { - Package (0x02) - { - "endpoint", - Zero - }, - Package (0x02) - { - "clock-lanes", - Zero - }, - Package (0x02) - { - "data-lanes", - Package (0x02) - { - One, - 0x02, - } - }, - Package (0x02) - { - "remote-endpoint", - Package (0x03) - { - ^I2C1.CAM0, - Zero, - Zero - } - } - } - }) -} - -Scope (\_SB.PCI0.I2C1) -{ - PowerResource (RCPR, 0x00, 0x0000) - { - Name (STA, Zero) - Method (_ON, 0, Serialized) /* Rear camera_ON_: Power On */ - { - If ((STA == Zero)) - { - /* Enable IMG_CLK */ - MCON(0,1) /* Clock 0, 19.2MHz */ - /* Pull PWREN high */ - STXS(GPP_B23) - Sleep(2) /* reset pulse width */ - /* Pull RST low */ - CTXS(GPP_R5) - Sleep(1) /* t2 */ - /* Pull RST high */ - STXS(GPP_R5) - Sleep(1) /* t2 */ - Store(1,STA) - } - } - Method (_OFF, 0, Serialized) /* Rear camera _OFF: Power Off */ - { - If ((STA == One)) - { - /* Disable IMG_CLK */ - Sleep(1) /* t0+t1 */ - MCOF(0) /* Clock 0 */ - /* Pull RST low */ - CTXS(GPP_R5) - /* Pull PWREN low */ - CTXS(GPP_B23) - Store(0,STA) - } - } - Method (_STA, 0, NotSerialized) /* _STA: Status */ - { - Return (STA) - } - } - Device (CAM0) - { - Name (_HID, "OVTI5675") /* _HID: Hardware ID */ - Name (_UID, Zero) /* _UID: Unique ID */ - Name (_DDN, "Ov 5675 Camera") /* _DDN: DOS Device Name */ - Method (_STA, 0, NotSerialized) /* _STA: Status */ - { - Return (0x0F) - } - Name (_CRS, ResourceTemplate () /* _CRS: Current Resource Settings */ - { - I2cSerialBus (0x0036, ControllerInitiated, 0x00061A80, - AddressingMode7Bit, "\\_SB.PCI0.I2C1", - 0x00, ResourceConsumer, , - ) - }) - Name (_PR0, Package (0x01) /* _PR0: Power Resources for D0 */ - { - RCPR - }) - Name (_PR3, Package (0x01) /* _PR3: Power Resources for D3hot */ - { - RCPR - }) - Name (_DSD, Package (0x04) /* _DSD: Device-Specific Data */ - { - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package (0x01) - { - Package (0x02) - { - "port0", - "PRT0" - } - }, - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x02) - { - Package (0x02) - { - "clock-frequency", - 0x0124F800 - }, - Package (0x02) - { - "lens-focus", - Package (0x01) - { - VCM0 - } - } - } - }) - Name (PRT0, Package (0x04) - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x01) - { - Package (0x02) - { - "port", - Zero - } - }, - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package (0x01) - { - Package (0x02) - { - "endpoint0", - "EP00" - } - } - }) - Name (EP00, Package (0x02) - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x05) - { - Package (0x02) - { - "endpoint", - Zero - }, - Package (0x02) - { - "clock-lanes", - Zero - }, - Package (0x02) - { - "data-lanes", - Package (0x02) - { - One, - 0x02 - } - }, - Package (0x02) - { - "link-frequencies", - Package (0x01) - { - 0x1AD27480 - } - }, - Package (0x02) - { - "remote-endpoint", - Package (0x03) - { - IPU0, - Zero, - Zero - } - } - } - }) - } - Device (VCM0) - { - Name (_HID, "PRP0001") /* _HID: Hardware ID */ - Name (_UID, 0x03) /* _UID: Unique ID */ - Name (_DDN, "DW AF DAC") /* _DDN: DOS Device Name */ - Method (_STA, 0, NotSerialized) /* _STA: Status */ - { - Return (0x0F) - } - Name (_CRS, ResourceTemplate () /* _CRS: Current Resource Settings */ - { - I2cSerialBus (0x000C, ControllerInitiated, 0x00061A80, - AddressingMode7Bit, "\\_SB.PCI0.I2C1", - 0x00, ResourceConsumer, , - ) - }) - Name (_DEP, Package (0x01) /* _DEP: Dependencies */ - { - CAM0 - }) - Name (_PR0, Package (0x01) /* _PR0: Power Resources for D0 */ - { - RCPR - }) - Name (_PR3, Package (0x01) /* _PR3: Power Resources for D3hot */ - { - RCPR - }) - Name (_DSD, Package (0x02) /* _DSD: Device-Specific Data */ - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x01) - { - Package (0x02) - { - "compatible", - "dongwoon,dw9714" - } - } - }) - } -} - -Scope (\_SB.PCI0.I2C5) -{ - PowerResource (FCPR, 0x00, 0x0000) - { - Name (STA, Zero) - Method (_ON, 0, Serialized) /* Front camera_ON_: Power On */ - { - If ((STA == Zero)) - { - /* Enable IMG_CLK */ - MCON(1,1) /* Clock 1, 19.2MHz */ - /* Pull PWREN high */ - STXS(GPP_E16) - Sleep(2) /* reset pulse width */ - /* Pull RST low */ - CTXS(GPP_E15) - Sleep(1) /* t2 */ - /* Pull RST high */ - STXS(GPP_E15) - Sleep(1) /* t2 */ - Store(1,STA) - } - } - Method (_OFF, 0, Serialized) /* Front camera_OFF_: Power Off */ - { - If ((STA == One)) - { - /* Disable IMG_CLK */ - Sleep(1) /* t0+t1 */ - MCOF(1) /* Clock 1 */ - /* Pull RST low */ - CTXS(GPP_E15) - /* Pull PWREN low */ - CTXS(GPP_E16) - Store(0,STA) - } - } - Method (_STA, 0, NotSerialized) /* _STA: Status */ - { - Return (STA) - } - } - Device (CAM1) - { - Name (_HID, "OVTI5675") /* _HID: Hardware ID */ - Name (_UID, Zero) /* _UID: Unique ID */ - Name (_DDN, "Ov 5675 Camera") /* _DDN: DOS Device Name */ - Method (_STA, 0, NotSerialized) /* _STA: Status */ - { - Return (0x0F) - } - Name (_CRS, ResourceTemplate () /* _CRS: Current Resource Settings */ - { - I2cSerialBus (0x0036, ControllerInitiated, 0x00061A80, - AddressingMode7Bit, "\\_SB.PCI0.I2C5", - 0x00, ResourceConsumer, , - ) - }) - Name (_PR0, Package (0x01) /* _PR0: Power Resources for D0 */ - { - FCPR - }) - Name (_PR3, Package (0x01) /* _PR3: Power Resources for D3hot */ - { - FCPR - }) - Name (_DSD, Package (0x04) /* _DSD: Device-Specific Data */ - { - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package (0x01) - { - Package (0x02) - { - "port0", - "PRT0" - } - }, - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x01) - { - Package (0x02) - { - "clock-frequency", - 0x0124F800 - } - } - }) - Name (PRT0, Package (0x04) - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x01) - { - Package (0x02) - { - "port", - Zero - } - }, - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package (0x01) - { - Package (0x02) - { - "endpoint0", - "EP00" - } - } - }) - Name (EP00, Package (0x02) - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package (0x05) - { - Package (0x02) - { - "endpoint", - Zero - }, - Package (0x02) - { - "clock-lanes", - Zero - }, - Package (0x02) - { - "data-lanes", - Package (0x02) - { - One, - 0x02 - } - }, - Package (0x02) - { - "link-frequencies", - Package (0x01) - { - 0x1AD27480 - } - }, - Package (0x02) - { - "remote-endpoint", - Package (0x03) - { - IPU0, - One, - Zero - } - } - } - }) - } -} diff --git a/src/mainboard/intel/adlrvp/devicetree.cb b/src/mainboard/intel/adlrvp/devicetree.cb index affa6f8384..8c823cd789 100644 --- a/src/mainboard/intel/adlrvp/devicetree.cb +++ b/src/mainboard/intel/adlrvp/devicetree.cb @@ -312,7 +312,21 @@ chip soc/intel/alderlake device generic 0 on end end end - device ref ipu on end + device ref ipu on + chip drivers/intel/mipi_camera + register "acpi_uid" = "0x50000" + register "acpi_name" = ""IPU0"" + register "device_type" = "INTEL_ACPI_CAMERA_CIO2" + + register "cio2_num_ports" = "2" + register "cio2_lanes_used" = "{2,2}" + register "cio2_lane_endpoint[0]" = ""^I2C5.CAM1"" + register "cio2_lane_endpoint[1]" = ""^I2C1.CAM0"" + register "cio2_prt[0]" = "2" + register "cio2_prt[1]" = "1" + device generic 0 on end + end + end device ref pcie4_0 on end device ref pcie4_1 on end device ref tbt_pcie_rp0 on end @@ -344,12 +358,95 @@ chip soc/intel/alderlake end end device ref i2c0 on end - device ref i2c1 on end + device ref i2c1 on + chip drivers/intel/mipi_camera + register "acpi_hid" = ""OVTI5675"" + register "acpi_uid" = "0" + register "acpi_name" = ""CAM0"" + register "chip_name" = ""Ov 5675 Camera"" + register "device_type" = "INTEL_ACPI_CAMERA_SENSOR" + + register "ssdb.lanes_used" = "2" + register "ssdb.vcm_type" = "0x0C" + register "vcm_name" = ""VCM0"" + register "num_freq_entries" = "1" + register "link_freq[0]" = "450000000" + register "remote_name" = ""IPU0"" + + register "has_power_resource" = "1" + #Controls + register "clk_panel.clks[0].clknum" = "0" #IMGCLKOUT_0 + register "clk_panel.clks[0].freq" = "1" #19.2 Mhz + register "gpio_panel.gpio[0].gpio_num" = "GPP_B23" #power_enable + register "gpio_panel.gpio[1].gpio_num" = "GPP_R5" #reset + + #_ON + register "on_seq.ops_cnt" = "4" + register "on_seq.ops[0]" = "SEQ_OPS_CLK_ENABLE(0, 0)" + register "on_seq.ops[1]" = "SEQ_OPS_GPIO_ENABLE(0, 2)" + register "on_seq.ops[2]" = "SEQ_OPS_GPIO_DISABLE(1, 1)" + register "on_seq.ops[3]" = "SEQ_OPS_GPIO_ENABLE(1, 1)" + + #_OFF + register "off_seq.ops_cnt" = "3" + register "off_seq.ops[0]" = "SEQ_OPS_CLK_DISABLE(0, 0)" + register "off_seq.ops[1]" = "SEQ_OPS_GPIO_DISABLE(1, 0)" + register "off_seq.ops[2]" = "SEQ_OPS_GPIO_DISABLE(0, 0)" + + device i2c 36 on end + end + chip drivers/intel/mipi_camera + register "acpi_uid" = "3" + register "acpi_name" = ""VCM0"" + register "chip_name" = ""DW AF VCM"" + register "device_type" = "INTEL_ACPI_CAMERA_VCM" + + register "pr0" = ""\\_SB.PCI0.I2C1.CAM0.PRIC"" + register "vcm_compat" = ""dongwoon,dw9714"" + + device i2c 0C on end + end + end device ref i2c2 on end device ref i2c3 on end device ref heci1 on end device ref sata on end - device ref i2c5 on end + device ref i2c5 on + chip drivers/intel/mipi_camera + register "acpi_hid" = ""OVTI5675"" + register "acpi_uid" = "0" + register "acpi_name" = ""CAM1"" + register "chip_name" = ""Ov 5675 Camera"" + register "device_type" = "INTEL_ACPI_CAMERA_SENSOR" + + register "ssdb.lanes_used" = "2" + register "num_freq_entries" = "1" + register "link_freq[0]" = "450000000" + register "remote_name" = ""IPU0"" + + register "has_power_resource" = "1" + #Controls + register "clk_panel.clks[0].clknum" = "1" #IMGCLKOUT_1 + register "clk_panel.clks[0].freq" = "1" #19.2 Mhz + register "gpio_panel.gpio[0].gpio_num" = "GPP_E16" #power_enable + register "gpio_panel.gpio[1].gpio_num" = "GPP_E15" #reset + + #_ON + register "on_seq.ops_cnt" = "4" + register "on_seq.ops[0]" = "SEQ_OPS_CLK_ENABLE(0, 0)" + register "on_seq.ops[1]" = "SEQ_OPS_GPIO_ENABLE(0, 2)" + register "on_seq.ops[2]" = "SEQ_OPS_GPIO_DISABLE(1, 1)" + register "on_seq.ops[3]" = "SEQ_OPS_GPIO_ENABLE(1, 1)" + + #_OFF + register "off_seq.ops_cnt" = "3" + register "off_seq.ops[0]" = "SEQ_OPS_CLK_DISABLE(0, 0)" + register "off_seq.ops[1]" = "SEQ_OPS_GPIO_DISABLE(1, 0)" + register "off_seq.ops[2]" = "SEQ_OPS_GPIO_DISABLE(0, 0)" + + device i2c 36 on end + end + end device ref pcie_rp1 on end device ref pcie_rp3 on end # W/A to FSP issue device ref pcie_rp4 on end # W/A to FSP issue diff --git a/src/mainboard/intel/adlrvp/dsdt.asl b/src/mainboard/intel/adlrvp/dsdt.asl index 6a4f512f43..4b41b22d6f 100644 --- a/src/mainboard/intel/adlrvp/dsdt.asl +++ b/src/mainboard/intel/adlrvp/dsdt.asl @@ -25,12 +25,8 @@ DefinitionBlock( #include <soc/intel/common/block/acpi/acpi/northbridge.asl> #include <soc/intel/alderlake/acpi/southbridge.asl> #include <soc/intel/alderlake/acpi/tcss.asl> - #include <soc/intel/common/block/acpi/acpi/ipu.asl> } - /* Camera */ - #include <acpi/mipi_camera.asl> - #if CONFIG(EC_GOOGLE_CHROMEEC) /* Chrome OS Embedded Controller */ Scope (\_SB.PCI0.LPCB) |