Ping-chung Chen has uploaded this change for review. ( https://review.coreboot.org/27350
Change subject: [Atlas] MIPI camera ASL files for Atlas ......................................................................
[Atlas] MIPI camera ASL files for Atlas
Change-Id: Ide0e923bbc34f869dd0227c0a29977645bc5d58d --- M src/mainboard/google/poppy/Kconfig M src/mainboard/google/poppy/variants/atlas/devicetree.cb A src/mainboard/google/poppy/variants/atlas/include/variant/acpi/camera.asl A src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_endpoints.asl A src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_mainboard.asl A src/mainboard/google/poppy/variants/atlas/include/variant/acpi/mipi_camera.asl M src/mainboard/google/poppy/variants/atlas/include/variant/gpio.h 7 files changed, 233 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/27350/1
diff --git a/src/mainboard/google/poppy/Kconfig b/src/mainboard/google/poppy/Kconfig old mode 100644 new mode 100755 index 7ad846e..b2ff703 --- a/src/mainboard/google/poppy/Kconfig +++ b/src/mainboard/google/poppy/Kconfig @@ -141,6 +141,7 @@ select DRIVERS_SPI_ACPI select EXCLUDE_NATIVE_SD_INTERFACE select MAINBOARD_HAS_SPI_TPM_CR50 + select VARIANT_HAS_CAMERA_ACPI
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 old mode 100644 new mode 100755 index 34bc4d4..7085d06 --- a/src/mainboard/google/poppy/variants/atlas/devicetree.cb +++ b/src/mainboard/google/poppy/variants/atlas/devicetree.cb @@ -40,8 +40,8 @@ register "EnableTraceHub" = "0" register "SsicPortEnable" = "0" register "SmbusEnable" = "1" - register "Cio2Enable" = "0" # FIXME: enable once MIPI is ready - register "SaImguEnable" = "0" # FIXME: enable once MIPI is ready + register "Cio2Enable" = "1" # FIXME: enable once MIPI is ready + register "SaImguEnable" = "1" # FIXME: enable once MIPI is ready register "ScsEmmcEnabled" = "1" register "ScsEmmcHs400Enabled" = "1" register "ScsSdCardEnabled" = "0" 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 new file mode 100755 index 0000000..9405e2b --- /dev/null +++ b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/camera.asl @@ -0,0 +1,18 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2018 Google Inc. + * + * 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. + */ + +#include "ipu_mainboard.asl" +#include "ipu_endpoints.asl" +#include "mipi_camera.asl" 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 new file mode 100755 index 0000000..5dc747b --- /dev/null +++ b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_endpoints.asl @@ -0,0 +1,29 @@ +/* + * 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 new file mode 100755 index 0000000..a7fdadf --- /dev/null +++ b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/ipu_mainboard.asl @@ -0,0 +1,39 @@ +/* + * 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" }, + } + }) + + 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" }, + } + }) + +} diff --git a/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/mipi_camera.asl b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/mipi_camera.asl new file mode 100755 index 0000000..008adbe --- /dev/null +++ b/src/mainboard/google/poppy/variants/atlas/include/variant/acpi/mipi_camera.asl @@ -0,0 +1,142 @@ +/* + * 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) +{ + 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 (STA, 0) + 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(11); + } + 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) + } + } + + Name (_PR0, Package (0x01) { FCPR }) + Name (_PR3, Package (0x01) { FCPR }) + + /* Power resource methods for Rear Camera */ + PowerResource (FCPR, 0, 0) { + Method (_ON, 0, Serialized) { + PMON () + } + Method (_OFF, 0, Serialized) { + PMOF () + } + Method (_STA, 0, Serialized) { + If (LGreater(STA,0)) { + Return (0x1) + } + Else { + Return (0x0) + } + } + } + + /* 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 } + }, + } + }) + + Method (SSDB, 0, Serialized) + { + Return (Buffer (0x5E) + { + /* 0000 */ 0x00, 0x30, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, + /* 0008 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0028 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0030 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0038 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0040 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0048 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 0050 */ 0x09, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x36, + /* 0058 */ 0x6E, 0x01, 0x00, 0x00, 0x00, 0x00 + }) + } + } +} diff --git a/src/mainboard/google/poppy/variants/atlas/include/variant/gpio.h b/src/mainboard/google/poppy/variants/atlas/include/variant/gpio.h old mode 100644 new mode 100755 index f28fb31..9c7276f --- a/src/mainboard/google/poppy/variants/atlas/include/variant/gpio.h +++ b/src/mainboard/google/poppy/variants/atlas/include/variant/gpio.h @@ -24,4 +24,6 @@ #undef EN_CAM_PMIC_RST_L #define EN_CAM_PMIC_RST_L GPP_D17
+#define EN_CAM_CLOCK GPP_D18 + #endif /* __MAINBOARD_GPIO_H__ */