Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41620 )
Change subject: acpi: Add support for call method
......................................................................
Patch Set 11: Code-Review+2
--
To view, visit https://review.coreboot.org/c/coreboot/+/41620
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibcb67bd756dc8ae1dfd2d40020c273325583df0f
Gerrit-Change-Number: 41620
Gerrit-PatchSet: 11
Gerrit-Owner: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Gerrit-Reviewer: Daniel Kang <daniel.h.kang(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)google.com>
Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-Reviewer: Wonkyu Kim <wonkyu.kim(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Kiran2 Kumar <kiran2.kumar(a)intel.corp-partner.google.com>
Gerrit-Comment-Date: Tue, 09 Jun 2020 05:22:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Sugnan Prabhu S has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41607 )
Change subject: drivers/intel/mipi_camera: camera SSDT generation
......................................................................
Patch Set 12:
(10 comments)
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
File src/drivers/intel/mipi_camera/camera.c:
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
PS11, Line 40: = 0;
> will update this in next patch.
Done
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
PS11, Line 54: struct acpi_dp *lanes = acpi_dp_new_table("data-lanes");
: uint32_t j;
> in coreboot, we usually declare all local variables at the top of the function.
Done
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
PS11, Line 94: if (!config->pld.ignore_color)
: config->pld.ignore_color = 1;
:
: if (!config->pld.visible)
: config->pld.visible = 1;
:
: if (!config->pld.vertical_offset)
: config->pld.vertical_offset = 0xffff;
:
: if (!config->pld.horizontal_offset)
: config->pld.horizontal_offset = 0xffff;
:
: /*
: * PLD_PANEL_TOP has a value of zero, so the following will change any instance
: * of PLD_PANEL_TOP to PLD_PANEL_FRONT unless disable_pld_defaults is set.
: */
: if (!config->pld.panel)
: config->pld.panel = PLD_PANEL_FRONT;
:
: /*
: * PLD_HORIZONTAL_POSITION_LEFT has a value of zero, so the following will
: * change any instance of that value to PLD_HORIZONTAL_POSITION_CENTER unless
: * disable_pld_defaults is set.
: */
: if (!config->pld.horizontal_position)
: config->pld.horizontal_position = PLD_HORIZONTAL_POSITION_CENTER;
:
: /*
: * The desired default for |vertical_position| is PLD_VERTICAL_POSITION_UPPER,
: * which has a value of zero so no work is needed to set a default. The same
: * applies for setting |shape| to PLD_SHAPE_ROUND.
: */
> suggestion: break this out into a separate function
Done
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
PS11, Line 139: 0x4
> 4
Done
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
PS11, Line 148: 822ace8f-2814-4174-a56b-5f029fe079ee
> a symbolic constant with a nice name would be helpful
Done
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
PS11, Line 156: 26257549-9271-4ca4-bb43-c4899d5a4881
> a symbolic constant with a nice name would be helpful
Done
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
PS11, Line 167: acpigen_write_return_integer(((uint32_t)i2c_bus) << 24 |
: ((uint32_t)i2c_addr) << 8 | 0x0); /* type 0 for sensor */
: acpigen_pop_len(); /* If Arg2=2 */
:
: if (config->ssdb.vcm_type) {
: /* If (LEqual (Local1, 3)) */
: acpigen_write_if_lequal_op_int(LOCAL1_OP, 3);
: acpigen_write_return_integer(((uint32_t)i2c_bus) << 24 | /* type 1 for vcm */
: ((uint32_t)config->vcm_address) << 8 | 0x01);
: acpigen_pop_len(); /* If Arg2=3 */
: }
:
: if (config->ssdb.rom_type) {
: /* If (LEqual (Local1, 3 or 4)) */
: acpigen_write_if_lequal_op_int(LOCAL1_OP, 3 + (config->ssdb.vcm_type ? 1 : 0));
: acpigen_write_return_integer(((uint32_t)i2c_bus) << 24 | /* type 2 for rom */
: ((uint32_t)config->rom_address) << 8 | 0x02);
: acpigen_pop_len(); /* If Arg2=3 or 4 */
> suggestion: add a helper function for creating these return values, with maybe an enum per type, sen […]
Done
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
PS11, Line 229: if (!config->disable_ssdb_defaults) {
: if (!config->ssdb.bdf_value)
: config->ssdb.bdf_value = PCI_DEVFN(CIO2_PCI_DEV, CIO2_PCI_FN);
:
: if (!config->ssdb.platform)
: config->ssdb.platform = PLATFORM_SKC;
:
: if (!config->ssdb.flash_support)
: config->ssdb.flash_support = FLASH_DISABLE;
:
: if (!config->ssdb.privacy_led)
: config->ssdb.privacy_led = PRIVACY_LED_A_16mA;
:
: if (!config->ssdb.mipi_define)
: config->ssdb.mipi_define = MIPI_INFO_ACPI_DEFINED;
:
: if (!config->ssdb.mclk_speed)
: config->ssdb.mclk_speed = CLK_FREQ_19_2MHZ;
:
: if (!config->ssdb.lanes_used) {
: cio2_config = cio2 ? cio2->chip_info : NULL;
:
: if (!cio2_config) {
: printk(BIOS_ERR, "Failed to get CIO2 config\n");
: } else if (cio2_config->device_type != INTEL_ACPI_CAMERA_CIO2) {
: printk(BIOS_ERR, "Device type isn't CIO2: %u\n",
: (u32)cio2_config->device_type);
: } else if (config->ssdb.link_used >= cio2_config->cio2_num_ports) {
: printk(BIOS_ERR, "%u exceeds CIO2's %u links\n",
: (u32)config->ssdb.link_used,
: (u32)cio2_config->cio2_num_ports);
: } else {
: config->ssdb.lanes_used =
: cio2_config->cio2_lanes_used[config->ssdb.link_used];
: }
: }
: }
> suggestion: same here, separate this out into a separate function
Done
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
PS11, Line 298: remote_name = "\\_SB.PCI0.CIO2";
> Could you add this to the rest of the defaults?
Done
https://review.coreboot.org/c/coreboot/+/41607/11/src/drivers/intel/mipi_ca…
PS11, Line 566: if (config->device_type == INTEL_ACPI_CAMERA_CIO2)
: return "CIO2";
: else if (config->device_type == INTEL_ACPI_CAMERA_IMGU)
: return "IMGU";
: else if (config->device_type == INTEL_ACPI_CAMERA_PMIC)
: return "PMIC";
:
: switch (config->device_type) {
: case INTEL_ACPI_CAMERA_SENSOR:
: prefix = "CAM";
: break;
: case INTEL_ACPI_CAMERA_VCM:
: prefix = "VCM";
: break;
: case INTEL_ACPI_CAMERA_NVM:
: prefix = "NVM";
: break;
: default:
: prefix = "ERR"; /* Error */
: break;
: }
> This can just be one switch statement; you can just return from the cases that have all 4 characters […]
Done
--
To view, visit https://review.coreboot.org/c/coreboot/+/41607
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I15979f345fb823df2560db269e902a1ea650b69e
Gerrit-Change-Number: 41607
Gerrit-PatchSet: 12
Gerrit-Owner: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Gerrit-Reviewer: Daniel Kang <daniel.h.kang(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Matt Delco <delco(a)chromium.org>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)google.com>
Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-Reviewer: Wonkyu Kim <wonkyu.kim(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-CC: Kiran2 Kumar <kiran2.kumar(a)intel.corp-partner.google.com>
Gerrit-Comment-Date: Tue, 09 Jun 2020 04:41:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Comment-In-Reply-To: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Comment-In-Reply-To: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: comment
Hello Varshit B Pandya, Matt Delco, build bot (Jenkins), Daniel Kang, Furquan Shaikh, Wonkyu Kim, Tim Wawrzynczak, Rizwan Qureshi, Tim Wawrzynczak, Patrick Rudolph,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/41607
to look at the new patch set (#12).
Change subject: drivers/intel/mipi_camera: camera SSDT generation
......................................................................
drivers/intel/mipi_camera: camera SSDT generation
Some boards & variants are using raw asl files to define the ACPI devices
(and related properties) required by Linux MIPI camera drivers.
The mipi_camera driver can provide a SSDB property, but it's
missing some properties needed for Linux drivers.
This change updates the mipi_camera driver so it can provide what's
required by Linux and expands the support for the IMGU and CIO2 devices.
BUG=WIP
BRANCH=none
TEST=Verified that the ACPI state generated by the driver (with
appropriate devicetree changes) is extremely comparible to what's
generated by the asl files.
Change-Id: I15979f345fb823df2560db269e902a1ea650b69e
Signed-off-by: Matt Delco <delco(a)chromium.org>
Signed-off-by: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
---
M src/drivers/intel/mipi_camera/camera.c
M src/drivers/intel/mipi_camera/chip.h
2 files changed, 659 insertions(+), 25 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/07/41607/12
--
To view, visit https://review.coreboot.org/c/coreboot/+/41607
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I15979f345fb823df2560db269e902a1ea650b69e
Gerrit-Change-Number: 41607
Gerrit-PatchSet: 12
Gerrit-Owner: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Gerrit-Reviewer: Daniel Kang <daniel.h.kang(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Matt Delco <delco(a)chromium.org>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)google.com>
Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-Reviewer: Wonkyu Kim <wonkyu.kim(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-CC: Kiran2 Kumar <kiran2.kumar(a)intel.corp-partner.google.com>
Gerrit-MessageType: newpatchset
Hello Varshit B Pandya, build bot (Jenkins), Daniel Kang, Furquan Shaikh, Wonkyu Kim, Tim Wawrzynczak, Rizwan Qureshi, Tim Wawrzynczak,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/41620
to look at the new patch set (#11).
Change subject: acpi: Add support for call method
......................................................................
acpi: Add support for call method
This change adds support function for calling methods and method to add
STA function which returns an external variable.
Change-Id: Ibcb67bd756dc8ae1dfd2d40020c273325583df0f
Signed-off-by: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
---
M src/acpi/acpigen.c
M src/include/acpi/acpigen.h
2 files changed, 23 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/20/41620/11
--
To view, visit https://review.coreboot.org/c/coreboot/+/41620
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibcb67bd756dc8ae1dfd2d40020c273325583df0f
Gerrit-Change-Number: 41620
Gerrit-PatchSet: 11
Gerrit-Owner: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Gerrit-Reviewer: Daniel Kang <daniel.h.kang(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)google.com>
Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-Reviewer: Wonkyu Kim <wonkyu.kim(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Kiran2 Kumar <kiran2.kumar(a)intel.corp-partner.google.com>
Gerrit-MessageType: newpatchset
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41815 )
Change subject: console: Update for vboot before bootblock
......................................................................
Patch Set 4:
(2 comments)
https://review.coreboot.org/c/coreboot/+/41815/4/src/console/Makefile.inc
File src/console/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/41815/4/src/console/Makefile.inc@14
PS4, Line 14: ifneq ($(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK),y)
The files here should be arch-agnostic. Which parts exactly are not usable for psp-verstage? Is there a followup to look at?
https://review.coreboot.org/c/coreboot/+/41815/4/src/console/init.c
File src/console/init.c:
https://review.coreboot.org/c/coreboot/+/41815/4/src/console/init.c@72
PS4, Line 72: pci_early_bridge_init
> I think there's a good argument to make for having it here. […]
We could probably change this to EARLY_PCI_BRIDGE && (ENV_BOOTBLOCK || ENV_ROMSTAGE). I don't see why we would need it called for verstage as the BARs on the secondary side PCIe device (assummed serial uart) persist across stage changes.
The entire EARLY_PCI_BRIDGE is very rarely used indeed and probably does not even work with FSP, PCIe rootports are not usable until late FSP-M from what I remember.
Like Martin said, it was used for debugging some of the first Chromebooks with mini-PCI-e serial cards, before servo and closed-case-debugging.
--
To view, visit https://review.coreboot.org/c/coreboot/+/41815
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifc9fb0810e0816fe0a68e52287eda6145043a619
Gerrit-Change-Number: 41815
Gerrit-PatchSet: 4
Gerrit-Owner: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Eric Peers <epeers(a)google.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-CC: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Comment-Date: Tue, 09 Jun 2020 04:18:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Raul Rangel <rrangel(a)chromium.org>
Comment-In-Reply-To: Martin Roth <martinroth(a)google.com>
Gerrit-MessageType: comment
Sugnan Prabhu S has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41620 )
Change subject: acpi: Add support for call method and store value
......................................................................
Patch Set 10:
(2 comments)
https://review.coreboot.org/c/coreboot/+/41620/5/src/acpi/acpigen.c
File src/acpi/acpigen.c:
https://review.coreboot.org/c/coreboot/+/41620/5/src/acpi/acpigen.c@1928
PS5, Line 1928: void acpigen_call_method(const char *name, unsigned char *params, int params_len)
: {
: int i;
: char ud[] = "____";
: for (i = 0; i < 4; i++) {
: if ((name[i] == '\0')) {
: acpigen_emit_stream(ud, 4 - i);
: break;
: }
: acpigen_emit_byte(name[i]);
: }
:
: for (i = 0; i < params_len; i++)
: acpigen_write_byte(params[i]);
: }
> Why is this necessary?
This is required to call any method. we are using this in powerresource generation patch to call MCON and MCOF
https://review.coreboot.org/c/coreboot/+/41624/11/src/drivers/intel/mipi_ca…https://review.coreboot.org/c/coreboot/+/41620/5/src/acpi/acpigen.c@1944
PS5, Line 1944: void acpigen_write_store_var(const char *name, uint8_t value)
: {
: int i;
: char ud[] = "____";
:
: acpigen_write_store();
: acpigen_emit_byte(value);
:
: for (i = 0; i < 4; i++) {
: if ((name[i] == '\0')) {
: acpigen_emit_stream(ud, 4 - i);
: break;
: }
: acpigen_emit_byte(name[i]);
: }
: }
> Why is this necessary?
This method has been removed in the latest patch.
https://review.coreboot.org/c/coreboot/+/41620/10/src/acpi/acpigen.c
During development I couldn't find any method for storing value in to a variable, but later found that acpigen_write_store_op_to_namestr has been added.
--
To view, visit https://review.coreboot.org/c/coreboot/+/41620
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibcb67bd756dc8ae1dfd2d40020c273325583df0f
Gerrit-Change-Number: 41620
Gerrit-PatchSet: 10
Gerrit-Owner: Sugnan Prabhu S <sugnan.prabhu.s(a)intel.com>
Gerrit-Reviewer: Daniel Kang <daniel.h.kang(a)intel.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)google.com>
Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-Reviewer: Wonkyu Kim <wonkyu.kim(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Kiran2 Kumar <kiran2.kumar(a)intel.corp-partner.google.com>
Gerrit-Comment-Date: Tue, 09 Jun 2020 03:05:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-MessageType: comment