Yifan Hong | a0b8d8e | 2022-11-22 22:18:04 -0800 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Matthias Maennich | 3334b77 | 2021-06-21 12:54:56 +0100 | [diff] [blame] | 2 | # Copyright (C) 2021 The Android Open Source Project |
Yifan Hong | d1601b5 | 2023-06-16 17:05:00 -0700 | [diff] [blame] | 3 | |
| 4 | load("@bazel_skylib//rules:write_file.bzl", "write_file") |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 5 | load("//build/bazel_common_rules/dist:dist.bzl", "copy_to_dist_dir") |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 6 | load("//build/kernel/kleaf:common_kernels.bzl", "define_common_kernels") |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 7 | load( |
| 8 | "//build/kernel/kleaf:kernel.bzl", |
Yifan Hong | 1122dd3 | 2023-08-08 13:50:56 -0700 | [diff] [blame] | 9 | "checkpatch", |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 10 | "ddk_headers", |
| 11 | "kernel_abi", |
| 12 | "kernel_build", |
| 13 | "kernel_images", |
| 14 | "kernel_modules_install", |
| 15 | "kernel_unstripped_modules_archive", |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 16 | "merged_kernel_uapi_headers", |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 17 | ) |
Ulises Mendez Martinez | 2c76415 | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 18 | load(":modules.bzl", "get_gki_modules_list") |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 19 | |
Yifan Hong | 8cd9712 | 2021-11-02 16:26:49 -0700 | [diff] [blame] | 20 | package( |
| 21 | default_visibility = [ |
| 22 | "//visibility:public", |
| 23 | ], |
| 24 | ) |
Matthias Maennich | 3334b77 | 2021-06-21 12:54:56 +0100 | [diff] [blame] | 25 | |
Ulises Mendez Martinez | bee3580 | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 26 | _GKI_AARCH64_MAKE_GOALS = [ |
| 27 | "Image", |
| 28 | "Image.lz4", |
| 29 | "Image.gz", |
| 30 | "modules", |
| 31 | ] |
| 32 | |
| 33 | _GKI_X86_64_MAKE_GOALS = [ |
| 34 | "bzImage", |
| 35 | "modules", |
| 36 | ] |
| 37 | |
Yifan Hong | 1122dd3 | 2023-08-08 13:50:56 -0700 | [diff] [blame] | 38 | checkpatch( |
| 39 | name = "checkpatch", |
| 40 | checkpatch_pl = "scripts/checkpatch.pl", |
| 41 | ) |
| 42 | |
Ulises Mendez Martinez | 2c76415 | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 43 | # Deprecated - Use arch specific files from below. |
Ulises Mendez Martinez | 3abb2ec | 2023-08-10 13:39:15 +0000 | [diff] [blame] | 44 | alias( |
Yifan Hong | d1601b5 | 2023-06-16 17:05:00 -0700 | [diff] [blame] | 45 | name = "gki_system_dlkm_modules", |
Ulises Mendez Martinez | 3abb2ec | 2023-08-10 13:39:15 +0000 | [diff] [blame] | 46 | actual = "gki_system_dlkm_modules_arm64", |
| 47 | deprecation = """ |
| 48 | Common list for all architectures is deprecated. |
| 49 | Instead use the file corresponding to the architecture used: |
| 50 | i.e. `gki_system_dlkm_modules_{arch}` |
| 51 | """, |
| 52 | ) |
| 53 | |
| 54 | alias( |
| 55 | name = "android/gki_system_dlkm_modules", |
| 56 | actual = "android/gki_system_dlkm_modules_arm64", |
| 57 | deprecation = """ |
| 58 | Common list for all architectures is deprecated. |
| 59 | Instead use the file corresponding to the architecture used: |
| 60 | i.e. `gki_system_dlkm_modules_{arch}` |
| 61 | """, |
Ulises Mendez Martinez | 2c76415 | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 62 | ) |
| 63 | |
| 64 | write_file( |
| 65 | name = "gki_system_dlkm_modules_arm64", |
| 66 | out = "android/gki_system_dlkm_modules_arm64", |
| 67 | content = get_gki_modules_list("arm64") + [ |
| 68 | # Ensure new line at the end. |
| 69 | "", |
| 70 | ], |
| 71 | ) |
| 72 | |
| 73 | write_file( |
| 74 | name = "gki_system_dlkm_modules_x86_64", |
| 75 | out = "android/gki_system_dlkm_modules_x86_64", |
| 76 | content = get_gki_modules_list("x86_64") + [ |
| 77 | # Ensure new line at the end. |
| 78 | "", |
| 79 | ], |
| 80 | ) |
| 81 | |
| 82 | write_file( |
| 83 | name = "gki_system_dlkm_modules_risc64", |
| 84 | out = "android/gki_system_dlkm_modules_riscv64", |
| 85 | content = get_gki_modules_list("riscv64") + [ |
Yifan Hong | d1601b5 | 2023-06-16 17:05:00 -0700 | [diff] [blame] | 86 | # Ensure new line at the end. |
| 87 | "", |
| 88 | ], |
| 89 | ) |
| 90 | |
Junki Min | 78ae52e | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 91 | filegroup( |
| 92 | name = "aarch64_additional_kmi_symbol_lists", |
| 93 | srcs = [ |
| 94 | # keep sorted |
Wanwei Jiang | 9f7633a | 2023-04-09 22:04:50 +0800 | [diff] [blame] | 95 | "android/abi_gki_aarch64_amlogic", |
Junki Min | 78ae52e | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 96 | "android/abi_gki_aarch64_db845c", |
| 97 | "android/abi_gki_aarch64_exynos", |
| 98 | "android/abi_gki_aarch64_fips140", |
erinwang2 | 5ef78a2 | 2023-06-02 09:42:48 -0700 | [diff] [blame] | 99 | "android/abi_gki_aarch64_lenovo", |
Xavier | be1b509 | 2023-09-04 16:47:05 +0800 | [diff] [blame] | 100 | "android/abi_gki_aarch64_mtkott", |
Lecopzer Chen | b85af8a | 2023-07-31 18:49:38 +0800 | [diff] [blame] | 101 | "android/abi_gki_aarch64_mtktv", |
Junki Min | 78ae52e | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 102 | "android/abi_gki_aarch64_oplus", |
| 103 | "android/abi_gki_aarch64_pixel", |
Sahil Chandna | 2ab9f0b | 2023-08-21 18:03:17 +0530 | [diff] [blame] | 104 | "android/abi_gki_aarch64_qcom", |
James Tai | 744ad30 | 2023-06-05 17:23:41 +0800 | [diff] [blame] | 105 | "android/abi_gki_aarch64_rtkstb", |
tfshen | 2e56d40 | 2023-06-02 15:06:49 +0800 | [diff] [blame] | 106 | "android/abi_gki_aarch64_rtktv", |
Junki Min | 78ae52e | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 107 | "android/abi_gki_aarch64_virtual_device", |
wang qiankun | fb96bf7 | 2023-04-18 16:44:53 +0800 | [diff] [blame] | 108 | "android/abi_gki_aarch64_xiaomi", |
zhangao | 3b371a4 | 2023-05-05 11:15:40 +0800 | [diff] [blame] | 109 | "android/abi_gki_aarch64_zeku", |
Junki Min | 78ae52e | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 110 | ], |
| 111 | visibility = ["//visibility:public"], |
| 112 | ) |
Yifan Hong | b8323be | 2022-09-15 11:51:15 -0700 | [diff] [blame] | 113 | |
Ramji Jiyani | 2f72cfb | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 114 | define_common_kernels(target_configs = { |
| 115 | "kernel_aarch64": { |
Ramji Jiyani | b3cc8c8 | 2023-03-16 21:25:22 +0000 | [diff] [blame] | 116 | "kmi_symbol_list_strict_mode": True, |
Yifan Hong | b8323be | 2022-09-15 11:51:15 -0700 | [diff] [blame] | 117 | "kmi_symbol_list": "android/abi_gki_aarch64", |
Yifan Hong | c517613 | 2023-07-20 16:50:01 -0700 | [diff] [blame] | 118 | "kmi_symbol_list_add_only": True, |
Junki Min | 78ae52e | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 119 | "additional_kmi_symbol_lists": [":aarch64_additional_kmi_symbol_lists"], |
Ramji Jiyani | 47819ed | 2023-03-21 22:49:31 +0000 | [diff] [blame] | 120 | "protected_exports_list": "android/abi_gki_protected_exports_aarch64", |
| 121 | "protected_modules_list": "android/gki_aarch64_protected_modules", |
Ulises Mendez Martinez | 2c76415 | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 122 | "module_implicit_outs": get_gki_modules_list("arm64"), |
Ulises Mendez Martinez | bee3580 | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 123 | "make_goals": _GKI_AARCH64_MAKE_GOALS, |
Ramji Jiyani | 2f72cfb | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 124 | }, |
Alistair Delva | 2f81119 | 2022-09-30 12:27:02 -0700 | [diff] [blame] | 125 | "kernel_aarch64_16k": { |
Aleksei Vetrov | d34386a | 2023-02-15 16:20:26 +0000 | [diff] [blame] | 126 | "kmi_symbol_list_strict_mode": False, |
Ulises Mendez Martinez | 2c76415 | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 127 | "module_implicit_outs": get_gki_modules_list("arm64"), |
Ulises Mendez Martinez | bee3580 | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 128 | "make_goals": _GKI_AARCH64_MAKE_GOALS, |
Alistair Delva | 2f81119 | 2022-09-30 12:27:02 -0700 | [diff] [blame] | 129 | }, |
Ramji Jiyani | 2f72cfb | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 130 | "kernel_aarch64_debug": { |
Yifan Hong | 54fc960 | 2022-07-08 11:14:24 -0700 | [diff] [blame] | 131 | "kmi_symbol_list_strict_mode": False, |
Yifan Hong | b8323be | 2022-09-15 11:51:15 -0700 | [diff] [blame] | 132 | "kmi_symbol_list": "android/abi_gki_aarch64", |
Yifan Hong | c517613 | 2023-07-20 16:50:01 -0700 | [diff] [blame] | 133 | "kmi_symbol_list_add_only": True, |
Junki Min | 78ae52e | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 134 | "additional_kmi_symbol_lists": [":aarch64_additional_kmi_symbol_lists"], |
Ramji Jiyani | 47819ed | 2023-03-21 22:49:31 +0000 | [diff] [blame] | 135 | "protected_exports_list": "android/abi_gki_protected_exports_aarch64", |
| 136 | "protected_modules_list": "android/gki_aarch64_protected_modules", |
Ulises Mendez Martinez | 2c76415 | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 137 | "module_implicit_outs": get_gki_modules_list("arm64"), |
Ulises Mendez Martinez | bee3580 | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 138 | "make_goals": _GKI_AARCH64_MAKE_GOALS, |
Ramji Jiyani | 2f72cfb | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 139 | }, |
Ramji Jiyani | 44e9b82 | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 140 | "kernel_x86_64": { |
| 141 | "kmi_symbol_list_strict_mode": False, |
Ramji Jiyani | 47819ed | 2023-03-21 22:49:31 +0000 | [diff] [blame] | 142 | "protected_exports_list": "android/abi_gki_protected_exports_x86_64", |
| 143 | "protected_modules_list": "android/gki_x86_64_protected_modules", |
Ulises Mendez Martinez | 2c76415 | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 144 | "module_implicit_outs": get_gki_modules_list("x86_64"), |
Ulises Mendez Martinez | bee3580 | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 145 | "make_goals": _GKI_X86_64_MAKE_GOALS, |
Ramji Jiyani | 44e9b82 | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 146 | }, |
Ramji Jiyani | 44e9b82 | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 147 | "kernel_x86_64_debug": { |
| 148 | "kmi_symbol_list_strict_mode": False, |
Ramji Jiyani | 47819ed | 2023-03-21 22:49:31 +0000 | [diff] [blame] | 149 | "protected_exports_list": "android/abi_gki_protected_exports_x86_64", |
| 150 | "protected_modules_list": "android/gki_x86_64_protected_modules", |
Ulises Mendez Martinez | 2c76415 | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 151 | "module_implicit_outs": get_gki_modules_list("x86_64"), |
Ulises Mendez Martinez | bee3580 | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 152 | "make_goals": _GKI_X86_64_MAKE_GOALS, |
Ramji Jiyani | 44e9b82 | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 153 | }, |
Ramji Jiyani | 2f72cfb | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 154 | }) |
Yifan Hong | 0af43f9 | 2022-05-12 14:42:33 -0700 | [diff] [blame] | 155 | |
Ulises Mendez Martinez | d8eb5e7 | 2023-06-23 10:03:10 +0000 | [diff] [blame] | 156 | _DB845C_MODULE_OUTS = [ |
| 157 | # keep sorted |
| 158 | "crypto/michael_mic.ko", |
| 159 | "drivers/base/regmap/regmap-sdw.ko", |
| 160 | "drivers/base/regmap/regmap-slimbus.ko", |
| 161 | "drivers/bus/mhi/core/mhi.ko", |
| 162 | "drivers/clk/qcom/clk-qcom.ko", |
| 163 | "drivers/clk/qcom/clk-rpmh.ko", |
| 164 | "drivers/clk/qcom/clk-spmi-pmic-div.ko", |
| 165 | "drivers/clk/qcom/dispcc-sdm845.ko", |
| 166 | "drivers/clk/qcom/dispcc-sm8250.ko", |
| 167 | "drivers/clk/qcom/gcc-sdm845.ko", |
| 168 | "drivers/clk/qcom/gcc-sm8250.ko", |
| 169 | "drivers/clk/qcom/gpucc-sdm845.ko", |
| 170 | "drivers/clk/qcom/gpucc-sm8250.ko", |
| 171 | "drivers/clk/qcom/lpass-gfm-sm8250.ko", |
| 172 | "drivers/clk/qcom/videocc-sdm845.ko", |
| 173 | "drivers/clk/qcom/videocc-sm8250.ko", |
| 174 | "drivers/cpufreq/qcom-cpufreq-hw.ko", |
| 175 | "drivers/dma-buf/heaps/system_heap.ko", |
| 176 | "drivers/dma/qcom/bam_dma.ko", |
| 177 | "drivers/extcon/extcon-usb-gpio.ko", |
| 178 | "drivers/firmware/qcom-scm.ko", |
| 179 | "drivers/gpio/gpio-wcd934x.ko", |
| 180 | "drivers/gpu/drm/bridge/display-connector.ko", |
| 181 | "drivers/gpu/drm/bridge/lontium-lt9611.ko", |
| 182 | "drivers/gpu/drm/bridge/lontium-lt9611uxc.ko", |
| 183 | "drivers/gpu/drm/msm/msm.ko", |
| 184 | "drivers/gpu/drm/scheduler/gpu-sched.ko", |
| 185 | "drivers/hwspinlock/qcom_hwspinlock.ko", |
| 186 | "drivers/i2c/busses/i2c-designware-core.ko", |
| 187 | "drivers/i2c/busses/i2c-designware-platform.ko", |
| 188 | "drivers/i2c/busses/i2c-qcom-geni.ko", |
| 189 | "drivers/i2c/busses/i2c-qup.ko", |
| 190 | "drivers/i2c/busses/i2c-rk3x.ko", |
| 191 | "drivers/i2c/i2c-dev.ko", |
| 192 | "drivers/i2c/i2c-mux.ko", |
| 193 | "drivers/i2c/muxes/i2c-mux-pca954x.ko", |
| 194 | "drivers/iio/adc/qcom-spmi-adc5.ko", |
| 195 | "drivers/iio/adc/qcom-vadc-common.ko", |
| 196 | "drivers/input/misc/pm8941-pwrkey.ko", |
| 197 | "drivers/interconnect/qcom/icc-bcm-voter.ko", |
| 198 | "drivers/interconnect/qcom/icc-osm-l3.ko", |
| 199 | "drivers/interconnect/qcom/icc-rpmh.ko", |
| 200 | "drivers/interconnect/qcom/qnoc-sdm845.ko", |
| 201 | "drivers/interconnect/qcom/qnoc-sm8250.ko", |
| 202 | "drivers/iommu/arm/arm-smmu/arm_smmu.ko", |
| 203 | "drivers/irqchip/qcom-pdc.ko", |
| 204 | "drivers/leds/led-class-multicolor.ko", |
| 205 | "drivers/mailbox/qcom-apcs-ipc-mailbox.ko", |
| 206 | "drivers/mailbox/qcom-ipcc.ko", |
| 207 | "drivers/mfd/qcom-spmi-pmic.ko", |
| 208 | "drivers/mfd/wcd934x.ko", |
| 209 | "drivers/misc/fastrpc.ko", |
| 210 | "drivers/mmc/host/cqhci.ko", |
| 211 | "drivers/mmc/host/sdhci-msm.ko", |
| 212 | "drivers/net/can/spi/mcp251xfd/mcp251xfd.ko", |
| 213 | "drivers/net/wireless/ath/ath.ko", |
| 214 | "drivers/net/wireless/ath/ath10k/ath10k_core.ko", |
| 215 | "drivers/net/wireless/ath/ath10k/ath10k_pci.ko", |
| 216 | "drivers/net/wireless/ath/ath10k/ath10k_snoc.ko", |
| 217 | "drivers/net/wireless/ath/ath11k/ath11k.ko", |
| 218 | "drivers/net/wireless/ath/ath11k/ath11k_ahb.ko", |
| 219 | "drivers/net/wireless/ath/ath11k/ath11k_pci.ko", |
| 220 | "drivers/nvmem/nvmem_qfprom.ko", |
| 221 | "drivers/phy/qualcomm/phy-qcom-qmp.ko", |
| 222 | "drivers/phy/qualcomm/phy-qcom-qusb2.ko", |
| 223 | "drivers/phy/qualcomm/phy-qcom-snps-femto-v2.ko", |
| 224 | "drivers/phy/qualcomm/phy-qcom-usb-hs.ko", |
| 225 | "drivers/pinctrl/qcom/pinctrl-lpass-lpi.ko", |
| 226 | "drivers/pinctrl/qcom/pinctrl-msm.ko", |
| 227 | "drivers/pinctrl/qcom/pinctrl-sdm845.ko", |
| 228 | "drivers/pinctrl/qcom/pinctrl-sm8250.ko", |
| 229 | "drivers/pinctrl/qcom/pinctrl-spmi-gpio.ko", |
| 230 | "drivers/pinctrl/qcom/pinctrl-spmi-mpp.ko", |
| 231 | "drivers/power/reset/qcom-pon.ko", |
| 232 | "drivers/power/reset/reboot-mode.ko", |
| 233 | "drivers/power/reset/syscon-reboot-mode.ko", |
| 234 | "drivers/regulator/gpio-regulator.ko", |
| 235 | "drivers/regulator/qcom-rpmh-regulator.ko", |
| 236 | "drivers/regulator/qcom_spmi-regulator.ko", |
| 237 | "drivers/regulator/qcom_usb_vbus-regulator.ko", |
| 238 | "drivers/remoteproc/qcom_common.ko", |
| 239 | "drivers/remoteproc/qcom_pil_info.ko", |
| 240 | "drivers/remoteproc/qcom_q6v5.ko", |
| 241 | "drivers/remoteproc/qcom_q6v5_adsp.ko", |
| 242 | "drivers/remoteproc/qcom_q6v5_mss.ko", |
| 243 | "drivers/remoteproc/qcom_q6v5_pas.ko", |
| 244 | "drivers/remoteproc/qcom_q6v5_wcss.ko", |
| 245 | "drivers/remoteproc/qcom_sysmon.ko", |
| 246 | "drivers/reset/reset-qcom-aoss.ko", |
| 247 | "drivers/reset/reset-qcom-pdc.ko", |
| 248 | "drivers/rpmsg/qcom_glink.ko", |
| 249 | "drivers/rpmsg/qcom_glink_rpm.ko", |
| 250 | "drivers/rpmsg/qcom_glink_smem.ko", |
| 251 | "drivers/rpmsg/qcom_smd.ko", |
| 252 | "drivers/rpmsg/rpmsg_ns.ko", |
| 253 | "drivers/rtc/rtc-pm8xxx.ko", |
| 254 | "drivers/slimbus/slim-qcom-ngd-ctrl.ko", |
| 255 | "drivers/slimbus/slimbus.ko", |
| 256 | "drivers/soc/qcom/apr.ko", |
| 257 | "drivers/soc/qcom/cmd-db.ko", |
| 258 | "drivers/soc/qcom/llcc-qcom.ko", |
| 259 | "drivers/soc/qcom/mdt_loader.ko", |
| 260 | "drivers/soc/qcom/pdr_interface.ko", |
| 261 | "drivers/soc/qcom/qcom_aoss.ko", |
| 262 | "drivers/soc/qcom/qcom_rpmh.ko", |
| 263 | "drivers/soc/qcom/qmi_helpers.ko", |
| 264 | "drivers/soc/qcom/rmtfs_mem.ko", |
| 265 | "drivers/soc/qcom/rpmhpd.ko", |
| 266 | "drivers/soc/qcom/smem.ko", |
| 267 | "drivers/soc/qcom/smp2p.ko", |
| 268 | "drivers/soc/qcom/smsm.ko", |
| 269 | "drivers/soc/qcom/socinfo.ko", |
| 270 | "drivers/soundwire/soundwire-bus.ko", |
| 271 | "drivers/soundwire/soundwire-qcom.ko", |
| 272 | "drivers/spi/spi-geni-qcom.ko", |
| 273 | "drivers/spi/spi-pl022.ko", |
| 274 | "drivers/spi/spi-qcom-qspi.ko", |
| 275 | "drivers/spi/spi-qup.ko", |
| 276 | "drivers/spmi/spmi-pmic-arb.ko", |
| 277 | "drivers/thermal/qcom/lmh.ko", |
| 278 | "drivers/thermal/qcom/qcom-spmi-adc-tm5.ko", |
| 279 | "drivers/thermal/qcom/qcom-spmi-temp-alarm.ko", |
| 280 | "drivers/thermal/qcom/qcom_tsens.ko", |
| 281 | "drivers/tty/serial/msm_serial.ko", |
| 282 | "drivers/ufs/host/ufs_qcom.ko", |
| 283 | "drivers/usb/common/ulpi.ko", |
| 284 | "drivers/usb/host/ohci-hcd.ko", |
| 285 | "drivers/usb/host/ohci-pci.ko", |
| 286 | "drivers/usb/host/ohci-platform.ko", |
| 287 | "drivers/usb/typec/qcom-pmic-typec.ko", |
| 288 | "net/mac80211/mac80211.ko", |
| 289 | "net/qrtr/qrtr.ko", |
| 290 | "net/qrtr/qrtr-mhi.ko", |
| 291 | "net/qrtr/qrtr-smd.ko", |
| 292 | "net/qrtr/qrtr-tun.ko", |
| 293 | "net/wireless/cfg80211.ko", |
| 294 | "sound/soc/codecs/snd-soc-dmic.ko", |
| 295 | "sound/soc/codecs/snd-soc-hdmi-codec.ko", |
| 296 | "sound/soc/codecs/snd-soc-lpass-va-macro.ko", |
| 297 | "sound/soc/codecs/snd-soc-lpass-wsa-macro.ko", |
| 298 | "sound/soc/codecs/snd-soc-max98927.ko", |
| 299 | "sound/soc/codecs/snd-soc-rl6231.ko", |
| 300 | "sound/soc/codecs/snd-soc-rt5663.ko", |
| 301 | "sound/soc/codecs/snd-soc-wcd-mbhc.ko", |
| 302 | "sound/soc/codecs/snd-soc-wcd9335.ko", |
| 303 | "sound/soc/codecs/snd-soc-wcd934x.ko", |
| 304 | "sound/soc/codecs/snd-soc-wsa881x.ko", |
| 305 | "sound/soc/qcom/qdsp6/q6adm.ko", |
| 306 | "sound/soc/qcom/qdsp6/q6afe.ko", |
| 307 | "sound/soc/qcom/qdsp6/q6afe-clocks.ko", |
| 308 | "sound/soc/qcom/qdsp6/q6afe-dai.ko", |
| 309 | "sound/soc/qcom/qdsp6/q6asm.ko", |
| 310 | "sound/soc/qcom/qdsp6/q6asm-dai.ko", |
| 311 | "sound/soc/qcom/qdsp6/q6core.ko", |
| 312 | "sound/soc/qcom/qdsp6/q6dsp-common.ko", |
| 313 | "sound/soc/qcom/qdsp6/q6routing.ko", |
| 314 | "sound/soc/qcom/snd-soc-qcom-common.ko", |
| 315 | "sound/soc/qcom/snd-soc-sdm845.ko", |
| 316 | "sound/soc/qcom/snd-soc-sm8250.ko", |
| 317 | ] |
| 318 | |
| 319 | _DB845C_WATCHDOG_MODULE_OUTS = [ |
| 320 | "drivers/watchdog/pm8916_wdt.ko", |
| 321 | "drivers/watchdog/qcom-wdt.ko", |
| 322 | ] |
| 323 | |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 324 | kernel_build( |
Ulises Mendez Martinez | d8eb5e7 | 2023-06-23 10:03:10 +0000 | [diff] [blame] | 325 | name = "db845c_no_kgdb", |
Ulises Mendez Martinez | b856e6c | 2022-09-02 19:21:44 +0000 | [diff] [blame] | 326 | outs = [ |
Yifan Hong | 0af43f9 | 2022-05-12 14:42:33 -0700 | [diff] [blame] | 327 | "arch/arm64/boot/dts/qcom/qrb5165-rb5.dtb", |
| 328 | "arch/arm64/boot/dts/qcom/sdm845-db845c.dtb", |
| 329 | ], |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 330 | # Enable mixed build. |
| 331 | base_kernel = ":kernel_aarch64", |
| 332 | build_config = "build.config.db845c", |
| 333 | collect_unstripped_modules = True, |
| 334 | kmi_symbol_list = "android/abi_gki_aarch64_db845c", |
Ulises Mendez Martinez | 3675647 | 2023-05-12 12:04:53 +0000 | [diff] [blame] | 335 | make_goals = [ |
| 336 | "modules", |
| 337 | "qcom/sdm845-db845c.dtb", |
| 338 | "qcom/qrb5165-rb5.dtb", |
| 339 | ], |
Ulises Mendez Martinez | d8eb5e7 | 2023-06-23 10:03:10 +0000 | [diff] [blame] | 340 | module_outs = _DB845C_MODULE_OUTS + _DB845C_WATCHDOG_MODULE_OUTS, |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 341 | strip_modules = True, |
| 342 | ) |
| 343 | |
Ulises Mendez Martinez | d8eb5e7 | 2023-06-23 10:03:10 +0000 | [diff] [blame] | 344 | kernel_build( |
| 345 | name = "db845c_with_kgdb", |
| 346 | outs = [ |
| 347 | "arch/arm64/boot/dts/qcom/qrb5165-rb5.dtb", |
| 348 | "arch/arm64/boot/dts/qcom/sdm845-db845c.dtb", |
| 349 | ], |
| 350 | # Enable mixed build. |
| 351 | base_kernel = ":kernel_aarch64", |
| 352 | build_config = "build.config.db845c", |
| 353 | make_goals = [ |
| 354 | "modules", |
| 355 | "qcom/sdm845-db845c.dtb", |
| 356 | "qcom/qrb5165-rb5.dtb", |
| 357 | ], |
| 358 | module_outs = _DB845C_MODULE_OUTS, |
| 359 | strip_modules = True, |
| 360 | ) |
| 361 | |
| 362 | alias( |
| 363 | name = "db845c", |
| 364 | actual = select({ |
| 365 | "//build/kernel/kleaf:kgdb_is_true": "db845c_with_kgdb", |
| 366 | "//conditions:default": "db845c_no_kgdb", |
| 367 | }), |
| 368 | ) |
| 369 | |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 370 | kernel_abi( |
| 371 | name = "db845c_abi", |
| 372 | kernel_build = ":db845c", |
| 373 | kmi_symbol_list_add_only = True, |
| 374 | ) |
| 375 | |
| 376 | kernel_modules_install( |
| 377 | name = "db845c_modules_install", |
| 378 | kernel_build = ":db845c", |
| 379 | ) |
| 380 | |
| 381 | merged_kernel_uapi_headers( |
| 382 | name = "db845c_merged_kernel_uapi_headers", |
| 383 | kernel_build = ":db845c", |
| 384 | ) |
| 385 | |
| 386 | kernel_images( |
| 387 | name = "db845c_images", |
| 388 | build_initramfs = True, |
| 389 | kernel_build = ":db845c", |
| 390 | kernel_modules_install = ":db845c_modules_install", |
| 391 | ) |
| 392 | |
| 393 | copy_to_dist_dir( |
| 394 | name = "db845c_dist", |
| 395 | data = [ |
| 396 | ":db845c", |
| 397 | ":db845c_images", |
| 398 | ":db845c_modules_install", |
| 399 | ":db845c_merged_kernel_uapi_headers", |
| 400 | # Mixed build: Additional GKI artifacts. |
| 401 | ":kernel_aarch64", |
| 402 | ":kernel_aarch64_modules", |
| 403 | ":kernel_aarch64_additional_artifacts", |
| 404 | ], |
| 405 | dist_dir = "out/db845/dist", |
| 406 | flat = True, |
| 407 | log = "info", |
Yifan Hong | 0af43f9 | 2022-05-12 14:42:33 -0700 | [diff] [blame] | 408 | ) |
Yifan Hong | b0f8873 | 2022-09-08 17:15:54 -0700 | [diff] [blame] | 409 | |
Ulises Mendez Martinez | bdd2312 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 410 | _ROCKPI4_MODULE_OUTS = [ |
| 411 | # keep sorted |
| 412 | "drivers/block/virtio_blk.ko", |
| 413 | "drivers/char/hw_random/virtio-rng.ko", |
| 414 | "drivers/clk/clk-rk808.ko", |
| 415 | "drivers/cpufreq/cpufreq-dt.ko", |
| 416 | "drivers/dma/pl330.ko", |
| 417 | "drivers/gpu/drm/bridge/analogix/analogix_dp.ko", |
| 418 | "drivers/gpu/drm/bridge/synopsys/dw-hdmi.ko", |
| 419 | "drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.ko", |
| 420 | "drivers/gpu/drm/rockchip/rockchipdrm.ko", |
| 421 | "drivers/i2c/busses/i2c-rk3x.ko", |
| 422 | "drivers/iio/adc/rockchip_saradc.ko", |
| 423 | "drivers/iio/buffer/industrialio-triggered-buffer.ko", |
| 424 | "drivers/iio/buffer/kfifo_buf.ko", |
| 425 | "drivers/mfd/rk808.ko", |
| 426 | "drivers/mmc/core/pwrseq_simple.ko", |
| 427 | "drivers/mmc/host/cqhci.ko", |
| 428 | "drivers/mmc/host/dw_mmc.ko", |
| 429 | "drivers/mmc/host/dw_mmc-pltfm.ko", |
| 430 | "drivers/mmc/host/dw_mmc-rockchip.ko", |
| 431 | "drivers/mmc/host/sdhci-of-arasan.ko", |
| 432 | "drivers/net/ethernet/stmicro/stmmac/dwmac-rk.ko", |
| 433 | "drivers/net/ethernet/stmicro/stmmac/stmmac.ko", |
| 434 | "drivers/net/ethernet/stmicro/stmmac/stmmac-platform.ko", |
| 435 | "drivers/net/net_failover.ko", |
| 436 | "drivers/net/pcs/pcs_xpcs.ko", |
| 437 | "drivers/net/virtio_net.ko", |
| 438 | "drivers/nvmem/nvmem_rockchip_efuse.ko", |
| 439 | "drivers/pci/controller/pcie-rockchip-host.ko", |
| 440 | "drivers/phy/rockchip/phy-rockchip-emmc.ko", |
| 441 | "drivers/phy/rockchip/phy-rockchip-inno-usb2.ko", |
| 442 | "drivers/phy/rockchip/phy-rockchip-pcie.ko", |
| 443 | "drivers/phy/rockchip/phy-rockchip-typec.ko", |
| 444 | "drivers/pwm/pwm-rockchip.ko", |
| 445 | "drivers/regulator/fan53555.ko", |
| 446 | "drivers/regulator/pwm-regulator.ko", |
| 447 | "drivers/regulator/rk808-regulator.ko", |
| 448 | "drivers/rtc/rtc-rk808.ko", |
| 449 | "drivers/soc/rockchip/io-domain.ko", |
| 450 | "drivers/thermal/rockchip_thermal.ko", |
| 451 | "drivers/usb/host/ohci-hcd.ko", |
| 452 | "drivers/usb/host/ohci-platform.ko", |
| 453 | "drivers/virtio/virtio_pci.ko", |
| 454 | "drivers/virtio/virtio_pci_modern_dev.ko", |
| 455 | "net/core/failover.ko", |
| 456 | ] |
| 457 | |
| 458 | _ROCKPI4_WATCHDOG_MODULE_OUTS = [ |
| 459 | # keep sorted |
| 460 | "drivers/watchdog/dw_wdt.ko", |
| 461 | ] |
| 462 | |
Yifan Hong | 023b893 | 2022-11-22 23:43:51 +0000 | [diff] [blame] | 463 | # TODO(b/258259749): Convert rockpi4 to mixed build |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 464 | kernel_build( |
Ulises Mendez Martinez | bdd2312 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 465 | name = "rockpi4_no_kgdb", |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 466 | outs = [ |
Yifan Hong | 023b893 | 2022-11-22 23:43:51 +0000 | [diff] [blame] | 467 | "Image", |
| 468 | "System.map", |
| 469 | "modules.builtin", |
| 470 | "modules.builtin.modinfo", |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 471 | "rk3399-rock-pi-4b.dtb", |
Yifan Hong | 023b893 | 2022-11-22 23:43:51 +0000 | [diff] [blame] | 472 | "vmlinux", |
| 473 | "vmlinux.symvers", |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 474 | ], |
| 475 | build_config = "build.config.rockpi4", |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 476 | collect_unstripped_modules = True, |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 477 | kmi_symbol_list = "android/abi_gki_rockpi4", |
Ulises Mendez Martinez | 3675647 | 2023-05-12 12:04:53 +0000 | [diff] [blame] | 478 | make_goals = [ |
| 479 | "Image", |
| 480 | "modules", |
| 481 | "rockchip/rk3399-rock-pi-4b.dtb", |
| 482 | ], |
Ulises Mendez Martinez | 2c76415 | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 483 | module_outs = get_gki_modules_list("arm64") + _ROCKPI4_MODULE_OUTS + _ROCKPI4_WATCHDOG_MODULE_OUTS, |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 484 | visibility = ["//visibility:private"], |
Ulises Mendez Martinez | bdd2312 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 485 | ) |
| 486 | |
| 487 | # TODO(b/258259749): Convert rockpi4 to mixed build |
| 488 | kernel_build( |
| 489 | name = "rockpi4_with_kgdb", |
| 490 | outs = [ |
| 491 | "Image", |
| 492 | "System.map", |
| 493 | "modules.builtin", |
| 494 | "modules.builtin.modinfo", |
| 495 | "rk3399-rock-pi-4b.dtb", |
| 496 | "vmlinux", |
| 497 | "vmlinux.symvers", |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 498 | ], |
Ulises Mendez Martinez | bdd2312 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 499 | build_config = "build.config.rockpi4", |
| 500 | collect_unstripped_modules = True, |
| 501 | kmi_symbol_list = "//common:android/abi_gki_rockpi4", |
| 502 | make_goals = [ |
| 503 | "Image", |
| 504 | "modules", |
| 505 | "rockchip/rk3399-rock-pi-4b.dtb", |
| 506 | ], |
Ulises Mendez Martinez | 2c76415 | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 507 | module_outs = get_gki_modules_list("arm64") + _ROCKPI4_MODULE_OUTS, |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 508 | visibility = ["//visibility:private"], |
Ulises Mendez Martinez | bdd2312 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 509 | ) |
| 510 | |
| 511 | alias( |
| 512 | name = "rockpi4", |
| 513 | actual = select({ |
| 514 | "//build/kernel/kleaf:kgdb_is_true": "rockpi4_with_kgdb", |
| 515 | "//conditions:default": "rockpi4_no_kgdb", |
| 516 | }), |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 517 | ) |
| 518 | |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 519 | kernel_abi( |
| 520 | name = "rockpi4_abi", |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 521 | kernel_build = ":rockpi4", |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 522 | kmi_symbol_list_add_only = True, |
| 523 | ) |
| 524 | |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 525 | kernel_modules_install( |
| 526 | name = "rockpi4_modules_install", |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 527 | kernel_build = ":rockpi4", |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 528 | ) |
| 529 | |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 530 | kernel_unstripped_modules_archive( |
| 531 | name = "rockpi4_unstripped_modules_archive", |
| 532 | kernel_build = ":rockpi4", |
| 533 | ) |
| 534 | |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 535 | kernel_images( |
| 536 | name = "rockpi4_images", |
| 537 | build_initramfs = True, |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 538 | kernel_build = ":rockpi4", |
| 539 | kernel_modules_install = ":rockpi4_modules_install", |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 540 | ) |
| 541 | |
| 542 | copy_to_dist_dir( |
| 543 | name = "rockpi4_dist", |
| 544 | data = [ |
| 545 | ":rockpi4", |
| 546 | ":rockpi4_images", |
| 547 | ":rockpi4_modules_install", |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 548 | ":rockpi4_unstripped_modules_archive", |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 549 | ], |
| 550 | dist_dir = "out/rockpi4/dist", |
| 551 | flat = True, |
| 552 | ) |
| 553 | |
Yifan Hong | b0f8873 | 2022-09-08 17:15:54 -0700 | [diff] [blame] | 554 | kernel_build( |
| 555 | name = "fips140", |
| 556 | outs = [], |
| 557 | base_kernel = ":kernel_aarch64", |
| 558 | build_config = "build.config.gki.aarch64.fips140", |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 559 | kmi_symbol_list = "android/abi_gki_aarch64_fips140", |
Yifan Hong | b0f8873 | 2022-09-08 17:15:54 -0700 | [diff] [blame] | 560 | module_outs = ["crypto/fips140.ko"], |
| 561 | ) |
| 562 | |
Ulises Mendez Martinez | 3c5ab71 | 2023-02-24 12:51:01 +0000 | [diff] [blame] | 563 | kernel_abi( |
| 564 | name = "fips140_abi", |
Ulises Mendez Martinez | 258f113 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 565 | kernel_build = ":fips140", |
Ulises Mendez Martinez | 3c5ab71 | 2023-02-24 12:51:01 +0000 | [diff] [blame] | 566 | kmi_symbol_list_add_only = True, |
| 567 | ) |
| 568 | |
Yifan Hong | b0f8873 | 2022-09-08 17:15:54 -0700 | [diff] [blame] | 569 | copy_to_dist_dir( |
| 570 | name = "fips140_dist", |
| 571 | data = [ |
| 572 | ":fips140", |
| 573 | ], |
| 574 | dist_dir = "out/fips140/dist", |
| 575 | flat = True, |
| 576 | ) |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 577 | |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 578 | # allmodconfig build tests. |
| 579 | # These are build tests only, so: |
| 580 | # - outs are intentionally set to empty to not copy anything to DIST_DIR |
| 581 | # - --allow-undeclared-modules must be used so modules are not declared or copied. |
| 582 | # - No dist target because these are build tests. We don't care about the artifacts. |
| 583 | |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 584 | # tools/bazel build --allow_undeclared_modules //common:kernel_aarch64_allmodconfig |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 585 | kernel_build( |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 586 | name = "kernel_aarch64_allmodconfig", |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 587 | # Hack to actually check the build. |
| 588 | # Otherwise, Bazel thinks that there are no output files, and skip building. |
| 589 | outs = [".config"], |
| 590 | build_config = "build.config.allmodconfig.aarch64", |
| 591 | visibility = ["//visibility:private"], |
| 592 | ) |
| 593 | |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 594 | # tools/bazel build --allow_undeclared_modules //common:kernel_x86_64_allmodconfig |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 595 | kernel_build( |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 596 | name = "kernel_x86_64_allmodconfig", |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 597 | # Hack to actually check the build. |
| 598 | # Otherwise, Bazel thinks that there are no output files, and skip building. |
| 599 | outs = [".config"], |
Ulises Mendez Martinez | 1f5a89e | 2023-06-27 18:19:15 +0000 | [diff] [blame] | 600 | arch = "x86_64", |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 601 | build_config = "build.config.allmodconfig.x86_64", |
| 602 | visibility = ["//visibility:private"], |
| 603 | ) |
| 604 | |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 605 | # tools/bazel build --allow_undeclared_modules //common:kernel_arm_allmodconfig |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 606 | kernel_build( |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 607 | name = "kernel_arm_allmodconfig", |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 608 | # Hack to actually check the build. |
| 609 | # Otherwise, Bazel thinks that there are no output files, and skip building. |
| 610 | outs = [".config"], |
Ulises Mendez Martinez | 1f5a89e | 2023-06-27 18:19:15 +0000 | [diff] [blame] | 611 | arch = "arm", |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 612 | build_config = "build.config.allmodconfig.arm", |
| 613 | visibility = ["//visibility:private"], |
| 614 | ) |
| 615 | |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 616 | # DDK Headers |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 617 | # All headers. These are the public targets for DDK modules to use. |
| 618 | alias( |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 619 | name = "all_headers", |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 620 | actual = "all_headers_aarch64", |
| 621 | visibility = ["//visibility:public"], |
| 622 | ) |
| 623 | |
| 624 | ddk_headers( |
| 625 | name = "all_headers_aarch64", |
| 626 | hdrs = [":all_headers_allowlist_aarch64"] + select({ |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 627 | "//build/kernel/kleaf:allow_ddk_unsafe_headers_set": [":all_headers_unsafe"], |
| 628 | "//conditions:default": [], |
| 629 | }), |
| 630 | visibility = ["//visibility:public"], |
| 631 | ) |
| 632 | |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 633 | ddk_headers( |
Yifan Hong | b5b9d44 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 634 | name = "all_headers_arm", |
| 635 | hdrs = [":all_headers_allowlist_arm"] + select({ |
| 636 | "//build/kernel/kleaf:allow_ddk_unsafe_headers_set": [":all_headers_unsafe"], |
| 637 | "//conditions:default": [], |
| 638 | }), |
| 639 | visibility = ["//visibility:public"], |
| 640 | ) |
| 641 | |
| 642 | ddk_headers( |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 643 | name = "all_headers_x86_64", |
| 644 | hdrs = [":all_headers_allowlist_x86_64"] + select({ |
| 645 | "//build/kernel/kleaf:allow_ddk_unsafe_headers_set": [":all_headers_unsafe"], |
| 646 | "//conditions:default": [], |
| 647 | }), |
| 648 | visibility = ["//visibility:public"], |
| 649 | ) |
| 650 | |
| 651 | # Implementation details for DDK headers. The targets below cannot be directly |
| 652 | # depended on by DDK modules. |
| 653 | |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 654 | # DDK headers allowlist. This is the list of all headers and include |
| 655 | # directories that are safe to use in DDK modules. |
| 656 | ddk_headers( |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 657 | name = "all_headers_allowlist_aarch64", |
| 658 | hdrs = [ |
| 659 | ":all_headers_allowlist_aarch64_globs", |
| 660 | ":all_headers_allowlist_common_globs", |
| 661 | ], |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 662 | # The list of include directories where source files can #include headers |
| 663 | # from. In other words, these are the `-I` option to the C compiler. |
Yifan Hong | 943d5a7 | 2022-11-03 16:12:31 -0700 | [diff] [blame] | 664 | # These are prepended to LINUXINCLUDE. |
| 665 | linux_includes = [ |
Yifan Hong | 14e14cc | 2022-10-21 20:19:28 -0700 | [diff] [blame] | 666 | "arch/arm64/include", |
| 667 | "arch/arm64/include/uapi", |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 668 | "include", |
| 669 | "include/uapi", |
| 670 | ], |
| 671 | visibility = ["//visibility:private"], |
| 672 | ) |
| 673 | |
| 674 | ddk_headers( |
Yifan Hong | b5b9d44 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 675 | name = "all_headers_allowlist_arm", |
| 676 | hdrs = [ |
| 677 | ":all_headers_allowlist_arm_globs", |
| 678 | ":all_headers_allowlist_common_globs", |
| 679 | ], |
| 680 | # The list of include directories where source files can #include headers |
| 681 | # from. In other words, these are the `-I` option to the C compiler. |
| 682 | # These are prepended to LINUXINCLUDE. |
| 683 | linux_includes = [ |
Yifan Hong | 6d03fcb | 2022-11-28 11:17:23 -0800 | [diff] [blame] | 684 | "arch/arm/include", |
| 685 | "arch/arm/include/uapi", |
Yifan Hong | b5b9d44 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 686 | "include", |
| 687 | "include/uapi", |
| 688 | ], |
| 689 | visibility = ["//visibility:private"], |
| 690 | ) |
| 691 | |
| 692 | ddk_headers( |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 693 | name = "all_headers_allowlist_x86_64", |
| 694 | hdrs = [ |
| 695 | ":all_headers_allowlist_common_globs", |
| 696 | ":all_headers_allowlist_x86_64_globs", |
| 697 | ], |
| 698 | # The list of include directories where source files can #include headers |
| 699 | # from. In other words, these are the `-I` option to the C compiler. |
Yifan Hong | 943d5a7 | 2022-11-03 16:12:31 -0700 | [diff] [blame] | 700 | # These are prepended to LINUXINCLUDE. |
| 701 | linux_includes = [ |
Yifan Hong | 3d56edf | 2022-10-21 23:07:21 -0700 | [diff] [blame] | 702 | "arch/x86/include", |
| 703 | "arch/x86/include/uapi", |
Yifan Hong | 14e14cc | 2022-10-21 20:19:28 -0700 | [diff] [blame] | 704 | "include", |
| 705 | "include/uapi", |
| 706 | ], |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 707 | visibility = ["//visibility:private"], |
| 708 | ) |
| 709 | |
| 710 | # List of DDK headers allowlist that are glob()-ed to avoid changes of BUILD |
| 711 | # file when the list of files changes. All headers in these directories |
| 712 | # are safe to use. |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 713 | # These are separate filegroup targets so the all_headers_allowlist_* are |
| 714 | # more friendly to batch BUILD file update tools like buildozer. |
| 715 | |
Yifan Hong | b5b9d44 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 716 | # globs() for arm only |
| 717 | filegroup( |
| 718 | name = "all_headers_allowlist_arm_globs", |
| 719 | srcs = glob(["arch/arm/include/**/*.h"]), |
| 720 | visibility = ["//visibility:private"], |
| 721 | ) |
| 722 | |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 723 | # globs() for arm64 only |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 724 | filegroup( |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 725 | name = "all_headers_allowlist_aarch64_globs", |
| 726 | srcs = glob(["arch/arm64/include/**/*.h"]), |
| 727 | visibility = ["//visibility:private"], |
| 728 | ) |
| 729 | |
| 730 | # globs() for x86 only |
| 731 | filegroup( |
| 732 | name = "all_headers_allowlist_x86_64_globs", |
| 733 | srcs = glob(["arch/x86/include/**/*.h"]), |
| 734 | visibility = ["//visibility:private"], |
| 735 | ) |
| 736 | |
| 737 | # globs() for all architectures |
| 738 | filegroup( |
| 739 | name = "all_headers_allowlist_common_globs", |
| 740 | srcs = glob(["include/**/*.h"]), |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 741 | visibility = ["//visibility:private"], |
| 742 | ) |
| 743 | |
| 744 | # DDK headers unsafe list. This is the list of all headers and include |
| 745 | # directories that may be used during migration from kernel_module's, but |
| 746 | # should be avoided in general. |
| 747 | # Use with caution; items may: |
| 748 | # - be removed without notice |
| 749 | # - be moved into all_headers |
| 750 | ddk_headers( |
| 751 | name = "all_headers_unsafe", |
Yifan Hong | 14e14cc | 2022-10-21 20:19:28 -0700 | [diff] [blame] | 752 | hdrs = [ |
| 753 | "drivers/devfreq/governor.h", |
| 754 | "drivers/dma-buf/heaps/deferred-free-helper.h", |
| 755 | "drivers/dma-buf/heaps/page_pool.h", |
| 756 | "drivers/dma/dmaengine.h", |
| 757 | "drivers/pci/controller/dwc/pcie-designware.h", |
| 758 | "drivers/pinctrl/core.h", |
| 759 | "drivers/pinctrl/samsung/pinctrl-samsung.h", |
| 760 | "drivers/staging/android/debug_kinfo.h", |
| 761 | "drivers/thermal/thermal_core.h", |
| 762 | "drivers/thermal/thermal_netlink.h", |
| 763 | "drivers/usb/core/phy.h", |
| 764 | "drivers/usb/dwc3/core.h", |
| 765 | "drivers/usb/dwc3/debug.h", |
| 766 | "drivers/usb/dwc3/gadget.h", |
| 767 | "drivers/usb/dwc3/io.h", |
| 768 | "drivers/usb/dwc3/trace.h", |
| 769 | "drivers/usb/gadget/configfs.h", |
| 770 | "drivers/usb/gadget/function/u_serial.h", |
| 771 | "drivers/usb/host/pci-quirks.h", |
| 772 | "drivers/usb/host/xhci.h", |
| 773 | "drivers/usb/host/xhci-ext-caps.h", |
| 774 | "drivers/usb/host/xhci-mvebu.h", |
| 775 | "drivers/usb/host/xhci-plat.h", |
| 776 | "drivers/usb/host/xhci-rcar.h", |
| 777 | "drivers/usb/typec/tcpm/tcpci.h", |
| 778 | ], |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 779 | # The list of include directories where source files can #include headers |
| 780 | # from. In other words, these are the `-I` option to the C compiler. |
Yifan Hong | 943d5a7 | 2022-11-03 16:12:31 -0700 | [diff] [blame] | 781 | # Unsafe include directories are appended to ccflags-y. |
Yifan Hong | 14e14cc | 2022-10-21 20:19:28 -0700 | [diff] [blame] | 782 | includes = [ |
| 783 | "drivers/devfreq", |
| 784 | "drivers/dma", |
| 785 | "drivers/dma-buf", |
| 786 | "drivers/pci/controller/dwc", |
| 787 | "drivers/pinctrl", |
| 788 | "drivers/scsi/ufs", |
| 789 | "drivers/thermal", |
| 790 | "drivers/usb", |
| 791 | "drivers/usb/gadget/function", |
| 792 | "drivers/usb/typec", |
| 793 | ], |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 794 | visibility = ["//visibility:private"], |
| 795 | ) |