Skip to content

Instantly share code, notes, and snippets.

@macromorgan
Created March 26, 2024 13:31
Show Gist options
  • Save macromorgan/1995d08c0e85cdd2440ccdd4a2c8d236 to your computer and use it in GitHub Desktop.
Save macromorgan/1995d08c0e85cdd2440ccdd4a2c8d236 to your computer and use it in GitHub Desktop.
RGxx3 Android Kernel Attempt - Take 1
load("//build/bazel_common_rules/dist:dist.bzl", "copy_to_dist_dir")
load("//build/kernel/kleaf:kernel.bzl", "kernel_build", "kernel_images", "kernel_modules_install")
load("//common:modules.bzl", "get_gki_modules_list")
load("//build/kernel/kleaf:common_kernels.bzl", "define_common_kernels")
_RGXX3_MODULE_OUTS = [
"sound/soc/generic/snd-soc-simple-card-utils.ko",
"drivers/input/misc/pwm-vibra.ko",
"drivers/gpu/drm/panel/panel-newvision-nv3051d.ko",
"drivers/char/hw_random/optee-rng.ko",
"drivers/cpufreq/cpufreq-dt.ko",
"drivers/net/wireless/realtek/rtw88/rtw88_8821c.ko",
"drivers/gpu/drm/bridge/synopsys/dw-hdmi.ko",
"drivers/tee/optee/optee.ko",
"drivers/input/keyboard/adc-keys.ko",
"drivers/gpu/drm/display/drm_display_helper.ko",
"drivers/phy/rockchip/phy-rockchip-inno-usb2.ko",
"sound/soc/rockchip/snd-soc-rockchip-pdm.ko",
"drivers/mmc/core/pwrseq_simple.ko",
"drivers/bluetooth/btrtl.ko",
"drivers/spi/spi-rockchip.ko",
"drivers/net/wireless/realtek/rtw88/rtw88_core.ko",
"drivers/clk/clk-scmi.ko",
"sound/soc/generic/snd-soc-audio-graph-card2.ko",
"drivers/gpu/drm/panel/panel-himax-hx8394.ko",
"sound/soc/codecs/snd-soc-rk817.ko",
"drivers/pinctrl/pinctrl-rk805.ko",
"drivers/video/backlight/led_bl.ko",
"sound/soc/rockchip/snd-soc-rockchip-i2s-tdm.ko",
"drivers/cpufreq/cpufreq-dt-platdev.ko",
"drivers/clk/clk-rk808.ko",
"drivers/mmc/host/dw_mmc-rockchip.ko",
"drivers/net/wireless/realtek/rtw88/rtw88_sdio.ko",
"sound/soc/codecs/snd-soc-es8328.ko",
"drivers/net/usb/lan78xx.ko",
"drivers/rtc/rtc-rk808.ko",
"drivers/gpu/drm/drm_dma_helper.ko",
"drivers/mfd/rk8xx-i2c.ko",
"drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.ko",
"drivers/iio/buffer/kfifo_buf.ko",
"drivers/tee/tee.ko",
"drivers/regulator/fan53555.ko",
"sound/soc/codecs/snd-soc-hdmi-codec.ko",
"drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.ko",
"drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.ko",
"drivers/input/touchscreen/goodix_ts.ko",
"sound/soc/generic/snd-soc-simple-card.ko",
"drivers/iio/buffer/industrialio-triggered-buffer.ko",
"drivers/thermal/rockchip_thermal.ko",
"drivers/i2c/busses/i2c-rk3x.ko",
"drivers/input/touchscreen/hynitron_cstxxx.ko",
"drivers/nvmem/nvmem_rockchip_efuse.ko",
"drivers/media/v4l2-core/v4l2-h264.ko",
"drivers/mmc/host/dw_mmc-pltfm.ko",
"drivers/media/v4l2-core/v4l2-vp9.ko",
"drivers/pwm/pwm-rockchip.ko",
"drivers/phy/rockchip/phy-rockchip-inno-csidphy.ko",
"sound/soc/codecs/snd-soc-es8328-spi.ko",
"drivers/soc/rockchip/io-domain.ko",
"drivers/gpu/drm/drm_mipi_dbi.ko",
"drivers/iio/adc/rockchip_saradc.ko",
"drivers/net/phy/microchip.ko",
"drivers/net/phy/smsc.ko",
"drivers/spi/spi-rockchip-sfc.ko",
"drivers/leds/leds-pwm.ko",
"drivers/regulator/rk808-regulator.ko",
"drivers/net/usb/dm9601.ko",
"drivers/video/backlight/pwm_bl.ko",
"drivers/usb/host/ohci-hcd.ko",
"drivers/net/usb/smsc75xx.ko",
"drivers/mfd/rk8xx-core.ko",
"drivers/mmc/host/sdhci-of-arasan.ko",
"drivers/phy/rockchip/phy-rockchip-usb.ko",
"sound/soc/rockchip/snd-soc-rockchip-spdif.ko",
"drivers/nvdimm/of_pmem.ko",
"drivers/mfd/rk8xx-spi.ko",
"drivers/input/joystick/adc-joystick.ko",
"drivers/mmc/host/sdhci-of-dwcmshc.ko",
"drivers/regulator/gpio-regulator.ko",
"drivers/gpu/drm/panel/panel-sitronix-st7703.ko",
"drivers/gpu/drm/panel/panel-sitronix-st7701.ko",
"drivers/gpu/drm/scheduler/gpu-sched.ko",
"drivers/power/supply/rk817_charger.ko",
"sound/soc/rockchip/snd-soc-rockchip-i2s.ko",
"drivers/gpu/drm/rockchip/rockchipdrm.ko",
"drivers/mmc/host/dw_mmc.ko",
"drivers/gpu/drm/panfrost/panfrost.ko",
"sound/soc/codecs/snd-soc-es8328-i2c.ko",
"drivers/watchdog/dw_wdt.ko",
"drivers/usb/host/ohci-platform.ko",
"drivers/staging/media/rkvdec/rockchip-vdec.ko",
"sound/soc/rockchip/snd-soc-rk3288-hdmi-analog.ko",
"drivers/phy/rockchip/phy-rockchip-naneng-combphy.ko",
"drivers/leds/leds-gpio.ko",
"drivers/net/usb/smsc95xx.ko",
"sound/soc/generic/snd-soc-audio-graph-card.ko",
"drivers/phy/rockchip/phy-rockchip-inno-dsidphy.ko",
"drivers/dma/pl330.ko",
"drivers/nvmem/nvmem-rockchip-otp.ko",
"drivers/phy/rockchip/phy-rockchip-inno-hdmi.ko",
"drivers/mmc/host/cqhci.ko",
"drivers/iio/buffer/industrialio-buffer-cb.ko",
"drivers/net/wireless/realtek/rtw88/rtw88_8821cs.ko",
]
kernel_build(
name = "rgxx3",
srcs = glob(
["**"],
exclude = [
"**/.*",
"**/.*/**",
"**/BUILD.bazel",
"**/*.bzl",
],
) + ["//common:kernel_aarch64_sources"],
outs = [
"Image",
"System.map",
"modules.builtin",
"modules.builtin.modinfo",
"arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dtb",
"vmlinux",
"vmlinux.symvers",
],
build_config = "//rgxx3:build.config.rgxx3",
# kmi_symbol_list_strict_mode = False,
make_goals = [
"Image",
"modules",
"rockchip/rk3566-anbernic-rg353p.dtb",
],
module_outs = get_gki_modules_list("arm64") + _RGXX3_MODULE_OUTS,
# strip_modules = False,
# trim_nonlisted_kmi = False,
)
copy_to_dist_dir(
name = "rgxx3_dist",
data = [
":rgxx3",
":rgxx3_images",
":rgxx3_modules_install",
],
dist_dir = "out/dist",
flat = True,
)
kernel_images(
name = "rgxx3_images",
build_initramfs = True,
kernel_build = "//rgxx3:rgxx3",
kernel_modules_install = "//rgxx3:rgxx3_modules_install",
)
kernel_modules_install(
name = "rgxx3_modules_install",
kernel_build = "//rgxx3:rgxx3",
)
KERNEL_DIR=common
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.common
. ${ROOT_DIR}/${KERNEL_DIR}/build.config.aarch64
TRIM_NONLISTED_KMI=""
KMI_SYMBOL_LIST_STRICT_MODE=""
BUILD_INITRAMFS=1
LZ4_RAMDISK=1
DEFCONFIG=rgxx3_gki_defconfig
FRAGMENT_CONFIG=rgxx3/rgxx3_gki.fragment
PRE_DEFCONFIG_CMDS="KCONFIG_CONFIG=${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG} ${ROOT_DIR}/${KERNEL_DIR}/scripts/kconfig/merge_config.sh -m -r ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/gki_defconfig ${ROOT_DIR}/${FRAGMENT_CONFIG}"
POST_DEFCONFIG_CMDS="rm ${ROOT_DIR}/${KERNEL_DIR}/arch/arm64/configs/${DEFCONFIG}"
FILES="
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dtb
"
CONFIG_ARCH_ROCKCHIP=y
CONFIG_BACKLIGHT_LED=m
CONFIG_BACKLIGHT_PWM=m
CONFIG_BT_HCIUART_3WIRE=y
CONFIG_BT_HCIUART_RTL=y
CONFIG_BT_RTL=m
CONFIG_CHARGER_RK817=m
# CONFIG_CLK_PX30 is not set
# CONFIG_CLK_RK3036 is not set
# CONFIG_CLK_RK312X is not set
# CONFIG_CLK_RK3188 is not set
# CONFIG_CLK_RK322X is not set
# CONFIG_CLK_RK3288 is not set
# CONFIG_CLK_RK3308 is not set
# CONFIG_CLK_RK3328 is not set
# CONFIG_CLK_RK3368 is not set
# CONFIG_CLK_RK3399 is not set
# CONFIG_CLK_RK3588 is not set
# CONFIG_CLK_RV110X is not set
CONFIG_COMMON_CLK_RK808=m
CONFIG_COMMON_CLK_SCMI=m
CONFIG_CPUFREQ_DT=m
CONFIG_DRM_DW_HDMI_I2S_AUDIO=m
CONFIG_DRM_MIPI_DBI=m
CONFIG_DRM_PANEL_HIMAX_HX8394=m
CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966=m
CONFIG_DRM_PANEL_NEWVISION_NV3051D=m
CONFIG_DRM_PANEL_SITRONIX_ST7701=m
CONFIG_DRM_PANEL_SITRONIX_ST7703=m
CONFIG_DRM_PANFROST=m
CONFIG_DRM_ROCKCHIP=m
CONFIG_DRM_SCHED=m
# CONFIG_DWMAC_GENERIC is not set
# CONFIG_DWMAC_IPQ806X is not set
# CONFIG_DWMAC_QCOM_ETHQOS is not set
# CONFIG_DWMAC_SUN8I is not set
# CONFIG_DWMAC_SUNXI is not set
CONFIG_DW_WATCHDOG=m
CONFIG_HW_RANDOM_OPTEE=m
CONFIG_I2C_RK3X=m
CONFIG_IIO_BUFFER_CB=m
CONFIG_INPUT_PWM_VIBRA=m
CONFIG_JOYSTICK_ADC=m
CONFIG_KEYBOARD_ADC=m
CONFIG_LEDS_GPIO=m
CONFIG_LEDS_PWM=m
CONFIG_MFD_CORE=m
CONFIG_MFD_RK8XX_I2C=m
CONFIG_MFD_RK8XX_SPI=m
CONFIG_MICROCHIP_PHY=m
CONFIG_MMC_CQHCI=m
CONFIG_MMC_DW=m
CONFIG_MMC_DW_ROCKCHIP=m
CONFIG_MMC_SDHCI_OF_ARASAN=m
CONFIG_MMC_SDHCI_OF_DWCMSHC=m
CONFIG_ND_BTT=m
CONFIG_NO_IOPORT_MAP=y
CONFIG_NVMEM_ROCKCHIP_EFUSE=m
CONFIG_NVMEM_ROCKCHIP_OTP=m
CONFIG_OF_PMEM=m
CONFIG_OPTEE=m
# CONFIG_OPTEE_INSECURE_LOAD_IMAGE is not set
CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY=m
CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=m
CONFIG_PHY_ROCKCHIP_INNO_HDMI=m
CONFIG_PHY_ROCKCHIP_INNO_USB2=m
CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=m
CONFIG_PHY_ROCKCHIP_USB=m
CONFIG_PINCTRL_RK805=m
CONFIG_PL330_DMA=m
CONFIG_PWM_ROCKCHIP=m
CONFIG_PWRSEQ_SIMPLE=m
CONFIG_REGULATOR_FAN53555=m
CONFIG_REGULATOR_GPIO=m
CONFIG_REGULATOR_RK808=m
CONFIG_REGULATOR_RK8XX=m
CONFIG_ROCKCHIP_DW_HDMI=y
CONFIG_ROCKCHIP_DW_MIPI_DSI=y
CONFIG_ROCKCHIP_EFUSE=m
CONFIG_ROCKCHIP_IODOMAIN=m
CONFIG_ROCKCHIP_IOMMU=y
CONFIG_ROCKCHIP_MBOX=y
CONFIG_ROCKCHIP_PM_DOMAINS=y
CONFIG_ROCKCHIP_SARADC=m
CONFIG_ROCKCHIP_THERMAL=m
CONFIG_ROCKCHIP_VOP2=y
# CONFIG_RTC_DRV_OPTEE is not set
CONFIG_RTC_DRV_RK808=m
# CONFIG_RTL8187 is not set
# CONFIG_RTL8XXXU is not set
# CONFIG_RTL_CARDS is not set
CONFIG_RTW88=m
# CONFIG_RTW88_8723DS is not set
# CONFIG_RTW88_8723DU is not set
CONFIG_RTW88_8821C=m
CONFIG_RTW88_8821CS=m
# CONFIG_RTW88_8821CU is not set
# CONFIG_RTW88_8822BS is not set
# CONFIG_RTW88_8822BU is not set
# CONFIG_RTW88_8822CS is not set
# CONFIG_RTW88_8822CU is not set
CONFIG_RTW88_CORE=m
# CONFIG_RTW88_DEBUG is not set
# CONFIG_RTW88_DEBUGFS is not set
CONFIG_RTW88_SDIO=m
# CONFIG_RTW89 is not set
CONFIG_SMSC_PHY=m
CONFIG_SND_AUDIO_GRAPH_CARD=m
CONFIG_SND_AUDIO_GRAPH_CARD2=m
# CONFIG_SND_AUDIO_GRAPH_CARD2_CUSTOM_SAMPLE is not set
CONFIG_SND_SIMPLE_CARD=m
CONFIG_SND_SIMPLE_CARD_UTILS=m
CONFIG_SND_SOC_ES8328=m
CONFIG_SND_SOC_ES8328_I2C=m
CONFIG_SND_SOC_ES8328_SPI=m
CONFIG_SND_SOC_HDMI_CODEC=m
CONFIG_SND_SOC_RK3288_HDMI_ANALOG=m
# CONFIG_SND_SOC_RK3399_GRU_SOUND is not set
CONFIG_SND_SOC_RK817=m
CONFIG_SND_SOC_ROCKCHIP=m
CONFIG_SND_SOC_ROCKCHIP_I2S=m
CONFIG_SND_SOC_ROCKCHIP_I2S_TDM=m
# CONFIG_SND_SOC_ROCKCHIP_MAX98090 is not set
CONFIG_SND_SOC_ROCKCHIP_PDM=m
# CONFIG_SND_SOC_ROCKCHIP_RT5645 is not set
CONFIG_SND_SOC_ROCKCHIP_SPDIF=m
CONFIG_SPI_ROCKCHIP=m
CONFIG_SPI_ROCKCHIP_SFC=m
CONFIG_STAGING_MEDIA=y
# CONFIG_STAGING_MEDIA_DEPRECATED is not set
# CONFIG_SURFACE_PLATFORMS is not set
CONFIG_TEE=m
CONFIG_TOUCHSCREEN_GOODIX=m
CONFIG_TOUCHSCREEN_HYNITRON_CSTXXX=m
CONFIG_USB_LAN78XX=m
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SMSC75XX=m
CONFIG_USB_NET_SMSC95XX=m
CONFIG_USB_OHCI_HCD=m
# CONFIG_USB_OHCI_HCD_PCI is not set
CONFIG_USB_OHCI_HCD_PLATFORM=m
CONFIG_V4L2_H264=m
CONFIG_V4L2_VP9=m
# CONFIG_VHOST_MENU is not set
# CONFIG_VIDEO_MAX96712 is not set
CONFIG_VIDEO_ROCKCHIP_VDEC=m
# CONFIG_VIRTIO_MENU is not set
# CONFIG_WLAN_VENDOR_MICROCHIP is not set
# CONFIG_WLAN_VENDOR_PURELIFI is not set
CONFIG_WLAN_VENDOR_REALTEK=y
# CONFIG_WLAN_VENDOR_SILABS is not set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment