![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <stdlib.h>
#include <acpi/acpi.h>
#include <acpi/acpi_device.h>
#include <acpi/acpigen.h>
#include <acpi/acpigen_pci.h>
#include <arch/cpu.h>
#include <console/console.h>
#include <cpu/intel/cpu_ids.h>
#include <device/i2c_simple.h>
#include <device/device.h>
#include <device/path.h>
#include <device/pci_def.h>
#include "chip.h"
Go to the source code of this file.
Macros | |
#define | SENSOR_NAME_UUID "822ace8f-2814-4174-a56b-5f029fe079ee" |
#define | SENSOR_TYPE_UUID "26257549-9271-4ca4-bb43-c4899d5a4881" |
#define | DEFAULT_ENDPOINT 0 |
#define | DEFAULT_REMOTE_NAME "\\_SB.PCI0.CIO2" |
#define | CIO2_PCI_DEV 0x14 |
#define | CIO2_PCI_FN 0x3 |
#define | POWER_RESOURCE_NAME "PRIC" |
#define | GUARD_VARIABLE_FORMAT "RES%1d" |
#define | ENABLE_METHOD_FORMAT "ENB%1d" |
#define | DISABLE_METHOD_FORMAT "DSB%1d" |
#define | UNKNOWN_METHOD_FORMAT "UNK%1d" |
#define | CLK_ENABLE_METHOD "MCON" |
#define | CLK_DISABLE_METHOD "MCOF" |
Variables | |
static struct camera_resource_manager | res_mgr |
static struct device_operations | camera_ops |
struct chip_operations | drivers_intel_mipi_camera_ops |
#define SENSOR_NAME_UUID "822ace8f-2814-4174-a56b-5f029fe079ee" |
#define SENSOR_TYPE_UUID "26257549-9271-4ca4-bb43-c4899d5a4881" |
|
static |
Definition at line 584 of file camera.c.
References acpigen_emit_ext_op(), acpigen_emit_namestring(), acpigen_emit_string(), acpigen_pop_len(), acpigen_write_debug_string(), acpigen_write_if(), acpigen_write_integer(), BIOS_ERR, CLK_DISABLE_METHOD, CLK_ENABLE_METHOD, clk_config::clknum, COND_REFOF_OP, DISABLE, ENABLE, clk_config::freq, NULL, and printk.
Referenced by add_power_operation().
|
static |
Definition at line 614 of file camera.c.
References acpigen_soc_clear_tx_gpio(), acpigen_soc_set_tx_gpio(), acpigen_write_debug_string(), BIOS_ERR, DISABLE, ENABLE, gpio_config::gpio_num, NULL, and printk.
Referenced by add_power_operation().
|
static |
Definition at line 551 of file camera.c.
References ACPI_NAME_BUFFER_SIZE, acpigen_emit_namestring(), BIOS_ERR, DISABLE, DISABLE_METHOD_FORMAT, ENABLE, ENABLE_METHOD_FORMAT, printk, resource_get_action_type(), snprintf(), and UNKNOWN_METHOD_FORMAT.
Referenced by call_guarded_method().
|
static |
Definition at line 712 of file camera.c.
References BIOS_ERR, camera_resource_manager::cnt, config, get_resource_index(), GPIO, camera_resource::id, IMGCLK, operation_type::index, MAX_GUARDED_RESOURCES, MAX_PWR_OPS, operation_seq::ops, operation_seq::ops_cnt, printk, res_mgr, camera_resource_manager::resource, resource_set_clk_config(), resource_set_gpio_config(), camera_resource::type, operation_type::type, write_disable_method(), write_enable_method(), and write_guard_variable().
Referenced by camera_fill_ssdt().
|
static |
Definition at line 633 of file camera.c.
References add_clk_op(), add_gpio_op(), BIOS_ERR, GPIO, gpio_config, IMGCLK, NULL, printk, resource_clk_config(), resource_get_action_type(), resource_get_ctrl_type(), resource_gpio_config(), and type.
Referenced by write_disable_method(), and write_enable_method().
Definition at line 208 of file camera.c.
References device::bus, device::chip_info, config, DEV_TYPE_ROM, DEV_TYPE_SENSOR, DEV_TYPE_VCM, i2c_path::device, device_path::i2c, device::path, and bus::secondary.
Referenced by camera_generate_dsm().
|
static |
Definition at line 160 of file camera.c.
References config, PLD_HORIZONTAL_POSITION_CENTER, and PLD_PANEL_FRONT.
Referenced by camera_generate_pld().
|
static |
Definition at line 571 of file camera.c.
References add_guarded_method_namestring(), get_resource_index(), and NULL.
Referenced by fill_power_res_sequence().
|
static |
Definition at line 991 of file camera.c.
References ACPI_NAME_BUFFER_SIZE, BIOS_ERR, device::chip_info, config, INTEL_ACPI_CAMERA_CIO2, INTEL_ACPI_CAMERA_IMGU, INTEL_ACPI_CAMERA_NVM, INTEL_ACPI_CAMERA_PMIC, INTEL_ACPI_CAMERA_SENSOR, INTEL_ACPI_CAMERA_VCM, name, NULL, printk, and snprintf().
Definition at line 1039 of file camera.c.
References camera_ops, and device::ops.
Definition at line 93 of file camera.c.
References acpi_dp_add_array(), acpi_dp_add_child(), acpi_dp_add_integer(), acpi_dp_add_reference(), acpi_dp_new_table(), acpi_dp_write(), BUS_PATH_MAX, device::chip_info, config, CONFIG, cpu_get_cpuid(), cpu_id, CPUID_ALDERLAKE_J0, CPUID_ALDERLAKE_N_A0, CPUID_ALDERLAKE_Q0, free(), MAX_PORT_ENTRIES, name, NULL, snprintf(), and strdup().
Referenced by write_camera_device_common().
Definition at line 467 of file camera.c.
References acpi_dp_add_integer(), acpi_dp_add_string(), acpi_dp_new_table(), acpi_dp_write(), device::chip_info, and config.
Referenced by write_camera_device_common().
Definition at line 354 of file camera.c.
References acpi_device_path(), acpi_dp_add_array(), acpi_dp_add_child(), acpi_dp_add_integer(), acpi_dp_add_reference(), acpi_dp_new_table(), acpi_dp_write(), acpigen_pop_len(), acpigen_write_method_serialized(), acpigen_write_return_byte_buffer(), BIOS_ERR, device::bus, camera_fill_ssdb_defaults(), camera_generate_dsm(), camera_generate_pld(), device::chip_info, CIO2_PCI_DEV, CIO2_PCI_FN, config, DEFAULT_ENDPOINT, DEFAULT_REMOTE_NAME, DEVICE_PATH_I2C, drivers_intel_mipi_camera_config::device_type, find_dev_path(), INTEL_ACPI_CAMERA_VCM, MAX_LINK_FREQ_ENTRIES, NULL, device::path, pcidev_on_root(), printk, device_path::type, and drivers_intel_mipi_camera_config::vcm_name.
Referenced by write_camera_device_common().
|
static |
Definition at line 290 of file camera.c.
References BIOS_ERR, device::chip_info, drivers_intel_mipi_camera_config::cio2_lanes_used, drivers_intel_mipi_camera_config::cio2_num_ports, CIO2_PCI_DEV, CIO2_PCI_FN, CLK_FREQ_19_2MHZ, config, drivers_intel_mipi_camera_config::device_type, FLASH_DISABLE, INTEL_ACPI_CAMERA_CIO2, MIPI_INFO_ACPI_DEFINED, NULL, PCI_DEVFN, pcidev_on_root(), PLATFORM_SKC, printk, and PRIVACY_LED_A_16mA.
Referenced by camera_fill_sensor().
Definition at line 932 of file camera.c.
References acpi_device_path(), acpi_device_scope(), acpigen_pop_len(), acpigen_write_scope(), add_guarded_operations(), BIOS_ERR, BIOS_INFO, device::bus, device::chip_info, device::chip_ops, config, bus::dev, pci_path::devfn, i2c_path::device, DEVICE_PATH_GENERIC, DEVICE_PATH_I2C, DEVICE_PATH_PCI, device::enabled, device_path::i2c, chip_operations::name, NULL, device::path, device_path::pci, printk, device_path::type, write_camera_device_common(), write_i2c_camera_device(), and write_pci_camera_device().
Definition at line 504 of file camera.c.
References acpi_dp_add_integer(), acpi_dp_add_string(), acpi_dp_new_table(), acpi_dp_write(), device::chip_info, and config.
Referenced by write_camera_device_common().
Definition at line 231 of file camera.c.
References acpigen_emit_byte(), acpigen_pop_len(), acpigen_write_if(), acpigen_write_if_lequal_op_int(), acpigen_write_method(), acpigen_write_return_integer(), acpigen_write_return_singleton_buffer(), acpigen_write_return_string(), acpigen_write_to_buffer(), acpigen_write_to_integer(), acpigen_write_uuid(), address_for_dev_type(), ARG0_OP, ARG2_OP, device::chip_info, config, DEV_TYPE_ROM, DEV_TYPE_SENSOR, DEV_TYPE_VCM, LEQUAL_OP, LOCAL0_OP, LOCAL1_OP, SENSOR_NAME_UUID, and SENSOR_TYPE_UUID.
Referenced by camera_fill_sensor().
Definition at line 196 of file camera.c.
References acpigen_write_pld(), apply_pld_defaults(), device::chip_info, and config.
Referenced by camera_fill_sensor().
|
static |
Definition at line 760 of file camera.c.
References acpigen_write_sleep(), operation_type::action, BIOS_ERR, call_guarded_method(), config, operation_type::delay_ms, GPIO, IMGCLK, operation_type::index, MAX_PWR_OPS, operation_seq::ops, operation_seq::ops_cnt, printk, resource_set_action_type(), resource_set_clk_config(), resource_set_gpio_config(), and operation_type::type.
Referenced by write_i2c_camera_device().
|
static |
Definition at line 521 of file camera.c.
References BIOS_ERR, clk_config::clknum, camera_resource_manager::cnt, GPIO, gpio_config, gpio_config::gpio_num, camera_resource::id, IMGCLK, printk, res_mgr, camera_resource_manager::resource, resource_clk_config(), resource_get_ctrl_type(), resource_gpio_config(), camera_resource::type, and type.
Referenced by add_guarded_operations(), and call_guarded_method().
|
static |
Definition at line 59 of file camera.c.
References resource_config::clk_conf, and NULL.
Referenced by add_power_operation(), and get_resource_index().
|
static |
Definition at line 33 of file camera.c.
References resource_config::action.
Referenced by add_guarded_method_namestring(), and add_power_operation().
|
static |
Definition at line 33 of file camera.c.
Referenced by add_power_operation(), and get_resource_index().
|
static |
Definition at line 73 of file camera.c.
References resource_config::gpio_conf, and NULL.
Referenced by add_power_operation(), and get_resource_index().
|
static |
Definition at line 33 of file camera.c.
Referenced by fill_power_res_sequence(), write_disable_method(), and write_enable_method().
|
static |
Definition at line 50 of file camera.c.
References resource_config::clk_conf, IMGCLK, and resource_config::type.
Referenced by add_guarded_operations(), and fill_power_res_sequence().
|
static |
Definition at line 64 of file camera.c.
References GPIO, resource_config::gpio_conf, and resource_config::type.
Referenced by add_guarded_operations(), and fill_power_res_sequence().
Definition at line 891 of file camera.c.
References acpigen_emit_namestring(), acpigen_pop_len(), acpigen_write_name(), acpigen_write_name_integer(), acpigen_write_package(), camera_fill_cio2(), camera_fill_nvm(), camera_fill_sensor(), camera_fill_vcm(), device::chip_info, config, INTEL_ACPI_CAMERA_CIO2, INTEL_ACPI_CAMERA_IMGU, INTEL_ACPI_CAMERA_NVM, INTEL_ACPI_CAMERA_SENSOR, INTEL_ACPI_CAMERA_VCM, and POWER_RESOURCE_NAME.
Referenced by camera_fill_ssdt().
|
static |
Definition at line 687 of file camera.c.
References ACPI_NAME_BUFFER_SIZE, acpigen_emit_byte(), acpigen_emit_namestring(), acpigen_pop_len(), acpigen_write_if(), acpigen_write_if_lequal_namestr_int(), acpigen_write_integer(), acpigen_write_method_serialized(), add_power_operation(), DECREMENT_OP, DISABLE, DISABLE_METHOD_FORMAT, GUARD_VARIABLE_FORMAT, LGREATER_OP, resource_set_action_type(), and snprintf().
Referenced by add_guarded_operations().
|
static |
Definition at line 667 of file camera.c.
References ACPI_NAME_BUFFER_SIZE, acpigen_emit_byte(), acpigen_emit_namestring(), acpigen_pop_len(), acpigen_write_if_lequal_namestr_int(), acpigen_write_method_serialized(), add_power_operation(), ENABLE, ENABLE_METHOD_FORMAT, GUARD_VARIABLE_FORMAT, INCREMENT_OP, resource_set_action_type(), and snprintf().
Referenced by add_guarded_operations().
Definition at line 659 of file camera.c.
References ACPI_NAME_BUFFER_SIZE, acpigen_write_name_integer(), GUARD_VARIABLE_FORMAT, and snprintf().
Referenced by add_guarded_operations().
Definition at line 803 of file camera.c.
References acpi_device_name(), acpi_device_status(), acpi_device_write_i2c(), ACPI_DT_NAMESPACE_HID, acpigen_emit_byte(), acpigen_emit_namestring(), acpigen_pop_len(), acpigen_write_device(), acpigen_write_if(), acpigen_write_integer(), acpigen_write_method(), acpigen_write_method_serialized(), acpigen_write_name(), acpigen_write_name_integer(), acpigen_write_name_string(), acpigen_write_power_res(), acpigen_write_resourcetemplate_footer(), acpigen_write_resourcetemplate_header(), acpigen_write_return_integer(), acpigen_write_STA(), acpigen_write_STA_ext(), acpigen_write_store_op_to_namestr(), acpi_i2c::address, device::chip_info, config, i2c_path::device, fill_power_res_sequence(), device_path::i2c, I2C_SPEED_FAST, INTEL_ACPI_CAMERA_NVM, INTEL_ACPI_CAMERA_SENSOR, INTEL_ACPI_CAMERA_VCM, LEQUAL_OP, i2c_path::mode_10bit, NULL, device::path, and POWER_RESOURCE_NAME.
Referenced by camera_fill_ssdt().
Definition at line 791 of file camera.c.
References acpi_device_name(), acpigen_write_ADR_pci_device(), acpigen_write_device(), acpigen_write_name_string(), BIOS_ERR, DEVICE_PATH_PCI, device::path, printk, and device_path::type.
Referenced by camera_fill_ssdt().
|
static |
Definition at line 991 of file camera.c.
Referenced by camera_enable().
struct chip_operations drivers_intel_mipi_camera_ops |
|
static |
Definition at line 1 of file camera.c.
Referenced by add_guarded_operations(), and get_resource_index().