Matt Delco has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31166
Change subject: nocturne: switch to mipi_camera driver ......................................................................
nocturne: switch to mipi_camera driver
Replaced asl files with use of devicetree configuration that utilizes the mipi_camera driver.
BUG=None BRANCH=None TEST=Verified still compiles.
Change-Id: Ic1b8aa435c27a9d1bf825158a02ba31d62472765 Signed-off-by: Matt Delco delco@chromium.org --- M src/mainboard/google/poppy/Kconfig M src/mainboard/google/poppy/variants/nocturne/devicetree.cb D src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam0.asl D src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam1.asl M src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/camera.asl D src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/ipu_endpoints.asl D src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/ipu_mainboard.asl 7 files changed, 158 insertions(+), 432 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/31166/1
diff --git a/src/mainboard/google/poppy/Kconfig b/src/mainboard/google/poppy/Kconfig index 77a1b8e..162f049 100644 --- a/src/mainboard/google/poppy/Kconfig +++ b/src/mainboard/google/poppy/Kconfig @@ -193,6 +193,7 @@ select MAINBOARD_HAS_SPI_TPM_CR50 select NO_FADT_8042 select VARIANT_HAS_CAMERA_ACPI + select DRIVERS_INTEL_MIPI_CAMERA select GEO_SAR_ENABLE if CHROMEOS_WIFI_SAR
config VARIANT_SPECIFIC_OPTIONS_RAMMUS diff --git a/src/mainboard/google/poppy/variants/nocturne/devicetree.cb b/src/mainboard/google/poppy/variants/nocturne/devicetree.cb index 76b9773..8471134 100644 --- a/src/mainboard/google/poppy/variants/nocturne/devicetree.cb +++ b/src/mainboard/google/poppy/variants/nocturne/devicetree.cb @@ -280,7 +280,10 @@ device domain 0 on device pci 00.0 on end # Host Bridge device pci 02.0 on end # Integrated Graphics Device - + chip drivers/intel/mipi_camera + register "device_type" = "INTEL_ACPI_CAMERA_IMGU" + device pci 05.0 on end + end device pci 14.0 on chip drivers/usb/acpi register "desc" = ""Root Hub"" @@ -312,6 +315,15 @@ end # USB xHCI device pci 14.1 on end # USB xDCI (OTG) device pci 14.2 on end # Thermal Subsystem + chip drivers/intel/mipi_camera + register "device_type" = "INTEL_ACPI_CAMERA_CIO2" + register "cio2_num_ports" = "2" + register "cio2_lanes_used[0]" = "4" + register "cio2_lane_endpoint[0]" = ""\_SB.PCI0.I2C3.CAM0"" + register "cio2_lanes_used[1]" = "4" + register "cio2_lane_endpoint[1]" = ""\_SB.PCI0.I2C5.CAM1"" + device pci 14.3 on end + end device pci 15.0 on chip drivers/i2c/hid register "generic.hid" = ""WCOM50C1"" @@ -362,7 +374,32 @@ end end # I2C #1 device pci 15.2 off end # I2C #2 - device pci 15.3 on end # I2C #3 - Camera + device pci 15.3 on + chip drivers/intel/mipi_camera + register "device_type" = "INTEL_ACPI_CAMERA_SENSOR" + register "acpi_hid" = ""SONY319A"" + register "chip_name" = ""Sony IMX319 Camera"" + register "pr0" = ""FCPR"" + register "pr3" = ""FCPR"" + register "rom_address" = "0x50" + register "ssdb.sensor_card_sku" = "0x20" + register "ssdb.rom_type" = "9" # m24c64 + register "use_pld" = "1" + register "num_freq_entries" = "1" + register "link_freq[0]" = "360000000" + device i2c 0x10 on end + end + chip drivers/intel/mipi_camera + register "device_type" = "INTEL_ACPI_CAMERA_NVM" + register "chip_name" = ""M24C64S"" + register "dep" = ""CAM0"" + register "pr0" = ""FCPR"" + register "pr3" = ""FCPR"" + register "nvm_size" = "8192" + register "nvm_width" = "16" + device i2c 0x50 on end + end + end # I2C #3 - Camera device pci 16.0 on end # Management Engine Interface 1 device pci 16.1 off end # Management Engine Interface 2 device pci 16.2 off end # Management Engine IDE-R @@ -401,6 +438,48 @@ register "reg_sar_ctrl2" = "0x3c" device i2c 28 on end end + chip drivers/intel/mipi_camera + register "device_type" = "INTEL_ACPI_CAMERA_SENSOR" + register "acpi_hid" = ""SONY355A"" + register "chip_name" = ""Sony IMX355A Camera"" + register "sensor_name" = ""50-704GVGEA8"" + register "pr0" = ""RCPR"" + register "pr3" = ""RCPR"" + register "vcm_address" = "0x0c" + register "rom_address" = "0x51" + register "ssdb.sensor_card_sku" = "0x20" + register "ssdb.link_used" = "1" + register "ssdb.rom_type" = "9" + register "ssdb.vcm_type" = "9" + register "use_pld" = "1" + register "pld.panel" = "PLD_PANEL_BACK" + register "pld.horizontal_position" = "PLD_HORIZONTAL_POSITION_RIGHT" + register "num_freq_entries" = "1" + register "link_freq[0]" = "360000000" + device i2c 0x1a on end + end + chip drivers/intel/mipi_camera + register "device_type" = "INTEL_ACPI_CAMERA_NVM" + register "acpi_uid" = "1" + register "chip_name" = ""M24C64S"" + register "dep" = ""CAM1"" + register "pr0" = ""RCPR"" + register "pr3" = ""RCPR"" + register "nvm_size" = "8192" + register "nvm_width" = "16" + device i2c 0x51 on end + end + chip drivers/intel/mipi_camera + register "device_type" = "INTEL_ACPI_CAMERA_VCM" + register "acpi_uid" = "3" + register "acpi_name" = ""VCM1"" + register "chip_name" = ""AKM AF DAC"" + register "dep" = ""CAM1"" + register "pr0" = ""RCPR"" + register "pr3" = ""RCPR"" + register "vcm_compat" = ""asahi-kasei,ak7375"" + device i2c 0xc on end + end end # I2C #5 device pci 19.2 on chip drivers/i2c/max98373 diff --git a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam0.asl b/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam0.asl deleted file mode 100644 index 1213270..0000000 --- a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam0.asl +++ /dev/null @@ -1,150 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2018 Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -Scope (_SB.PCI0.I2C3) -{ - PowerResource (FCPR, 0, 0) - { - Name (STA, 0) - Method (_ON, 0, Serialized) { - If (LEqual(STA, 0)) { - CTXS (GPIO_FCAM_RST_L) - STXS (GPIO_FCAM_PWR_EN) - STXS (GPIO_PCH_FCAM_CLK_EN) - Sleep (3) - STXS (GPIO_FCAM_RST_L) - - /* - * A delay of T7 (minimum of 5 ms) + T8 - * (max 5 ms + delay of coarse integration - * time value + 14 H, time for 14 horizontal - * lines) is needed to have the sensor ready - * for streaming, as soon as the power on - * sequence completes - */ - Sleep (11) - Store (1, STA) - } - } - Method (_OFF, 0, Serialized) { - If (LEqual(STA, 1)) { - CTXS (GPIO_PCH_FCAM_CLK_EN) - CTXS (GPIO_FCAM_RST_L) - CTXS (GPIO_FCAM_PWR_EN) - Store (0, STA) - } - } - Method (_STA, 0, NotSerialized) { - Return (STA) - } - } - - Device (CAM0) - { - Name (_HID, "SONY319A") /* _HID: Hardware ID */ - Name (_UID, Zero) /* _UID: Unique ID */ - Name (_DDN, "Sony IMX319 Camera") /* _DDN: DOS Device Name */ - - Method (_STA, 0, NotSerialized) /* _STA: Status */ - { - Return (0x0F) - } - - Name (_CRS, ResourceTemplate () - { - I2cSerialBus (0x0010, ControllerInitiated, 0x00061A80, - AddressingMode7Bit, "\_SB.PCI0.I2C3", - 0x00, ResourceConsumer, , - ) - }) - - Name (_PR0, Package () { FCPR }) - Name (_PR3, Package () { FCPR }) - - /* Port0 of CAM0 is connected to port0 of CIO2 device */ - Name (_DSD, Package () { - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package () { - Package () { "port0", "PRT0" }, - }, - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "clock-frequency", 19200000 }, - } - }) - - Name (PRT0, Package() { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "port", 0 }, - }, - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package () { - Package () { "endpoint0", "EP00" }, - } - }) - - Name (EP00, Package() { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "endpoint", 0 }, - Package () { "clock-lanes", 0 }, - Package () { "data-lanes", - Package () { 1, 2, 3, 4 } - }, - Package () { "link-frequencies", - Package() { 482400000 } - }, - Package () { "remote-endpoint", - Package() { _SB.PCI0.CIO2, 0, 0 } - }, - } - }) - } - - Device (NVM0) - { - Name (_HID, "INT3499") /* _HID: Hardware ID */ - Name (_UID, Zero) /* _UID: Unique ID */ - Name (_DDN, "M24C64S") /* _DDN: DOS Device Name */ - - Method (_STA, 0, NotSerialized) /* _STA: Status */ - { - Return (0x0F) - } - - Name (_CRS, ResourceTemplate () - { - I2cSerialBus (0x0050, ControllerInitiated, 0x00061A80, - AddressingMode7Bit, "\_SB.PCI0.I2C3", - 0x00, ResourceConsumer, ,) - }) - Name (_DEP, Package () { CAM0 }) - - Name (_PR0, Package () { FCPR }) - Name (_PR3, Package () { FCPR }) - - Name (_DSD, Package () - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "size", 8192 }, - Package () { "pagesize", 1 }, - Package () { "read-only", 1 }, - Package () { "address-width", 16 }, - } - }) - } -} diff --git a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam1.asl b/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam1.asl deleted file mode 100644 index 19146dc..0000000 --- a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/cam1.asl +++ /dev/null @@ -1,184 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2018 Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -Scope (_SB.PCI0.I2C5) -{ - PowerResource (RCPR, 0, 0) - { - Name (STA, 0) - Method (_ON, 0, Serialized) { - If (LEqual(STA, 0)) { - CTXS (GPIO_RCAM_RST_L) - STXS (GPIO_RCAM_PWR_EN) - STXS (GPIO_PCH_RCAM_CLK_EN) - Sleep (3) - STXS (GPIO_RCAM_RST_L) - - /* - * A delay of T7 (minimum of 10 ms) + T8 - * (max 1.4 ms + delay of coarse integration - * time value) is needed to have the sensor - * ready for streaming, as soon as the power - * on sequence completes - */ - Sleep (12) - Store (1, STA) - } - } - Method (_OFF, 0, Serialized) { - If (LEqual(STA, 1)) { - CTXS (GPIO_PCH_RCAM_CLK_EN) - CTXS (GPIO_RCAM_RST_L) - CTXS (GPIO_RCAM_PWR_EN) - Store (0, STA) - } - } - Method (_STA, 0, NotSerialized) { - Return (STA) - } - } - - Device (CAM1) - { - Name (_HID, "SONY355A") /* _HID: Hardware ID */ - Name (_UID, Zero) /* _UID: Unique ID */ - Name (_DDN, "SONY IMX355A Camera") /* _DDN: DOS Device Name */ - - Method (_STA, 0, NotSerialized) /* _STA: Status */ - { - Return (0x0F) - } - - Name (_CRS, ResourceTemplate () - { - I2cSerialBus (0x001A, ControllerInitiated, 0x00061A80, - AddressingMode7Bit, "\_SB.PCI0.I2C5", - 0x00, ResourceConsumer, , - ) - }) - - Name (_PR0, Package () { RCPR }) - Name (_PR3, Package () { RCPR }) - - /* Port0 of CAM1 is connected to port1 of CIO2 device */ - Name (_DSD, Package () { - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package () { - Package () { "port0", "PRT0" }, - }, - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "clock-frequency", 19200000 }, - Package () { "lens-focus", - Package () { _SB.PCI0.I2C5.VCM1 } - } - } - }) - - Name (PRT0, Package() { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "port", 0 }, - }, - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package () { - Package () { "endpoint0", "EP00" }, - } - }) - - Name (EP00, Package() { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "endpoint", 0 }, - Package () { "clock-lanes", 0 }, - Package () { "data-lanes", - Package () { 1, 2, 3, 4 } - }, - Package () { "link-frequencies", - Package() { 360000000 } - }, - Package () { "remote-endpoint", - Package() { _SB.PCI0.CIO2, 1, 0 } - }, - } - }) - } - - Device (VCM1) - { - Name (_HID, "PRP0001") /* _HID: Hardware ID */ - Name (_UID, 3) /* _UID: Unique ID */ - Name (_DDN, "AKM AF DAC") /* _DDN: DOS Device Name */ - - Method (_STA, 0, NotSerialized) /* _STA: Status */ - { - Return (0x0F) - } - - Name (_CRS, ResourceTemplate () - { - I2cSerialBus (0x000C, ControllerInitiated, 0x00061A80, - AddressingMode7Bit, "\_SB.PCI0.I2C5", - 0x00, ResourceConsumer, , - ) - }) - - Name (_DEP, Package() { CAM1 }) - - Name (_PR0, Package () { RCPR }) - Name (_PR3, Package () { RCPR }) - - Name (_DSD, Package () { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "compatible", "asahi-kasei,ak7375" }, - } - }) - } - - Device (NVM1) - { - Name (_HID, "INT3499") /* _HID: Hardware ID */ - Name (_UID, 1) /* _UID: Unique ID */ - Name (_DDN, "M24C64S") /* _DDN: DOS Device Name */ - - Method (_STA, 0, NotSerialized) /* _STA: Status */ - { - Return (0x0F) - } - - Name (_CRS, ResourceTemplate () - { - I2cSerialBus (0x0051, ControllerInitiated, 0x00061A80, - AddressingMode7Bit, "\_SB.PCI0.I2C5", - 0x00, ResourceConsumer, ,) - }) - Name (_DEP, Package () { CAM1 }) - - Name (_PR0, Package () { RCPR }) - Name (_PR3, Package () { RCPR }) - - Name (_DSD, Package () - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "size", 8192 }, - Package () { "pagesize", 1 }, - Package () { "read-only", 1 }, - Package () { "address-width", 16 }, - } - }) - } -} diff --git a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/camera.asl b/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/camera.asl index 7e63340..cbb086d 100644 --- a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/camera.asl +++ b/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/camera.asl @@ -13,7 +13,79 @@ * GNU General Public License for more details. */
-#include "ipu_mainboard.asl" -#include "ipu_endpoints.asl" -#include "cam0.asl" -#include "cam1.asl" +Scope (_SB.PCI0.I2C3) +{ + PowerResource (FCPR, 0, 0) + { + Name (STA, 0) + Method (_ON, 0, Serialized) { + If (LEqual(STA, 0)) { + CTXS (GPIO_FCAM_RST_L) + STXS (GPIO_FCAM_PWR_EN) + STXS (GPIO_PCH_FCAM_CLK_EN) + Sleep (3) + STXS (GPIO_FCAM_RST_L) + + /* + * A delay of T7 (minimum of 5 ms) + T8 + * (max 5 ms + delay of coarse integration + * time value + 14 H, time for 14 horizontal + * lines) is needed to have the sensor ready + * for streaming, as soon as the power on + * sequence completes + */ + Sleep (11) + Store (1, STA) + } + } + Method (_OFF, 0, Serialized) { + If (LEqual(STA, 1)) { + CTXS (GPIO_PCH_FCAM_CLK_EN) + CTXS (GPIO_FCAM_RST_L) + CTXS (GPIO_FCAM_PWR_EN) + Store (0, STA) + } + } + Method (_STA, 0, NotSerialized) { + Return (STA) + } + } +} + +Scope (_SB.PCI0.I2C5) +{ + PowerResource (RCPR, 0, 0) + { + Name (STA, 0) + Method (_ON, 0, Serialized) { + If (LEqual(STA, 0)) { + CTXS (GPIO_RCAM_RST_L) + STXS (GPIO_RCAM_PWR_EN) + STXS (GPIO_PCH_RCAM_CLK_EN) + Sleep (3) + STXS (GPIO_RCAM_RST_L) + + /* + * A delay of T7 (minimum of 10 ms) + T8 + * (max 1.4 ms + delay of coarse integration + * time value) is needed to have the sensor + * ready for streaming, as soon as the power + * on sequence completes + */ + Sleep (12) + Store (1, STA) + } + } + Method (_OFF, 0, Serialized) { + If (LEqual(STA, 1)) { + CTXS (GPIO_PCH_RCAM_CLK_EN) + CTXS (GPIO_RCAM_RST_L) + CTXS (GPIO_RCAM_PWR_EN) + Store (0, STA) + } + } + Method (_STA, 0, NotSerialized) { + Return (STA) + } + } +} diff --git a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/ipu_endpoints.asl b/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/ipu_endpoints.asl deleted file mode 100644 index 7f6a4ef..0000000 --- a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/ipu_endpoints.asl +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2018 Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -Scope (_SB.PCI0.CIO2) -{ - Name (EP00, Package() { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "endpoint", 0 }, - Package () { "clock-lanes", 0 }, - Package () { "data-lanes", Package () { 1, 2, 3, 4 } }, - Package () { "remote-endpoint", - Package() { _SB.PCI0.I2C3.CAM0, 0, 0 } - }, - } - }) - - Name (EP10, Package() { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "endpoint", 0 }, - Package () { "clock-lanes", 0 }, - Package () { "data-lanes", Package () { 1, 2, 3, 4 } }, - Package () { "remote-endpoint", - Package() { _SB.PCI0.I2C5.CAM1, 0, 0 } - }, - } - }) -} diff --git a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/ipu_mainboard.asl b/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/ipu_mainboard.asl deleted file mode 100644 index ec5347d..0000000 --- a/src/mainboard/google/poppy/variants/nocturne/include/variant/acpi/ipu_mainboard.asl +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright (C) 2018 Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -Scope (_SB.PCI0.CIO2) -{ - /* Define two ports for CIO2 device where endpoint of port0 - is connected to CAM0 and endpoint of port1 is connected to CAM1 */ - - Name (_DSD, Package () { - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package () { - Package () { "port0", "PRT0" }, - Package () { "port1", "PRT1" }, - } - }) - - Name (PRT0, Package () { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "port", 0 }, /* csi 0 */ - }, - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package () { - Package () { "endpoint0", "EP00" }, - } - }) - - Name (PRT1, Package () { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "port", 1 }, /* csi 1 */ - }, - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package () { - Package () { "endpoint0", "EP10" }, - } - }) - -}