| Yifan Hong | f5f041c | 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 | f5f041c | 2022-11-22 22:18:04 -0800 | [diff] [blame] | 3 | |
| Yifan Hong | 64e4b4d | 2023-06-16 17:05:00 -0700 | [diff] [blame] | 4 | load("@bazel_skylib//rules:write_file.bzl", "write_file") |
| Ulises Mendez Martinez | 75c1d99 | 2022-11-24 12:00:01 +0000 | [diff] [blame] | 5 | load("//build/bazel_common_rules/dist:dist.bzl", "copy_to_dist_dir") |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 6 | load("//build/kernel/kleaf:common_kernels.bzl", "define_common_kernels") |
| Jiyong Park | ae5ea90 | 2023-09-25 10:02:14 +0900 | [diff] [blame] | 7 | load("//build/kernel/kleaf:constants.bzl", "X86_64_OUTS") |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 8 | load( |
| 9 | "//build/kernel/kleaf:kernel.bzl", |
| Yifan Hong | 37f45094 | 2023-08-08 13:50:56 -0700 | [diff] [blame] | 10 | "checkpatch", |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 11 | "ddk_headers", |
| 12 | "kernel_abi", |
| 13 | "kernel_build", |
| 14 | "kernel_images", |
| 15 | "kernel_modules_install", |
| 16 | "merged_kernel_uapi_headers", |
| 17 | ) |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 18 | load(":modules.bzl", "get_gki_modules_list") |
| Ulises Mendez Martinez | 75c1d99 | 2022-11-24 12:00:01 +0000 | [diff] [blame] | 19 | |
| Yifan Hong | 2eefbec | 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 | 119cead | 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_RISCV64_MAKE_GOALS = [ |
| 34 | "Image", |
| 35 | "Image.lz4", |
| 36 | "Image.gz", |
| 37 | "modules", |
| 38 | ] |
| 39 | |
| 40 | _GKI_X86_64_MAKE_GOALS = [ |
| 41 | "bzImage", |
| 42 | "modules", |
| 43 | ] |
| 44 | |
| Yifan Hong | 37f45094 | 2023-08-08 13:50:56 -0700 | [diff] [blame] | 45 | checkpatch( |
| 46 | name = "checkpatch", |
| 47 | checkpatch_pl = "scripts/checkpatch.pl", |
| 48 | ) |
| 49 | |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 50 | # Deprecated - Use arch specific files from below. |
| Ulises Mendez Martinez | e44e395 | 2023-08-10 13:39:15 +0000 | [diff] [blame] | 51 | alias( |
| Yifan Hong | 64e4b4d | 2023-06-16 17:05:00 -0700 | [diff] [blame] | 52 | name = "gki_system_dlkm_modules", |
| Ulises Mendez Martinez | e44e395 | 2023-08-10 13:39:15 +0000 | [diff] [blame] | 53 | actual = "gki_system_dlkm_modules_arm64", |
| 54 | deprecation = """ |
| 55 | Common list for all architectures is deprecated. |
| 56 | Instead use the file corresponding to the architecture used: |
| 57 | i.e. `gki_system_dlkm_modules_{arch}` |
| 58 | """, |
| 59 | ) |
| 60 | |
| 61 | alias( |
| 62 | name = "android/gki_system_dlkm_modules", |
| 63 | actual = "android/gki_system_dlkm_modules_arm64", |
| 64 | deprecation = """ |
| 65 | Common list for all architectures is deprecated. |
| 66 | Instead use the file corresponding to the architecture used: |
| 67 | i.e. `gki_system_dlkm_modules_{arch}` |
| 68 | """, |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 69 | ) |
| 70 | |
| 71 | write_file( |
| 72 | name = "gki_system_dlkm_modules_arm64", |
| 73 | out = "android/gki_system_dlkm_modules_arm64", |
| 74 | content = get_gki_modules_list("arm64") + [ |
| 75 | # Ensure new line at the end. |
| 76 | "", |
| 77 | ], |
| 78 | ) |
| 79 | |
| 80 | write_file( |
| 81 | name = "gki_system_dlkm_modules_x86_64", |
| 82 | out = "android/gki_system_dlkm_modules_x86_64", |
| 83 | content = get_gki_modules_list("x86_64") + [ |
| 84 | # Ensure new line at the end. |
| 85 | "", |
| 86 | ], |
| 87 | ) |
| 88 | |
| 89 | write_file( |
| 90 | name = "gki_system_dlkm_modules_risc64", |
| 91 | out = "android/gki_system_dlkm_modules_riscv64", |
| 92 | content = get_gki_modules_list("riscv64") + [ |
| Yifan Hong | 64e4b4d | 2023-06-16 17:05:00 -0700 | [diff] [blame] | 93 | # Ensure new line at the end. |
| 94 | "", |
| 95 | ], |
| 96 | ) |
| 97 | |
| Junki Min | 4754c56 | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 98 | filegroup( |
| 99 | name = "aarch64_additional_kmi_symbol_lists", |
| 100 | srcs = [ |
| 101 | # keep sorted |
| Rishi Sikka | 773ad7ab | 2025-01-28 04:27:15 +0000 | [diff] [blame] | 102 | "android/abi_gki_aarch64_arg", |
| meitaogao | a0b3b39 | 2024-01-29 16:56:44 +0800 | [diff] [blame] | 103 | "android/abi_gki_aarch64_asr", |
| steve2_yang | 215e38e | 2023-09-13 18:43:57 +0800 | [diff] [blame] | 104 | "android/abi_gki_aarch64_asus", |
| Pierre Couillaud | ac97064 | 2024-05-09 07:30:53 -0700 | [diff] [blame] | 105 | "android/abi_gki_aarch64_bcmstb", |
| Junki Min | 4754c56 | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 106 | "android/abi_gki_aarch64_db845c", |
| Junki Min | d88ab88 | 2023-04-19 15:03:19 +0900 | [diff] [blame] | 107 | "android/abi_gki_aarch64_exynos", |
| Bumyong Lee | 1b7f110 | 2023-07-14 14:40:47 +0900 | [diff] [blame] | 108 | "android/abi_gki_aarch64_exynosauto", |
| Eric Biggers | e61a6ec | 2024-02-29 01:26:25 +0000 | [diff] [blame] | 109 | "android/abi_gki_aarch64_fips140", |
| Junki Min | 4754c56 | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 110 | "android/abi_gki_aarch64_galaxy", |
| Norihiko Hama | 66a20ed | 2024-01-06 14:20:56 +0900 | [diff] [blame] | 111 | "android/abi_gki_aarch64_honda", |
| Dezhi Huang | cab47c8 | 2023-05-17 15:13:45 +0800 | [diff] [blame] | 112 | "android/abi_gki_aarch64_honor", |
| Zhipeng Wang | 710a5d9 | 2023-04-11 14:03:40 +0000 | [diff] [blame] | 113 | "android/abi_gki_aarch64_imx", |
| luoyongjie | 1fb9e95 | 2023-09-05 11:27:10 +0800 | [diff] [blame] | 114 | "android/abi_gki_aarch64_meizu", |
| Xiaojun Ji | d68f68a | 2023-07-28 11:21:50 +0800 | [diff] [blame] | 115 | "android/abi_gki_aarch64_moto", |
| Chun-Hung Wu | 24c3982 | 2023-04-07 15:48:38 +0800 | [diff] [blame] | 116 | "android/abi_gki_aarch64_mtk", |
| Dylan Chang | 21c71a7 | 2024-01-22 11:23:20 +0800 | [diff] [blame] | 117 | "android/abi_gki_aarch64_nothing", |
| Junki Min | 4754c56 | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 118 | "android/abi_gki_aarch64_oplus", |
| Konstantin Komarov | ef4fb40b | 2025-01-17 13:14:49 +0300 | [diff] [blame] | 119 | "android/abi_gki_aarch64_paragon", |
| Subrahmanyam Guthena | 067a03c | 2024-01-30 20:29:37 +0000 | [diff] [blame] | 120 | "android/abi_gki_aarch64_pasa", |
| Junki Min | 4754c56 | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 121 | "android/abi_gki_aarch64_pixel", |
| 122 | "android/abi_gki_aarch64_qcom", |
| Kever Yang | 2f3d6aa | 2023-09-13 11:58:02 +0800 | [diff] [blame] | 123 | "android/abi_gki_aarch64_rockchip", |
| Keita Aihara | 131de56 | 2023-10-06 17:47:19 +0900 | [diff] [blame] | 124 | "android/abi_gki_aarch64_sony", |
| Aran Dalton | a1895da | 2024-08-31 16:17:36 +0800 | [diff] [blame] | 125 | "android/abi_gki_aarch64_sunxi", |
| Sukjin Kong | be8ff39 | 2024-08-08 12:53:09 +0900 | [diff] [blame] | 126 | "android/abi_gki_aarch64_telechips", |
| hao lv | 311457e | 2024-10-08 19:10:37 +0800 | [diff] [blame] | 127 | "android/abi_gki_aarch64_transsion", |
| aaro | 2d1d3be | 2023-08-21 19:13:20 +0300 | [diff] [blame] | 128 | "android/abi_gki_aarch64_tuxera", |
| Will McVicker | 089d1b8 | 2024-04-10 09:54:27 -0700 | [diff] [blame] | 129 | "android/abi_gki_aarch64_type_visibility", |
| Cixi Geng | 10e4c80 | 2023-05-16 17:14:56 +0800 | [diff] [blame] | 130 | "android/abi_gki_aarch64_unisoc", |
| Junki Min | 4754c56 | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 131 | "android/abi_gki_aarch64_virtual_device", |
| litao | 3183446 | 2023-04-19 10:16:07 +0800 | [diff] [blame] | 132 | "android/abi_gki_aarch64_vivo", |
| fengqi | 732a9ff | 2023-04-06 15:53:09 +0800 | [diff] [blame] | 133 | "android/abi_gki_aarch64_xiaomi", |
| gy niu | 62f36f9 | 2025-03-13 20:39:24 +0800 | [diff] [blame] | 134 | "android/abi_gki_aarch64_zebra", |
| Junki Min | 4754c56 | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 135 | ], |
| 136 | visibility = ["//visibility:public"], |
| 137 | ) |
| Aleksei Vetrov | ad1cfe4 | 2023-02-16 14:03:19 +0000 | [diff] [blame] | 138 | |
| Ramji Jiyani | 08ae9a7 | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 139 | define_common_kernels(target_configs = { |
| 140 | "kernel_aarch64": { |
| Ramji Jiyani | cc85c8a | 2023-03-16 21:25:22 +0000 | [diff] [blame] | 141 | "kmi_symbol_list_strict_mode": True, |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 142 | "module_implicit_outs": get_gki_modules_list("arm64"), |
| Aleksei Vetrov | ad1cfe4 | 2023-02-16 14:03:19 +0000 | [diff] [blame] | 143 | "kmi_symbol_list": "android/abi_gki_aarch64", |
| Yifan Hong | 3c19f70 | 2024-05-31 16:51:18 -0700 | [diff] [blame] | 144 | "rewrite_absolute_paths_in_config": True, |
| Yifan Hong | 15a4b0d | 2023-07-20 16:50:01 -0700 | [diff] [blame] | 145 | "kmi_symbol_list_add_only": True, |
| Junki Min | 4754c56 | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 146 | "additional_kmi_symbol_lists": [":aarch64_additional_kmi_symbol_lists"], |
| Ramji Jiyani | 0d5b95a | 2023-03-21 22:49:31 +0000 | [diff] [blame] | 147 | "protected_exports_list": "android/abi_gki_protected_exports_aarch64", |
| 148 | "protected_modules_list": "android/gki_aarch64_protected_modules", |
| Ulises Mendez Martinez | 119cead | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 149 | "make_goals": _GKI_AARCH64_MAKE_GOALS, |
| Ramji Jiyani | 08ae9a7 | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 150 | }, |
| Alistair Delva | 763cc48 | 2022-09-30 12:27:02 -0700 | [diff] [blame] | 151 | "kernel_aarch64_16k": { |
| Vilas Bhat | 5c7d0d4 | 2024-09-20 00:27:36 +0000 | [diff] [blame] | 152 | "kmi_symbol_list_strict_mode": True, |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 153 | "module_implicit_outs": get_gki_modules_list("arm64"), |
| Vilas Bhat | 5c7d0d4 | 2024-09-20 00:27:36 +0000 | [diff] [blame] | 154 | "kmi_symbol_list": "android/abi_gki_aarch64", |
| 155 | "rewrite_absolute_paths_in_config": True, |
| 156 | "kmi_symbol_list_add_only": True, |
| 157 | "additional_kmi_symbol_lists": [":aarch64_additional_kmi_symbol_lists"], |
| 158 | "protected_exports_list": "android/abi_gki_protected_exports_aarch64", |
| 159 | "protected_modules_list": "android/gki_aarch64_protected_modules", |
| Ulises Mendez Martinez | 119cead | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 160 | "make_goals": _GKI_AARCH64_MAKE_GOALS, |
| Alistair Delva | 763cc48 | 2022-09-30 12:27:02 -0700 | [diff] [blame] | 161 | }, |
| Ramji Jiyani | 08ae9a7 | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 162 | "kernel_aarch64_debug": { |
| T.J. Mercier | 806fc43 | 2023-01-19 01:46:38 +0000 | [diff] [blame] | 163 | "kmi_symbol_list_strict_mode": False, |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 164 | "module_implicit_outs": get_gki_modules_list("arm64"), |
| Aleksei Vetrov | ad1cfe4 | 2023-02-16 14:03:19 +0000 | [diff] [blame] | 165 | "kmi_symbol_list": "android/abi_gki_aarch64", |
| Yifan Hong | 3c19f70 | 2024-05-31 16:51:18 -0700 | [diff] [blame] | 166 | "rewrite_absolute_paths_in_config": True, |
| Yifan Hong | 15a4b0d | 2023-07-20 16:50:01 -0700 | [diff] [blame] | 167 | "kmi_symbol_list_add_only": True, |
| Junki Min | 4754c56 | 2023-03-29 19:18:01 +0900 | [diff] [blame] | 168 | "additional_kmi_symbol_lists": [":aarch64_additional_kmi_symbol_lists"], |
| Ramji Jiyani | 0d5b95a | 2023-03-21 22:49:31 +0000 | [diff] [blame] | 169 | "protected_exports_list": "android/abi_gki_protected_exports_aarch64", |
| 170 | "protected_modules_list": "android/gki_aarch64_protected_modules", |
| Ulises Mendez Martinez | 119cead | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 171 | "make_goals": _GKI_AARCH64_MAKE_GOALS, |
| Ramji Jiyani | 08ae9a7 | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 172 | }, |
| Alistair Delva | d0da01f | 2022-11-21 16:11:21 -0800 | [diff] [blame] | 173 | "kernel_riscv64": { |
| T.J. Mercier | 806fc43 | 2023-01-19 01:46:38 +0000 | [diff] [blame] | 174 | "kmi_symbol_list_strict_mode": False, |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 175 | "module_implicit_outs": get_gki_modules_list("riscv64"), |
| Ulises Mendez Martinez | 119cead | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 176 | "make_goals": _GKI_RISCV64_MAKE_GOALS, |
| Alistair Delva | d0da01f | 2022-11-21 16:11:21 -0800 | [diff] [blame] | 177 | }, |
| Ramji Jiyani | 200e7cb | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 178 | "kernel_x86_64": { |
| 179 | "kmi_symbol_list_strict_mode": False, |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 180 | "module_implicit_outs": get_gki_modules_list("x86_64"), |
| Ramji Jiyani | 0d5b95a | 2023-03-21 22:49:31 +0000 | [diff] [blame] | 181 | "protected_exports_list": "android/abi_gki_protected_exports_x86_64", |
| 182 | "protected_modules_list": "android/gki_x86_64_protected_modules", |
| Ulises Mendez Martinez | 119cead | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 183 | "make_goals": _GKI_X86_64_MAKE_GOALS, |
| Ramji Jiyani | 200e7cb | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 184 | }, |
| Ramji Jiyani | 200e7cb | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 185 | "kernel_x86_64_debug": { |
| 186 | "kmi_symbol_list_strict_mode": False, |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 187 | "module_implicit_outs": get_gki_modules_list("x86_64"), |
| Ramji Jiyani | 0d5b95a | 2023-03-21 22:49:31 +0000 | [diff] [blame] | 188 | "protected_exports_list": "android/abi_gki_protected_exports_x86_64", |
| 189 | "protected_modules_list": "android/gki_x86_64_protected_modules", |
| Ulises Mendez Martinez | 119cead | 2023-05-04 22:04:29 +0000 | [diff] [blame] | 190 | "make_goals": _GKI_X86_64_MAKE_GOALS, |
| Ramji Jiyani | 200e7cb | 2022-10-26 01:01:29 +0000 | [diff] [blame] | 191 | }, |
| Ramji Jiyani | 08ae9a7 | 2022-04-27 16:20:12 -0700 | [diff] [blame] | 192 | }) |
| Yifan Hong | 32787ef | 2022-04-25 21:17:00 -0700 | [diff] [blame] | 193 | |
| Jiyong Park | ae5ea90 | 2023-09-25 10:02:14 +0900 | [diff] [blame] | 194 | # Microdroid is not a real device. The kernel image is built with special |
| 195 | # configs to reduce the size. Hence, not using mixed build. |
| 196 | kernel_build( |
| 197 | name = "kernel_aarch64_microdroid", |
| 198 | srcs = ["//common:kernel_aarch64_sources"], |
| 199 | outs = [ |
| 200 | "Image", |
| 201 | "System.map", |
| 202 | "modules.builtin", |
| 203 | "modules.builtin.modinfo", |
| 204 | "vmlinux", |
| 205 | "vmlinux.symvers", |
| 206 | ], |
| 207 | build_config = "build.config.microdroid.aarch64", |
| 208 | make_goals = [ |
| 209 | "Image", |
| 210 | ], |
| 211 | ) |
| 212 | |
| 213 | copy_to_dist_dir( |
| 214 | name = "kernel_aarch64_microdroid_dist", |
| 215 | data = [ |
| 216 | ":kernel_aarch64_microdroid", |
| 217 | ], |
| 218 | dist_dir = "out/kernel_aarch64_microdroid/dist", |
| 219 | flat = True, |
| 220 | log = "info", |
| 221 | ) |
| 222 | |
| Nikita Ioffe | fd40c1d | 2024-01-11 10:49:01 +0000 | [diff] [blame] | 223 | kernel_build( |
| 224 | name = "kernel_aarch64_microdroid_16k", |
| 225 | srcs = ["//common:kernel_aarch64_sources"], |
| 226 | outs = [ |
| 227 | "Image", |
| 228 | "System.map", |
| 229 | "modules.builtin", |
| 230 | "modules.builtin.modinfo", |
| 231 | "vmlinux", |
| 232 | "vmlinux.symvers", |
| 233 | ], |
| 234 | build_config = "build.config.microdroid.aarch64", |
| 235 | make_goals = [ |
| 236 | "Image", |
| 237 | ], |
| 238 | page_size = "16k", |
| 239 | ) |
| 240 | |
| 241 | copy_to_dist_dir( |
| 242 | name = "kernel_aarch64_microdroid_16k_dist", |
| 243 | data = [ |
| 244 | ":kernel_aarch64_microdroid_16k", |
| 245 | ], |
| 246 | dist_dir = "out/kernel_aarch64_microdroid_16k/dist", |
| 247 | flat = True, |
| 248 | log = "info", |
| 249 | ) |
| 250 | |
| Jiyong Park | ae5ea90 | 2023-09-25 10:02:14 +0900 | [diff] [blame] | 251 | # Microdroid is not a real device. The kernel image is built with special |
| 252 | # configs to reduce the size. Hence, not using mixed build. |
| 253 | kernel_build( |
| 254 | name = "kernel_x86_64_microdroid", |
| 255 | srcs = ["//common:kernel_x86_64_sources"], |
| 256 | outs = X86_64_OUTS, |
| 257 | arch = "x86_64", |
| 258 | build_config = "build.config.microdroid.x86_64", |
| 259 | make_goals = [ |
| 260 | "bzImage", |
| 261 | ], |
| 262 | ) |
| 263 | |
| 264 | copy_to_dist_dir( |
| 265 | name = "kernel_x86_64_microdroid_dist", |
| 266 | data = [ |
| 267 | ":kernel_x86_64_microdroid", |
| 268 | ], |
| 269 | dist_dir = "out/kernel_x86_64_microdroid/dist", |
| 270 | flat = True, |
| 271 | log = "info", |
| 272 | ) |
| 273 | |
| 274 | kernel_build( |
| 275 | name = "kernel_aarch64_crashdump", |
| 276 | srcs = ["//common:kernel_aarch64_sources"], |
| 277 | outs = [ |
| 278 | "Image", |
| 279 | ], |
| 280 | build_config = "build.config.crashdump.aarch64", |
| 281 | make_goals = [ |
| 282 | "Image", |
| 283 | ], |
| 284 | ) |
| 285 | |
| 286 | copy_to_dist_dir( |
| 287 | name = "kernel_aarch64_crashdump_dist", |
| 288 | data = [ |
| 289 | ":kernel_aarch64_crashdump", |
| 290 | ], |
| 291 | dist_dir = "out/kernel_aarch64_crashdump/dist", |
| 292 | flat = True, |
| 293 | log = "info", |
| 294 | ) |
| 295 | |
| 296 | kernel_build( |
| 297 | name = "kernel_x86_64_crashdump", |
| 298 | srcs = ["//common:kernel_x86_64_sources"], |
| 299 | outs = X86_64_OUTS, |
| 300 | arch = "x86_64", |
| 301 | build_config = "build.config.crashdump.x86_64", |
| 302 | make_goals = [ |
| 303 | "bzImage", |
| 304 | ], |
| 305 | ) |
| 306 | |
| 307 | copy_to_dist_dir( |
| 308 | name = "kernel_x86_64_crashdump_dist", |
| 309 | data = [ |
| 310 | ":kernel_x86_64_crashdump", |
| 311 | ], |
| 312 | dist_dir = "out/kernel_x86_64_crashdump/dist", |
| 313 | flat = True, |
| 314 | log = "info", |
| 315 | ) |
| 316 | |
| Ulises Mendez Martinez | 054ab3a | 2023-06-23 10:03:10 +0000 | [diff] [blame] | 317 | _DB845C_MODULE_OUTS = [ |
| 318 | # keep sorted |
| 319 | "crypto/michael_mic.ko", |
| 320 | "drivers/base/regmap/regmap-sdw.ko", |
| 321 | "drivers/base/regmap/regmap-slimbus.ko", |
| 322 | "drivers/bus/mhi/host/mhi.ko", |
| 323 | "drivers/clk/qcom/clk-qcom.ko", |
| 324 | "drivers/clk/qcom/clk-rpmh.ko", |
| 325 | "drivers/clk/qcom/clk-spmi-pmic-div.ko", |
| 326 | "drivers/clk/qcom/dispcc-sdm845.ko", |
| 327 | "drivers/clk/qcom/dispcc-sm8250.ko", |
| 328 | "drivers/clk/qcom/gcc-sdm845.ko", |
| 329 | "drivers/clk/qcom/gcc-sm8250.ko", |
| 330 | "drivers/clk/qcom/gcc-sm8450.ko", |
| 331 | "drivers/clk/qcom/gpucc-sdm845.ko", |
| 332 | "drivers/clk/qcom/gpucc-sm8250.ko", |
| 333 | "drivers/clk/qcom/lpass-gfm-sm8250.ko", |
| 334 | "drivers/clk/qcom/videocc-sdm845.ko", |
| 335 | "drivers/clk/qcom/videocc-sm8250.ko", |
| 336 | "drivers/cpufreq/qcom-cpufreq-hw.ko", |
| 337 | "drivers/dma-buf/heaps/system_heap.ko", |
| 338 | "drivers/dma/qcom/bam_dma.ko", |
| 339 | "drivers/dma/qcom/gpi.ko", |
| 340 | "drivers/extcon/extcon-usb-gpio.ko", |
| 341 | "drivers/firmware/qcom-scm.ko", |
| 342 | "drivers/gpio/gpio-wcd934x.ko", |
| 343 | "drivers/gpu/drm/bridge/display-connector.ko", |
| 344 | "drivers/gpu/drm/bridge/lontium-lt9611.ko", |
| 345 | "drivers/gpu/drm/bridge/lontium-lt9611uxc.ko", |
| 346 | "drivers/gpu/drm/display/drm_display_helper.ko", |
| 347 | "drivers/gpu/drm/display/drm_dp_aux_bus.ko", |
| 348 | "drivers/gpu/drm/msm/msm.ko", |
| 349 | "drivers/gpu/drm/scheduler/gpu-sched.ko", |
| 350 | "drivers/hwspinlock/qcom_hwspinlock.ko", |
| 351 | "drivers/i2c/busses/i2c-designware-core.ko", |
| 352 | "drivers/i2c/busses/i2c-designware-platform.ko", |
| 353 | "drivers/i2c/busses/i2c-qcom-geni.ko", |
| 354 | "drivers/i2c/busses/i2c-qup.ko", |
| 355 | "drivers/i2c/busses/i2c-rk3x.ko", |
| 356 | "drivers/i2c/i2c-dev.ko", |
| 357 | "drivers/i2c/i2c-mux.ko", |
| 358 | "drivers/i2c/muxes/i2c-mux-pca954x.ko", |
| 359 | "drivers/iio/adc/qcom-spmi-adc5.ko", |
| 360 | "drivers/iio/adc/qcom-vadc-common.ko", |
| 361 | "drivers/input/misc/pm8941-pwrkey.ko", |
| 362 | "drivers/interconnect/qcom/icc-bcm-voter.ko", |
| 363 | "drivers/interconnect/qcom/icc-osm-l3.ko", |
| 364 | "drivers/interconnect/qcom/icc-rpmh.ko", |
| 365 | "drivers/interconnect/qcom/qnoc-sdm845.ko", |
| 366 | "drivers/interconnect/qcom/qnoc-sm8250.ko", |
| 367 | "drivers/interconnect/qcom/qnoc-sm8450.ko", |
| 368 | "drivers/iommu/arm/arm-smmu/arm_smmu.ko", |
| 369 | "drivers/irqchip/qcom-pdc.ko", |
| 370 | "drivers/leds/rgb/leds-qcom-lpg.ko", |
| 371 | "drivers/mailbox/qcom-apcs-ipc-mailbox.ko", |
| 372 | "drivers/mailbox/qcom-ipcc.ko", |
| 373 | "drivers/media/platform/qcom/venus/venus-core.ko", |
| 374 | "drivers/media/platform/qcom/venus/venus-dec.ko", |
| 375 | "drivers/media/platform/qcom/venus/venus-enc.ko", |
| 376 | "drivers/mfd/qcom-spmi-pmic.ko", |
| 377 | "drivers/mfd/wcd934x.ko", |
| 378 | "drivers/misc/fastrpc.ko", |
| 379 | "drivers/mmc/host/cqhci.ko", |
| 380 | "drivers/mmc/host/sdhci-msm.ko", |
| 381 | "drivers/net/can/spi/mcp251xfd/mcp251xfd.ko", |
| 382 | "drivers/net/wireless/ath/ath.ko", |
| 383 | "drivers/net/wireless/ath/ath10k/ath10k_core.ko", |
| 384 | "drivers/net/wireless/ath/ath10k/ath10k_pci.ko", |
| 385 | "drivers/net/wireless/ath/ath10k/ath10k_snoc.ko", |
| 386 | "drivers/net/wireless/ath/ath11k/ath11k.ko", |
| 387 | "drivers/net/wireless/ath/ath11k/ath11k_ahb.ko", |
| 388 | "drivers/net/wireless/ath/ath11k/ath11k_pci.ko", |
| 389 | "drivers/nvmem/nvmem_qfprom.ko", |
| 390 | "drivers/phy/qualcomm/phy-qcom-qmp-combo.ko", |
| 391 | "drivers/phy/qualcomm/phy-qcom-qmp-pcie.ko", |
| 392 | "drivers/phy/qualcomm/phy-qcom-qmp-pcie-msm8996.ko", |
| 393 | "drivers/phy/qualcomm/phy-qcom-qmp-ufs.ko", |
| 394 | "drivers/phy/qualcomm/phy-qcom-qmp-usb.ko", |
| 395 | "drivers/phy/qualcomm/phy-qcom-qusb2.ko", |
| 396 | "drivers/phy/qualcomm/phy-qcom-snps-femto-v2.ko", |
| 397 | "drivers/phy/qualcomm/phy-qcom-usb-hs.ko", |
| 398 | "drivers/pinctrl/qcom/pinctrl-lpass-lpi.ko", |
| 399 | "drivers/pinctrl/qcom/pinctrl-msm.ko", |
| 400 | "drivers/pinctrl/qcom/pinctrl-sdm845.ko", |
| 401 | "drivers/pinctrl/qcom/pinctrl-sm8250.ko", |
| 402 | "drivers/pinctrl/qcom/pinctrl-sm8250-lpass-lpi.ko", |
| 403 | "drivers/pinctrl/qcom/pinctrl-sm8450.ko", |
| 404 | "drivers/pinctrl/qcom/pinctrl-spmi-gpio.ko", |
| 405 | "drivers/pinctrl/qcom/pinctrl-spmi-mpp.ko", |
| 406 | "drivers/power/reset/qcom-pon.ko", |
| 407 | "drivers/power/reset/reboot-mode.ko", |
| 408 | "drivers/power/reset/syscon-reboot-mode.ko", |
| 409 | "drivers/regulator/gpio-regulator.ko", |
| 410 | "drivers/regulator/qcom-rpmh-regulator.ko", |
| 411 | "drivers/regulator/qcom_spmi-regulator.ko", |
| 412 | "drivers/regulator/qcom_usb_vbus-regulator.ko", |
| 413 | "drivers/remoteproc/qcom_common.ko", |
| 414 | "drivers/remoteproc/qcom_pil_info.ko", |
| 415 | "drivers/remoteproc/qcom_q6v5.ko", |
| 416 | "drivers/remoteproc/qcom_q6v5_adsp.ko", |
| 417 | "drivers/remoteproc/qcom_q6v5_mss.ko", |
| 418 | "drivers/remoteproc/qcom_q6v5_pas.ko", |
| 419 | "drivers/remoteproc/qcom_q6v5_wcss.ko", |
| 420 | "drivers/remoteproc/qcom_sysmon.ko", |
| 421 | "drivers/reset/reset-qcom-aoss.ko", |
| 422 | "drivers/reset/reset-qcom-pdc.ko", |
| 423 | "drivers/rpmsg/qcom_glink.ko", |
| 424 | "drivers/rpmsg/qcom_glink_rpm.ko", |
| 425 | "drivers/rpmsg/qcom_glink_smem.ko", |
| 426 | "drivers/rpmsg/qcom_smd.ko", |
| 427 | "drivers/rpmsg/rpmsg_ns.ko", |
| 428 | "drivers/rtc/rtc-pm8xxx.ko", |
| 429 | "drivers/slimbus/slim-qcom-ngd-ctrl.ko", |
| 430 | "drivers/slimbus/slimbus.ko", |
| 431 | "drivers/soc/qcom/apr.ko", |
| 432 | "drivers/soc/qcom/cmd-db.ko", |
| 433 | "drivers/soc/qcom/cpr.ko", |
| 434 | "drivers/soc/qcom/llcc-qcom.ko", |
| 435 | "drivers/soc/qcom/mdt_loader.ko", |
| 436 | "drivers/soc/qcom/pdr_interface.ko", |
| 437 | "drivers/soc/qcom/qcom_aoss.ko", |
| 438 | "drivers/soc/qcom/qcom_rpmh.ko", |
| 439 | "drivers/soc/qcom/qmi_helpers.ko", |
| 440 | "drivers/soc/qcom/rmtfs_mem.ko", |
| 441 | "drivers/soc/qcom/rpmhpd.ko", |
| 442 | "drivers/soc/qcom/smem.ko", |
| 443 | "drivers/soc/qcom/smp2p.ko", |
| 444 | "drivers/soc/qcom/smsm.ko", |
| 445 | "drivers/soc/qcom/socinfo.ko", |
| 446 | "drivers/soc/qcom/spm.ko", |
| 447 | "drivers/soundwire/soundwire-bus.ko", |
| 448 | "drivers/soundwire/soundwire-qcom.ko", |
| 449 | "drivers/spi/spi-geni-qcom.ko", |
| 450 | "drivers/spi/spi-pl022.ko", |
| 451 | "drivers/spi/spi-qcom-qspi.ko", |
| 452 | "drivers/spi/spi-qup.ko", |
| 453 | "drivers/spmi/spmi-pmic-arb.ko", |
| 454 | "drivers/thermal/qcom/lmh.ko", |
| 455 | "drivers/thermal/qcom/qcom-spmi-adc-tm5.ko", |
| 456 | "drivers/thermal/qcom/qcom-spmi-temp-alarm.ko", |
| 457 | "drivers/thermal/qcom/qcom_tsens.ko", |
| 458 | "drivers/tty/serial/msm_serial.ko", |
| 459 | "drivers/ufs/host/ufs_qcom.ko", |
| 460 | "drivers/usb/common/ulpi.ko", |
| 461 | "drivers/usb/host/ohci-hcd.ko", |
| 462 | "drivers/usb/host/ohci-pci.ko", |
| 463 | "drivers/usb/host/ohci-platform.ko", |
| 464 | "drivers/usb/typec/qcom-pmic-typec.ko", |
| 465 | "net/mac80211/mac80211.ko", |
| 466 | "net/qrtr/qrtr.ko", |
| 467 | "net/qrtr/qrtr-mhi.ko", |
| 468 | "net/qrtr/qrtr-smd.ko", |
| 469 | "net/qrtr/qrtr-tun.ko", |
| 470 | "net/wireless/cfg80211.ko", |
| 471 | "sound/soc/codecs/snd-soc-dmic.ko", |
| 472 | "sound/soc/codecs/snd-soc-hdmi-codec.ko", |
| 473 | "sound/soc/codecs/snd-soc-lpass-macro-common.ko", |
| 474 | "sound/soc/codecs/snd-soc-lpass-va-macro.ko", |
| 475 | "sound/soc/codecs/snd-soc-lpass-wsa-macro.ko", |
| 476 | "sound/soc/codecs/snd-soc-max98927.ko", |
| 477 | "sound/soc/codecs/snd-soc-rl6231.ko", |
| 478 | "sound/soc/codecs/snd-soc-rt5663.ko", |
| 479 | "sound/soc/codecs/snd-soc-wcd-mbhc.ko", |
| 480 | "sound/soc/codecs/snd-soc-wcd9335.ko", |
| 481 | "sound/soc/codecs/snd-soc-wcd934x.ko", |
| 482 | "sound/soc/codecs/snd-soc-wsa881x.ko", |
| 483 | "sound/soc/qcom/qdsp6/q6adm.ko", |
| 484 | "sound/soc/qcom/qdsp6/q6afe.ko", |
| 485 | "sound/soc/qcom/qdsp6/q6afe-clocks.ko", |
| 486 | "sound/soc/qcom/qdsp6/q6afe-dai.ko", |
| 487 | "sound/soc/qcom/qdsp6/q6apm-dai.ko", |
| 488 | "sound/soc/qcom/qdsp6/q6apm-lpass-dais.ko", |
| 489 | "sound/soc/qcom/qdsp6/q6asm.ko", |
| 490 | "sound/soc/qcom/qdsp6/q6asm-dai.ko", |
| 491 | "sound/soc/qcom/qdsp6/q6core.ko", |
| 492 | "sound/soc/qcom/qdsp6/q6prm.ko", |
| 493 | "sound/soc/qcom/qdsp6/q6prm-clocks.ko", |
| 494 | "sound/soc/qcom/qdsp6/q6routing.ko", |
| 495 | "sound/soc/qcom/qdsp6/snd-q6apm.ko", |
| 496 | "sound/soc/qcom/qdsp6/snd-q6dsp-common.ko", |
| 497 | "sound/soc/qcom/snd-soc-qcom-common.ko", |
| 498 | "sound/soc/qcom/snd-soc-qcom-sdw.ko", |
| 499 | "sound/soc/qcom/snd-soc-sdm845.ko", |
| 500 | "sound/soc/qcom/snd-soc-sm8250.ko", |
| 501 | ] |
| 502 | |
| 503 | _DB845C_WATCHDOG_MODULE_OUTS = [ |
| 504 | "drivers/watchdog/pm8916_wdt.ko", |
| 505 | "drivers/watchdog/qcom-wdt.ko", |
| 506 | ] |
| 507 | |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 508 | kernel_build( |
| Ulises Mendez Martinez | 054ab3a | 2023-06-23 10:03:10 +0000 | [diff] [blame] | 509 | name = "db845c_no_kgdb", |
| Ulises Mendez Martinez | ebf227d | 2022-09-02 19:21:44 +0000 | [diff] [blame] | 510 | outs = [ |
| Yifan Hong | 32787ef | 2022-04-25 21:17:00 -0700 | [diff] [blame] | 511 | "arch/arm64/boot/dts/qcom/qrb5165-rb5.dtb", |
| 512 | "arch/arm64/boot/dts/qcom/sdm845-db845c.dtb", |
| Peter Collingbourne | 1e0ed73 | 2022-02-01 16:18:49 -0800 | [diff] [blame] | 513 | "arch/arm64/boot/dts/qcom/sm8450-qrd.dtb", |
| Yifan Hong | 32787ef | 2022-04-25 21:17:00 -0700 | [diff] [blame] | 514 | ], |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 515 | # Enable mixed build. |
| 516 | base_kernel = ":kernel_aarch64", |
| 517 | build_config = "build.config.db845c", |
| 518 | collect_unstripped_modules = True, |
| 519 | kmi_symbol_list = "android/abi_gki_aarch64_db845c", |
| Ulises Mendez Martinez | 81509f8 | 2023-05-12 12:04:53 +0000 | [diff] [blame] | 520 | make_goals = [ |
| 521 | "modules", |
| 522 | "qcom/sdm845-db845c.dtb", |
| 523 | "qcom/qrb5165-rb5.dtb", |
| 524 | "qcom/sm8450-qrd.dtb", |
| 525 | ], |
| Ulises Mendez Martinez | 054ab3a | 2023-06-23 10:03:10 +0000 | [diff] [blame] | 526 | module_outs = _DB845C_MODULE_OUTS + _DB845C_WATCHDOG_MODULE_OUTS, |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 527 | strip_modules = True, |
| 528 | ) |
| 529 | |
| Ulises Mendez Martinez | 054ab3a | 2023-06-23 10:03:10 +0000 | [diff] [blame] | 530 | kernel_build( |
| 531 | name = "db845c_with_kgdb", |
| 532 | outs = [ |
| 533 | "arch/arm64/boot/dts/qcom/qrb5165-rb5.dtb", |
| 534 | "arch/arm64/boot/dts/qcom/sdm845-db845c.dtb", |
| 535 | "arch/arm64/boot/dts/qcom/sm8450-qrd.dtb", |
| 536 | ], |
| 537 | # Enable mixed build. |
| 538 | base_kernel = ":kernel_aarch64", |
| 539 | build_config = "build.config.db845c", |
| 540 | make_goals = [ |
| 541 | "modules", |
| 542 | "qcom/sdm845-db845c.dtb", |
| 543 | "qcom/qrb5165-rb5.dtb", |
| 544 | "qcom/sm8450-qrd.dtb", |
| 545 | ], |
| 546 | module_outs = _DB845C_MODULE_OUTS, |
| 547 | strip_modules = True, |
| 548 | ) |
| 549 | |
| 550 | alias( |
| 551 | name = "db845c", |
| 552 | actual = select({ |
| 553 | "//build/kernel/kleaf:kgdb_is_true": "db845c_with_kgdb", |
| 554 | "//conditions:default": "db845c_no_kgdb", |
| 555 | }), |
| 556 | ) |
| 557 | |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 558 | kernel_abi( |
| 559 | name = "db845c_abi", |
| 560 | kernel_build = ":db845c", |
| 561 | kmi_symbol_list_add_only = True, |
| 562 | ) |
| 563 | |
| 564 | kernel_modules_install( |
| 565 | name = "db845c_modules_install", |
| 566 | kernel_build = ":db845c", |
| 567 | ) |
| 568 | |
| 569 | merged_kernel_uapi_headers( |
| 570 | name = "db845c_merged_kernel_uapi_headers", |
| 571 | kernel_build = ":db845c", |
| 572 | ) |
| 573 | |
| 574 | kernel_images( |
| 575 | name = "db845c_images", |
| 576 | build_initramfs = True, |
| 577 | kernel_build = ":db845c", |
| 578 | kernel_modules_install = ":db845c_modules_install", |
| 579 | ) |
| 580 | |
| 581 | copy_to_dist_dir( |
| 582 | name = "db845c_dist", |
| 583 | data = [ |
| 584 | ":db845c", |
| 585 | ":db845c_images", |
| 586 | ":db845c_modules_install", |
| 587 | ":db845c_merged_kernel_uapi_headers", |
| 588 | # Mixed build: Additional GKI artifacts. |
| 589 | ":kernel_aarch64", |
| 590 | ":kernel_aarch64_modules", |
| 591 | ":kernel_aarch64_additional_artifacts", |
| 592 | ], |
| 593 | dist_dir = "out/db845/dist", |
| 594 | flat = True, |
| 595 | log = "info", |
| Yifan Hong | 32787ef | 2022-04-25 21:17:00 -0700 | [diff] [blame] | 596 | ) |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 597 | |
| Ulises Mendez Martinez | 32c2d42 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 598 | _ROCKPI4_MODULE_OUTS = [ |
| 599 | # keep sorted |
| 600 | "drivers/block/virtio_blk.ko", |
| 601 | "drivers/char/hw_random/virtio-rng.ko", |
| 602 | "drivers/clk/clk-rk808.ko", |
| 603 | "drivers/cpufreq/cpufreq-dt.ko", |
| Carlos Llamas | 92704e0 | 2024-05-14 17:08:50 +0000 | [diff] [blame] | 604 | "drivers/cpufreq/tegra20-cpufreq.ko", |
| Ulises Mendez Martinez | 32c2d42 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 605 | "drivers/dma/pl330.ko", |
| 606 | "drivers/gpu/drm/bridge/analogix/analogix_dp.ko", |
| 607 | "drivers/gpu/drm/bridge/synopsys/dw-hdmi.ko", |
| 608 | "drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.ko", |
| 609 | "drivers/gpu/drm/display/drm_display_helper.ko", |
| 610 | "drivers/gpu/drm/drm_dma_helper.ko", |
| 611 | "drivers/gpu/drm/rockchip/rockchipdrm.ko", |
| 612 | "drivers/i2c/busses/i2c-rk3x.ko", |
| 613 | "drivers/iio/adc/rockchip_saradc.ko", |
| 614 | "drivers/iio/buffer/industrialio-triggered-buffer.ko", |
| 615 | "drivers/iio/buffer/kfifo_buf.ko", |
| 616 | "drivers/mfd/rk808.ko", |
| 617 | "drivers/mmc/core/pwrseq_simple.ko", |
| 618 | "drivers/mmc/host/cqhci.ko", |
| 619 | "drivers/mmc/host/dw_mmc.ko", |
| 620 | "drivers/mmc/host/dw_mmc-pltfm.ko", |
| 621 | "drivers/mmc/host/dw_mmc-rockchip.ko", |
| 622 | "drivers/mmc/host/sdhci-of-arasan.ko", |
| 623 | "drivers/net/ethernet/stmicro/stmmac/dwmac-rk.ko", |
| 624 | "drivers/net/ethernet/stmicro/stmmac/stmmac.ko", |
| 625 | "drivers/net/ethernet/stmicro/stmmac/stmmac-platform.ko", |
| 626 | "drivers/net/net_failover.ko", |
| 627 | "drivers/net/pcs/pcs_xpcs.ko", |
| 628 | "drivers/net/virtio_net.ko", |
| 629 | "drivers/pci/controller/pcie-rockchip-host.ko", |
| 630 | "drivers/phy/rockchip/phy-rockchip-emmc.ko", |
| 631 | "drivers/phy/rockchip/phy-rockchip-inno-usb2.ko", |
| 632 | "drivers/phy/rockchip/phy-rockchip-pcie.ko", |
| 633 | "drivers/phy/rockchip/phy-rockchip-typec.ko", |
| 634 | "drivers/pwm/pwm-rockchip.ko", |
| 635 | "drivers/regulator/fan53555.ko", |
| 636 | "drivers/regulator/pwm-regulator.ko", |
| 637 | "drivers/regulator/rk808-regulator.ko", |
| 638 | "drivers/rtc/rtc-rk808.ko", |
| 639 | "drivers/soc/rockchip/io-domain.ko", |
| 640 | "drivers/thermal/rockchip_thermal.ko", |
| 641 | "drivers/usb/host/ohci-hcd.ko", |
| 642 | "drivers/usb/host/ohci-platform.ko", |
| 643 | "drivers/virtio/virtio_pci.ko", |
| 644 | "drivers/virtio/virtio_pci_legacy_dev.ko", |
| 645 | "drivers/virtio/virtio_pci_modern_dev.ko", |
| 646 | "net/core/failover.ko", |
| 647 | ] |
| 648 | |
| 649 | _ROCKPI4_WATCHDOG_MODULE_OUTS = [ |
| 650 | # keep sorted |
| 651 | "drivers/watchdog/dw_wdt.ko", |
| 652 | ] |
| 653 | |
| Yifan Hong | bbf0d780 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 654 | # TODO(b/258259749): Convert rockpi4 to mixed build |
| 655 | kernel_build( |
| Ulises Mendez Martinez | 32c2d42 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 656 | name = "rockpi4_no_kgdb", |
| Yifan Hong | bbf0d780 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 657 | outs = [ |
| 658 | "Image", |
| 659 | "System.map", |
| 660 | "modules.builtin", |
| 661 | "modules.builtin.modinfo", |
| 662 | "rk3399-rock-pi-4b.dtb", |
| 663 | "vmlinux", |
| 664 | "vmlinux.symvers", |
| 665 | ], |
| 666 | build_config = "build.config.rockpi4", |
| 667 | dtstree = "//common-modules/virtual-device:rockpi4_dts", |
| Ulises Mendez Martinez | 81509f8 | 2023-05-12 12:04:53 +0000 | [diff] [blame] | 668 | make_goals = [ |
| 669 | "Image", |
| 670 | "modules", |
| 671 | "rk3399-rock-pi-4b.dtb", |
| 672 | ], |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 673 | module_outs = get_gki_modules_list("arm64") + _ROCKPI4_MODULE_OUTS + _ROCKPI4_WATCHDOG_MODULE_OUTS, |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 674 | visibility = ["//visibility:private"], |
| Ulises Mendez Martinez | 32c2d42 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 675 | ) |
| 676 | |
| 677 | # TODO(b/258259749): Convert rockpi4 to mixed build |
| 678 | kernel_build( |
| 679 | name = "rockpi4_with_kgdb", |
| 680 | outs = [ |
| 681 | "Image", |
| 682 | "System.map", |
| 683 | "modules.builtin", |
| 684 | "modules.builtin.modinfo", |
| 685 | "rk3399-rock-pi-4b.dtb", |
| 686 | "vmlinux", |
| 687 | "vmlinux.symvers", |
| Yifan Hong | bbf0d780 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 688 | ], |
| Ulises Mendez Martinez | 32c2d42 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 689 | build_config = "build.config.rockpi4", |
| 690 | dtstree = "//common-modules/virtual-device:rockpi4_dts", |
| 691 | make_goals = [ |
| 692 | "Image", |
| 693 | "modules", |
| 694 | "rk3399-rock-pi-4b.dtb", |
| 695 | ], |
| Ulises Mendez Martinez | 9a399ca | 2023-08-07 12:42:40 +0000 | [diff] [blame] | 696 | module_outs = get_gki_modules_list("arm64") + _ROCKPI4_MODULE_OUTS, |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 697 | visibility = ["//visibility:private"], |
| Ulises Mendez Martinez | 32c2d42 | 2023-04-11 10:52:32 +0000 | [diff] [blame] | 698 | ) |
| 699 | |
| 700 | alias( |
| 701 | name = "rockpi4", |
| 702 | actual = select({ |
| 703 | "//build/kernel/kleaf:kgdb_is_true": "rockpi4_with_kgdb", |
| 704 | "//conditions:default": "rockpi4_no_kgdb", |
| 705 | }), |
| Yifan Hong | bbf0d780 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 706 | ) |
| 707 | |
| 708 | kernel_modules_install( |
| 709 | name = "rockpi4_modules_install", |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 710 | kernel_build = ":rockpi4", |
| Yifan Hong | bbf0d780 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 711 | ) |
| 712 | |
| 713 | kernel_images( |
| 714 | name = "rockpi4_images", |
| 715 | build_initramfs = True, |
| Ulises Mendez Martinez | ec0fc55 | 2023-06-22 14:08:27 +0000 | [diff] [blame] | 716 | kernel_build = ":rockpi4", |
| 717 | kernel_modules_install = ":rockpi4_modules_install", |
| Yifan Hong | bbf0d780 | 2022-11-15 23:01:00 -0800 | [diff] [blame] | 718 | ) |
| 719 | |
| 720 | copy_to_dist_dir( |
| 721 | name = "rockpi4_dist", |
| 722 | data = [ |
| 723 | ":rockpi4", |
| 724 | ":rockpi4_images", |
| 725 | ":rockpi4_modules_install", |
| 726 | ], |
| 727 | dist_dir = "out/rockpi4/dist", |
| 728 | flat = True, |
| 729 | ) |
| 730 | |
| Ard Biesheuvel | c6d5a76 | 2021-03-23 10:54:38 +0100 | [diff] [blame] | 731 | kernel_build( |
| 732 | name = "fips140", |
| 733 | outs = [], |
| 734 | base_kernel = ":kernel_aarch64", |
| 735 | build_config = "build.config.gki.aarch64.fips140", |
| Eric Biggers | e61a6ec | 2024-02-29 01:26:25 +0000 | [diff] [blame] | 736 | kmi_symbol_list = "android/abi_gki_aarch64_fips140", |
| Ard Biesheuvel | c6d5a76 | 2021-03-23 10:54:38 +0100 | [diff] [blame] | 737 | module_outs = ["crypto/fips140.ko"], |
| 738 | ) |
| 739 | |
| Eric Biggers | e61a6ec | 2024-02-29 01:26:25 +0000 | [diff] [blame] | 740 | kernel_abi( |
| 741 | name = "fips140_abi", |
| 742 | kernel_build = ":fips140", |
| 743 | kmi_symbol_list_add_only = True, |
| 744 | ) |
| 745 | |
| Ard Biesheuvel | c6d5a76 | 2021-03-23 10:54:38 +0100 | [diff] [blame] | 746 | copy_to_dist_dir( |
| 747 | name = "fips140_dist", |
| 748 | data = [ |
| 749 | ":fips140", |
| 750 | ], |
| 751 | dist_dir = "out/fips140/dist", |
| 752 | flat = True, |
| 753 | ) |
| 754 | |
| Yifan Hong | 6bf834cb5 | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 755 | # allmodconfig build tests. |
| 756 | # These are build tests only, so: |
| 757 | # - outs are intentionally set to empty to not copy anything to DIST_DIR |
| 758 | # - --allow-undeclared-modules must be used so modules are not declared or copied. |
| 759 | # - No dist target because these are build tests. We don't care about the artifacts. |
| 760 | |
| Ulises Mendez Martinez | 75c1d99 | 2022-11-24 12:00:01 +0000 | [diff] [blame] | 761 | # tools/bazel build --allow_undeclared_modules //common:kernel_aarch64_allmodconfig |
| Yifan Hong | 6bf834cb5 | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 762 | kernel_build( |
| Ulises Mendez Martinez | 75c1d99 | 2022-11-24 12:00:01 +0000 | [diff] [blame] | 763 | name = "kernel_aarch64_allmodconfig", |
| Yifan Hong | 6bf834cb5 | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 764 | # Hack to actually check the build. |
| 765 | # Otherwise, Bazel thinks that there are no output files, and skip building. |
| 766 | outs = [".config"], |
| 767 | build_config = "build.config.allmodconfig.aarch64", |
| 768 | visibility = ["//visibility:private"], |
| 769 | ) |
| 770 | |
| Ulises Mendez Martinez | 75c1d99 | 2022-11-24 12:00:01 +0000 | [diff] [blame] | 771 | # tools/bazel build --allow_undeclared_modules //common:kernel_x86_64_allmodconfig |
| Yifan Hong | 6bf834cb5 | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 772 | kernel_build( |
| Ulises Mendez Martinez | 75c1d99 | 2022-11-24 12:00:01 +0000 | [diff] [blame] | 773 | name = "kernel_x86_64_allmodconfig", |
| Yifan Hong | 6bf834cb5 | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 774 | # Hack to actually check the build. |
| 775 | # Otherwise, Bazel thinks that there are no output files, and skip building. |
| 776 | outs = [".config"], |
| Ulises Mendez Martinez | b57cdab | 2023-06-27 18:19:15 +0000 | [diff] [blame] | 777 | arch = "x86_64", |
| Yifan Hong | 6bf834cb5 | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 778 | build_config = "build.config.allmodconfig.x86_64", |
| 779 | visibility = ["//visibility:private"], |
| 780 | ) |
| 781 | |
| Ulises Mendez Martinez | 75c1d99 | 2022-11-24 12:00:01 +0000 | [diff] [blame] | 782 | # tools/bazel build --allow_undeclared_modules //common:kernel_arm_allmodconfig |
| Yifan Hong | 6bf834cb5 | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 783 | kernel_build( |
| Ulises Mendez Martinez | 75c1d99 | 2022-11-24 12:00:01 +0000 | [diff] [blame] | 784 | name = "kernel_arm_allmodconfig", |
| Yifan Hong | 6bf834cb5 | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 785 | # Hack to actually check the build. |
| 786 | # Otherwise, Bazel thinks that there are no output files, and skip building. |
| 787 | outs = [".config"], |
| Ulises Mendez Martinez | b57cdab | 2023-06-27 18:19:15 +0000 | [diff] [blame] | 788 | arch = "arm", |
| Yifan Hong | 6bf834cb5 | 2022-11-11 16:37:02 -0800 | [diff] [blame] | 789 | build_config = "build.config.allmodconfig.arm", |
| 790 | visibility = ["//visibility:private"], |
| 791 | ) |
| 792 | |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 793 | # DDK Headers |
| Yifan Hong | 4d71819 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 794 | # All headers. These are the public targets for DDK modules to use. |
| 795 | alias( |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 796 | name = "all_headers", |
| Yifan Hong | 4d71819 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 797 | actual = "all_headers_aarch64", |
| 798 | visibility = ["//visibility:public"], |
| 799 | ) |
| 800 | |
| 801 | ddk_headers( |
| 802 | name = "all_headers_aarch64", |
| 803 | hdrs = [":all_headers_allowlist_aarch64"] + select({ |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 804 | "//build/kernel/kleaf:allow_ddk_unsafe_headers_set": [":all_headers_unsafe"], |
| 805 | "//conditions:default": [], |
| 806 | }), |
| 807 | visibility = ["//visibility:public"], |
| 808 | ) |
| 809 | |
| Yifan Hong | 4d71819 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 810 | ddk_headers( |
| Yifan Hong | b97f4c6 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 811 | name = "all_headers_arm", |
| 812 | hdrs = [":all_headers_allowlist_arm"] + select({ |
| 813 | "//build/kernel/kleaf:allow_ddk_unsafe_headers_set": [":all_headers_unsafe"], |
| 814 | "//conditions:default": [], |
| 815 | }), |
| 816 | visibility = ["//visibility:public"], |
| 817 | ) |
| 818 | |
| 819 | ddk_headers( |
| Alistair Delva | 93e1118 | 2022-12-08 13:20:51 -0800 | [diff] [blame] | 820 | name = "all_headers_riscv64", |
| 821 | hdrs = [":all_headers_allowlist_riscv64"] + select({ |
| 822 | "//build/kernel/kleaf:allow_ddk_unsafe_headers_set": [":all_headers_unsafe"], |
| 823 | "//conditions:default": [], |
| 824 | }), |
| 825 | visibility = ["//visibility:public"], |
| 826 | ) |
| 827 | |
| 828 | ddk_headers( |
| Yifan Hong | 4d71819 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 829 | name = "all_headers_x86_64", |
| 830 | hdrs = [":all_headers_allowlist_x86_64"] + select({ |
| 831 | "//build/kernel/kleaf:allow_ddk_unsafe_headers_set": [":all_headers_unsafe"], |
| 832 | "//conditions:default": [], |
| 833 | }), |
| 834 | visibility = ["//visibility:public"], |
| 835 | ) |
| 836 | |
| 837 | # Implementation details for DDK headers. The targets below cannot be directly |
| 838 | # depended on by DDK modules. |
| 839 | |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 840 | # DDK headers allowlist. This is the list of all headers and include |
| 841 | # directories that are safe to use in DDK modules. |
| 842 | ddk_headers( |
| Yifan Hong | 4d71819 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 843 | name = "all_headers_allowlist_aarch64", |
| 844 | hdrs = [ |
| 845 | ":all_headers_allowlist_aarch64_globs", |
| 846 | ":all_headers_allowlist_common_globs", |
| 847 | ], |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 848 | # The list of include directories where source files can #include headers |
| 849 | # from. In other words, these are the `-I` option to the C compiler. |
| Yifan Hong | a4c2687 | 2022-11-03 16:12:31 -0700 | [diff] [blame] | 850 | # These are prepended to LINUXINCLUDE. |
| 851 | linux_includes = [ |
| Yifan Hong | e07b026 | 2022-10-21 20:19:28 -0700 | [diff] [blame] | 852 | "arch/arm64/include", |
| 853 | "arch/arm64/include/uapi", |
| Yifan Hong | 4d71819 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 854 | "include", |
| 855 | "include/uapi", |
| 856 | ], |
| 857 | visibility = ["//visibility:private"], |
| 858 | ) |
| 859 | |
| 860 | ddk_headers( |
| Yifan Hong | b97f4c6 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 861 | name = "all_headers_allowlist_arm", |
| 862 | hdrs = [ |
| 863 | ":all_headers_allowlist_arm_globs", |
| 864 | ":all_headers_allowlist_common_globs", |
| 865 | ], |
| 866 | # The list of include directories where source files can #include headers |
| 867 | # from. In other words, these are the `-I` option to the C compiler. |
| 868 | # These are prepended to LINUXINCLUDE. |
| 869 | linux_includes = [ |
| 870 | "arch/arm/include", |
| 871 | "arch/arm/include/uapi", |
| 872 | "include", |
| 873 | "include/uapi", |
| 874 | ], |
| 875 | visibility = ["//visibility:private"], |
| 876 | ) |
| 877 | |
| 878 | ddk_headers( |
| Alistair Delva | 93e1118 | 2022-12-08 13:20:51 -0800 | [diff] [blame] | 879 | name = "all_headers_allowlist_riscv64", |
| 880 | hdrs = [ |
| 881 | ":all_headers_allowlist_common_globs", |
| 882 | ":all_headers_allowlist_riscv64_globs", |
| 883 | ], |
| 884 | # The list of include directories where source files can #include headers |
| 885 | # from. In other words, these are the `-I` option to the C compiler. |
| 886 | # These are prepended to LINUXINCLUDE. |
| 887 | linux_includes = [ |
| 888 | "arch/riscv/include", |
| 889 | "arch/riscv/include/uapi", |
| 890 | "include", |
| 891 | "include/uapi", |
| 892 | ], |
| 893 | visibility = ["//visibility:private"], |
| 894 | ) |
| 895 | |
| 896 | ddk_headers( |
| Yifan Hong | 4d71819 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 897 | name = "all_headers_allowlist_x86_64", |
| 898 | hdrs = [ |
| 899 | ":all_headers_allowlist_common_globs", |
| 900 | ":all_headers_allowlist_x86_64_globs", |
| 901 | ], |
| 902 | # The list of include directories where source files can #include headers |
| 903 | # from. In other words, these are the `-I` option to the C compiler. |
| Yifan Hong | a4c2687 | 2022-11-03 16:12:31 -0700 | [diff] [blame] | 904 | # These are prepended to LINUXINCLUDE. |
| 905 | linux_includes = [ |
| Yifan Hong | a08c2979 | 2022-10-21 23:07:21 -0700 | [diff] [blame] | 906 | "arch/x86/include", |
| 907 | "arch/x86/include/uapi", |
| Yifan Hong | e07b026 | 2022-10-21 20:19:28 -0700 | [diff] [blame] | 908 | "include", |
| 909 | "include/uapi", |
| 910 | ], |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 911 | visibility = ["//visibility:private"], |
| 912 | ) |
| 913 | |
| 914 | # List of DDK headers allowlist that are glob()-ed to avoid changes of BUILD |
| 915 | # file when the list of files changes. All headers in these directories |
| 916 | # are safe to use. |
| Yifan Hong | 4d71819 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 917 | # These are separate filegroup targets so the all_headers_allowlist_* are |
| 918 | # more friendly to batch BUILD file update tools like buildozer. |
| 919 | |
| Alistair Delva | 93e1118 | 2022-12-08 13:20:51 -0800 | [diff] [blame] | 920 | # globs() for arm64 only |
| 921 | filegroup( |
| 922 | name = "all_headers_allowlist_aarch64_globs", |
| 923 | srcs = glob(["arch/arm64/include/**/*.h"]), |
| 924 | visibility = ["//visibility:private"], |
| 925 | ) |
| 926 | |
| Yifan Hong | b97f4c6 | 2022-11-22 14:32:14 -0800 | [diff] [blame] | 927 | # globs() for arm only |
| 928 | filegroup( |
| 929 | name = "all_headers_allowlist_arm_globs", |
| 930 | srcs = glob(["arch/arm/include/**/*.h"]), |
| 931 | visibility = ["//visibility:private"], |
| 932 | ) |
| 933 | |
| Alistair Delva | 93e1118 | 2022-12-08 13:20:51 -0800 | [diff] [blame] | 934 | # globs() for riscv64 only |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 935 | filegroup( |
| Alistair Delva | 93e1118 | 2022-12-08 13:20:51 -0800 | [diff] [blame] | 936 | name = "all_headers_allowlist_riscv64_globs", |
| 937 | srcs = glob(["arch/riscv/include/**/*.h"]), |
| Yifan Hong | 4d71819 | 2022-10-28 16:55:44 -0700 | [diff] [blame] | 938 | visibility = ["//visibility:private"], |
| 939 | ) |
| 940 | |
| 941 | # globs() for x86 only |
| 942 | filegroup( |
| 943 | name = "all_headers_allowlist_x86_64_globs", |
| 944 | srcs = glob(["arch/x86/include/**/*.h"]), |
| 945 | visibility = ["//visibility:private"], |
| 946 | ) |
| 947 | |
| 948 | # globs() for all architectures |
| 949 | filegroup( |
| 950 | name = "all_headers_allowlist_common_globs", |
| 951 | srcs = glob(["include/**/*.h"]), |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 952 | visibility = ["//visibility:private"], |
| 953 | ) |
| 954 | |
| 955 | # DDK headers unsafe list. This is the list of all headers and include |
| 956 | # directories that may be used during migration from kernel_module's, but |
| 957 | # should be avoided in general. |
| 958 | # Use with caution; items may: |
| 959 | # - be removed without notice |
| 960 | # - be moved into all_headers |
| 961 | ddk_headers( |
| 962 | name = "all_headers_unsafe", |
| Yifan Hong | a08c2979 | 2022-10-21 23:07:21 -0700 | [diff] [blame] | 963 | hdrs = [ |
| 964 | "drivers/gpu/drm/virtio/virtgpu_trace.h", |
| 965 | ], |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 966 | # The list of include directories where source files can #include headers |
| 967 | # from. In other words, these are the `-I` option to the C compiler. |
| Yifan Hong | a4c2687 | 2022-11-03 16:12:31 -0700 | [diff] [blame] | 968 | # Unsafe include directories are appended to ccflags-y. |
| Yifan Hong | 45d94b7 | 2022-10-11 23:07:33 -0700 | [diff] [blame] | 969 | includes = [], |
| 970 | visibility = ["//visibility:private"], |
| 971 | ) |