2015-05-28 11:43:13 +00:00
|
|
|
proc have_platform_drv {} {
|
2015-06-08 07:05:32 +00:00
|
|
|
if {[have_spec linux]} {
|
|
|
|
return 0
|
|
|
|
}
|
2015-07-08 20:35:22 +00:00
|
|
|
|
2015-09-03 12:55:05 +00:00
|
|
|
return [expr [have_spec arndale] \
|
|
|
|
|| [have_spec imx53] \
|
|
|
|
|| [have_spec rpi] \
|
|
|
|
|| [have_spec odroid_x2] \
|
2015-04-28 12:04:37 +00:00
|
|
|
|| [have_spec x86]]
|
2015-05-28 11:43:13 +00:00
|
|
|
}
|
|
|
|
|
2017-01-20 15:08:01 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
# Return 1 if the scenario depends on the USB driver on the used platform
|
|
|
|
#
|
|
|
|
# On most ARM platform, user input is provided by an USB HID device. On other
|
|
|
|
# platforms, the USB driver may be omitted.
|
|
|
|
#
|
|
|
|
proc need_usb_hid { } {
|
|
|
|
|
|
|
|
# covered by fb_sdl
|
|
|
|
if {[have_spec linux]} { return 0 }
|
|
|
|
|
|
|
|
# covered by ps2_drv
|
|
|
|
if {[have_spec x86]} { return 0 }
|
|
|
|
if {[have_spec pbxa9]} { return 0 }
|
|
|
|
|
|
|
|
return [have_spec usb]
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-03-09 13:03:46 +00:00
|
|
|
##
|
|
|
|
# Return name of the NIC driver binary
|
|
|
|
#
|
|
|
|
proc nic_drv_binary { } {
|
|
|
|
if {[have_spec linux]} { return linux_nic_drv }
|
|
|
|
if {[have_spec omap4] || [have_spec arndale] || [have_spec rpi]} { return usb_drv }
|
2018-01-16 23:00:57 +00:00
|
|
|
if {!([have_spec imx53] || [have_spec riscv] || [have_spec odroid_xu])} { return nic_drv }
|
2018-02-05 14:12:59 +00:00
|
|
|
return no_nic_drv_available
|
2017-03-09 13:03:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-03-09 16:08:26 +00:00
|
|
|
##
|
|
|
|
# Return name of the audio driver binary
|
|
|
|
#
|
|
|
|
proc audio_drv_binary { } {
|
|
|
|
if {[have_spec linux]} { return linux_audio_drv }
|
|
|
|
if {[have_spec x86]} { return audio_drv }
|
2018-02-05 14:12:59 +00:00
|
|
|
return no_audio_drv_available
|
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
|
2017-10-19 08:13:35 +00:00
|
|
|
lappend_if [have_spec x86] drv_build_components drivers/acpi
|
|
|
|
lappend_if [have_spec x86] drv_build_components server/report_rom
|
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
|
|
|
}
|
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
proc platform_drv_boot_modules {} {
|
|
|
|
set drv_boot_modules ""
|
|
|
|
lappend_if [have_platform_drv] drv_boot_modules platform_drv
|
2017-10-19 08:13:35 +00:00
|
|
|
lappend_if [have_spec x86] drv_boot_modules report_rom
|
|
|
|
|
|
|
|
if {[have_spec x86]} {
|
|
|
|
if {[have_spec muen]} {
|
|
|
|
lappend drv_boot_modules acpi
|
|
|
|
} else {
|
|
|
|
lappend drv_boot_modules acpi_drv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 {} {
|
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
if ([have_spec x86]) {
|
|
|
|
return {
|
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>
|
|
|
|
<policy label_prefix="wifi_drv"> <pci class="WIFI"/> </policy>
|
|
|
|
<policy label_prefix="usb_drv"> <pci class="USB"/> </policy>
|
|
|
|
<policy label_prefix="ahci_drv"> <pci class="AHCI"/> </policy>
|
|
|
|
<policy label_prefix="audio_drv"> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>
|
|
|
|
<policy label_prefix="intel_fb_drv" irq_mode="nomsi">
|
2015-09-18 14:34:19 +00:00
|
|
|
<pci class="VGA"/>
|
|
|
|
<pci bus="0" device="0" function="0"/>
|
|
|
|
<pci class="ISABRIDGE"/>
|
|
|
|
</policy>}
|
2015-06-08 07:05:32 +00:00
|
|
|
} else {
|
|
|
|
return {}
|
|
|
|
}
|
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 {} {
|
2017-10-19 08:13:35 +00:00
|
|
|
if {[have_spec x86]} {
|
2016-05-13 14:09:20 +00:00
|
|
|
return {
|
|
|
|
<service name="ROM" label="system"> <child name="acpi_report_rom"/> </service>}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2017-01-20 15:08:01 +00:00
|
|
|
|
2016-05-13 14:09:20 +00:00
|
|
|
proc platform_drv_config_config {} {
|
2017-01-03 12:17:41 +00:00
|
|
|
if {[have_spec acpi] || [have_spec arm] || [have_spec muen]} {
|
2016-05-13 14:09:20 +00:00
|
|
|
return {
|
|
|
|
<config>}
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
<config acpi="no">}
|
|
|
|
}
|
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
|
|
|
|
2017-10-19 08:13:35 +00:00
|
|
|
if {[have_spec x86] && ![have_spec muen] && ![have_spec linux]} {
|
2015-05-28 11:43:13 +00:00
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append drv_config {
|
2017-06-07 16:43:08 +00:00
|
|
|
<start name="acpi_drv" } [platform_drv_priority] { caps="400" >
|
2016-07-22 15:35:42 +00:00
|
|
|
<resource name="RAM" quantum="3M"/>
|
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>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
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>
|
2016-05-13 13:42:58 +00:00
|
|
|
<policy label="platform_drv -> acpi" report="acpi_drv -> acpi"/>
|
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 {
|
2017-05-07 20:36:11 +00:00
|
|
|
<start name="platform_drv" } [platform_drv_priority] { caps="800">
|
2015-11-12 10:00:58 +00:00
|
|
|
<resource name="RAM" quantum="4M" constrain_phys="yes"/>
|
2015-06-08 07:05:32 +00:00
|
|
|
<provides>
|
|
|
|
<service name="Platform"/>}
|
|
|
|
|
2017-10-19 08:13:35 +00:00
|
|
|
append_if [have_spec x86] 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
|
|
|
|
2017-10-19 08:13:35 +00:00
|
|
|
append_if [expr [have_spec x86] && ![have_spec muen]] 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
|
|
|
|
2017-02-11 02:38:38 +00:00
|
|
|
append_if [have_spec rpi] 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
|
|
|
|
}
|