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 |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 3 | load("//build/bazel_common_rules/dist:dist.bzl", "copy_to_dist_dir") |
| 4 | load("//build/kernel/kleaf:common_kernels.bzl", "define_common_kernels", "define_db845c") |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 5 | load( |
| 6 | "//build/kernel/kleaf:kernel.bzl", |
| 7 | "ddk_headers", |
| 8 | "kernel_abi", |
| 9 | "kernel_build", |
| 10 | "kernel_images", |
| 11 | "kernel_modules_install", |
| 12 | "kernel_unstripped_modules_archive", |
| 13 | ) |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 14 | load(":modules.bzl", "COMMON_GKI_MODULES_LIST") |
| 15 | |
Yifan Hong | 8cd9712 | 2021-11-02 16:26:49 -0700 | [diff] [blame] | 16 | package( |
| 17 | default_visibility = [ |
| 18 | "//visibility:public", |
| 19 | ], |
| 20 | ) |
Matthias Maennich | 3334b77 | 2021-06-21 12:54:56 +0100 | [diff] [blame] | 21 | |
Yifan Hong | b8323be | 2022-09-15 11:51:15 -0700 | [diff] [blame] | 22 | _aarch64_additional_kmi_symbol_lists = [ |
| 23 | # keep sorted |
| 24 | "android/abi_gki_aarch64_db845c", |
| 25 | "android/abi_gki_aarch64_exynos", |
Ulises Mendez Martinez | 3c5ab71 | 2023-02-24 12:51:01 +0000 | [diff] [blame] | 26 | "android/abi_gki_aarch64_fips140", |
Yifan Hong | b8323be | 2022-09-15 11:51:15 -0700 | [diff] [blame] | 27 | "android/abi_gki_aarch64_pixel", |
Ramji Jiyani | 7d08da2 | 2022-12-01 16:48:57 +0000 | [diff] [blame] | 28 | "android/abi_gki_aarch64_virtual_device", |
Yifan Hong | b8323be | 2022-09-15 11:51:15 -0700 | [diff] [blame] | 29 | ] |
| 30 | |
Ramji Jiyani | 2f72cfb | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 31 | define_common_kernels(target_configs = { |
| 32 | "kernel_aarch64": { |
Ramji Jiyani | b3cc8c8 | 2023-03-16 21:25:22 +0000 | [diff] [blame] | 33 | "kmi_symbol_list_strict_mode": True, |
Yifan Hong | 718c482 | 2022-11-15 15:32:17 -0800 | [diff] [blame] | 34 | "module_implicit_outs": COMMON_GKI_MODULES_LIST, |
Yifan Hong | b8323be | 2022-09-15 11:51:15 -0700 | [diff] [blame] | 35 | "kmi_symbol_list": "android/abi_gki_aarch64", |
| 36 | "additional_kmi_symbol_lists": _aarch64_additional_kmi_symbol_lists, |
Ramji Jiyani | 47819ed | 2023-03-21 22:49:31 +0000 | [diff] [blame^] | 37 | "protected_exports_list": "android/abi_gki_protected_exports_aarch64", |
| 38 | "protected_modules_list": "android/gki_aarch64_protected_modules", |
Ramji Jiyani | 2f72cfb | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 39 | }, |
Alistair Delva | 2f81119 | 2022-09-30 12:27:02 -0700 | [diff] [blame] | 40 | "kernel_aarch64_16k": { |
Aleksei Vetrov | d34386a | 2023-02-15 16:20:26 +0000 | [diff] [blame] | 41 | "kmi_symbol_list_strict_mode": False, |
Yifan Hong | 718c482 | 2022-11-15 15:32:17 -0800 | [diff] [blame] | 42 | "module_implicit_outs": COMMON_GKI_MODULES_LIST, |
Alistair Delva | 2f81119 | 2022-09-30 12:27:02 -0700 | [diff] [blame] | 43 | }, |
Ramji Jiyani | 2f72cfb | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 44 | "kernel_aarch64_debug": { |
Yifan Hong | 54fc960 | 2022-07-08 11:14:24 -0700 | [diff] [blame] | 45 | "kmi_symbol_list_strict_mode": False, |
Yifan Hong | 718c482 | 2022-11-15 15:32:17 -0800 | [diff] [blame] | 46 | "module_implicit_outs": COMMON_GKI_MODULES_LIST, |
Yifan Hong | b8323be | 2022-09-15 11:51:15 -0700 | [diff] [blame] | 47 | "kmi_symbol_list": "android/abi_gki_aarch64", |
| 48 | "additional_kmi_symbol_lists": _aarch64_additional_kmi_symbol_lists, |
Ramji Jiyani | 47819ed | 2023-03-21 22:49:31 +0000 | [diff] [blame^] | 49 | "protected_exports_list": "android/abi_gki_protected_exports_aarch64", |
| 50 | "protected_modules_list": "android/gki_aarch64_protected_modules", |
Ramji Jiyani | 2f72cfb | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 51 | }, |
Ramji Jiyani | 44e9b82 | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 52 | "kernel_x86_64": { |
| 53 | "kmi_symbol_list_strict_mode": False, |
Yifan Hong | 718c482 | 2022-11-15 15:32:17 -0800 | [diff] [blame] | 54 | "module_implicit_outs": COMMON_GKI_MODULES_LIST, |
Ramji Jiyani | 47819ed | 2023-03-21 22:49:31 +0000 | [diff] [blame^] | 55 | "protected_exports_list": "android/abi_gki_protected_exports_x86_64", |
| 56 | "protected_modules_list": "android/gki_x86_64_protected_modules", |
Ramji Jiyani | 44e9b82 | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 57 | }, |
Ramji Jiyani | 44e9b82 | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 58 | "kernel_x86_64_debug": { |
| 59 | "kmi_symbol_list_strict_mode": False, |
Yifan Hong | 718c482 | 2022-11-15 15:32:17 -0800 | [diff] [blame] | 60 | "module_implicit_outs": COMMON_GKI_MODULES_LIST, |
Ramji Jiyani | 47819ed | 2023-03-21 22:49:31 +0000 | [diff] [blame^] | 61 | "protected_exports_list": "android/abi_gki_protected_exports_x86_64", |
| 62 | "protected_modules_list": "android/gki_x86_64_protected_modules", |
Ramji Jiyani | 44e9b82 | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 63 | }, |
Ramji Jiyani | 2f72cfb | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 64 | }) |
Yifan Hong | 0af43f9 | 2022-05-12 14:42:33 -0700 | [diff] [blame] | 65 | |
Yifan Hong | 0af43f9 | 2022-05-12 14:42:33 -0700 | [diff] [blame] | 66 | define_db845c( |
| 67 | name = "db845c", |
Ulises Mendez Martinez | b856e6c | 2022-09-02 19:21:44 +0000 | [diff] [blame] | 68 | outs = [ |
Yifan Hong | 0af43f9 | 2022-05-12 14:42:33 -0700 | [diff] [blame] | 69 | "arch/arm64/boot/dts/qcom/qrb5165-rb5.dtb", |
| 70 | "arch/arm64/boot/dts/qcom/sdm845-db845c.dtb", |
| 71 | ], |
Yongqin Liu | 4a881d7 | 2022-11-25 14:29:48 +0800 | [diff] [blame] | 72 | define_abi_targets = True, |
| 73 | kmi_symbol_list = "//common:android/abi_gki_aarch64_db845c", |
| 74 | kmi_symbol_list_add_only = True, |
Yifan Hong | 0af43f9 | 2022-05-12 14:42:33 -0700 | [diff] [blame] | 75 | module_outs = [ |
| 76 | # keep sorted |
| 77 | "crypto/michael_mic.ko", |
| 78 | "drivers/base/regmap/regmap-sdw.ko", |
| 79 | "drivers/base/regmap/regmap-slimbus.ko", |
Yifan Hong | 0af43f9 | 2022-05-12 14:42:33 -0700 | [diff] [blame] | 80 | "drivers/bus/mhi/core/mhi.ko", |
| 81 | "drivers/clk/qcom/clk-qcom.ko", |
| 82 | "drivers/clk/qcom/clk-rpmh.ko", |
| 83 | "drivers/clk/qcom/clk-spmi-pmic-div.ko", |
| 84 | "drivers/clk/qcom/dispcc-sdm845.ko", |
| 85 | "drivers/clk/qcom/dispcc-sm8250.ko", |
| 86 | "drivers/clk/qcom/gcc-sdm845.ko", |
| 87 | "drivers/clk/qcom/gcc-sm8250.ko", |
| 88 | "drivers/clk/qcom/gpucc-sdm845.ko", |
| 89 | "drivers/clk/qcom/gpucc-sm8250.ko", |
| 90 | "drivers/clk/qcom/lpass-gfm-sm8250.ko", |
| 91 | "drivers/clk/qcom/videocc-sdm845.ko", |
| 92 | "drivers/clk/qcom/videocc-sm8250.ko", |
| 93 | "drivers/cpufreq/qcom-cpufreq-hw.ko", |
| 94 | "drivers/dma-buf/heaps/system_heap.ko", |
| 95 | "drivers/dma/qcom/bam_dma.ko", |
| 96 | "drivers/extcon/extcon-usb-gpio.ko", |
| 97 | "drivers/firmware/qcom-scm.ko", |
| 98 | "drivers/gpio/gpio-wcd934x.ko", |
| 99 | "drivers/gpu/drm/bridge/display-connector.ko", |
| 100 | "drivers/gpu/drm/bridge/lontium-lt9611.ko", |
| 101 | "drivers/gpu/drm/bridge/lontium-lt9611uxc.ko", |
| 102 | "drivers/gpu/drm/msm/msm.ko", |
| 103 | "drivers/gpu/drm/scheduler/gpu-sched.ko", |
| 104 | "drivers/hwspinlock/qcom_hwspinlock.ko", |
| 105 | "drivers/i2c/busses/i2c-designware-core.ko", |
| 106 | "drivers/i2c/busses/i2c-designware-platform.ko", |
| 107 | "drivers/i2c/busses/i2c-qcom-geni.ko", |
| 108 | "drivers/i2c/busses/i2c-qup.ko", |
| 109 | "drivers/i2c/busses/i2c-rk3x.ko", |
| 110 | "drivers/i2c/i2c-dev.ko", |
| 111 | "drivers/i2c/i2c-mux.ko", |
| 112 | "drivers/i2c/muxes/i2c-mux-pca954x.ko", |
| 113 | "drivers/iio/adc/qcom-spmi-adc5.ko", |
| 114 | "drivers/iio/adc/qcom-vadc-common.ko", |
| 115 | "drivers/input/misc/pm8941-pwrkey.ko", |
| 116 | "drivers/interconnect/qcom/icc-bcm-voter.ko", |
| 117 | "drivers/interconnect/qcom/icc-osm-l3.ko", |
| 118 | "drivers/interconnect/qcom/icc-rpmh.ko", |
| 119 | "drivers/interconnect/qcom/qnoc-sdm845.ko", |
| 120 | "drivers/interconnect/qcom/qnoc-sm8250.ko", |
| 121 | "drivers/iommu/arm/arm-smmu/arm_smmu.ko", |
| 122 | "drivers/irqchip/qcom-pdc.ko", |
| 123 | "drivers/leds/led-class-multicolor.ko", |
| 124 | "drivers/mailbox/qcom-apcs-ipc-mailbox.ko", |
| 125 | "drivers/mailbox/qcom-ipcc.ko", |
| 126 | "drivers/mfd/qcom-spmi-pmic.ko", |
| 127 | "drivers/mfd/wcd934x.ko", |
| 128 | "drivers/misc/fastrpc.ko", |
| 129 | "drivers/mmc/host/cqhci.ko", |
| 130 | "drivers/mmc/host/sdhci-msm.ko", |
| 131 | "drivers/net/can/spi/mcp251xfd/mcp251xfd.ko", |
| 132 | "drivers/net/wireless/ath/ath.ko", |
| 133 | "drivers/net/wireless/ath/ath10k/ath10k_core.ko", |
| 134 | "drivers/net/wireless/ath/ath10k/ath10k_pci.ko", |
| 135 | "drivers/net/wireless/ath/ath10k/ath10k_snoc.ko", |
| 136 | "drivers/net/wireless/ath/ath11k/ath11k.ko", |
| 137 | "drivers/net/wireless/ath/ath11k/ath11k_ahb.ko", |
| 138 | "drivers/net/wireless/ath/ath11k/ath11k_pci.ko", |
| 139 | "drivers/nvmem/nvmem_qfprom.ko", |
| 140 | "drivers/phy/qualcomm/phy-qcom-qmp.ko", |
| 141 | "drivers/phy/qualcomm/phy-qcom-qusb2.ko", |
| 142 | "drivers/phy/qualcomm/phy-qcom-snps-femto-v2.ko", |
| 143 | "drivers/phy/qualcomm/phy-qcom-usb-hs.ko", |
| 144 | "drivers/pinctrl/qcom/pinctrl-lpass-lpi.ko", |
| 145 | "drivers/pinctrl/qcom/pinctrl-msm.ko", |
| 146 | "drivers/pinctrl/qcom/pinctrl-sdm845.ko", |
| 147 | "drivers/pinctrl/qcom/pinctrl-sm8250.ko", |
| 148 | "drivers/pinctrl/qcom/pinctrl-spmi-gpio.ko", |
| 149 | "drivers/pinctrl/qcom/pinctrl-spmi-mpp.ko", |
| 150 | "drivers/power/reset/qcom-pon.ko", |
| 151 | "drivers/power/reset/reboot-mode.ko", |
| 152 | "drivers/power/reset/syscon-reboot-mode.ko", |
| 153 | "drivers/regulator/gpio-regulator.ko", |
| 154 | "drivers/regulator/qcom-rpmh-regulator.ko", |
| 155 | "drivers/regulator/qcom_spmi-regulator.ko", |
| 156 | "drivers/regulator/qcom_usb_vbus-regulator.ko", |
| 157 | "drivers/remoteproc/qcom_common.ko", |
| 158 | "drivers/remoteproc/qcom_pil_info.ko", |
| 159 | "drivers/remoteproc/qcom_q6v5.ko", |
| 160 | "drivers/remoteproc/qcom_q6v5_adsp.ko", |
| 161 | "drivers/remoteproc/qcom_q6v5_mss.ko", |
| 162 | "drivers/remoteproc/qcom_q6v5_pas.ko", |
| 163 | "drivers/remoteproc/qcom_q6v5_wcss.ko", |
| 164 | "drivers/remoteproc/qcom_sysmon.ko", |
| 165 | "drivers/reset/reset-qcom-aoss.ko", |
| 166 | "drivers/reset/reset-qcom-pdc.ko", |
| 167 | "drivers/rpmsg/qcom_glink.ko", |
| 168 | "drivers/rpmsg/qcom_glink_rpm.ko", |
| 169 | "drivers/rpmsg/qcom_glink_smem.ko", |
| 170 | "drivers/rpmsg/qcom_smd.ko", |
| 171 | "drivers/rpmsg/rpmsg_ns.ko", |
| 172 | "drivers/rtc/rtc-pm8xxx.ko", |
Yifan Hong | 0af43f9 | 2022-05-12 14:42:33 -0700 | [diff] [blame] | 173 | "drivers/slimbus/slim-qcom-ngd-ctrl.ko", |
| 174 | "drivers/slimbus/slimbus.ko", |
| 175 | "drivers/soc/qcom/apr.ko", |
| 176 | "drivers/soc/qcom/cmd-db.ko", |
| 177 | "drivers/soc/qcom/llcc-qcom.ko", |
| 178 | "drivers/soc/qcom/mdt_loader.ko", |
| 179 | "drivers/soc/qcom/pdr_interface.ko", |
| 180 | "drivers/soc/qcom/qcom_aoss.ko", |
| 181 | "drivers/soc/qcom/qcom_rpmh.ko", |
| 182 | "drivers/soc/qcom/qmi_helpers.ko", |
| 183 | "drivers/soc/qcom/rmtfs_mem.ko", |
| 184 | "drivers/soc/qcom/rpmhpd.ko", |
| 185 | "drivers/soc/qcom/smem.ko", |
| 186 | "drivers/soc/qcom/smp2p.ko", |
| 187 | "drivers/soc/qcom/smsm.ko", |
| 188 | "drivers/soc/qcom/socinfo.ko", |
| 189 | "drivers/soundwire/soundwire-bus.ko", |
| 190 | "drivers/soundwire/soundwire-qcom.ko", |
| 191 | "drivers/spi/spi-geni-qcom.ko", |
| 192 | "drivers/spi/spi-pl022.ko", |
| 193 | "drivers/spi/spi-qcom-qspi.ko", |
| 194 | "drivers/spi/spi-qup.ko", |
| 195 | "drivers/spmi/spmi-pmic-arb.ko", |
| 196 | "drivers/thermal/qcom/lmh.ko", |
| 197 | "drivers/thermal/qcom/qcom-spmi-adc-tm5.ko", |
| 198 | "drivers/thermal/qcom/qcom-spmi-temp-alarm.ko", |
| 199 | "drivers/thermal/qcom/qcom_tsens.ko", |
| 200 | "drivers/tty/serial/msm_serial.ko", |
Yifan Hong | c0ef669 | 2022-07-08 11:18:51 -0700 | [diff] [blame] | 201 | "drivers/ufs/host/ufs_qcom.ko", |
Yifan Hong | 0af43f9 | 2022-05-12 14:42:33 -0700 | [diff] [blame] | 202 | "drivers/usb/common/ulpi.ko", |
| 203 | "drivers/usb/host/ohci-hcd.ko", |
| 204 | "drivers/usb/host/ohci-pci.ko", |
| 205 | "drivers/usb/host/ohci-platform.ko", |
| 206 | "drivers/usb/typec/qcom-pmic-typec.ko", |
| 207 | "drivers/watchdog/pm8916_wdt.ko", |
| 208 | "drivers/watchdog/qcom-wdt.ko", |
| 209 | "net/qrtr/ns.ko", |
| 210 | "net/qrtr/qrtr.ko", |
| 211 | "net/qrtr/qrtr-mhi.ko", |
| 212 | "net/qrtr/qrtr-smd.ko", |
| 213 | "net/qrtr/qrtr-tun.ko", |
| 214 | "sound/soc/codecs/snd-soc-dmic.ko", |
| 215 | "sound/soc/codecs/snd-soc-hdmi-codec.ko", |
| 216 | "sound/soc/codecs/snd-soc-lpass-va-macro.ko", |
| 217 | "sound/soc/codecs/snd-soc-lpass-wsa-macro.ko", |
| 218 | "sound/soc/codecs/snd-soc-max98927.ko", |
| 219 | "sound/soc/codecs/snd-soc-rl6231.ko", |
| 220 | "sound/soc/codecs/snd-soc-rt5663.ko", |
| 221 | "sound/soc/codecs/snd-soc-wcd-mbhc.ko", |
| 222 | "sound/soc/codecs/snd-soc-wcd9335.ko", |
| 223 | "sound/soc/codecs/snd-soc-wcd934x.ko", |
| 224 | "sound/soc/codecs/snd-soc-wsa881x.ko", |
| 225 | "sound/soc/qcom/qdsp6/q6adm.ko", |
| 226 | "sound/soc/qcom/qdsp6/q6afe.ko", |
| 227 | "sound/soc/qcom/qdsp6/q6afe-clocks.ko", |
| 228 | "sound/soc/qcom/qdsp6/q6afe-dai.ko", |
| 229 | "sound/soc/qcom/qdsp6/q6asm.ko", |
| 230 | "sound/soc/qcom/qdsp6/q6asm-dai.ko", |
| 231 | "sound/soc/qcom/qdsp6/q6core.ko", |
| 232 | "sound/soc/qcom/qdsp6/q6dsp-common.ko", |
| 233 | "sound/soc/qcom/qdsp6/q6routing.ko", |
| 234 | "sound/soc/qcom/snd-soc-qcom-common.ko", |
| 235 | "sound/soc/qcom/snd-soc-sdm845.ko", |
| 236 | "sound/soc/qcom/snd-soc-sm8250.ko", |
| 237 | ], |
| 238 | ) |
Yifan Hong | b0f8873 | 2022-09-08 17:15:54 -0700 | [diff] [blame] | 239 | |
Yifan Hong | 023b893 | 2022-11-22 23:43:51 +0000 | [diff] [blame] | 240 | # TODO(b/258259749): Convert rockpi4 to mixed build |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 241 | kernel_build( |
| 242 | name = "rockpi4", |
| 243 | outs = [ |
Yifan Hong | 023b893 | 2022-11-22 23:43:51 +0000 | [diff] [blame] | 244 | "Image", |
| 245 | "System.map", |
| 246 | "modules.builtin", |
| 247 | "modules.builtin.modinfo", |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 248 | "rk3399-rock-pi-4b.dtb", |
Yifan Hong | 023b893 | 2022-11-22 23:43:51 +0000 | [diff] [blame] | 249 | "vmlinux", |
| 250 | "vmlinux.symvers", |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 251 | ], |
| 252 | build_config = "build.config.rockpi4", |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 253 | collect_unstripped_modules = True, |
| 254 | kmi_symbol_list = "//common:android/abi_gki_rockpi4", |
Yifan Hong | 023b893 | 2022-11-22 23:43:51 +0000 | [diff] [blame] | 255 | module_outs = COMMON_GKI_MODULES_LIST + [ |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 256 | # keep sorted |
| 257 | "drivers/block/virtio_blk.ko", |
| 258 | "drivers/char/hw_random/virtio-rng.ko", |
| 259 | "drivers/clk/clk-rk808.ko", |
| 260 | "drivers/cpufreq/cpufreq-dt.ko", |
| 261 | "drivers/dma/pl330.ko", |
| 262 | "drivers/gpu/drm/bridge/analogix/analogix_dp.ko", |
| 263 | "drivers/gpu/drm/bridge/synopsys/dw-hdmi.ko", |
| 264 | "drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.ko", |
| 265 | "drivers/gpu/drm/rockchip/rockchipdrm.ko", |
| 266 | "drivers/i2c/busses/i2c-rk3x.ko", |
| 267 | "drivers/iio/adc/rockchip_saradc.ko", |
| 268 | "drivers/iio/buffer/industrialio-triggered-buffer.ko", |
| 269 | "drivers/iio/buffer/kfifo_buf.ko", |
| 270 | "drivers/mfd/rk808.ko", |
| 271 | "drivers/mmc/core/pwrseq_simple.ko", |
| 272 | "drivers/mmc/host/cqhci.ko", |
| 273 | "drivers/mmc/host/dw_mmc.ko", |
| 274 | "drivers/mmc/host/dw_mmc-pltfm.ko", |
| 275 | "drivers/mmc/host/dw_mmc-rockchip.ko", |
| 276 | "drivers/mmc/host/sdhci-of-arasan.ko", |
| 277 | "drivers/net/ethernet/stmicro/stmmac/dwmac-rk.ko", |
| 278 | "drivers/net/ethernet/stmicro/stmmac/stmmac.ko", |
| 279 | "drivers/net/ethernet/stmicro/stmmac/stmmac-platform.ko", |
| 280 | "drivers/net/net_failover.ko", |
| 281 | "drivers/net/pcs/pcs_xpcs.ko", |
| 282 | "drivers/net/virtio_net.ko", |
| 283 | "drivers/nvmem/nvmem_rockchip_efuse.ko", |
| 284 | "drivers/pci/controller/pcie-rockchip-host.ko", |
| 285 | "drivers/phy/rockchip/phy-rockchip-emmc.ko", |
| 286 | "drivers/phy/rockchip/phy-rockchip-inno-usb2.ko", |
| 287 | "drivers/phy/rockchip/phy-rockchip-pcie.ko", |
| 288 | "drivers/phy/rockchip/phy-rockchip-typec.ko", |
| 289 | "drivers/pwm/pwm-rockchip.ko", |
| 290 | "drivers/regulator/fan53555.ko", |
| 291 | "drivers/regulator/pwm-regulator.ko", |
| 292 | "drivers/regulator/rk808-regulator.ko", |
| 293 | "drivers/rtc/rtc-rk808.ko", |
| 294 | "drivers/soc/rockchip/io-domain.ko", |
| 295 | "drivers/thermal/rockchip_thermal.ko", |
| 296 | "drivers/usb/host/ohci-hcd.ko", |
| 297 | "drivers/usb/host/ohci-platform.ko", |
| 298 | "drivers/virtio/virtio_pci.ko", |
| 299 | "drivers/virtio/virtio_pci_modern_dev.ko", |
| 300 | "drivers/watchdog/dw_wdt.ko", |
| 301 | "net/core/failover.ko", |
| 302 | ], |
| 303 | ) |
| 304 | |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 305 | kernel_abi( |
| 306 | name = "rockpi4_abi", |
| 307 | kernel_build = "//common:rockpi4", |
| 308 | kmi_symbol_list_add_only = True, |
| 309 | ) |
| 310 | |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 311 | kernel_modules_install( |
| 312 | name = "rockpi4_modules_install", |
| 313 | kernel_build = "//common:rockpi4", |
| 314 | ) |
| 315 | |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 316 | kernel_unstripped_modules_archive( |
| 317 | name = "rockpi4_unstripped_modules_archive", |
| 318 | kernel_build = ":rockpi4", |
| 319 | ) |
| 320 | |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 321 | kernel_images( |
| 322 | name = "rockpi4_images", |
| 323 | build_initramfs = True, |
| 324 | kernel_build = "//common:rockpi4", |
| 325 | kernel_modules_install = "//common:rockpi4_modules_install", |
| 326 | ) |
| 327 | |
| 328 | copy_to_dist_dir( |
| 329 | name = "rockpi4_dist", |
| 330 | data = [ |
| 331 | ":rockpi4", |
| 332 | ":rockpi4_images", |
| 333 | ":rockpi4_modules_install", |
Ulises Mendez Martinez | 24886bc4 | 2022-12-14 19:28:55 +0000 | [diff] [blame] | 334 | ":rockpi4_unstripped_modules_archive", |
Yifan Hong | 880ad59 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 335 | ], |
| 336 | dist_dir = "out/rockpi4/dist", |
| 337 | flat = True, |
| 338 | ) |
| 339 | |
Yifan Hong | b0f8873 | 2022-09-08 17:15:54 -0700 | [diff] [blame] | 340 | kernel_build( |
| 341 | name = "fips140", |
| 342 | outs = [], |
| 343 | base_kernel = ":kernel_aarch64", |
| 344 | build_config = "build.config.gki.aarch64.fips140", |
Ulises Mendez Martinez | 3c5ab71 | 2023-02-24 12:51:01 +0000 | [diff] [blame] | 345 | kmi_symbol_list = "//common:android/abi_gki_aarch64_fips140", |
Yifan Hong | b0f8873 | 2022-09-08 17:15:54 -0700 | [diff] [blame] | 346 | module_outs = ["crypto/fips140.ko"], |
| 347 | ) |
| 348 | |
Ulises Mendez Martinez | 3c5ab71 | 2023-02-24 12:51:01 +0000 | [diff] [blame] | 349 | kernel_abi( |
| 350 | name = "fips140_abi", |
| 351 | kernel_build = "//common:fips140", |
| 352 | kmi_symbol_list_add_only = True, |
| 353 | ) |
| 354 | |
Yifan Hong | b0f8873 | 2022-09-08 17:15:54 -0700 | [diff] [blame] | 355 | copy_to_dist_dir( |
| 356 | name = "fips140_dist", |
| 357 | data = [ |
| 358 | ":fips140", |
| 359 | ], |
| 360 | dist_dir = "out/fips140/dist", |
| 361 | flat = True, |
| 362 | ) |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 363 | |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 364 | # allmodconfig build tests. |
| 365 | # These are build tests only, so: |
| 366 | # - outs are intentionally set to empty to not copy anything to DIST_DIR |
| 367 | # - --allow-undeclared-modules must be used so modules are not declared or copied. |
| 368 | # - No dist target because these are build tests. We don't care about the artifacts. |
| 369 | |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 370 | # tools/bazel build --allow_undeclared_modules //common:kernel_aarch64_allmodconfig |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 371 | kernel_build( |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 372 | name = "kernel_aarch64_allmodconfig", |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 373 | # Hack to actually check the build. |
| 374 | # Otherwise, Bazel thinks that there are no output files, and skip building. |
| 375 | outs = [".config"], |
| 376 | build_config = "build.config.allmodconfig.aarch64", |
| 377 | visibility = ["//visibility:private"], |
| 378 | ) |
| 379 | |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 380 | # tools/bazel build --allow_undeclared_modules //common:kernel_x86_64_allmodconfig |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 381 | kernel_build( |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 382 | name = "kernel_x86_64_allmodconfig", |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 383 | # Hack to actually check the build. |
| 384 | # Otherwise, Bazel thinks that there are no output files, and skip building. |
| 385 | outs = [".config"], |
| 386 | build_config = "build.config.allmodconfig.x86_64", |
| 387 | visibility = ["//visibility:private"], |
| 388 | ) |
| 389 | |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 390 | # tools/bazel build --allow_undeclared_modules //common:kernel_arm_allmodconfig |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 391 | kernel_build( |
Ulises Mendez Martinez | 3a954f9 | 2022-11-24 11:46:54 +0000 | [diff] [blame] | 392 | name = "kernel_arm_allmodconfig", |
Yifan Hong | ce3c550c | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 393 | # Hack to actually check the build. |
| 394 | # Otherwise, Bazel thinks that there are no output files, and skip building. |
| 395 | outs = [".config"], |
| 396 | build_config = "build.config.allmodconfig.arm", |
| 397 | visibility = ["//visibility:private"], |
| 398 | ) |
| 399 | |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 400 | # DDK Headers |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 401 | # All headers. These are the public targets for DDK modules to use. |
| 402 | alias( |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 403 | name = "all_headers", |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 404 | actual = "all_headers_aarch64", |
| 405 | visibility = ["//visibility:public"], |
| 406 | ) |
| 407 | |
| 408 | ddk_headers( |
| 409 | name = "all_headers_aarch64", |
| 410 | hdrs = [":all_headers_allowlist_aarch64"] + select({ |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 411 | "//build/kernel/kleaf:allow_ddk_unsafe_headers_set": [":all_headers_unsafe"], |
| 412 | "//conditions:default": [], |
| 413 | }), |
| 414 | visibility = ["//visibility:public"], |
| 415 | ) |
| 416 | |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 417 | ddk_headers( |
Yifan Hong | b5b9d44 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 418 | name = "all_headers_arm", |
| 419 | hdrs = [":all_headers_allowlist_arm"] + select({ |
| 420 | "//build/kernel/kleaf:allow_ddk_unsafe_headers_set": [":all_headers_unsafe"], |
| 421 | "//conditions:default": [], |
| 422 | }), |
| 423 | visibility = ["//visibility:public"], |
| 424 | ) |
| 425 | |
| 426 | ddk_headers( |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 427 | name = "all_headers_x86_64", |
| 428 | hdrs = [":all_headers_allowlist_x86_64"] + select({ |
| 429 | "//build/kernel/kleaf:allow_ddk_unsafe_headers_set": [":all_headers_unsafe"], |
| 430 | "//conditions:default": [], |
| 431 | }), |
| 432 | visibility = ["//visibility:public"], |
| 433 | ) |
| 434 | |
| 435 | # Implementation details for DDK headers. The targets below cannot be directly |
| 436 | # depended on by DDK modules. |
| 437 | |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 438 | # DDK headers allowlist. This is the list of all headers and include |
| 439 | # directories that are safe to use in DDK modules. |
| 440 | ddk_headers( |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 441 | name = "all_headers_allowlist_aarch64", |
| 442 | hdrs = [ |
| 443 | ":all_headers_allowlist_aarch64_globs", |
| 444 | ":all_headers_allowlist_common_globs", |
| 445 | ], |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 446 | # The list of include directories where source files can #include headers |
| 447 | # 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] | 448 | # These are prepended to LINUXINCLUDE. |
| 449 | linux_includes = [ |
Yifan Hong | 14e14cc | 2022-10-21 20:19:28 -0700 | [diff] [blame] | 450 | "arch/arm64/include", |
| 451 | "arch/arm64/include/uapi", |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 452 | "include", |
| 453 | "include/uapi", |
| 454 | ], |
| 455 | visibility = ["//visibility:private"], |
| 456 | ) |
| 457 | |
| 458 | ddk_headers( |
Yifan Hong | b5b9d44 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 459 | name = "all_headers_allowlist_arm", |
| 460 | hdrs = [ |
| 461 | ":all_headers_allowlist_arm_globs", |
| 462 | ":all_headers_allowlist_common_globs", |
| 463 | ], |
| 464 | # The list of include directories where source files can #include headers |
| 465 | # from. In other words, these are the `-I` option to the C compiler. |
| 466 | # These are prepended to LINUXINCLUDE. |
| 467 | linux_includes = [ |
Yifan Hong | 6d03fcb | 2022-11-28 11:17:23 -0800 | [diff] [blame] | 468 | "arch/arm/include", |
| 469 | "arch/arm/include/uapi", |
Yifan Hong | b5b9d44 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 470 | "include", |
| 471 | "include/uapi", |
| 472 | ], |
| 473 | visibility = ["//visibility:private"], |
| 474 | ) |
| 475 | |
| 476 | ddk_headers( |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 477 | name = "all_headers_allowlist_x86_64", |
| 478 | hdrs = [ |
| 479 | ":all_headers_allowlist_common_globs", |
| 480 | ":all_headers_allowlist_x86_64_globs", |
| 481 | ], |
| 482 | # The list of include directories where source files can #include headers |
| 483 | # 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] | 484 | # These are prepended to LINUXINCLUDE. |
| 485 | linux_includes = [ |
Yifan Hong | 3d56edf | 2022-10-21 23:07:21 -0700 | [diff] [blame] | 486 | "arch/x86/include", |
| 487 | "arch/x86/include/uapi", |
Yifan Hong | 14e14cc | 2022-10-21 20:19:28 -0700 | [diff] [blame] | 488 | "include", |
| 489 | "include/uapi", |
| 490 | ], |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 491 | visibility = ["//visibility:private"], |
| 492 | ) |
| 493 | |
| 494 | # List of DDK headers allowlist that are glob()-ed to avoid changes of BUILD |
| 495 | # file when the list of files changes. All headers in these directories |
| 496 | # are safe to use. |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 497 | # These are separate filegroup targets so the all_headers_allowlist_* are |
| 498 | # more friendly to batch BUILD file update tools like buildozer. |
| 499 | |
Yifan Hong | b5b9d44 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 500 | # globs() for arm only |
| 501 | filegroup( |
| 502 | name = "all_headers_allowlist_arm_globs", |
| 503 | srcs = glob(["arch/arm/include/**/*.h"]), |
| 504 | visibility = ["//visibility:private"], |
| 505 | ) |
| 506 | |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 507 | # globs() for arm64 only |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 508 | filegroup( |
Yifan Hong | 366ac32 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 509 | name = "all_headers_allowlist_aarch64_globs", |
| 510 | srcs = glob(["arch/arm64/include/**/*.h"]), |
| 511 | visibility = ["//visibility:private"], |
| 512 | ) |
| 513 | |
| 514 | # globs() for x86 only |
| 515 | filegroup( |
| 516 | name = "all_headers_allowlist_x86_64_globs", |
| 517 | srcs = glob(["arch/x86/include/**/*.h"]), |
| 518 | visibility = ["//visibility:private"], |
| 519 | ) |
| 520 | |
| 521 | # globs() for all architectures |
| 522 | filegroup( |
| 523 | name = "all_headers_allowlist_common_globs", |
| 524 | srcs = glob(["include/**/*.h"]), |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 525 | visibility = ["//visibility:private"], |
| 526 | ) |
| 527 | |
| 528 | # DDK headers unsafe list. This is the list of all headers and include |
| 529 | # directories that may be used during migration from kernel_module's, but |
| 530 | # should be avoided in general. |
| 531 | # Use with caution; items may: |
| 532 | # - be removed without notice |
| 533 | # - be moved into all_headers |
| 534 | ddk_headers( |
| 535 | name = "all_headers_unsafe", |
Yifan Hong | 14e14cc | 2022-10-21 20:19:28 -0700 | [diff] [blame] | 536 | hdrs = [ |
| 537 | "drivers/devfreq/governor.h", |
| 538 | "drivers/dma-buf/heaps/deferred-free-helper.h", |
| 539 | "drivers/dma-buf/heaps/page_pool.h", |
| 540 | "drivers/dma/dmaengine.h", |
| 541 | "drivers/pci/controller/dwc/pcie-designware.h", |
| 542 | "drivers/pinctrl/core.h", |
| 543 | "drivers/pinctrl/samsung/pinctrl-samsung.h", |
| 544 | "drivers/staging/android/debug_kinfo.h", |
| 545 | "drivers/thermal/thermal_core.h", |
| 546 | "drivers/thermal/thermal_netlink.h", |
| 547 | "drivers/usb/core/phy.h", |
| 548 | "drivers/usb/dwc3/core.h", |
| 549 | "drivers/usb/dwc3/debug.h", |
| 550 | "drivers/usb/dwc3/gadget.h", |
| 551 | "drivers/usb/dwc3/io.h", |
| 552 | "drivers/usb/dwc3/trace.h", |
| 553 | "drivers/usb/gadget/configfs.h", |
| 554 | "drivers/usb/gadget/function/u_serial.h", |
| 555 | "drivers/usb/host/pci-quirks.h", |
| 556 | "drivers/usb/host/xhci.h", |
| 557 | "drivers/usb/host/xhci-ext-caps.h", |
| 558 | "drivers/usb/host/xhci-mvebu.h", |
| 559 | "drivers/usb/host/xhci-plat.h", |
| 560 | "drivers/usb/host/xhci-rcar.h", |
| 561 | "drivers/usb/typec/tcpm/tcpci.h", |
| 562 | ], |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 563 | # The list of include directories where source files can #include headers |
| 564 | # 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] | 565 | # Unsafe include directories are appended to ccflags-y. |
Yifan Hong | 14e14cc | 2022-10-21 20:19:28 -0700 | [diff] [blame] | 566 | includes = [ |
| 567 | "drivers/devfreq", |
| 568 | "drivers/dma", |
| 569 | "drivers/dma-buf", |
| 570 | "drivers/pci/controller/dwc", |
| 571 | "drivers/pinctrl", |
| 572 | "drivers/scsi/ufs", |
| 573 | "drivers/thermal", |
| 574 | "drivers/usb", |
| 575 | "drivers/usb/gadget/function", |
| 576 | "drivers/usb/typec", |
| 577 | ], |
Yifan Hong | ede1fd3 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 578 | visibility = ["//visibility:private"], |
| 579 | ) |