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