diff --git a/sys-kernel/asahi-kernel/Manifest b/sys-kernel/asahi-kernel/Manifest index 8aa0735d..7b7dece4 100644 --- a/sys-kernel/asahi-kernel/Manifest +++ b/sys-kernel/asahi-kernel/Manifest @@ -1,3 +1,5 @@ DIST asahi-kernel-6.6.0_p16.tar.gz 229861406 BLAKE2B e8f90373fe3cfb0ee8824158c59d548af05d1e68626715a65dcf086b35cfe7f4d44b184f02bbfad33474040b86f488e4fa99c8886ae329cf138933161658f94c SHA512 fc62cf346b95229aa31bc1483c9fcffaeacf94d09d13801a3e8e50ed3ba7f3d1b1d4dd8083051879955e1f99bffa61bf411cd38fcc45e176d372fc1d205b9c76 DIST gentoo-kernel-config-g11.tar.gz 5077 BLAKE2B dc17ded74f79baddd703a78084113b85e7130877b300b5fe60453cde515fe37c52ece7877049bb0ef384f74ecfc73d59d7d4a513f8fef7bf4f651599946383e8 SHA512 e91156765ef2a48396370f884fdecd7bb1d600e5167f6bad51130520f886e9198adae375adf3e40fa803abc5d5482057775fb0275ab2589bd8f94d8af4a03c4e DIST kernel-aarch64-16k-fedora.config-6.6.3-414-gentoo 272164 BLAKE2B 27de91eb46c467015d18eac1fe3c96c71112caae73c9818ee4a5c476f57732e7a7b1fd18feaf008e61d1fc775e1b1cb32b32c0fdda3b3ebfeb8e6f7e79a34e6d SHA512 e4196f46f92e5c8d0e681d42fe6392ac2a150530a71e189d7abeff877c76a0a86c4619d794f181ea784f12ad0a1d1f6d639bbcd4209396436b03b5baa4d6998b +DIST kernel-aarch64-16k-fedora.config-6.8.7-402-gentoo 279185 BLAKE2B 84ce67080186723d9a8a47141d7a66e031fc39f6f02ac55352f34e05e7d5a288354c046fb87a8c21b04870736ec0d813173a05cefa7a24598d07fd30393b36a7 SHA512 ff8e0ac754ade12fcdfe96fa98318c8b42e21da3ed165ed28808752212f0507a0d94e4a0b54ee992a307577e02a10696d3a0cd2d74cfa9840eb634bbbd3217fe +DIST linux-asahi-6.8.6-3.tar.gz 235240335 BLAKE2B 399ba72e6f856581d47fec48625d7371f793c99fe39b9b82cbaa1f8a397be478209d3760d8efbbf263e12bb5e4e4e699a0d0f543303b9bc980f98f5c066b35de SHA512 3a4bc2ca30ca20ba930108569be306242915af729f3385d7559e72910d611f3f15f5f39ec1a083060c448829fbd796e00618edb5681708cca1ba0d323579221a diff --git a/sys-kernel/asahi-kernel/asahi-kernel-6.8.6_p3.ebuild b/sys-kernel/asahi-kernel/asahi-kernel-6.8.6_p3.ebuild new file mode 100644 index 00000000..3a51fcfa --- /dev/null +++ b/sys-kernel/asahi-kernel/asahi-kernel-6.8.6_p3.ebuild @@ -0,0 +1,131 @@ +# Copyright 2023-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="8" +K_SECURITY_UNSUPPORTED="1" +ETYPE="sources" +#K_WANT_GENPATCHES="base extras experimental" +#K_GENPATCHES_VER="5" +K_NODRYRUN="1" + +inherit kernel-build + +if [[ ${PV} != ${PV/_rc} ]] ; then + # $PV is expected to be of following form: 6.0_rc5_p1 + MY_TAG="$(ver_cut 6)" + MY_P="asahi-$(ver_rs 2 - $(ver_cut 1-4))-${MY_TAG}" +else + # $PV is expected to be of following form: 5.19.0_p1 + MY_TAG="$(ver_cut 5)" + if [[ "$(ver_cut 3)" == "0" ]] ; then + MY_P="asahi-$(ver_cut 1-2)-${MY_TAG}" + else + MY_P="asahi-$(ver_cut 1-3)-${MY_TAG}" + fi +fi +CONFIG_VER=6.8.7-402-gentoo +GENTOO_CONFIG_VER=g11 +FEDORA_CONFIG_DISTGIT="copr-dist-git.fedorainfracloud.org/cgit/@asahi/kernel" +# FEDORA_CONFIG_DISTGIT="copr-dist-git.fedorainfracloud.org/cgit/ngompa/fedora-asahi-dev" +FEDORA_CONFIG_SHA1=647ffd915dc8351fd69790ee708b1ae8638ccc95 + +DESCRIPTION="Asahi Linux kernel sources" +HOMEPAGE="https://asahilinux.org" +KERNEL_URI="https://github.com/AsahiLinux/linux/archive/refs/tags/${MY_P}.tar.gz -> linux-${MY_P}.tar.gz" +SRC_URI="${KERNEL_URI} + https://github.com/projg2/gentoo-kernel-config/archive/${GENTOO_CONFIG_VER}.tar.gz + -> gentoo-kernel-config-${GENTOO_CONFIG_VER}.tar.gz + https://${FEDORA_CONFIG_DISTGIT}/kernel.git/plain/kernel-aarch64-16k-fedora.config?id=${FEDORA_CONFIG_SHA1} + -> kernel-aarch64-16k-fedora.config-${CONFIG_VER} +" + +S="${WORKDIR}/linux-${MY_P}" + +LICENSE="GPL-2" +KEYWORDS="~arm64" + +IUSE="debug" + +# Rust is non-negotiable for the dist kernel +DEPEND=" + ${DEPEND} + virtual/rust + || ( + >=dev-lang/rust-bin-1.76[rust-src,rustfmt] + >=dev-lang/rust-1.76[rust-src,rustfmt] + ) + dev-util/bindgen + debug? ( dev-util/pahole ) +" + +PDEPEND=" + ~virtual/dist-kernel-${PV} +" + +QA_FLAGS_IGNORED=" + usr/src/linux-.*/scripts/gcc-plugins/.*.so + usr/src/linux-.*/vmlinux + usr/src/linux-.*/arch/powerpc/kernel/vdso.*/vdso.*.so.dbg +" + +PATCHES=( + "${FILESDIR}/${PN}-$(ver_cut 1-2)-enable-speakers.patch" +) + +src_prepare() { + default + + # prepare the default config + cp "${DISTDIR}/kernel-aarch64-16k-fedora.config-${CONFIG_VER}" ".config" || die + + # ensure a consistant version across kernel and gentoo + # this passes the ${PV}-as-release check in kernel-install_pkg_preinst() + # override "-asahi" in localversion.05-asahi with "_pX" to override the + # kernel's base varsion to gentoo's ${PV} + echo "-p${MY_TAG}" > localversion.05-asahi + # use CONFIG_LOCALVERSION to provide "asahi" and "dist" annotations. + local myversion="-asahi-dist" + echo "CONFIG_LOCALVERSION=\"${myversion}\"" > "${T}"/version.config || die + local dist_conf_path="${WORKDIR}/gentoo-kernel-config-${GENTOO_CONFIG_VER}" + + local merge_configs=( + "${T}"/version.config + "${dist_conf_path}"/base.config + ) + use debug || merge_configs+=( + "${dist_conf_path}"/no-debug.config + ) + + # deselect all non APPLE arm64 ARCHs + merge_configs+=( + "${FILESDIR}"/linux-$(ver_cut 1-2)_arm64_deselect_non_apple_arch.config + ) + # adjust base config for Apple silicon systems + merge_configs+=( + "${FILESDIR}"/linux-$(ver_cut 1-2)_arch_apple_overrides.config + ) + + kernel-build_merge_configs "${merge_configs[@]}" +} + +src_install() { + # call kernel-build's scr_install + kernel-build_src_install + + # symlink installed *.dtbs back into kernel "source" directory + local dir_ver=${PV}${KV_LOCALVERSION} + local kernel_dir=/usr/src/linux-${dir_ver} + local relfile=${ED}${kernel_dir}/include/config/kernel.release + local module_ver + module_ver=$(<"${relfile}") || die + + for dtb in /boot/dtbs/${module_ver}/apple/*.dtb; do + dosym ${dtb} /${kernel_dir}/arch/arm64/boot/dts/apple/$(basename ${dtb}) + done +} + +pkg_postinst() { + einfo "For more information about Asahi Linux please visit ${HOMEPAGE}," + einfo "or consult the Wiki at https://github.com/AsahiLinux/docs/wiki." + kernel-build_pkg_postinst +} diff --git a/sys-kernel/asahi-kernel/files/asahi-kernel-6.8-enable-speakers.patch b/sys-kernel/asahi-kernel/files/asahi-kernel-6.8-enable-speakers.patch new file mode 100644 index 00000000..8ce6df53 --- /dev/null +++ b/sys-kernel/asahi-kernel/files/asahi-kernel-6.8-enable-speakers.patch @@ -0,0 +1,125 @@ +From 385ea7b5023486aba7919cec8b6b3f6a843a1013 Mon Sep 17 00:00:00 2001 +From: Hector Martin +Date: Fri, 15 Dec 2023 20:38:32 +0900 +Subject: [PATCH] READ COMMIT MESSAGE! macaudio: Enable first round of models + +Enables j313, j293, j493, j314, j414, j274, j375, j473, j474, j475 + +*** WARNING FOR DISTRO PACKAGERS WANTING TO APPLY THIS: *** +*** YOU ABSOLUTELY NEED THIS PATCH IN YOUR LSP-PLUGINS PACKAGE *** + +https://github.com/lsp-plugins/lsp-dsp-lib/pull/20 + +Do NOT enable speakers without that patch, on any model. It can/will +result in nasty noise that could damage them. + +Signed-off-by: Hector Martin +--- + sound/soc/apple/macaudio.c | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +diff --git a/sound/soc/apple/macaudio.c b/sound/soc/apple/macaudio.c +index f5b349057a67e1..d2ced87e88c0e1 100644 +--- a/sound/soc/apple/macaudio.c ++++ b/sound/soc/apple/macaudio.c +@@ -1490,23 +1490,27 @@ struct macaudio_platform_cfg macaudio_j180_cfg = { + false, AMP_SN012776, SPKR_1W1T, false, 10, -20, + }; + struct macaudio_platform_cfg macaudio_j274_cfg = { +- false, AMP_TAS5770, SPKR_1W, false, 20, -20, ++ true, AMP_TAS5770, SPKR_1W, false, 20, -20, + }; + + struct macaudio_platform_cfg macaudio_j293_cfg = { +- false, AMP_TAS5770, SPKR_2W, true, 15, -20, ++ true, AMP_TAS5770, SPKR_2W, true, 15, -20, + }; + + struct macaudio_platform_cfg macaudio_j313_cfg = { +- false, AMP_TAS5770, SPKR_1W, true, 10, -20, ++ true, AMP_TAS5770, SPKR_1W, true, 10, -20, + }; + +-struct macaudio_platform_cfg macaudio_j314_j316_cfg = { ++struct macaudio_platform_cfg macaudio_j314_cfg = { ++ true, AMP_SN012776, SPKR_2W1T, true, 15, -20, ++}; ++ ++struct macaudio_platform_cfg macaudio_j316_cfg = { + false, AMP_SN012776, SPKR_2W1T, true, 15, -20, + }; + + struct macaudio_platform_cfg macaudio_j37x_j47x_cfg = { +- false, AMP_SN012776, SPKR_1W, false, 20, -20, ++ true, AMP_SN012776, SPKR_1W, false, 20, -20, + }; + + struct macaudio_platform_cfg macaudio_j413_cfg = { +@@ -1522,7 +1526,7 @@ struct macaudio_platform_cfg macaudio_j45x_cfg = { + }; + + struct macaudio_platform_cfg macaudio_j493_cfg = { +- false, AMP_SN012776, SPKR_2W, true, 15, -20, ++ true, AMP_SN012776, SPKR_2W, true, 15, -20, + }; + + struct macaudio_platform_cfg macaudio_fallback_cfg = { +@@ -1558,9 +1562,9 @@ static const struct of_device_id macaudio_snd_device_id[] = { + /* j313 AID4 tas5770 10 2× 1W */ + { .compatible = "apple,j313-macaudio", .data = &macaudio_j313_cfg }, + /* j314 AID8 sn012776 15 2× 2W+1T */ +- { .compatible = "apple,j314-macaudio", .data = &macaudio_j314_j316_cfg }, ++ { .compatible = "apple,j314-macaudio", .data = &macaudio_j314_cfg }, + /* j316 AID9 sn012776 15 2× 2W+1T */ +- { .compatible = "apple,j316-macaudio", .data = &macaudio_j314_j316_cfg }, ++ { .compatible = "apple,j316-macaudio", .data = &macaudio_j316_cfg }, + /* j375 AID10 sn012776 15 1× 1W */ + { .compatible = "apple,j375-macaudio", .data = &macaudio_j37x_j47x_cfg }, + /* j413 AID13 sn012776 15 2× 1W+1T */ +From 6a24102c06c95951ab992e2d41336cc6d4bfdf23 Mon Sep 17 00:00:00 2001 +From: Hector Martin +Date: Fri, 15 Dec 2023 20:40:53 +0900 +Subject: [PATCH] READ COMMIT MESSAGE! macaudio: Enable second round of models + +Enables j316, j413, j415, j416 + +*** WARNING FOR DISTRO PACKAGERS WANTING TO APPLY THIS: *** +*** YOU ABSOLUTELY NEED THIS PATCH IN YOUR LSP-PLUGINS PACKAGE *** + +https://github.com/lsp-plugins/lsp-dsp-lib/pull/20 + +Do NOT enable speakers without that patch, on any model. It can/will +result in nasty noise that could damage them. + +Signed-off-by: Hector Martin +--- + sound/soc/apple/macaudio.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/apple/macaudio.c b/sound/soc/apple/macaudio.c +index d2ced87e88c0e1..f347f08b7ad01e 100644 +--- a/sound/soc/apple/macaudio.c ++++ b/sound/soc/apple/macaudio.c +@@ -1506,7 +1506,7 @@ struct macaudio_platform_cfg macaudio_j314_cfg = { + }; + + struct macaudio_platform_cfg macaudio_j316_cfg = { +- false, AMP_SN012776, SPKR_2W1T, true, 15, -20, ++ true, AMP_SN012776, SPKR_2W1T, true, 15, -20, + }; + + struct macaudio_platform_cfg macaudio_j37x_j47x_cfg = { +@@ -1514,11 +1514,11 @@ struct macaudio_platform_cfg macaudio_j37x_j47x_cfg = { + }; + + struct macaudio_platform_cfg macaudio_j413_cfg = { +- false, AMP_SN012776, SPKR_1W1T, true, 15, -20, ++ true, AMP_SN012776, SPKR_1W1T, true, 15, -20, + }; + + struct macaudio_platform_cfg macaudio_j415_cfg = { +- false, AMP_SN012776, SPKR_2W1T, true, 15, -20, ++ true, AMP_SN012776, SPKR_2W1T, true, 15, -20, + }; + + struct macaudio_platform_cfg macaudio_j45x_cfg = { diff --git a/sys-kernel/asahi-kernel/files/linux-6.8_arch_apple_overrides.config b/sys-kernel/asahi-kernel/files/linux-6.8_arch_apple_overrides.config new file mode 100644 index 00000000..b16c25de --- /dev/null +++ b/sys-kernel/asahi-kernel/files/linux-6.8_arch_apple_overrides.config @@ -0,0 +1,10 @@ +## prefer simpledrm over frame buffer drivers +CONFIG_DRM_SIMPLEDRM=y +# CONFIG_FB_EFI is not set +# CONFIG_FB_VESA is not set + +## enable EFI_ZBOOT for systemd-boot support +CONFIG_EFI_ZBOOT=y + +## no ACPI on Apple silicon systems +# CONFIG_ACPI_EXTLOG is not set diff --git a/sys-kernel/asahi-kernel/files/linux-6.8_arm64_deselect_non_apple_arch.config b/sys-kernel/asahi-kernel/files/linux-6.8_arm64_deselect_non_apple_arch.config new file mode 100644 index 00000000..69dfc80d --- /dev/null +++ b/sys-kernel/asahi-kernel/files/linux-6.8_arm64_deselect_non_apple_arch.config @@ -0,0 +1,43 @@ +# CONFIG_ARCH_ACTIONS is not set +# CONFIG_ARCH_SUNXI is not set +# CONFIG_ARCH_ALPINE is not set +# CONFIG_ARCH_BCM is not set +# CONFIG_ARCH_BCM2835 is not set +# CONFIG_ARCH_BCM_IPROC is not set +# CONFIG_ARCH_BCMBCA is not set +# CONFIG_ARCH_BRCMSTB is not set +# CONFIG_ARCH_BERLIN is not set +# CONFIG_ARCH_BITMAIN is not set +# CONFIG_ARCH_EXYNOS is not set +# CONFIG_ARCH_SPARX5 is not set +# CONFIG_ARCH_K3 is not set +# CONFIG_ARCH_LG1K is not set +# CONFIG_ARCH_HISI is not set +# CONFIG_ARCH_KEEMBAY is not set +# CONFIG_ARCH_MEDIATEK is not set +# CONFIG_ARCH_MESON is not set +# CONFIG_ARCH_MVEBU is not set +# CONFIG_ARCH_NXP is not set +# CONFIG_ARCH_LAYERSCAPE is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_S32 is not set +# CONFIG_ARCH_MA35 is not set +# CONFIG_ARCH_NPCM is not set +# CONFIG_ARCH_PENSANDO is not set +# CONFIG_ARCH_QCOM is not set +# CONFIG_ARCH_REALTEK is not set +# CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_ROCKCHIP is not set +# CONFIG_ARCH_SEATTLE is not set +# CONFIG_ARCH_INTEL_SOCFPGA is not set +# CONFIG_ARCH_STM32 is not set +# CONFIG_ARCH_SYNQUACER is not set +# CONFIG_ARCH_TEGRA is not set +# CONFIG_ARCH_SPRD is not set +# CONFIG_ARCH_THUNDER is not set +# CONFIG_ARCH_THUNDER2 is not set +# CONFIG_ARCH_UNIPHIER is not set +# CONFIG_ARCH_VEXPRESS is not set +# CONFIG_ARCH_VISCONTI is not set +# CONFIG_ARCH_XGENE is not set +# CONFIG_ARCH_ZYNQMP is not set