src/mb/intel/tglrvp: Update camera ACPI configuration

* Change power sequence to make it closer to ov8856 sensor
  data sheet version 2
* Handle different PWREN GPIO pins for up3 and up4
* Add link frequencies definitions to sensor side
* Clean up format

BUG=None
BRANCH=None
TEST=Build and boot TGLRVP U or Y. Start camera app and able to
capture images.

Signed-off-by: Daniel Kang <daniel.h.kang@intel.com>
Change-Id: Ic11a36f1f82fe425c1a5796847ce020007064403
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39529
Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Daniel Kang 2020-03-13 18:19:24 -07:00 committed by Patrick Georgi
parent 789bdc3d9b
commit 0ae21ff7ff
1 changed files with 115 additions and 89 deletions

View File

@ -15,7 +15,7 @@
Scope (\_SB.PCI0.IPU0) Scope (\_SB.PCI0.IPU0)
{ {
Name (_DSD, Package (0x02) Name (_DSD, Package (0x02) /* _DSD: Device-Specific Data */
{ {
ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
Package (0x02) Package (0x02)
@ -25,7 +25,6 @@ Scope (\_SB.PCI0.IPU0)
"port0", "port0",
"PRT0" "PRT0"
}, },
Package (0x02) Package (0x02)
{ {
"port1", "port1",
@ -45,7 +44,6 @@ Scope (\_SB.PCI0.IPU0)
One One
} }
}, },
ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
Package (0x01) Package (0x01)
{ {
@ -81,7 +79,7 @@ Scope (\_SB.PCI0.IPU0)
}) })
} }
Scope (_SB.PCI0.IPU0) Scope (\_SB.PCI0.IPU0)
{ {
Name (EP00, Package (0x02) Name (EP00, Package (0x02)
{ {
@ -93,13 +91,11 @@ Scope (_SB.PCI0.IPU0)
"endpoint", "endpoint",
Zero Zero
}, },
Package (0x02) Package (0x02)
{ {
"clock-lanes", "clock-lanes",
Zero Zero
}, },
Package (0x02) Package (0x02)
{ {
"data-lanes", "data-lanes",
@ -111,7 +107,6 @@ Scope (_SB.PCI0.IPU0)
0x04 0x04
} }
}, },
Package (0x02) Package (0x02)
{ {
"remote-endpoint", "remote-endpoint",
@ -134,13 +129,11 @@ Scope (_SB.PCI0.IPU0)
"endpoint", "endpoint",
Zero Zero
}, },
Package (0x02) Package (0x02)
{ {
"clock-lanes", "clock-lanes",
Zero Zero
}, },
Package (0x02) Package (0x02)
{ {
"data-lanes", "data-lanes",
@ -172,40 +165,45 @@ Scope (\_SB.PCI0.I2C3)
PowerResource (RCPR, 0x00, 0x0000) PowerResource (RCPR, 0x00, 0x0000)
{ {
Name (STA, Zero) Name (STA, Zero)
Method (_ON, 0, Serialized) Method (_ON, 0, Serialized) /* Rear camera_ON_: Power On */
{ {
If ((STA == Zero)) If ((STA == Zero))
{ {
/* Enable CLK0 with 19.2MHz */ /* Enable IMG_CLK */
MCON(0,1) MCON(0,1) /* Clock 0, 19.2MHz */
/* Pull PWREN(GPIO B23) high */
STXS(GPP_B23) /* Pull RST low */
Sleep(5)
/* Pull RST(GPIO C15) low */
CTXS(GPP_C15) CTXS(GPP_C15)
Sleep(5)
/* Pull PWREN high */
STXS(GPP_B23)
Sleep(2) /* reset pulse width */
/* Pull RST high */ /* Pull RST high */
STXS(GPP_C15) STXS(GPP_C15)
Sleep(5) Sleep(1) /* t2 */
Store(1,STA) Store(1,STA)
} }
} }
Method (_OFF, 0, Serialized) /* Rear camera _OFF: Power Off */
Method (_OFF, 0, Serialized)
{ {
If ((STA == One)) If ((STA == One))
{ {
/* Disable IMG_CLK */
Sleep(1) /* t0+t1 */
MCOF(0) /* Clock 0 */
/* Pull RST low */ /* Pull RST low */
CTXS(GPP_C15) CTXS(GPP_C15)
/* Pull PWREN low */ /* Pull PWREN low */
CTXS(GPP_B23) CTXS(GPP_B23)
/* Disable CLK0 */
MCOF(0)
Store(0,STA) Store(0,STA)
} }
} }
Method (_STA, 0, NotSerialized) /* _STA: Status */
Method (_STA, 0, NotSerialized)
{ {
Return (STA) Return (STA)
} }
@ -213,33 +211,29 @@ Scope (\_SB.PCI0.I2C3)
Device (CAM0) Device (CAM0)
{ {
Name (_HID, "OVTI8856") Name (_HID, "OVTI8856") /* _HID: Hardware ID */
Name (_UID, Zero) Name (_UID, Zero) /* _UID: Unique ID */
Name (_DDN, "Ov 8856 Camera") Name (_DDN, "Ov 8856 Camera") /* _DDN: DOS Device Name */
Method (_STA, 0, NotSerialized) Method (_STA, 0, NotSerialized) /* _STA: Status */
{ {
Return (0x0F) Return (0x0F)
} }
Name (_CRS, ResourceTemplate () /* _CRS: Current Resource Settings */
Name (_CRS, ResourceTemplate ()
{ {
I2cSerialBus (0x0010, ControllerInitiated, 0x00061A80, I2cSerialBus (0x0010, ControllerInitiated, 0x00061A80,
AddressingMode7Bit, "\\_SB.PCI0.I2C3", AddressingMode7Bit, "\\_SB.PCI0.I2C3",
0x00, ResourceConsumer, , 0x00, ResourceConsumer, ,
) )
}) })
Name (_PR0, Package (0x01) /* _PR0: Power Resources for D0 */
Name (_PR0, Package (0x01)
{ {
RCPR RCPR
}) })
Name (_PR3, Package (0x01) /* _PR3: Power Resources for D3hot */
Name (_PR3, Package (0x01)
{ {
RCPR RCPR
}) })
Name (_DSD, Package (0x04) /* _DSD: Device-Specific Data */
Name (_DSD, Package (0x04)
{ {
ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
Package (0x01) Package (0x01)
@ -250,7 +244,6 @@ Scope (\_SB.PCI0.I2C3)
"PRT0" "PRT0"
} }
}, },
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package (0x02) Package (0x02)
{ {
@ -269,7 +262,6 @@ Scope (\_SB.PCI0.I2C3)
} }
} }
}) })
Name (PRT0, Package (0x04) Name (PRT0, Package (0x04)
{ {
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
@ -281,7 +273,6 @@ Scope (\_SB.PCI0.I2C3)
Zero Zero
} }
}, },
ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
Package (0x01) Package (0x01)
{ {
@ -292,24 +283,39 @@ Scope (\_SB.PCI0.I2C3)
} }
} }
}) })
Name (EP00, Package (0x02) Name (EP00, Package (0x02)
{ {
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package (0x03) Package (0x05)
{ {
Package (0x02) Package (0x02)
{ {
"endpoint", "endpoint",
Zero Zero
}, },
Package (0x02)
{
"clock-lanes",
Zero
},
Package (0x02)
{
"data-lanes",
Package (0x04)
{
One,
0x02,
0x03,
0x04
}
},
Package (0x02) Package (0x02)
{ {
"link-frequencies", "link-frequencies",
Package (0x01) Package (0x02)
{ {
0x325AA000 0x15752A00,
0xABA9500
} }
}, },
Package (0x02) Package (0x02)
@ -328,34 +334,33 @@ Scope (\_SB.PCI0.I2C3)
Device (VCM0) Device (VCM0)
{ {
Name (_HID, "PRP0001") Name (_HID, "PRP0001") /* _HID: Hardware ID */
Name (_UID, 0x03) Name (_UID, 0x03) /* _UID: Unique ID */
Name (_DDN, "DW9714 VCM") Name (_DDN, "DW9714 VCM") /* _DDN: DOS Device Name */
Method (_STA, 0, NotSerialized) Method (_STA, 0, NotSerialized) /* _STA: Status */
{ {
Return (0x0F) Return (0x0F)
} }
Name (_CRS, ResourceTemplate () /* _CRS: Current Resource Settings */
Name (_CRS, ResourceTemplate ()
{ {
I2cSerialBus (0x000C, ControllerInitiated, 0x00061A80, I2cSerialBus (0x000C, ControllerInitiated, 0x00061A80,
AddressingMode7Bit, "\\_SB.PCI0.I2C3", AddressingMode7Bit, "\\_SB.PCI0.I2C3",
0x00, ResourceConsumer, , 0x00, ResourceConsumer, ,
) )
}) })
Name (_DEP, Package (0x01) Name (_DEP, Package (0x01) /* _DEP: Dependencies */
{ {
CAM0 CAM0
}) })
Name (_PR0, Package (0x01) Name (_PR0, Package (0x01) /* _PR0: Power Resources for D0 */
{ {
RCPR RCPR
}) })
Name (_PR3, Package (0x01) Name (_PR3, Package (0x01) /* _PR3: Power Resources for D3hot */
{ {
RCPR RCPR
}) })
Name (_DSD, Package (0x02) Name (_DSD, Package (0x02) /* _DSD: Device-Specific Data */
{ {
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package (0x01) Package (0x01)
@ -375,40 +380,53 @@ Scope (\_SB.PCI0.I2C5)
PowerResource (FCPR, 0x00, 0x0000) PowerResource (FCPR, 0x00, 0x0000)
{ {
Name (STA, Zero) Name (STA, Zero)
Method (_ON, 0, Serialized) Method (_ON, 0, Serialized) /* Front camera_ON_: Power On */
{ {
If ((STA == Zero)) If ((STA == Zero))
{ {
/* Enable CLK1 with 19.2MHz */ /* Enable IMG_CLK */
MCON(1,1) MCON(1,1) /* Clock 1, 19.2MHz */
/* Pull PWREN(GPIO R6) high */
STXS(GPP_R6) /* Pull RST low */
Sleep(5)
/* Pull RST(GPIO H12) low */
CTXS(GPP_H12) CTXS(GPP_H12)
Sleep(5)
/* Pull PWREN high */
#if CONFIG_BOARD_INTEL_TIGERLAKE_RVPY
STXS(GPP_E22)
#else
STXS(GPP_R6)
#endif
Sleep(2) /* reset pulse width */
/* Pull RST high */ /* Pull RST high */
STXS(GPP_H12) STXS(GPP_H12)
Sleep(5) Sleep(1) /* t2 */
Store(1,STA) Store(1,STA)
} }
} }
Method (_OFF, 0, Serialized) /* Front camera_OFF_: Power Off */
Method (_OFF, 0, Serialized)
{ {
If ((STA == One)) If ((STA == One))
{ {
/* Disable IMG_CLK */
Sleep(1) /* t0+t1 */
MCOF(1) /* Clock 1 */
/* Pull RST low */ /* Pull RST low */
CTXS(GPP_H12) CTXS(GPP_H12)
/* Pull PWREN low */ /* Pull PWREN low */
#if CONFIG_BOARD_INTEL_TIGERLAKE_RVPY
CTXS(GPP_E22)
#else
CTXS(GPP_R6) CTXS(GPP_R6)
/* Disable CLK1 */ #endif
MCOF(1)
Store(0,STA) Store(0,STA)
} }
} }
Method (_STA, 0, NotSerialized) /* _STA: Status */
Method (_STA, 0, NotSerialized) // _STA: Status
{ {
Return (STA) Return (STA)
} }
@ -416,33 +434,29 @@ Scope (\_SB.PCI0.I2C5)
Device (CAM1) Device (CAM1)
{ {
Name (_HID, "OVTI8856") Name (_HID, "OVTI8856") /* _HID: Hardware ID */
Name (_UID, Zero) Name (_UID, Zero) /* _UID: Unique ID */
Name (_DDN, "Ov 8856 Camera") Name (_DDN, "Ov 8856 Camera") /* _DDN: DOS Device Name */
Method (_STA, 0, NotSerialized) Method (_STA, 0, NotSerialized) /* _STA: Status */
{ {
Return (0x0F) Return (0x0F)
} }
Name (_CRS, ResourceTemplate () /* _CRS: Current Resource Settings */
Name (_CRS, ResourceTemplate ()
{ {
I2cSerialBus (0x0010, ControllerInitiated, 0x00061A80, I2cSerialBus (0x0010, ControllerInitiated, 0x00061A80,
AddressingMode7Bit, "\\_SB.PCI0.I2C5", AddressingMode7Bit, "\\_SB.PCI0.I2C5",
0x00, ResourceConsumer, , 0x00, ResourceConsumer, ,
) )
}) })
Name (_PR0, Package (0x01) /* _PR0: Power Resources for D0 */
Name (_PR0, Package (0x01)
{ {
FCPR FCPR
}) })
Name (_PR3, Package (0x01) /* _PR3: Power Resources for D3hot */
Name (_PR3, Package (0x01)
{ {
FCPR FCPR
}) })
Name (_DSD, Package (0x04) /* _DSD: Device-Specific Data */
Name (_DSD, Package (0x04)
{ {
ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
Package (0x01) Package (0x01)
@ -453,7 +467,6 @@ Scope (\_SB.PCI0.I2C5)
"PRT0" "PRT0"
} }
}, },
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package (0x01) Package (0x01)
{ {
@ -464,7 +477,6 @@ Scope (\_SB.PCI0.I2C5)
} }
} }
}) })
Name (PRT0, Package (0x04) Name (PRT0, Package (0x04)
{ {
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
@ -476,7 +488,6 @@ Scope (\_SB.PCI0.I2C5)
Zero Zero
} }
}, },
ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"),
Package (0x01) Package (0x01)
{ {
@ -487,24 +498,39 @@ Scope (\_SB.PCI0.I2C5)
} }
} }
}) })
Name (EP00, Package (0x02) Name (EP00, Package (0x02)
{ {
ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
Package (0x03) Package (0x05)
{ {
Package (0x02) Package (0x02)
{ {
"endpoint", "endpoint",
Zero Zero
}, },
Package (0x02)
{
"clock-lanes",
Zero
},
Package (0x02)
{
"data-lanes",
Package (0x04)
{
One,
0x02,
0x03,
0x04
}
},
Package (0x02) Package (0x02)
{ {
"link-frequencies", "link-frequencies",
Package (0x01) Package (0x02)
{ {
0x325AA000 0x15752A00,
0xABA9500
} }
}, },
Package (0x02) Package (0x02)