2015-05-28 11:43:13 +00:00
|
|
|
proc have_platform_drv {} {
|
2022-02-02 15:57:17 +00:00
|
|
|
return [expr [have_board pc]]
|
2017-01-20 15:08:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-08-22 14:31:34 +00:00
|
|
|
##
|
|
|
|
# Return name of the USB driver binary
|
|
|
|
#
|
|
|
|
proc usb_host_drv_binary { } {
|
2021-01-13 09:15:10 +00:00
|
|
|
if {[have_board rpi]} { return rpi_usb_host_drv }
|
|
|
|
if {[have_board imx6q_sabrelite]} { return imx6q_sabrelite_usb_host_drv }
|
|
|
|
if {[have_board pc]} { return x86_pc_usb_host_drv }
|
2018-08-22 14:31:34 +00:00
|
|
|
return no_usb_drv_available
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-03-09 16:08:26 +00:00
|
|
|
##
|
|
|
|
# Return name of the audio driver binary
|
|
|
|
#
|
|
|
|
proc audio_drv_binary { } {
|
2021-01-13 09:15:10 +00:00
|
|
|
if {[have_board linux]} { return linux_audio_drv }
|
|
|
|
if {[have_board pc]} { return pci_audio_drv }
|
2018-02-05 14:12:59 +00:00
|
|
|
return no_audio_drv_available
|
2017-03-09 16:08:26 +00:00
|
|
|
}
|
|
|
|
|
2020-05-13 12:06:39 +00:00
|
|
|
##
|
|
|
|
# Return attributes of the audio driver's <start> node
|
|
|
|
#
|
|
|
|
proc audio_drv_start_attr { } {
|
2021-01-13 09:15:10 +00:00
|
|
|
if {[have_board linux]} { return {ld="no"} }
|
2020-05-13 12:06:39 +00:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2018-05-07 19:25:50 +00:00
|
|
|
proc acpi_drv_name { } {
|
|
|
|
global use_acpica_as_acpi_drv
|
|
|
|
if {[info exists use_acpica_as_acpi_drv] && $use_acpica_as_acpi_drv} {
|
|
|
|
return acpica }
|
|
|
|
|
|
|
|
return acpi_drv
|
|
|
|
}
|
2017-03-09 16:08:26 +00:00
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
proc platform_drv_build_components {} {
|
|
|
|
set drv_build_components ""
|
|
|
|
lappend_if [have_platform_drv] drv_build_components drivers/platform
|
2021-01-29 12:48:00 +00:00
|
|
|
if {[have_board pc]} {
|
2021-01-13 09:15:10 +00:00
|
|
|
lappend drv_build_components server/report_rom
|
2018-05-07 19:25:50 +00:00
|
|
|
if {[acpi_drv_name] eq "acpi_drv"} {
|
|
|
|
lappend drv_build_components drivers/acpi
|
|
|
|
}
|
|
|
|
if {[acpi_drv_name] eq "acpica"} {
|
|
|
|
lappend drv_build_components app/acpica
|
|
|
|
}
|
|
|
|
}
|
2017-02-11 02:38:38 +00:00
|
|
|
return $drv_build_components
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
proc append_platform_drv_build_components {} {
|
|
|
|
global build_components
|
2017-02-11 02:51:44 +00:00
|
|
|
append build_components { } [platform_drv_build_components]
|
2015-05-28 11:43:13 +00:00
|
|
|
}
|
|
|
|
|
2019-04-23 09:07:51 +00:00
|
|
|
proc platform_drv_binary {} {
|
2022-02-02 15:57:17 +00:00
|
|
|
if {[have_board pc]} { return legacy_pc_platform_drv }
|
2019-04-23 09:07:51 +00:00
|
|
|
return no_platform_drv_available
|
|
|
|
}
|
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
proc platform_drv_boot_modules {} {
|
|
|
|
set drv_boot_modules ""
|
2019-04-23 09:07:51 +00:00
|
|
|
lappend_if [have_platform_drv] drv_boot_modules [platform_drv_binary]
|
2017-10-19 08:13:35 +00:00
|
|
|
|
2021-02-03 10:46:14 +00:00
|
|
|
if {[have_board pc]} {
|
2021-01-13 09:15:10 +00:00
|
|
|
lappend drv_boot_modules report_rom
|
2021-01-29 12:48:00 +00:00
|
|
|
lappend drv_boot_modules [acpi_drv_name]
|
2017-10-19 08:13:35 +00:00
|
|
|
}
|
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
return $drv_boot_modules
|
|
|
|
}
|
2017-01-20 15:08:01 +00:00
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
proc append_platform_drv_boot_modules {} {
|
|
|
|
global boot_modules
|
2017-02-11 02:51:44 +00:00
|
|
|
append boot_modules { } [platform_drv_boot_modules]
|
2015-05-28 11:43:13 +00:00
|
|
|
}
|
|
|
|
|
2017-01-20 15:08:01 +00:00
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
proc platform_drv_policy {} {
|
|
|
|
|
2021-02-03 10:46:14 +00:00
|
|
|
if {![have_board pc]} {
|
2018-05-07 19:25:50 +00:00
|
|
|
return {}
|
|
|
|
}
|
|
|
|
|
|
|
|
set drv_policy ""
|
|
|
|
|
|
|
|
if {[acpi_drv_name] eq "acpica"} {
|
|
|
|
append drv_policy {
|
|
|
|
<policy label="acpi_drv -> "> <pci class="ALL"/> </policy>}
|
|
|
|
}
|
|
|
|
|
|
|
|
append drv_policy {
|
2016-11-24 14:28:32 +00:00
|
|
|
<policy label_prefix="ps2_drv"> <device name="PS2"/> </policy>
|
|
|
|
<policy label_prefix="nic_drv"> <pci class="ETHERNET"/> </policy>
|
|
|
|
<policy label_prefix="fb_drv"> <pci class="VGA"/> </policy>
|
2021-04-19 13:36:34 +00:00
|
|
|
<policy label_prefix="wifi_drv" msix="false"> <pci class="WIFI"/> </policy>
|
2016-11-24 14:28:32 +00:00
|
|
|
<policy label_prefix="usb_drv"> <pci class="USB"/> </policy>
|
|
|
|
<policy label_prefix="ahci_drv"> <pci class="AHCI"/> </policy>
|
2018-03-05 22:23:05 +00:00
|
|
|
<policy label_prefix="nvme_drv"> <pci class="NVME"/> </policy>
|
2016-11-24 14:28:32 +00:00
|
|
|
<policy label_prefix="audio_drv"> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>
|
2018-04-09 21:33:34 +00:00
|
|
|
<policy label_prefix="intel_fb_drv">
|
2015-09-18 14:34:19 +00:00
|
|
|
<pci class="VGA"/>
|
|
|
|
<pci bus="0" device="0" function="0"/>
|
|
|
|
<pci class="ISABRIDGE"/>
|
|
|
|
</policy>}
|
2018-05-07 19:25:50 +00:00
|
|
|
|
|
|
|
return $drv_policy
|
2015-05-28 11:43:13 +00:00
|
|
|
}
|
|
|
|
|
2017-01-20 15:08:01 +00:00
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
proc platform_drv_priority {} { return "" }
|
2016-05-13 14:09:20 +00:00
|
|
|
proc platform_drv_add_routing {} {
|
2018-05-07 19:25:50 +00:00
|
|
|
|
|
|
|
if {[acpi_drv_name] eq "acpica"} {
|
2016-05-13 14:09:20 +00:00
|
|
|
return {
|
2018-05-07 19:25:50 +00:00
|
|
|
<service name="ROM" label="acpi_ready"> <child name="acpi_report_rom"/> </service>}
|
2016-05-13 14:09:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2017-01-20 15:08:01 +00:00
|
|
|
|
2016-05-13 14:09:20 +00:00
|
|
|
proc platform_drv_config_config {} {
|
2018-05-07 19:25:50 +00:00
|
|
|
if {[acpi_drv_name] eq "acpica"} {
|
|
|
|
return {
|
|
|
|
<config acpi_ready="yes">}
|
|
|
|
}
|
|
|
|
|
2019-05-07 12:56:02 +00:00
|
|
|
return {<config>}
|
2016-05-13 14:09:20 +00:00
|
|
|
}
|
2015-05-28 11:43:13 +00:00
|
|
|
|
2017-01-20 15:08:01 +00:00
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
proc platform_drv_config {} {
|
|
|
|
set drv_config ""
|
2015-05-28 11:43:13 +00:00
|
|
|
|
2021-01-13 09:15:10 +00:00
|
|
|
if {[have_board pc]} {
|
2015-05-28 11:43:13 +00:00
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append drv_config {
|
2019-09-23 13:18:26 +00:00
|
|
|
<start name="acpi_drv" } [platform_drv_priority] { caps="350" >
|
2018-05-07 19:25:50 +00:00
|
|
|
<binary name="} [acpi_drv_name] {"/>}
|
|
|
|
|
|
|
|
if {[acpi_drv_name] eq "acpica"} {
|
|
|
|
append drv_config {
|
|
|
|
<resource name="RAM" quantum="5M"/>
|
|
|
|
<config acpi_ready="yes" act_as_acpi_drv="yes" report="yes"/>}
|
|
|
|
} else {
|
|
|
|
append drv_config {
|
2019-07-09 14:36:37 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>}
|
2018-05-07 19:25:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
append drv_config {
|
2015-05-26 18:12:17 +00:00
|
|
|
<route>
|
|
|
|
<service name="IO_MEM"> <parent/> </service>
|
2017-01-18 16:10:07 +00:00
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="RM"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
2018-05-07 19:25:50 +00:00
|
|
|
<service name="ROM"> <parent/> </service>}
|
|
|
|
|
|
|
|
append_if [expr {[acpi_drv_name] eq "acpica"}] drv_config {
|
|
|
|
<service name="IO_PORT"> <parent/> </service>
|
|
|
|
<service name="IRQ"> <parent/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<service name="Platform"> <child name="platform_drv"/> </service>
|
|
|
|
<service name="Acpi"> <child name="platform_drv"/> </service>}
|
|
|
|
|
|
|
|
append drv_config {
|
2015-05-26 18:12:17 +00:00
|
|
|
<service name="Report"> <child name="acpi_report_rom"/> </service>
|
2017-01-30 22:00:19 +00:00
|
|
|
<service name="ROM" label="platform_info"> <parent/> </service>
|
2015-05-26 18:12:17 +00:00
|
|
|
</route>
|
|
|
|
</start>}
|
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append drv_config "
|
2015-05-26 18:12:17 +00:00
|
|
|
<start name=\"acpi_report_rom\" [platform_drv_priority]>"
|
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append drv_config {
|
2015-05-26 18:12:17 +00:00
|
|
|
<binary name="report_rom"/>
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
2015-05-28 11:43:13 +00:00
|
|
|
<provides>
|
2015-05-26 18:12:17 +00:00
|
|
|
<service name="ROM" />
|
|
|
|
<service name="Report" />
|
2015-05-28 11:43:13 +00:00
|
|
|
</provides>
|
|
|
|
<config>
|
2019-07-09 16:28:12 +00:00
|
|
|
<policy label="smbios_decoder -> smbios_table" report="acpi_drv -> smbios_table"/>
|
|
|
|
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>}
|
2018-05-07 19:25:50 +00:00
|
|
|
|
|
|
|
append_if [expr {[acpi_drv_name] eq "acpica"}] drv_config {
|
|
|
|
<policy label="platform_drv -> acpi_ready" report="acpi_drv -> acpi_ready"/>}
|
|
|
|
|
|
|
|
append drv_config {
|
2015-05-28 11:43:13 +00:00
|
|
|
</config>
|
2015-05-26 18:12:17 +00:00
|
|
|
<route>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
2017-01-18 16:10:07 +00:00
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
2015-05-26 18:12:17 +00:00
|
|
|
</route>
|
2015-05-28 11:43:13 +00:00
|
|
|
</start>}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
if {[have_platform_drv]} {
|
2015-05-28 11:43:13 +00:00
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append drv_config {
|
2020-07-10 11:04:12 +00:00
|
|
|
<start name="platform_drv" } [platform_drv_priority] { caps="800" managing_system="yes">
|
2019-04-23 09:07:51 +00:00
|
|
|
<binary name="} [platform_drv_binary] {"/>
|
2020-07-10 11:04:12 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
2015-06-08 07:05:32 +00:00
|
|
|
<provides>
|
|
|
|
<service name="Platform"/>}
|
|
|
|
|
2021-02-03 10:46:14 +00:00
|
|
|
append_if [have_board pc] drv_config {
|
2016-06-01 20:26:54 +00:00
|
|
|
<service name="Acpi"/>}
|
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append_if [have_spec arm] drv_config {
|
2015-06-08 07:05:32 +00:00
|
|
|
<service name="Regulator"/>}
|
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append drv_config {
|
2015-06-08 07:05:32 +00:00
|
|
|
</provides>
|
2015-05-26 18:12:17 +00:00
|
|
|
<route>}
|
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append drv_config "[platform_drv_add_routing]"
|
2016-05-13 14:09:20 +00:00
|
|
|
|
2021-01-13 09:15:10 +00:00
|
|
|
append_if [have_board pc] drv_config {
|
2016-05-13 13:42:58 +00:00
|
|
|
<service name="ROM" label="acpi"> <child name="acpi_report_rom"/> </service>}
|
2015-06-08 07:05:32 +00:00
|
|
|
|
2021-02-03 10:46:14 +00:00
|
|
|
append_if [expr [have_board pc]] drv_config {
|
2020-12-15 12:31:07 +00:00
|
|
|
<service name="Report"> <child name="acpi_report_rom"/> </service>}
|
|
|
|
|
2021-01-13 09:15:10 +00:00
|
|
|
append_if [expr [have_board rpi] || [have_board pc]] drv_config {
|
2015-06-08 07:05:32 +00:00
|
|
|
<service name="Timer"> <any-child/> </service>}
|
2015-05-26 18:12:17 +00:00
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append drv_config {
|
2015-05-26 18:12:17 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>}
|
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append drv_config [platform_drv_config_config]
|
|
|
|
append drv_config [platform_drv_policy]
|
2015-05-26 18:12:17 +00:00
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append drv_config {
|
2015-05-28 11:43:13 +00:00
|
|
|
</config>
|
|
|
|
</start>}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
return $drv_config
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
proc append_platform_drv_config {} {
|
|
|
|
global config
|
|
|
|
append config [platform_drv_config]
|
2015-05-28 11:43:13 +00:00
|
|
|
return $config
|
|
|
|
}
|