Matt Delco has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31164
Change subject: atlas: switch to mipi_camera driver ......................................................................
atlas: switch to mipi_camera driver
Replaced asl files with use of devicetree configuration that utilizes the mipi_camera driver.
BUG=None BRANCH=None TEST=Compared before & after ACPI device and configuration. Observed that the data if interest to Linux drivers is still present and camera is still functional. Also noticed that data of interest to Windows drivers is now present (though I don't have a suitable driver to test to see if it works).
Change-Id: Ia72fd8f0e4181be7d979900fcf54de26cc5eb4ba Signed-off-by: Matt Delco delco@chromium.org --- M src/mainboard/google/poppy/Kconfig M src/mainboard/google/poppy/variants/atlas/devicetree.cb D src/mainboard/google/poppy/variants/atlas/include/variant/acpi/cam0.asl M src/mainboard/google/poppy/variants/atlas/include/variant/acpi/camera.asl D src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_endpoints.asl D src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_mainboard.asl 6 files changed, 66 insertions(+), 228 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/31164/1
diff --git a/src/mainboard/google/poppy/Kconfig b/src/mainboard/google/poppy/Kconfig index 419b10e..aa3f6e6 100644 --- a/src/mainboard/google/poppy/Kconfig +++ b/src/mainboard/google/poppy/Kconfig @@ -154,6 +154,7 @@ select EXCLUDE_NATIVE_SD_INTERFACE select MAINBOARD_HAS_SPI_TPM_CR50 select VARIANT_HAS_CAMERA_ACPI + select DRIVERS_INTEL_MIPI_CAMERA
config VARIANT_SPECIFIC_OPTIONS_POPPY def_bool n diff --git a/src/mainboard/google/poppy/variants/atlas/devicetree.cb b/src/mainboard/google/poppy/variants/atlas/devicetree.cb index f8a6e6d..2b4525e 100644 --- a/src/mainboard/google/poppy/variants/atlas/devicetree.cb +++ b/src/mainboard/google/poppy/variants/atlas/devicetree.cb @@ -267,10 +267,21 @@ 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 13.0 off end # Integrated Sensor Hub device pci 14.0 on 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" = "1" + register "cio2_lanes_used[0]" = "2" + register "cio2_lane_endpoint[0]" = ""\_SB.PCI0.I2C3.CAM0"" + device pci 14.3 on end + end device pci 15.0 on chip drivers/i2c/hid register "generic.hid" = ""ACPI0C50"" @@ -302,7 +313,33 @@ device i2c 0x15 on end end end # I2C #2 - Trackpad - 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" = ""INT3478"" + register "chip_name" = ""SONY IMX208 Camera"" + register "pr0" = ""FCPR"" + register "pr3" = ""FCPR"" + register "rom_address" = "0x50" + register "ssdb.sensor_card_sku" = "0x20" + register "ssdb.rom_type" = "11" + register "use_pld" = "1" + register "num_freq_entries" = "2" + register "link_freq[0]" = "384000000" + register "link_freq[1]" = "96000000" + device i2c 0x10 on end + end + chip drivers/intel/mipi_camera + register "device_type" = "INTEL_ACPI_CAMERA_NVM" + register "chip_name" = ""GT24C16S"" + register "dep" = ""CAM0"" + register "pr0" = ""FCPR"" + register "pr3" = ""FCPR"" + register "nvm_size" = "2048" + register "nvm_width" = "8" + 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 diff --git a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/cam0.asl b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/cam0.asl deleted file mode 100644 index 0a703d4..0000000 --- a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/cam0.asl +++ /dev/null @@ -1,156 +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) -{ - /* Power resource methods for Front Camera */ - PowerResource (FCPR, 0, 0) { - Name (STA, 0) - Method (_ON, 0, Serialized) { - PMON () - } - Method (_OFF, 0, Serialized) { - PMOF () - } - Method (_STA, 0, Serialized) { - If (LGreater(STA,0)) { - Return (0x1) - } - Else { - Return (0x0) - } - } - Method (PMON, 0, Serialized) { - If (STA == 0) { - CTXS (EN_CAM_PMIC_RST_L) - STXS (EN_PP3300_DX_CAM) - Sleep(3) - STXS (EN_CAM_PMIC_RST_L) - STXS (EN_CAM_CLOCK) - Sleep(2); - } - STA++ - } - - Method (PMOF, 0, Serialized) { - If (STA == 0) { - Return - } - STA-- - If (STA == 0) { - CTXS (EN_CAM_CLOCK) - CTXS (EN_CAM_PMIC_RST_L) - CTXS (EN_PP3300_DX_CAM) - } - } - } - - Device (CAM0) - { - Name (_HID, "INT3478") /* _HID: Hardware ID */ - Name (_UID, Zero) /* _UID: Unique ID */ - Name (_DDN, "SONY IMX208 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 (0x01) { FCPR }) - Name (_PR3, Package (0x01) { 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 } - }, - Package () { "link-frequencies", - Package() { 384000000, 96000000 } - }, - 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, "GT24C16S") /* _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 (0x01) { FCPR }) - Name (_PR3, Package (0x01) { FCPR }) - - Name (_DSD, Package () - { - ToUUID ("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), - Package () { - Package () { "size", 2048 }, - Package () { "pagesize", 1 }, - Package () { "read-only", 1 }, - Package () { "address-width", 8 }, - } - }) - } -} diff --git a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/camera.asl b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/camera.asl index d7ca972..a7d9afa 100644 --- a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/camera.asl +++ b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/camera.asl @@ -13,6 +13,30 @@ * GNU General Public License for more details. */
-#include "ipu_mainboard.asl" -#include "ipu_endpoints.asl" -#include "cam0.asl" +Scope (_SB.PCI0.I2C3) +{ + /* Power resource methods for Front Camera */ + PowerResource (FCPR, 0, 0) { + Name (STA, 0) + Method (_ON, 0, Serialized) { + CTXS (EN_CAM_PMIC_RST_L) + STXS (EN_PP3300_DX_CAM) + Sleep(3) + STXS (EN_CAM_PMIC_RST_L) + STXS (EN_CAM_CLOCK) + Sleep(2); + Store (1, STA) + } + Method (_OFF, 0, Serialized) { + If (LEqual(STA, 1)) { + CTXS (EN_CAM_CLOCK) + CTXS (EN_CAM_PMIC_RST_L) + CTXS (EN_PP3300_DX_CAM) + Store (0, STA) + } + } + Method (_STA, 0, Serialized) { + Return (STA) + } + } +} diff --git a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_endpoints.asl b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_endpoints.asl deleted file mode 100644 index 5dc747b..0000000 --- a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_endpoints.asl +++ /dev/null @@ -1,29 +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 } }, - Package () { "remote-endpoint", - Package() { _SB.PCI0.I2C3.CAM0, 0, 0 } - }, - } - }) -} diff --git a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_mainboard.asl b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_mainboard.asl deleted file mode 100644 index ec4eb1e..0000000 --- a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_mainboard.asl +++ /dev/null @@ -1,39 +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 the port for CIO2 device where endpoint of port0 - * is connected to CAM0 */ - - Name (_DSD, Package () { - ToUUID ("dbb8e3e6-5886-4ba6-8795-1319f52a966b"), - Package () { - Package () { "port0", "PRT0" }, - } - }) - - 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" }, - } - }) - -}