diff --git a/Android.mk b/Android.mk index 43b279f509..663968dd3b 100644 --- a/Android.mk +++ b/Android.mk @@ -1,6 +1,6 @@ # Android makefile for spu kernel modules (spcom.ko and spss_utils.ko) ifeq ($(call is-vendor-board-platform,QCOM),true) -ifeq ($(call is-board-platform-in-list,kalama pineapple),true) +ifeq ($(call is-board-platform-in-list,kalama pineapple niobe),true) # This makefile is only for DLKM ifneq ($(findstring vendor,$(LOCAL_PATH)),) diff --git a/BUILD.bazel b/BUILD.bazel index 5180288623..830d80add4 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -18,6 +18,7 @@ ddk_headers( hdrs = glob(["include/uapi/linux/*.h"]), includes = [ "include/uapi/linux", + "include/uapi", ], ) @@ -49,7 +50,8 @@ ddk_headers( ], ) -load(":target.bzl", "define_pineapple") +load(":target.bzl", "define_modules") -define_pineapple() +targets = ["pineapple", "niobe"] +define_modules(targets) diff --git a/Kbuild b/Kbuild index 015f611b6f..0018debc69 100644 --- a/Kbuild +++ b/Kbuild @@ -2,8 +2,8 @@ ifeq ($(CONFIG_QCOM_SPSS), m) - include $(SPU_ROOT)/config/gki_pineapplespu.conf - LINUXINCLUDE += -include $(SPU_ROOT)/config/gki_pineapplespuconf.h + include $(SPU_ROOT)/config/gki_spu.conf + LINUXINCLUDE += -include $(SPU_ROOT)/config/gki_spuconf.h endif LINUXINCLUDE += -I$(srctree)/../../vendor/qcom/opensource/spu-kernel/include/uapi diff --git a/config/gki_pineapplespu.conf b/config/gki_spu.conf similarity index 100% rename from config/gki_pineapplespu.conf rename to config/gki_spu.conf diff --git a/config/gki_pineapplespuconf.h b/config/gki_spuconf.h similarity index 75% rename from config/gki_pineapplespuconf.h rename to config/gki_spuconf.h index c1effba378..79bbe3e06e 100644 --- a/config/gki_pineapplespuconf.h +++ b/config/gki_spuconf.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2021, The Linux Foundation. All rights reserved. */ diff --git a/drivers/spcom.c b/drivers/spcom.c index 2a20e46bb4..84c1791c89 100644 --- a/drivers/spcom.c +++ b/drivers/spcom.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2019, 2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023,2024 Qualcomm Innovation Center, Inc. All rights reserved. */ /* @@ -2722,7 +2722,7 @@ static int spcom_ioctl_handle_lock_dmabuf_command(struct spcom_ioctl_dmabuf_lock int fd = 0; int i = 0; - spcom_pr_dbg("Lock dmabuf cmd arg: ch_name[%s], fd[%d], padding[%u], PID[%ld]\n", + spcom_pr_dbg("Lock dmabuf cmd arg: ch_name[%s], fd[%d], padding[%u], PID[%d]\n", arg->ch_name, arg->fd, arg->padding, current_pid()); ch_name = arg->ch_name; @@ -2825,7 +2825,7 @@ static int spcom_ioctl_handle_unlock_dmabuf_command(struct spcom_ioctl_dmabuf_lo int ret = 0; bool unlock_all = false; - spcom_pr_dbg("Unlock dmabuf cmd arg: ch_name[%s], fd[%d], padding[%u], PID[%ld]\n", + spcom_pr_dbg("Unlock dmabuf cmd arg: ch_name[%s], fd[%d], padding[%u], PID[%d]\n", arg->ch_name, arg->fd, arg->padding, current_pid()); ch_name = arg->ch_name; @@ -3218,12 +3218,12 @@ bool is_arg_size_expected(unsigned int cmd, uint32_t arg_size) expected_size = sizeof(struct spcom_ioctl_dmabuf_lock); break; default: - spcom_pr_err("No userspace data for ioctl cmd[%ld]\n", cmd); + spcom_pr_err("No userspace data for ioctl cmd[%d]\n", cmd); return false; } if (arg_size != expected_size) { - spcom_pr_err("Invalid cmd size: cmd[%ld], arg size[%u], expected[%u]\n", + spcom_pr_err("Invalid cmd size: cmd[%d], arg size[%u], expected[%u]\n", cmd, arg_size, expected_size); return false; } @@ -3924,7 +3924,6 @@ static int spcom_probe(struct platform_device *pdev) pr_err("Unable to create IPC log context\n"); spcom_pr_info("Driver Initialization completed ok\n"); - return 0; fail_reg_chardev: diff --git a/drivers/spss_utils.c b/drivers/spss_utils.c index 867525a16e..28ad979ff4 100644 --- a/drivers/spss_utils.c +++ b/drivers/spss_utils.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022,2024 Qualcomm Innovation Center, Inc. All rights reserved. */ /* @@ -535,13 +535,13 @@ static long spss_utils_ioctl(struct file *file, if (size && (cmd & IOC_IN)) { if (size > sizeof(data)) { pr_err("cmd [0x%x] size [0x%x] too large\n", - cmd, size); + cmd, (unsigned int)size); return -EINVAL; } if (copy_from_user(data, (void __user *)arg, size)) { pr_err("copy_from_user() failed, cmd [0x%x] size [0x%x]\n", - cmd, size); + cmd, (unsigned int)size); return -EFAULT; } } @@ -569,7 +569,7 @@ static long spss_utils_ioctl(struct file *file, case SPSS_IOC_WAIT_FOR_EVENT: /* check input params */ if (size != sizeof(struct spss_ioc_wait_for_event)) { - pr_err("cmd [0x%x] invalid size [0x%x]\n", cmd, size); + pr_err("cmd [0x%x] invalid size [0x%x]\n", cmd, (unsigned int)size); return -EINVAL; } ret = spss_wait_for_event(req); @@ -587,7 +587,7 @@ static long spss_utils_ioctl(struct file *file, case SPSS_IOC_SIGNAL_EVENT: /* check input params */ if (size != sizeof(struct spss_ioc_signal_event)) { - pr_err("cmd [0x%x] invalid size [0x%x]\n", cmd, size); + pr_err("cmd [0x%x] invalid size [0x%x]\n", cmd, (unsigned int)size); return -EINVAL; } ret = spss_signal_event(req); @@ -604,7 +604,7 @@ static long spss_utils_ioctl(struct file *file, case SPSS_IOC_IS_EVENT_SIGNALED: /* check input params */ if (size != sizeof(struct spss_ioc_is_signaled)) { - pr_err("cmd [0x%x] invalid size [0x%x]\n", cmd, size); + pr_err("cmd [0x%x] invalid size [0x%x]\n", cmd, (unsigned int)size); return -EINVAL; } ret = spss_is_event_signaled(req); @@ -622,7 +622,7 @@ static long spss_utils_ioctl(struct file *file, case SPSS_IOC_SET_SSR_STATE: /* check input params */ if (size != sizeof(uint32_t)) { - pr_err("cmd [0x%x] invalid size [0x%x]\n", cmd, size); + pr_err("cmd [0x%x] invalid size [0x%x]\n", cmd, (unsigned int)size); return -EINVAL; } @@ -931,7 +931,7 @@ static int spss_parse_dt(struct device_node *node) /* cmac buffer after spss firmware end */ cmac_mem_addr = pil_addr + pil_size; - pr_info("iar_buf_addr [0x%08x].\n", cmac_mem_addr); + pr_info("iar_buf_addr [0x%08x].\n", (unsigned int)cmac_mem_addr); memset(saved_fw_cmac, 0xA5, sizeof(saved_fw_cmac)); memset(saved_apps_cmac, 0xA5, sizeof(saved_apps_cmac)); diff --git a/spu_driver_board.mk b/spu_driver_board.mk index 3e311761dc..444a0c585d 100644 --- a/spu_driver_board.mk +++ b/spu_driver_board.mk @@ -7,7 +7,7 @@ endif ifeq ($(SPU_DLKM_ENABLE), true) ifneq ($(TARGET_BOARD_AUTO),true) - ifeq ($(call is-board-platform-in-list, kalama pineapple),true) + ifeq ($(call is-board-platform-in-list, kalama pineapple niobe),true) BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/spcom.ko \ $(KERNEL_MODULES_OUT)/spss_utils.ko endif diff --git a/target.bzl b/target.bzl index 84c14f23a9..c1a37b91c6 100644 --- a/target.bzl +++ b/target.bzl @@ -1,9 +1,11 @@ load(":spu_modules.bzl", "spu_driver_modules") load(":spu_module_build.bzl", "define_consolidate_gki_modules") -def define_pineapple(): - define_consolidate_gki_modules( - target = "pineapple", +def define_modules(targets): + # go over all targets + for t in targets: + define_consolidate_gki_modules( + target = t, registry = spu_driver_modules, modules = [ "spcom",